@tickernelz/wardmote-ui 2026.1108.2 → 2026.1111.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccessSelectIdentity-BzNL_ZaL.js +1 -0
- package/dist/assets/ActiveAgentsPanel-CLj_ucN7.js +1 -0
- package/dist/assets/AdapterManager-8ofINbXH.js +1 -0
- package/dist/assets/AdvancedToolsRoute-dQcLG_fZ.js +39 -0
- package/dist/assets/AgentActionButtons-pRsHFtLW.js +1 -0
- package/dist/assets/AgentAvatar-EsXsSxSG.js +1 -0
- package/dist/assets/AgentBubbleActionRow-nLDgzu9o.js +1 -0
- package/dist/assets/AgentCharacter-DzxzveQH.js +2 -0
- package/dist/assets/AgentChat-DTQT-Wek.js +1 -0
- package/dist/assets/AgentChats-DztS4ACV.js +1 -0
- package/dist/assets/AgentDefaults-xGoI264I.js +1 -0
- package/dist/assets/AgentDetail-BbpgFl_G.js +38 -0
- package/dist/assets/AgentIconPicker-DHCKaIkZ.js +1 -0
- package/dist/assets/AgentIdentity-GjMQAWCv.js +1 -0
- package/dist/assets/AgentMailCredentialField-CJcF0Clw.js +1 -0
- package/dist/assets/AgentMultiSelect-ChKUNflE.js +1 -0
- package/dist/assets/AgentRoleEditor-BaT_mb8k.js +1 -0
- package/dist/assets/AgentSetupPrompt-CRMBM6wm.js +30 -0
- package/dist/assets/AgentTodoCard-BCx1biOy.js +1 -0
- package/dist/assets/Agents-BTZu-vy-.js +3 -0
- package/dist/assets/AppDetail-Bw4J28Ak.js +5 -0
- package/dist/assets/AppLogo-DTmvrLai.js +1 -0
- package/dist/assets/AppNotConnected-CBliUH8m.js +1 -0
- package/dist/assets/ApprovalCard-DKGjyQt-.js +1 -0
- package/dist/assets/ApprovalDetail-DVVR3EtT.js +1 -0
- package/dist/assets/ApprovalPayload-DekKq-IE.js +1 -0
- package/dist/assets/Approvals-CLeSmmEV.js +1 -0
- package/dist/assets/AppsConnect-C35NNIiG.js +1 -0
- package/dist/assets/AppsReview-lab3deOa.js +1 -0
- package/dist/assets/ArtifactCard-BOcWFgmA.js +1 -0
- package/dist/assets/Artifacts-DAtpWAuL.js +1 -0
- package/dist/assets/AssistantConnection-gcHktiyu.js +1 -0
- package/dist/assets/AttentionInteractionResolver-Cm0k_3MB.js +1 -0
- package/dist/assets/AuditHub-C6U9wM2v.js +1 -0
- package/dist/assets/Auth-BdXfGiLC.js +3 -0
- package/dist/assets/BoardChat-BTFAl90K.js +18 -0
- package/dist/assets/BoardClaim-Cv56WNDU.js +1 -0
- package/dist/assets/BootstrapSetupUxLab-DbE6ARGg.js +1 -0
- package/dist/assets/BreadcrumbContext-C1Pz9E0M.js +1 -0
- package/dist/assets/Browse-0mLkYDuT.js +1 -0
- package/dist/assets/BudgetPolicyCard-BwV8P4n4.js +1 -0
- package/dist/assets/CaseDetail-X0DGQoca.js +2 -0
- package/dist/assets/CaseIdentifierKey-DgiLO3Rb.js +1 -0
- package/dist/assets/Cases-gjrf6tmu.js +2 -0
- package/dist/assets/ChatEndpointDetail-Co2K-j6p.js +5 -0
- package/dist/assets/ChatEndpointSetup-XspGek-A.js +1 -0
- package/dist/assets/ChatIdentityConfirm-m3fNvAJx.js +1 -0
- package/dist/assets/ChoiceControls-Cy8E_BqQ.js +1 -0
- package/dist/assets/CliAuth-CTkJ-3kI.js +1 -0
- package/dist/assets/CommentAttributionChip-DHuPOHJh.js +1 -0
- package/dist/assets/Companies-BbbaWb0v.js +1 -0
- package/dist/assets/CompanyAccess-Dmq_cs8a.js +1 -0
- package/dist/assets/CompanyActivity-D1j2INEB.js +1 -0
- package/dist/assets/CompanyConnections-CZOQquHF.js +1 -0
- package/dist/assets/CompanyContext-BxCDBNSH.js +1 -0
- package/dist/assets/CompanyEnvironments-DDbrQrMB.js +3 -0
- package/dist/assets/CompanyExport-B0eLuNvu.js +4 -0
- package/dist/assets/CompanyImport-DbbCQEFp.js +1 -0
- package/dist/assets/CompanySettings-8ROAg5aG.js +1 -0
- package/dist/assets/CompanySettingsPluginPage-B-79nVuk.js +1 -0
- package/dist/assets/CompanySkills-BfBhMNaP.js +10 -0
- package/dist/assets/ComposerAddMenu-DBuHSmG4.js +3 -0
- package/dist/assets/ConfigureBuiltInAgentModal-BkaylF48.js +1 -0
- package/dist/assets/ConnectionSetupFlow-Dzuzx7jk.js +40 -0
- package/dist/assets/CopyText-CW3qWFPY.js +1 -0
- package/dist/assets/CopyableGatewayUrl-C8LwXvVu.js +1 -0
- package/dist/assets/CrossIssueCollaborationUxLab-BNEDnULO.js +1 -0
- package/dist/assets/Dashboard-C_87MSE2.js +2 -0
- package/dist/assets/DashboardLive-CdHY1mHk.js +1 -0
- package/dist/assets/DecisionDateChips-BckDENkn.js +1 -0
- package/dist/assets/DecisionModelSettings-DiqQ14Zd.js +1 -0
- package/dist/assets/DecisionQueuePage-BZrUoCk3.js +1 -0
- package/dist/assets/DesignGuide-B38yltct.js +23 -0
- package/dist/assets/DocumentFrameHeader-C57Py4YE.js +1 -0
- package/dist/assets/EmailConnectionAccess-CgZl2FFX.js +1 -0
- package/dist/assets/EmailEndpointSetup-Dpg3e5IP.js +1 -0
- package/dist/assets/EnforcementBanner-CqY3eZb5.js +1 -0
- package/dist/assets/EntityRow-CsMXIXXb.js +1 -0
- package/dist/assets/ExecutionWorkspaceDetail-w0tph5fx.js +19 -0
- package/dist/assets/FilterBar-BsmtWqB7.js +1 -0
- package/dist/assets/FoldCurtain-BirYTOEh.js +1 -0
- package/dist/assets/FolderControls-DfQCO8-2.js +1 -0
- package/dist/assets/GatewayDetail-Cf6WshG5.js +2 -0
- package/dist/assets/GatewaysList-C3fEQHRs.js +1 -0
- package/dist/assets/GoalDetail-B2jZMNHQ.js +1 -0
- package/dist/assets/GoalTree-Btaagjxs.js +1 -0
- package/dist/assets/Goals-0Q2Gnko1.js +1 -0
- package/dist/assets/Identity-DHk25Fo0.js +1 -0
- package/dist/assets/ImageGalleryModal-OwUAU2AO.js +1 -0
- package/dist/assets/Inbox-Bk8khlSh.js +2 -0
- package/dist/assets/InlineBanner-DnQWPYOq.js +1 -0
- package/dist/assets/InlineEditor-B-oEEW8R.js +1 -0
- package/dist/assets/InlineEntitySelector-NCqeSVBt.js +1 -0
- package/dist/assets/InstanceAccess-DyQFxK_O.js +1 -0
- package/dist/assets/InstanceAdvanced-C8uDSsPL.js +1 -0
- package/dist/assets/InstanceFeatures-CPYwZmZk.js +1 -0
- package/dist/assets/InviteLanding-o-enK_RP.js +1 -0
- package/dist/assets/IssueChatLongThreadPerf-CjaD3woT.js +2 -0
- package/dist/assets/IssueChatThread-CUlN-lN0.js +40 -0
- package/dist/assets/IssueDetail-CdKGl1_O.js +9 -0
- package/dist/assets/IssueDocumentAnnotations-DqMdyd5R.js +2 -0
- package/dist/assets/IssueOutputSection-BReOvQxZ.js +1 -0
- package/dist/assets/IssueRecoveryActionCard-DXthkoa2.js +1 -0
- package/dist/assets/IssueReferenceActivitySummary-BybOSmTQ.js +1 -0
- package/dist/assets/IssueReferencePill-Byyo3mWU.js +1 -0
- package/dist/assets/IssueThreadInteractionCard-CnGISjFd.js +9 -0
- package/dist/assets/IssueWriteDenialNotice-CFwpbsKd.js +1 -0
- package/dist/assets/Issues-BrnnvHeE.js +3 -0
- package/dist/assets/JoinRequestQueue-D2RLtri2.js +1 -0
- package/dist/assets/JsonSchemaForm-Cn579kgp.js +1 -0
- package/dist/assets/LiveNowTodoLine-DJoyO8eZ.js +1 -0
- package/dist/assets/ManagedAiConnectionDetails-DsAuL_cK.js +1 -0
- package/dist/assets/MarkdownBody-BfIbo0pr.js +16 -0
- package/dist/assets/MarkdownEditor-CCqgqbbX.js +85 -0
- package/dist/assets/McpConnect-BJhgeezW.js +1 -0
- package/dist/assets/MembershipAction-Bu1nqQYv.js +1 -0
- package/dist/assets/MetricCard-DCSvmMqn.js +1 -0
- package/dist/assets/MissingPluginTabPlaceholder-UM0Cgk9J.js +1 -0
- package/dist/assets/ModelsAndProviders-B0gYOLvd.js +1 -0
- package/dist/assets/MootMark-DpAqNyxE.js +1 -0
- package/dist/assets/NewAgent-E1cSVMu1.js +1 -0
- package/dist/assets/OmpAllSettings-fSc31cIu.js +1 -0
- package/dist/assets/OmpSignIn-BSLYU6uC.js +3 -0
- package/dist/assets/OpenwaGatewayManager-UG0cEqQK.js +2 -0
- package/dist/assets/PathInstructionsModal-CEyWg69s.js +1 -0
- package/dist/assets/PipelineSettings-CY-XoAGe.js +2 -0
- package/dist/assets/Pipelines-lSbZ6-uQ.js +1 -0
- package/dist/assets/PixelsOffice-s8WCydt9.js +2 -0
- package/dist/assets/PluginManager-BLY48Rdb.js +1 -0
- package/dist/assets/PluginPage-CIvrzBLJ.js +1 -0
- package/dist/assets/PluginSettings-DugaPtGC.js +1 -0
- package/dist/assets/ProfileDetailRoute-CY9Zo_L-.js +1 -0
- package/dist/assets/ProfileSettings-Bfeh1MlI.js +1 -0
- package/dist/assets/ProfileWizardRoute-DQ8Wf6CN.js +1 -0
- package/dist/assets/ProjectDetail-Cie7YkeD.js +1 -0
- package/dist/assets/ProjectWorkspaceDetail-4Eh2xMnt.js +29 -0
- package/dist/assets/ProjectWorkspacesContent-CAEuHcwN.js +1 -0
- package/dist/assets/Projects-B7XDgtru.js +1 -0
- package/dist/assets/PublicIssueSharePage-D7UqYVp1.js +1 -0
- package/dist/assets/QuestionForm-BexjfwBC.js +7 -0
- package/dist/assets/QuotaBar-85eAFwZM.js +1 -0
- package/dist/assets/RepositoryEditor-C783DHwy.js +1 -0
- package/dist/assets/ResponsibleUserDenialNotice-CKbMq_8f.js +1 -0
- package/dist/assets/ResponsibleUserDenialUxLab-CFDLXQbq.js +1 -0
- package/dist/assets/ReviewQueueCard-LPKXTa7p.js +1 -0
- package/dist/assets/RichWorkProductCard-BO_PVS_R.js +1 -0
- package/dist/assets/RoutineActivityRow-BAIWOkSU.js +1 -0
- package/dist/assets/RoutineDetail-CxBrkRyy.js +2 -0
- package/dist/assets/RoutineRunVariablesDialog-BmocvukK.js +1 -0
- package/dist/assets/RoutineVariablesEditor-CBxgGYWn.js +1 -0
- package/dist/assets/Routines-BOD80kz-.js +1 -0
- package/dist/assets/ScrollToBottom-MElZx9KC.js +1 -0
- package/dist/assets/Search-CBYkMobM.js +1 -0
- package/dist/assets/SearchableSelect-DF7YpkdT.js +1 -0
- package/dist/assets/Secrets-Bu6q9QVj.js +4 -0
- package/dist/assets/SetupWizard-C3-3uNXq.js +1 -0
- package/dist/assets/SidebarContext-BDwcx9eV.js +1 -0
- package/dist/assets/SidebarNavItem-BFemYMPb.js +1 -0
- package/dist/assets/SkillBinaryFile-lsCfxI4Z.js +1 -0
- package/dist/assets/SkillCardIcon-D6Sde9N1.js +2 -0
- package/dist/assets/SkillSourceTree-BCndxsNf.js +2 -0
- package/dist/assets/SkillSources-B7fG3KBv.js +2 -0
- package/dist/assets/SkillStudio-BEAfNXcI.js +9 -0
- package/dist/assets/SourceTrustBadge-BaYEFytm.js +1 -0
- package/dist/assets/StatusCards-BfwQO3yd.js +1 -0
- package/dist/assets/StatusIcon-C2NWeA8n.js +1 -0
- package/dist/assets/SummarySlotCard-CmxW3-lC.js +1 -0
- package/dist/assets/TaskChatComposerTakeoverContext-DWOxDlEu.js +1 -0
- package/dist/assets/TaskChatLab-B0aJ05Zn.js +11 -0
- package/dist/assets/TaskChatMarker-CqvZL5i4.js +2 -0
- package/dist/assets/TaskChatProtocolCard-poluyifm.js +1 -0
- package/dist/assets/TaskChatThreadView-QQeO-S6o.js +4 -0
- package/dist/assets/TaskDetailRelationsPanel-Bk1aFfQv.js +1 -0
- package/dist/assets/TaskTreeControls-CDIjiEFr.js +3 -0
- package/dist/assets/Terminal-_XGdPaFV.js +1 -0
- package/dist/assets/TerminalView-DYJK_6rV.js +58 -0
- package/dist/assets/ThemeContext-DD1EP5qf.js +1 -0
- package/dist/assets/ThemeToggle-CYTGbBo5.js +1 -0
- package/dist/assets/ToastContext-hirVjDXt.js +1 -0
- package/dist/assets/ToolsAdminGate-CGmWPDuY.js +1 -0
- package/dist/assets/TrustPresetSection-BE9L2eQf.js +1 -0
- package/dist/assets/UserProfile-DUpHIz3U.js +1 -0
- package/dist/assets/WebhookUrlWarning-DEtZrsXR.js +1 -0
- package/dist/assets/WhatNeedsMe-s8nEWFq9.js +1 -0
- package/dist/assets/WorkspaceRuntimeControls-UK1xSSV7.js +1 -0
- package/dist/assets/Workspaces-J1XIkM6C.js +1 -0
- package/dist/assets/access-CbJiLazn.js +1 -0
- package/dist/assets/activity-Cvh9YJZ4.js +1 -0
- package/dist/assets/activity-format-B1sPfZ7Q.js +1 -0
- package/dist/assets/activity-in5dxqje.js +1 -0
- package/dist/assets/adapter-display-registry-DLd1q9Lr.js +1 -0
- package/dist/assets/adapters-qgEEm2Iw.js +1 -0
- package/dist/assets/agent-avatar-url-BqlU_BLu.js +1 -0
- package/dist/assets/agent-config-primitives-CB06SePU.js +1 -0
- package/dist/assets/agent-order-BE-pAWdx.js +1 -0
- package/dist/assets/agentChats-C2bFjmaS.js +1 -0
- package/dist/assets/agents-HNnobIne.js +1 -0
- package/dist/assets/alert-dialog-DnlZalnH.js +1 -0
- package/dist/assets/app-connect-policy-IJzJACTA.js +1 -0
- package/dist/assets/archive-CSkC2INB.js +1 -0
- package/dist/assets/archive-restore-lk6xiO1p.js +1 -0
- package/dist/assets/arrow-down-B0zOBhzU.js +1 -0
- package/dist/assets/arrow-down-left-DW1TelNZ.js +1 -0
- package/dist/assets/arrow-left-CKq5sdlw.js +1 -0
- package/dist/assets/arrow-right-CDTbNhTa.js +1 -0
- package/dist/assets/arrow-up-DgjI5OHn.js +1 -0
- package/dist/assets/arrow-up-down-RwrdXrTc.js +1 -0
- package/dist/assets/arrow-up-right-CnSONOF5.js +1 -0
- package/dist/assets/artifacts-CaQr7P1r.js +1 -0
- package/dist/assets/assets-j5Kg0sqV.js +1 -0
- package/dist/assets/assignees-DkQNbPzi.js +1 -0
- package/dist/assets/audit-navigation-IalprBz0.js +1 -0
- package/dist/assets/avatar-Cliaab6i.js +1 -0
- package/dist/assets/badge-CmRCZQXu.js +1 -0
- package/dist/assets/badge-check-ByHo5kUl.js +1 -0
- package/dist/assets/bot-TL3Jdr73.js +1 -0
- package/dist/assets/boxes-BxuK2fXe.js +1 -0
- package/dist/assets/braces-Cc8xLJ1U.js +1 -0
- package/dist/assets/browser-use-DEYvGklp.js +1 -0
- package/dist/assets/budgets-ifaLm6Di.js +1 -0
- package/dist/assets/button-Cq79rkKD.js +1 -0
- package/dist/assets/calendar-clock-Bm_UA63E.js +1 -0
- package/dist/assets/card-DCb-JOH-.js +1 -0
- package/dist/assets/cases-DVp6Rjr-.js +1 -0
- package/dist/assets/chatEndpoints-DkjTRXJB.js +1 -0
- package/dist/assets/check-vba7RPNV.js +1 -0
- package/dist/assets/checkbox-BGLv5God.js +1 -0
- package/dist/assets/chevron-down-CTfmQYtZ.js +1 -0
- package/dist/assets/chevron-left-DbSymkYp.js +1 -0
- package/dist/assets/chevron-right-CZqG6c6-.js +1 -0
- package/dist/assets/chevron-up-CzC1gtv6.js +1 -0
- package/dist/assets/chip-BzNFVgX5.js +1 -0
- package/dist/assets/circle-3iXc8Bn9.js +1 -0
- package/dist/assets/circle-alert-DXWfyHyZ.js +1 -0
- package/dist/assets/circle-dot-ClSiVq7g.js +1 -0
- package/dist/assets/circle-question-mark-CqwY53-2.js +1 -0
- package/dist/assets/circle-slash-CFjhY0cX.js +1 -0
- package/dist/assets/circle-x-DlwqHtyY.js +1 -0
- package/dist/assets/clipboard-CTLKYvRL.js +1 -0
- package/dist/assets/clipboard-paste-0RG8HmtD.js +1 -0
- package/dist/assets/clock-BoEHLMU_.js +1 -0
- package/dist/assets/cloud-J5TXOfaU.js +1 -0
- package/dist/assets/code-xml-CfpLGfdE.js +1 -0
- package/dist/assets/coins-BzhY_8bw.js +1 -0
- package/dist/assets/collapsible-BVnhGR5_.js +1 -0
- package/dist/assets/color-contrast-BHHcEMtO.js +1 -0
- package/dist/assets/columns-3-BEJ-fVu5.js +1 -0
- package/dist/assets/command-Cq8PZDyP.js +5 -0
- package/dist/assets/companies-query-CmKa9bVw.js +1 -0
- package/dist/assets/company-skill-routes-D5LJ1l8M.js +1 -0
- package/dist/assets/connection-identity-HeZN7f9X.js +1 -0
- package/dist/assets/connection-owner-DfXYDqVS.js +1 -0
- package/dist/assets/copy-DWkF-rFH.js +1 -0
- package/dist/assets/createLucideIcon-C01KAfc1.js +94 -0
- package/dist/assets/decision-models-B27g9stT.js +1 -0
- package/dist/assets/{definition-CvJN1sEp.js → definition-CP66xiVi.js} +1 -1
- package/dist/assets/dialog-DAYoqqlE.js +1 -0
- package/dist/assets/dist-B6TpBrd3.js +1 -0
- package/dist/assets/dist-BAtkULn4.js +1 -0
- package/dist/assets/{dist-YLpD_m68.js → dist-BEo-uoE2.js} +2 -2
- package/dist/assets/dist-BPuuaNc6.js +1 -0
- package/dist/assets/dist-BQx_Sj8Z.js +1 -0
- package/dist/assets/dist-BX4PSqp4.js +1 -0
- package/dist/assets/dist-BY93_d3Z.js +1 -0
- package/dist/assets/{dist-CoBeqEhN.js → dist-Bc6S4vv3.js} +2 -2
- package/dist/assets/dist-BgbeNgQ7.js +1 -0
- package/dist/assets/dist-BhEZ0cZQ.js +1 -0
- package/dist/assets/dist-BhxPxuMy.js +13 -0
- package/dist/assets/dist-BoCmQaxU.js +1 -0
- package/dist/assets/{dist-Bs-s6dPt.js → dist-Bp5Y-deP.js} +1 -1
- package/dist/assets/dist-C7_8mWOJ.js +1 -0
- package/dist/assets/dist-CD47N__7.js +1 -0
- package/dist/assets/{dist-D_0NfuCy.js → dist-CN5Rg9XU.js} +4 -4
- package/dist/assets/dist-CcBZFMdg.js +1 -0
- package/dist/assets/dist-CdFTLNcc.js +1 -0
- package/dist/assets/dist-CjIC-l6P.js +1 -0
- package/dist/assets/{dist-DwUD8svp.js → dist-Cv1Aw0YM.js} +1 -1
- package/dist/assets/dist-CxscfvXr.js +1 -0
- package/dist/assets/dist-D4qkWMdz.js +1 -0
- package/dist/assets/{dist-DX49WtIu.js → dist-D61jI6QA.js} +1 -1
- package/dist/assets/dist-DTj_cM7l.js +1 -0
- package/dist/assets/dist-DTwCbVsv.js +7 -0
- package/dist/assets/dist-DXN4Acbb.js +1 -0
- package/dist/assets/dist-DY5RRJBY.js +1 -0
- package/dist/assets/dist-Dqr5P1yA.js +1 -0
- package/dist/assets/dist-DrXWoUSy.js +1 -0
- package/dist/assets/dist-Uvf9OORN.js +1 -0
- package/dist/assets/dist-Wi1mdRva.js +1 -0
- package/dist/assets/dist-ZRlzTkPa.js +1 -0
- package/dist/assets/dist-ds5P5TFe.js +13 -0
- package/dist/assets/dist-t8wEz_ib.js +1 -0
- package/dist/assets/dist-xt2ddRNe.js +1 -0
- package/dist/assets/dist-yKrp-Qew.js +1 -0
- package/dist/assets/dropdown-menu-BgB3ZFIW.js +1 -0
- package/dist/assets/dynamic-loader-ehitOaJV.js +103 -0
- package/dist/assets/ellipsis-BK2IHFgt.js +1 -0
- package/dist/assets/ellipsis-vertical-C5e3-e9R.js +1 -0
- package/dist/assets/email-CV3yYcNq.js +1 -0
- package/dist/assets/environment-variables-editor-BitLLMXQ.js +1 -0
- package/dist/assets/environments-CfHweeFn.js +1 -0
- package/dist/assets/es2015-DhDTIiZX.js +41 -0
- package/dist/assets/execution-projection-BGI5f3kX.js +1 -0
- package/dist/assets/external-link-CFqVy5ry.js +1 -0
- package/dist/assets/eye-BwNiGG0K.js +1 -0
- package/dist/assets/eye-off-DM4Mn0Ui.js +1 -0
- package/dist/assets/fast-responses-DPQkf5ib.js +1 -0
- package/dist/assets/file-_5byK_0p.js +1 -0
- package/dist/assets/file-code-corner-P0uyjZIh.js +1 -0
- package/dist/assets/file-pen-line-kClOj_yW.js +1 -0
- package/dist/assets/file-question-mark-CkUR8QEW.js +1 -0
- package/dist/assets/file-search-B7lfsYmF.js +1 -0
- package/dist/assets/file-text-Chu49UHl.js +1 -0
- package/dist/assets/flag-CrPUL4EW.js +1 -0
- package/dist/assets/flask-conical-Dcrf_nx_.js +1 -0
- package/dist/assets/folder-git-2-CLpnZyIw.js +1 -0
- package/dist/assets/folder-open-Kn4cJ9z0.js +1 -0
- package/dist/assets/folder-search-B8ukxS6T.js +1 -0
- package/dist/assets/funnel-DCdgde5v.js +1 -0
- package/dist/assets/git-pull-request-BpJt0qs7.js +1 -0
- package/dist/assets/github-icon-Cd7zG3cl.js +1 -0
- package/dist/assets/health-DgXwfcgQ.js +1 -0
- package/dist/assets/heartbeats-DqejhX23.js +1 -0
- package/dist/assets/inbox-Cbfplszq.js +1 -0
- package/dist/assets/inboxArchiveCache-BtWGk_ob.js +1 -0
- package/dist/assets/index-B68fUztV.js +63 -0
- package/dist/assets/index-EGhEwKJ3.css +2 -0
- package/dist/assets/info-DH5P_pOB.js +1 -0
- package/dist/assets/input-ChF32KiE.js +1 -0
- package/dist/assets/instance-settings-QXUWVmQs.js +1 -0
- package/dist/assets/instanceSettings-CUD5DYwc.js +1 -0
- package/dist/assets/interaction-audience-B7SSjTOH.js +1 -0
- package/dist/assets/interaction-card-visibility-BruS_M_b.js +1 -0
- package/dist/assets/invite-memory-CHGcQdLs.js +1 -0
- package/dist/assets/issue-attribution-DfN_3u2W.js +1 -0
- package/dist/assets/issue-blockers-CPChygIu.js +1 -0
- package/dist/assets/issue-filters-BO9xiK0c.js +1 -0
- package/dist/assets/issue-output-BWw5hGM4.js +1 -0
- package/dist/assets/issue-properties-DImTADpL.js +4 -0
- package/dist/assets/issue-share-BziUBrKs.js +1 -0
- package/dist/assets/issue-workspace-selection-ZZQ5MvBX.js +1 -0
- package/dist/assets/issueActiveRun-s6f-GUHq.js +1 -0
- package/dist/assets/key-round-hIknfaVC.js +1 -0
- package/dist/assets/label-B8cGBdHV.js +1 -0
- package/dist/assets/layout-dashboard-B47lh1t7.js +1 -0
- package/dist/assets/line-diff-DAcZgvm2.js +3 -0
- package/dist/assets/link-2-Czdp7P22.js +1 -0
- package/dist/assets/link-B5IDCTfS.js +1 -0
- package/dist/assets/list-filter-DGszpYtY.js +1 -0
- package/dist/assets/list-todo-mtfpHiej.js +1 -0
- package/dist/assets/log-in-xaKdjJ3s.js +1 -0
- package/dist/assets/managed-sandbox-environment-B8DewKvK.js +1 -0
- package/dist/assets/maximize-2-D_7SnXGd.js +1 -0
- package/dist/assets/{mention-chips-BKRdYPgz.js → mention-chips-rgpUYSS0.js} +9 -9
- package/dist/assets/message-square-plus-Bx97bVFn.js +1 -0
- package/dist/assets/minus-Cksvqs-H.js +1 -0
- package/dist/assets/model-DidtFy-U.js +1 -0
- package/dist/assets/model-fallback-BA1V-ii-.js +1 -0
- package/dist/assets/model-picker-fields-reyKlVR2.js +1 -0
- package/dist/assets/network-DuLdTW_2.js +1 -0
- package/dist/assets/octagon-alert-CDc0IOFm.js +1 -0
- package/dist/assets/octagon-x-BnObTt3C.js +1 -0
- package/dist/assets/omp-settings-model-RrukAqFT.js +1 -0
- package/dist/assets/package-CAlqg80l.js +1 -0
- package/dist/assets/paperclip-CdwdbvAb.js +1 -0
- package/dist/assets/pause-D5LWH4m4.js +1 -0
- package/dist/assets/pen-line-BctzdUrl.js +1 -0
- package/dist/assets/pencil-4y59RLDI.js +1 -0
- package/dist/assets/pipeline-stage-presentation-DplSUQ-v.js +2 -0
- package/dist/assets/pipelines-zw8JXnEw.js +1 -0
- package/dist/assets/play-DYcWlP80.js +1 -0
- package/dist/assets/plug-Dlmv_sib.js +1 -0
- package/dist/assets/plugins-DxlXA9g_.js +1 -0
- package/dist/assets/plus-XHeYelml.js +1 -0
- package/dist/assets/popover-Dq6_MkmZ.js +1 -0
- package/dist/assets/portable-files-CloN_vbk.js +1 -0
- package/dist/assets/power-Df1YORDz.js +1 -0
- package/dist/assets/presentation-mode-B1mYfRtC.js +1 -0
- package/dist/assets/primary-sidebar-styles-BdMiagDc.js +1 -0
- package/dist/assets/profile-summary-ClLOCEcJ.js +1 -0
- package/dist/assets/projects-DebVPi8C.js +1 -0
- package/dist/assets/proposal-review-COOriT05.js +1 -0
- package/dist/assets/query-placeholder-data-Bg4z2kcq.js +1 -0
- package/dist/assets/queryClient-zvH4bKo9.js +1 -0
- package/dist/assets/queryKeys-Br82Auye.js +1 -0
- package/dist/assets/radio-BIjLcReK.js +1 -0
- package/dist/assets/radio-card-BO_94Vo8.js +1 -0
- package/dist/assets/recent-agent-chats-BzbiZr3S.js +1 -0
- package/dist/assets/recent-assignees-DmalYaLf.js +1 -0
- package/dist/assets/recent-selections-BnN_nb6Y.js +1 -0
- package/dist/assets/refresh-cw-CqldqiKu.js +1 -0
- package/dist/assets/repeat-5LyAUYWe.js +1 -0
- package/dist/assets/resizable-panels-D6N09g1s.js +1 -0
- package/dist/assets/responsible-user-denial-Dyl0BwU5.js +1 -0
- package/dist/assets/retired-composio-DrxhEOpx.js +1 -0
- package/dist/assets/review-policy-C0aUsC3B.js +1 -0
- package/dist/assets/rotate-ccw-CMMEfcO3.js +1 -0
- package/dist/assets/rotate-cw-chXO5k8L.js +1 -0
- package/dist/assets/router-Bo2oJyq_.js +1 -0
- package/dist/assets/routines-Dj56gU5g.js +1 -0
- package/dist/assets/run-log-chunks-ZnzOvrXs.js +2 -0
- package/dist/assets/runRetryState-BykQUNQw.js +1 -0
- package/dist/assets/save-B-X79KYj.js +1 -0
- package/dist/assets/schema-config-fields-BKzRKOf-.js +1 -0
- package/dist/assets/scroll-area-C1fbWVPu.js +1 -0
- package/dist/assets/scroll-text-C2dYnVvE.js +1 -0
- package/dist/assets/search-BXCEz7xF.js +1 -0
- package/dist/assets/searchable-select-fvMNMcqm.js +1 -0
- package/dist/assets/secrets-DhK8O7Pz.js +1 -0
- package/dist/assets/segmented-tifc6Dov.js +1 -0
- package/dist/assets/select-zH7gqAbB.js +1 -0
- package/dist/assets/send-DixgMXzs.js +1 -0
- package/dist/assets/separator-B65gZ5VY.js +1 -0
- package/dist/assets/server-DnsT1uDe.js +1 -0
- package/dist/assets/server-cog-vS2OmfoT.js +1 -0
- package/dist/assets/settings-D88XZaPT.js +1 -0
- package/dist/assets/shared-CT8xZIqu.js +1 -0
- package/dist/assets/sheet-DnX__vl2.js +1 -0
- package/dist/assets/shield-KDhiJeJq.js +1 -0
- package/dist/assets/shield-alert-BEyIvSqK.js +1 -0
- package/dist/assets/shield-check-BBMPASnP.js +1 -0
- package/dist/assets/shield-question-mark-CzkOeQok.js +1 -0
- package/dist/assets/shield-x-Cf3sKG3X.js +1 -0
- package/dist/assets/sidebarPreferences-CdgZXAKV.js +1 -0
- package/dist/assets/skeleton-B4cIa_g2.js +1 -0
- package/dist/assets/skill-source-connect-return-C3vV7DQP.js +1 -0
- package/dist/assets/slots-FyJ3Hfus.js +49 -0
- package/dist/assets/smoke-lab-matrix-DWiBJIcl.js +1 -0
- package/dist/assets/square-DPfXoq29.js +1 -0
- package/dist/assets/star-B0Mu4cdA.js +15 -0
- package/dist/assets/sun-Bl_UqCKR.js +1 -0
- package/dist/assets/system-notice-comment-CoRAcwGq.js +1 -0
- package/dist/assets/tabs-B0vo1rAq.js +1 -0
- package/dist/assets/task-chat-attachments-DtAs6_z7.js +10 -0
- package/dist/assets/terminal-Bm6kwzsr.js +1 -0
- package/dist/assets/terminal-font-B-qtwS34.js +10 -0
- package/dist/assets/textarea-DddKJofz.js +1 -0
- package/dist/assets/thumbs-down-BVyvvF51.js +1 -0
- package/dist/assets/thumbs-up-BueMhd4r.js +1 -0
- package/dist/assets/toggle-switch-D8RWluFT.js +1 -0
- package/dist/assets/tool-taxonomy-ChJ16HLB.js +1 -0
- package/dist/assets/tools-ClJdhG8w.js +1 -0
- package/dist/assets/tooltip-BF1EZSM_.js +1 -0
- package/dist/assets/transcript-adapter-8zQ2IrC0.js +5 -0
- package/dist/assets/trash-CN4Xf2am.js +1 -0
- package/dist/assets/triangle-alert-DuUA72IB.js +1 -0
- package/dist/assets/use-adapter-capabilities-DIMhQ3jT.js +1 -0
- package/dist/assets/use-copy-action-JoIz-xmX.js +1 -0
- package/dist/assets/useAgentChatEnabled-hizcCAft.js +1 -0
- package/dist/assets/useAutosaveIndicator-DT0E_3dy.js +1 -0
- package/dist/assets/useHiddenSettings-CXOyNixn.js +1 -0
- package/dist/assets/useInfiniteQuery-Desl5o9L.js +1 -0
- package/dist/assets/useInstanceFeatureSettings-DVYS6vi6.js +1 -0
- package/dist/assets/useManagedSandboxOnly-Buxyl4mU.js +1 -0
- package/dist/assets/useMobileEntityPickerViewportStyle-CTKldW72.js +1 -0
- package/dist/assets/usePrefersReducedMotion-D9kOF5TM.js +1 -0
- package/dist/assets/useProfilesData-BaJegHE_.js +1 -0
- package/dist/assets/useQueries-Dsz6Nov_.js +1 -0
- package/dist/assets/useSecondTick-BpSp0EL3.js +1 -0
- package/dist/assets/useSharedPolling-BsEZUKWE.js +1 -0
- package/dist/assets/useSummaryDraftStream-B5G7DDoN.js +3 -0
- package/dist/assets/user-DrmBwrR4.js +1 -0
- package/dist/assets/user-check-wxCkYhKI.js +1 -0
- package/dist/assets/user-minus-D4gqJyh-.js +1 -0
- package/dist/assets/user-round-CafDnRCl.js +1 -0
- package/dist/assets/user-x-Cc_Mqj5k.js +1 -0
- package/dist/assets/users-BCTPIiOj.js +1 -0
- package/dist/assets/wand-sparkles-BAzjtC-H.js +1 -0
- package/dist/assets/webhook-BmdMp-g8.js +1 -0
- package/dist/assets/workspace-restore-Dz-CzQw6.js +1 -0
- package/dist/assets/x-s4V0MRUq.js +1 -0
- package/dist/brands/adapters/openai-dot.README.md +1 -1
- package/dist/downloads/local-browser-chromium.zip +0 -0
- package/dist/downloads/local-browser-firefox-unsigned.zip +0 -0
- package/dist/downloads/local-browser-firefox.xpi +0 -0
- package/dist/fonts/NOTICE.md +1 -1
- package/dist/index.html +222 -19
- package/dist/sw.js +3 -3
- package/package.json +2 -2
- package/dist/assets/CompanyExport-nSZ6c22o.js +0 -4
- package/dist/assets/Terminal-BUKNL-hS.js +0 -1
- package/dist/assets/clipboard-oERS_NGj.js +0 -15
- package/dist/assets/dist-7JK5o5w2.js +0 -7
- package/dist/assets/dist-BJVIAntd.js +0 -1
- package/dist/assets/dist-BNQK72Ay.js +0 -1
- package/dist/assets/dist-BRZ2juoF.js +0 -1
- package/dist/assets/dist-BYmxsnlZ.js +0 -1
- package/dist/assets/dist-Be2PH9Ri.js +0 -1
- package/dist/assets/dist-BsvRtKyc.js +0 -1
- package/dist/assets/dist-C-AEDno-.js +0 -1
- package/dist/assets/dist-CPFoA4ty.js +0 -1
- package/dist/assets/dist-CWYWSO70.js +0 -1
- package/dist/assets/dist-CsYwdeKQ.js +0 -1
- package/dist/assets/dist-CwygYsQk.js +0 -1
- package/dist/assets/dist-DCmyl8JS.js +0 -1
- package/dist/assets/dist-DLhVtuRQ.js +0 -1
- package/dist/assets/dist-DpJyVhoi.js +0 -1
- package/dist/assets/dist-DxGmGQAd.js +0 -1
- package/dist/assets/dist-aSaqj57N.js +0 -1
- package/dist/assets/dist-fm9IOgs2.js +0 -13
- package/dist/assets/index-CXBON4gu.js +0 -760
- package/dist/assets/index-CYb_Lk-W.css +0 -1
- package/dist/assets/x-CzBf9g0R.js +0 -134
|
@@ -0,0 +1,63 @@
|
|
|
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-B0aJ05Zn.js","assets/createLucideIcon-C01KAfc1.js","assets/check-vba7RPNV.js","assets/circle-3iXc8Bn9.js","assets/copy-DWkF-rFH.js","assets/button-Cq79rkKD.js","assets/dist-t8wEz_ib.js","assets/dist-Dqr5P1yA.js","assets/minus-Cksvqs-H.js","assets/pause-D5LWH4m4.js","assets/play-DYcWlP80.js","assets/plus-XHeYelml.js","assets/rotate-ccw-CMMEfcO3.js","assets/TaskChatThreadView-QQeO-S6o.js","assets/star-B0Mu4cdA.js","assets/preload-helper-CceJXRIF.js","assets/ArtifactCard-BOcWFgmA.js","assets/router-Bo2oJyq_.js","assets/queryKeys-Br82Auye.js","assets/CompanyContext-BxCDBNSH.js","assets/companies-query-CmKa9bVw.js","assets/popover-Dq6_MkmZ.js","assets/dist-BoCmQaxU.js","assets/dist-CjIC-l6P.js","assets/dist-ZRlzTkPa.js","assets/es2015-DhDTIiZX.js","assets/boxes-BxuK2fXe.js","assets/circle-dot-ClSiVq7g.js","assets/package-CAlqg80l.js","assets/search-BXCEz7xF.js","assets/shield-KDhiJeJq.js","assets/terminal-Bm6kwzsr.js","assets/external-link-CFqVy5ry.js","assets/paperclip-CdwdbvAb.js","assets/use-copy-action-JoIz-xmX.js","assets/ToastContext-hirVjDXt.js","assets/clipboard-CTLKYvRL.js","assets/arrow-down-B0zOBhzU.js","assets/chevron-down-CTfmQYtZ.js","assets/chevron-right-CZqG6c6-.js","assets/tool-taxonomy-ChJ16HLB.js","assets/circle-question-mark-CqwY53-2.js","assets/file-pen-line-kClOj_yW.js","assets/RichWorkProductCard-BO_PVS_R.js","assets/file-text-Chu49UHl.js","assets/file-_5byK_0p.js","assets/maximize-2-D_7SnXGd.js","assets/server-DnsT1uDe.js","assets/github-icon-Cd7zG3cl.js","assets/ImageGalleryModal-OwUAU2AO.js","assets/dist-BgbeNgQ7.js","assets/chevron-left-DbSymkYp.js","assets/x-s4V0MRUq.js","assets/issue-output-BWw5hGM4.js","assets/network-DuLdTW_2.js","assets/shield-check-BBMPASnP.js","assets/MarkdownBody-BfIbo0pr.js","assets/mention-chips-rgpUYSS0.js","assets/agent-avatar-url-BqlU_BLu.js","assets/color-contrast-BHHcEMtO.js","assets/archive-CSkC2INB.js","assets/circle-x-DlwqHtyY.js","assets/clock-BoEHLMU_.js","assets/file-code-corner-P0uyjZIh.js","assets/folder-open-Kn4cJ9z0.js","assets/git-pull-request-BpJt0qs7.js","assets/key-round-hIknfaVC.js","assets/octagon-alert-CDc0IOFm.js","assets/agents-HNnobIne.js","assets/usePrefersReducedMotion-D9kOF5TM.js","assets/ThemeContext-DD1EP5qf.js","assets/StatusIcon-C2NWeA8n.js","assets/task-chat-attachments-DtAs6_z7.js","assets/TaskChatMarker-CqvZL5i4.js","assets/bot-TL3Jdr73.js","assets/flag-CrPUL4EW.js","assets/info-DH5P_pOB.js","assets/octagon-x-BnObTt3C.js","assets/TaskChatProtocolCard-poluyifm.js","assets/QuestionForm-BexjfwBC.js","assets/MarkdownEditor-CCqgqbbX.js","assets/dist-xt2ddRNe.js","assets/dist-C7_8mWOJ.js","assets/dist-CxscfvXr.js","assets/dist-BQx_Sj8Z.js","assets/dist-DXN4Acbb.js","assets/dist-BhEZ0cZQ.js","assets/calendar-clock-Bm_UA63E.js","assets/user-DrmBwrR4.js","assets/AgentAvatar-EsXsSxSG.js","assets/Identity-DHk25Fo0.js","assets/avatar-Cliaab6i.js","assets/routines-Dj56gU5g.js","assets/activity-Cvh9YJZ4.js","assets/dist-BhxPxuMy.js","assets/message-square-plus-Bx97bVFn.js","assets/input-ChF32KiE.js","assets/TaskChatComposerTakeoverContext-DWOxDlEu.js","assets/triangle-alert-DuUA72IB.js","assets/dialog-DAYoqqlE.js","assets/textarea-DddKJofz.js","assets/square-DPfXoq29.js","assets/users-BCTPIiOj.js","assets/presentation-mode-B1mYfRtC.js","assets/list-todo-mtfpHiej.js","assets/shield-question-mark-CzkOeQok.js","assets/shield-x-Cf3sKG3X.js","assets/system-notice-comment-CoRAcwGq.js","assets/label-B8cGBdHV.js","assets/heartbeats-DqejhX23.js","assets/email-CV3yYcNq.js","assets/transcript-adapter-8zQ2IrC0.js","assets/AgentBubbleActionRow-nLDgzu9o.js","assets/dropdown-menu-BgB3ZFIW.js","assets/ellipsis-BK2IHFgt.js","assets/thumbs-down-BVyvvF51.js","assets/thumbs-up-BueMhd4r.js","assets/tooltip-BF1EZSM_.js","assets/segmented-tifc6Dov.js","assets/Cases-gjrf6tmu.js","assets/checkbox-BGLv5God.js","assets/arrow-up-down-RwrdXrTc.js","assets/columns-3-BEJ-fVu5.js","assets/funnel-DCdgde5v.js","assets/badge-CmRCZQXu.js","assets/projects-DebVPi8C.js","assets/BreadcrumbContext-C1Pz9E0M.js","assets/cases-DVp6Rjr-.js","assets/CaseIdentifierKey-DgiLO3Rb.js","assets/FilterBar-BsmtWqB7.js","assets/CaseDetail-X0DGQoca.js","assets/IssueDocumentAnnotations-DqMdyd5R.js","assets/sheet-DnX__vl2.js","assets/tabs-B0vo1rAq.js","assets/ellipsis-vertical-C5e3-e9R.js","assets/issue-properties-DImTADpL.js","assets/issue-attribution-DfN_3u2W.js","assets/WorkspaceRuntimeControls-UK1xSSV7.js","assets/activity-in5dxqje.js","assets/useManagedSandboxOnly-Buxyl4mU.js","assets/instanceSettings-CUD5DYwc.js","assets/archive-restore-lk6xiO1p.js","assets/arrow-right-CDTbNhTa.js","assets/arrow-up-right-CnSONOF5.js","assets/repeat-5LyAUYWe.js","assets/inboxArchiveCache-BtWGk_ob.js","assets/access-CbJiLazn.js","assets/assignees-DkQNbPzi.js","assets/AgentIdentity-GjMQAWCv.js","assets/recent-selections-BnN_nb6Y.js","assets/recent-assignees-DmalYaLf.js","assets/InlineEntitySelector-NCqeSVBt.js","assets/useMobileEntityPickerViewportStyle-CTKldW72.js","assets/issue-blockers-CPChygIu.js","assets/eye-BwNiGG0K.js","assets/refresh-cw-CqldqiKu.js","assets/TaskDetailRelationsPanel-Bk1aFfQv.js","assets/query-placeholder-data-Bg4z2kcq.js","assets/SourceTrustBadge-BaYEFytm.js","assets/badge-check-ByHo5kUl.js","assets/circle-alert-DXWfyHyZ.js","assets/shield-alert-BEyIvSqK.js","assets/InlineBanner-DnQWPYOq.js","assets/runRetryState-BykQUNQw.js","assets/IssueReferencePill-Byyo3mWU.js","assets/review-policy-C0aUsC3B.js","assets/user-check-wxCkYhKI.js","assets/user-minus-D4gqJyh-.js","assets/separator-B65gZ5VY.js","assets/issue-workspace-selection-ZZQ5MvBX.js","assets/list-filter-DGszpYtY.js","assets/trash-CN4Xf2am.js","assets/select-zH7gqAbB.js","assets/chevron-up-CzC1gtv6.js","assets/chip-BzNFVgX5.js","assets/card-DCb-JOH-.js","assets/useAutosaveIndicator-DT0E_3dy.js","assets/FoldCurtain-BirYTOEh.js","assets/line-diff-DAcZgvm2.js","assets/DocumentFrameHeader-C57Py4YE.js","assets/Dashboard-C_87MSE2.js","assets/flask-conical-Dcrf_nx_.js","assets/layout-dashboard-B47lh1t7.js","assets/MootMark-DpAqNyxE.js","assets/useSharedPolling-BsEZUKWE.js","assets/slots-FyJ3Hfus.js","assets/SidebarContext-BDwcx9eV.js","assets/plugins-DxlXA9g_.js","assets/instance-settings-QXUWVmQs.js","assets/IssueReferenceActivitySummary-BybOSmTQ.js","assets/activity-format-B1sPfZ7Q.js","assets/MetricCard-DCSvmMqn.js","assets/ActiveAgentsPanel-CLj_ucN7.js","assets/useQueries-Dsz6Nov_.js","assets/IssueChatThread-CUlN-lN0.js","assets/ConnectionSetupFlow-Dzuzx7jk.js","assets/connection-identity-HeZN7f9X.js","assets/queryClient-zvH4bKo9.js","assets/collapsible-BVnhGR5_.js","assets/alert-dialog-DnlZalnH.js","assets/PathInstructionsModal-CEyWg69s.js","assets/arrow-left-CKq5sdlw.js","assets/SearchableSelect-DF7YpkdT.js","assets/command-Cq8PZDyP.js","assets/searchable-select-fvMNMcqm.js","assets/environment-variables-editor-BitLLMXQ.js","assets/eye-off-DM4Mn0Ui.js","assets/save-B-X79KYj.js","assets/user-round-CafDnRCl.js","assets/model-DidtFy-U.js","assets/proposal-review-COOriT05.js","assets/server-cog-vS2OmfoT.js","assets/secrets-DhK8O7Pz.js","assets/inbox-Cbfplszq.js","assets/link-2-Czdp7P22.js","assets/SetupWizard-C3-3uNXq.js","assets/skeleton-B4cIa_g2.js","assets/tools-ClJdhG8w.js","assets/AppLogo-DTmvrLai.js","assets/assets-j5Kg0sqV.js","assets/toggle-switch-D8RWluFT.js","assets/model-picker-fields-reyKlVR2.js","assets/arrow-up-DgjI5OHn.js","assets/AgentMultiSelect-ChKUNflE.js","assets/radio-card-BO_94Vo8.js","assets/JsonSchemaForm-Cn579kgp.js","assets/schema-config-fields-BKzRKOf-.js","assets/agent-config-primitives-CB06SePU.js","assets/adapter-display-registry-DLd1q9Lr.js","assets/environments-CfHweeFn.js","assets/AgentSetupPrompt-CRMBM6wm.js","assets/managed-sandbox-environment-B8DewKvK.js","assets/dynamic-loader-ehitOaJV.js","assets/adapters-qgEEm2Iw.js","assets/use-adapter-capabilities-DIMhQ3jT.js","assets/AgentCharacter-DzxzveQH.js","assets/app-connect-policy-IJzJACTA.js","assets/responsible-user-denial-Dyl0BwU5.js","assets/ComposerAddMenu-DBuHSmG4.js","assets/IssueThreadInteractionCard-CnGISjFd.js","assets/plug-Dlmv_sib.js","assets/interaction-card-visibility-BruS_M_b.js","assets/interaction-audience-B7SSjTOH.js","assets/AgentMailCredentialField-CJcF0Clw.js","assets/run-log-chunks-ZnzOvrXs.js","assets/useSecondTick-BpSp0EL3.js","assets/IssueRecoveryActionCard-DXthkoa2.js","assets/execution-projection-BGI5f3kX.js","assets/workspace-restore-Dz-CzQw6.js","assets/CommentAttributionChip-DHuPOHJh.js","assets/LiveNowTodoLine-DJoyO8eZ.js","assets/AgentTodoCard-BCx1biOy.js","assets/smoke-lab-matrix-DWiBJIcl.js","assets/DashboardLive-CdHY1mHk.js","assets/Companies-BbbaWb0v.js","assets/pencil-4y59RLDI.js","assets/Agents-BTZu-vy-.js","assets/useAgentChatEnabled-hizcCAft.js","assets/useHiddenSettings-CXOyNixn.js","assets/health-DgXwfcgQ.js","assets/AgentRoleEditor-BaT_mb8k.js","assets/EntityRow-CsMXIXXb.js","assets/AgentDetail-BbpgFl_G.js","assets/useInfiniteQuery-Desl5o9L.js","assets/ScrollToBottom-MElZx9KC.js","assets/scroll-area-C1fbWVPu.js","assets/braces-Cc8xLJ1U.js","assets/chatEndpoints-DkjTRXJB.js","assets/ConfigureBuiltInAgentModal-BkaylF48.js","assets/model-fallback-BA1V-ii-.js","assets/ResponsibleUserDenialNotice-CKbMq_8f.js","assets/user-x-Cc_Mqj5k.js","assets/omp-settings-model-RrukAqFT.js","assets/ChoiceControls-Cy8E_BqQ.js","assets/SkillCardIcon-D6Sde9N1.js","assets/CopyText-CW3qWFPY.js","assets/MembershipAction-Bu1nqQYv.js","assets/log-in-xaKdjJ3s.js","assets/AgentActionButtons-pRsHFtLW.js","assets/TrustPresetSection-BE9L2eQf.js","assets/EnforcementBanner-CqY3eZb5.js","assets/shared-CT8xZIqu.js","assets/OmpAllSettings-fSc31cIu.js","assets/Projects-B7XDgtru.js","assets/ProjectDetail-Cie7YkeD.js","assets/link-B5IDCTfS.js","assets/BudgetPolicyCard-BwV8P4n4.js","assets/AccessSelectIdentity-BzNL_ZaL.js","assets/InlineEditor-B-oEEW8R.js","assets/SummarySlotCard-CmxW3-lC.js","assets/useSummaryDraftStream-B5G7DDoN.js","assets/budgets-ifaLm6Di.js","assets/ProjectWorkspacesContent-CAEuHcwN.js","assets/ProjectWorkspaceDetail-4Eh2xMnt.js","assets/MissingPluginTabPlaceholder-UM0Cgk9J.js","assets/Workspaces-J1XIkM6C.js","assets/Issues-BrnnvHeE.js","assets/Inbox-Bk8khlSh.js","assets/issue-filters-BO9xiK0c.js","assets/ApprovalPayload-DekKq-IE.js","assets/scroll-text-C2dYnVvE.js","assets/Search-CBYkMobM.js","assets/file-question-mark-CkUR8QEW.js","assets/IssueDetail-CdKGl1_O.js","assets/IssueWriteDenialNotice-CFwpbsKd.js","assets/TerminalView-DYJK_6rV.js","assets/clipboard-paste-0RG8HmtD.js","assets/rotate-cw-chXO5k8L.js","assets/terminal-font-B-qtwS34.js","assets/cloud-J5TXOfaU.js","assets/file-search-B7lfsYmF.js","assets/folder-search-B8ukxS6T.js","assets/radio-BIjLcReK.js","assets/settings-D88XZaPT.js","assets/browser-use-DEYvGklp.js","assets/TaskTreeControls-CDIjiEFr.js","assets/code-xml-CfpLGfdE.js","assets/issueActiveRun-s6f-GUHq.js","assets/ApprovalCard-DKGjyQt-.js","assets/issue-share-BziUBrKs.js","assets/artifacts-CaQr7P1r.js","assets/AgentChats-DztS4ACV.js","assets/recent-agent-chats-BzbiZr3S.js","assets/AgentChat-DTQT-Wek.js","assets/agentChats-C2bFjmaS.js","assets/IssueChatLongThreadPerf-CjaD3woT.js","assets/Routines-BOD80kz-.js","assets/audit-navigation-IalprBz0.js","assets/FolderControls-DfQCO8-2.js","assets/RoutineRunVariablesDialog-BmocvukK.js","assets/Pipelines-lSbZ6-uQ.js","assets/pipeline-stage-presentation-DplSUQ-v.js","assets/folder-git-2-CLpnZyIw.js","assets/pipelines-zw8JXnEw.js","assets/PipelineSettings-CY-XoAGe.js","assets/RoutineVariablesEditor-CBxgGYWn.js","assets/StatusCards-BfwQO3yd.js","assets/wand-sparkles-BAzjtC-H.js","assets/PixelsOffice-s8WCydt9.js","assets/coins-BzhY_8bw.js","assets/AttentionInteractionResolver-Cm0k_3MB.js","assets/RoutineDetail-CxBrkRyy.js","assets/pen-line-BctzdUrl.js","assets/webhook-BmdMp-g8.js","assets/WebhookUrlWarning-DEtZrsXR.js","assets/RoutineActivityRow-BAIWOkSU.js","assets/UserProfile-DUpHIz3U.js","assets/ExecutionWorkspaceDetail-w0tph5fx.js","assets/Goals-0Q2Gnko1.js","assets/GoalTree-Btaagjxs.js","assets/Artifacts-DAtpWAuL.js","assets/GoalDetail-B2jZMNHQ.js","assets/Approvals-CLeSmmEV.js","assets/ApprovalDetail-DVVR3EtT.js","assets/CompanyActivity-D1j2INEB.js","assets/AuditHub-C6U9wM2v.js","assets/arrow-down-left-DW1TelNZ.js","assets/decision-models-B27g9stT.js","assets/fast-responses-DPQkf5ib.js","assets/QuotaBar-85eAFwZM.js","assets/WhatNeedsMe-s8nEWFq9.js","assets/DecisionDateChips-BckDENkn.js","assets/sun-Bl_UqCKR.js","assets/DecisionQueuePage-BZrUoCk3.js","assets/BoardChat-BTFAl90K.js","assets/circle-slash-CFjhY0cX.js","assets/send-DixgMXzs.js","assets/CompanySettings-8ROAg5aG.js","assets/DecisionModelSettings-DiqQ14Zd.js","assets/CompanyConnections-CZOQquHF.js","assets/CompanyEnvironments-DDbrQrMB.js","assets/BootstrapSetupUxLab-DbE6ARGg.js","assets/ResponsibleUserDenialUxLab-CFDLXQbq.js","assets/CrossIssueCollaborationUxLab-BNEDnULO.js","assets/CompanySettingsPluginPage-B-79nVuk.js","assets/CompanyAccess-Dmq_cs8a.js","assets/AdvancedToolsRoute-dQcLG_fZ.js","assets/power-Df1YORDz.js","assets/profile-summary-ClLOCEcJ.js","assets/useProfilesData-BaJegHE_.js","assets/ProfileWizardRoute-DQ8Wf6CN.js","assets/ToolsAdminGate-CGmWPDuY.js","assets/ProfileDetailRoute-CY9Zo_L-.js","assets/Browse-0mLkYDuT.js","assets/ManagedAiConnectionDetails-DsAuL_cK.js","assets/retired-composio-DrxhEOpx.js","assets/connection-owner-DfXYDqVS.js","assets/AssistantConnection-gcHktiyu.js","assets/AppsConnect-C35NNIiG.js","assets/skill-source-connect-return-C3vV7DQP.js","assets/ChatEndpointSetup-XspGek-A.js","assets/EmailEndpointSetup-Dpg3e5IP.js","assets/OpenwaGatewayManager-UG0cEqQK.js","assets/ChatEndpointDetail-Co2K-j6p.js","assets/EmailConnectionAccess-CgZl2FFX.js","assets/ChatIdentityConfirm-m3fNvAJx.js","assets/AppsReview-lab3deOa.js","assets/ReviewQueueCard-LPKXTa7p.js","assets/AppDetail-Bw4J28Ak.js","assets/AppNotConnected-CBliUH8m.js","assets/GatewaysList-C3fEQHRs.js","assets/CopyableGatewayUrl-C8LwXvVu.js","assets/GatewayDetail-Cf6WshG5.js","assets/CompanySkills-BfBhMNaP.js","assets/SkillBinaryFile-lsCfxI4Z.js","assets/company-skill-routes-D5LJ1l8M.js","assets/SkillSources-B7fG3KBv.js","assets/SkillSourceTree-BCndxsNf.js","assets/SkillStudio-BEAfNXcI.js","assets/AgentIconPicker-DHCKaIkZ.js","assets/resizable-panels-D6N09g1s.js","assets/IssueOutputSection-BReOvQxZ.js","assets/Secrets-Bu6q9QVj.js","assets/CompanyImport-DbbCQEFp.js","assets/agent-order-BE-pAWdx.js","assets/sidebarPreferences-CdgZXAKV.js","assets/portable-files-CloN_vbk.js","assets/DesignGuide-B38yltct.js","assets/RepositoryEditor-C783DHwy.js","assets/ThemeToggle-CYTGbBo5.js","assets/InstanceFeatures-CPYwZmZk.js","assets/useInstanceFeatureSettings-DVYS6vi6.js","assets/AgentDefaults-xGoI264I.js","assets/ModelsAndProviders-B0gYOLvd.js","assets/OmpSignIn-BSLYU6uC.js","assets/InstanceAdvanced-C8uDSsPL.js","assets/InstanceAccess-DyQFxK_O.js","assets/ProfileSettings-Bfeh1MlI.js","assets/PluginManager-BLY48Rdb.js","assets/PluginSettings-DugaPtGC.js","assets/AdapterManager-8ofINbXH.js","assets/PluginPage-CIvrzBLJ.js","assets/NewAgent-E1cSVMu1.js","assets/Auth-BdXfGiLC.js","assets/invite-memory-CHGcQdLs.js","assets/BoardClaim-Cv56WNDU.js","assets/McpConnect-BJhgeezW.js","assets/CliAuth-CTkJ-3kI.js","assets/InviteLanding-o-enK_RP.js","assets/PublicIssueSharePage-D7UqYVp1.js","assets/JoinRequestQueue-D2RLtri2.js","assets/CompanyExport-B0eLuNvu.js","assets/Terminal-_XGdPaFV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var f_=Object.defineProperty;var r=(e,t)=>f_(e,"name",{value:t,configurable:!0});import{i as Og,n as m_,t as Ql}from"./rolldown-runtime-ZpX3ckPj.js";import{$i as Lg,$r as fk,Ar as p_,At as h_,C as mk,Ci as g_,Dr as x_,Er as b_,Li as v_,Lt as y_,Mr as _h,Nr as j_,Ot as w_,P as k_,Qi as S_,Qr as Fs,Qt as zg,Ri as oy,Si as N_,Tr as C_,Zr as pk,_ as A_,_n as __,er as E_,i as gd,ji as kc,jr as hk,ki as Pg,kt as gk,l as G,n as xk,r as ar,t as nt,vn as I_,w as cy,x as T_,zt as Sd}from"./createLucideIcon-C01KAfc1.js";import{l as bk}from"./dist-CjIC-l6P.js";import{t as ye}from"./preload-helper-CceJXRIF.js";import{_ as R_,a as Eh,c as D_,d as Wl,f as M,h as vn,n as Ih,p as M_,r as bi,s as O_,t as Ug,v as Rs,y as vk}from"./star-B0Mu4cdA.js";import{J as $g,X as Rn,Y as L_,_ as bn,c as Ir,d as Bg,f as z_,g as yk,h as cf,n as ji,r as Re,t as P,u as P_,v as be}from"./queryKeys-Br82Auye.js";import{t as uf}from"./queryClient-zvH4bKo9.js";import{t as Kg}from"./useQueries-Dsz6Nov_.js";import{a as U_,c as $_,i as qg,l as B_,o as Xn,u as uy}from"./companies-query-CmKa9bVw.js";import{N as dy,dt as K_,f as q_,ft as F_,k as H_,n as V_,p as Q_,pt as W_,z as jk}from"./ConnectionSetupFlow-Dzuzx7jk.js";import{t as wk}from"./issue-attribution-DfN_3u2W.js";import{t as G_}from"./execution-projection-BGI5f3kX.js";import{C as kk,D as Y_,O as X_,T as Z_,d as Sk,f as Fg,k as Th,w as Nk}from"./connection-identity-HeZN7f9X.js";import{n as bt,r as J_,t as eE}from"./CompanyContext-BxCDBNSH.js";import{A as tE,B as Nd,C as nE,E as aE,G as Hg,H as sE,Ht as Cd,J as iE,Jt as Vg,L as Ku,Lt as rE,O as lE,Q as Ck,Rt as dn,St as oE,Z as fy,Zt as cE,b as uE,dt as Ak,f as Ad,i as dE,in as fE,n as _k,nt as Mp,o as xa,ot as Jo,p as df,q as Qg,qt as Rh,r as Ge,rn as mE,t as fn,tt as ff,u as Ek,ut as Ik,v as Tk,zt as pE}from"./router-Bo2oJyq_.js";import{t as hE}from"./dist-t8wEz_ib.js";import{n as Rk,r as gE,t as Dk}from"./collapsible-BVnhGR5_.js";import{a as Mk,c as Ok,i as Lk,l as xE,n as zk,o as Pk,r as Uk,s as $k,t as Bk}from"./alert-dialog-DnlZalnH.js";import{a as _d,n as Ed,t as Id}from"./avatar-Cliaab6i.js";import{t as hi}from"./checkbox-BGLv5God.js";import{a as Kk,c as yi,i as Cn,n as my,o as bE,p as Vr,r as Qr,s as vE,t as Wr}from"./dropdown-menu-BgB3ZFIW.js";import{t as yE}from"./scroll-area-C1fbWVPu.js";import{i as jE,r as wE,t as kE}from"./tabs-B0vo1rAq.js";import{a as SE,o as NE,r as CE,s as AE,t as qk}from"./MarkdownEditor-CCqgqbbX.js";import{o as hs,r as gs,t as xs}from"./popover-Dq6_MkmZ.js";import{t as Wg}from"./activity-in5dxqje.js";import{n as _E}from"./PathInstructionsModal-CEyWg69s.js";import{t as Fk}from"./archive-CSkC2INB.js";import{t as EE}from"./arrow-down-B0zOBhzU.js";import{t as Gg}from"./arrow-left-CKq5sdlw.js";import{t as IE}from"./arrow-right-CDTbNhTa.js";import{t as TE}from"./arrow-up-down-RwrdXrTc.js";import{t as RE}from"./arrow-up-right-CnSONOF5.js";import{t as Hk}from"./arrow-up-DgjI5OHn.js";import{t as oc}from"./bot-TL3Jdr73.js";import{t as Vk}from"./boxes-BxuK2fXe.js";import{t as DE}from"./braces-Cc8xLJ1U.js";import{t as ME}from"./calendar-clock-Bm_UA63E.js";import{t as _s}from"./check-vba7RPNV.js";import{t as $r}from"./chevron-down-CTfmQYtZ.js";import{t as Qk}from"./chevron-left-DbSymkYp.js";import{t as tr}from"./chevron-right-CZqG6c6-.js";import{t as OE}from"./chevron-up-CzC1gtv6.js";import{n as Wk,t as LE}from"./SearchableSelect-DF7YpkdT.js";import{t as Gk}from"./circle-alert-DXWfyHyZ.js";import{t as Td}from"./circle-dot-ClSiVq7g.js";import{t as py}from"./circle-question-mark-CqwY53-2.js";import{t as zE}from"./circle-3iXc8Bn9.js";import{t as Dh}from"./AgentIconPicker-DHCKaIkZ.js";import{a as PE,c as UE,d as Mh,i as hy,l as $E,n as BE,o as Yk,r as KE,s as qE,t as FE,u as qu}from"./ComposerAddMenu-DBuHSmG4.js";import{t as HE}from"./clipboard-paste-0RG8HmtD.js";import{t as VE}from"./clock-BoEHLMU_.js";import{C as QE,D as WE,F as GE,O as Xk,P as gy,k as YE,t as XE,w as ZE}from"./MarkdownBody-BfIbo0pr.js";import{t as JE}from"./columns-3-BEJ-fVu5.js";import{t as eI}from"./copy-DWkF-rFH.js";import{n as tI,t as nI}from"./package-CAlqg80l.js";import{t as mf}from"./ellipsis-BK2IHFgt.js";import{t as aI}from"./external-link-CFqVy5ry.js";import{a as sI,d as iI,f as rI,g as lI,h as oI,i as cI,l as uI,m as dI,p as fI,u as mI}from"./task-chat-attachments-DtAs6_z7.js";import{t as Zk}from"./file-code-corner-P0uyjZIh.js";import{t as Jk}from"./file-text-Chu49UHl.js";import{t as Yg}from"./flag-CrPUL4EW.js";import{t as pI}from"./flask-conical-Dcrf_nx_.js";import{t as eS}from"./folder-open-Kn4cJ9z0.js";import{t as hI}from"./funnel-DCdgde5v.js";import{t as gI}from"./git-pull-request-BpJt0qs7.js";import{t as Xg}from"./inbox-Cbfplszq.js";import{t as Zg}from"./key-round-hIknfaVC.js";import{t as Jg}from"./layout-dashboard-B47lh1t7.js";import{t as xI}from"./link-2-Czdp7P22.js";import{r as za,t as pe}from"./button-Cq79rkKD.js";import{t as bI}from"./RepositoryEditor-C783DHwy.js";import{t as tS}from"./maximize-2-D_7SnXGd.js";import{t as vI}from"./minus-Cksvqs-H.js";import{n as Es,t as yI}from"./ThemeToggle-CYTGbBo5.js";import{t as jI}from"./network-DuLdTW_2.js";import{t as wI}from"./paperclip-CdwdbvAb.js";import{t as e0}from"./pencil-4y59RLDI.js";import{t as t0}from"./play-DYcWlP80.js";import{t as Xa}from"./plus-XHeYelml.js";import{t as Gl}from"./refresh-cw-CqldqiKu.js";import{t as nS}from"./repeat-5LyAUYWe.js";import{t as ec}from"./rotate-ccw-CMMEfcO3.js";import{t as kI}from"./scroll-text-C2dYnVvE.js";import{t as Br}from"./search-BXCEz7xF.js";import{t as SI}from"./send-DixgMXzs.js";import{t as aS}from"./settings-D88XZaPT.js";import{t as NI}from"./shield-alert-BEyIvSqK.js";import{t as Rd}from"./shield-check-BBMPASnP.js";import{t as CI}from"./shield-question-mark-CzkOeQok.js";import{t as AI}from"./shield-KDhiJeJq.js";import{t as _I}from"./square-DPfXoq29.js";import{t as EI}from"./terminal-Bm6kwzsr.js";import{t as Oh}from"./trash-CN4Xf2am.js";import{t as ki}from"./triangle-alert-DuUA72IB.js";import{t as II}from"./user-round-CafDnRCl.js";import{t as zl}from"./user-DrmBwrR4.js";import{t as Kr}from"./users-BCTPIiOj.js";import{t as ia}from"./x-s4V0MRUq.js";import{a as TI,i as RI,n as DI,r as MI}from"./SetupWizard-C3-3uNXq.js";import{i as OI,n as LI,r as Zn,t as zI}from"./SidebarContext-BDwcx9eV.js";import{t as n0}from"./MootMark-DpAqNyxE.js";import{a as pf,c as PI,i as UI,n as Ye,o as xy,r as $I,s as BI,t as sS}from"./SidebarNavItem-BFemYMPb.js";import{n as Kl,t as Ji}from"./primary-sidebar-styles-BdMiagDc.js";import{i as Ns,n as Cs,r as KI,t as As}from"./tooltip-BF1EZSM_.js";import{t as Bn}from"./badge-CmRCZQXu.js";import{n as qI,t as Lh}from"./Identity-DHk25Fo0.js";import{t as sr}from"./AgentAvatar-EsXsSxSG.js";import{a as Si,n as hf,o as FI,r as HI,t as VI}from"./ToastContext-hirVjDXt.js";import{t as Pa}from"./agents-HNnobIne.js";import{t as gf}from"./heartbeats-DqejhX23.js";import{t as fa}from"./instanceSettings-CUD5DYwc.js";import{a as Op,c as QI,i as WI,l as GI,n as by,o as Lp,r as YI,s as zh,t as vy}from"./agent-order-BE-pAWdx.js";import{n as cc,t as uc}from"./useSharedPolling-BsEZUKWE.js";import{m as XI,s as ZI}from"./inboxArchiveCache-BtWGk_ob.js";import{n as yy,t as ir}from"./projects-DebVPi8C.js";import{t as xf}from"./useAgentChatEnabled-hizcCAft.js";import{a as Sc,i as a0,n as Gs,o as JI,r as Nc,s as Qs,t as Ds}from"./dialog-DAYoqqlE.js";import{t as aa}from"./input-ChF32KiE.js";import{t as wi}from"./access-CbJiLazn.js";import{a as e3,c as Ph,d as t3,f as jy,h as Qi,i as n3,l as a3,m as wy,n as s3,o as i3,p as zp,r as iS,s as Uh,t as rS,u as Dd}from"./issue-filters-BO9xiK0c.js";import{a as Pl,n as lS,r as Pr,t as Mr}from"./assignees-DkQNbPzi.js";import{t as s0}from"./plugins-DxlXA9g_.js";import{n as r3,r as l3,t as Gi}from"./instance-settings-QXUWVmQs.js";import{a as o3,c as i0,d as c3,f as u3,i as ky,l as d3,m as f3,n as $h,o as Cc,p as m3,r as p3,s as h3,t as r0,u as g3}from"./slots-FyJ3Hfus.js";import{t as Ac}from"./health-DgXwfcgQ.js";import{t as rr}from"./useHiddenSettings-CXOyNixn.js";import{t as Md}from"./sidebarPreferences-CdgZXAKV.js";import{t as ct}from"./skeleton-B4cIa_g2.js";import{t as oS}from"./chatEndpoints-DkjTRXJB.js";import{t as Rl}from"./tools-ClJdhG8w.js";import{t as x3}from"./AppLogo-DTmvrLai.js";import{r as b3}from"./audit-navigation-IalprBz0.js";import{t as v3}from"./routines-Dj56gU5g.js";import{t as y3}from"./github-icon-Cd7zG3cl.js";import{n as cS,t as j3}from"./BreadcrumbContext-C1Pz9E0M.js";import{a as l0,c as Yi,i as qs,l as w3,n as k3,o as jn,r as o0,s as c0,t as uS}from"./command-Cq8PZDyP.js";import{t as ql}from"./AgentIdentity-GjMQAWCv.js";import{t as Bh}from"./secrets-DhK8O7Pz.js";import{t as dS}from"./textarea-DddKJofz.js";import{t as fS}from"./assets-j5Kg0sqV.js";import{n as S3,r as N3}from"./recent-selections-BnN_nb6Y.js";import{a as Od,i as Ld,n as Kh,r as mS,t as C3}from"./recent-assignees-DmalYaLf.js";import{t as pS}from"./toggle-switch-D8RWluFT.js";import{n as A3,t as _3}from"./presentation-mode-B1mYfRtC.js";import{a as Pp,c as Sy,d as Tr,g as Fu,h as Ny,m as gi,o as E3,s as Cy,t as I3,v as Ay}from"./TaskChatComposerTakeoverContext-DWOxDlEu.js";import{t as T3}from"./interaction-card-visibility-BruS_M_b.js";import{r as R3}from"./useMobileEntityPickerViewportStyle-CTKldW72.js";import{i as _y,n as D3,t as M3}from"./color-contrast-BHHcEMtO.js";import{t as u0}from"./InlineEntitySelector-NCqeSVBt.js";import{r as O3}from"./searchable-select-fvMNMcqm.js";import{t as Ey}from"./InlineBanner-DnQWPYOq.js";import{t as Iy}from"./select-zH7gqAbB.js";import{t as L3}from"./chip-BzNFVgX5.js";import{t as z3}from"./environments-CfHweeFn.js";import{t as d0}from"./clipboard-CTLKYvRL.js";import{n as P3,r as U3,t as $3}from"./AgentSetupPrompt-CRMBM6wm.js";import{t as f0}from"./usePrefersReducedMotion-D9kOF5TM.js";import{t as B3}from"./use-copy-action-JoIz-xmX.js";import{i as K3}from"./app-connect-policy-IJzJACTA.js";import{t as _c}from"./card-DCb-JOH-.js";import{t as hS}from"./agentChats-C2bFjmaS.js";import{t as q3}from"./ThemeContext-DD1EP5qf.js";import{n as F3,r as vi,t as Ul}from"./OmpSignIn-BSLYU6uC.js";import{n as H3,t as V3}from"./segmented-tifc6Dov.js";import{t as Vs}from"./StatusIcon-C2NWeA8n.js";import{a as Q3,d as W3,i as G3,l as Y3,s as X3,t as Z3}from"./issue-blockers-CPChygIu.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 d of c)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&l(m)}).observe(document,{childList:!0,subtree:!0});function i(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}r(i,"getFetchOpts");function l(c){if(c.ep)return;c.ep=!0;const d=i(c);fetch(c.href,d)}r(l,"processPreload")}),"polyfill")();var Ty=/^paperclip(?=[:.])/;function J3(e){const t=[];for(let i=0;i<e.length;i+=1){const l=e.key(i);l!==null&&Ty.test(l)&&t.push(l)}for(const i of t){const l=e.getItem(i),c=i.replace(Ty,"wardmote");l!==null&&e.getItem(c)===null&&e.setItem(c,l),e.removeItem(i)}}r(J3,"migrateRetiredStorageKeys");for(const e of[()=>window.localStorage,()=>window.sessionStorage])try{J3(e())}catch{continue}function gS(e){return(typeof e=="string"?e:e?.name??"").trim()}r(gS,"rawNameOf");function xS(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(xS,"looksLikeNetworkAddress");function qh(e){return e.split(/[\s._-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}r(qh,"titleCaseIdentifier");function eT(e){const t=/^plugin:\s*(.+)$/i.exec(e);if(!t)return null;let i=t[1].trim();return i=i.slice(i.lastIndexOf(".")+1),i=i.replace(/^plugin[-_]/i,""),qh(i)||"Custom app"}r(eT,"pluginPackageLabel");function tT(e,t={}){const i=t.title?.trim();if(i)return i;const l=gS(e);if(!l||xS(l))return"Custom app";const c=eT(l);if(c)return c;if(l.includes(":")&&!l.includes("://")){const d=l.slice(l.lastIndexOf(":")+1).trim();if(d)return qh(d)}return/\s/.test(l)||/[A-Z]/.test(l)?l:/[._-]/.test(l)?qh(l):l}r(tT,"humanizeConnectionDisplayName");function iQ(e){const t=gS(e);return t&&xS(t)?`hosted at ${t}`:null}r(iQ,"connectionDisplaySecondaryHint");var bS={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"}]]};bS.node;var nT=nt(bS),vS={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["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"}]]};vS.node;var aT=nt(vS),yS={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"}]]};yS.node;var sT=nt(yS),jS={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"}]]};jS.node;var iT=nt(jS),wS={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"]};wS.node;var kS=nt(wS),SS={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"]};SS.node;var NS=nt(SS),CS={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"]};CS.node;var rT=nt(CS),AS={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};AS.node;var lT=nt(AS),_S={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"}]]};_S.node;var ES=nt(_S),IS={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"}]]};IS.node;var Fh=nt(IS),TS={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"}]]};TS.node;var oT=nt(TS),RS={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"}]]};RS.node;var cT=nt(RS),DS={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"}]]};DS.node;var uT=nt(DS),MS={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"}]]};MS.node;var dT=nt(MS),OS={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"]};OS.node;var fT=nt(OS),LS={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"}]]};LS.node;var mT=nt(LS),zS={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"]};zS.node;var pT=nt(zS),PS={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"}]]};PS.node;var hT=nt(PS),US={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"}]]};US.node;var Hh=nt(US),$S={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"}]]};$S.node;var gT=nt($S),BS={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"}]]};BS.node;var xT=nt(BS),KS={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"}]]};KS.node;var qS=nt(KS),FS={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"}]]};FS.node;var bT=nt(FS),HS={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"}]]};HS.node;var bf=nt(HS),VS={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};VS.node;var QS=nt(VS),WS={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"}]]};WS.node;var Vh=nt(WS),GS={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"}]]};GS.node;var vT=nt(GS),YS={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"}]]};YS.node;var XS=nt(YS),ZS={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"}]]};ZS.node;var yT=nt(ZS),JS={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"}]]};JS.node;var e1=nt(JS),t1={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"}]]};t1.node;var n1=nt(t1),a1={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"}]]};a1.node;var jT=nt(a1),s1={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"}]]};s1.node;var wT=nt(s1),i1={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"}]]};i1.node;var kT=nt(i1),r1={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"]};r1.node;var m0=nt(r1),l1={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"}]]};l1.node;var ST=nt(l1),o1={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"}]]};o1.node;var NT=nt(o1),c1={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"}]]};c1.node;var CT=nt(c1),u1={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"}]]};u1.node;var d1=nt(u1),f1={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"]};f1.node;var AT=nt(f1),m1={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"]};m1.node;var p0=nt(m1),p1={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"]};p1.node;var _T=nt(p1),h1={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"]};h1.node;var ET=nt(h1),g1={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"}]]};g1.node;var IT=nt(g1),x1={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"}]]};x1.node;var TT=nt(x1),b1={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"}]]};b1.node;var v1=nt(b1),y1={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"}]]};y1.node;var RT=nt(y1),j1={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};j1.node;var DT=nt(j1),w1={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"}]]};w1.node;var k1=nt(w1),S1={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"}]]};S1.node;var MT=nt(S1),N1={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"}]]};N1.node;var OT=nt(N1),Dl=Og(bk()),b=Og(Lg(),1),C1="wardmote.staleChunkReload";function LT(){try{return window.sessionStorage}catch{return null}}r(LT,"sessionStore");function zT(e){try{e?.removeItem(C1)}catch{return}}r(zT,"clearReloadMark");function PT(e,t){if(!e)return!1;try{return e.getItem("wardmote.staleChunkReload")===t?!1:(e.setItem(C1,t),!0)}catch{return!1}}r(PT,"markReloadOnce");function ke(e,t={}){const i=t.reload??(()=>window.location.reload()),l=t.path??(()=>window.location.pathname);return(0,b.lazy)(async()=>{const c=t.storage===void 0?LT():t.storage;try{const d=await e();return zT(c),{default:d}}catch(d){if(!PT(c,l()))throw d;return i(),new Promise(()=>{})}})}r(ke,"lazyPage");var st=r(e=>typeof e=="string","isString$1"),Qo=r(()=>{let e,t;const i=new Promise((l,c)=>{e=l,t=c});return i.resolve=e,i.reject=t,i},"defer"),Up=r(e=>e==null?"":String(e),"makeString"),UT=r((e,t,i)=>{e.forEach(l=>{t[l]&&(i[l]=t[l])})},"copy"),$T=/###/g,Ry=r(e=>e&&e.includes("###")?e.replace($T,"."):e,"cleanKey"),Dy=r(e=>!e||st(e),"canNotTraverseDeeper"),tc=r((e,t,i)=>{const l=st(t)?t.split("."):t;let c=0;for(;c<l.length-1;){if(Dy(e))return{};const d=Ry(l[c]);!e[d]&&i&&(e[d]=new i),Object.prototype.hasOwnProperty.call(e,d)?e=e[d]:e={},++c}return Dy(e)?{}:{obj:e,k:Ry(l[c])}},"getLastOfPath"),My=r((e,t,i)=>{const{obj:l,k:c}=tc(e,t,Object);if(l!==void 0||t.length===1){l[c]=i;return}let d=t[t.length-1],m=t.slice(0,t.length-1),f=tc(e,m,Object);for(;f.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),f=tc(e,m,Object),f?.obj&&typeof f.obj[`${f.k}.${d}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${d}`]=i},"setPath"),BT=r((e,t,i,l)=>{const{obj:c,k:d}=tc(e,t,Object);c[d]=c[d]||[],c[d].push(i)},"pushPath"),zd=r((e,t)=>{const{obj:i,k:l}=tc(e,t);if(i&&Object.prototype.hasOwnProperty.call(i,l))return i[l]},"getPath"),KT=r((e,t,i)=>{const l=zd(e,i);return l!==void 0?l:zd(t,i)},"getPathWithDefaults"),A1=r((e,t,i)=>{for(const l in t)l!=="__proto__"&&l!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,l)?st(e[l])||e[l]instanceof String||st(t[l])||t[l]instanceof String?i&&(e[l]=t[l]):A1(e[l],t[l],i):e[l]=t[l]);return e},"deepExtend"),xi=r(e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),"regexEscape"),qT={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},FT=r(e=>st(e)?e.replace(/[&<>"'\/]/g,t=>qT[t]):e,"escape"),HT=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 i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}},VT=[" ",",","?","!",";"],QT=new HT(20),WT=r((e,t,i)=>{t=t||"",i=i||"";const l=VT.filter(m=>!t.includes(m)&&!i.includes(m));if(l.length===0)return!0;const c=QT.getRegExp(`(${l.map(m=>m==="?"?"\\?":m).join("|")})`);let d=!c.test(e);if(!d){const m=e.indexOf(i);m>0&&!c.test(e.substring(0,m))&&(d=!0)}return d},"looksLikeObjectPath"),Qh=r((e,t,i=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const l=t.split(i);let c=e;for(let d=0;d<l.length;){if(!c||typeof c!="object")return;let m,f="";for(let h=d;h<l.length;++h)if(h!==d&&(f+=i),f+=l[h],m=c[f],m!==void 0){if(["string","number","boolean"].includes(typeof m)&&h<l.length-1)continue;d+=h-d+1;break}c=m}return c},"deepFind"),dc=r(e=>e?.replace(/_/g,"-"),"getCleanedCode"),GT={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)}},YT=class Wh{static{r(this,"Logger")}constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||GT,this.options=i,this.debug=i.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,i,l,c){return c&&!this.debug?null:(t=t.map(d=>st(d)?d.replace(/[\r\n\x00-\x1F\x7F]/g," "):d),st(t[0])&&(t[0]=`${l}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Wh(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Wh(this.logger,t)}},Hs=new YT,vf=class{static{r(this,"EventEmitter")}constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const l=this.observers[i].get(t)||0;this.observers[i].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 i=r((...l)=>{t(...l),this.off(e,i)},"wrapper");return this.on(e,i),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,l])=>{for(let c=0;c<l;c++)i(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,l])=>{for(let c=0;c<l;c++)i(e,...t)})}},Oy=class extends vf{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,i,l={}){const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,d=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let m;e.includes(".")?m=e.split("."):(m=[e,t],i&&(Array.isArray(i)?m.push(...i):st(i)&&c?m.push(...i.split(c)):m.push(i)));const f=zd(this.data,m);return!f&&!t&&!i&&e.includes(".")&&(e=m[0],t=m[1],i=m.slice(2).join(".")),f||!d||!st(i)?f:Qh(this.data?.[e]?.[t],i,c)}addResource(e,t,i,l,c={silent:!1}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let m=[e,t];i&&(m=m.concat(d?i.split(d):i)),e.includes(".")&&(m=e.split("."),l=t,t=m[1]),this.addNamespaces(t),My(this.data,m,l),c.silent||this.emit("added",e,t,i,l)}addResources(e,t,i,l={silent:!1}){for(const c in i)(st(i[c])||Array.isArray(i[c]))&&this.addResource(e,t,c,i[c],{silent:!0});l.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,l,c,d={silent:!1,skipCopy:!1}){let m=[e,t];e.includes(".")&&(m=e.split("."),l=i,i=t,t=m[1]),this.addNamespaces(t);let f=zd(this.data,m)||{};d.skipCopy||(i=JSON.parse(JSON.stringify(i))),l?A1(f,i,c):f={...f,...i},My(this.data,m,f),d.silent||this.emit("added",e,t,i)}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(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}},_1={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,l,c){return e.forEach(d=>{t=this.processors[d]?.process(t,i,l,c)??t}),t}},E1=Symbol("i18next/PATH_KEY");function XT(){const e=[],t=Object.create(null);let i;return t.get=(l,c)=>(i?.revoke?.(),c===E1?e:(e.push(c),i=Proxy.revocable(l,t),i.proxy)),Proxy.revocable(Object.create(null),t).proxy}r(XT,"createProxy");function $l(e,t){const{[E1]:i}=e(XT()),l=t?.keySeparator??".",c=t?.nsSeparator??":",d=t?.enableSelector==="strict";if(i.length>1&&c){const m=t?.ns,f=d?Array.isArray(m)?m:m?[m]:null:Array.isArray(m)?m:null;if(f&&(d?f:f.length>1?f.slice(1):[]).includes(i[0]))return`${i[0]}${c}${i.slice(1).join(l)}`}return i.join(l)}r($l,"keysFromSelector");var $p=r(e=>!st(e)&&typeof e!="boolean"&&typeof e!="number","shouldHandleAsObject"),Ly=class I1 extends vf{static{r(this,"Translator")}constructor(t,i={}){super(),UT(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Hs.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const l={...i};if(t==null)return!1;const c=this.resolve(t,l);if(c?.res===void 0)return!1;const d=$p(c.res);return!(l.returnObjects===!1&&d)}extractFromKey(t,i){let l=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;l===void 0&&(l=":");const c=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let d=i.ns||this.options.defaultNS||[];const m=l&&t.includes(l),f=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!WT(t,l,c);if(m&&!f){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:st(d)?[d]:d};const g=t.split(l);(l!==c||l===c&&this.options.ns.includes(g[0]))&&(d=g.shift()),t=g.join(c)}return{key:t,namespaces:st(d)?[d]:d}}translate(t,i,l){let c=typeof i=="object"?{...i}:i;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=$l(t,{...this.options,...c})),Array.isArray(t)||(t=[String(t)]),t=t.map(se=>typeof se=="function"?$l(se,{...this.options,...c}):String(se));const d=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,m=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?d?{res:`${g}${v}${f}`,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:g,usedParams:this.getUsedParamsDetails(c)}:`${g}${v}${f}`:d?{res:f,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:g,usedParams:this.getUsedParamsDetails(c)}:f;const k=this.resolve(t,c);let N=k?.res;const S=k?.usedKey||f,D=k?.exactUsedKey||f,R=["[object Number]","[object Function]","[object RegExp]"],E=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,I=c.count!==void 0&&!st(c.count),O=I1.hasDefaultValue(c),z=I?this.pluralResolver.getSuffix(y,c.count,c):"",B=c.ordinal&&I?this.pluralResolver.getSuffix(y,c.count,{ordinal:!1}):"",L=I&&!c.ordinal&&c.count===0,_=L&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${z}`]||c[`defaultValue${B}`]||c.defaultValue;let U=N;C&&!N&&O&&(U=_);const F=$p(U),Y=Object.prototype.toString.apply(U);if(C&&U&&F&&!R.includes(Y)&&!(st(E)&&Array.isArray(U))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const se=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,U,{...c,ns:h}):`key '${f} (${this.language})' returned an object instead of string.`;return d?(k.res=se,k.usedParams=this.getUsedParamsDetails(c),k):se}if(m){const se=Array.isArray(U),me=se?[]:{},oe=se?D:S;for(const $ in U)if(Object.prototype.hasOwnProperty.call(U,$)){const T=`${oe}${m}${$}`;O&&!N?me[$]=this.translate(T,{...c,defaultValue:$p(_)?_[$]:void 0,joinArrays:!1,ns:h}):me[$]=this.translate(T,{...c,joinArrays:!1,ns:h}),me[$]===T&&(me[$]=U[$])}N=me}}else if(C&&st(E)&&Array.isArray(N))N=N.join(E),N&&(N=this.extendTranslation(N,t,c,l));else{let se=!1,me=!1;!this.isValidLookup(N)&&O&&(se=!0,N=_),this.isValidLookup(N)||(me=!0,N=f);const oe=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&me?void 0:N,$=O&&_!==N&&this.options.updateMissing;if(me||se||$){if(this.logger.log($?"updateKey":"missingKey",y,g,I&&!$?`${f}${this.pluralResolver.getSuffix(y,c.count,c)}`:f,$?_:N),m){const ae=this.resolve(f,{...c,keySeparator:!1});ae&&ae.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 T=[];const te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(let ae=0;ae<te.length;ae++)T.push(te[ae]);else this.options.saveMissingTo==="all"?T=this.languageUtils.toResolveHierarchy(c.lng||this.language):T.push(c.lng||this.language);const ce=r((ae,Ce,ue)=>{const we=O&&ue!==N?ue:oe;this.options.missingKeyHandler?this.options.missingKeyHandler(ae,g,Ce,we,$,c):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ae,g,Ce,we,$,c),this.emit("missingKey",ae,g,Ce,N)},"send");this.options.saveMissing&&(this.options.saveMissingPlurals&&I?T.forEach(ae=>{const Ce=this.pluralResolver.getSuffixes(ae,c);L&&c[`defaultValue${this.options.pluralSeparator}zero`]&&!Ce.includes(`${this.options.pluralSeparator}zero`)&&Ce.push(`${this.options.pluralSeparator}zero`),Ce.forEach(ue=>{ce([ae],f+ue,c[`defaultValue${ue}`]||_)})}):ce(T,f,_))}N=this.extendTranslation(N,t,c,k,l),me&&N===f&&this.options.appendNamespaceToMissingKey&&(N=`${g}${v}${f}`),(me||se)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${v}${f}`:f,se?N:void 0,c))}return d?(k.res=N,k.usedParams=this.getUsedParamsDetails(c),k):N}extendTranslation(t,i,l,c,d){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=st(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&&!st(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)=>d?.[0]===y[0]&&!l.context?(this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${i[0]}`),null):this.translate(...y,i),l)),l.interpolation&&this.interpolator.reset()}const m=l.postProcess||this.options.postProcess,f=st(m)?[m]:m;return t!=null&&f?.length&&l.applyPostProcessor!==!1&&(t=_1.handle(f,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(l)},...l}:l,this)),t}resolve(t,i={}){let l,c,d,m,f;return st(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(h=>typeof h=="function"?$l(h,{...this.options,...i}):h)),t.forEach(h=>{if(this.isValidLookup(l))return;const g=this.extractFromKey(h,i),v=g.key;c=v;let y=g.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const j=i.count!==void 0&&!st(i.count),k=j&&!i.ordinal&&i.count===0,N=i.context!==void 0&&(st(i.context)||typeof i.context=="number")&&i.context!=="",S=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);y.forEach(D=>{this.isValidLookup(l)||(f=D,!this.checkedLoadedFor[`${S[0]}-${D}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(f)&&(this.checkedLoadedFor[`${S[0]}-${D}`]=!0,this.logger.warn(`key "${c}" for languages "${S.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!!!")),S.forEach(R=>{if(this.isValidLookup(l))return;m=R;const E=[v];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(E,v,R,D,i);else{let I;j&&(I=this.pluralResolver.getSuffix(R,i.count,i));const O=`${this.options.pluralSeparator}zero`,z=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(j&&(i.ordinal&&I.startsWith(z)&&E.push(v+I.replace(z,this.options.pluralSeparator)),E.push(v+I),k&&E.push(v+O)),N){const B=`${v}${this.options.contextSeparator||"_"}${i.context}`;E.push(B),j&&(i.ordinal&&I.startsWith(z)&&E.push(B+I.replace(z,this.options.pluralSeparator)),E.push(B+I),k&&E.push(B+O))}}let C;for(;C=E.pop();)this.isValidLookup(l)||(d=C,l=this.getResource(R,D,C,i))}))})}),{res:l,usedKey:c,exactUsedKey:d,usedLng:m,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,l,c={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,l,c):this.resourceStore.getResource(t,i,l,c)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],l=t.replace&&!st(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 d of i)delete c[d]}return c}static hasDefaultValue(t){const i="defaultValue";for(const l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&l.startsWith(i)&&t[l]!==void 0)return!0;return!1}},zy=class{static{r(this,"LanguageUtil")}constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Hs.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=dc(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=dc(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(st(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(i=>{if(t)return;const l=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(l))&&(t=l)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;const l=this.getScriptPartFromCode(i);if(this.isSupportedCode(l))return t=l;const c=this.getLanguagePartFromCode(i);if(this.isSupportedCode(c))return t=c;t=this.options.supportedLngs.find(d=>d===c?!0:!d.includes("-")&&!c.includes("-")?!1:!!(d.includes("-")&&!c.includes("-")&&d.slice(0,d.indexOf("-"))===c||d.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)),st(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){const i=this.options.fallbackLng,l=Array.isArray(i)?i.join("|"):i;l!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=l);const c=t===void 0||t===!1||st(t),d=t===void 0&&typeof this.options.fallbackLng=="function",m=st(e)&&c&&!d;let f=null;if(m){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 st(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))):st(e)&&v(this.formatLanguageCode(e)),h.forEach(y=>{g.includes(y)||v(this.formatLanguageCode(y))}),f!==null?(this.resolveHierarchyCache[f]=g,g.slice()):g}},Py={zero:0,one:1,two:2,few:3,many:4,other:5},Uy={select:r(e=>e===1?"one":"other","select"),resolvedOptions:r(()=>({pluralCategories:["one","other"]}),"resolvedOptions")},ZT=class{static{r(this,"PluralResolver")}constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Hs.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const i=dc(e==="dev"?"en":e),l=t.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:i,type:l});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let d;try{d=new Intl.PluralRules(i,{type:l})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Uy;if(!e.match(/-|_/))return Uy;const f=this.languageUtils.getLanguagePartFromCode(e);d=this.getRule(f,t)}return this.pluralRulesCache[c]=d,d}needsPlural(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,i={}){return this.getSuffixes(e,i).map(l=>`${t}${l}`)}getSuffixes(e,t={}){let i=this.getRule(e,t);return i||(i=this.getRule("dev",t)),i?i.resolvedOptions().pluralCategories.sort((l,c)=>Py[l]-Py[c]).map(l=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(e,t,i={}){const l=this.getRule(e,i);return l?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${l.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,i))}},$y=r((e,t,i,l=".",c=!0)=>{let d=KT(e,t,i);return!d&&c&&st(i)&&(d=Qh(e,i,l),d===void 0&&(d=Qh(t,i,l))),d},"deepFindWithDefaults"),By=r(e=>e.replace(/\$/g,"$$$$"),"regexSafe"),Ky=class{static{r(this,"Interpolator")}constructor(e={}){this.logger=Hs.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:i,useRawValueToEscape:l,prefix:c,prefixEscaped:d,suffix:m,suffixEscaped:f,formatSeparator:h,unescapeSuffix:g,unescapePrefix:v,nestingPrefix:y,nestingPrefixEscaped:j,nestingSuffix:k,nestingSuffixEscaped:N,nestingOptionsSeparator:S,maxReplaces:D,alwaysFormat:R}=e.interpolation;this.escape=t!==void 0?t:FT,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=c?xi(c):d||"{{",this.suffix=m?xi(m):f||"}}",this.formatSeparator=h||",",this.unescapePrefix=g?"":v?xi(v):"-",this.unescapeSuffix=this.unescapePrefix?"":g?xi(g):"",this.nestingPrefix=y?xi(y):j||xi("$t("),this.nestingSuffix=k?xi(k):N||xi(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=D||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=r((t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"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,i,l){let c,d,m;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=r(y=>{if(!y.includes(this.formatSeparator)){const S=$y(t,f,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,i,{...l,...t,interpolationkey:y}):S}const j=y.split(this.formatSeparator),k=j.shift().trim(),N=j.join(this.formatSeparator).trim();return this.format($y(t,f,k,this.options.keySeparator,this.options.ignoreJSONStructure),N,i,{...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(m=0;c=y.regex.exec(e);){const j=c[1].trim();if(d=h(j),d===void 0)if(typeof g=="function"){const N=g(e,c,l);d=st(N)?N:""}else if(l&&Object.prototype.hasOwnProperty.call(l,j))d="";else if(v){d=c[0];continue}else this.logger.warn(`missed to pass in variable ${j} for interpolating ${e}`),d="";else!st(d)&&!this.useRawValueToEscape&&(d=Up(d));const k=y.safeValue(d);if(e=e.replace(c[0],By(k)),v?(y.regex.lastIndex+=k.length,y.regex.lastIndex-=c[0].length):y.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),e}nest(e,t,i={}){let l,c,d;const m=r((f,h)=>{const g=this.nestingOptionsSeparator;if(!f.includes(g))return f;const v=f.split(new RegExp(`${xi(g)}[ ]*{`));let y=`{${v[1]}`;f=v[0],y=this.interpolate(y,d);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{d=JSON.parse(y),h&&(d={...h,...d})}catch(N){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,N),`${f}${g}${y}`}return d.defaultValue&&d.defaultValue.includes(this.prefix)&&delete d.defaultValue,f},"handleHasOptions");for(;l=this.nestingRegexp.exec(e);){let f=[];d={...i},d=d.replace&&!st(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.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(m.call(this,l[1].trim(),d),d),c&&l[0]===e&&!st(c))return c;st(c)||(c=Up(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,i.lng,{...i,interpolationkey:l[1].trim()}),c.trim())),e=e.replace(l[0],By(Up(c))),this.regexp.lastIndex=0}return e}},JT=r(e=>{let t=e.toLowerCase().trim();const i={};if(e.includes("(")){const l=e.split("(");t=l[0].toLowerCase().trim();const c=l[1].slice(0,-1);t==="currency"&&!c.includes(":")?i.currency||(i.currency=c.trim()):t==="relativetime"&&!c.includes(":")?i.range||(i.range=c.trim()):c.split(";").forEach(d=>{if(d){const[m,...f]=d.split(":"),h=f.join(":").trim().replace(/^'+|'+$/g,""),g=m.trim();i[g]||(i[g]=h),h==="false"&&(i[g]=!1),h==="true"&&(i[g]=!0),isNaN(h)||(i[g]=parseInt(h,10))}})}return{formatName:t,formatOptions:i}},"parseFormatStr"),qy=r(e=>{const t={};return(i,l,c)=>{let d=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(d={...d,[c.interpolationkey]:void 0});const m=l+JSON.stringify(d);let f=t[m];return f||(f=e(dc(l),c),t[m]=f),f(i)}},"createCachedFormatter"),eR=r(e=>(t,i,l)=>e(dc(i),l)(t),"createNonCachedFormatter"),tR=class{static{r(this,"Formatter")}constructor(e={}){this.logger=Hs.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const i=t.cacheInBuiltFormats?qy:eR;this.formats={number:i((l,c)=>{const d=new Intl.NumberFormat(l,{...c});return m=>d.format(m)}),currency:i((l,c)=>{const d=new Intl.NumberFormat(l,{...c,style:"currency"});return m=>d.format(m)}),datetime:i((l,c)=>{const d=new Intl.DateTimeFormat(l,{...c});return m=>d.format(m)}),relativetime:i((l,c)=>{const d=new Intl.RelativeTimeFormat(l,{...c});return m=>d.format(m,c.range||"day")}),list:i((l,c)=>{const d=new Intl.ListFormat(l,{...c});return m=>d.format(m)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=qy(t)}format(e,t,i,l={}){if(!t||e==null)return e;const c=t.split(this.formatSeparator),d=[];for(let m=0;m<c.length;m++){let f=c[m];for(;f.indexOf("(")>-1&&!f.includes(")")&&m+1<c.length;)f=`${f}${this.formatSeparator}${c[++m]}`;d.push(f)}return d.reduce((m,f)=>{const{formatName:h,formatOptions:g}=JT(f);if(this.formats[h]){let v=m;try{const y=l?.formatParams?.[l.interpolationkey]||{},j=y.locale||y.lng||l.locale||l.lng||i;v=this.formats[h](m,j,{...g,...l,...y})}catch(y){this.logger.warn(y)}return v}else this.logger.warn(`there was no format function for ${h}`);return m},e)}},nR=r((e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},"removePending"),aR=class extends vf{static{r(this,"Connector")}constructor(e,t,i,l={}){super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=l,this.logger=Hs.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?.(i,l.backend,l)}queueLoad(e,t,i,l){const c={},d={},m={},f={};return e.forEach(h=>{let g=!0;t.forEach(v=>{const y=`${h}|${v}`;!i.reload&&this.store.hasResourceBundle(h,v)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?d[y]===void 0&&(d[y]=!0):(this.state[y]=1,g=!1,d[y]===void 0&&(d[y]=!0),c[y]===void 0&&(c[y]=!0),f[v]===void 0&&(f[v]=!0)))}),g||(m[h]=!0)}),(Object.keys(c).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(c),pending:Object.keys(d),toLoadLanguages:Object.keys(m),toLoadNamespaces:Object.keys(f)}}loaded(e,t,i){const l=e.split("|"),c=l[0],d=l[1];t&&this.emit("failedLoading",c,d,t),!t&&i&&this.store.addResourceBundle(c,d,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);const m={};this.queue.forEach(f=>{BT(f.loaded,[c],d),nR(f,e),t&&f.errors.push(t),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(h=>{m[h]||(m[h]={});const g=f.loaded[h];g.length&&g.forEach(v=>{m[h][v]===void 0&&(m[h][v]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",m),this.queue=this.queue.filter(f=>!f.done)}read(e,t,i,l=0,c=this.retryTimeout,d){if(!e.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:l,wait:c,callback:d});return}this.readingCalls++;const m=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,i,l+1,c*2,d)},c);return}d(h,g)},"resolver"),f=this.backend[i].bind(this.backend);if(f.length===2){try{const h=f(e,t);h&&typeof h.then=="function"?h.then(g=>m(null,g)).catch(m):m(null,h)}catch(h){m(h)}return}return f(e,t,m)}prepareLoading(e,t,i={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();st(e)&&(e=this.languageUtils.toResolveHierarchy(e)),st(t)&&(t=[t]);const c=this.queueLoad(e,t,i,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(d=>{this.loadOne(d)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e,t=""){const i=e.split("|"),l=i[0],c=i[1];this.read(l,c,"read",void 0,void 0,(d,m)=>{d&&this.logger.warn(`${t}loading namespace ${c} for language ${l} failed`,d),!d&&m&&this.logger.log(`${t}loaded namespace ${c} for language ${l}`,m),this.loaded(e,d,m)})}saveMissing(e,t,i,l,c,d={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" 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(!(i==null||i==="")){if(this.backend?.create){const f={...d,isUpdate:c},h=this.backend.create.bind(this.backend);if(h.length<6)try{let g;h.length===5?g=h(e,t,i,l,f):g=h(e,t,i,l),g&&typeof g.then=="function"?g.then(v=>m(null,v)).catch(m):m(null,g)}catch(g){m(g)}else h(e,t,i,l,m,f)}!e||!e[0]||this.store.addResource(e[0],t,i,l)}}},Bp=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]),st(e[1])&&(t.defaultValue=e[1]),st(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const i=e[3]||e[2];Object.keys(i).forEach(l=>{t[l]=i[l]})}return t},"overloadTranslationOptionHandler"),interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),"get"),Fy=r(e=>(st(e.ns)&&(e.ns=[e.ns]),st(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),st(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),"transformOptions"),Hu=r(()=>{},"noop$1"),sR=r(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]=="function"&&(e[t]=e[t].bind(e))})},"bindMemberFunctions"),iR=class xd extends vf{static{r(this,"I18n")}constructor(t={},i){if(super(),this.options=Fy(t),this.services={},this.logger=Hs,this.modules={external:[]},sR(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(t={},i){this.isInitializing=!0,typeof t=="function"&&(i=t,t={}),t.defaultNS==null&&t.ns&&(st(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const l=Bp();this.options={...l,...this.options,...Fy(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?Hs.init(c(this.modules.logger),this.options):Hs.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=tR;const h=new zy(this.options);this.store=new Oy(this.options.resources,this.options);const g=this.services;g.logger=Hs,g.resourceStore=this.store,g.languageUtils=h,g.pluralResolver=new ZT(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 Ky(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new aR(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 Ly(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,i||(i=Hu),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 d=Qo(),m=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),d.resolve(g),i(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?m():setTimeout(m,0),d}loadResources(t,i=Hu){let l=i;const c=st(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 d=[],m=r(f=>{f&&f!=="cimode"&&this.services.languageUtils.toResolveHierarchy(f).forEach(h=>{h!=="cimode"&&(d.includes(h)||d.push(h))})},"append");c?m(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>m(f)),this.options.preload?.forEach?.(f=>m(f)),this.services.backendConnector.load(d,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),l(f)})}else l(null)}reloadResources(t,i,l){const c=Qo();return typeof t=="function"&&(l=t,t=void 0),typeof i=="function"&&(l=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),l||(l=Hu),this.services.backendConnector.reload(t,i,d=>{c.resolve(),l(d)}),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"&&_1.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 i=0;i<this.languages.length;i++){const l=this.languages[i];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,i){this.isLanguageChangingTo=t;const l=Qo();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"),d=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)),i&&i(f,(...g)=>this.t(...g))},"done"),m=r(f=>{!t&&!f&&this.services.languageDetector&&(f=[]);const h=st(f)?f:f&&f[0],g=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(st(f)?[f]:f);g&&(this.language||c(g),this.translator.language||this.translator.changeLanguage(g),this.services.languageDetector?.cacheUserLanguage?.(g)),this.loadResources(g,v=>{d(v,g)})},"setLng");return!t&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(t),l}getFixedT(t,i,l,c){const d=c?.scopeNs,m=r((f,h,...g)=>{let v;typeof h!="object"?v=this.options.overloadTranslationOptionHandler([f,h].concat(g)):v={...h},v.lng=v.lng||m.lng,v.lngs=v.lngs||m.lngs;const y=v.ns!==void 0&&v.ns!==null;v.ns=v.ns||m.ns,v.keyPrefix!==""&&(v.keyPrefix=v.keyPrefix||l||m.keyPrefix);const j={...this.options,...v};Array.isArray(d)&&!y&&(j.ns=d),typeof v.keyPrefix=="function"&&(v.keyPrefix=$l(v.keyPrefix,j));const k=this.options.keySeparator||".";let N;return v.keyPrefix&&Array.isArray(f)?N=f.map(S=>(typeof S=="function"&&(S=$l(S,j)),`${v.keyPrefix}${k}${S}`)):(typeof f=="function"&&(f=$l(f,j)),N=v.keyPrefix?`${v.keyPrefix}${k}${f}`:f),this.t(N,v)},"fixedT");return st(t)?m.lng=t:m.lngs=t,m.ns=i,m.keyPrefix=l,m}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){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=i.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,d=this.languages[this.languages.length-1];if(l.toLowerCase()==="cimode")return!0;const m=r((f,h)=>{const g=this.services.backendConnector.state[`${f}|${h}`];return g===-1||g===0||g===2},"loadNotPending");if(i.precheck){const f=i.precheck(this,m);if(f!==void 0)return f}return!!(this.hasResourceBundle(l,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(l,t)&&(!c||m(d,t)))}loadNamespaces(t,i){const l=Qo();return this.options.ns?(st(t)&&(t=[t]),t.forEach(c=>{this.options.ns.includes(c)||this.options.ns.push(c)}),this.loadResources(c=>{l.resolve(),i&&i(c)}),l):(i&&i(),Promise.resolve())}loadLanguages(t,i){const l=Qo();st(t)&&(t=[t]);const c=this.options.preload||[],d=t.filter(m=>!c.includes(m)&&this.services.languageUtils.isSupportedCode(m));return d.length?(this.options.preload=c.concat(d),this.loadResources(m=>{l.resolve(),i&&i(m)}),l):(i&&i(),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 d=c.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const i=["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 zy(Bp());return t.toLowerCase().indexOf("-latn")>1?"ltr":i.includes(l.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const l=new xd(t,i);return l.createInstance=xd.createInstance,l}cloneInstance(t={},i=Hu){const l=t.forkResourceStore;l&&delete t.forkResourceStore;const c={...this.options,...t,isClone:!0},d=new xd(c);if((t.debug!==void 0||t.prefix!==void 0)&&(d.logger=d.logger.clone(t)),["store","services","language"].forEach(m=>{d[m]=this[m]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},l){const m=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),{});d.store=new Oy(m,c),d.services.resourceStore=d.store}if(t.interpolation){const m={...Bp().interpolation,...this.options.interpolation,...t.interpolation},f={...c,interpolation:m};d.services.interpolator=new Ky(f)}return d.translator=new Ly(d.services,c),d.translator.on("*",(m,...f)=>{d.emit(m,...f)}),d.init(c,i),d.translator.options=c,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},Na=iR.createInstance(),rQ=Na.createInstance,lQ=Na.dir,oQ=Na.init,cQ=Na.loadResources,uQ=Na.reloadResources,dQ=Na.use,fQ=Na.changeLanguage,mQ=Na.getFixedT,pQ=Na.t,hQ=Na.exists,gQ=Na.setDefaultNamespace,xQ=Na.hasLoadedNamespace,bQ=Na.loadNamespaces,vQ=Na.loadLanguages,rR=r((e,t,i,l)=>{const c=[i,{code:t,...l||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(c,"warn","react-i18next::",!0);qr(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),e?.services?.logger?.warn&&e.services.logger.warn(...c)},"warn"),Hy={},bd=r((e,t,i,l)=>{qr(i)&&Hy[i]||(qr(i)&&(Hy[i]=new Date),rR(e,t,i,l))},"warnOnce"),T1=r((e,t)=>()=>{if(e.isInitialized)t();else{const i=r(()=>{setTimeout(()=>{e.off("initialized",i)},0),t()},"initialized");e.on("initialized",i)}},"loadedClb"),Gh=r((e,t,i)=>{e.loadNamespaces(t,T1(e,i))},"loadNamespaces"),Vy=r((e,t,i,l)=>{if(qr(i)&&(i=[i]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Gh(e,i,l);i.forEach(c=>{e.options.ns.indexOf(c)<0&&e.options.ns.push(c)}),e.loadLanguages(t,T1(e,l))},"loadLanguages"),lR=r((e,t,i={})=>!t.languages||!t.languages.length?(bd(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:i.lng,precheck:r((l,c)=>{if(i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&l.services.backendConnector.backend&&l.isLanguageChangingTo&&!c(l.isLanguageChangingTo,e))return!1},"precheck")}),"hasLoadedNamespace"),qr=r(e=>typeof e=="string","isString"),oR=r(e=>typeof e=="object"&&e!==null,"isObject"),cR=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,uR={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},dR=r(e=>uR[e],"unescapeHtmlEntity"),fR=r(e=>e.replace(cR,dR),"unescape"),Yh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:fR,transDefaultProps:void 0},mR=r((e={})=>{Yh={...Yh,...e}},"setDefaults"),pR=r(()=>Yh,"getDefaults"),R1,hR=r(e=>{R1=e},"setI18n"),gR=r(()=>R1,"getI18n"),xR={type:"3rdParty",init(e){mR(e.options.react),hR(e)}},bR=(0,b.createContext)(),vR=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)}},yR=Ql((e=>{var t=Lg();function i(j,k){return j===k&&(j!==0||1/j===1/k)||j!==j&&k!==k}r(i,"is");var l=typeof Object.is=="function"?Object.is:i,c=t.useState,d=t.useEffect,m=t.useLayoutEffect,f=t.useDebugValue;function h(j,k){var N=k(),S=c({inst:{value:N,getSnapshot:k}}),D=S[0].inst,R=S[1];return m(function(){D.value=N,D.getSnapshot=k,g(D)&&R({inst:D})},[j,N,k]),d(function(){return g(D)&&R({inst:D}),j(function(){g(D)&&R({inst:D})})},[j]),f(N),N}r(h,"useSyncExternalStore$2");function g(j){var k=j.getSnapshot;j=j.value;try{var N=k();return!l(j,N)}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})),jR=Ql(((e,t)=>{t.exports=yR()})),wR=jR(),kR=r((e,t)=>{if(qr(t))return t;if(oR(t)&&qr(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const i=e[e.length-1];return typeof i=="function"?"":i}return e},"notReadyT"),SR={t:kR,ready:!1},NR=r(()=>()=>{},"dummySubscribe"),CR=r((e,t={})=>{const{i18n:i}=t,{i18n:l,defaultNS:c}=(0,b.useContext)(bR)||{},d=i||l||gR();d&&!d.reportNamespaces&&(d.reportNamespaces=new vR),d||bd(d,"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 m=(0,b.useMemo)(()=>({...pR(),...d?.options?.react,...t}),[d,t]),{useSuspense:f,keyPrefix:h}=m,g=e||c||d?.options?.defaultNS,v=qr(g)?[g]:g||["translation"],y=(0,b.useMemo)(()=>v,v);d?.reportNamespaces?.addUsedNamespaces?.(y);const j=(0,b.useRef)(0),k=(0,b.useCallback)(U=>{if(!d)return NR;const{bindI18n:F,bindI18nStore:Y}=m,se=r(()=>{j.current+=1,U()},"wrappedCallback");return F&&d.on(F,se),Y&&d.store.on(Y,se),()=>{F&&F.split(" ").forEach(me=>d.off(me,se)),Y&&Y.split(" ").forEach(me=>d.store.off(me,se))}},[d,m]),N=(0,b.useRef)(),S=(0,b.useCallback)(()=>{if(!d)return SR;const U=!!(d.isInitialized||d.initializedStoreOnce)&&y.every(oe=>lR(oe,d,m)),F=t.lng||d.language,Y=j.current,se=N.current;if(se&&se.ready===U&&se.lng===F&&se.keyPrefix===h&&se.revision===Y)return se;const me={t:d.getFixedT(F,m.nsMode==="fallback"?y:y[0],h,{scopeNs:y}),ready:U,lng:F,keyPrefix:h,revision:Y};return N.current=me,me},[d,y,h,m,t.lng]),[D,R]=(0,b.useState)(0),{t:E,ready:C}=(0,wR.useSyncExternalStore)(k,S,S);(0,b.useEffect)(()=>{if(d&&!C&&!f){const U=r(()=>R(F=>F+1),"onLoaded");t.lng?Vy(d,t.lng,y,U):Gh(d,y,U)}},[d,t.lng,y,C,f,D]);const I=d||{},O=(0,b.useRef)(null),z=(0,b.useRef)(),B=r(U=>`${U.language}|${U.resolvedLanguage}|${U.languages?.join(",")}`,"languageKey"),L=r(U=>{const F=Object.getOwnPropertyDescriptors(U);F.__original&&delete F.__original;const Y=Object.create(Object.getPrototypeOf(U),F);if(!Object.prototype.hasOwnProperty.call(Y,"__original"))try{Object.defineProperty(Y,"__original",{value:U,writable:!1,enumerable:!1,configurable:!1})}catch{}return Y},"createI18nWrapper"),_=(0,b.useMemo)(()=>{const U=I,F=U&&B(U);let Y=U;U&&(O.current&&O.current.__original===U?z.current!==F?(Y=L(U),O.current=Y,z.current=F):Y=O.current:(Y=L(U),O.current=Y,z.current=F));const se=!C&&!f?(...oe)=>(bd(d,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),E(...oe)):E,me=[se,Y,C];return me.t=se,me.i18n=Y,me.ready=C,me},[E,I,C,I.resolvedLanguage,I.language,I.languages]);if(d&&f&&!C){let U=!1;try{U=!1}catch{}throw U&&bd(d,"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(F=>{const Y=r(()=>F(),"onLoaded");t.lng?Vy(d,t.lng,y,Y):Gh(d,y,Y)})}return _},"useTranslation$1"),AR={noCompanies:{title:"أنشئ شركتك الأولى",description:"ابدأ بإنشاء شركة.",newCompany:"شركة جديدة"}},_R={app:AR},ER={noCompanies:{title:"আপনার প্রথম কোম্পানি তৈরি করুন",description:"একটি কোম্পানি তৈরি করে শুরু করুন।",newCompany:"নতুন কোম্পানি"}},IR={app:ER},TR={noCompanies:{title:"Vytvořte svou první společnost",description:"Začněte vytvořením společnosti.",newCompany:"Nová společnost"}},RR={app:TR},DR={noCompanies:{title:"Opret din første virksomhed",description:"Kom i gang ved at oprette en virksomhed.",newCompany:"Ny virksomhed"}},MR={app:DR},OR={noCompanies:{title:"Erstellen Sie Ihr erstes Unternehmen",description:"Beginnen Sie, indem Sie ein Unternehmen erstellen.",newCompany:"Neues Unternehmen"}},LR={app:OR},zR={noCompanies:{title:"Δημιουργήστε την πρώτη σας εταιρεία",description:"Ξεκινήστε δημιουργώντας μια εταιρεία.",newCompany:"Νέα εταιρεία"}},PR={app:zR},UR={noCompanies:{title:"Create your first organization",description:"Get started by creating an organization.",newCompany:"New Organization"}},h0={app:UR},$R={noCompanies:{title:"Crea tu primera empresa",description:"Comienza creando una empresa.",newCompany:"Nueva empresa"}},BR={app:$R},KR={noCompanies:{title:"اولین شرکت خود را ایجاد کنید",description:"با ایجاد یک شرکت شروع کنید.",newCompany:"شرکت جدید"}},qR={app:KR},FR={noCompanies:{title:"Luo ensimmäinen yrityksesi",description:"Aloita luomalla yritys.",newCompany:"Uusi yritys"}},HR={app:FR},VR={noCompanies:{title:"Gumawa ng iyong unang kumpanya",description:"Magsimula sa paggawa ng kumpanya.",newCompany:"Bagong Kumpanya"}},QR={app:VR},WR={noCompanies:{title:"Créez votre première entreprise",description:"Commencez par créer une entreprise.",newCompany:"Nouvelle entreprise"}},GR={app:WR},YR={noCompanies:{title:"צרו את החברה הראשונה שלכם",description:"התחילו ביצירת חברה.",newCompany:"חברה חדשה"}},XR={app:YR},ZR={noCompanies:{title:"अपनी पहली कंपनी बनाएं",description:"कंपनी बनाकर शुरुआत करें.",newCompany:"नई कंपनी"}},JR={app:ZR},eD={noCompanies:{title:"Hozza létre első vállalatát",description:"Kezdje egy vállalat létrehozásával.",newCompany:"Új vállalat"}},tD={app:eD},nD={noCompanies:{title:"Buat perusahaan pertama Anda",description:"Mulai dengan membuat perusahaan.",newCompany:"Perusahaan Baru"}},aD={app:nD},sD={noCompanies:{title:"Crea la tua prima azienda",description:"Inizia creando un'azienda.",newCompany:"Nuova azienda"}},iD={app:sD},rD={noCompanies:{title:"最初の会社を作成",description:"会社を作成して始めましょう。",newCompany:"新しい会社"}},lD={app:rD},oD={noCompanies:{title:"첫 회사를 만드세요",description:"회사를 만들어 시작하세요.",newCompany:"새 회사"}},cD={app:oD},uD={noCompanies:{title:"तुमची पहिली कंपनी तयार करा",description:"कंपनी तयार करून सुरुवात करा.",newCompany:"नवीन कंपनी"}},dD={app:uD},fD={noCompanies:{title:"Cipta syarikat pertama anda",description:"Mulakan dengan mencipta syarikat.",newCompany:"Syarikat Baharu"}},mD={app:fD},pD={noCompanies:{title:"Opprett ditt første selskap",description:"Kom i gang ved å opprette et selskap.",newCompany:"Nytt selskap"}},hD={app:pD},gD={noCompanies:{title:"Maak uw eerste bedrijf aan",description:"Begin door een bedrijf aan te maken.",newCompany:"Nieuw bedrijf"}},xD={app:gD},bD={noCompanies:{title:"ਆਪਣੀ ਪਹਿਲੀ ਕੰਪਨੀ ਬਣਾਓ",description:"ਕੰਪਨੀ ਬਣਾਕੇ ਸ਼ੁਰੂ ਕਰੋ।",newCompany:"ਨਵੀਂ ਕੰਪਨੀ"}},vD={app:bD},yD={noCompanies:{title:"Utwórz swoją pierwszą firmę",description:"Zacznij od utworzenia firmy.",newCompany:"Nowa firma"}},jD={app:yD},wD={noCompanies:{title:"Crie sua primeira empresa",description:"Comece criando uma empresa.",newCompany:"Nova empresa"}},kD={app:wD},SD={noCompanies:{title:"Crie a sua primeira empresa",description:"Comece por criar uma empresa.",newCompany:"Nova empresa"}},ND={app:SD},CD={noCompanies:{title:"Creați prima companie",description:"Începeți prin crearea unei companii.",newCompany:"Companie nouă"}},AD={app:CD},_D={noCompanies:{title:"Создайте свою первую компанию",description:"Начните с создания компании.",newCompany:"Новая компания"}},ED={app:_D},ID={noCompanies:{title:"Skapa ditt första företag",description:"Kom igång genom att skapa ett företag.",newCompany:"Nytt företag"}},TD={app:ID},RD={noCompanies:{title:"Unda kampuni yako ya kwanza",description:"Anza kwa kuunda kampuni.",newCompany:"Kampuni Mpya"}},DD={app:RD},MD={noCompanies:{title:"உங்கள் முதல் நிறுவனத்தை உருவாக்குங்கள்",description:"ஒரு நிறுவனத்தை உருவாக்கி தொடங்குங்கள்.",newCompany:"புதிய நிறுவனம்"}},OD={app:MD},LD={noCompanies:{title:"మీ మొదటి కంపెనీని సృష్టించండి",description:"కంపెనీని సృష్టించడం ద్వారా ప్రారంభించండి.",newCompany:"కొత్త కంపెనీ"}},zD={app:LD},PD={noCompanies:{title:"สร้างบริษัทแรกของคุณ",description:"เริ่มต้นด้วยการสร้างบริษัท",newCompany:"บริษัทใหม่"}},UD={app:PD},$D={noCompanies:{title:"İlk şirketinizi oluşturun",description:"Bir şirket oluşturarak başlayın.",newCompany:"Yeni Şirket"}},BD={app:$D},KD={noCompanies:{title:"Створіть свою першу компанію",description:"Почніть зі створення компанії.",newCompany:"Нова компанія"}},qD={app:KD},FD={noCompanies:{title:"اپنی پہلی کمپنی بنائیں",description:"کمپنی بنا کر شروع کریں۔",newCompany:"نئی کمپنی"}},HD={app:FD},VD={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"}},QD={app:VD},WD={noCompanies:{title:"创建您的第一家公司",description:"通过创建公司开始。",newCompany:"新公司"}},GD={app:WD},YD={noCompanies:{title:"建立您的第一家公司",description:"從建立公司開始。",newCompany:"新公司"}},XD={app:YD},ZD=2e3;function Qy(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}r(Qy,"isPlainObject");function Zi(e){return e.length>0?e.join("."):"<root>"}r(Zi,"formatPath");function Wy(e){return Array.from(e.matchAll(/{{\s*([A-Za-z0-9_.-]+)\s*}}/g),t=>t[1]).sort()}r(Wy,"interpolationPlaceholders");function Gy(e){return/<\/?[A-Za-z][A-Za-z0-9:-]*(?:\s[^>]*)?>/.test(e)}r(Gy,"hasRawHtml");function Yy(e){return/\son[A-Za-z]+\s*=/i.test(e)}r(Yy,"hasEventHandlerAttribute");function Xy(e){return Array.from(e.matchAll(/\bhttps?:\/\/[^\s<>"')]+/gi),t=>t[0]).sort()}r(Xy,"urlsIn");function JD(e,t){const i=[[/<script\b/i.test(e),/<script\b/i.test(t),"<script"],[Yy(e),Yy(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:"],[Gy(e),Gy(t),"raw HTML tag"]].filter(([c,d])=>c&&!d).map(([,,c])=>c),l=new Set(Xy(t));return Xy(e).find(c=>!l.has(c))&&i.push("unexpected URL"),i}r(JD,"hasBlockedData");function eM(e,t,i,l){const c=Wy(t),d=Wy(i);c.join("\0")!==d.join("\0")&&l.push(`${Zi(e)} interpolation placeholders must match English exactly: expected ${JSON.stringify(d)}, received ${JSON.stringify(c)}`);for(const h of JD(t,i))l.push(`${Zi(e)} contains disallowed ${h}`);const m=Math.max(i.length*4+64,i.length+128),f=Math.min(ZD,m);t.length>f&&l.push(`${Zi(e)} is too long: ${t.length} characters exceeds ${f}`)}r(eM,"validateString");function D1(e,t,i,l){if(typeof i=="string"){if(typeof t!="string"){l.push(`${Zi(e)} must be a string`);return}eM(e,t,i,l);return}if(!Qy(i)){l.push(`${Zi(e)} has unsupported English reference type`);return}if(!Qy(t)){l.push(`${Zi(e)} must be an object`);return}const c=Object.keys(i).sort(),d=Object.keys(t).sort(),m=c.filter(h=>!d.includes(h)),f=d.filter(h=>!c.includes(h));for(const h of m)l.push(`${Zi([...e,h])} is missing`);for(const h of f)l.push(`${Zi([...e,h])} is not defined in English`);for(const h of c)h in t&&D1([...e,h],t[h],i[h],l)}r(D1,"validateNode");function tM(e,t=h0){const i=[];return D1([],e,t,i),i}r(tM,"validateLocaleMessages");function nM(e,t=h0){const i=tM(e,t);if(i.length>0)throw new Error(`Invalid locale messages:
|
|
3
|
+
${i.join(`
|
|
4
|
+
`)}`)}r(nM,"assertValidLocaleMessages");var aM=Object.assign({"./locales/ar.json":_R,"./locales/bn.json":IR,"./locales/cs.json":RR,"./locales/da.json":MR,"./locales/de.json":LR,"./locales/el.json":PR,"./locales/en.json":h0,"./locales/es.json":BR,"./locales/fa.json":qR,"./locales/fi.json":HR,"./locales/fil.json":QR,"./locales/fr.json":GR,"./locales/he.json":XR,"./locales/hi.json":JR,"./locales/hu.json":tD,"./locales/id.json":aD,"./locales/it.json":iD,"./locales/ja.json":lD,"./locales/ko.json":cD,"./locales/mr.json":dD,"./locales/ms.json":mD,"./locales/nb.json":hD,"./locales/nl.json":xD,"./locales/pa.json":vD,"./locales/pl.json":jD,"./locales/pt-BR.json":kD,"./locales/pt-PT.json":ND,"./locales/ro.json":AD,"./locales/ru.json":ED,"./locales/sv.json":TD,"./locales/sw.json":DD,"./locales/ta.json":OD,"./locales/te.json":zD,"./locales/th.json":UD,"./locales/tr.json":BD,"./locales/uk.json":qD,"./locales/ur.json":HD,"./locales/vi.json":QD,"./locales/zh-CN.json":GD,"./locales/zh-TW.json":XD}),yf=Object.fromEntries(Object.entries(aM).map(([e,t])=>{const i=e.match(/\/([A-Za-z0-9_-]+)\.json$/)?.[1];if(!i)throw new Error(`Invalid locale file path: ${e}`);return[i,t]}));if(!("en"in yf))throw new Error("Missing default locale messages for en");for(const[e,t]of Object.entries(yf))try{nM(t)}catch(i){const l=i instanceof Error?i.message:String(i);throw new Error(`Invalid ${e} locale messages: ${l}`)}var sM=Object.keys(yf),iM=Object.fromEntries(Object.entries(yf).map(([e,t])=>[e,{translation:t}])),rM={resources:iM,lng:"en",fallbackLng:"en",supportedLngs:sM,defaultNS:"translation",interpolation:{escapeValue:!1},returnObjects:!1,initAsync:!1};Na.use(xR).init(rM).catch(e=>{});var M1=CR,a=Og(S_(),1);function Zy({collapsible:e,headerAction:t,label:i,menu:l}){const{isMobile:c}=Zn(),[d,m]=(0,b.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=G("h-3 w-3 shrink-0 text-ink-3/60 transition-all",g,e?.open&&"rotate-90",d&&"opacity-100"),y=G("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:i}),k=t?.icon,N=f?(0,a.jsxs)(Wr,{open:d,onOpenChange:m,children:[(0,a.jsx)(Vr,{asChild:!0,children:(0,a.jsx)("button",{type:"button","data-slot":"icon-button",className:G("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",d&&"bg-bg-3/50"),"aria-label":l?.ariaLabel??`${i} actions`,children:j})}),(0,a.jsxs)(Qr,{align:"start",className:"w-48",children:[l?.actions?.map((S,D)=>{if(S.type==="separator")return(0,a.jsx)(yi,{},`separator-${D}`);const R=S.icon,E=(0,a.jsxs)(a.Fragment,{children:[R?(0,a.jsx)(R,{className:"size-4"}):null,(0,a.jsx)("span",{children:S.label})]});return S.href?(0,a.jsx)(Cn,{asChild:!0,children:(0,a.jsx)(fn,{to:S.href,children:E})},`${S.label}-${D}`):(0,a.jsx)(Cn,{onSelect:S.onSelect,children:E},`${S.label}-${D}`)}),l?.radioChoices&&l.radioChoices.length>0?(0,a.jsx)(bE,{value:l.radioValue,onValueChange:l.onRadioValueChange,"aria-label":l.radioLabel,children:l.radioChoices.map(S=>(0,a.jsx)(vE,{value:S.value,children:S.label},S.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)(gE,{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 ${i}`:`Expand ${i}`,children:(0,a.jsx)(tr,{className:v,"aria-hidden":"true"})})}):null,N,t&&k?(0,a.jsx)(pe,{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(Zy,"SidebarSectionHeader");function Pd({label:e,children:t,collapsible:i,menu:l,headerAction:c}){const{collapsed:d,peeking:m}=Zn(),f=$I(),h=d&&!m&&!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]}):i?(0,a.jsxs)(Dk,{open:i.open,onOpenChange:i.onOpenChange,children:[(0,a.jsx)(Zy,{label:e,collapsible:i,menu:l,headerAction:c}),(0,a.jsx)(Rk,{children:g})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(Zy,{label:e,menu:l,headerAction:c}),g]})}r(Pd,"SidebarSection");var O1=(0,b.createContext)(null),lM=O1.Provider;function jf(e){const t=(0,b.useContext)(O1);return t&&(!e||t.companyId===e)?t:null}r(jf,"usePrimaryAgentPresentation");function yQ({agentId:e,companyId:t}){const i=jf(t);return!i||i.loading||i.primaryAgentId!==e?null:(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{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)(Ik,{"aria-hidden":"true",className:"size-3.5"})})}),(0,a.jsx)(Cs,{children:"My primary agent"})]})}r(yQ,"PrimaryAgentIndicator");function jQ({agent:e}){const t=jf(e.companyId);if(!t||e.status==="terminated"||e.status==="pending_approval")return null;if(t.error)return(0,a.jsx)(pe,{type:"button",variant:"danger",size:"sm",onClick:t.onRetry,className:"h-auto justify-start p-0 text-xs",children:"Retry loading primary agent"});const i=t.primaryAgentId===e.id,l=t.pendingAgentId===e.id;if(i&&!l&&!t.loading)return null;const c=t.primaryAgent?.id===t.primaryAgentId?t.primaryAgent:null,d=t.loading||!!(t.primaryAgentId&&!c),m=d||!!t.pendingAgentId,f=(0,a.jsxs)(pe,{type:"button",variant:"link",size:"sm",disabled:m,onClick:t.primaryAgentId?void 0:()=>t.onChange(e.id),className:"h-auto justify-start p-0 text-xs",children:[l||d?(0,a.jsx)(za,{"aria-hidden":"true",className:"size-3 motion-safe:animate-spin"}):null,d?"Loading primary…":l?"Setting primary…":"Set as my primary"]});return c?(0,a.jsxs)(Bk,{children:[(0,a.jsx)(xE,{asChild:!0,children:f}),(0,a.jsxs)(Lk,{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)(sr,{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)(IE,{"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)(sr,{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)(Ik,{"aria-hidden":"true",className:"size-3.5"})})]})]})]}),(0,a.jsxs)($k,{children:[(0,a.jsx)(Ok,{children:"Change your primary agent?"}),(0,a.jsxs)(Mk,{className:"break-words",children:["This will make ",e.name," your primary agent, do you want to do this?"]})]}),(0,a.jsxs)(Pk,{className:"flex-row justify-between sm:justify-between",children:[(0,a.jsx)(Uk,{children:"Cancel"}),(0,a.jsx)(zk,{disabled:m,onClick:r(()=>t.onChange(e.id),"onClick"),children:"Set as my primary"})]})]})]},c.id):f}r(jQ,"SetPrimaryAgentButton");var L1=(0,b.createContext)(null),z1=(0,b.createContext)(null);function oM({children:e}){const[t,i]=(0,b.useState)(!1),[l,c]=(0,b.useState)({}),[d,m]=(0,b.useState)(!1),[f,h]=(0,b.useState)(!1),[g,v]=(0,b.useState)({}),[y,j]=(0,b.useState)(!1),[k,N]=(0,b.useState)(!1),[S,D]=(0,b.useState)({}),[R,E]=(0,b.useState)(!1),C=(0,b.useCallback)((oe={})=>{c(oe),i(!0)},[]),I=(0,b.useCallback)(()=>{i(!1),c({})},[]),O=(0,b.useCallback)(()=>{m(!0)},[]),z=(0,b.useCallback)(()=>{m(!1)},[]),B=(0,b.useCallback)((oe={})=>{v(oe),h(!0)},[]),L=(0,b.useCallback)(()=>{h(!1),v({})},[]),_=(0,b.useCallback)(()=>{j(!0)},[]),U=(0,b.useCallback)(()=>{j(!1)},[]),F=(0,b.useCallback)((oe={})=>{D(oe),N(!0)},[]),Y=(0,b.useCallback)(()=>{N(!1),D({})},[]),se=(0,b.useMemo)(()=>({newIssueOpen:t,newIssueDefaults:l,newProjectOpen:d,newGoalOpen:f,newGoalDefaults:g,newAgentOpen:y,onboardingOpen:k,onboardingOptions:S,onboardingRouteDismissed:R}),[t,l,d,f,g,y,k,S,R]),me=(0,b.useMemo)(()=>({openNewIssue:C,closeNewIssue:I,openNewProject:O,closeNewProject:z,openNewGoal:B,closeNewGoal:L,openNewAgent:_,closeNewAgent:U,openOnboarding:F,closeOnboarding:Y,setOnboardingRouteDismissed:E}),[C,I,O,z,B,L,_,U,F,Y,E]);return(0,a.jsx)(z1.Provider,{value:me,children:(0,a.jsx)(L1.Provider,{value:se,children:e})})}r(oM,"DialogProvider");function Ms(){const e=(0,b.useContext)(z1);if(!e)throw new Error("useDialogActions must be used within DialogProvider");return e}r(Ms,"useDialogActions");function wf(){const e=(0,b.useContext)(L1);if(!e)throw new Error("useDialogState must be used within DialogProvider");return e}r(wf,"useDialogState");function Ec(){return{...wf(),...Ms()}}r(Ec,"useDialog");var cM={list:r(e=>Re.get(`/companies/${e}/built-in-agents`),"list"),provision:r((e,t,i={})=>Re.post(`/companies/${e}/built-in-agents/${t}/provision`,i),"provision"),reset:r((e,t,i)=>Re.post(`/companies/${e}/built-in-agents/${t}/reset`,i?{resources:i}:{}),"reset"),reconcile:r((e,t)=>Re.post(`/companies/${e}/built-in-agents/${t}/reconcile`,{}),"reconcile"),runRoutine:r((e,t,i)=>Re.post(`/companies/${e}/built-in-agents/${t}/routines/${i}/run`,{}),"runRoutine"),enableRoutineSchedule:r((e,t,i)=>Re.post(`/companies/${e}/built-in-agents/${t}/routines/${i}/enable`,{}),"enableRoutineSchedule"),disableRoutineSchedule:r((e,t,i)=>Re.post(`/companies/${e}/built-in-agents/${t}/routines/${i}/disable`,{}),"disableRoutineSchedule")};function uM({status:e,compact:t=!1,className:i}){if(e!=="needs_setup"&&e!=="pending_approval")return null;const l=e==="pending_approval";return(0,a.jsx)(Bn,{variant:"outline",className:G(aE.amber,t&&"px-1.5 py-0 text-(length:--text-nano)",i),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(uM,"BuiltInLifecycleChip");function Kp(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]!==t[i])return!1;return!0}r(Kp,"areEqual$2");function qp(e,t,i){return zh(e,t,i).map(l=>l.id)}r(qp,"buildOrderIds$2");function dM({agents:e,companyId:t,userId:i}){const l=(0,b.useMemo)(()=>({leadershipFirst:!0}),[]),c=(0,b.useMemo)(()=>t?YI(t,i):null,[t,i]),[d,m]=(0,b.useState)(()=>c?qp(e,Op(c),l):e.map(f=>f.id));return(0,b.useEffect)(()=>{const f=c?qp(e,Op(c),l):e.map(h=>h.id);m(h=>Kp(h,f)?h:f)},[e,c,l]),(0,b.useEffect)(()=>{if(!c)return;const f=r(v=>{const y=qp(e,v,l);m(j=>Kp(j,y)?j:y)},"syncFromIds"),h=r(v=>{v.key===c&&f(Op(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,b.useMemo)(()=>zh(e,d,l),[e,d,l]),orderedIds:d,persistOrder:(0,b.useCallback)(f=>{const h=new Set(e.map(v=>v.id)),g=f.filter(v=>h.has(v));for(const v of zh(e,[],l))g.includes(v.id)||g.push(v.id);m(v=>Kp(v,g)?v:g),c&&QI(c,g)},[e,c,l])}}r(dM,"useAgentOrder");var Xh={listMine:r(e=>Re.get(`/companies/${e}/resource-memberships/me`),"listMine"),updateProject:r((e,t,i)=>Re.put(`/companies/${e}/resource-memberships/me/projects/${t}`,i),"updateProject"),updateAgent:r((e,t,i)=>Re.put(`/companies/${e}/resource-memberships/me/agents/${t}`,i),"updateAgent")};function fM(){return{projectMemberships:{},agentMemberships:{},starredProjectIds:[],starredAgentIds:[],starredDocumentIds:[],projectStarredAt:{},agentStarredAt:{},documentStarredAt:{},updatedAt:null}}r(fM,"emptyMemberships");function mM(e){return e==="project"?{ids:"starredProjectIds",at:"projectStarredAt",state:"projectMemberships"}:{ids:"starredAgentIds",at:"agentStarredAt",state:"agentMemberships"}}r(mM,"starKeys");function Jy(e,t,i,l){const c=e??fM(),d=mM(t),m=c[d.state]??{},f=m[i]==="left"?"left":"joined",h=l.starred===!0?"joined":l.state??f,g=c[d.ids]??[],v={...c[d.at]??{}},y=g.includes(i),j=h==="left"?!1:l.starred===!0?!0:l.starred===!1?!1:y;let k=g;return j&&!y?(k=[i,...g],v[i]=new Date):!j&&y&&(k=g.filter(N=>N!==i),delete v[i]),{...c,[d.state]:{...m,[i]:h},[d.ids]:k,[d.at]:v,updatedAt:new Date}}r(Jy,"applyMembershipChange");function P1(e,t,i){return(t==="project"?e?.projectMemberships[i]:e?.agentMemberships[i])==="left"?"left":"joined"}r(P1,"resourceMembershipState");function U1(e,t,i){const l=t==="project"?e?.starredProjectIds:t==="agent"?e?.starredAgentIds:e?.starredDocumentIds;return Array.isArray(l)&&l.includes(i)}r(U1,"isStarred");function $1(e,t){const i=t==="project"?e?.starredProjectIds:t==="agent"?e?.starredAgentIds:e?.starredDocumentIds;return Array.isArray(i)?i:[]}r($1,"starredResourceIds");function g0(e){return be({queryKey:P.resourceMemberships.mine(e??"__none__"),queryFn:r(()=>Xh.listMine(e),"queryFn"),enabled:!!e})}r(g0,"useResourceMemberships");function B1(e){const t=Rn(),{pushToast:i}=Si(),l=P.resourceMemberships.mine(e??"__none__");return bn({mutationFn:r(c=>{if(!e)throw new Error("Select an organization first.");const d={state:c.state,starred:c.starred};return c.resourceType==="project"?Xh.updateProject(e,c.resourceId,d):Xh.updateAgent(e,c.resourceId,d)},"mutationFn"),onMutate:r(async c=>{await t.cancelQueries({queryKey:l});const d=t.getQueryData(l);return t.setQueryData(l,Jy(d,c.resourceType,c.resourceId,{state:c.state,starred:c.starred})),{previous:d}},"onMutate"),onError:r((c,d,m)=>{m?.previous&&t.setQueryData(l,m.previous);const f=d.starred!==void 0?d.starred?"star":"unstar":d.state==="left"?"leave":"join";i({title:`Couldn't ${f} ${d.resourceName}.`,body:c instanceof Error?c.message:"Try again.",tone:"error"})},"onError"),onSuccess:r((c,d)=>{t.setQueryData(l,m=>Jy(m,d.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(B1,"useResourceMembershipMutation");var pM={healthy:"bg-emerald-500/90 text-white",warning:"bg-amber-500/95 text-amber-950",critical:"bg-red-500/90 text-white"},hM={healthy:"Budget healthy",warning:"Budget warning",critical:"Paused by budget"};function K1({title:e,level:t="critical"}){const i=e??hM[t];return(0,a.jsx)("span",{title:i,"aria-label":i,className:`ml-auto inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full shadow-(--shadow-extract-3) ${pM[t]}`,children:(0,a.jsx)(ES,{className:"h-3 w-3"})})}r(K1,"BudgetSidebarMarker");var gM="opacity-100 sm:opacity-0 sm:transition-opacity sm:group-hover:opacity-100 sm:group-focus-within:opacity-100";function q1({starred:e,resourceName:t,pending:i=!1,error:l=!1,size:c="row",onToggle:d,quiet:m=!1,className:f,revealClassName:h}){const g=e?`Unstar ${t}`:`Star ${t}`,v=i?za:Ug;function y(j){j.preventDefault(),j.stopPropagation(),!i&&d(!e)}return r(y,"handleClick"),c==="button"?(0,a.jsx)(pe,{type:"button",size:"icon-sm",variant:"ghost","aria-label":g,"aria-pressed":e,"aria-busy":i?"true":void 0,disabled:i,onClick:y,title:l?"Couldn't save — retry":void 0,className:f,children:(0,a.jsx)(v,{className:G("h-4 w-4",i&&"motion-safe:animate-spin",!i&&l&&"text-bad",!i&&e&&!l&&"fill-amber-500 text-amber-500",!i&&l&&"text-red-500")})}):(0,a.jsx)(pe,{type:"button",size:"icon-xs",variant:"ghost","aria-label":g,"aria-pressed":e,"aria-busy":i?"true":void 0,disabled:i,onClick:y,title:l?"Couldn't save — retry":void 0,className:G("h-6 w-6 shrink-0",l||i||e&&!m?"opacity-100":h??gM,f),children:(0,a.jsx)(v,{className:G("h-3.5 w-3.5",i&&"motion-safe:animate-spin",!i&&l&&"text-red-500",!i&&!l&&e&&"fill-amber-500 text-amber-500",!i&&!l&&!e&&"text-ink-3")})})}r(q1,"StarToggle");var xM=3,ej=12e4,bM=[{value:"top",label:"Top"},{value:"alphabetical",label:"Alphabetical"},{value:"recent",label:"Recent"}];function Cl(e,t){const i=e[t];if(!i)return 0;const l=new Date(i).getTime();return Number.isFinite(l)?l:0}r(Cl,"agentTimestamp");function tj(e,t){if(t==="top")return e;const i=[...e];return t==="alphabetical"?(i.sort((l,c)=>l.name.localeCompare(c.name,void 0,{sensitivity:"base"})),i):(i.sort((l,c)=>{const d=Cl(c,"lastHeartbeatAt")-Cl(l,"lastHeartbeatAt");if(d!==0)return d;const m=Cl(c,"updatedAt")-Cl(l,"updatedAt");if(m!==0)return m;const f=Cl(c,"createdAt")-Cl(l,"createdAt");return f!==0?f:l.name.localeCompare(c.name,void 0,{sensitivity:"base"})}),i)}r(tj,"sortAgents");var vM="opacity-0 transition-opacity group-hover/agent:opacity-100 group-focus-within/agent:opacity-100";function yM({activeAgentId:e,activeTab:t,agent:i,disabled:l,isMobile:c,leaving:d,onLeaveAgent:m,onPauseResume:f,rail:h,runCount:g,setSidebarOpen:v,builtInStatus:y,starred:j=!1,onToggleStar:k,starPending:N=!1}){const S=ar(i),D=t?`${gd(i)}/${t}`:gd(i),R=`${gd(i)}/configuration`,E=e===S,C=i.status==="paused",I=C&&i.pauseReason==="budget",O=i.orgChainHealth?.status==="invalid_org_chain",z=C?"Resume agent":"Pause agent",B=l||i.status==="pending_approval"||I||C&&O,L=l?"Updating...":I?"Budget paused":C&&O?"Invalid org chain":z,_=y==="needs_setup"||y==="pending_approval",U=[_?`Built-in agent ${y.replace(/_/g," ")}`:null,O?"Invalid reporting chain":null].filter(Boolean).join(", ")||void 0,F=(0,a.jsx)(Ye,{to:D,label:i.name,iconNode:(0,a.jsx)(sr,{agent:i,size:16,className:"shrink-0 h-4 w-4"}),active:E,liveCount:g,labelClassName:_?"min-w-(--sz-4_5rem) flex-initial":void 0,className:G("min-w-0 flex-1",j&&!c?"pr-14":"pr-8"),trailing:_||O?(0,a.jsxs)("span",{className:"ml-1 flex shrink-0 items-center gap-1",children:[_?(0,a.jsx)(uM,{status:y,compact:!0}):null,O?(0,a.jsx)(ki,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):null]}):void 0,trailingLabel:U,liveAccessory:i.pauseReason==="budget"?(0,a.jsx)(K1,{title:"Agent paused by budget"}):void 0});return h?F:(0,a.jsxs)("div",{className:"group/agent relative flex items-center",children:[F,j&&!c&&k?(0,a.jsx)("span",{className:"absolute right-10 top-1/2 -translate-y-1/2",children:(0,a.jsx)(q1,{size:"row",quiet:!0,starred:!0,pending:N,resourceName:i.name,onToggle:r(()=>k(i,!1),"onToggle"),revealClassName:vM})}):null,(0,a.jsxs)(Wr,{children:[(0,a.jsx)(Vr,{asChild:!0,children:(0,a.jsx)(pe,{variant:"ghost",size:"icon-xs",className:G("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 ${i.name}`,children:(0,a.jsx)(mf,{className:"h-3.5 w-3.5"})})}),(0,a.jsxs)(Qr,{align:"end",className:"w-48",children:[k?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(Cn,{onClick:r(()=>{N||k(i,!j)},"onClick"),disabled:N,children:[N?(0,a.jsx)(za,{className:"size-4 motion-safe:animate-spin"}):(0,a.jsx)(Ug,{className:G("size-4",j&&"fill-amber-500 text-amber-500")}),(0,a.jsx)("span",{children:j?"Remove from starred":"Star agent"})]}),(0,a.jsx)(yi,{})]}):null,(0,a.jsx)(Cn,{asChild:!0,children:(0,a.jsxs)(fn,{to:R,onClick:r(()=>{c&&v(!1)},"onClick"),children:[(0,a.jsx)(e0,{className:"size-4"}),(0,a.jsx)("span",{children:"Edit agent"})]})}),(0,a.jsx)(yi,{}),(0,a.jsxs)(Cn,{onClick:r(()=>{B||f(i,C?"resume":"pause")},"onClick"),disabled:B,title:I?"Agent was paused by budget limits":void 0,children:[C?(0,a.jsx)(NS,{className:"size-4"}):(0,a.jsx)(kS,{className:"size-4"}),(0,a.jsx)("span",{children:L})]}),(0,a.jsx)(yi,{}),(0,a.jsxs)(Cn,{onClick:r(()=>{d||m(i)},"onClick"),disabled:d,children:[d?(0,a.jsx)(za,{className:"size-4 motion-safe:animate-spin"}):(0,a.jsx)(bf,{className:"size-4"}),(0,a.jsx)("span",{children:d?"Leaving...":"Leave agent"})]})]})]})]})}r(yM,"SidebarAgentItem");function jM({streamlined:e=!1}={}){const[t,i]=(0,b.useState)(!0),[l,c]=(0,b.useState)(()=>new Set),[d,m]=(0,b.useState)(0),f=(0,b.useRef)(new Map),h=Rn(),{selectedCompanyId:g}=bt(),v=jf(g),{openNewAgent:y}=Ms(),{isMobile:j,setSidebarOpen:k,collapsed:N,peeking:S}=Zn(),D=N&&!S,{pushToast:R}=Si(),E=vn(),{data:C}=be({queryKey:P.agents.list(g),queryFn:r(()=>Pa.list(g),"queryFn"),enabled:!!g}),{data:I}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn"),enabled:!!g}),O=I?.enableBuiltInAgents===!0,{data:z}=be({queryKey:P.builtInAgents.list(g),queryFn:r(()=>cM.list(g),"queryFn"),enabled:!!g&&O}),B=(0,b.useMemo)(()=>{const _e=new Map;if(!O)return _e;for(const ze of z??[])ze.agentId&&_e.set(ze.agentId,ze.status);return _e},[z,O]),{data:L}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn")}),_=g0(g),U=B1(g),F=P.liveRuns(g),Y=cc({companyId:g,resourceKey:"live-runs",queryKey:F,enabled:!!g,refetchInterval:!1,leaderOnly:!0}),{data:se,dataUpdatedAt:me}=be({queryKey:F,queryFn:r(()=>gf.liveRunsForCompany(g),"queryFn"),enabled:Y.enabled,refetchInterval:Y.refetchInterval});uc(Y,se,me);const oe=(0,b.useMemo)(()=>{const _e=new Map;for(const ze of se??[])_e.set(ze.agentId,(_e.get(ze.agentId)??0)+1);return _e},[se]),$=(0,b.useMemo)(()=>{const _e=new Set;for(const[ze,Je]of oe)Je>0&&_e.add(ze);return _e},[oe]),T=(0,b.useMemo)(()=>(C??[]).filter(_e=>_e.status!=="terminated"&&(!_.isSuccess||P1(_.data,"agent",_e.id)!=="left")),[C,_.data,_.isSuccess]),te=L?.user?.id??L?.session?.userId??null,ce=(0,b.useMemo)(()=>g?WI(g,te):null,[te,g]),[ae,Ce]=(0,b.useState)(()=>ce?Lp(ce):"top"),{orderedAgents:ue}=dM({agents:T,companyId:g,userId:te}),we=(0,b.useMemo)(()=>tj(ue,ae),[ue,ae]),Ae=(0,b.useMemo)(()=>new Set(we.map(_e=>_e.id)),[we]);(0,b.useEffect)(()=>{const _e=Date.now();for(const ze of $)f.current.set(ze,_e);for(const ze of f.current.keys())Ae.has(ze)||f.current.delete(ze)},[$,Ae]);const je=(0,b.useMemo)(()=>{const _e=Date.now(),ze=f.current;return we.filter(Je=>{if((oe.get(Je.id)??0)>0)return!0;const rt=ze.get(Je.id);return rt!==void 0&&_e-rt<=ej})},[oe,d,we]),he=je.length>0,Te=e?he?je:we.slice(0,xM):we,Ve=e&&we.length>0,De=E.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)(?:\/([^/]+))?/),Se=De?.[1]??null,ut=De?.[2]??null;(0,b.useEffect)(()=>{if(!ce){Ce("top");return}Ce(Lp(ce))},[ce]),(0,b.useEffect)(()=>{if(!ce)return;const _e=r(Je=>{Je.key===ce&&Ce(Lp(ce))},"onStorage"),ze=r(Je=>{const rt=Je.detail;!rt||rt.storageKey!==ce||Ce(rt.sortMode)},"onCustomEvent");return window.addEventListener("storage",_e),window.addEventListener(by,ze),()=>{window.removeEventListener("storage",_e),window.removeEventListener(by,ze)}},[ce]),(0,b.useEffect)(()=>{if(!e)return;const _e=Date.now();let ze=null;for(const rt of we){if((oe.get(rt.id)??0)>0)continue;const At=f.current.get(rt.id);if(At===void 0)continue;const Wt=At+ej;Wt<_e||(ze=ze===null?Wt:Math.min(ze,Wt))}if(ze===null)return;const Je=window.setTimeout(()=>{m(rt=>rt+1)},Math.max(0,ze-_e+1));return()=>{window.clearTimeout(Je)}},[e,we,oe,d]);const wt=(0,b.useCallback)(_e=>{const ze=_e==="alphabetical"||_e==="recent"?_e:"top";Ce(ze),ce&&GI(ce,ze)},[ce]),kt=bn({mutationFn:r(({agent:_e,action:ze})=>ze==="pause"?Pa.pause(_e.id,g??void 0):Pa.resume(_e.id,g??void 0),"mutationFn"),onMutate:r(({agent:_e})=>{c(ze=>{const Je=new Set(ze);return Je.add(_e.id),Je})},"onMutate"),onSuccess:r(async(_e,{agent:ze,action:Je})=>{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(ze.id)}),h.invalidateQueries({queryKey:P.agents.detail(ar(ze))})]),R({title:Je==="pause"?"Agent paused":"Agent resumed",body:ze.name,tone:"success"})},"onSuccess"),onError:r((_e,{agent:ze,action:Je})=>{R({title:Je==="pause"?"Could not pause agent":"Could not resume agent",body:_e instanceof Error?_e.message:ze.name,tone:"error"})},"onError"),onSettled:r((_e,ze,{agent:Je})=>{c(rt=>{const At=new Set(rt);return At.delete(Je.id),At})},"onSettled")}),$t=(0,b.useCallback)(_e=>U.mutate({resourceType:"agent",resourceId:_e.id,resourceName:_e.name,state:"left"}),[U]),le=(0,b.useCallback)(_e=>U.isPending&&U.variables?.resourceType==="agent"&&U.variables.resourceId===_e.id,[U.isPending,U.variables]),Ue=(0,b.useCallback)((_e,ze)=>U.mutate({resourceType:"agent",resourceId:_e.id,resourceName:_e.name,starred:ze}),[U]),Fe=(0,b.useCallback)(_e=>U.isPending&&U.variables?.resourceType==="agent"&&U.variables.resourceId===_e.id&&U.variables.starred!==void 0,[U.isPending,U.variables]),it=(0,b.useMemo)(()=>new Set($1(_.data,"agent")),[_.data]),Vt=(0,b.useMemo)(()=>tj(T.filter(_e=>it.has(_e.id)),"alphabetical"),[T,it]),Qt=(0,b.useMemo)(()=>Te.filter(_e=>!it.has(_e.id)),[Te,it]),V=v&&!v.loading?T.find(_e=>_e.id===v.primaryAgentId):void 0,Ct=r((_e,ze)=>(0,a.jsx)(yM,{activeAgentId:Se,activeTab:ut,agent:_e,disabled:l.has(_e.id),isMobile:j,leaving:le(_e),onLeaveAgent:$t,onPauseResume:r((Je,rt)=>kt.mutate({agent:Je,action:rt}),"onPauseResume"),rail:D,runCount:oe.get(_e.id)??0,setSidebarOpen:k,builtInStatus:B.get(_e.id),starred:ze||U1(_.data,"agent",_e.id),onToggleStar:Ue,starPending:Fe(_e)},_e.id),"renderAgentRow");return(0,a.jsxs)(Pd,{label:"Agents",collapsible:{open:t,onOpenChange:i},headerAction:{ariaLabel:"New agent",icon:Xa,onClick:y},menu:{ariaLabel:"Agents section actions",actions:[{type:"item",label:"Browse agents",icon:Kr,href:"/agents/all"},{type:"separator"}],radioLabel:"Agent sort",radioChoices:bM,radioValue:ae,onRadioValueChange:wt},children:[[...V?[V]:[],...Vt.filter(_e=>_e.id!==V?.id),...Qt.filter(_e=>_e.id!==V?.id)].map(_e=>Ct(_e,it.has(_e.id))),Ve&&(()=>{const _e=(0,a.jsxs)(fn,{to:"/agents/all",state:pf,"aria-label":D?"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)(Kr,{className:"shrink-0 h-4 w-4"}),(0,a.jsx)("span",{className:D?"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none":void 0,children:"See all agents"})]});return D?(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{asChild:!0,children:_e}),(0,a.jsx)(Cs,{side:"right",children:"See all agents"})]}):_e})()]})}r(jM,"SidebarAgents");var wM="opacity-0 transition-opacity group-hover/starred-project:opacity-100 group-focus-within/starred-project:opacity-100";function kM(){const{selectedCompanyId:e}=bt(),{isMobile:t,setSidebarOpen:i,collapsed:l,peeking:c}=Zn(),d=l&&!c,m=vn(),{data:f}=be({queryKey:P.projects.list(e),queryFn:r(()=>ir.list(e),"queryFn"),enabled:!!e}),h=g0(e),g=B1(e),v=m.pathname.match(/^\/(?:[^/]+\/)?projects\/([^/]+)/)?.[1]??null,y=(0,b.useMemo)(()=>{if(!h.isSuccess)return[];const S=new Set($1(h.data,"project"));if(S.size===0)return[];const D=new Map((f??[]).map(R=>[R.id,R]));return Array.from(S).map(R=>D.get(R)).filter(R=>!!R).sort((R,E)=>R.name.localeCompare(E.name,void 0,{sensitivity:"base"}))},[h.data,h.isSuccess,f]),j=(0,b.useCallback)(S=>g.mutate({resourceType:"project",resourceId:S.id,resourceName:S.name,starred:!1}),[g]),k=(0,b.useCallback)(S=>g.mutate({resourceType:"project",resourceId:S.id,resourceName:S.name,state:"left"}),[g]),N=(0,b.useCallback)(S=>g.isPending&&g.variables?.resourceType==="project"&&g.variables.resourceId===S.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(S=>{const D=mk(S),R=v===D||v===S.id,E=N(S),C=E&&g.variables?.starred===!1,I=E&&g.variables?.state==="left",O=U1(h.data,"project",S.id),z=(0,a.jsx)(SM,{project:S,active:R,rail:d,onNavigate:r(()=>{t&&i(!1)},"onNavigate")});return(0,a.jsxs)("div",{className:"group/starred-project relative flex items-center",children:[d?(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{asChild:!0,children:(0,a.jsx)("div",{className:"min-w-0 flex-1",children:z})}),(0,a.jsx)(Cs,{side:"right",children:S.name})]}):z,!d&&!t?(0,a.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:(0,a.jsx)(q1,{size:"row",quiet:!0,starred:O,pending:C,resourceName:S.name,onToggle:r(()=>j(S),"onToggle"),revealClassName:wM})}):null,!d&&t?(0,a.jsxs)(Wr,{children:[(0,a.jsx)(Vr,{asChild:!0,children:(0,a.jsx)(pe,{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 ${S.name}`,children:(0,a.jsx)(mf,{className:"h-3.5 w-3.5"})})}),(0,a.jsxs)(Qr,{align:"end",className:"w-48",children:[(0,a.jsxs)(Cn,{onClick:r(()=>{E||j(S)},"onClick"),disabled:E,children:[C?(0,a.jsx)(za,{className:"size-4 motion-safe:animate-spin"}):(0,a.jsx)(Ug,{className:"size-4 fill-amber-500 text-amber-500"}),(0,a.jsx)("span",{children:"Remove from starred"})]}),(0,a.jsx)(yi,{}),(0,a.jsxs)(Cn,{onClick:r(()=>{E||k(S)},"onClick"),disabled:E,children:[I?(0,a.jsx)(za,{className:"size-4 motion-safe:animate-spin"}):(0,a.jsx)(bf,{className:"size-4"}),(0,a.jsx)("span",{children:"Leave project"})]})]})]}):null]},S.id)})})}r(kM,"SidebarStarredProjects");function SM({project:e,active:t,rail:i,onNavigate:l}){return(0,a.jsxs)(fn,{to:`/projects/${mk(e)}/issues`,state:pf,"aria-current":t?"page":void 0,onClick:l,className:G("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",!i&&"pl-6 pr-8",t?Kl.active:G(Kl.rest,"text-ink/80")),children:[(0,a.jsx)(Tk,{color:e.color??null,icon:e.icon??null,size:"xs"}),(0,a.jsx)("span",{className:i?xk:"flex-1 truncate",children:e.name}),!i&&e.visibility==="private"?(0,a.jsx)(Ih,{className:"size-3.5 shrink-0 text-ink-3","aria-label":"Private project"}):null,!i&&e.pauseReason==="budget"?(0,a.jsx)(K1,{title:"Project paused by budget"}):null]})}r(SM,"SidebarStarredProjectLink");var Zh="wardmote:recent-tasks-updated",F1="wardmote.recentTasks.v2:",NM="wardmote.recentTasks:";function H1(e,t){return`${F1}${e}:${t??"__local_board__"}`}r(H1,"getRecentTasksStorageKey");function CM(e,t){if(!e||typeof e!="object")return!1;const i=e;return i.companyId===t&&typeof i.id=="string"&&i.id.length>0&&typeof i.title=="string"&&(i.identifier===null||typeof i.identifier=="string")&&typeof i.status=="string"&&typeof i.recordedAt=="number"&&Number.isFinite(i.recordedAt)&&(i.snapshotUpdatedAt===void 0||typeof i.snapshotUpdatedAt=="number"&&Number.isFinite(i.snapshotUpdatedAt))}r(CM,"isRecentTaskEntry");function Ur(e,t){if(typeof window>"u")return[];try{const i=e.startsWith(F1)?NM+e.slice(24):e,l=window.localStorage.getItem(e)??window.localStorage.getItem(i),c=JSON.parse(l??"[]");return Array.isArray(c)?V1(c.filter(d=>CM(d,t))):[]}catch{return[]}}r(Ur,"readRecentTasks");function AM(e,t){if(!(typeof window>"u")){try{if(window.localStorage.getItem(e)!==null)return}catch{return}kf(e,Ur(e,t))}}r(AM,"migrateRecentTasks");function V1(e){const t=new Set;return[...e].sort((i,l)=>l.recordedAt-i.recordedAt).filter(i=>t.has(i.id)?!1:(t.add(i.id),!0)).slice(0,5)}r(V1,"normalizeRecentTasks");function _M(e,t){typeof window>"u"||window.dispatchEvent(new CustomEvent(Zh,{detail:{storageKey:e,entries:t}}))}r(_M,"publishRecentTasks");function kf(e,t){if(typeof window>"u")return;const i=V1(t);try{const l=JSON.stringify(i);if(window.localStorage.getItem(e)===l)return;window.localStorage.setItem(e,l)}catch{}_M(e,i)}r(kf,"writeRecentTasks");function x0(e,t){if(e.id!==t.id||e.companyId!==t.companyId)return e;const i=new Date(t.updatedAt).getTime();return!Number.isFinite(i)||e.snapshotUpdatedAt!==void 0&&i<e.snapshotUpdatedAt?e:i===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:i,recordedAt:Math.max(e.recordedAt,i)}}r(x0,"mergeRecentTaskSnapshot");function EM(e,t,i=new Date(e.updatedAt).getTime()){if(e.conversationAgentId)return;const l=H1(e.companyId,t),c=Ur(l,e.companyId),d=c.find(v=>v.id===e.id),m=Number.isFinite(i)?i:d?.recordedAt??Date.now(),f=new Date(e.updatedAt).getTime(),h=d?x0(d,e):{id:e.id,companyId:e.companyId,title:e.title,identifier:e.identifier,status:e.status,externalConversationState:e.externalConversationState,recordedAt:m,...Number.isFinite(f)?{snapshotUpdatedAt:f}:{}},g={...h,recordedAt:Math.max(m,h.recordedAt)};d&&d.title===g.title&&d.identifier===g.identifier&&d.status===g.status&&d.externalConversationState===g.externalConversationState&&d.recordedAt===g.recordedAt&&d.snapshotUpdatedAt===g.snapshotUpdatedAt||kf(l,d?c.map(v=>v.id===e.id?g:v):[g,...c])}r(EM,"recordRecentTask");function IM(e,t,i){if(i.size===0)return;const l=Ur(e,t),c=l.filter(d=>!i.has(d.id));c.length!==l.length&&kf(e,c)}r(IM,"pruneRecentTasks");function Q1(e,t,i){const l=new Map(i.map(f=>[f.id,f])),c=Ur(e,t);let d=!1;const m=c.map(f=>{const h=l.get(f.id);if(!h||h.companyId!==t)return f;const g=x0(f,h);return g!==f&&(d=!0),g});d&&kf(e,m)}r(Q1,"updateRecentTaskSnapshots");var TM=1e3;function RM({companyId:e,userId:t}){const i=(0,b.useMemo)(()=>e?H1(e,t):null,[e,t]),[l,c]=(0,b.useState)(()=>i&&e?Ur(i,e):[]);(0,b.useEffect)(()=>{i&&e&&AM(i,e),c(i&&e?Ur(i,e):[])},[e,i]),(0,b.useEffect)(()=>{if(!i||!e)return;const S=r(()=>c(Ur(i,e)),"sync"),D=r(E=>{E.key===i&&S()},"onStorage"),R=r(E=>{const C=E.detail;C?.storageKey===i&&c(C.entries)},"onRecentTasksUpdated");return window.addEventListener("storage",D),window.addEventListener(Zh,R),()=>{window.removeEventListener("storage",D),window.removeEventListener(Zh,R)}},[e,i]);const d=[...l].sort((S,D)=>S.id.localeCompare(D.id)),m=JSON.stringify(d.map(S=>S.id)),f=Kg({queries:d.map(S=>({queryKey:P.issues.detail(S.id),queryFn:r(()=>dn.get(S.id),"queryFn"),retry:!1,staleTime:3e4}))}),h=new Map(f.flatMap(S=>S.data?[[S.data.id,S.data]]:[])),g=l.map(S=>{const D=h.get(S.id);return!D||D.companyId!==e||D.hiddenAt?S:x0(S,D)}),v=f.map(S=>`${S.dataUpdatedAt}:${S.errorUpdatedAt}:${S.status}`).join("|");(0,b.useEffect)(()=>{if(!i||!e||f.length===0)return;const S=[],D=new Set;f.forEach((R,E)=>{const C=d[E];C&&(R.data?R.data.companyId!==e||R.data.hiddenAt?D.add(C.id):S.push(R.data):R.error instanceof ji&&[403,404].includes(R.error.status)&&D.add(C.id))}),Q1(i,e,S),IM(i,e,D)},[e,m,v,i]);const[y,j]=(0,b.useState)(()=>l.map(S=>S.id)),k=JSON.stringify(l.map(S=>[S.id,S.recordedAt]));(0,b.useEffect)(()=>{const S=JSON.parse(k).map(([R])=>R);if(JSON.stringify([...y].sort((R,E)=>R.localeCompare(E)))!==m){j(S);return}if(S.every((R,E)=>R===y[E]))return;const D=window.setTimeout(()=>j(S),TM);return()=>window.clearTimeout(D)},[k,m,y,i]);const N=new Map(g.map(S=>[S.id,S]));return{entries:y.length===l.length&&y.every(S=>N.has(S))?y.map(S=>N.get(S)):g,storageKey:i}}r(RM,"useRecentTasks");var Fp="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",DM=":restart-wake-retry";function MM(e,t){return`wardmote.recentTasks:${e}:${t??"__local_board__"}${DM}`}r(MM,"restartWakeRetryStorageKey");function W1(e){if(!e)return new Set;try{const t=JSON.parse(window.localStorage.getItem(e)??"[]");return new Set(Array.isArray(t)?t.filter(i=>typeof i=="string"):[])}catch{return new Set}}r(W1,"readRestartWakeRetryIssueIds");function Hp(e,t,i){if(!e)return;const l=W1(e);i?l.add(t):l.delete(t);try{l.size>0?window.localStorage.setItem(e,JSON.stringify([...l])):window.localStorage.removeItem(e)}catch{}}r(Hp,"setRestartWakeRetryPending");function Vp(e,t){return e instanceof Error&&e.message.trim()?e.message:t}r(Vp,"errorMessage$2");function OM({companyId:e,liveIssueIds:t}){const{collapsed:i,peeking:l}=Zn(),c=i&&!l,{data:d,isPending:m}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),retry:!1});if(!e||m)return null;const f=d?.user?.id??d?.session?.userId??null;return(0,a.jsx)(LM,{companyId:e,userId:f,liveIssueIds:t,rail:c},`${e}:${f??"__local_board__"}`)}r(OM,"SidebarRecentTasks");function LM({companyId:e,userId:t,liveIssueIds:i,rail:l}){const{entries:c,storageKey:d}=RM({companyId:e,userId:t}),m=Rn(),f=hf(),[h,g]=(0,b.useState)(null),[v,y]=(0,b.useState)(""),[j,k]=(0,b.useState)(null),N=MM(e,t);if(c.length===0)return null;const S=r(async I=>{await Promise.all([m.invalidateQueries({queryKey:P.issues.detail(I)}),m.invalidateQueries({queryKey:P.issues.list(e)}),m.invalidateQueries({queryKey:P.issues.activity(I)})])},"refreshIssueQueries"),D=r(I=>{g(I),y(I.title)},"beginRename"),R=r(async I=>{I.preventDefault();const O=v.trim();if(!h||!O||O===h.title){g(null);return}k("rename");try{const z=await dn.update(h.id,{title:O});m.setQueryData(P.issues.detail(h.id),z),d&&Q1(d,e,[z]),await S(h.id),g(null),f?.pushToast({title:"Task renamed",tone:"success"})}catch(z){f?.pushToast({title:"Task rename failed",body:Vp(z,"Unable to rename this task."),tone:"error"})}finally{k(null)}},"submitRename"),E=r(async I=>{k("archive");try{await dn.archiveFromInbox(I.id),await S(I.id),await m.invalidateQueries({queryKey:P.sidebarBadges(e)}),f?.pushToast({title:"Task archived from inbox",tone:"success"})}catch(O){f?.pushToast({title:"Task archive failed",body:Vp(O,"Unable to archive this task from the inbox."),tone:"error"})}finally{k(null)}},"archiveTask"),C=r(async I=>{k("pause");try{const O=await dn.getTreeControlState(I.id);if(O.activePauseHold?.isRoot){const z=await dn.get(I.id);if(Hp(N,I.id,!0),await dn.releaseTreeHold(I.id,O.activePauseHold.holdId,{reason:"Restarted from Recent Tasks."}),z.assigneeAgentId){const B=await Pa.wakeup(z.assigneeAgentId,{source:"assignment",triggerDetail:"manual",reason:"recent_task_restart",payload:{issueId:z.id}},z.companyId);if(!("id"in B))throw new Error(B.message??"The assignee wake was skipped.")}Hp(N,I.id,!1),f?.pushToast({title:"Task restarted",tone:"success"})}else{if(O.activePauseHold)throw new Error("This task is paused by a parent task. Restart it from the pause root.");if(W1(N).has(I.id)){const z=await dn.get(I.id);if(z.assigneeAgentId){const B=await Pa.wakeup(z.assigneeAgentId,{source:"assignment",triggerDetail:"manual",reason:"recent_task_restart_retry",payload:{issueId:z.id}},z.companyId);if(!("id"in B))throw new Error(B.message??"The assignee wake was skipped.")}Hp(N,I.id,!1),f?.pushToast({title:"Task restarted",tone:"success"})}else await dn.createTreeHold(I.id,{mode:"pause",reason:"Paused from Recent Tasks.",releasePolicy:{strategy:"manual"}}),f?.pushToast({title:"Task paused",tone:"success"})}await m.invalidateQueries({queryKey:["issues","tree-control-state",I.id]})}catch(O){f?.pushToast({title:"Task pause update failed",body:Vp(O,"Unable to pause or restart this task."),tone:"error"})}finally{k(null)}},"toggleTaskPause");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Pd,{label:"Recent Tasks",children:c.map(I=>(0,a.jsxs)("div",{className:"sidebar-action-row group/recent-task relative",children:[(0,a.jsx)(Ye,{to:`/issues/${I.id}`,label:I.title,trailing:I.status==="in_review"&&I.externalConversationState==="waiting"?(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Idle"}):void 0,trailingLabel:I.status==="in_review"&&I.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:i.has(I.id)?1:void 0}),l?null:(0,a.jsxs)(Wr,{children:[(0,a.jsx)(Vr,{asChild:!0,children:(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`More actions for ${I.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)(Qr,{side:"right",align:"start",className:"w-(--profile-popover-width) rounded-xl p-1.5 shadow-(--shadow-profile-popover)",children:[(0,a.jsxs)(Cn,{className:Fp,onSelect:r(()=>D(I),"onSelect"),children:[(0,a.jsx)(e0,{"aria-hidden":"true"}),"Rename"]}),(0,a.jsxs)(Cn,{className:Fp,disabled:j!==null,onSelect:r(()=>{E(I)},"onSelect"),children:[(0,a.jsx)(Fk,{"aria-hidden":"true"}),"Archive"]}),(0,a.jsxs)(Cn,{className:Fp,disabled:j!==null,onSelect:r(()=>{C(I)},"onSelect"),children:[(0,a.jsx)(Gl,{"aria-hidden":"true"}),"Pause/Restart"]})]})]})]},I.id))}),(0,a.jsx)(Ds,{open:h!==null,onOpenChange:r(I=>{!I&&j!=="rename"&&g(null)},"onOpenChange"),children:(0,a.jsx)(Gs,{className:"sm:max-w-md",children:(0,a.jsxs)("form",{className:"grid gap-4",onSubmit:r(I=>{R(I)},"onSubmit"),children:[(0,a.jsxs)(Sc,{children:[(0,a.jsx)(Qs,{children:"Rename task"}),(0,a.jsx)(Nc,{children:"Choose a short, clear name for this task."})]}),(0,a.jsx)(aa,{autoFocus:!0,"aria-label":"Task name",value:v,disabled:j==="rename",onChange:r(I=>y(I.target.value),"onChange")}),(0,a.jsxs)(a0,{children:[(0,a.jsx)(pe,{type:"button",variant:"secondary",disabled:j==="rename",onClick:r(()=>g(null),"onClick"),children:"Cancel"}),(0,a.jsx)(pe,{type:"submit",disabled:j==="rename"||!v.trim(),children:j==="rename"?"Saving...":"Save"})]})]})})})]})}r(LM,"RecentTasksList");var zM={list:r((e,t={})=>{const i=new URLSearchParams;t.includeDismissed&&i.set("includeDismissed","true"),t.archived&&i.set("archived","true"),t.all&&i.set("all","true"),t.activitySince&&i.set("activitySince",t.activitySince),t.activityUntil&&i.set("activityUntil",t.activityUntil),t.queue&&i.set("queue",t.queue),t.sort&&i.set("sort",t.sort),t.cursor&&i.set("cursor",t.cursor),t.limit!==void 0&&i.set("limit",String(t.limit));const l=i.toString();return Re.get(`/companies/${e}/attention${l?`?${l}`:""}`)},"list"),count:r(e=>Re.get(`/companies/${e}/attention/count`),"count")},Vu={list:r(e=>Re.get(`/companies/${e}/inbox-dismissals`),"list"),dismiss:r((e,t)=>Re.post(`/companies/${e}/inbox-dismissals`,{itemKey:t}),"dismiss"),snooze:r((e,t,i)=>Re.post(`/companies/${e}/inbox-dismissals`,{itemKey:t,kind:"snooze",snoozedUntil:i}),"snooze"),restore:r((e,t)=>Re.delete(`/companies/${e}/inbox-dismissals/${encodeURIComponent(t)}`),"restore")},G1={list:r((e,t)=>Re.get(`/companies/${e}/approvals${t?`?status=${encodeURIComponent(t)}`:""}`),"list"),create:r((e,t)=>Re.post(`/companies/${e}/approvals`,t),"create"),get:r(e=>Re.get(`/approvals/${e}`),"get"),approve:r((e,t)=>Re.post(`/approvals/${e}/approve`,{decisionNote:t}),"approve"),reject:r((e,t)=>Re.post(`/approvals/${e}/reject`,{decisionNote:t}),"reject"),requestRevision:r((e,t)=>Re.post(`/approvals/${e}/request-revision`,{decisionNote:t}),"requestRevision"),resubmit:r((e,t)=>Re.post(`/approvals/${e}/resubmit`,{payload:t}),"resubmit"),listComments:r(e=>Re.get(`/approvals/${e}/comments`),"listComments"),addComment:r((e,t)=>Re.post(`/approvals/${e}/comments`,{body:t}),"addComment"),listIssues:r(e=>Re.get(`/approvals/${e}/issues`),"listIssues")},PM={summary:r(e=>Re.get(`/companies/${e}/dashboard`),"summary")},Y1={get:r(e=>Re.get(`/companies/${e}/sidebar-badges`),"get")};var UM=new Set(["failed","timed_out"]),Ud=new Set(["pending","revision_requested"]),X1="wardmote:inbox:dismissed",Z1="wardmote:inbox:read-items",J1="wardmote:inbox:last-tab",wQ="wardmote:inbox:issue-columns",eN="wardmote:inbox:nesting",tN="wardmote:inbox:group-by",kQ="wardmote:inbox:filters",$M="wardmote:inbox:collapsed-groups",BM="wardmote:inbox:collapsed-parents",Jh=["status","id","assignee","kickedOffBy","project","workspace","parent","labels","updated"],nN=["status","id","updated"];function aN(e){return e?`${$M}:${e}`:null}r(aN,"getInboxCollapsedGroupsStorageKey");function sN(e){return e?`${BM}:${e}`:null}r(sN,"getInboxCollapsedParentsStorageKey");function SQ(e){const t=aN(e);if(!t)return new Set;try{const i=localStorage.getItem(t);if(!i)return new Set;const l=JSON.parse(i);return new Set(Array.isArray(l)?l.filter(c=>typeof c=="string"):[])}catch{return new Set}}r(SQ,"loadCollapsedInboxGroupKeys");function NQ(e,t){const i=aN(e);if(i)try{localStorage.setItem(i,JSON.stringify([...t]))}catch{}}r(NQ,"saveCollapsedInboxGroupKeys");function CQ(e){const t=sN(e);if(!t)return new Set;try{const i=localStorage.getItem(t);if(!i)return new Set;const l=JSON.parse(i);return new Set(Array.isArray(l)?l.filter(c=>typeof c=="string"):[])}catch{return new Set}}r(CQ,"loadCollapsedInboxParentIds");function AQ(e,t){const i=sN(e);if(i)try{localStorage.setItem(i,JSON.stringify([...t]))}catch{}}r(AQ,"saveCollapsedInboxParentIds");function nj(){try{const e=localStorage.getItem(X1);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(i=>typeof i=="string"&&i.startsWith("alert:"))):new Set}catch{return new Set}}r(nj,"loadDismissedInboxAlerts");function KM(e){try{localStorage.setItem(X1,JSON.stringify([...e]))}catch{}}r(KM,"saveDismissedInboxAlerts");function qM(e){return new Map(e.map(t=>[t.itemKey,Za(t.dismissedAt)]))}r(qM,"buildInboxDismissedAtByKey");function aj(e,t,i){const l=e.get(t);return l==null?!1:l>=Za(i)}r(aj,"isInboxEntityDismissed");function sj(){try{const e=localStorage.getItem(Z1);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}r(sj,"loadReadInboxItems");function ij(e){try{localStorage.setItem(Z1,JSON.stringify([...e]))}catch{}}r(ij,"saveReadInboxItems");function iN(e){const t=new Set(e);return Jh.filter(i=>t.has(i))}r(iN,"normalizeInboxIssueColumns");function FM(e){return e?[...Jh]:Jh.filter(t=>t!=="workspace")}r(FM,"getAvailableInboxIssueColumns");function _Q(){try{const e=localStorage.getItem(tN);return e==="type"||e==="assignee"||e==="project"||e==="workspace"?e:"none"}catch{return"none"}}r(_Q,"loadInboxWorkItemGroupBy");function EQ(e){try{localStorage.setItem(tN,e)}catch{}}r(EQ,"saveInboxWorkItemGroupBy");function IQ(e,t,i){return i&&e==="workspace"&&!t}r(IQ,"shouldResetInboxWorkspaceGrouping");function HM(e,t,{isolatedWorkspacesEnabled:i=!1,executionWorkspaceById:l,projectWorkspaceById:c,defaultProjectWorkspaceIdByProjectId:d}={}){const m=t.trim().toLowerCase();return!m||e.title.toLowerCase().includes(m)||e.identifier?.toLowerCase().includes(m)||e.description?.toLowerCase().includes(m)?!0:i?rN(e,{executionWorkspaceById:l,projectWorkspaceById:c,defaultProjectWorkspaceIdByProjectId:d})?.toLowerCase().includes(m)??!1:!1}r(HM,"matchesInboxIssueSearch");function TQ({visibleIssues:e,searchableIssues:t,query:i,isolatedWorkspacesEnabled:l=!1,executionWorkspaceById:c,projectWorkspaceById:d,defaultProjectWorkspaceIdByProjectId:m}){const f=i.trim();if(!f)return[];const h=new Set(e.map(g=>g.id));return t.filter(g=>!h.has(g.id)).filter(g=>HM(g,f,{isolatedWorkspacesEnabled:l,executionWorkspaceById:c,projectWorkspaceById:d,defaultProjectWorkspaceIdByProjectId:m})).sort(fc)}r(TQ,"getArchivedInboxSearchIssues");function RQ({query:e,filteredWorkItems:t,archivedSearchIssues:i,remoteIssues:l,issueFilters:c,currentUserId:d,enableRoutineVisibilityFilter:m=!1,liveIssueIds:f,issueFilterContext:h={}}){if(!e.trim())return[];const g=new Set([...t.filter(v=>v.kind==="issue").map(v=>v.issue.id),...i.map(v=>v.id)]);return rS(l,c,d,m,f,h).filter(v=>!g.has(v.id))}r(RQ,"getInboxSearchSupplementIssues");function VM(e){const t=e?.trim();return t?`${t} (default)`:"Default workspace"}r(VM,"formatDefaultWorkspaceGroupLabel");function QM(e,{projectWorkspaceById:t,defaultProjectWorkspaceIdByProjectId:i}){if(!e.projectId)return null;const l=i?.get(e.projectId)??null;return l?{id:l,label:VM(t?.get(l)?.name)}:null}r(QM,"resolveDefaultProjectWorkspaceInfo");function rN(e,{executionWorkspaceById:t,projectWorkspaceById:i,defaultProjectWorkspaceIdByProjectId:l}){const c=e.projectId?l?.get(e.projectId)??null:null;if(e.executionWorkspaceId){const d=t?.get(e.executionWorkspaceId)??null,m=d?.projectWorkspaceId??e.projectWorkspaceId??null;if(d?.mode==="shared_workspace"&&m===c)return null;const f=d?.name;if(f)return f}if(e.projectWorkspaceId){if(e.projectWorkspaceId===c)return null;const d=i?.get(e.projectWorkspaceId)?.name;if(d)return d}return null}r(rN,"resolveIssueWorkspaceName");function WM(e,{executionWorkspaceById:t,projectWorkspaceById:i,defaultProjectWorkspaceIdByProjectId:l}={}){const c=QM(e,{projectWorkspaceById:i,defaultProjectWorkspaceIdByProjectId:l});if(e.executionWorkspaceId){const d=t?.get(e.executionWorkspaceId)??null,m=d?.projectWorkspaceId??e.projectWorkspaceId??null;if(d?.mode==="shared_workspace"&&m!=null&&m===c?.id&&c)return{key:`workspace:project:${c.id}`,label:c.label};const f=d?.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 d=i?.get(e.projectWorkspaceId)?.name?.trim();if(d)return{key:`workspace:project:${e.projectWorkspaceId}`,label:d}}return c?{key:`workspace:project:${c.id}`,label:c.label}:{key:"workspace:none",label:"No workspace"}}r(WM,"resolveIssueWorkspaceGroup");function DQ(){try{return localStorage.getItem(eN)!=="false"}catch{return!0}}r(DQ,"loadInboxNesting");function MQ(e){try{localStorage.setItem(eN,String(e))}catch{}}r(MQ,"saveInboxNesting");function OQ(e,t){return e&&!t}r(OQ,"resolveInboxNestingEnabled");function rj(){try{const e=localStorage.getItem(J1);return e==="all"||e==="unread"||e==="recent"||e==="mine"||e==="blocked"?e:"mine"}catch{return"mine"}}r(rj,"loadLastInboxTab");function LQ(e){try{localStorage.setItem(J1,e)}catch{}}r(LQ,"saveLastInboxTab");function zQ(e){return e==="mine"}r(zQ,"isMineInboxTab");function PQ(e){return e==="all"}r(PQ,"shouldShowCompanyAlerts");function UQ(e,t){return t===0||e<0?-1:Math.min(e,t-1)}r(UQ,"resolveInboxSelectionIndex");function GM(e,t,i){return t===0?-1:e<0?0:i==="next"?Math.min(e+1,t-1):Math.max(e-1,0)}r(GM,"getInboxKeyboardSelectionIndex");function $Q(e){const t=[...e].sort((l,c)=>new Date(c.createdAt).getTime()-new Date(l.createdAt).getTime()),i=new Map;for(const l of t)i.has(l.agentId)||i.set(l.agentId,l);return Array.from(i.values()).filter(l=>UM.has(l.status))}r($Q,"getLatestFailedRunsByAgent");function Za(e){if(!e)return 0;const t=new Date(e).getTime();return Number.isFinite(t)?t:0}r(Za,"normalizeTimestamp");function $d(e){const t=Za(e.lastActivityAt);if(t>0)return t;const i=Za(e.lastExternalCommentAt);return i>0?i:Za(e.updatedAt)}r($d,"issueLastActivityTimestamp");function fc(e,t){const i=$d(t)-$d(e);return i!==0?i:Za(t.updatedAt)-Za(e.updatedAt)}r(fc,"sortIssuesByMostRecentActivity");function YM(e){return[...e].sort(fc).slice(0,100)}r(YM,"getRecentTouchedIssues");function BQ(e,t,i,l){const c=[...e].sort((d,m)=>Za(m.updatedAt)-Za(d.updatedAt));return t==="mine"?c.filter(d=>lN(d,l)):t==="recent"?c:t==="unread"?c.filter(d=>Ud.has(d.status)):i==="all"?c:c.filter(d=>{const m=Ud.has(d.status);return i==="actionable"?m:!m})}r(BQ,"getApprovalsForTab");function lN(e,t){return Ud.has(e.status)?!0:t?e.requestedByUserId===t||e.decidedByUserId===t:!1}r(lN,"isApprovalVisibleInMine");function Qp(e){const t=Za(e.updatedAt);return t>0?t:Za(e.createdAt)}r(Qp,"approvalActivityTimestamp");function KQ({issues:e,approvals:t,failedRuns:i=[],joinRequests:l=[]}){return[...e.map(c=>({kind:"issue",timestamp:$d(c),issue:c})),...t.map(c=>({kind:"approval",timestamp:Qp(c),approval:c})),...i.map(c=>({kind:"failed_run",timestamp:Za(c.createdAt),run:c})),...l.map(c=>({kind:"join_request",timestamp:Za(c.createdAt),joinRequest:c}))].sort((c,d)=>{const m=d.timestamp-c.timestamp;return m!==0?m:c.kind==="issue"&&d.kind==="issue"?fc(c.issue,d.issue):c.kind==="approval"&&d.kind==="approval"?Qp(d.approval)-Qp(c.approval):c.kind==="approval"?-1:1})}r(KQ,"getInboxWorkItems");var XM=["issue","approval","failed_run","join_request"],oN={issue:"Tasks",approval:"Approvals",failed_run:"Failed runs",join_request:"Join requests"};function ZM(e,{agentById:t,currentUserId:i,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:Pr(e.assigneeUserId,i,l)??"User"}:{key:"assignee:none",label:"Unassigned"}}r(ZM,"resolveIssueAssigneeGroup");function JM(e,{projectById:t}){if(!e.projectId)return{key:"project:none",label:"No project"};const i=t?.get(e.projectId)?.name?.trim();return{key:`project:${e.projectId}`,label:i||e.projectId.slice(0,8)}}r(JM,"resolveIssueProjectGroup");function Wp(e,t){const i=new Map;for(const l of e){const c=l.kind==="issue"?t(l.issue):{key:`kind:${l.kind}`,label:oN[l.kind]},d=i.get(c.key);d?(d.items.push(l),d.latestTimestamp=Math.max(d.latestTimestamp,l.timestamp)):i.set(c.key,{label:c.label,items:[l],latestTimestamp:l.timestamp})}return[...i.entries()].map(([l,c])=>({key:l,label:c.label,items:c.items,latestTimestamp:c.latestTimestamp})).sort((l,c)=>{const d=c.latestTimestamp-l.latestTimestamp;return d!==0?d:l.label.localeCompare(c.label)}).map(({key:l,label:c,items:d})=>({key:l,label:c,items:d}))}r(Wp,"groupInboxWorkItemsByIssueGroup");function eO(e,t,i={}){if(t==="none")return[{key:"__all",label:null,items:e}];if(t==="workspace")return Wp(e,d=>WM(d,i));if(t==="assignee")return Wp(e,d=>ZM(d,i));if(t==="project")return Wp(e,d=>JM(d,i));const l=new Map;for(const d of e){const m=l.get(d.kind)??[];m.push(d),l.set(d.kind,m)}const c=[];for(const d of XM){const m=l.get(d)??[];m.length!==0&&c.push({key:d,label:oN[d],items:m})}return c}r(eO,"groupInboxWorkItems");function tO(e){return e.replace(/^archived-search:/,"").replace(/^other-search:/,"")}r(tO,"stripInboxSearchGroupPrefix");function nO(e){return e.find(t=>t.kind==="issue")?.issue??null}r(nO,"firstIssueFromInboxWorkItems");function lj(e,t,i){return e?t.projectWorkspaceById?.get(e)?.projectId??(i?.projectWorkspaceId===e?i.projectId:null):i?.projectId??null}r(lj,"projectIdForProjectWorkspace");function qQ(e,t,i,l={}){const c=nO(i);if(!c)return null;const d=tO(e);if(t==="project"){if(!d.startsWith("project:"))return{};const m=d.slice(8);return m&&m!=="none"?{projectId:m}:{}}if(t==="assignee"){if(d.startsWith("assignee:agent:")){const m=d.slice(15);return m?{assigneeAgentId:m}:{}}if(d.startsWith("assignee:user:")){const m=d.slice(14);return m?{assigneeUserId:m}:{}}return{}}if(t==="workspace"){if(d.startsWith("workspace:execution:")){const m=d.slice(20);if(!m)return{};const f=l.executionWorkspaceById?.get(m)??null,h=f?.projectWorkspaceId??(c.executionWorkspaceId===m?c.projectWorkspaceId:null),g=f?.projectId??lj(h,l,c);return{executionWorkspaceId:m,executionWorkspaceMode:"reuse_existing",...g?{projectId:g}:{},...h?{projectWorkspaceId:h}:{}}}if(d.startsWith("workspace:project:")){const m=d.slice(18);if(!m)return{};const f=lj(m,l,c);return{...f?{projectId:f}:{},projectWorkspaceId:m}}}return{}}r(qQ,"buildInboxIssueGroupCreateDefaults");function aO(e){const t=[],i=[];for(const f of e)f.kind==="issue"?t.push(f):i.push(f);const l=new Set(t.map(f=>f.issue.id)),c=new Map,d=new Set;for(const f of t){const{issue:h}=f;if(h.parentId&&l.has(h.parentId)){d.add(h.id);const g=c.get(h.parentId)??[];g.push(h),c.set(h.parentId,g)}}const m=r((f,h=new Set)=>{const g=$d(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=>m(j,v)))},"subtreeActivityTimestamp");for(const f of c.values())f.sort((h,g)=>{const v=m(g)-m(h);return v!==0?v:fc(h,g)});return{displayItems:[...t.filter(f=>!d.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=>m(v)));return{...f,timestamp:Math.max(f.timestamp,g)}}),...i].sort((f,h)=>{const g=h.timestamp-f.timestamp;return g!==0?g:f.kind==="issue"&&h.kind==="issue"?fc(f.issue,h.issue):0}),childrenByIssueId:c}}r(aO,"buildInboxNesting");function FQ(e,t,i,l){const c=l?.keyPrefix??"",d=l?.searchSection??"none",m=l?.nestingEnabled??!1;return d!=="none"&&e.length===0?[]:eO(e,t,i).map(f=>{const h=m&&f.items.some(g=>g.kind==="issue")?aO(f.items):{displayItems:f.items,childrenByIssueId:new Map};return{key:`${c}${f.key}`,label:f.label,displayItems:h.displayItems,childrenByIssueId:h.childrenByIssueId,searchSection:d}})}r(FQ,"buildGroupedInboxSections");function sO(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(sO,"getInboxWorkItemKey");function HQ(e,t,i){const l=[];for(const c of e){const d=t.has(c.key);if(c.label&&l.push({type:"group",groupKey:c.key,label:c.label,collapsed:d}),d)continue;const m=r((f,h)=>{const g=c.childrenByIssueId.get(f);if(!(!g?.length||i.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}),m(v.id,y)}},"addIssueChildren");for(const f of c.displayItems)l.push({type:"top",itemKey:`${c.key}:${sO(f)}`,item:f}),f.kind==="issue"&&m(f.issue.id,new Set([f.issue.id]))}return l}r(HQ,"buildInboxKeyboardNavEntries");function VQ({tab:e,hasItems:t,showOnMine:i,showOnRecent:l,showOnUnread:c,showOnAll:d}){return t?e==="mine"?i:e==="recent"?l:e==="unread"?c:d:!1}r(VQ,"shouldShowInboxSection");function iO({approvals:e,joinRequests:t,dashboard:i,failedRuns:l,mineIssues:c,dismissedAlerts:d,dismissedAtByKey:m,currentUserId:f}){const h=e.filter(R=>lN(R,f)&&Ud.has(R.status)&&!aj(m,`approval:${R.id}`,R.updatedAt)).length,g=t.filter(R=>!aj(m,`join:${R.id}`,R.updatedAt??R.createdAt)).length,v=c.filter(R=>R.isUnreadForMe).length,y=i?.agents.error??0,j=i?.costs.monthBudgetCents??0,k=i?.costs.monthUtilizationPercent??0,N=y>0&&l===0&&!d.has("alert:agent-errors"),S=j>0&&k>=80&&!d.has("alert:budget"),D=Number(N)+Number(S);return{inbox:h+g+l+v,approvals:h,failedRuns:l,joinRequests:g,mineIssues:v,alerts:D}}r(iO,"computeInboxBadgeData");var rO="backlog,todo,in_progress,in_review,blocked,done",lO=500,oO=3e4;function cO(){const[e,t]=(0,b.useState)(nj);return(0,b.useEffect)(()=>{const l=r(c=>{c.key==="wardmote:inbox:dismissed"&&t(nj())},"handleStorage");return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)},[]),{dismissed:e,dismiss:r(l=>{t(c=>{const d=new Set(c);return d.add(l),KM(d),d})},"dismiss")}}r(cO,"useDismissedInboxAlerts");function uO(e){const t=Rn(),i=e?P.inboxDismissals(e):["inbox-dismissals","__disabled__"],{data:l=[]}=be({queryKey:i,queryFn:r(()=>Vu.list(e),"queryFn"),enabled:!!e}),c=bn({mutationFn:r(({itemKey:j})=>Vu.dismiss(e,j),"mutationFn"),onMutate:r(async({itemKey:j})=>{if(!e)return{previous:[]};await t.cancelQueries({queryKey:i});const k=t.getQueryData(i)??[],N=new Date;return t.setQueryData(i,[{id:`optimistic:${j}`,companyId:e,userId:"me",itemKey:j,dismissedAt:N,createdAt:N,updatedAt:N},...k.filter(S=>S.itemKey!==j)]),{previous:k}},"onMutate"),onError:r((j,k,N)=>{N&&t.setQueryData(i,N.previous)},"onError"),onSettled:r(()=>{e&&d()},"onSettled")});function d(){e&&(t.invalidateQueries({queryKey:i}),t.invalidateQueries({queryKey:P.sidebarBadges(e)}),t.invalidateQueries({queryKey:P.attention(e)}))}r(d,"invalidateDismissalConsumers");const m=bn({mutationFn:r(({itemKey:j,snoozedUntil:k})=>Vu.snooze(e,j,k),"mutationFn"),onSettled:d}),f=bn({mutationFn:r(({itemKey:j})=>Vu.restore(e,j),"mutationFn"),onSettled:d}),h=(0,b.useMemo)(()=>qM(l),[l]),g=c.mutate,v=m.mutate,y=f.mutate;return{dismissals:l,dismissedAtByKey:h,dismiss:(0,b.useCallback)(j=>g({itemKey:j}),[g]),snooze:(0,b.useCallback)((j,k)=>v({itemKey:j,snoozedUntil:k}),[v]),restore:(0,b.useCallback)(j=>y({itemKey:j}),[y]),isPending:c.isPending||m.isPending||f.isPending}}r(uO,"useInboxDismissals");function QQ(){const[e,t]=(0,b.useState)(sj);return(0,b.useEffect)(()=>{const c=r(d=>{d.key==="wardmote:inbox:read-items"&&t(sj())},"handleStorage");return window.addEventListener("storage",c),()=>window.removeEventListener("storage",c)},[]),{readItems:e,markRead:r(c=>{t(d=>{const m=new Set(d);return m.add(c),ij(m),m})},"markRead"),markUnread:r(c=>{t(d=>{const m=new Set(d);return m.delete(c),ij(m),m})},"markUnread")}}r(QQ,"useReadInboxItems");function b0(e){const t=XI(e),{dismissed:i}=cO(),{dismissedAtByKey:l}=uO(e),{data:c}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn")}),{data:d=[]}=be({queryKey:P.approvals.list(e),queryFn:r(()=>G1.list(e),"queryFn"),enabled:!!e}),{data:m=[]}=be({queryKey:P.access.joinRequests(e),queryFn:r(async()=>{try{return await wi.listJoinRequests(e,"pending_approval")}catch(C){if(C instanceof ji&&(C.status===401||C.status===403))return[];throw C}},"queryFn"),enabled:!!e,retry:!1}),f=P.dashboard(e),h=cc({companyId:e,resourceKey:"dashboard",queryKey:f,enabled:!!e}),{data:g,dataUpdatedAt:v}=be({queryKey:f,queryFn:r(()=>PM.summary(e),"queryFn"),enabled:!!e});uc(h,g,v);const y=P.issues.listMineByMe(e),j=cc({companyId:e,resourceKey:"inbox-badge:mine-issues",queryKey:y,enabled:!!e}),{data:k=[],dataUpdatedAt:N}=be({queryKey:y,queryFn:r(()=>dn.listCompact(e,{touchedByUserId:"me",inboxArchivedByUserId:"me",status:rO,limit:lO}).then(C=>C),"queryFn"),enabled:!!e,refetchOnWindowFocus:!1,staleTime:oO});uc(j,k,N);const S=(0,b.useMemo)(()=>YM(ZI(e,k)),[e,t,k]),D=c?.user.id??c?.session.userId??null,{data:R}=be({queryKey:e?P.sidebarBadges(e):["sidebar-badges","__disabled__"],queryFn:r(async()=>{try{return await Y1.get(e)}catch(C){if(C instanceof ji&&(C.status===401||C.status===403))return null;throw C}},"queryFn"),enabled:!!e,retry:!1}),E=R?.failedRuns??0;return(0,b.useMemo)(()=>iO({approvals:d,joinRequests:m,dashboard:g,failedRuns:E,mineIssues:S,dismissedAlerts:i,dismissedAtByKey:l,currentUserId:D}),[d,m,g,E,S,i,l,D])}r(b0,"useInboxBadge");var dO=new Set(["detailTab","taskDetailView","contextMenuItem","commentAnnotation","commentContextMenuItem","projectSidebarItem","toolbarButton"]),cN=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),fO=1e3,mO=new Set(v_),uN=(0,b.createContext)(null);function pO(e){return e instanceof Error&&e.message?e.message:"Unknown error"}r(pO,"getErrorMessage");function hO(e,t,i){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:i,renderEnvironment:t}}r(hO,"buildLauncherHostContext");function gO(e){if(!e)return;const t=e.querySelector(cN);if(t){t.focus();return}e.focus()}r(gO,"focusFirstElement");function oj(e,t){if(/^https?:\/\//.test(e)||e.startsWith("/")||e.startsWith("#")||e.startsWith(".")||e.startsWith("?"))return e;const i=t.companyPrefix?.trim();return i?`/${i}/${e}`:e}r(oj,"resolveLauncherNavigationTarget");function xO(e){if(e.action.type!=="navigate"&&e.action.type!=="deepLink"||/^https?:\/\//.test(e.action.target))return null;const[t]=e.action.target.split(/[?#]/,1),i=t?.split("/").filter(Boolean).at(-1);return i?i.toLowerCase():null}r(xO,"launcherRoutePath");function bO(e,t){if(e.placementZone!=="sidebar"||!t)return e.displayName;const i=xO(e);return i?t.slots.find(l=>l.type==="routeSidebar"&&l.routePath?.toLowerCase()===i)?.displayName??e.displayName:e.displayName}r(bO,"launcherDisplayName");function vO(e,t){if(t.key!=="Tab")return;const i=Array.from(e.querySelectorAll(cN)).filter(m=>!m.hasAttribute("disabled")&&m.tabIndex!==-1);if(i.length===0){t.preventDefault(),e.focus();return}const l=i[0],c=i[i.length-1],d=document.activeElement;if(t.shiftKey&&d===l){t.preventDefault(),c.focus();return}!t.shiftKey&&d===c&&(t.preventDefault(),l.focus())}r(vO,"trapFocus");function yO(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(yO,"launcherTriggerClassName");function dN(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(dN,"launcherShellBoundsStyle");function jO(e){const t=e.sourceRect,i=dN(e.bounds).width??"min(24rem, calc(100vw - 2rem))";return t?{width:i,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:i,maxHeight:"min(70vh, 36rem)",top:"4rem",left:"50%",transform:"translateX(-50%)"}}r(jO,"launcherPopoverStyle");function wO(e){return typeof e=="string"&&mO.has(e)}r(wO,"isPluginLauncherBounds");function fN(e){const t=e.enabled??!0,{data:i,isLoading:l,error:c}=be({queryKey:P.plugins.uiContributions,queryFn:r(()=>s0.listUiContributions(),"queryFn"),enabled:t}),d=(0,b.useMemo)(()=>[...e.placementZones].sort().join("|"),[e.placementZones]),m=(0,b.useMemo)(()=>{const f=new Map;for(const h of i??[])f.set(h.pluginId,h);return f},[i]);return{launchers:(0,b.useMemo)(()=>{const f=new Set(d.split("|").filter(Boolean)),h=[];for(const g of i??[])for(const v of g.launchers)f.has(v.placementZone)&&(dO.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},[i,e.entityType,d]),contributionsByPluginId:m,isLoading:t&&l,errorMessage:c?pO(c):null}}r(fN,"usePluginLaunchers");async function kO(e,t){const i=t.action.target,l=ky(t.pluginKey,i);return l||(await p3(e),ky(t.pluginKey,i))}r(kO,"resolveLauncherComponent");function SO({pluginId:e,hostContext:t,children:i}){const l=(0,b.useMemo)(()=>({pluginId:e,hostContext:t}),[e,t]);return(0,a.jsx)(h3.Provider,{value:l,children:i})}r(SO,"PluginLauncherBridgeScope");var NO=class extends b.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 CO({instance:e,renderEnvironment:t}){const i=e.component,{data:l}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn")}),c=l?.user?.id??l?.session?.userId??null,d=(0,b.useMemo)(()=>hO(e.hostContext,t,c),[e.hostContext,t,c]);if(!i)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(i.kind==="web-component")return(0,b.createElement)(i.tagName,{className:"block w-full",pluginLauncher:e.launcher,pluginContext:d});const m=(0,b.createElement)(i.component,{launcher:e.launcher,context:d});return(0,a.jsx)(NO,{launcher:e.launcher,children:(0,a.jsx)(SO,{pluginId:e.launcher.pluginId,hostContext:d,children:m})})}r(CO,"LauncherRenderContent");function AO({instance:e,stackIndex:t,isTopmost:i,requestBounds:l,closeLauncher:c}){const d=(0,b.useRef)(null),m=(0,b.useId)();(0,b.useEffect)(()=>{if(!i)return;const y=requestAnimationFrame(()=>{gO(d.current)});return()=>cancelAnimationFrame(y)},[i]),(0,b.useEffect)(()=>{if(!i)return;const y=r(j=>{if(d.current){if(j.key==="Escape"){j.preventDefault(),c(e.key,{reason:"escapeKey",nativeEvent:j});return}vO(d.current,j)}},"handleKeyDown");return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c,e.key,i]);const f=(0,b.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=fO+t*20,g=e.launcher.action.type,v=g==="openPopover"?jO(e):dN(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=>{i&&y.target===y.currentTarget&&c(e.key,{reason:"backdrop",nativeEvent:y})},"onMouseDown")}),(0,a.jsxs)("div",{ref:d,role:"dialog","aria-modal":"true","aria-labelledby":m,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:m,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)(pe,{type:"button",variant:"ghost",size:"sm",className:"ml-auto",onClick:r(()=>{c(e.key,{reason:"programmatic"})},"onClick"),children:"Close"})]}),(0,a.jsx)("div",{className:G("overflow-auto p-4",g==="openDrawer"?"h-[calc(100%-3.5rem)]":"max-h-[calc(100vh-7rem)]"),children:(0,a.jsx)(CO,{instance:e,renderEnvironment:f})})]})]})}r(AO,"LauncherModalShell");function _O({children:e}){const[t,i]=(0,b.useState)([]),l=(0,b.useRef)(t);l.current=t;const c=vn(),d=xa(),m=(0,b.useCallback)(async(v,y)=>{const j=l.current.find(k=>k.key===v);if(j){for(const k of[...j.beforeCloseHandlers])await k(y);i(k=>k.filter(N=>N.key!==v)),queueMicrotask(()=>{for(const k of[...j.closeHandlers])k(y);j.sourceElement&&document.contains(j.sourceElement)&&j.sourceElement.focus()})}},[]);(0,b.useEffect)(()=>{t.length!==0&&Promise.all(t.map(v=>m(v.key,{reason:"hostNavigation"})))},[c.key]);const f=(0,b.useCallback)(async(v,y)=>{wO(y.bounds)&&i(j=>j.map(k=>k.key===v?{...k,bounds:y.bounds}:k))},[]),h=(0,b.useCallback)(async(v,y,j,k)=>{switch(v.action.type){case"navigate":d(oj(v.action.target,y));return;case"deepLink":/^https?:\/\//.test(v.action.target)?window.open(v.action.target,"_blank","noopener,noreferrer"):d(oj(v.action.target,y));return;case"performAction":await s0.bridgePerformAction(v.pluginId,v.action.target,v.action.params,y.companyId??null);return;case"openModal":case"openDrawer":case"openPopover":{const N=await kO(j,v),S=k?.getBoundingClientRect()??null,D={key:`${v.pluginId}:${v.id}:${Date.now()}:${Math.random().toString(36).slice(2,8)}`,launcher:v,hostContext:y,contribution:j,component:N,sourceElement:k??null,sourceRect:S,bounds:v.render?.bounds??"default",beforeCloseHandlers:new Set,closeHandlers:new Set};i(R=>[...R,D]);return}}},[d]),g=(0,b.useMemo)(()=>({activateLauncher:h}),[h]);return(0,a.jsxs)(uN.Provider,{value:g,children:[e,t.map((v,y)=>(0,a.jsx)(AO,{instance:v,stackIndex:y,isTopmost:y===t.length-1,requestBounds:f,closeLauncher:m},v.key))]})}r(_O,"PluginLauncherProvider");function EO(){const e=(0,b.useContext)(uN);if(!e)throw new Error("usePluginLauncherRuntime must be used within PluginLauncherProvider");return e}r(EO,"usePluginLauncherRuntime");function IO({displayName:e,launcher:t,placementZone:i,onClick:l}){return(0,a.jsx)(pe,{type:"button",variant:i==="toolbarButton"||i==="globalToolbarButton"?"secondary":"ghost",size:"sm",className:yO(i),onClick:l,children:e??t.displayName})}r(IO,"DefaultLauncherTrigger");function mN({placementZones:e,context:t,entityType:i,className:l,itemClassName:c,errorClassName:d,errorBehavior:m="inline"}){const{activateLauncher:f}=EO(),{launchers:h,contributionsByPluginId:g,errorMessage:v}=fN({placementZones:e,entityType:i,companyId:t.companyId,enabled:!!t.companyId});return v&&m==="inline"?(0,a.jsxs)("div",{className:G("rounded-md border border-bad/30 bg-bad/5 px-2 py-1 text-xs text-bad",d),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)(IO,{displayName:bO(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(mN,"PluginLauncherOutlet");function TO(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return(0,b.useMemo)(()=>l=>{t.forEach(c=>c(l))},t)}r(TO,"useCombinedRefs");var Sf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yl(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}r(Yl,"isWindow");function v0(e){return"nodeType"in e}r(v0,"isNode");function Ca(e){var t,i;return e?Yl(e)?e:v0(e)&&(t=(i=e.ownerDocument)==null?void 0:i.defaultView)!=null?t:window:window}r(Ca,"getWindow");function y0(e){const{Document:t}=Ca(e);return e instanceof t}r(y0,"isDocument");function Ic(e){return Yl(e)?!1:e instanceof Ca(e).HTMLElement}r(Ic,"isHTMLElement");function pN(e){return e instanceof Ca(e).SVGElement}r(pN,"isSVGElement");function Xl(e){return e?Yl(e)?e.document:v0(e)?y0(e)?e:Ic(e)||pN(e)?e.ownerDocument:document:document:document}r(Xl,"getOwnerDocument");var Is=Sf?b.useLayoutEffect:b.useEffect;function Nf(e){const t=(0,b.useRef)(e);return Is(()=>{t.current=e}),(0,b.useCallback)(function(){for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return t.current==null?void 0:t.current(...l)},[])}r(Nf,"useEvent");function RO(){const e=(0,b.useRef)(null);return[(0,b.useCallback)((t,i)=>{e.current=setInterval(t,i)},[]),(0,b.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}r(RO,"useInterval");function mc(e,t){t===void 0&&(t=[e]);const i=(0,b.useRef)(e);return Is(()=>{i.current!==e&&(i.current=e)},t),i}r(mc,"useLatestValue");function Tc(e,t){const i=(0,b.useRef)();return(0,b.useMemo)(()=>{const l=e(i.current);return i.current=l,l},[...t])}r(Tc,"useLazyMemo");function Bd(e){const t=Nf(e),i=(0,b.useRef)(null);return[i,(0,b.useCallback)(l=>{l!==i.current&&t?.(l,i.current),i.current=l},[])]}r(Bd,"useNodeRef");function Kd(e){const t=(0,b.useRef)();return(0,b.useEffect)(()=>{t.current=e},[e]),t.current}r(Kd,"usePrevious");var Gp={};function Rc(e,t){return(0,b.useMemo)(()=>{if(t)return t;const i=Gp[e]==null?0:Gp[e]+1;return Gp[e]=i,e+"-"+i},[e,t])}r(Rc,"useUniqueId");function hN(e){return function(t){for(var i=arguments.length,l=new Array(i>1?i-1:0),c=1;c<i;c++)l[c-1]=arguments[c];return l.reduce((d,m)=>{const f=Object.entries(m);for(const[h,g]of f){const v=d[h];v!=null&&(d[h]=v+e*g)}return d},{...t})}}r(hN,"createAdjustmentFn");var Bl=hN(1),pc=hN(-1);function DO(e){return"clientX"in e&&"clientY"in e}r(DO,"hasViewportRelativeCoordinates");function Cf(e){if(!e)return!1;const{KeyboardEvent:t}=Ca(e.target);return t&&e instanceof t}r(Cf,"isKeyboardEvent");function MO(e){if(!e)return!1;const{TouchEvent:t}=Ca(e.target);return t&&e instanceof t}r(MO,"isTouchEvent");function qd(e){if(MO(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:i}=e.touches[0];return{x:t,y:i}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:i}=e.changedTouches[0];return{x:t,y:i}}}return DO(e)?{x:e.clientX,y:e.clientY}:null}r(qd,"getEventCoordinates");var Ws=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:i}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(i?Math.round(i):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:i}=e;return"scaleX("+t+") scaleY("+i+")"}},Transform:{toString(e){if(e)return[Ws.Translate.toString(e),Ws.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:i,easing:l}=e;return t+" "+i+"ms "+l}}}),cj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function OO(e){return e.matches(cj)?e:e.querySelector(cj)}r(OO,"findFirstFocusableNode");var LO={display:"none"};function zO(e){let{id:t,value:i}=e;return b.createElement("div",{id:t,style:LO},i)}r(zO,"HiddenText");function PO(e){let{id:t,announcement:i,ariaLiveType:l="assertive"}=e;return b.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},i)}r(PO,"LiveRegion");function UO(){const[e,t]=(0,b.useState)("");return{announce:(0,b.useCallback)(i=>{i!=null&&t(i)},[]),announcement:e}}r(UO,"useAnnouncement$1");var gN=(0,b.createContext)(null);function $O(e){const t=(0,b.useContext)(gN);(0,b.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}r($O,"useDndMonitor");function BO(){const[e]=(0,b.useState)(()=>new Set),t=(0,b.useCallback)(i=>(e.add(i),()=>e.delete(i)),[e]);return[(0,b.useCallback)(i=>{let{type:l,event:c}=i;e.forEach(d=>{var m;return(m=d[l])==null?void 0:m.call(d,c)})},[e]),t]}r(BO,"useDndMonitorProvider");var KO={draggable:`
|
|
5
|
+
To pick up a draggable item, press the space bar.
|
|
6
|
+
While dragging, use the arrow keys to move the item.
|
|
7
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
8
|
+
`},qO={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:i}=e;return i?"Draggable item "+t.id+" was moved over droppable area "+i.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:i}=e;return i?"Draggable item "+t.id+" was dropped over droppable area "+i.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function FO(e){let{announcements:t=qO,container:i,hiddenTextDescribedById:l,screenReaderInstructions:c=KO}=e;const{announce:d,announcement:m}=UO(),f=Rc("DndLiveRegion"),[h,g]=(0,b.useState)(!1);if((0,b.useEffect)(()=>{g(!0)},[]),$O((0,b.useMemo)(()=>({onDragStart(y){let{active:j}=y;d(t.onDragStart({active:j}))},onDragMove(y){let{active:j,over:k}=y;t.onDragMove&&d(t.onDragMove({active:j,over:k}))},onDragOver(y){let{active:j,over:k}=y;d(t.onDragOver({active:j,over:k}))},onDragEnd(y){let{active:j,over:k}=y;d(t.onDragEnd({active:j,over:k}))},onDragCancel(y){let{active:j,over:k}=y;d(t.onDragCancel({active:j,over:k}))}}),[d,t])),!h)return null;const v=b.createElement(b.Fragment,null,b.createElement(zO,{id:l,value:c.draggable}),b.createElement(PO,{id:f,announcement:m}));return i?(0,Dl.createPortal)(v,i):v}r(FO,"Accessibility");var Yn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Yn||(Yn={}));function Fd(){}r(Fd,"noop");function hc(e,t){return(0,b.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}r(hc,"useSensor");function j0(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return(0,b.useMemo)(()=>[...t].filter(l=>l!=null),[...t])}r(j0,"useSensors");var Ts=Object.freeze({x:0,y:0});function xN(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}r(xN,"distanceBetween");function HO(e,t){const i=qd(e);if(!i)return"0 0";const l={x:(i.x-t.left)/t.width*100,y:(i.y-t.top)/t.height*100};return l.x+"% "+l.y+"%"}r(HO,"getRelativeTransformOrigin");function bN(e,t){let{data:{value:i}}=e,{data:{value:l}}=t;return i-l}r(bN,"sortCollisionsAsc");function VO(e,t){let{data:{value:i}}=e,{data:{value:l}}=t;return l-i}r(VO,"sortCollisionsDesc");function uj(e){let{left:t,top:i,height:l,width:c}=e;return[{x:t,y:i},{x:t+c,y:i},{x:t,y:i+l},{x:t+c,y:i+l}]}r(uj,"cornersOfRectangle");function vN(e,t){if(!e||e.length===0)return null;const[i]=e;return t?i[t]:i}r(vN,"getFirstCollision");function dj(e,t,i){return t===void 0&&(t=e.left),i===void 0&&(i=e.top),{x:t+e.width*.5,y:i+e.height*.5}}r(dj,"centerOfRectangle");var yN=r(e=>{let{collisionRect:t,droppableRects:i,droppableContainers:l}=e;const c=dj(t,t.left,t.top),d=[];for(const m of l){const{id:f}=m,h=i.get(f);if(h){const g=xN(dj(h),c);d.push({id:f,data:{droppableContainer:m,value:g}})}}return d.sort(bN)},"closestCenter"),QO=r(e=>{let{collisionRect:t,droppableRects:i,droppableContainers:l}=e;const c=uj(t),d=[];for(const m of l){const{id:f}=m,h=i.get(f);if(h){const g=uj(h),v=c.reduce((j,k,N)=>j+xN(g[N],k),0),y=Number((v/4).toFixed(4));d.push({id:f,data:{droppableContainer:m,value:y}})}}return d.sort(bN)},"closestCorners");function WO(e,t){const i=Math.max(t.top,e.top),l=Math.max(t.left,e.left),c=Math.min(t.left+t.width,e.left+e.width),d=Math.min(t.top+t.height,e.top+e.height),m=c-l,f=d-i;if(l<c&&i<d){const h=t.width*t.height,g=e.width*e.height,v=m*f,y=v/(h+g-v);return Number(y.toFixed(4))}return 0}r(WO,"getIntersectionRatio");var GO=r(e=>{let{collisionRect:t,droppableRects:i,droppableContainers:l}=e;const c=[];for(const d of l){const{id:m}=d,f=i.get(m);if(f){const h=WO(f,t);h>0&&c.push({id:m,data:{droppableContainer:d,value:h}})}}return c.sort(VO)},"rectIntersection");function YO(e,t,i){return{...e,scaleX:t&&i?t.width/i.width:1,scaleY:t&&i?t.height/i.height:1}}r(YO,"adjustScale");function jN(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ts}r(jN,"getRectDelta");function XO(e){return r(function(i){for(var l=arguments.length,c=new Array(l>1?l-1:0),d=1;d<l;d++)c[d-1]=arguments[d];return c.reduce((m,f)=>({...m,top:m.top+e*f.y,bottom:m.bottom+e*f.y,left:m.left+e*f.x,right:m.right+e*f.x}),{...i})},"adjustClientRect")}r(XO,"createRectAdjustmentFn");var ZO=XO(1);function wN(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}r(wN,"parseTransform");function JO(e,t,i){const l=wN(t);if(!l)return e;const{scaleX:c,scaleY:d,x:m,y:f}=l,h=e.left-m-(1-c)*parseFloat(i),g=e.top-f-(1-d)*parseFloat(i.slice(i.indexOf(" ")+1)),v=c?e.width/c:e.width,y=d?e.height/d:e.height;return{width:v,height:y,top:g,right:h+v,bottom:g+y,left:h}}r(JO,"inverseTransform");var e5={ignoreTransform:!1};function Zl(e,t){t===void 0&&(t=e5);let i=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:v}=Ca(e).getComputedStyle(e);g&&(i=JO(i,g,v))}const{top:l,left:c,width:d,height:m,bottom:f,right:h}=i;return{top:l,left:c,width:d,height:m,bottom:f,right:h}}r(Zl,"getClientRect");function fj(e){return Zl(e,{ignoreTransform:!0})}r(fj,"getTransformAgnosticClientRect");function t5(e){const t=e.innerWidth,i=e.innerHeight;return{top:0,left:0,right:t,bottom:i,width:t,height:i}}r(t5,"getWindowClientRect");function n5(e,t){return t===void 0&&(t=Ca(e).getComputedStyle(e)),t.position==="fixed"}r(n5,"isFixed");function a5(e,t){t===void 0&&(t=Ca(e).getComputedStyle(e));const i=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(l=>{const c=t[l];return typeof c=="string"?i.test(c):!1})}r(a5,"isScrollable");function Af(e,t){const i=[];function l(c){if(t!=null&&i.length>=t||!c)return i;if(y0(c)&&c.scrollingElement!=null&&!i.includes(c.scrollingElement))return i.push(c.scrollingElement),i;if(!Ic(c)||pN(c)||i.includes(c))return i;const d=Ca(e).getComputedStyle(c);return c!==e&&a5(c,d)&&i.push(c),n5(c,d)?i:l(c.parentNode)}return r(l,"findScrollableAncestors"),e?l(e):i}r(Af,"getScrollableAncestors");function kN(e){const[t]=Af(e,1);return t??null}r(kN,"getFirstScrollableAncestor");function Yp(e){return!Sf||!e?null:Yl(e)?e:v0(e)?y0(e)||e===Xl(e).scrollingElement?window:Ic(e)?e:null:null}r(Yp,"getScrollableElement");function SN(e){return Yl(e)?e.scrollX:e.scrollLeft}r(SN,"getScrollXCoordinate");function NN(e){return Yl(e)?e.scrollY:e.scrollTop}r(NN,"getScrollYCoordinate");function eg(e){return{x:SN(e),y:NN(e)}}r(eg,"getScrollCoordinates");var sa;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(sa||(sa={}));function CN(e){return!Sf||!e?!1:e===document.scrollingElement}r(CN,"isDocumentScrollingElement");function AN(e){const t={x:0,y:0},i=CN(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},l={x:e.scrollWidth-i.width,y:e.scrollHeight-i.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=l.y,isRight:e.scrollLeft>=l.x,maxScroll:l,minScroll:t}}r(AN,"getScrollPosition");var s5={x:.2,y:.2};function i5(e,t,i,l,c){let{top:d,left:m,right:f,bottom:h}=i;l===void 0&&(l=10),c===void 0&&(c=s5);const{isTop:g,isBottom:v,isLeft:y,isRight:j}=AN(e),k={x:0,y:0},N={x:0,y:0},S={height:t.height*c.y,width:t.width*c.x};return!g&&d<=t.top+S.height?(k.y=sa.Backward,N.y=l*Math.abs((t.top+S.height-d)/S.height)):!v&&h>=t.bottom-S.height&&(k.y=sa.Forward,N.y=l*Math.abs((t.bottom-S.height-h)/S.height)),!j&&f>=t.right-S.width?(k.x=sa.Forward,N.x=l*Math.abs((t.right-S.width-f)/S.width)):!y&&m<=t.left+S.width&&(k.x=sa.Backward,N.x=l*Math.abs((t.left+S.width-m)/S.width)),{direction:k,speed:N}}r(i5,"getScrollDirectionAndSpeed");function r5(e){if(e===document.scrollingElement){const{innerWidth:d,innerHeight:m}=window;return{top:0,left:0,right:d,bottom:m,width:d,height:m}}const{top:t,left:i,right:l,bottom:c}=e.getBoundingClientRect();return{top:t,left:i,right:l,bottom:c,width:e.clientWidth,height:e.clientHeight}}r(r5,"getScrollElementRect");function _N(e){return e.reduce((t,i)=>Bl(t,eg(i)),Ts)}r(_N,"getScrollOffsets");function l5(e){return e.reduce((t,i)=>t+SN(i),0)}r(l5,"getScrollXOffset");function o5(e){return e.reduce((t,i)=>t+NN(i),0)}r(o5,"getScrollYOffset");function EN(e,t){if(t===void 0&&(t=Zl),!e)return;const{top:i,left:l,bottom:c,right:d}=t(e);kN(e)&&(c<=0||d<=0||i>=window.innerHeight||l>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}r(EN,"scrollIntoViewIfNeeded");var c5=[["x",["left","right"],l5],["y",["top","bottom"],o5]],w0=class{static{r(this,"Rect")}constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=Af(t),l=_N(i);this.rect={...e},this.width=e.width,this.height=e.height;for(const[c,d,m]of c5)for(const f of d)Object.defineProperty(this,f,{get:r(()=>{const h=m(i),g=l[c]-h;return this.rect[f]+g},"get"),enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},nc=class{static{r(this,"Listeners")}constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...t)})},this.target=e}add(e,t,i){var l;(l=this.target)==null||l.addEventListener(e,t,i),this.listeners.push([e,t,i])}};function u5(e){const{EventTarget:t}=Ca(e);return e instanceof t?e:Xl(e)}r(u5,"getEventListenerTarget");function Xp(e,t){const i=Math.abs(e.x),l=Math.abs(e.y);return typeof t=="number"?Math.sqrt(i**2+l**2)>t:"x"in t&&"y"in t?i>t.x&&l>t.y:"x"in t?i>t.x:"y"in t?l>t.y:!1}r(Xp,"hasExceededDistance");var ps;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ps||(ps={}));function mj(e){e.preventDefault()}r(mj,"preventDefault");function d5(e){e.stopPropagation()}r(d5,"stopPropagation");var Rt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Rt||(Rt={}));var IN={start:[Rt.Space,Rt.Enter],cancel:[Rt.Esc],end:[Rt.Space,Rt.Enter,Rt.Tab]},f5=r((e,t)=>{let{currentCoordinates:i}=t;switch(e.code){case Rt.Right:return{...i,x:i.x+25};case Rt.Left:return{...i,x:i.x-25};case Rt.Down:return{...i,y:i.y+25};case Rt.Up:return{...i,y:i.y-25}}},"defaultKeyboardCoordinateGetter"),k0=class{static{r(this,"KeyboardSensor")}constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new nc(Xl(t)),this.windowListeners=new nc(Ca(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ps.Resize,this.handleCancel),this.windowListeners.add(ps.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ps.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,i=e.node.current;i&&EN(i),t(Ts)}handleKeyDown(e){if(Cf(e)){const{active:t,context:i,options:l}=this.props,{keyboardCodes:c=IN,coordinateGetter:d=f5,scrollBehavior:m="smooth"}=l,{code:f}=e;if(c.end.includes(f)){this.handleEnd(e);return}if(c.cancel.includes(f)){this.handleCancel(e);return}const{collisionRect:h}=i.current,g=h?{x:h.left,y:h.top}:Ts;this.referenceCoordinates||(this.referenceCoordinates=g);const v=d(e,{active:t,context:i.current,currentCoordinates:g});if(v){const y=pc(v,g),j={x:0,y:0},{scrollableAncestors:k}=i.current;for(const N of k){const S=e.code,{isTop:D,isRight:R,isLeft:E,isBottom:C,maxScroll:I,minScroll:O}=AN(N),z=r5(N),B={x:Math.min(S===Rt.Right?z.right-z.width/2:z.right,Math.max(S===Rt.Right?z.left:z.left+z.width/2,v.x)),y:Math.min(S===Rt.Down?z.bottom-z.height/2:z.bottom,Math.max(S===Rt.Down?z.top:z.top+z.height/2,v.y))},L=S===Rt.Right&&!R||S===Rt.Left&&!E,_=S===Rt.Down&&!C||S===Rt.Up&&!D;if(L&&B.x!==v.x){const U=N.scrollLeft+y.x,F=S===Rt.Right&&U<=I.x||S===Rt.Left&&U>=O.x;if(F&&!y.y){N.scrollTo({left:U,behavior:m});return}F?j.x=N.scrollLeft-U:j.x=S===Rt.Right?N.scrollLeft-I.x:N.scrollLeft-O.x,j.x&&N.scrollBy({left:-j.x,behavior:m});break}else if(_&&B.y!==v.y){const U=N.scrollTop+y.y,F=S===Rt.Down&&U<=I.y||S===Rt.Up&&U>=O.y;if(F&&!y.x){N.scrollTo({top:U,behavior:m});return}F?j.y=N.scrollTop-U:j.y=S===Rt.Down?N.scrollTop-I.y:N.scrollTop-O.y,j.y&&N.scrollBy({top:-j.y,behavior:m});break}}this.handleMove(e,Bl(pc(v,this.referenceCoordinates),j))}}}handleMove(e,t){const{onMove:i}=this.props;e.preventDefault(),i(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};k0.activators=[{eventName:"onKeyDown",handler:r((e,t,i)=>{let{keyboardCodes:l=IN,onActivation:c}=t,{active:d}=i;const{code:m}=e.nativeEvent;if(l.start.includes(m)){const f=d.activatorNode.current;return f&&e.target!==f?!1:(e.preventDefault(),c?.({event:e.nativeEvent}),!0)}return!1},"handler")}];function pj(e){return!!(e&&"distance"in e)}r(pj,"isDistanceConstraint");function hj(e){return!!(e&&"delay"in e)}r(hj,"isDelayConstraint");var S0=class{static{r(this,"AbstractPointerSensor")}constructor(e,t,i){var l;i===void 0&&(i=u5(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:c}=e,{target:d}=c;this.props=e,this.events=t,this.document=Xl(d),this.documentListeners=new nc(this.document),this.listeners=new nc(i),this.windowListeners=new nc(Ca(d)),this.initialCoordinates=(l=qd(c))!=null?l:Ts,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:i}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(ps.Resize,this.handleCancel),this.windowListeners.add(ps.DragStart,mj),this.windowListeners.add(ps.VisibilityChange,this.handleCancel),this.windowListeners.add(ps.ContextMenu,mj),this.documentListeners.add(ps.Keydown,this.handleKeydown),t){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(hj(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(pj(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:i,onPending:l}=this.props;l(i,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ps.Click,d5,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ps.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:i,initialCoordinates:l,props:c}=this,{onMove:d,options:{activationConstraint:m}}=c;if(!l)return;const f=(t=qd(e))!=null?t:Ts,h=pc(l,f);if(!i&&m){if(pj(m)){if(m.tolerance!=null&&Xp(h,m.tolerance))return this.handleCancel();if(Xp(h,m.distance))return this.handleStart()}if(hj(m)&&Xp(h,m.tolerance))return this.handleCancel();this.handlePending(m,h);return}e.cancelable&&e.preventDefault(),d(f)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Rt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},m5={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},_f=class extends S0{static{r(this,"PointerSensor")}constructor(e){const{event:t}=e,i=Xl(t.target);super(e,m5,i)}};_f.activators=[{eventName:"onPointerDown",handler:r((e,t)=>{let{nativeEvent:i}=e,{onActivation:l}=t;return!i.isPrimary||i.button!==0?!1:(l?.({event:i}),!0)},"handler")}];var p5={move:{name:"mousemove"},end:{name:"mouseup"}},tg;(function(e){e[e.RightClick=2]="RightClick"})(tg||(tg={}));var TN=class extends S0{static{r(this,"MouseSensor")}constructor(e){super(e,p5,Xl(e.event.target))}};TN.activators=[{eventName:"onMouseDown",handler:r((e,t)=>{let{nativeEvent:i}=e,{onActivation:l}=t;return i.button===tg.RightClick?!1:(l?.({event:i}),!0)},"handler")}];var Zp={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},RN=class extends S0{static{r(this,"TouchSensor")}constructor(e){super(e,Zp)}static setup(){return window.addEventListener(Zp.move.name,e,{capture:!1,passive:!1}),r(function(){window.removeEventListener(Zp.move.name,e)},"teardown");function e(){}r(e,"noop")}};RN.activators=[{eventName:"onTouchStart",handler:r((e,t)=>{let{nativeEvent:i}=e,{onActivation:l}=t;const{touches:c}=i;return c.length>1?!1:(l?.({event:i}),!0)},"handler")}];var ac;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ac||(ac={}));var Hd;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Hd||(Hd={}));function h5(e){let{acceleration:t,activator:i=ac.Pointer,canScroll:l,draggingRect:c,enabled:d,interval:m=5,order:f=Hd.TreeOrder,pointerCoordinates:h,scrollableAncestors:g,scrollableAncestorRects:v,delta:y,threshold:j}=e;const k=x5({delta:y,disabled:!d}),[N,S]=RO(),D=(0,b.useRef)({x:0,y:0}),R=(0,b.useRef)({x:0,y:0}),E=(0,b.useMemo)(()=>{switch(i){case ac.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case ac.DraggableRect:return c}},[i,c,h]),C=(0,b.useRef)(null),I=(0,b.useCallback)(()=>{const z=C.current;if(!z)return;const B=D.current.x*R.current.x,L=D.current.y*R.current.y;z.scrollBy(B,L)},[]),O=(0,b.useMemo)(()=>f===Hd.TreeOrder?[...g].reverse():g,[f,g]);(0,b.useEffect)(()=>{if(!d||!g.length||!E){S();return}for(const z of O){if(l?.(z)===!1)continue;const B=g.indexOf(z),L=v[B];if(!L)continue;const{direction:_,speed:U}=i5(z,L,E,t,j);for(const F of["x","y"])k[F][_[F]]||(U[F]=0,_[F]=0);if(U.x>0||U.y>0){S(),C.current=z,N(I,m),D.current=U,R.current=_;return}}D.current={x:0,y:0},R.current={x:0,y:0},S()},[t,I,l,S,d,m,JSON.stringify(E),JSON.stringify(k),N,g,O,v,JSON.stringify(j)])}r(h5,"useAutoScroller");var g5={x:{[sa.Backward]:!1,[sa.Forward]:!1},y:{[sa.Backward]:!1,[sa.Forward]:!1}};function x5(e){let{delta:t,disabled:i}=e;const l=Kd(t);return Tc(c=>{if(i||!l||!c)return g5;const d={x:Math.sign(t.x-l.x),y:Math.sign(t.y-l.y)};return{x:{[sa.Backward]:c.x[sa.Backward]||d.x===-1,[sa.Forward]:c.x[sa.Forward]||d.x===1},y:{[sa.Backward]:c.y[sa.Backward]||d.y===-1,[sa.Forward]:c.y[sa.Forward]||d.y===1}}},[i,t,l])}r(x5,"useScrollIntent");function b5(e,t){const i=t!=null?e.get(t):void 0,l=i?i.node.current:null;return Tc(c=>{var d;return t==null?null:(d=l??c)!=null?d:null},[l,t])}r(b5,"useCachedNode");function v5(e,t){return(0,b.useMemo)(()=>e.reduce((i,l)=>{const{sensor:c}=l,d=c.activators.map(m=>({eventName:m.eventName,handler:t(m.handler,l)}));return[...i,...d]},[]),[e,t])}r(v5,"useCombineActivators");var gc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(gc||(gc={}));var ng;(function(e){e.Optimized="optimized"})(ng||(ng={}));var gj=new Map;function y5(e,t){let{dragging:i,dependencies:l,config:c}=t;const[d,m]=(0,b.useState)(null),{frequency:f,measure:h,strategy:g}=c,v=(0,b.useRef)(e),y=D(),j=mc(y),k=(0,b.useCallback)(function(R){R===void 0&&(R=[]),!j.current&&m(E=>E===null?R:E.concat(R.filter(C=>!E.includes(C))))},[j]),N=(0,b.useRef)(null),S=Tc(R=>{if(y&&!i)return gj;if(!R||R===gj||v.current!==e||d!=null){const E=new Map;for(let C of e){if(!C)continue;if(d&&d.length>0&&!d.includes(C.id)&&C.rect.current){E.set(C.id,C.rect.current);continue}const I=C.node.current,O=I?new w0(h(I),I):null;C.rect.current=O,O&&E.set(C.id,O)}return E}return R},[e,d,i,y,h]);return(0,b.useEffect)(()=>{v.current=e},[e]),(0,b.useEffect)(()=>{y||k()},[i,y]),(0,b.useEffect)(()=>{d&&d.length>0&&m(null)},[JSON.stringify(d)]),(0,b.useEffect)(()=>{y||typeof f!="number"||N.current!==null||(N.current=setTimeout(()=>{k(),N.current=null},f))},[f,y,k,...l]),{droppableRects:S,measureDroppableContainers:k,measuringScheduled:d!=null};function D(){switch(g){case gc.Always:return!1;case gc.BeforeDragging:return i;default:return!i}}r(D,"isDisabled")}r(y5,"useDroppableMeasuring");function N0(e,t){return Tc(i=>e?i||(typeof t=="function"?t(e):e):null,[t,e])}r(N0,"useInitialValue");function j5(e,t){return N0(e,t)}r(j5,"useInitialRect");function w5(e){let{callback:t,disabled:i}=e;const l=Nf(t),c=(0,b.useMemo)(()=>{if(i||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:d}=window;return new d(l)},[l,i]);return(0,b.useEffect)(()=>()=>c?.disconnect(),[c]),c}r(w5,"useMutationObserver");function Ef(e){let{callback:t,disabled:i}=e;const l=Nf(t),c=(0,b.useMemo)(()=>{if(i||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:d}=window;return new d(l)},[i]);return(0,b.useEffect)(()=>()=>c?.disconnect(),[c]),c}r(Ef,"useResizeObserver");function k5(e){return new w0(Zl(e),e)}r(k5,"defaultMeasure");function xj(e,t,i){t===void 0&&(t=k5);const[l,c]=(0,b.useState)(null);function d(){c(h=>{if(!e)return null;if(e.isConnected===!1){var g;return(g=h??i)!=null?g:null}const v=t(e);return JSON.stringify(h)===JSON.stringify(v)?h:v})}r(d,"measureRect");const m=w5({callback(h){if(e)for(const g of h){const{type:v,target:y}=g;if(v==="childList"&&y instanceof HTMLElement&&y.contains(e)){d();break}}}}),f=Ef({callback:d});return Is(()=>{d(),e?(f?.observe(e),m?.observe(document.body,{childList:!0,subtree:!0})):(f?.disconnect(),m?.disconnect())},[e]),l}r(xj,"useRect");function S5(e){return jN(e,N0(e))}r(S5,"useRectDelta");var bj=[];function N5(e){const t=(0,b.useRef)(e),i=Tc(l=>e?l&&l!==bj&&e&&t.current&&e.parentNode===t.current.parentNode?l:Af(e):bj,[e]);return(0,b.useEffect)(()=>{t.current=e},[e]),i}r(N5,"useScrollableAncestors");function C5(e){const[t,i]=(0,b.useState)(null),l=(0,b.useRef)(e),c=(0,b.useCallback)(d=>{const m=Yp(d.target);m&&i(f=>f?(f.set(m,eg(m)),new Map(f)):null)},[]);return(0,b.useEffect)(()=>{const d=l.current;if(e!==d){m(d);const f=e.map(h=>{const g=Yp(h);return g?(g.addEventListener("scroll",c,{passive:!0}),[g,eg(g)]):null}).filter(h=>h!=null);i(f.length?new Map(f):null),l.current=e}return()=>{m(e),m(d)};function m(f){f.forEach(h=>{Yp(h)?.removeEventListener("scroll",c)})}},[c,e]),(0,b.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((d,m)=>Bl(d,m),Ts):_N(e):Ts,[e,t])}r(C5,"useScrollOffsets");function vj(e,t){t===void 0&&(t=[]);const i=(0,b.useRef)(null);return(0,b.useEffect)(()=>{i.current=null},t),(0,b.useEffect)(()=>{const l=e!==Ts;l&&!i.current&&(i.current=e),!l&&i.current&&(i.current=null)},[e]),i.current?pc(e,i.current):Ts}r(vj,"useScrollOffsetsDelta");function A5(e){(0,b.useEffect)(()=>{if(!Sf)return;const t=e.map(i=>{let{sensor:l}=i;return l.setup==null?void 0:l.setup()});return()=>{for(const i of t)i?.()}},e.map(t=>{let{sensor:i}=t;return i}))}r(A5,"useSensorSetup");function _5(e,t){return(0,b.useMemo)(()=>e.reduce((i,l)=>{let{eventName:c,handler:d}=l;return i[c]=m=>{d(m,t)},i},{}),[e,t])}r(_5,"useSyntheticListeners");function DN(e){return(0,b.useMemo)(()=>e?t5(e):null,[e])}r(DN,"useWindowRect");var yj=[];function E5(e,t){t===void 0&&(t=Zl);const[i]=e,l=DN(i?Ca(i):null),[c,d]=(0,b.useState)(yj);function m(){d(()=>e.length?e.map(h=>CN(h)?l:new w0(t(h),h)):yj)}r(m,"measureRects");const f=Ef({callback:m});return Is(()=>{f?.disconnect(),m(),e.forEach(h=>f?.observe(h))},[e]),c}r(E5,"useRects");function MN(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ic(t)?t:e}r(MN,"getMeasurableNode");function I5(e){let{measure:t}=e;const[i,l]=(0,b.useState)(null),c=Ef({callback:(0,b.useCallback)(h=>{for(const{target:g}of h)if(Ic(g)){l(v=>{const y=t(g);return v?{...v,width:y.width,height:y.height}:y});break}},[t])}),d=(0,b.useCallback)(h=>{const g=MN(h);c?.disconnect(),g&&c?.observe(g),l(g?t(g):null)},[t,c]),[m,f]=Bd(d);return(0,b.useMemo)(()=>({nodeRef:m,rect:i,setRef:f}),[i,m,f])}r(I5,"useDragOverlayMeasuring");var T5=[{sensor:_f,options:{}},{sensor:k0,options:{}}],R5={current:{}},vd={draggable:{measure:fj},droppable:{measure:fj,strategy:gc.WhileDragging,frequency:ng.Optimized},dragOverlay:{measure:Zl}},sc=class extends Map{static{r(this,"DroppableContainersMap")}get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,i;return(t=(i=this.get(e))==null?void 0:i.node.current)!=null?t:void 0}},D5={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new sc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Fd},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:vd,measureDroppableContainers:Fd,windowRect:null,measuringScheduled:!1},ON={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Fd,draggableNodes:new Map,over:null,measureDroppableContainers:Fd},Dc=(0,b.createContext)(ON),LN=(0,b.createContext)(D5);function M5(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new sc}}}r(M5,"getInitialState");function O5(e,t){switch(t.type){case Yn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Yn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Yn.DragEnd:case Yn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yn.RegisterDroppable:{const{element:i}=t,{id:l}=i,c=new sc(e.droppable.containers);return c.set(l,i),{...e,droppable:{...e.droppable,containers:c}}}case Yn.SetDroppableDisabled:{const{id:i,key:l,disabled:c}=t,d=e.droppable.containers.get(i);if(!d||l!==d.key)return e;const m=new sc(e.droppable.containers);return m.set(i,{...d,disabled:c}),{...e,droppable:{...e.droppable,containers:m}}}case Yn.UnregisterDroppable:{const{id:i,key:l}=t,c=e.droppable.containers.get(i);if(!c||l!==c.key)return e;const d=new sc(e.droppable.containers);return d.delete(i),{...e,droppable:{...e.droppable,containers:d}}}default:return e}}r(O5,"reducer");function L5(e){let{disabled:t}=e;const{active:i,activatorEvent:l,draggableNodes:c}=(0,b.useContext)(Dc),d=Kd(l),m=Kd(i?.id);return(0,b.useEffect)(()=>{if(!t&&!l&&d&&m!=null){if(!Cf(d)||document.activeElement===d.target)return;const f=c.get(m);if(!f)return;const{activatorNode:h,node:g}=f;if(!h.current&&!g.current)return;requestAnimationFrame(()=>{for(const v of[h.current,g.current]){if(!v)continue;const y=OO(v);if(y){y.focus();break}}})}},[l,t,c,m,d]),null}r(L5,"RestoreFocus");function zN(e,t){let{transform:i,...l}=t;return e!=null&&e.length?e.reduce((c,d)=>d({transform:c,...l}),i):i}r(zN,"applyModifiers");function z5(e){return(0,b.useMemo)(()=>({draggable:{...vd.draggable,...e?.draggable},droppable:{...vd.droppable,...e?.droppable},dragOverlay:{...vd.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}r(z5,"useMeasuringConfiguration");function P5(e){let{activeNode:t,measure:i,initialRect:l,config:c=!0}=e;const d=(0,b.useRef)(!1),{x:m,y:f}=typeof c=="boolean"?{x:c,y:c}:c;Is(()=>{if(!m&&!f||!t){d.current=!1;return}if(d.current||!l)return;const h=t?.node.current;if(!h||h.isConnected===!1)return;const g=jN(i(h),l);if(m||(g.x=0),f||(g.y=0),d.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const v=kN(h);v&&v.scrollBy({top:g.y,left:g.x})}},[t,m,f,l,i])}r(P5,"useLayoutShiftScrollCompensation");var If=(0,b.createContext)({...Ts,scaleX:1,scaleY:1}),Xi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Xi||(Xi={}));var C0=(0,b.memo)(r(function(t){var i,l,c,d;let{id:m,accessibility:f,autoScroll:h=!0,children:g,sensors:v=T5,collisionDetection:y=GO,measuring:j,modifiers:k,...N}=t;const[S,D]=(0,b.useReducer)(O5,void 0,M5),[R,E]=BO(),[C,I]=(0,b.useState)(Xi.Uninitialized),O=C===Xi.Initialized,{draggable:{active:z,nodes:B,translate:L},droppable:{containers:_}}=S,U=z!=null?B.get(z):null,F=(0,b.useRef)({initial:null,translated:null}),Y=(0,b.useMemo)(()=>{var Mt;return z!=null?{id:z,data:(Mt=U?.data)!=null?Mt:R5,rect:F}:null},[z,U]),se=(0,b.useRef)(null),[me,oe]=(0,b.useState)(null),[$,T]=(0,b.useState)(null),te=mc(N,Object.values(N)),ce=Rc("DndDescribedBy",m),ae=(0,b.useMemo)(()=>_.getEnabled(),[_]),Ce=z5(j),{droppableRects:ue,measureDroppableContainers:we,measuringScheduled:Ae}=y5(ae,{dragging:O,dependencies:[L.x,L.y],config:Ce.droppable}),je=b5(B,z),he=(0,b.useMemo)(()=>$?qd($):null,[$]),Te=an(),Ve=j5(je,Ce.draggable.measure);P5({activeNode:z!=null?B.get(z):null,config:Te.layoutShiftCompensation,initialRect:Ve,measure:Ce.draggable.measure});const De=xj(je,Ce.draggable.measure,Ve),Se=xj(je?je.parentElement:null),ut=(0,b.useRef)({activatorEvent:null,active:null,activeNode:je,collisionRect:null,collisions:null,droppableRects:ue,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:_,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),wt=_.getNodeFor((i=ut.current.over)==null?void 0:i.id),kt=I5({measure:Ce.dragOverlay.measure}),$t=(l=kt.nodeRef.current)!=null?l:je,le=O?(c=kt.rect)!=null?c:De:null,Ue=!!(kt.nodeRef.current&&kt.rect),Fe=S5(Ue?null:De),it=DN($t?Ca($t):null),Vt=N5(O?wt??je:null),Qt=E5(Vt),V=zN(k,{transform:{x:L.x-Fe.x,y:L.y-Fe.y,scaleX:1,scaleY:1},activatorEvent:$,active:Y,activeNodeRect:De,containerNodeRect:Se,draggingNodeRect:le,over:ut.current.over,overlayNodeRect:kt.rect,scrollableAncestors:Vt,scrollableAncestorRects:Qt,windowRect:it}),Ct=he?Bl(he,L):null,_e=C5(Vt),ze=vj(_e),Je=vj(_e,[De]),rt=Bl(V,ze),At=le?ZO(le,V):null,Wt=Y&&At?y({active:Y,collisionRect:At,droppableRects:ue,droppableContainers:ae,pointerCoordinates:Ct}):null,mn=vN(Wt,"id"),[Zt,_t]=(0,b.useState)(null),Et=YO(Ue?V:Bl(V,Je),(d=Zt?.rect)!=null?d:null,De),ln=(0,b.useRef)(null),Qn=(0,b.useCallback)((Mt,pt)=>{let{sensor:Pe,options:Me}=pt;if(se.current==null)return;const $e=B.get(se.current);if(!$e)return;const He=Mt.nativeEvent,Ot=new Pe({active:se.current,activeNode:$e,event:He,options:Me,context:ut,onAbort(zt){if(!B.get(zt))return;const{onDragAbort:Jt}=te.current,Lt={id:zt};Jt?.(Lt),R({type:"onDragAbort",event:Lt})},onPending(zt,Jt,Lt,pn){if(!B.get(zt))return;const{onDragPending:hn}=te.current,on={id:zt,constraint:Jt,initialCoordinates:Lt,offset:pn};hn?.(on),R({type:"onDragPending",event:on})},onStart(zt){const Jt=se.current;if(Jt==null)return;const Lt=B.get(Jt);if(!Lt)return;const{onDragStart:pn}=te.current,hn={activatorEvent:He,active:{id:Jt,data:Lt.data,rect:F}};(0,Dl.unstable_batchedUpdates)(()=>{pn?.(hn),I(Xi.Initializing),D({type:Yn.DragStart,initialCoordinates:zt,active:Jt}),R({type:"onDragStart",event:hn}),oe(ln.current),T(He)})},onMove(zt){D({type:Yn.DragMove,coordinates:zt})},onEnd:lt(Yn.DragEnd),onCancel:lt(Yn.DragCancel)});ln.current=Ot;function lt(zt){return r(async function(){const{active:Lt,collisions:pn,over:hn,scrollAdjustedTranslate:on}=ut.current;let An=null;if(Lt&&on){const{cancelDrop:Dn}=te.current;An={activatorEvent:He,active:Lt,collisions:pn,delta:on,over:hn},zt===Yn.DragEnd&&typeof Dn=="function"&&await Promise.resolve(Dn(An))&&(zt=Yn.DragCancel)}se.current=null,(0,Dl.unstable_batchedUpdates)(()=>{D({type:zt}),I(Xi.Uninitialized),_t(null),oe(null),T(null),ln.current=null;const Dn=zt===Yn.DragEnd?"onDragEnd":"onDragCancel";if(An){const Ja=te.current[Dn];Ja?.(An),R({type:Dn,event:An})}})},"handler")}r(lt,"createHandler")},[B]),dt=v5(v,(0,b.useCallback)((Mt,pt)=>(Pe,Me)=>{const $e=Pe.nativeEvent,He=B.get(Me);if(se.current!==null||!He||$e.dndKit||$e.defaultPrevented)return;const Ot={active:He};Mt(Pe,pt.options,Ot)===!0&&($e.dndKit={capturedBy:pt.sensor},se.current=Me,Qn(Pe,pt))},[B,Qn]));A5(v),Is(()=>{De&&C===Xi.Initializing&&I(Xi.Initialized)},[De,C]),(0,b.useEffect)(()=>{const{onDragMove:Mt}=te.current,{active:pt,activatorEvent:Pe,collisions:Me,over:$e}=ut.current;if(!pt||!Pe)return;const He={active:pt,activatorEvent:Pe,collisions:Me,delta:{x:rt.x,y:rt.y},over:$e};(0,Dl.unstable_batchedUpdates)(()=>{Mt?.(He),R({type:"onDragMove",event:He})})},[rt.x,rt.y]),(0,b.useEffect)(()=>{const{active:Mt,activatorEvent:pt,collisions:Pe,droppableContainers:Me,scrollAdjustedTranslate:$e}=ut.current;if(!Mt||se.current==null||!pt||!$e)return;const{onDragOver:He}=te.current,Ot=Me.get(mn),lt=Ot&&Ot.rect.current?{id:Ot.id,rect:Ot.rect.current,data:Ot.data,disabled:Ot.disabled}:null,zt={active:Mt,activatorEvent:pt,collisions:Pe,delta:{x:$e.x,y:$e.y},over:lt};(0,Dl.unstable_batchedUpdates)(()=>{_t(lt),He?.(zt),R({type:"onDragOver",event:zt})})},[mn]),Is(()=>{ut.current={activatorEvent:$,active:Y,activeNode:je,collisionRect:At,collisions:Wt,droppableRects:ue,draggableNodes:B,draggingNode:$t,draggingNodeRect:le,droppableContainers:_,over:Zt,scrollableAncestors:Vt,scrollAdjustedTranslate:rt},F.current={initial:le,translated:At}},[Y,je,Wt,At,B,$t,le,ue,_,Zt,Vt,rt]),h5({...Te,delta:L,draggingRect:At,pointerCoordinates:Ct,scrollableAncestors:Vt,scrollableAncestorRects:Qt});const wn=(0,b.useMemo)(()=>({active:Y,activeNode:je,activeNodeRect:De,activatorEvent:$,collisions:Wt,containerNodeRect:Se,dragOverlay:kt,draggableNodes:B,droppableContainers:_,droppableRects:ue,over:Zt,measureDroppableContainers:we,scrollableAncestors:Vt,scrollableAncestorRects:Qt,measuringConfiguration:Ce,measuringScheduled:Ae,windowRect:it}),[Y,je,De,$,Wt,Se,kt,B,_,ue,Zt,we,Vt,Qt,Ce,Ae,it]),Dt=(0,b.useMemo)(()=>({activatorEvent:$,activators:dt,active:Y,activeNodeRect:De,ariaDescribedById:{draggable:ce},dispatch:D,draggableNodes:B,over:Zt,measureDroppableContainers:we}),[$,dt,Y,De,D,ce,B,Zt,we]);return b.createElement(gN.Provider,{value:E},b.createElement(Dc.Provider,{value:Dt},b.createElement(LN.Provider,{value:wn},b.createElement(If.Provider,{value:Et},g)),b.createElement(L5,{disabled:f?.restoreFocus===!1})),b.createElement(FO,{...f,hiddenTextDescribedById:ce}));function an(){const Mt=me?.autoScrollEnabled===!1,pt=typeof h=="object"?h.enabled===!1:h===!1,Pe=O&&!Mt&&!pt;return typeof h=="object"?{...h,enabled:Pe}:{enabled:Pe}}},"DndContext")),U5=(0,b.createContext)(null),jj="button",$5="Draggable";function B5(e){let{id:t,data:i,disabled:l=!1,attributes:c}=e;const d=Rc($5),{activators:m,activatorEvent:f,active:h,activeNodeRect:g,ariaDescribedById:v,draggableNodes:y,over:j}=(0,b.useContext)(Dc),{role:k=jj,roleDescription:N="draggable",tabIndex:S=0}=c??{},D=h?.id===t,R=(0,b.useContext)(D?If:U5),[E,C]=Bd(),[I,O]=Bd(),z=_5(m,t),B=mc(i);return Is(()=>(y.set(t,{id:t,key:d,node:E,activatorNode:I,data:B}),()=>{const L=y.get(t);L&&L.key===d&&y.delete(t)}),[y,t]),{active:h,activatorEvent:f,activeNodeRect:g,attributes:(0,b.useMemo)(()=>({role:k,tabIndex:S,"aria-disabled":l,"aria-pressed":D&&k===jj?!0:void 0,"aria-roledescription":N,"aria-describedby":v.draggable}),[l,k,S,D,N,v.draggable]),isDragging:D,listeners:l?void 0:z,node:E,over:j,setNodeRef:C,setActivatorNodeRef:O,transform:R}}r(B5,"useDraggable");function PN(){return(0,b.useContext)(LN)}r(PN,"useDndContext");var K5="Droppable",q5={timeout:25};function UN(e){let{data:t,disabled:i=!1,id:l,resizeObserverConfig:c}=e;const d=Rc(K5),{active:m,dispatch:f,over:h,measureDroppableContainers:g}=(0,b.useContext)(Dc),v=(0,b.useRef)({disabled:i}),y=(0,b.useRef)(!1),j=(0,b.useRef)(null),k=(0,b.useRef)(null),{disabled:N,updateMeasurementsFor:S,timeout:D}={...q5,...c},R=mc(S??l),E=Ef({callback:(0,b.useCallback)(()=>{if(!y.current){y.current=!0;return}k.current!=null&&clearTimeout(k.current),k.current=setTimeout(()=>{g(Array.isArray(R.current)?R.current:[R.current]),k.current=null},D)},[D]),disabled:N||!m}),C=(0,b.useCallback)((B,L)=>{E&&(L&&(E.unobserve(L),y.current=!1),B&&E.observe(B))},[E]),[I,O]=Bd(C),z=mc(t);return(0,b.useEffect)(()=>{!E||!I.current||(E.disconnect(),y.current=!1,E.observe(I.current))},[I,E]),(0,b.useEffect)(()=>(f({type:Yn.RegisterDroppable,element:{id:l,key:d,disabled:i,node:I,rect:j,data:z}}),()=>f({type:Yn.UnregisterDroppable,key:d,id:l})),[l]),(0,b.useEffect)(()=>{i!==v.current.disabled&&(f({type:Yn.SetDroppableDisabled,id:l,key:d,disabled:i}),v.current.disabled=i)},[l,d,i,f]),{active:m,rect:j,isOver:h?.id===l,node:I,over:h,setNodeRef:O}}r(UN,"useDroppable");function F5(e){let{animation:t,children:i}=e;const[l,c]=(0,b.useState)(null),[d,m]=(0,b.useState)(null),f=Kd(i);return!i&&!l&&f&&c(f),Is(()=>{if(!d)return;const h=l?.key,g=l?.props.id;if(h==null||g==null){c(null);return}Promise.resolve(t(g,d)).then(()=>{c(null)})},[t,l,d]),b.createElement(b.Fragment,null,i,l?(0,b.cloneElement)(l,{ref:m}):null)}r(F5,"AnimationManager");var H5={x:0,y:0,scaleX:1,scaleY:1};function V5(e){let{children:t}=e;return b.createElement(Dc.Provider,{value:ON},b.createElement(If.Provider,{value:H5},t))}r(V5,"NullifiedContextProvider");var Q5={position:"fixed",touchAction:"none"},W5=r(e=>Cf(e)?"transform 250ms ease":void 0,"defaultTransition$1"),G5=(0,b.forwardRef)((e,t)=>{let{as:i,activatorEvent:l,adjustScale:c,children:d,className:m,rect:f,style:h,transform:g,transition:v=W5}=e;if(!f)return null;const y=c?g:{...g,scaleX:1,scaleY:1},j={...Q5,width:f.width,height:f.height,top:f.top,left:f.left,transform:Ws.Transform.toString(y),transformOrigin:c&&l?HO(l,f):void 0,transition:typeof v=="function"?v(l):v,...h};return b.createElement(i,{className:m,style:j,ref:t},d)}),Y5=r(e=>t=>{let{active:i,dragOverlay:l}=t;const c={},{styles:d,className:m}=e;if(d!=null&&d.active)for(const[f,h]of Object.entries(d.active))h!==void 0&&(c[f]=i.node.style.getPropertyValue(f),i.node.style.setProperty(f,h));if(d!=null&&d.dragOverlay)for(const[f,h]of Object.entries(d.dragOverlay))h!==void 0&&l.node.style.setProperty(f,h);return m!=null&&m.active&&i.node.classList.add(m.active),m!=null&&m.dragOverlay&&l.node.classList.add(m.dragOverlay),r(function(){for(const[h,g]of Object.entries(c))i.node.style.setProperty(h,g);m!=null&&m.active&&i.node.classList.remove(m.active)},"cleanup")},"defaultDropAnimationSideEffects"),X5=r(e=>{let{transform:{initial:t,final:i}}=e;return[{transform:Ws.Transform.toString(t)},{transform:Ws.Transform.toString(i)}]},"defaultKeyframeResolver"),Z5={duration:250,easing:"ease",keyframes:X5,sideEffects:Y5({styles:{active:{opacity:"0"}}})};function J5(e){let{config:t,draggableNodes:i,droppableContainers:l,measuringConfiguration:c}=e;return Nf((d,m)=>{if(t===null)return;const f=i.get(d);if(!f)return;const h=f.node.current;if(!h)return;const g=MN(m);if(!g)return;const{transform:v}=Ca(m).getComputedStyle(m),y=wN(v);if(!y)return;const j=typeof t=="function"?t:eL(t);return EN(h,c.draggable.measure),j({active:{id:d,data:f.data,node:h,rect:c.draggable.measure(h)},draggableNodes:i,dragOverlay:{node:m,rect:c.dragOverlay.measure(g)},droppableContainers:l,measuringConfiguration:c,transform:y})})}r(J5,"useDropAnimation");function eL(e){const{duration:t,easing:i,sideEffects:l,keyframes:c}={...Z5,...e};return d=>{let{active:m,dragOverlay:f,transform:h,...g}=d;if(!t)return;const v={x:f.rect.left-m.rect.left,y:f.rect.top-m.rect.top},y={scaleX:h.scaleX!==1?m.rect.width*h.scaleX/f.rect.width:1,scaleY:h.scaleY!==1?m.rect.height*h.scaleY/f.rect.height:1},j={x:h.x-v.x,y:h.y-v.y,...y},k=c({...g,active:m,dragOverlay:f,transform:{initial:h,final:j}}),[N]=k,S=k[k.length-1];if(JSON.stringify(N)===JSON.stringify(S))return;const D=l?.({active:m,dragOverlay:f,...g}),R=f.node.animate(k,{duration:t,easing:i,fill:"forwards"});return new Promise(E=>{R.onfinish=()=>{D?.(),E()}})}}r(eL,"createDefaultDropAnimation");var wj=0;function tL(e){return(0,b.useMemo)(()=>{if(e!=null)return wj++,wj},[e])}r(tL,"useKey");var nL=b.memo(e=>{let{adjustScale:t=!1,children:i,dropAnimation:l,style:c,transition:d,modifiers:m,wrapperElement:f="div",className:h,zIndex:g=999}=e;const{activatorEvent:v,active:y,activeNodeRect:j,containerNodeRect:k,draggableNodes:N,droppableContainers:S,dragOverlay:D,over:R,measuringConfiguration:E,scrollableAncestors:C,scrollableAncestorRects:I,windowRect:O}=PN(),z=(0,b.useContext)(If),B=tL(y?.id),L=zN(m,{activatorEvent:v,active:y,activeNodeRect:j,containerNodeRect:k,draggingNodeRect:D.rect,over:R,overlayNodeRect:D.rect,scrollableAncestors:C,scrollableAncestorRects:I,transform:z,windowRect:O}),_=N0(j),U=J5({config:l,draggableNodes:N,droppableContainers:S,measuringConfiguration:E}),F=_?D.setRef:void 0;return b.createElement(V5,null,b.createElement(F5,{animation:U},y&&B?b.createElement(G5,{key:B,id:y.id,ref:F,as:f,activatorEvent:v,adjustScale:t,className:h,transition:d,rect:_,style:{zIndex:g,...c},transform:L},i):null))});function A0(e,t,i){const l=e.slice();return l.splice(i<0?l.length+i:i,0,l.splice(t,1)[0]),l}r(A0,"arrayMove");function aL(e,t){return e.reduce((i,l,c)=>{const d=t.get(l);return d&&(i[c]=d),i},Array(e.length))}r(aL,"getSortedRects");function Qu(e){return e!==null&&e>=0}r(Qu,"isValidIndex");function sL(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}r(sL,"itemsEqual");function iL(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}r(iL,"normalizeDisabled");var Wu={scaleX:1,scaleY:1},rL=r(e=>{var t;let{rects:i,activeNodeRect:l,activeIndex:c,overIndex:d,index:m}=e;const f=(t=i[c])!=null?t:l;if(!f)return null;const h=lL(i,m,c);if(m===c){const g=i[d];return g?{x:c<d?g.left+g.width-(f.left+f.width):g.left-f.left,y:0,...Wu}:null}return m>c&&m<=d?{x:-f.width-h,y:0,...Wu}:m<c&&m>=d?{x:f.width+h,y:0,...Wu}:{x:0,y:0,...Wu}},"horizontalListSortingStrategy");function lL(e,t,i){const l=e[t],c=e[t-1],d=e[t+1];return!l||!c&&!d?0:i<t?c?l.left-(c.left+c.width):d.left-(l.left+l.width):d?d.left-(l.left+l.width):l.left-(c.left+c.width)}r(lL,"getItemGap");var $N=r(e=>{let{rects:t,activeIndex:i,overIndex:l,index:c}=e;const d=A0(t,l,i),m=t[c],f=d[c];return!f||!m?null:{x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height}},"rectSortingStrategy"),Gu={scaleX:1,scaleY:1},BN=r(e=>{var t;let{activeIndex:i,activeNodeRect:l,index:c,rects:d,overIndex:m}=e;const f=(t=d[i])!=null?t:l;if(!f)return null;if(c===i){const g=d[m];return g?{x:0,y:i<m?g.top+g.height-(f.top+f.height):g.top-f.top,...Gu}:null}const h=oL(d,c,i);return c>i&&c<=m?{x:0,y:-f.height-h,...Gu}:c<i&&c>=m?{x:0,y:f.height+h,...Gu}:{x:0,y:0,...Gu}},"verticalListSortingStrategy");function oL(e,t,i){const l=e[t],c=e[t-1],d=e[t+1];return l?i<t?c?l.top-(c.top+c.height):d?d.top-(l.top+l.height):0:d?d.top-(l.top+l.height):c?l.top-(c.top+c.height):0:0}r(oL,"getItemGap$1");var KN="Sortable",qN=b.createContext({activeIndex:-1,containerId:KN,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$N,disabled:{draggable:!1,droppable:!1}});function _0(e){let{children:t,id:i,items:l,strategy:c=$N,disabled:d=!1}=e;const{active:m,dragOverlay:f,droppableRects:h,over:g,measureDroppableContainers:v}=PN(),y=Rc(KN,i),j=f.rect!==null,k=(0,b.useMemo)(()=>l.map(z=>typeof z=="object"&&"id"in z?z.id:z),[l]),N=m!=null,S=m?k.indexOf(m.id):-1,D=g?k.indexOf(g.id):-1,R=(0,b.useRef)(k),E=!sL(k,R.current),C=D!==-1&&S===-1||E,I=iL(d);Is(()=>{E&&N&&v(k)},[E,k,N,v]),(0,b.useEffect)(()=>{R.current=k},[k]);const O=(0,b.useMemo)(()=>({activeIndex:S,containerId:y,disabled:I,disableTransforms:C,items:k,overIndex:D,useDragOverlay:j,sortedRects:aL(k,h),strategy:c}),[S,y,I.draggable,I.droppable,C,k,D,h,j,c]);return b.createElement(qN.Provider,{value:O},t)}r(_0,"SortableContext");var cL=r(e=>{let{id:t,items:i,activeIndex:l,overIndex:c}=e;return A0(i,l,c).indexOf(t)},"defaultNewIndexGetter"),uL=r(e=>{let{containerId:t,isSorting:i,wasDragging:l,index:c,items:d,newIndex:m,previousItems:f,previousContainerId:h,transition:g}=e;return!g||!l||f!==d&&c===m?!1:i?!0:m!==c&&t===h},"defaultAnimateLayoutChanges"),dL={duration:200,easing:"ease"},FN="transform",fL=Ws.Transition.toString({property:FN,duration:0,easing:"linear"}),mL={roleDescription:"sortable"};function pL(e){let{disabled:t,index:i,node:l,rect:c}=e;const[d,m]=(0,b.useState)(null),f=(0,b.useRef)(i);return Is(()=>{if(!t&&i!==f.current&&l.current){const h=c.current;if(h){const g=Zl(l.current,{ignoreTransform:!0}),v={x:h.left-g.left,y:h.top-g.top,scaleX:h.width/g.width,scaleY:h.height/g.height};(v.x||v.y)&&m(v)}}i!==f.current&&(f.current=i)},[t,i,l,c]),(0,b.useEffect)(()=>{d&&m(null)},[d]),d}r(pL,"useDerivedTransform");function E0(e){let{animateLayoutChanges:t=uL,attributes:i,disabled:l,data:c,getNewIndex:d=cL,id:m,strategy:f,resizeObserverConfig:h,transition:g=dL}=e;const{items:v,containerId:y,activeIndex:j,disabled:k,disableTransforms:N,sortedRects:S,overIndex:D,useDragOverlay:R,strategy:E}=(0,b.useContext)(qN),C=hL(l,k),I=v.indexOf(m),O=(0,b.useMemo)(()=>({sortable:{containerId:y,index:I,items:v},...c}),[y,c,I,v]),z=(0,b.useMemo)(()=>v.slice(v.indexOf(m)),[v,m]),{rect:B,node:L,isOver:_,setNodeRef:U}=UN({id:m,data:O,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:z,...h}}),{active:F,activatorEvent:Y,activeNodeRect:se,attributes:me,setNodeRef:oe,listeners:$,isDragging:T,over:te,setActivatorNodeRef:ce,transform:ae}=B5({id:m,data:O,attributes:{...mL,...i},disabled:C.draggable}),Ce=TO(U,oe),ue=!!F,we=ue&&!N&&Qu(j)&&Qu(D),Ae=!R&&T,je=Ae&&we?ae:null,he=we?je??(f??E)({rects:S,activeNodeRect:se,activeIndex:j,overIndex:D,index:I}):null,Te=Qu(j)&&Qu(D)?d({id:m,items:v,activeIndex:j,overIndex:D}):I,Ve=F?.id,De=(0,b.useRef)({activeId:Ve,items:v,newIndex:Te,containerId:y}),Se=v!==De.current.items,ut=t({active:F,containerId:y,isDragging:T,isSorting:ue,id:m,index:I,items:v,newIndex:De.current.newIndex,previousItems:De.current.items,previousContainerId:De.current.containerId,transition:g,wasDragging:De.current.activeId!=null}),wt=pL({disabled:!ut,index:I,node:L,rect:B});return(0,b.useEffect)(()=>{ue&&De.current.newIndex!==Te&&(De.current.newIndex=Te),y!==De.current.containerId&&(De.current.containerId=y),v!==De.current.items&&(De.current.items=v)},[ue,Te,y,v]),(0,b.useEffect)(()=>{if(Ve===De.current.activeId)return;if(Ve!=null&&De.current.activeId==null){De.current.activeId=Ve;return}const $t=setTimeout(()=>{De.current.activeId=Ve},50);return()=>clearTimeout($t)},[Ve]),{active:F,activeIndex:j,attributes:me,data:O,rect:B,index:I,newIndex:Te,items:v,isOver:_,isSorting:ue,isDragging:T,listeners:$,node:L,overIndex:D,over:te,setNodeRef:Ce,setActivatorNodeRef:ce,setDroppableNodeRef:U,setDraggableNodeRef:oe,transform:wt??he,transition:kt()};function kt(){if(wt||Se&&De.current.newIndex===I)return fL;if(!(Ae&&!Cf(Y)||!g)&&(ue||ut))return Ws.Transition.toString({...g,property:FN})}r(kt,"getTransition")}r(E0,"useSortable");function hL(e,t){var i,l;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(i=e?.draggable)!=null?i:t.draggable,droppable:(l=e?.droppable)!=null?l:t.droppable}}r(hL,"normalizeLocalDisabled");function Vd(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}r(Vd,"hasSortableData");var gL=[Rt.Down,Rt.Right,Rt.Up,Rt.Left],xL=r((e,t)=>{let{context:{active:i,collisionRect:l,droppableRects:c,droppableContainers:d,over:m,scrollableAncestors:f}}=t;if(gL.includes(e.code)){if(e.preventDefault(),!i||!l)return;const h=[];d.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const j=c.get(y.id);if(j)switch(e.code){case Rt.Down:l.top<j.top&&h.push(y);break;case Rt.Up:l.top>j.top&&h.push(y);break;case Rt.Left:l.left>j.left&&h.push(y);break;case Rt.Right:l.left<j.left&&h.push(y)}});const g=QO({active:i,collisionRect:l,droppableRects:c,droppableContainers:h,pointerCoordinates:null});let v=vN(g,"id");if(v===m?.id&&g.length>1&&(v=g[1].id),v!=null){const y=d.get(i.id),j=d.get(v),k=j?c.get(j.id):null,N=j?.node.current;if(N&&k&&y&&j){const S=Af(N).some((I,O)=>f[O]!==I),D=HN(y,j),R=bL(y,j),E=S||!D?{x:0,y:0}:{x:R?l.width-k.width:0,y:R?l.height-k.height:0},C={x:k.left,y:k.top};return E.x&&E.y?C:pc(C,E)}}}},"sortableKeyboardCoordinates");function HN(e,t){return!Vd(e)||!Vd(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}r(HN,"isSameContainer");function bL(e,t){return!Vd(e)||!Vd(t)||!HN(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}r(bL,"isAfter");function kj(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]!==t[i])return!1;return!0}r(kj,"areEqual$1");function VN(e,t){if(e.length===0)return[];if(t.length===0)return e;const i=new Map(e.map(c=>[c.id,c])),l=[];for(const c of t){const d=i.get(c);d&&(l.push(d),i.delete(c))}for(const c of i.values())l.push(c);return l}r(VN,"sortCompaniesByOrder");function Sj(e,t){return VN(e,t).map(i=>i.id)}r(Sj,"buildOrderIds$1");function vL({companies:e,userId:t}){const i=Rn(),l=(0,b.useMemo)(()=>P.sidebarPreferences.companyOrder(t??"__anon__"),[t]),{data:c}=be({queryKey:l,queryFn:r(()=>Md.getCompanyOrder(),"queryFn"),enabled:!!t}),[d,m]=(0,b.useState)(()=>Sj(e,[]));(0,b.useEffect)(()=>{const h=Sj(e,c?.orderedIds??[]);m(g=>kj(g,h)?g:h)},[e,c?.orderedIds]);const f=bn({mutationFn:r(h=>Md.updateCompanyOrder({orderedIds:h}),"mutationFn"),onSuccess:r(h=>{i.setQueryData(l,h)},"onSuccess")});return{orderedCompanies:(0,b.useMemo)(()=>VN(e,d),[e,d]),orderedIds:d,persistOrder:(0,b.useCallback)(h=>{const g=new Set(e.map(y=>y.id)),v=h.filter(y=>g.has(y));for(const y of e)v.includes(y.id)||v.push(y.id);m(y=>kj(y,v)?y:v),t&&(i.setQueryData(l,y=>({orderedIds:v,updatedAt:y?.updatedAt??null})),f.mutate(v))},[e,f,i,l,t])}}r(vL,"useCompanyOrder");var yL=[P.health[0]];function jL(e){return!yL.includes(e[0])}r(jL,"isAccountScopedQueryKey");function I0({onSignedOut:e}={}){const t=Rn();return bn({mutationFn:r(async()=>{await $_(),await Xn.signOut()},"mutationFn"),onSuccess:r(async()=>{e?.(),t.resetQueries({predicate:r(i=>jL(i.queryKey),"predicate")}),await t.invalidateQueries({queryKey:P.health})},"onSuccess")})}r(I0,"useSignOut");var wL=[[0,8,2,10],[12,4,14,6],[3,11,1,9],[15,7,13,5]];function kL(e){let t=2166136261;for(let i=0;i<e.length;i++)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return t>>>0}r(kL,"hashString");function SL(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let i=Math.imul(t^t>>>15,1|t);return i^=i+Math.imul(i^i>>>7,61|i),((i^i>>>14)>>>0)/4294967296}}r(SL,"mulberry32");function Nj(e,t,i){const l=(e%360+360)%360,c=Math.max(0,Math.min(100,t))/100,d=Math.max(0,Math.min(100,i))/100,m=(1-Math.abs(2*d-1))*c,f=m*(1-Math.abs(l/60%2-1)),h=d-m/2;let g=0,v=0,y=0;return l<60?(g=m,v=f):l<120?(g=f,v=m):l<180?(v=m,y=f):l<240?(v=f,y=m):l<300?(g=f,y=m):(g=m,y=f),[Math.round((g+h)*255),Math.round((v+h)*255),Math.round((y+h)*255)]}r(Nj,"hslToRgb");function NL(e,t=22,i=2){if(typeof document>"u")return"";const l=document.createElement("canvas");l.width=t*i,l.height=t*i;const c=l.getContext("2d");if(!c)return"";const d=SL(kL(e)),m=Math.floor(d()*360),[f,h,g]=Nj(m,54+Math.floor(d()*14),36+Math.floor(d()*12)),[v,y,j]=Nj(m+(d()>.5?10:-10),86+Math.floor(d()*10),82+Math.floor(d()*10)),k=(t-1)/2,N=Math.max(k,1),S=d()*Math.PI*2,D=Math.cos(S),R=Math.sin(S),E=Math.abs(D*N)+Math.abs(R*N),C=.34+d()*.12,I=.33+d()*.12,O=d()*Math.PI*2,z=d()*Math.PI*2;c.fillStyle=`rgb(${f} ${h} ${g})`,c.fillRect(0,0,l.width,l.height),c.fillStyle=`rgb(${v} ${y} ${j})`;const B=i*.46;for(let L=0;L<t;L++){const _=L-k;for(let U=0;U<t;U++){const F=U-k,Y=((F*D+_*R)/E+1)*.5,se=Math.sin((F+_)*C+O)*.5+.5,me=Math.sin((F-_)*I+z)*.5+.5,oe=se*.5+me*.5,$=Math.max(0,Math.min(1,Y+(oe-.5)*.22));if(Math.max(0,Math.min(15,Math.floor($*16)))<=wL[L&3][U&3])continue;const T=U*i+i/2,te=L*i+i/2;c.beginPath(),c.arc(T,te,B,0,Math.PI*2),c.fill()}}return l.toDataURL("image/png")}r(NL,"makeCompanyPatternDataUrl");function QN({companyName:e,logoUrl:t,className:i,logoFit:l="cover"}){const c=e.trim().charAt(0).toUpperCase()||"?",[d,m]=(0,b.useState)(!1),f=!d&&typeof t=="string"&&t.trim().length>0?t:null;(0,b.useEffect)(()=>{m(!1)},[t]);const h=(0,b.useMemo)(()=>NL(e.trim().toLowerCase()),[e]);return(0,a.jsxs)("div",{className:G("relative flex items-center justify-center w-11 h-11 text-base font-semibold text-white overflow-hidden",i),children:[f?(0,a.jsx)("img",{src:f,alt:`${e} logo`,onError:r(()=>m(!0),"onError"),className:G("absolute inset-0 h-full w-full",l==="contain"?"object-contain":"object-cover")}):h?(0,a.jsx)("img",{src:h,alt:"","aria-hidden":"true",className:"absolute inset-0 h-full w-full",style:{imageRendering:"pixelated"}}):(0,a.jsx)("div",{className:"absolute inset-0 bg-bg-3"}),!f&&(0,a.jsx)("span",{className:"relative z-10 drop-shadow-(--drop-shadow-extract-1)",children:c})]})}r(QN,"CompanyPatternIcon");function CL({collapsed:e}){return(0,a.jsxs)("div",{role:"status","aria-label":"Loading organization","aria-busy":"true",className:"flex h-9 min-w-0 flex-1 items-center gap-2 px-4",children:[(0,a.jsx)(ct,{className:"size-5 shrink-0"}),!e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"min-w-0 flex-1",children:(0,a.jsx)(ct,{className:"h-4 w-20 max-w-full"})}),(0,a.jsx)(Wk,{className:"size-3.5 shrink-0 text-ink-3","aria-hidden":"true"})]})]})}r(CL,"OrganizationSwitcherLoading");function AL({children:e,open:t,onOpenChange:i}){const{userId:l,settled:c,failed:d}=qg(),{selectedCompanyId:m}=bt(),f=U_(),h=f.data?.companies.find(y=>y.id===m)??null,g=c&&f.isSuccess&&!f.data?.unauthorized&&(m===null||h!==null),v=!g&&!d&&!f.isError&&!f.data?.unauthorized;return(0,a.jsx)(_L,{settled:g,loading:v,companyId:m,company:h,open:t,onOpenChange:i,children:e},JSON.stringify([l,m]))}r(AL,"PluginOrganizationSwitcher");function _L({children:e,settled:t,loading:i,companyId:l,company:c,open:d,onOpenChange:m}){const[f,h]=(0,b.useState)(!1),{isMobile:g,setSidebarOpen:v,collapsed:y,peeking:j}=Zn(),k=d??f,N=m??h;function S(){N(!1),g&&v(!1)}r(S,"closeNavigation");const D=I0({onSignedOut:S}),{slots:R,isLoading:E,errorMessage:C}=Cc({slotTypes:["organizationSwitcher"],companyId:l,enabled:t});if(i||t&&E&&!C)return(0,a.jsx)(CL,{collapsed:y&&!j});if(!t||C||R.length!==1)return e;const I={organizationSwitcher:{currentCompany:c?{name:c.name,logoUrl:c.logoUrl??null}:null,collapsed:y&&!j,open:k,onOpenChange:N,onNavigate:S,onSignOut:r(()=>D.mutate(),"onSignOut"),signingOut:D.isPending,renderIcon:r((O,z,B)=>(0,a.jsx)(QN,{companyName:O,logoUrl:z,className:B?"size-(--organization-popover-avatar-size) shrink-0 rounded-lg text-(length:--text-micro)":"size-5 shrink-0 rounded-md text-(length:--text-micro)"}),"renderIcon")}};return(0,a.jsx)(r0,{slot:R[0],context:{companyId:l,companyPrefix:c?.issuePrefix??null},componentProps:{...I},fallback:e})}r(_L,"OrganizationSwitcher");var EL="size-5 shrink-0 rounded-md text-(length:--text-micro)",IL="size-(--organization-popover-avatar-size) shrink-0 rounded-lg text-(length:--text-micro)",TL="h-(--organization-popover-company-row-height) min-w-0 gap-(--organization-popover-row-gap) rounded-lg px-2.5 py-0 text-(length:--text-compact) focus:bg-bg-3/50 focus:text-ink",Jp="h-(--organization-popover-action-row-height) gap-(--organization-popover-row-gap) rounded-lg px-2.5 py-0 text-(length:--text-compact) font-medium leading-(--organization-popover-action-line-height) text-ink focus:bg-bg-3/50 focus:text-ink";function WN({company:e,inPopover:t=!1}){return(0,a.jsx)(QN,{companyName:e.name,logoUrl:e.logoUrl,className:t?IL:EL})}r(WN,"WorkspaceIcon");function RL({company:e,isEditing:t,isSelected:i,onSelect:l}){const{attributes:c,listeners:d,setActivatorNodeRef:m,setNodeRef:f,transform:h,transition:g,isDragging:v}=E0({id:e.id,disabled:!t});return(0,a.jsxs)(Cn,{ref:f,style:{transform:Ws.Transform.toString(h),transition:g,zIndex:v?10:void 0},onSelect:r(y=>{if(t){y.preventDefault();return}l(e)},"onSelect"),className:G(TL,t&&"cursor-grab",v&&"opacity-80"),children:[(0,a.jsx)(WN,{company:e,inPopover:!0}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate font-medium leading-(--organization-popover-name-line-height)",children:e.name}),t?null:(0,a.jsx)("span",{className:"block truncate text-(length:--text-nano) leading-(--organization-popover-prefix-line-height) text-ink-3",children:e.issuePrefix})]}),t?(0,a.jsx)("button",{type:"button",ref:m,"aria-label":`Reorder ${e.name}`,className:"inline-flex size-8 shrink-0 items-center justify-center rounded text-ink-3 hover:bg-bg-3 hover:text-ink focus-visible:outline-none focus-visible:ring-(length:--rad-2) focus-visible:ring-focus",onClick:r(y=>{y.preventDefault(),y.stopPropagation()},"onClick"),...c,...d,children:(0,a.jsx)(mT,{className:"size-4","aria-hidden":"true"})}):(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center",children:i?(0,a.jsx)(_s,{className:"size-4 text-ink"}):null})]})}r(RL,"SortableCompanyItem");function DL(e={}){return(0,a.jsx)(AL,{...e,children:(0,a.jsx)(ML,{...e})})}r(DL,"SidebarCompanyMenu");function ML({open:e,onOpenChange:t}){const[i,l]=(0,b.useState)(!1),[c,d]=(0,b.useState)(!1),{companies:m,selectedCompany:f,setSelectedCompanyId:h,companyListUnavailable:g,retryCompanies:v}=bt(),{openOnboarding:y}=Ms(),{isMobile:j,setSidebarOpen:k,collapsed:N,peeking:S}=Zn(),D=N&&!S,R=vn(),E=xa(),C=e??i,I=t??l,O=j0(hc(TN,{activationConstraint:{distance:8}}),hc(RN,{activationConstraint:{delay:180,tolerance:6}})),z=(0,b.useMemo)(()=>m.filter(ue=>ue.status!=="archived"),[m]),{data:B}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),retry:!1}),L=B?.user?.id??B?.session?.userId??null,{orderedCompanies:_,persistOrder:U}=vL({companies:z,userId:L}),{hidden:F,loaded:Y}=rr(),se=Y&&!Sd(F,"company.members")&&!Sd(F,"company.invites"),me="organization",oe=f?.name??null,$=I0({onSignedOut:te});function T(ue){ue||d(!1),I(ue)}r(T,"handleOpenChange");function te(){I(!1),d(!1),j&&k(!1)}r(te,"closeNavigationChrome");function ce(ue){const we=R.pathname.split("/")[1]?.toUpperCase(),Ae=z.some(he=>he.issuePrefix.toUpperCase()===we),je=ue.id!==f?.id&&(R.pathname.startsWith("/instance/")||Ae);h(ue.id),I(!1),j&&k(!1),je&&E(`/${ue.issuePrefix}/dashboard`)}r(ce,"selectCompany");function ae(){I(!1),j&&k(!1),y({initialStep:1})}r(ae,"addCompany");const Ce=(0,b.useCallback)(ue=>{const{active:we,over:Ae}=ue;if(!Ae||we.id===Ae.id)return;const je=_.map(Ve=>Ve.id),he=je.indexOf(we.id),Te=je.indexOf(Ae.id);he===-1||Te===-1||U(A0(je,he,Te))},[_,U]);return(0,a.jsxs)(Wr,{open:C,onOpenChange:T,children:[(0,a.jsx)(Vr,{asChild:!0,children:(0,a.jsxs)(pe,{variant:"ghost",className:"h-9 min-w-0 flex-1 justify-start gap-2 px-4 text-left has-[>svg]:px-4","aria-label":oe?`Open ${oe} ${me} switcher`:`Open ${me} switcher`,children:[(0,a.jsxs)("span",{className:G("flex min-w-0 flex-1 items-center",D?"gap-2.5":"gap-2"),children:[f?(0,a.jsx)(WN,{company:f}):null,(0,a.jsx)("span",{className:G("min-w-0 truncate text-sm font-bold text-ink",D&&"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none"),title:oe??void 0,children:oe??`Select ${me}`})]}),!D&&(0,a.jsx)(Wk,{className:"size-3.5 shrink-0 text-ink-3"})]})}),(0,a.jsxs)(Qr,{align:"start",sideOffset:8,className:"ml-2 w-(--organization-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:"flex h-(--organization-popover-header-height) items-center justify-between gap-2 px-3.5",children:[(0,a.jsx)(Kk,{className:"p-0 text-(length:--text-compact) font-semibold text-ink",children:"Organizations"}),(0,a.jsx)("button",{type:"button",onClick:r(ue=>{ue.preventDefault(),ue.stopPropagation(),d(we=>!we)},"onClick"),className:"rounded px-1.5 py-0.5 text-xs font-medium text-ink-3 transition-colors hover:bg-bg-3 hover:text-ink",children:c?"Done":"Edit"})]}),(0,a.jsxs)("div",{className:"flex max-h-96 flex-col gap-0.5 overflow-y-auto px-2.5 pb-2 pt-1",children:[(0,a.jsx)(C0,{sensors:O,collisionDetection:yN,onDragEnd:Ce,children:(0,a.jsx)(_0,{items:_.map(ue=>ue.id),strategy:BN,children:_.map(ue=>(0,a.jsx)(RL,{company:ue,isEditing:c,isSelected:ue.id===f?.id,onSelect:ce},ue.id))})}),_.length===0?g?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Cn,{disabled:!0,children:"Couldn't load organizations"}),(0,a.jsxs)(Cn,{onSelect:r(ue=>{ue.preventDefault(),v()},"onSelect"),children:[(0,a.jsx)(Gl,{className:"h-4 w-4 mr-2"}),"Try again"]})]}):(0,a.jsx)(Cn,{disabled:!0,children:"No organizations"}):null]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 border-t border-line px-2.5 pb-2.5 pt-2",children:[(0,a.jsxs)(Cn,{onClick:ae,className:Jp,disabled:c,children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)(Xa,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:"Create organization"})]}),se?(0,a.jsx)(Cn,{asChild:!0,disabled:c,className:Jp,children:(0,a.jsxs)(fn,{to:"/company/settings/members?tab=invites",onClick:r(ue=>{if(c){ue.preventDefault();return}te()},"onClick"),children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)(k1,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:oe?`Invite people to ${oe}`:"Invite people"})]})}):null,B?.session?(0,a.jsxs)(Cn,{className:Jp,onClick:r(()=>$.mutate(),"onClick"),disabled:c||$.isPending,children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)(bf,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:$.isPending?"Signing out...":"Sign out"})]}):null]})]})]})}r(ML,"BuiltinCompanyMenu");function Cj({children:e}){const{openNewIssue:t}=Ms(),{enabled:i}=xf(),[l,c]=(0,b.useState)(!0),[d,m]=(0,b.useState)(!0),{selectedCompanyId:f,selectedCompany:h}=bt(),{collapsed:g,peeking:v}=Zn(),y=g&&!v,j=b0(f),{data:k,isFetched:N}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn")}),S=P.liveRuns(f),D=cc({companyId:f,resourceKey:"live-runs",queryKey:S,enabled:!!f,refetchInterval:!1,leaderOnly:!0}),{data:R,dataUpdatedAt:E}=be({queryKey:S,queryFn:r(()=>gf.liveRunsForCompany(f),"queryFn"),enabled:D.enabled,refetchInterval:D.refetchInterval});uc(D,R,E);const C=R?.length??0,I=new Set((R??[]).flatMap(T=>T.issueId?[T.issueId]:[])),O=i,z=k?.enableCombinedInboxTasks===!0,B=!O&&k?.enableIsolatedWorkspaces===!0,L=k?.enablePipelines===!0,_=k?.enableStatusCards===!0,U=!N,F=k?.enableGoalsSidebarLink===!0,Y=k?.enableDecisions===!0,{data:se}=be({queryKey:P.attentionCount(f),queryFn:r(()=>zM.count(f),"queryFn"),enabled:!!f&&Y,refetchInterval:6e4}),me=se?.count??0,oe=k?.enableCases===!0,$={companyId:f,companyPrefix:h?.issuePrefix??null};return(0,a.jsxs)("aside",{className:G("w-full h-full min-h-0 flex flex-col",Ji.surface),children:[(0,a.jsxs)("div",{className:"flex h-(--sz-60px) shrink-0 items-center gap-2 px-3",children:[y?null:(0,a.jsx)(n0,{className:"size-5 shrink-0 text-ink",title:"Wardmote"}),(0,a.jsx)(DL,{})]}),(0,a.jsxs)("nav",{className:y?Ji.railNav:Ji.nav,children:[(0,a.jsxs)("div",{className:Ji.group,children:[(()=>{const T=(0,a.jsxs)("button",{onClick:r(()=>t(),"onClick"),"data-slot":"icon-button","aria-label":y?"New Task":void 0,className:G("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/80 transition-colors hover:bg-bg-3 hover:text-ink"),children:[(0,a.jsx)(p0,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:y?xk:"truncate",children:"New Task"})]});return y?(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{asChild:!0,children:T}),(0,a.jsx)(Cs,{side:"right",children:"New Task"})]}):T})(),(0,a.jsx)(Ye,{to:"/search",label:"Search",icon:Br}),(0,a.jsx)(Ye,{to:"/dashboard",label:"Dashboard",icon:Jg,liveCount:C}),z?null:(0,a.jsx)(Ye,{to:"/inbox",label:"Inbox",icon:Xg,badge:j.inbox,badgeLabel:"unread",badgeTone:j.failedRuns>0?"danger":"default",alert:j.failedRuns>0}),i&&!O?(0,a.jsx)(Ye,{to:"/chats",label:"Chat",icon:Vh}):null,Y?(0,a.jsx)(Ye,{to:"/decisions",label:"Decisions",icon:gT,badge:me,badgeLabel:"decisions"}):null,_?(0,a.jsx)(Ye,{to:"/status",label:"Status",icon:hT,textBadge:"beta"}):null]}),(0,a.jsxs)(Pd,{label:"Work",collapsible:{open:l,onOpenChange:c},children:[O?(0,a.jsx)(Ye,{to:"/chats",label:"Chat",icon:Vh}):null,z?(0,a.jsx)(Ye,{to:"/issues",label:"Tasks",icon:Eh,badge:j.inbox,badgeLabel:"unread",badgeTone:j.failedRuns>0?"danger":"default",alert:j.failedRuns>0}):(0,a.jsx)(Ye,{to:"/issues",label:"Tasks",icon:Eh}),(0,a.jsx)(Ye,{to:"/projects",label:"Projects",icon:eS}),(0,a.jsx)(kM,{}),(0,a.jsx)(Ye,{to:"/routines",label:"Routines",icon:nS}),(0,a.jsx)(Ye,{to:"/artifacts",label:"Artifacts",icon:nI}),oe?(0,a.jsx)(Ye,{to:"/cases",label:"Cases",icon:ff,textBadge:"beta"}):null,L?(0,a.jsx)(Ye,{to:"/pipelines",label:"Pipelines",icon:Jo}):null,F?(0,a.jsx)(Ye,{to:"/goals",label:"Goals",icon:Qg}):U?(0,a.jsx)("div",{"data-testid":"sidebar-goals-placeholder",className:"h-8 pointer-coarse:h-7","aria-hidden":"true"}):null,B?(0,a.jsx)(Ye,{to:"/workspaces",label:"Workspaces",icon:Jo}):null,(0,a.jsx)(Ye,{to:"/terminal",label:"Terminal",icon:ET}),(0,a.jsx)($h,{errorBehavior:"hidden",slotTypes:["sidebar"],context:$,className:"flex flex-col gap-0.5",itemClassName:"text-(length:--text-compact) font-medium",missingBehavior:"placeholder"}),(0,a.jsx)(mN,{errorBehavior:"hidden",placementZones:["sidebar"],context:$,className:"flex flex-col gap-0.5",itemClassName:"text-(length:--text-compact) font-medium"})]}),(0,a.jsxs)(Pd,{label:"Org",collapsible:{open:d,onOpenChange:m},children:[(0,a.jsx)(Ye,{to:"/agents",label:"Agents",icon:Kr}),(0,a.jsx)(Ye,{to:"/skills",label:"Skills",icon:Vk}),(0,a.jsx)(Ye,{to:"/apps",label:"Connectors",icon:RT}),(0,a.jsx)(Ye,{to:"/activity",label:"Audit",icon:m0})]}),e??(0,a.jsx)(jM,{streamlined:!0}),(0,a.jsx)(OM,{companyId:f,liveIssueIds:I}),(0,a.jsx)($h,{errorBehavior:"hidden",slotTypes:["sidebarPanel"],context:$,className:"flex flex-col gap-3",itemClassName:"rounded-lg border border-line p-3",missingBehavior:"placeholder"})]})]})}r(Cj,"Sidebar");function GN(){const e=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn")});return{enabled:!e.isError&&e.data?.enableFastResponses===!0,loaded:e.isFetched}}r(GN,"useFastResponsesEnabled");var OL="wardmote.contextualSidebar.origin";function YN(e,t){if(!t)return[];const i=e.split("/").filter(Boolean);return i.length<2?[]:i[0]?.toUpperCase()!==t.toUpperCase()?[]:i.slice(1)}r(YN,"getCompanyPathSegments");function LL(e,t){const i=YN(e,t),l=i[0]?.toLowerCase(),c=l==="company"&&["settings","export","import"].includes(i[1]?.toLowerCase()??""),d=i[1]?.toLowerCase(),m=l==="agents"&&!!d&&d!=="new"&&!["all","active","paused","error","builtin"].includes(d??""),f=l==="routines"&&i.length>=2,h=l==="skills";return{companySegments:i,isTaskDetail:(l==="issues"||l==="chats")&&i.length>=2,builtInContextualSurface:c?"settings":l==="apps"||l==="tools"?"apps":m?"agent":f?"routine":h?"skills":null}}r(LL,"classifyShellRoute");function XN(e,t){return`${OL}:${t.toUpperCase()}:${e}`}r(XN,"contextualOriginStorageKey");function ZN(e,t){return e.split("/").filter(Boolean)[0]?.toUpperCase()===t.toUpperCase()}r(ZN,"isCompanyPath");function zL({surface:e,companyPrefix:t,previousPathname:i}){if(!(typeof window>"u"||!ZN(i,t)))try{window.sessionStorage.setItem(XN(e,t),i)}catch{}}r(zL,"rememberContextualSidebarOrigin");function PL({surface:e,companyPrefix:t,fallbackTo:i}){if(typeof window>"u"||!t)return i;try{const l=window.sessionStorage.getItem(XN(e,t));return l&&ZN(l,t)?l:i}catch{return i}}r(PL,"readContextualSidebarOrigin");function Mc({surface:e,title:t,icon:i,fallbackTo:l="/dashboard",showHeader:c=!0,className:d,children:m}){const f=xa(),{selectedCompany:h}=bt(),{isMobile:g,setSidebarOpen:v}=Zn();function y(){f(PL({surface:e,companyPrefix:h?.issuePrefix,fallbackTo:l})),g&&v(!1)}return r(y,"goBack"),(0,a.jsx)(sS,{children:(0,a.jsxs)("aside",{"data-contextual-sidebar":e,className:G("flex h-full min-h-0 w-full flex-col bg-bg-3",d),children:[c?(0,a.jsxs)("div",{className:"flex shrink-0 flex-col gap-1 px-3 py-3",children:[(0,a.jsxs)("button",{type:"button",onClick:y,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs text-ink-3 transition-colors hover:bg-bg hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus","aria-label":`Back from ${t}`,children:[(0,a.jsx)(Qk,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),(0,a.jsx)("span",{className:"truncate",children:h?.name??"Organization"})]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 px-2 py-1",children:[i?(0,a.jsx)(i,{className:"h-4 w-4 shrink-0 text-ink-3","aria-hidden":"true"}):null,(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-bold text-ink",children:t})]})]}):null,m]})})}r(Mc,"ContextualSidebarFrame");function UL(e){const t=e.manifestJson.environmentDrivers??[];return t.length===0?!1:t.every(i=>i.kind==="sandbox_provider")}r(UL,"isSandboxProviderOnly");function $L(){const{selectedCompanyId:e}=bt(),{hidden:t}=rr(),{enabled:i}=GN(),l=r(g=>!t.has(g),"showPage"),c=l("instance.plugins"),{slots:d}=Cc({slotTypes:["companySettingsPage"],companyId:e,enabled:!!e}),{data:m}=be({queryKey:e?P.sidebarBadges(e):["sidebar-badges","__disabled__"],queryFn:r(async()=>{try{return await Y1.get(e)}catch(g){if(g instanceof ji&&(g.status===401||g.status===403))return null;throw g}},"queryFn"),enabled:!!e,retry:!1,refetchInterval:15e3}),{data:f}=be({queryKey:P.plugins.all,queryFn:r(()=>s0.list(),"queryFn"),enabled:c}),h=(f??[]).filter(g=>!UL(g));return(0,a.jsxs)(Mc,{surface:"settings",title:"Settings",showHeader:!1,className:Ji.surface,children:[(0,a.jsx)("div",{"data-slot":"settings-sidebar-header",className:"flex h-(--sz-60px) shrink-0 items-center px-3",children:(0,a.jsx)("div",{"data-slot":"settings-back-group",className:`${Ji.group} w-full`,children:(0,a.jsx)(Ye,{to:"/dashboard",label:"Back to app",icon:Gg})})}),(0,a.jsx)("nav",{"aria-label":"Settings","data-slot":"contextual-sidebar-nav",className:Ji.nav,children:(0,a.jsxs)("div",{"data-slot":"contextual-sidebar-group",className:Ji.group,children:[(0,a.jsx)(Ye,{to:"/company/settings",label:"General",icon:d1,end:!0}),l("instance.profile")&&(0,a.jsx)(Ye,{to:"/company/settings/instance/profile",label:"Profile",icon:MT,end:!0}),l("company.members")&&(0,a.jsx)(Ye,{to:"/company/settings/members",label:"Members",icon:Kr,badge:m?.joinRequests??0,end:!0}),d.filter(g=>g.routePath).map(g=>(0,a.jsx)(Ye,{to:`/company/settings/${g.routePath}`,label:g.displayName,icon:fy,end:!0},`${g.pluginKey}:${g.id}`)),(0,a.jsx)(Ye,{to:"/company/settings/agent-defaults",label:"Agent defaults",icon:oc}),(0,a.jsx)(Ye,{to:"/company/settings/models",label:"Models and providers",icon:Vk,end:!0}),l("company.secrets")&&(0,a.jsx)(Ye,{to:"/company/settings/secrets",label:"Secrets",icon:Zg,end:!0}),l("instance.environments")&&(0,a.jsx)(Ye,{to:"/company/settings/instance/environments",label:"Environments",icon:yT,end:!0}),i&&(0,a.jsx)(Ye,{to:"/company/settings/connections",label:"Connections",icon:xI,end:!0}),l("instance.access")&&(0,a.jsx)(Ye,{to:"/company/settings/instance/access",label:"Access",icon:AI,end:!0}),l("company.export")&&(0,a.jsx)(Ye,{to:"/company/export",label:"Export",icon:Fh}),l("company.import")&&(0,a.jsx)(Ye,{to:"/company/import",label:"Import",icon:DT,end:!0}),l("instance.experimental")&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Ye,{to:"/company/settings/instance/features",label:"Features",icon:v1}),(0,a.jsx)(Ye,{to:"/company/settings/instance/advanced",label:"Advanced",icon:Hg})]}),c&&(0,a.jsx)(Ye,{to:"/company/settings/instance/plugins",label:"Plugins",icon:fy}),c&&h.length>0?(0,a.jsx)("div",{className:"ml-4 mt-1 flex flex-col gap-0.5 border-l border-line/70 pl-3",children:h.map(g=>(0,a.jsx)(_k,{to:`${Gi}/plugins/${g.id}`,state:pf,className:r(({isActive:v})=>G("rounded-md px-2 py-1.5 text-xs transition-colors",v?Kl.active:G(Kl.rest,"text-ink-3")),"className"),children:g.manifestJson.displayName??g.packageName},g.id))}):null,l("instance.adapters")&&(0,a.jsx)(Ye,{to:"/company/settings/instance/adapters",label:"Adapters",icon:tI})]})})]})}r($L,"CompanySettingsSidebar");function BL({items:e,value:t,onValueChange:i,align:l="center"}){const{isMobile:c}=Zn();return c&&t!==void 0&&i?(0,a.jsxs)("div",{className:"relative inline-flex",children:[(0,a.jsx)("select",{value:t,onChange:r(d=>i(d.target.value),"onChange"),className:"h-9 appearance-none rounded-md border border-line bg-bg pl-3 pr-9 py-1 text-base focus:outline-none focus:ring-1 focus:ring-focus","aria-label":"Page section",children:e.map(d=>(0,a.jsx)("option",{value:d.value,children:typeof d.label=="string"?d.label:d.value},d.value))}),(0,a.jsx)($r,{"aria-hidden":"true",className:"pointer-events-none absolute right-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"})]}):(0,a.jsx)(wE,{variant:"line",className:l==="start"?"justify-start":void 0,children:e.map(d=>(0,a.jsx)(jE,{value:d.value,children:d.label},d.value))})}r(BL,"PageTabBar");var KL=[{value:"general",label:"General",href:"/company/settings"},{value:"export",label:"Export",href:"/company/export"},{value:"import",label:"Import",href:"/company/import"},{value:"members",label:"Members",href:"/company/settings/members"},{value:"secrets",label:"Secrets",href:"/company/settings/secrets"},{value:"instance-profile",label:"Profile",href:`${Gi}/profile`},{value:"instance-environments",label:"Environments",href:`${Gi}/environments`},{value:"connections",label:"Connections",href:"/company/settings/connections"},{value:"instance-access",label:"Access",href:`${Gi}/access`},{value:"instance-features",label:"Features",href:`${Gi}/features`},{value:"instance-advanced",label:"Advanced",href:`${Gi}/advanced`},{value:"instance-plugins",label:"Plugins",href:`${Gi}/plugins`},{value:"instance-adapters",label:"Adapters",href:`${Gi}/adapters`}],qL={export:"company.export",import:"company.import",members:"company.members",secrets:"company.secrets","instance-profile":"instance.profile","instance-environments":"instance.environments","instance-access":"instance.access","instance-features":"instance.experimental","instance-advanced":"instance.experimental","instance-plugins":"instance.plugins","instance-adapters":"instance.adapters"};function FL(e){return e.includes("/company/settings/connections")?"connections":e.includes("/company/settings/instance/profile")?"instance-profile":e.includes("/company/settings/instance/environments")?"instance-environments":e.includes("/company/settings/instance/access")?"instance-access":e.includes("/company/settings/instance/features")?"instance-features":e.includes("/company/settings/instance/advanced")?"instance-advanced":e.includes("/company/settings/instance/plugins")?"instance-plugins":e.includes("/company/settings/instance/adapters")?"instance-adapters":e.includes("/company/settings/instance/general")?"general":e.includes("/company/settings/environments")?"instance-environments":e.includes("/company/export")?"export":e.includes("/company/import")?"import":e.includes("/company/settings/members")||e.includes("/company/settings/access")||e.includes("/company/settings/invites")?"members":e.includes("/company/settings/secrets")?"secrets":"general"}r(FL,"getCompanySettingsTab");function HL(){const e=vn(),t=xa(),{hidden:i}=rr(),{enabled:l}=GN(),c=FL(e.pathname),d=KL.filter(f=>{if(f.value==="connections"&&!l)return!1;const h=qL[f.value];return!h||!i.has(h)});function m(f){const h=d.find(g=>g.value===f);!h||h.value===c||t(h.href)}return r(m,"handleTabChange"),(0,a.jsx)(kE,{value:c,onValueChange:m,children:(0,a.jsx)(BL,{items:d.map(({value:f,label:h})=>({value:f,label:h})),value:c,onValueChange:m,align:"start"})})}r(HL,"CompanySettingsNav");var $n={nav:"flex min-h-0 flex-1 flex-col overflow-y-auto scrollbar-auto-hide px-3 py-2",group:"flex flex-col gap-0.5",section:"mt-4 border-t border-line pt-3",sectionLabel:"px-2 pb-1 text-(length:--text-micro) font-semibold uppercase tracking-wide text-ink-3",sectionDescription:"px-4 pb-1.5 text-(length:--text-micro) leading-snug text-ink-3/70"};function JN({endpointId:e,NavItem:t=Ye}){const i=be({queryKey:P.chatEndpoints.detail(e),queryFn:r(()=>oS.get(e),"queryFn"),enabled:!!e});return(0,a.jsx)("aside",{className:"flex h-full min-h-0 w-full flex-col border-r border-line bg-bg",children:(0,a.jsx)("nav",{"aria-label":"Chat connection","data-slot":"contextual-sidebar-nav",className:$n.nav,children:(0,a.jsxs)("div",{"data-slot":"contextual-sidebar-group",className:$n.group,children:[(0,a.jsx)(t,{to:`/apps/chat/${e}/settings`,label:"Settings",icon:aS,end:!0}),(0,a.jsx)(t,{to:`/apps/chat/${e}/access`,label:"Access",icon:Kr,end:!0}),i.data?.provider==="github"&&(0,a.jsx)(t,{to:`/apps/chat/${e}/reviews`,label:"Reviews",icon:gI}),(0,a.jsx)(t,{to:`/apps/chat/${e}/conversations`,label:"Conversations",icon:Ck,end:!0}),(0,a.jsx)(t,{to:`/apps/chat/${e}/activity`,label:"Activity",icon:Wg,end:!0}),i.data?.provider==="openwa"&&(0,a.jsx)(t,{to:`/apps/chat/${e}/approvals`,label:"Approvals",icon:Rd,end:!0}),i.data?.provider==="openwa"&&(0,a.jsx)(t,{to:`/apps/chat/${e}/audit`,label:"Audit",icon:kI,end:!0})]})})})}r(JN,"ChatDetailSidebar");var na=r(e=>`/chat-endpoints/${e}/github`,"path$1"),VL={repositories:r((e,t={})=>{const i=new URLSearchParams({limit:String(t.limit??20),offset:String(t.offset??0),search:t.search??""});return Re.get(`${na(e)}/repositories?${i}`)},"repositories"),toggleAllRepositories:r((e,t)=>Re.put(`${na(e)}/repositories/access`,{enabled:t}),"toggleAllRepositories"),configuration:r(e=>Re.get(`${na(e)}/configuration`),"configuration"),save:r((e,t,i)=>Re.put(`${na(e)}/configuration`,{expectedRevision:t,configuration:i}),"save"),registration:r((e,t)=>Re.post(`${na(e)}/registration`,t),"registration"),saveDraft:r((e,t)=>Re.put(`${na(e)}/draft`,t),"saveDraft"),advance:r(e=>Re.post(`${na(e)}/setup`,{}),"advance"),startIdentity:r(e=>Re.post(`${na(e)}/identity/start`,{}),"startIdentity"),confirmIdentity:r((e,t)=>Re.post(`${na(e)}/identity/confirm`,{githubUserId:t}),"confirmIdentity"),connectApp:r((e,t)=>Re.post(`${na(e)}/app`,t),"connectApp"),refreshRepositories:r(e=>Re.post(`${na(e)}/repositories/refresh`,{}),"refreshRepositories"),verify:r(e=>Re.post(`${na(e)}/verify`,{}),"verify"),progress:r((e,t)=>Re.put(`${na(e)}/progress`,{stage:t}),"progress"),personalConnections:r(e=>Re.get(`${na(e)}/personal-connections`),"personalConnections"),identity:r((e,t,i)=>Re.post(`${na(e)}/identity`,{connectionId:t,confirmedGithubUserId:i}),"identity"),lookup:r((e,t)=>Re.post(`${na(e)}/people/lookup`,{login:t}),"lookup"),review:r((e,t)=>Re.get(`${na(e)}/reviews/${t}`),"review"),reviews:r(e=>Re.get(`${na(e)}/reviews`),"reviews")};function QL({NavItem:e=Ye}){const[t]=vk(),i=t.get("resume"),l=be({queryKey:["github-wizard",i],queryFn:r(()=>VL.advance(i),"queryFn"),enabled:!1});return t.get("provider")==="github"&&i&&t.get("stage")!=="identity"&&t.get("reconnect")!=="1"&&l.data?.state==="connected"?(0,a.jsx)(JN,{endpointId:i,NavItem:e}):(0,a.jsx)(MI,{})}r(QL,"ChatSetupSidebar");function WQ(e){return(0,a.jsx)(DI,{...e,labels:e.labels??["Choose agent","Connect provider","Try it"],ariaLabel:"Connection setup progress"})}r(WQ,"ChatSetupNavigation");var WL="/apps/advanced";function GL(e){return`${WL}/${e}`}r(GL,"advancedTabHref");var eC=[{key:"paste-config",label:"Paste a config",icon:HE}],tC=[{key:"gateways",label:"Gateways",icon:jI},{key:"profiles",label:"Profiles",icon:ff},{key:"smoke-lab",label:"Smoke Lab",icon:pI}],GQ=[...eC,...tC];function YQ(e){return eC.some(t=>t.key===e)}r(YQ,"isAdvancedSetupTab");function YL(e){return e==="smoke-lab"}r(YL,"isExperimentalToolTab");var Aj=null;function XL(){return Aj??=new uf,Aj}r(XL,"getDetachedClient$2");function ZL(){const e=(0,b.useContext)($g),{data:t,isFetched:i}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn"),enabled:e!=null},e??XL());return e?{enabled:t?.enableSmokeLab===!0,loaded:i}:{enabled:!1,loaded:!0}}r(ZL,"useSmokeLabEnabled");function JL(){const{selectedCompanyId:e}=bt();return be({queryKey:P.tools.actionRequests(e??"__none__","pending"),queryFn:r(()=>Rl.listActionRequests(e,"pending"),"queryFn"),enabled:!!e,refetchInterval:2e4}).data?.actionRequests.length??0}r(JL,"useReviewCount");function e4(){const{pathname:e}=vn(),t=JL(),{enabled:i}=ZL(),l=tC.filter(d=>d.key==="gateways"||d.key==="profiles"?!1:!YL(d.key)||i);if(e.endsWith("/apps/chat/connect"))return(0,a.jsx)(QL,{});const c=e.match(/\/apps\/chat\/([^/]+)(?:\/(?:settings|access|conversations|activity|approvals|audit)|\/reviews(?:\/[^/]+)?)?\/?$/);return c?(0,a.jsx)(JN,{endpointId:c[1]}):(0,a.jsx)("aside",{className:"w-full h-full min-h-0 border-r border-line bg-bg flex flex-col",children:(0,a.jsxs)("nav",{"aria-label":"Connectors","data-slot":"contextual-sidebar-nav",className:$n.nav,children:[(0,a.jsxs)("div",{"data-slot":"contextual-sidebar-group",className:$n.group,children:[(0,a.jsx)(Ye,{to:"/apps",label:"Browse",icon:IT,end:!0}),(0,a.jsx)(Ye,{to:"/apps/review",label:"Review",icon:CI,badge:t>0?t:void 0,badgeTone:"warning",badgeLabel:"waiting for your OK"})]}),l.length>0?(0,a.jsxs)("div",{"data-slot":"contextual-sidebar-section",className:$n.section,children:[(0,a.jsx)("div",{"data-slot":"contextual-sidebar-section-label",className:$n.sectionLabel,children:"Developer"}),(0,a.jsx)("p",{"data-slot":"contextual-sidebar-section-description",className:$n.sectionDescription,children:"Advanced setup for developers."}),(0,a.jsx)("div",{"data-slot":"contextual-sidebar-group",className:$n.group,children:l.map(d=>(0,a.jsx)(Ye,{to:GL(d.key),label:d.label,icon:d.icon,end:!0},d.key))})]}):null]})})}r(e4,"AppsSidebar");function _j(e){const{selectedCompanyId:t}=bt(),{isMobile:i,setSidebarOpen:l}=Zn(),c=be({queryKey:P.tools.connection(e.kind==="connection"?e.connectionId:"__none__"),queryFn:r(()=>Rl.getConnection(e.kind==="connection"?e.connectionId:""),"queryFn"),enabled:e.kind==="connection"&&!!e.connectionId}),d=be({queryKey:P.tools.applications(t??"__none__"),queryFn:r(()=>Rl.listApplications(t),"queryFn"),enabled:!!t}),m=be({queryKey:P.tools.connections(t??"__none__"),queryFn:r(()=>Rl.listConnections(t),"queryFn"),enabled:e.kind==="application"&&!!t}),f=be({queryKey:P.apps.gallery(t??"__none__"),queryFn:r(()=>Rl.listGallery(t),"queryFn"),enabled:!!t}),h=be({queryKey:P.apps.attention(t??"__none__"),queryFn:r(()=>Rl.listAppsAttention(t),"queryFn"),enabled:!!t,refetchInterval:3e4}),g=c.data,v=e.kind==="application"?e.applicationId:g?.applicationId,y=(d.data?.applications??[]).find(C=>C.id===v)??null,j=a4(e.kind==="application"?(m.data?.connections??[]).filter(C=>C.applicationId===e.applicationId):[]),k=g?tT(g):y?.name??"App",N=n4(f.data?.apps??[],g,y??void 0),S=kk(y)??Nk(g)??(N?Th(N):null),D=g?.id??j?.id??null,R=D?h.data?.apps.find(C=>C.connection.id===D):null,E=(R?.pendingActionRequestCount??0)+((R?.quarantinedCatalogEntryCount??0)>0?1:0);return(0,a.jsxs)("aside",{className:"flex h-full min-h-0 w-full flex-col border-r border-line bg-bg",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col gap-3 px-3 py-3",children:[(0,a.jsxs)(fn,{to:"/apps",onClick:r(()=>{i&&l(!1)},"onClick"),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-ink-3 transition-colors hover:bg-bg-3/50 hover:text-ink",children:[(0,a.jsx)(Qk,{className:"h-3.5 w-3.5 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:"All connectors"})]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 px-2 py-1",children:[(0,a.jsx)(x3,{name:k,brandKey:S,logoUrl:Y_(N),allowRemoteFallback:!d.isPending,darkLogoUrl:Z_(N),size:28}),(0,a.jsx)("span",{className:"flex-1 truncate text-sm font-bold text-ink",children:k})]})]}),(0,a.jsx)("nav",{className:"scrollbar-auto-hide min-h-0 flex-1 overflow-y-auto px-3 py-2",children:(0,a.jsx)("div",{className:"flex flex-col gap-0.5",children:K_.map(C=>(0,a.jsx)(Ye,{to:t4(e,C.key),label:C.label,icon:C.icon,end:!0,badge:C.key==="review"&&E>0?E:void 0,badgeTone:"danger",badgeLabel:"needing review"},C.key))})})]})}r(_j,"AppDetailSidebar");function t4(e,t){return e.kind==="connection"?W_(e.connectionId,t):F_(e.applicationId,t)}r(t4,"tabHref");function n4(e,t,i){const l=kk(i)??Nk(t);if(l){const d=e.find(m=>Th(m)===l);if(d)return d}const c=(t?.name??i?.name)?.toLowerCase();return c?e.find(d=>X_(d).toLowerCase()===c)??e.find(d=>Th(d)===c)??null:null}r(n4,"galleryEntryFor");function a4(e){const t=e.filter(i=>i.status==="archived");return t.length===0?null:t.reduce((i,l)=>{const c=new Date(i.updatedAt??i.createdAt??0).getTime();return new Date(l.updatedAt??l.createdAt??0).getTime()>c?l:i})}r(a4,"latestArchivedConnection");var s4=[{label:"Agent",items:[{value:"overview",label:"Overview"},{value:"setup",label:"Setup"},{value:"instructions",label:"Instructions"},{value:"skills",label:"Skills"}]},{label:"Runtime",items:[{value:"runtime",label:"Harness / Runtime"},{value:"secrets",label:"Secrets"},{value:"tools",label:"Tools"},{value:"channels",label:"Channels"}]},{label:"Governance",items:[{value:"permissions",label:"Permissions / Trust"},{value:"api-keys",label:"API Keys"},{value:"revisions",label:"Revisions"}]}];function XQ(e){return e==="setup"?"setup":e==="instructions"||e==="prompts"?"instructions":e==="skills"?"skills":e==="runtime"||e==="configure"||e==="configuration"?"runtime":e==="secrets"?"secrets":e==="tools"?"tools":e==="channels"?"channels":e==="permissions"||e==="trust"?"permissions":e==="api-keys"||e==="keys"?"api-keys":e==="revisions"||e==="history"?"revisions":"overview"}r(XQ,"parseAgentDetailView");function i4(e,t="overview"){return`/agents/${e}/${t}`}r(i4,"agentDetailHref");function ZQ(e){return e==="runs"?"runs":e==="audit"||e==="activity"?"activity":e==="cost"||e==="costs"?"costs":e==="budget"||e==="budgets"?"budgets":null}r(ZQ,"agentLegacyAuditSection");function r4(e,t){return b3(t,{mode:t==="activity"?"agents":void 0,agentId:e})}r(r4,"agentScopedAuditHref");var l4={overview:iE,setup:d1,instructions:sT,skills:Hh,runtime:ST,secrets:Rd,tools:Hg,channels:Ck,permissions:Rd,"api-keys":Zg,revisions:m0},o4=[{section:"activity",label:"Activity",icon:Wg},{section:"runs",label:"Runs",icon:NS},{section:"costs",label:"Costs",icon:kT},{section:"budgets",label:"Budgets",icon:nT}];function c4({agentRef:e,agentId:t,agentName:i,labels:l={secrets:"Secrets & variables"}}){const{selectedCompanyId:c}=bt(),d=!t||!i,{data:m}=be({queryKey:[...P.agents.detail(e),c??null,"contextual-sidebar"],queryFn:r(()=>Pa.get(e,c??void 0),"queryFn"),enabled:d&&!!(e&&c)}),f=t??m?.id,h=i??m?.name??"Agent";return(0,a.jsx)(Mc,{surface:"agent",title:h,fallbackTo:"/agents/all",showHeader:!1,className:"border-r border-line bg-bg",children:(0,a.jsxs)("nav",{"aria-label":`${h} navigation`,"data-slot":"contextual-sidebar-nav",className:$n.nav,children:[s4.map(g=>(0,a.jsxs)("div",{"data-slot":"contextual-sidebar-section",className:$n.section,children:[(0,a.jsx)("p",{"data-slot":"contextual-sidebar-section-label",className:$n.sectionLabel,children:g.label}),(0,a.jsx)("div",{"data-slot":"contextual-sidebar-group",className:$n.group,children:g.items.map(v=>{const y=i4(e,v.value);return(0,a.jsx)(Ye,{to:y,label:l?.[v.value]??v.label,icon:l4[v.value]},v.value)})})]},g.label)),(0,a.jsxs)("div",{"data-slot":"contextual-sidebar-section",className:$n.section,children:[(0,a.jsx)("p",{"data-slot":"contextual-sidebar-section-label",className:$n.sectionLabel,children:"Audit"}),(0,a.jsx)("div",{"data-slot":"contextual-sidebar-group",className:$n.group,children:f?o4.map(g=>(0,a.jsx)(Ye,{to:r4(f,g.section),label:g.label,icon:g.icon},g.section)):(0,a.jsx)("p",{className:"px-2 py-1.5 text-xs text-ink-3",children:"Loading audit links…"})})]})]})})}r(c4,"AgentContextualSidebar");var u4=["overview","triggers","variables","delivery","secrets","history","runs","activity"],d4=[{view:"overview",label:"Overview",icon:Jg},{view:"triggers",label:"Triggers",icon:ME},{view:"variables",label:"Variables",icon:DE},{view:"delivery",label:"Delivery",icon:SI},{view:"secrets",label:"Secrets",icon:Zg}];function f4(e){return u4.includes(e)}r(f4,"isRoutineDetailView");function ic(e,t="overview"){return`/routines/${e}/${t}`}r(ic,"routineDetailHref");function JQ(e){const t=e.legacyTab??e.section;return f4(t)?ic(e.routineId,t):ic(e.routineId,"overview")}r(JQ,"resolveRoutineDetailDestination");function m4({routineId:e,title:t}={}){const i=Rs(),l=e??i.routineId??"",{data:c}=be({queryKey:P.routines.detail(l),queryFn:r(()=>v3.get(l),"queryFn"),enabled:!!(l&&!t)}),d=t??c?.title??"Routine";return(0,a.jsx)(Mc,{surface:"routine",title:d,icon:nS,fallbackTo:"/routines",showHeader:!1,className:"border-r border-line bg-bg",children:(0,a.jsxs)("nav",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-2","aria-label":"Routine navigation",children:[(0,a.jsx)("div",{className:"flex flex-col gap-0.5",children:d4.map(m=>(0,a.jsx)(Ye,{to:ic(l,m.view),label:m.label,icon:m.icon,end:!0},m.view))}),(0,a.jsx)("p",{className:"px-4 pb-1 pt-5 text-(length:--text-nano) font-mono font-medium uppercase tracking-widest text-ink-3/60",children:"Operate"}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)(Ye,{to:ic(l,"runs"),label:"Runs",icon:t0}),(0,a.jsx)(Ye,{to:ic(l,"activity"),label:"Activity",icon:Wg})]})]})})}r(m4,"RoutineContextualSidebar");var Yu={sources:"/skills/sources",installed:"/skills",discover:"/skills?tab=discover",authored:"/skills/studio"};function p4(e){return["discover","all","catalog","bundled"].includes(e??"")?"discover":"installed"}r(p4,"resolveSkillsDiscoveryView");function eW(e,t){const i=new URLSearchParams(e);return t==="installed"?i.delete("tab"):i.set("tab","discover"),i.delete("view"),i.delete("category"),t!=="installed"&&i.delete("folder"),i}r(eW,"withSkillsDiscoveryView");function h4(e,t=""){const i=e.split("/").filter(Boolean),l=i.findIndex(m=>m.toLowerCase()==="skills"),c=l>=0?i.slice(l+1):[];if(c[0]?.toLowerCase()==="sources")return"sources";if(c[0]?.toLowerCase()==="studio")return"authored";const d=typeof t=="string"?new URLSearchParams(t):t;return d.has("catalog")||d.get("view")==="catalog"?"discover":p4(d.get("tab"))}r(h4,"resolveSkillsNavigationView");function g4(){const e=vn(),t=h4(e.pathname,e.search);return(0,a.jsx)(Mc,{surface:"skills",title:"Skills",icon:Hh,fallbackTo:"/dashboard",showHeader:!1,className:"border-r border-line bg-bg",children:(0,a.jsxs)("nav",{"aria-label":"Skills","data-slot":"contextual-sidebar-nav",className:$n.nav,children:[(0,a.jsxs)("div",{"data-slot":"contextual-sidebar-group",className:$n.group,children:[(0,a.jsx)(Ye,{to:Yu.installed,label:"Installed",icon:Hh,active:t==="installed",end:!0}),(0,a.jsx)(Ye,{to:Yu.discover,label:"Discover",icon:Ak,active:t==="discover",end:!0}),(0,a.jsx)(Ye,{to:Yu.sources,label:"Sources",icon:y3,active:t==="sources"})]}),(0,a.jsxs)("div",{"data-slot":"contextual-sidebar-section",className:$n.section,children:[(0,a.jsx)("div",{"data-slot":"contextual-sidebar-section-label",className:$n.sectionLabel,children:"Author"}),(0,a.jsx)("p",{"data-slot":"contextual-sidebar-section-description",className:$n.sectionDescription,children:"Skills you create, edit, and test."}),(0,a.jsx)("div",{"data-slot":"contextual-sidebar-group",className:$n.group,children:(0,a.jsx)(Ye,{to:Yu.authored,label:"My Skills",icon:wT,active:t==="authored"})})]})]})})}r(g4,"SkillsContextualSidebar");var nC="wardmote:panel-visible",aC=(0,b.createContext)(null);function sC(){return typeof window.matchMedia=="function"&&window.matchMedia("(min-width: 768px) and (max-width: 1023px) and (min-height: 431px)").matches}r(sC,"fullPagePanel");function x4(){if(sC())return!1;try{const e=localStorage.getItem(nC);return e===null?!0:e==="true"}catch{return!0}}r(x4,"readPreference");function Ej(e){if(!sC())try{localStorage.setItem(nC,String(e))}catch{}}r(Ej,"writePreference");function b4({children:e}){const[t,i]=(0,b.useState)(null),[l,c]=(0,b.useState)("padded"),[d,m]=(0,b.useState)(x4),[f,h]=(0,b.useState)(!1),g=(0,b.useCallback)(()=>{h(!0)},[]),v=(0,b.useCallback)(()=>{h(!1)},[]),y=(0,b.useCallback)((S,D)=>{i(S),c(D?.contentMode??"padded")},[]),j=(0,b.useCallback)(()=>{i(null),c("padded")},[]),k=(0,b.useCallback)(S=>{m(S),Ej(S)},[]),N=(0,b.useCallback)(()=>{m(S=>{const D=!S;return Ej(D),D})},[]);return(0,a.jsx)(aC.Provider,{value:{panelContent:t,panelContentMode:l,panelVisible:d,openPanel:y,closePanel:j,setPanelVisible:k,togglePanelVisible:N,panelMaximizeRequested:f,requestPanelMaximize:g,clearPanelMaximizeRequest:v},children:e})}r(b4,"PanelProvider");function T0(){const e=(0,b.useContext)(aC);if(!e)throw new Error("usePanel must be used within PanelProvider");return e}r(T0,"usePanel");function v4({...e}){return(0,a.jsx)("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}r(v4,"Breadcrumb");function y4({className:e,...t}){return(0,a.jsx)("ol",{"data-slot":"breadcrumb-list",className:G("text-ink-3 flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}r(y4,"BreadcrumbList");function j4({className:e,...t}){return(0,a.jsx)("li",{"data-slot":"breadcrumb-item",className:G("inline-flex items-center gap-1.5",e),...t})}r(j4,"BreadcrumbItem");function w4({asChild:e,className:t,...i}){const l=e?hE:"a";return(0,a.jsx)(l,{"data-slot":"breadcrumb-link",className:G("hover:text-ink transition-colors",t),...i})}r(w4,"BreadcrumbLink");function Ij({className:e,...t}){return(0,a.jsx)("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:G("text-ink font-normal",e),...t})}r(Ij,"BreadcrumbPage");function k4({children:e,className:t,...i}){return(0,a.jsx)("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:G("[&>svg]:size-3.5",t),...i,children:e??(0,a.jsx)(tr,{})})}r(k4,"BreadcrumbSeparator");function Al({identifier:e}){return e?(0,a.jsx)("span",{"data-slot":"task-title-identifier",className:"min-w-0 max-w-1/2 shrink truncate font-mono text-(length:--text-micro) text-ink-3",children:e}):null}r(Al,"CrumbIdentifier");function S4({context:e,pageToolbar:t}){const{slots:i}=Cc({slotTypes:["globalToolbarButton"],companyId:e.companyId}),{launchers:l}=fN({placementZones:["globalToolbarButton"],companyId:e.companyId,enabled:!!e.companyId});return(0,a.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1 pl-2 empty:hidden",children:[t,i.length>0?(0,a.jsx)($h,{slotTypes:["globalToolbarButton"],context:e,className:"flex items-center gap-1"}):null,l.length>0?(0,a.jsx)(mN,{placementZones:["globalToolbarButton"],context:e,className:"flex items-center gap-1"}):null]})}r(S4,"GlobalToolbar");function Tj({taskDetailLayout:e=!1}){const{breadcrumbs:t,breadcrumbToolbar:i,breadcrumbPanelControl:l,mobileToolbar:c}=cS(),{toggleSidebar:d,isMobile:m}=Zn(),{openNewIssue:f}=Ms(),{panelVisible:h,togglePanelVisible:g}=T0(),{selectedCompanyId:v,selectedCompany:y}=bt(),j=l?.open??h,k=l?.onToggle??g,N=(0,b.useMemo)(()=>({companyId:v??null,companyPrefix:y?.issuePrefix??null}),[v,y?.issuePrefix]),S=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S4,{context:N,pageToolbar:m?null:i}),m?(0,a.jsx)(pe,{variant:"ghost",size:"icon-sm",className:"ms-1 shrink-0",onClick:r(()=>f(),"onClick"),"aria-label":"New Task",children:(0,a.jsx)(p0,{className:"h-5 w-5"})}):null]});if(m&&c)return(0,a.jsx)("div",{className:"h-(--sz-60px) shrink-0 flex items-center border-b border-line px-2",children:c});if(t.length===0)return(0,a.jsx)("div",{className:"h-(--sz-60px) shrink-0 flex items-center justify-end border-b border-line px-4 md:px-6",children:S});const D=m&&(0,a.jsx)(pe,{variant:"ghost",size:"icon-sm",className:"mr-2 shrink-0",onClick:d,"aria-label":"Open sidebar",children:(0,a.jsx)(QS,{className:"h-5 w-5"})}),R=t[t.length-1];if(m&&t[0]?.label==="Tasks"&&R.identifier)return(0,a.jsxs)("div",{className:"h-(--sz-60px) shrink-0 flex items-center border-b border-line px-4",children:[D,(0,a.jsxs)("h1",{className:"flex min-w-0 flex-1 items-baseline gap-1.5 text-sm",children:[R.leading?(0,a.jsx)("span",{className:"flex shrink-0 items-center self-center",children:R.leading}):null,(0,a.jsx)("span",{className:"min-w-0 truncate",title:R.label,children:R.label}),(0,a.jsx)(Al,{identifier:R.identifier})]}),S]});const E=(0,a.jsx)("div",{className:"min-w-0 overflow-hidden flex-1",children:(0,a.jsx)(v4,{className:"min-w-0 overflow-hidden",children:(0,a.jsx)(y4,{className:"flex-nowrap",children:t.map((C,I)=>{const O=I===t.length-1;return(0,a.jsxs)(b.Fragment,{children:[I>0&&(0,a.jsx)(k4,{}),(0,a.jsxs)(j4,{className:O?"min-w-0":"shrink-0",children:[O||!C.href?C.leading||C.identifier?(0,a.jsxs)(Ij,{className:G("flex min-w-0 gap-1.5",C.trailing?"items-center":"items-baseline"),children:[C.leading&&(0,a.jsx)("span",{className:"flex shrink-0 items-center self-center",children:C.leading}),e?null:(0,a.jsx)(Al,{identifier:C.identifier}),(0,a.jsx)("span",{className:"min-w-0 truncate",children:C.label}),e&&O?(0,a.jsx)(Al,{identifier:C.identifier}):null]}):(0,a.jsx)(Ij,{className:"truncate",children:C.label}):(0,a.jsx)(w4,{asChild:!0,children:C.leading||C.identifier?(0,a.jsxs)(fn,{to:C.href,onClick:C.onClick,className:G("flex min-w-0 items-baseline gap-1.5",I===0&&"font-semibold uppercase tracking-wider text-ink-3 hover:text-ink"),children:[C.leading&&(0,a.jsx)("span",{className:"flex shrink-0 items-center self-center",children:C.leading}),e?null:(0,a.jsx)(Al,{identifier:C.identifier}),(0,a.jsx)("span",{className:"min-w-0 truncate",children:C.label}),e&&O?(0,a.jsx)(Al,{identifier:C.identifier}):null]}):(0,a.jsx)(fn,{to:C.href,onClick:C.onClick,className:G("min-w-0 truncate",I===0&&"font-semibold uppercase tracking-wider text-ink-3 hover:text-ink"),children:C.label})}),C.trailing&&(0,a.jsx)("span",{className:"flex shrink-0 items-center",children:C.trailing})]})]},I)})})})});return t.length===1&&!e?(0,a.jsxs)("div",{className:"h-(--sz-60px) shrink-0 flex items-center border-b border-line px-4 md:px-6",children:[D,(0,a.jsx)("div",{className:"min-w-0 overflow-hidden flex-1",children:t[0].leading||t[0].identifier?(0,a.jsxs)("h1",{className:"flex items-baseline gap-1.5 text-sm font-semibold uppercase tracking-wider",children:[t[0].leading&&(0,a.jsx)("span",{className:"flex shrink-0 items-center self-center",children:t[0].leading}),(0,a.jsx)(Al,{identifier:t[0].identifier}),(0,a.jsx)("span",{className:"truncate",children:t[0].label})]}):(0,a.jsx)("h1",{className:"text-sm font-semibold uppercase tracking-wider truncate",children:t[0].label})}),S]}):(0,a.jsxs)("div",{className:G("relative h-(--sz-60px) shrink-0 flex items-center border-b border-line","px-4 md:px-6"),children:[D,E,S,e?(0,a.jsx)(pe,{variant:"ghost",size:"icon-sm",className:"ml-5 size-9 shrink-0",onClick:k,"aria-label":j?"Hide properties":"Show properties",title:j?"Hide properties":"Show properties",children:j?(0,a.jsx)(e1,{className:"h-4 w-4"}):(0,a.jsx)(n1,{className:"h-4 w-4"})}):null]})}r(Tj,"BreadcrumbBar");var N4=600;function C4(e){const t=e.trim();if(!t)return null;const i=Number.parseFloat(t);return Number.isFinite(i)?t.endsWith("s")&&!t.endsWith("ms")?i*1e3:i:null}r(C4,"parseCssTimeMs");function A4(){const e=(0,b.useRef)(null),t=(0,b.useRef)(null),i=(0,b.useCallback)(l=>{const c=l.currentTarget;t.current=c,c.dataset.scrollActive="true",e.current!==null&&window.clearTimeout(e.current);const d=C4(getComputedStyle(document.documentElement).getPropertyValue("--motion-scrollbar-idle-delay"));e.current=window.setTimeout(()=>{delete c.dataset.scrollActive,e.current=null},d??N4)},[]);return(0,b.useEffect)(()=>()=>{e.current!==null&&window.clearTimeout(e.current),t.current&&delete t.current.dataset.scrollActive},[]),i}r(A4,"useScrollbarWhileScrolling");function _4({children:e,header:t,footer:i,trailingControls:l,presentation:c="docked",contentMode:d="padded",open:m=!0,maximized:f=!1,resizing:h=!1,label:g="Side panel",headerSize:v="default",className:y,bodyClassName:j,style:k}){const N=A4();return(0,a.jsxs)("section",{"aria-label":g,"aria-hidden":!m,"data-presentation":c,"data-open":m?"true":"false","data-maximized":f?"true":"false","data-resizing":h?"true":"false",className:G("flex min-h-0 min-w-0 flex-col overflow-hidden bg-(--side-panel-bg) text-(--side-panel-fg)",c==="docked"&&"h-full border-l border-line",c==="sheet"&&"h-full w-full",c==="embedded"&&"h-full rounded-xl border border-line",!m&&"pointer-events-none opacity-0",y),style:k,children:[t||l?(0,a.jsxs)("header",{className:G("flex h-(--side-panel-header-height) min-w-0 shrink-0 items-center gap-1 px-2"),children:[(0,a.jsx)("div",{className:"flex min-w-0 flex-1 self-stretch",children:t}),l?(0,a.jsx)("div",{className:"flex shrink-0 items-center gap-1",children:l}):null]}):null,(0,a.jsx)("div",{"data-side-panel-content-viewport":"true",onScroll:N,className:G("min-h-0 flex-1",d==="full-bleed"?"overflow-hidden":"overflow-auto",d!=="full-bleed"&&"scrollbar-while-scrolling",d==="padded"&&"p-4",j),children:d==="prose"?(0,a.jsx)("div",{"data-side-panel-prose-content":"true",className:"mx-auto w-full max-w-4xl px-6 py-4",children:e}):e}),i?(0,a.jsx)("footer",{className:G("shrink-0",v!=="task-detail"&&"border-t border-line"),children:i}):null]})}r(_4,"SidePanelFrame");function E4({open:e,onToggle:t,shortcut:i,className:l}){const c="Toggle side panel";return(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{asChild:!0,children:(0,a.jsx)(pe,{active:e,type:"button",variant:"ghost",size:"icon-sm","aria-label":c,"aria-pressed":e,onClick:t,className:G("h-(--side-panel-tab-height) w-(--side-panel-tab-height)",l),children:e?(0,a.jsx)(e1,{"aria-hidden":!0}):(0,a.jsx)(n1,{"aria-hidden":!0})})}),(0,a.jsx)(Cs,{side:"bottom",children:i?`${c} (${i})`:c})]})}r(E4,"SidePanelToggleButton");function I4({maximized:e,onMaximizedChange:t,onToggle:i,closeControl:l="toggle"}){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm",className:"h-(--side-panel-tab-height) w-(--side-panel-tab-height)",onClick:r(()=>t(!e),"onClick"),"aria-label":e?"Restore side panel":"Maximize side panel",title:e?"Restore side panel":"Maximize side panel",children:e?(0,a.jsx)(XS,{"aria-hidden":!0}):(0,a.jsx)(tS,{"aria-hidden":!0})}),l==="close"?(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm",className:"h-(--side-panel-tab-height) w-(--side-panel-tab-height)",onClick:i,"aria-label":"Close side panel",title:"Close side panel",children:(0,a.jsx)(ia,{"aria-hidden":!0})}):(0,a.jsx)(E4,{open:!0,onToggle:i})]})}r(I4,"SidePanelWindowControls");function T4({sections:e,onSelect:t,placeholder:i,emptyMessage:l,panel:c}){return(0,a.jsxs)(uS,{className:G(c&&"border border-line shadow-sm"),children:[(0,a.jsx)(l0,{placeholder:i,"aria-label":i}),(0,a.jsxs)(c0,{className:G(c&&"max-h-none flex-1"),children:[(0,a.jsx)(o0,{children:l}),e.map((d,m)=>(0,a.jsxs)("div",{children:[m>0?(0,a.jsx)(Yi,{}):null,(0,a.jsxs)(qs,{heading:d.label,children:[d.loading?(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-ink-3",role:"status",children:[(0,a.jsx)(za,{className:"size-4 animate-spin","aria-hidden":!0}),"Loading…"]}):null,d.error?(0,a.jsxs)("div",{className:"flex items-start gap-2 px-2 py-3 text-sm text-ink-3",role:"status",children:[(0,a.jsx)(Gk,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{children:d.error})]}):null,d.items.map(f=>(0,a.jsxs)(jn,{value:`${f.label} ${f.description??""} ${f.searchText??""}`,disabled:f.disabled,title:f.disabledReason,onSelect:r(()=>t(f),"onSelect"),className:"min-h-10",children:[f.icon?(0,a.jsx)("span",{className:"flex size-4 shrink-0 items-center justify-center",children:f.icon}):null,(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate",children:f.label}),f.description||f.disabledReason?(0,a.jsx)("span",{className:"block truncate text-xs text-ink-3",children:f.disabledReason??f.description}):null]}),f.alreadyOpen?(0,a.jsx)(_s,{className:"size-4 text-ink-3","aria-label":"Already open"}):null,f.shortcut?(0,a.jsx)(w3,{children:f.shortcut}):null]},f.id))]})]},d.id))]})]})}r(T4,"LauncherContent");function tW({sections:e,onSelect:t,presentation:i="panel",trigger:l,open:c,onOpenChange:d,title:m="Open a side panel tab",description:f="Choose a view or resource to open.",placeholder:h="Search tabs and resources…",emptyMessage:g="No matching tabs or resources.",className:v}){const[y,j]=(0,b.useState)(!1),k=c??y,N=d??j,S=(0,a.jsx)(T4,{sections:e,onSelect:r(D=>{t(D),i==="popover"&&N(!1)},"onSelect"),placeholder:h,emptyMessage:g,panel:i==="panel"});return i==="popover"?l?(0,a.jsxs)(xs,{open:k,onOpenChange:N,children:[(0,a.jsx)(hs,{asChild:!0,children:l}),(0,a.jsxs)(gs,{align:"start",className:G("w-(--side-panel-launcher-width) overflow-hidden p-0",v),children:[(0,a.jsxs)("div",{className:"sr-only",children:[(0,a.jsx)("h2",{children:m}),(0,a.jsx)("p",{children:f})]}),S]})]}):null:(0,a.jsxs)("div",{className:G("mx-auto flex h-full w-full max-w-xl flex-col justify-center gap-4 p-4",v),children:[(0,a.jsxs)("div",{className:"space-y-1 text-center",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:m}),(0,a.jsx)("p",{className:"text-sm text-ink-3",children:f})]}),S]})}r(tW,"SidePanelLauncher");function R4({id:e,label:t,ariaLabel:i,icon:l,status:c,active:d,closable:m=!0,disabled:f=!1,tabRef:h,dragHandleProps:g,onSelect:v,onClose:y,onAuxClick:j,onKeyDown:k,appearance:N="default",className:S}){const D=`Close ${t}`,R=(0,b.useRef)(null),E=(0,b.useRef)(null),[C,I]=(0,b.useState)(!1),O=`${N}:${t}:${l?"icon":"no-icon"}:${c?"status":"no-status"}:${m?"closable":"fixed"}`,[z,B]=(0,b.useState)(null),L=z?.key===O;return(0,b.useLayoutEffect)(()=>{if(N==="streamlined-task"||L)return;const _=R.current?.getBoundingClientRect().width??0;_<=0||B({key:O,width:Math.ceil(_)})},[L,O]),(0,b.useEffect)(()=>{const _=E.current;if(!_)return;const U=r(()=>{I(_.scrollWidth>_.clientWidth)},"updateTruncation");if(U(),typeof ResizeObserver>"u")return;const F=new ResizeObserver(U);return F.observe(_),()=>F.disconnect()},[t]),(0,a.jsxs)("div",{ref:R,"data-side-panel-tab-wrapper":e,"data-active":d?"true":"false","data-appearance":N,style:N==="default"&&L?{width:z.width}:void 0,className:G(N==="streamlined-task"?"group/side-panel-tab relative mx-1.5 flex h-7 min-w-0 flex-1 basis-0 items-center rounded-md border border-transparent":"group/side-panel-tab relative flex h-(--side-panel-tab-height) min-w-0 shrink-0 items-center rounded-(--side-panel-tab-radius) border border-transparent","side-panel-tab-motion",d?N==="streamlined-task"?"text-ink hover:bg-bg-3/50":"bg-(--side-panel-tab-active-bg) text-ink":N==="streamlined-task"?"text-ink-3 hover:bg-bg-3/50 hover:text-ink":"text-ink-3 hover:bg-(--side-panel-tab-hover-bg) hover:text-ink",f&&"opacity-50",S),children:[(0,a.jsxs)(As,{open:C?void 0:!1,children:[(0,a.jsx)(Ns,{asChild:!0,children:(0,a.jsxs)("button",{...g,ref:h,type:"button",role:"tab","data-side-panel-tab-target":e,"data-side-panel-tab-tooltip":C?"enabled":"disabled",id:`side-panel-tab-${e}`,"aria-controls":`side-panel-content-${e}`,"aria-selected":d,"aria-label":i??t,tabIndex:d?0:-1,disabled:f,onClick:v,onAuxClick:j,onKeyDown:k,className:G(N==="streamlined-task"?"flex h-full w-full min-w-0 items-center justify-start rounded-md px-3 text-sm font-medium outline-none":"flex h-full w-full min-w-0 items-center gap-1.5 rounded-(--side-panel-tab-radius) py-1.5 pl-2 text-xs font-medium outline-none",N==="default"&&(m&&(!L||d)?"pr-7":"pr-2.5"),"focus-visible:ring-2 focus-visible:ring-focus/60",g?.className),children:[l&&N==="default"?(0,a.jsx)("span",{className:"flex size-3.5 shrink-0 items-center justify-center [&_svg]:size-3.5",children:l}):null,(0,a.jsx)("span",{ref:E,"data-truncated":C?"true":void 0,className:G(N==="streamlined-task"?"side-panel-tab-label-close-fade task-detail-pane-tab-label min-w-0 flex-1 overflow-hidden whitespace-nowrap text-center":"overflow-hidden whitespace-nowrap",N==="default"&&(m&&L&&!d?"max-w-(--side-panel-tab-label-expanded-max-width)":"max-w-(--side-panel-tab-label-max-width)"),N==="default"&&C&&"side-panel-tab-label-fade"),children:t}),c?(0,a.jsx)("span",{className:G("flex shrink-0 items-center",N==="streamlined-task"&&"transition-opacity group-hover/side-panel-tab:opacity-0 group-focus-within/side-panel-tab:opacity-0"),children:c}):null]})}),C?(0,a.jsx)(Cs,{side:"bottom",children:t}):null]}),m&&y&&(N==="streamlined-task"||d)?(0,a.jsx)("button",{type:"button","aria-label":D,title:D,onPointerDown:r(_=>{N==="streamlined-task"&&(_.preventDefault(),_.stopPropagation())},"onPointerDown"),onClick:r(_=>{_.stopPropagation(),y()},"onClick"),className:G("side-panel-tab-close-motion absolute flex items-center justify-center text-ink-3 outline-none hover:text-ink",N==="streamlined-task"?"right-0 top-1/2 z-20 size-5 pointer-coarse:size-6 -translate-y-1/2 rounded-sm opacity-0 hover:bg-bg-3 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-focus/60 group-hover/side-panel-tab:opacity-100":"right-1 size-6 rounded-lg hover:bg-bg/70 focus-visible:ring-2 focus-visible:ring-focus/60"),children:(0,a.jsx)(ia,{className:N==="streamlined-task"?"size-3.5":"size-3","aria-hidden":!0})}):null]})}r(R4,"SidePanelTab");function D4({tab:e,active:t,appearance:i,fillAvailableWidth:l,showLeadingSeparator:c,onSelect:d,onClose:m,onAuxClick:f,onKeyDown:h}){const g=E0({id:e.id,disabled:e.disabled});return(0,a.jsxs)("div",{ref:g.setNodeRef,style:{transform:Ws.Transform.toString(g.transform),transition:g.transition},className:G(i==="streamlined-task"?G("relative flex flex-1 items-center",l?"min-w-0 max-w-none basis-auto":"min-w-(--side-panel-streamlined-tab-min-width) max-w-(--side-panel-streamlined-tab-max-width) basis-0"):"relative",g.isDragging&&"z-20 opacity-80"),children:[c?(0,a.jsx)("span",{"aria-hidden":!0,"data-side-panel-tab-separator":"true",className:G("pointer-events-none absolute w-px bg-line",i==="streamlined-task"?"left-0 top-1/2 h-4 -translate-y-1/2":"inset-y-2 -left-0.5 bg-line/60")}):null,(0,a.jsx)(R4,{id:e.id,label:e.label,ariaLabel:e.ariaLabel,icon:e.icon,status:e.status,active:t,appearance:i,closable:e.closable,disabled:e.disabled,tabRef:g.setActivatorNodeRef,dragHandleProps:{...g.attributes,...g.listeners},onSelect:d,onClose:m,onAuxClick:f,onKeyDown:h})]})}r(D4,"SortableSidePanelTab");function nW({tabs:e,activeTabId:t,onActiveTabChange:i,onCloseTab:l,onReorderTabs:c,onAddTab:d,addControl:m,addLabel:f="Open a new tab",appearance:h="default",className:g}){const[v,y]=(0,b.useState)(""),[j,k]=(0,b.useState)(!1),N=(0,b.useRef)(null),S=(0,b.useRef)(null),D=(0,b.useRef)(null),R=j0(hc(_f,{activationConstraint:{distance:4}}),hc(k0,{coordinateGetter:xL})),E=(0,b.useMemo)(()=>e.map(L=>L.id),[e]);function C(L,_){const U=_==="wrapper"?"data-side-panel-tab-wrapper":"data-side-panel-tab-target";return Array.from(N.current?.querySelectorAll(`[${U}]`)??[]).find(F=>F.getAttribute(U)===L)??null}r(C,"findTabElement"),(0,b.useEffect)(()=>{if(!t)return;const L=C(t,"wrapper"),_=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;L?.scrollIntoView({behavior:_?"auto":"smooth",block:"nearest",inline:"nearest"})},[t]),(0,b.useEffect)(()=>{const L=N.current;if(!L||h!=="streamlined-task"){k(!1);return}const _=r(()=>{const F=L.scrollWidth-L.clientWidth-L.scrollLeft;k(F>1)},"updateEndFade");_(),L.addEventListener("scroll",_,{passive:!0});const U=typeof ResizeObserver>"u"?null:new ResizeObserver(_);return U?.observe(L),L.firstElementChild&&U?.observe(L.firstElementChild),()=>{L.removeEventListener("scroll",_),U?.disconnect()}},[h,E]);function I(L){window.requestAnimationFrame(()=>{if(!L){S.current?.focus(),D.current?.querySelector("button, [href], input, [tabindex]:not([tabindex='-1'])")?.focus();return}C(L,"target")?.focus()})}r(I,"focusTab");function O(L){const _=E.indexOf(L),U=E[_+1]??E[_-1]??null;l(L),y(U?"Tab closed.":"Last tab closed. Choose something to open."),I(U)}r(O,"closeTab");function z(L,_){const U=E.indexOf(_);if(U<0)return;if(L.altKey&&L.shiftKey&&(L.key==="ArrowLeft"||L.key==="ArrowRight")){if(!c)return;L.preventDefault();const se=L.key==="ArrowLeft"?U-1:U+1;if(se<0||se>=E.length)return;const me=[...E],[oe]=me.splice(U,1);me.splice(se,0,oe),c(me),y(`Moved ${e[U]?.label??"tab"} to position ${se+1} of ${e.length}.`),I(_);return}const F=L.key==="ArrowLeft"?Math.max(0,U-1):L.key==="ArrowRight"?Math.min(E.length-1,U+1):L.key==="Home"?0:L.key==="End"?E.length-1:-1;if(F<0||F===U)return;L.preventDefault();const Y=E[F];i(Y),I(Y)}r(z,"handleKeyDown");function B(L){if(!c||!L.over||L.active.id===L.over.id)return;const _=E.indexOf(String(L.active.id)),U=E.indexOf(String(L.over.id));if(_<0||U<0)return;const F=[...E],[Y]=F.splice(_,1);F.splice(U,0,Y),c(F),y(`Moved ${e[_]?.label??"tab"} to position ${U+1} of ${e.length}.`)}return r(B,"handleDragEnd"),(0,a.jsxs)("div",{className:G("flex min-w-0 flex-1 items-center",h==="streamlined-task"?"gap-0":"gap-1",g),children:[(0,a.jsx)("div",{ref:N,role:"tablist","aria-orientation":"horizontal","data-scroll-end-fade":h==="streamlined-task"&&j?"true":void 0,className:G("side-panel-tabs-scroll min-w-0 flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",h==="streamlined-task"?"overflow-x-auto overscroll-x-contain":"overflow-x-auto"),children:(0,a.jsx)(C0,{sensors:R,collisionDetection:yN,onDragEnd:B,children:(0,a.jsx)(_0,{items:E,strategy:rL,children:(0,a.jsx)("div",{className:G("flex items-center",h==="streamlined-task"?e.length===1?"w-full gap-0":"w-max min-w-full gap-0":"min-w-max gap-1 py-1"),children:e.map((L,_)=>(0,a.jsx)(D4,{tab:L,active:L.id===t,appearance:h,fillAvailableWidth:h==="streamlined-task"&&e.length===1,showLeadingSeparator:h==="streamlined-task"?_>0:_>0&&L.id!==t&&e[_-1]?.id!==t,onSelect:r(()=>i(L.id),"onSelect"),onClose:r(()=>O(L.id),"onClose"),onAuxClick:r(U=>{U.button!==1||L.closable===!1||(U.preventDefault(),O(L.id))},"onAuxClick"),onKeyDown:r(U=>z(U,L.id),"onKeyDown")},L.id))})})})}),m?(0,a.jsx)("div",{ref:D,className:"shrink-0",children:m}):d?(0,a.jsx)(pe,{ref:S,type:"button",variant:"ghost",size:"icon-sm",onClick:d,"aria-label":f,title:f,className:G("shrink-0",h==="streamlined-task"?"h-(--side-panel-tab-height) w-(--side-panel-tab-height) rounded-md":"h-(--side-panel-tab-height) w-(--side-panel-tab-height) rounded-(--side-panel-control-radius)"),children:(0,a.jsx)(Xa,{"aria-hidden":!0})}):null,(0,a.jsx)("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:v})]})}r(nW,"SidePanelTabs");function aW({tabs:e,activeTabId:t,onActiveTabChange:i,onCloseTab:l,addControl:c}){const[d,m]=(0,b.useState)(!1),f=(0,b.useRef)(null),h=(0,b.useRef)(null),g=e.find(y=>y.id===t);function v(y,j){const k=e.filter(D=>!D.disabled),N=k.findIndex(D=>D.id===j);let S;switch(y.key){case"ArrowDown":S=(N+1)%k.length;break;case"ArrowUp":S=(N-1+k.length)%k.length;break;case"Home":S=0;break;case"End":S=k.length-1;break;default:return}y.preventDefault(),f.current?.querySelectorAll("[data-mobile-tab-select]:not(:disabled)")[S]?.focus()}return r(v,"moveFocus"),(0,a.jsxs)("div",{ref:h,className:"flex min-w-0 flex-1 items-center gap-1",children:[(0,a.jsxs)(xs,{open:d,onOpenChange:m,children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsxs)(pe,{variant:"ghost",className:"h-(--sz-44px) min-w-0 flex-1 justify-start gap-2 px-2","aria-label":`Switch tabs, ${e.length} open`,disabled:e.length===0,children:[(0,a.jsx)("span",{id:g?`side-panel-tab-${g.id}`:void 0,className:"min-w-0 flex-1 truncate text-left",children:g?.label??"Choose a tab"}),(0,a.jsx)("span",{className:"shrink-0 rounded-md bg-bg-3 px-1.5 py-0.5 text-xs text-ink-3",children:e.length}),(0,a.jsx)($r,{"aria-hidden":!0,className:"shrink-0"})]})}),(0,a.jsxs)(gs,{"aria-label":"Open tabs",align:"start",className:"w-(--side-panel-mobile-tabs-width) max-w-(--radix-popover-content-available-width) p-2",onOpenAutoFocus:r(y=>{y.preventDefault();const j=f.current?.querySelectorAll("[data-mobile-tab-select]:not(:disabled)");(Array.from(j??[]).find(k=>k.dataset.mobileTabSelect===t)??j?.[0])?.focus()},"onOpenAutoFocus"),onCloseAutoFocus:r(y=>{if(e.length!==0)return;const j=h.current?.querySelector('[aria-label="Open a new tab"]');j&&(y.preventDefault(),j.focus())},"onCloseAutoFocus"),children:[(0,a.jsx)("p",{className:"px-2 py-2 text-xs font-medium text-ink-3",children:"Open tabs"}),(0,a.jsx)("ul",{ref:f,"aria-label":"Open tabs",className:"max-h-(--side-panel-mobile-tabs-max-height) overflow-y-auto overscroll-contain",children:e.map(y=>(0,a.jsxs)("li",{className:G("flex items-center rounded-md",y.id===t&&"bg-bg-3"),children:[(0,a.jsxs)("button",{type:"button","data-mobile-tab-select":y.id,disabled:y.disabled,"aria-current":y.id===t?"true":void 0,"aria-label":y.ariaLabel??y.label,onKeyDown:r(j=>v(j,y.id),"onKeyDown"),onClick:r(()=>{i(y.id),m(!1)},"onClick"),className:"flex min-h-(--sz-44px) min-w-0 flex-1 items-center gap-3 rounded-md px-2 py-3 text-left text-sm hover:bg-bg-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus disabled:opacity-50",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"shrink-0 text-ink-3 [&_svg]:size-4",children:y.icon}),(0,a.jsx)("span",{className:"min-w-0 flex-1 break-words",children:y.label}),y.id===t?(0,a.jsx)(_s,{"aria-hidden":!0,className:"size-4 shrink-0"}):null]}),y.closable!==!1?(0,a.jsx)(pe,{variant:"ghost",size:"icon",className:"size-(--sz-44px) shrink-0","aria-label":`Close ${y.label}`,disabled:y.disabled,onClick:r(()=>{const j=Array.from(f.current?.querySelectorAll("[data-mobile-tab-select]:not(:disabled)")??[]),k=j.findIndex(N=>N.dataset.mobileTabSelect===y.id);(j[k+1]??j[k-1])?.focus(),l(y.id),e.length===1&&m(!1)},"onClick"),children:(0,a.jsx)(ia,{"aria-hidden":!0})}):null]},y.id))})]})]}),c]})}r(aW,"SidePanelMobileTabs");function iC(e){const t=new Set,i=e.tabs.filter(l=>!l.id||!l.type||t.has(l.id)?!1:(t.add(l.id),!0));return{tabs:i,activeTabId:e.activeTabId&&t.has(e.activeTabId)?e.activeTabId:i[0]?.id??null}}r(iC,"normalizeSidePanelTabsState");function M4(e,t){switch(t.type){case"open":{const i=e.tabs.find(l=>l.id===t.tab.id);return i?t.activate===!1||e.activeTabId===i.id?e:{...e,activeTabId:i.id}:{tabs:[...e.tabs,t.tab],activeTabId:t.activate===!1?e.activeTabId:t.tab.id}}case"select":return e.activeTabId===t.tabId?e:e.tabs.some(i=>i.id===t.tabId)?{...e,activeTabId:t.tabId}:e;case"close":{const i=e.tabs.findIndex(c=>c.id===t.tabId);if(i<0)return e;const l=e.tabs.filter(c=>c.id!==t.tabId);return e.activeTabId!==t.tabId?{...e,tabs:l}:{tabs:l,activeTabId:l[i]?.id??l[i-1]?.id??null}}case"close-others":{const i=e.tabs.find(l=>l.id===t.tabId);return i?{tabs:[i],activeTabId:i.id}:e}case"reorder":{if(t.orderedTabIds.length!==e.tabs.length)return e;const i=new Map(e.tabs.map(c=>[c.id,c])),l=t.orderedTabIds.map(c=>i.get(c));return l.some(c=>!c)||new Set(t.orderedTabIds).size!==e.tabs.length?e:{...e,tabs:l}}case"update":{let i=!1;const l=e.tabs.map(c=>c.id!==t.tabId?c:(i=!0,{...c,...t.patch,id:c.id}));return i?{...e,tabs:l}:e}case"reset":return iC(t.state)}}r(M4,"sidePanelTabsReducer");function sW({initialState:e,onStateChange:t}){const[i,l]=(0,b.useReducer)(M4,e,iC);(0,b.useEffect)(()=>{t?.(i)},[t,i]);const c=(0,b.useCallback)((y,j=!0)=>{l({type:"open",tab:y,activate:j})},[]),d=(0,b.useCallback)(y=>l({type:"select",tabId:y}),[]),m=(0,b.useCallback)(y=>l({type:"close",tabId:y}),[]),f=(0,b.useCallback)(y=>l({type:"close-others",tabId:y}),[]),h=(0,b.useCallback)(y=>l({type:"reorder",orderedTabIds:y}),[]),g=(0,b.useCallback)((y,j)=>l({type:"update",tabId:y,patch:j}),[]),v=(0,b.useCallback)(y=>l({type:"reset",state:y}),[]);return{...i,openTab:c,selectTab:d,closeTab:m,closeOtherTabs:f,reorderTabs:h,updateTab:g,resetTabs:v}}r(sW,"useSidePanelTabs");function O4({taskDetailLayout:e=!1}){const{panelContent:t,panelContentMode:i,panelVisible:l,setPanelVisible:c,panelMaximizeRequested:d,clearPanelMaximizeRequest:m}=T0(),f=e;return t?(0,a.jsx)(W4,{panelContent:t,panelContentMode:i,panelVisible:l,setPanelVisible:c,taskDetailLayout:f,maximizeRequested:d,clearMaximizeRequest:m},f?"task-detail":"default"):null}r(O4,"PropertiesPanel");var L4="properties-pane-header-slot",z4="properties-pane-footer-slot",P4="taskChatRedesign.propertiesPaneWidth",U4="taskChatRedesign.taskDetailPropertiesPaneWidth",$4=320,B4=434,Rj=260,K4=656,q4=840,F4=400;function Dj(e){const t=typeof window>"u"?Number.POSITIVE_INFINITY:Math.max(Rj,window.innerWidth-K4);return Math.min(Math.max(Math.round(e),Rj),t)}r(Dj,"clampPaneWidth");function H4(e,t){if(typeof window>"u")return t;try{const i=window.localStorage.getItem(e),l=i===null?NaN:Number(i);return Number.isFinite(l)?l:t}catch{return t}}r(H4,"readStoredPaneWidth");function V4(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(t))}catch{}}r(V4,"persistPaneWidth");function Q4(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}}r(Q4,"clearStoredPaneWidth");function Mj(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}r(Mj,"prefersReducedMotion");function W4({panelContent:e,panelContentMode:t,panelVisible:i,setPanelVisible:l,taskDetailLayout:c,maximizeRequested:d,clearMaximizeRequest:m}){const f=c?B4:$4,h=c?U4:P4,[g,v]=(0,b.useState)(()=>Dj(H4(h,f))),[y,j]=(0,b.useState)(!1),[k,N]=(0,b.useState)(!1),[S,D]=(0,b.useState)(null),R=(0,b.useRef)(null),E=(0,b.useRef)(g);E.current=g;const C=(0,b.useRef)(null),I=(0,b.useRef)(""),O=(0,b.useRef)(null),z=(0,b.useCallback)(()=>{O.current!==null&&(window.clearTimeout(O.current),O.current=null)},[]),B=(0,b.useCallback)(()=>{z(),D(null)},[z]);(0,b.useEffect)(()=>{i||(N(!1),B())},[i,B]),(0,b.useEffect)(()=>()=>{O.current!==null&&window.clearTimeout(O.current),C.current!==null&&(document.body.style.userSelect=I.current)},[]);const L=(0,b.useCallback)(ae=>{C.current!==null&&(C.current=null,j(!1),document.body.style.userSelect=I.current,ae&&V4(h,E.current))},[h]),_=(0,b.useCallback)(ae=>{ae.pointerType==="mouse"&&ae.button!==0||(ae.preventDefault(),ae.currentTarget.setPointerCapture(ae.pointerId),C.current={pointerId:ae.pointerId,startX:ae.clientX,startWidth:E.current},I.current=document.body.style.userSelect,document.body.style.userSelect="none",j(!0))},[]),U=(0,b.useCallback)(ae=>{const Ce=C.current;Ce===null||Ce.pointerId!==ae.pointerId||v(Dj(Ce.startWidth+(Ce.startX-ae.clientX)))},[]),F=(0,b.useCallback)(ae=>{const Ce=C.current;Ce===null||Ce.pointerId!==ae.pointerId||L(!0)},[L]),Y=(0,b.useCallback)(()=>{L(!0)},[L]),se=(0,b.useCallback)(()=>{v(f),Q4(h)},[f,h]),me=(0,b.useCallback)(()=>{const ae=R.current,Ce=ae?.parentElement;if(!ae||!Ce)return;z(),N(!0);const ue=Ce.getBoundingClientRect();D(we=>{if(we)return{...we,left:we.parentLeft};const Ae=ae.getBoundingClientRect(),je={top:Ae.top,left:Ae.left,rightInset:Math.max(0,window.innerWidth-Ae.right),parentLeft:ue.left};return Mj()?{...je,left:je.parentLeft}:(window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{D(he=>he&&{...he,left:he.parentLeft})})}),je)})},[z]),oe=(0,b.useCallback)(()=>{const ae=R.current?.parentElement;if(N(!1),Mj()){B();return}D(Ce=>{if(!Ce)return Ce;const ue=ae?ae.getBoundingClientRect().right:window.innerWidth-Ce.rightInset;return{...Ce,left:ue-E.current}}),z(),O.current=window.setTimeout(B,F4)},[z,B]);(0,b.useEffect)(()=>{!d||!i||(m(),k||me())},[d,i,k,me,m]);const $=(0,b.useCallback)(ae=>{ae.target!==R.current||ae.propertyName!=="left"||k||B()},[k,B]),T=S!==null,te=OI(LI),ce=te?"100%":g;return(0,a.jsxs)(a.Fragment,{children:[T?(0,a.jsx)("div",{"aria-hidden":!0,className:"hidden md:block shrink-0",style:{width:i?g:0}}):null,(0,a.jsxs)("aside",{ref:R,className:G("hidden md:flex bg-bg-2 flex-col",!k&&"border-l border-line",T?"tc-pane-glide fixed z-40 overflow-hidden":G(te?"absolute inset-0 z-30 h-full":"relative h-full shrink-0",i?"overflow-visible":"overflow-hidden",!y&&"transition-(--tp-width-opacity) duration-200 ease-in-out")),style:T?{top:S.top,bottom:0,left:S.left,right:S.rightInset}:{width:i?ce:0,opacity:i?1:0},onTransitionEnd:$,children:[!T&&!te&&i?(0,a.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel","data-dragging":y?"":void 0,className:"group absolute inset-y-0 z-10 cursor-col-resize touch-none",style:{left:-4,width:8},onPointerDown:_,onPointerMove:U,onPointerUp:F,onPointerCancel:F,onLostPointerCapture:Y,onDoubleClick:se,children:(0,a.jsx)("div",{className:G("mx-auto h-full w-0.5 transition-colors",y?"bg-focus":"bg-transparent group-hover:bg-focus")})}):null,(0,a.jsx)("div",{className:G("flex-1 flex flex-col min-h-0",T&&"w-full"),style:T?void 0:{width:ce,minWidth:ce},children:(0,a.jsx)(_4,{presentation:"docked",maximized:k,contentMode:"full-bleed",headerSize:c?"task-detail":"default",className:"flex-1 border-l-0",header:(0,a.jsx)("div",{id:L4,className:"flex min-w-0 flex-1 items-center self-stretch"}),trailingControls:(0,a.jsx)(I4,{maximized:k,closeControl:c?"close":"toggle",onMaximizedChange:r(ae=>{ae?me():oe()},"onMaximizedChange"),onToggle:r(()=>l(!1),"onToggle")}),footer:(0,a.jsx)("div",{id:z4}),children:t==="full-bleed"?e:(0,a.jsx)(yE,{className:"h-full",children:(0,a.jsx)("div",{className:G("p-4",k&&"mx-auto w-full px-9"),style:k?{maxWidth:q4}:void 0,children:e})})})})]})]})}r(W4,"ResizablePropertiesPanel");function G4(e){return e?.enableCombinedInboxTasks===!0}r(G4,"resolveCombinedInboxTasksEnabled");var Oj=null;function Y4(){return Oj??=new uf,Oj}r(Y4,"getDetachedClient$1");function Tf(){const e=(0,b.useContext)($g),t=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn"),enabled:e!=null},e??Y4());return e?{enabled:G4(t.data),loaded:t.isFetched}:{enabled:!1,loaded:!0}}r(Tf,"useCombinedInboxTasksEnabled");var X4=["status","priority","assigneeAgentId","assigneeUserId","projectId","labelId","updatedWithin","updatedAfter"],Z4=["backlog","todo","in_progress","in_review","blocked"],J4=["done","cancelled"],R0=["title","id","desc","comment","doc","text"],ez=[{key:"title",label:"Title",description:"Match the task title",kind:"text"},{key:"id",label:"ID",description:"Exact task identifier",kind:"text"},{key:"desc",label:"Description",description:"Match the task description",kind:"text"},{key:"comment",label:"Comments",description:"Match task comments",kind:"text"},{key:"doc",label:"Documents",description:"Match task documents",kind:"text"},{key:"text",label:"All text",description:"Title, ID, description, comments and documents",kind:"text"},{key:"status",label:"Status",description:"Filter by status, open or closed",kind:"picker"},{key:"priority",label:"Priority",description:"Filter by priority",kind:"picker"},{key:"assignee",label:"Assignee",description:"Filter by assignee",kind:"picker"},{key:"label",label:"Label",description:"Filter by label",kind:"picker"},{key:"project",label:"Project",description:"Filter by project",kind:"picker"},{key:"author",label:"Author",description:"Filter by who created the task",kind:"picker"},{key:"updated",label:"Updated",description:"Filter by last update",kind:"picker"}],tz=["assignee:me","is:open","updated:>7d"];function xc(e){return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}r(xc,"stripValueQuotes");function D0(e){const t=[];let i=0;for(;i<e.length;){for(;/\s/.test(e[i]??"");)i+=1;if(i>=e.length)break;const l=i;if(e[i]==='"'){for(i+=1;i<e.length&&e[i]!=='"';)i+=1;e[i]==='"'&&(i+=1);const d=e.slice(l,i);t.push({raw:d,value:d});continue}for(;i<e.length&&!/\s/.test(e[i]??"");){if(e[i]===":"&&e[i+1]==='"'){for(i+=2;i<e.length&&e[i]!=='"';)i+=1;e[i]==='"'&&(i+=1);break}i+=1}const c=e.slice(l,i);t.push({raw:c,value:c})}return t}r(D0,"tokenizeQuery");function eh(e){let t=0,i=!1;for(let l=0;l<e.length;l+=1){const c=e[l];c==='"'?i=!i:!i&&/\s/.test(c)&&(t=l+1)}return{start:t,token:e.slice(t)}}r(eh,"currentSearchToken");function nz(e){const t=e.replace(/"/g,"").trim();return/[\s:]/.test(t)?`"${t}"`:t}r(nz,"quoteSearchValue");function zr(e,t){return`${e}:${nz(t)}`}r(zr,"formatSearchToken");var rC=["status","priority","assignee","label","project","author","updated","is"];function az(e,t){const i=/^([a-zA-Z]+):(.+)$/s.exec(e);if(!i)return!1;const l=i[1].toLowerCase();if(!R0.includes(l)&&!t.includes(l))return!1;const c=i[2];return c.startsWith('"')&&(c.length<2||!c.endsWith('"'))?!1:xc(c).trim().length>0}r(az,"isCompleteScopedToken");function Wo(e,t=rC,i=!1){const l=D0(e),c=[],d=[];return l.forEach((m,f)=>{const h=f===l.length-1;!(i&&h)&&az(m.raw,t)?c.push(m.raw):d.push(m.raw)}),{tokens:c,text:d.join(" ")}}r(Wo,"splitSearchInput");function sz(e,t={}){const i=Fl(e,t).pills[0];if(i)return i;const l=/^([a-zA-Z]+):(.*)$/s.exec(e);return{key:l?.[1]?.toLowerCase()??"text",value:xc(l?.[2]??e),label:e}}r(sz,"searchTokenPill");function th(e){return j_(e)??e.trim().toLowerCase()}r(th,"normalizedLookup");function Xu(e,t){const i=th(t);return e?.find(l=>l.id===t||th(l.name)===i?!0:l.urlKey?th(l.urlKey)===i:!1)??null}r(Xu,"findByNameOrId");function Lj(e,t){return e?.includes(t)?e:[...e??[],t]}r(Lj,"addUnique");function Sa(e,t){t.trim().length>0&&e.push(t)}r(Sa,"appendText");function iz(e){return kc.includes(e)?e:null}r(iz,"parseStatus");function rz(e){return Pg.includes(e)?e:null}r(rz,"parsePriority");function lz(e){const t=e.startsWith(">")?e.slice(1):e;return/^[1-9]\d{0,2}(h|d|w|m)$/.test(t)?t:null}r(lz,"parseUpdatedWithin");function da(e,t){return`${e}:${t}`}r(da,"operatorLabel");function Fl(e,t={}){const i=[],l={},c=[];for(const d of D0(e)){const m=/^([a-zA-Z]+):(.*)$/s.exec(d.value);if(!m){Sa(i,d.raw);continue}const f=m[1].toLowerCase(),h=m[2],g=xc(h).trim();if(!g){Sa(i,d.raw);continue}if(R0.includes(f)){Sa(i,d.raw),c.push({key:f,value:g,label:da(f,g)});continue}if(t.operatorKeys&&!t.operatorKeys.includes(f)){Sa(i,d.raw);continue}if(f==="status"){const v=iz(g);if(!v){Sa(i,d.raw);continue}l.status=Lj(l.status,v),c.push({key:"status",value:v,label:da("status",v)});continue}if(f==="priority"){const v=rz(g);if(!v){Sa(i,d.raw);continue}l.priority=Lj(l.priority,v),c.push({key:"priority",value:v,label:da("priority",v)});continue}if(f==="assignee"){if(g.toLowerCase()==="me"){if(t.currentAgentId){l.assigneeAgentId=t.currentAgentId,c.push({key:"assignee",value:"me",label:"assignee:me"});continue}if(t.currentUserId){l.assigneeUserId=t.currentUserId,c.push({key:"assignee",value:"me",label:"assignee:me"});continue}Sa(i,d.raw);continue}if(g.toLowerCase()==="none"){l.assigneeAgentId=null,c.push({key:"assignee",value:"none",label:"assignee:none"});continue}const v=Xu(t.agents,g);if(!v){Sa(i,d.raw);continue}l.assigneeAgentId=v.id,c.push({key:"assignee",value:v.name,label:da("assignee",v.name)});continue}if(f==="author"){if(g.toLowerCase()==="me"){if(t.currentAgentId){l.createdByAgentId=t.currentAgentId,c.push({key:"author",value:"me",label:"author:me"});continue}if(t.currentUserId){l.createdByUserId=t.currentUserId,c.push({key:"author",value:"me",label:"author:me"});continue}Sa(i,d.raw);continue}const v=Xu(t.agents,g);if(!v){Sa(i,d.raw);continue}l.createdByAgentId=v.id,c.push({key:"author",value:v.name,label:da("author",v.name)});continue}if(f==="project"){const v=Xu(t.projects,g);if(!v){Sa(i,d.raw);continue}l.projectId=v.id,c.push({key:"project",value:v.name,label:da("project",v.name)});continue}if(f==="label"){const v=Xu(t.labels,g);if(v){l.labelId=v.id,c.push({key:"label",value:v.name,label:da("label",v.name)});continue}if(_h(g)){l.labelId=g,c.push({key:"label",value:g,label:da("label",g.slice(0,8))});continue}Sa(i,d.raw);continue}if(f==="updated"){const v=lz(g);if(!v){Sa(i,d.raw);continue}l.updatedWithin=v,c.push({key:"updated",value:`>${v}`,label:da("updated",`>${v}`)});continue}if(f==="is"){if(g==="open"){l.status=Z4,c.push({key:"is",value:"open",label:"is:open"});continue}if(g==="closed"){l.status=J4,c.push({key:"is",value:"closed",label:"is:closed"});continue}Sa(i,d.raw);continue}Sa(i,d.raw)}return{query:i.join(" ").replace(/\s+/g," ").trim(),filters:l,pills:c}}r(Fl,"parseSearchQuery");function zj(e,t,i){for(const l of i??[])e.append(t,l)}r(zj,"appendMulti");function oz(e){for(const t of X4)e.delete(t)}r(oz,"clearSearchFilterParams");function cz(e,t){oz(e),zj(e,"status",t.status),zj(e,"priority",t.priority),t.assigneeAgentId!==void 0&&e.set("assigneeAgentId",t.assigneeAgentId??"null"),t.assigneeUserId!==void 0&&e.set("assigneeUserId",t.assigneeUserId),t.projectId!==void 0&&e.set("projectId",t.projectId),t.labelId!==void 0&&e.set("labelId",t.labelId),t.updatedWithin!==void 0&&e.set("updatedWithin",t.updatedWithin),t.updatedAfter!==void 0&&e.set("updatedAfter",t.updatedAfter)}r(cz,"applySearchFiltersToParams");function Pj(e,t){return e.filter(i=>t.includes(i))}r(Pj,"validValues");function iW(e){const t={},i=Pj(e.getAll("status").flatMap(v=>v.split(",")),kc),l=Pj(e.getAll("priority").flatMap(v=>v.split(",")),Pg),c=e.get("assigneeAgentId"),d=e.get("assigneeUserId"),m=e.get("projectId"),f=e.get("labelId"),h=e.get("updatedWithin"),g=e.get("updatedAfter");return i.length>0&&(t.status=i),l.length>0&&(t.priority=l),c!==null&&(t.assigneeAgentId=c==="null"?null:c),d&&(t.assigneeUserId=d),m&&_h(m)&&(t.projectId=m),f&&_h(f)&&(t.labelId=f),h&&(/^[1-9]\d{0,2}(h|d|w|m)$/.test(h)||hk.includes(h))&&(t.updatedWithin=h),g&&!Number.isNaN(new Date(g).getTime())&&(t.updatedAfter=g),t}r(iW,"readSearchFiltersFromParams");function lC(e){return!!(e.status?.length||e.priority?.length||e.assigneeAgentId!==void 0||e.assigneeUserId||e.projectId||e.labelId||e.updatedWithin||e.updatedAfter||e.createdByAgentId||e.createdByUserId)}r(lC,"hasSearchFilters");var uz={h:1,d:24,w:168,m:720};function oC(e,t=new Date){const i=/^(\d+)(h|d|w|m)$/.exec(e);if(!i)return null;const l=Number.parseInt(i[1],10)*uz[i[2]];return new Date(t.getTime()-l*60*60*1e3).toISOString()}r(oC,"updatedWithinToSince");function cC(e,t=new Date){const i={};e.status?.length&&(i.status=e.status.join(",")),e.priority?.length&&(i.priority=e.priority.join(",")),e.assigneeAgentId!==void 0&&(i.assigneeAgentId=e.assigneeAgentId??"null"),e.assigneeUserId&&(i.assigneeUserId=e.assigneeUserId),e.projectId&&(i.projectId=e.projectId),e.labelId&&(i.labelId=e.labelId),e.createdByAgentId&&(i.createdByAgentId=e.createdByAgentId),e.createdByUserId&&(i.createdByUserId=e.createdByUserId);const l=e.updatedAfter??(e.updatedWithin?oC(e.updatedWithin,t):null);return l&&(i.updatedSince=l),i}r(cC,"searchFiltersToIssueListParams");function dz(e){const t={};if(e.statuses.length>0&&(t.status=e.statuses.join(",")),e.priorities.length>0&&(t.priority=e.priorities.join(",")),e.labels.length>0&&(t.labelId=e.labels.join(",")),e.projects.length===1&&(t.projectId=e.projects[0]),e.assignees.length===1){const i=e.assignees[0];i==="__me"?t.assigneeUserId="me":i!=="__unassigned"&&(t.assigneeAgentId=i)}if(e.creators.length===1){const i=e.creators[0];i.startsWith("agent:")&&(t.createdByAgentId=i.slice(6)),i.startsWith("user:")&&(t.createdByUserId=i.slice(5))}return t}r(dz,"issueFilterStateToListParams");function uC(e){const t=[];for(const i of D0(e)){const l=/^([a-zA-Z]+):(.+)$/s.exec(i.value),c=l?.[1]?.toLowerCase();if(l&&c&&R0.includes(c)){const m=xc(l[2]).trim().toLowerCase();m&&t.push({field:c,value:m});continue}const d=xc(i.value).trim().toLowerCase();d&&t.push({field:null,value:d})}return t}r(uC,"localSearchTerms");function rW(e){return uC(e).map(t=>t.value).join(" ")}r(rW,"localSearchText");function fz(e,t){const i=e.title.toLowerCase(),l=(e.identifier??"").toLowerCase(),c=(e.description??"").toLowerCase();return t.every(d=>d.field==="title"?i.includes(d.value):d.field==="id"?l===d.value:d.field==="desc"?c.includes(d.value):i.includes(d.value)||l.includes(d.value)||c.includes(d.value))}r(fz,"issueMatchesLocalSearchTerms");function mz(e,t,i=new Date){if(t.status?.length&&!t.status.includes(e.status)||t.priority?.length&&!t.priority.includes(e.priority)||t.assigneeAgentId!==void 0&&(e.assigneeAgentId??null)!==t.assigneeAgentId||t.assigneeUserId&&e.assigneeUserId!==t.assigneeUserId||t.projectId&&e.projectId!==t.projectId||t.labelId&&!(e.labelIds??[]).includes(t.labelId)||t.createdByAgentId&&e.createdByAgentId!==t.createdByAgentId||t.createdByUserId&&e.createdByUserId!==t.createdByUserId)return!1;const l=t.updatedAfter??(t.updatedWithin?oC(t.updatedWithin,i):null);return!(l&&new Date(e.updatedAt).getTime()<new Date(l).getTime())}r(mz,"issueMatchesSearchFilters");function nh(e,t){return e?.find(i=>i.id===t)?.name??t.slice(0,8)}r(nh,"nameForId");function lW(e,t={}){const i=[];for(const l of e.status??[])i.push({key:"status",value:l,label:da("status",l)});for(const l of e.priority??[])i.push({key:"priority",value:l,label:da("priority",l)});if(e.assigneeAgentId!==void 0){const l=e.assigneeAgentId===null?"unassigned":nh(t.agents,e.assigneeAgentId);i.push({key:"assignee",value:l,label:da("assignee",l)})}if(e.assigneeUserId){const l=e.assigneeUserId===t.currentUserId?"me":e.assigneeUserId.slice(0,8);i.push({key:"assignee",value:l,label:da("assignee",l)})}if(e.projectId){const l=nh(t.projects,e.projectId);i.push({key:"project",value:l,label:da("project",l)})}if(e.labelId){const l=nh(t.labels,e.labelId);i.push({key:"label",value:l,label:da("label",l)})}return e.updatedWithin&&i.push({key:"updated",value:`>${e.updatedWithin}`,label:da("updated",`>${e.updatedWithin}`)}),e.updatedAfter&&i.push({key:"updated",value:e.updatedAfter,label:da("updated",e.updatedAfter)}),i}r(lW,"searchFilterPills");function pz(e,t={}){const i=Fl(e,t),l=new URLSearchParams;i.query.length>0&&l.set("q",i.query),cz(l,i.filters);const c=l.toString();return c?`/search?${c}`:"/search"}r(pz,"buildSearchPathFromQuery");var hz="__paperclip-search-all__";function gz(e,t={}){return pz(e,t)}r(gz,"buildFullSearchPath");var xz=/\/issues\/[^/?#]+(?:$|\?|#|\/)/;function bz(e){return xz.test(e)}r(bz,"isOnIssueDetail");var vz=5,yz=6,jz=10,Uj=20,wz=250;function kz(e,t){let i=0;for(let l=0;l<t.length&&i<e.length;l+=1)t[l]===e[i]&&(i+=1);return i===e.length}r(kz,"isSubsequence");function Sz(e,t,i){if(e===i)return 1e3;if(e.startsWith(i))return Math.max(700,900-e.length);const l=e.indexOf(i);return l>=0?700-l:t.includes(i)?400:kz(i,e)?200:null}r(Sz,"scoreProjectMatch");function Nz(){const[e,t]=(0,b.useState)(!1),[i,l]=(0,b.useState)(""),[c,d]=(0,b.useState)(""),m=xa(),f=vn(),{selectedCompanyId:h}=bt(),{openNewIssue:g,openNewAgent:v}=Ms(),{isMobile:y,setSidebarOpen:j}=Zn(),k=i.trim(),N=bz(f.pathname),{enabled:S}=Tf(),{hidden:D}=rr(),R=!D.has("instance.experimental"),{data:E}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn"),enabled:e});(0,b.useEffect)(()=>{function he(Te){Te.key==="k"&&(Te.metaKey||Te.ctrlKey)&&(Te.preventDefault(),t(!0),y&&j(!1))}return r(he,"handleKeyDown"),document.addEventListener("keydown",he),()=>document.removeEventListener("keydown",he)},[y,j]),(0,b.useEffect)(()=>{e||l("")},[e]),(0,b.useEffect)(()=>{if(i.trim().length===0){d("");return}const he=window.setTimeout(()=>d(i),wz);return()=>window.clearTimeout(he)},[i]);const{data:C=[]}=be({queryKey:P.agents.list(h),queryFn:r(()=>Pa.list(h),"queryFn"),enabled:!!h&&e}),{data:I=[]}=be({queryKey:P.projects.list(h),queryFn:r(()=>ir.list(h),"queryFn"),enabled:!!h&&e}),O=(0,b.useMemo)(()=>I,[I]),{data:z=[]}=be({queryKey:P.issues.labels(h),queryFn:r(()=>dn.listLabels(h),"queryFn"),enabled:!!h&&e}),{data:B}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),enabled:e}),L=B?.user?.id??B?.session?.userId??null,_=(0,b.useMemo)(()=>({currentUserId:L,agents:C,projects:O,labels:z}),[C,L,z,O]),U=(0,b.useMemo)(()=>Fl(i,_),[_,i]).query.trim(),F=(0,b.useMemo)(()=>Fl(c,_),[c,_]),Y=F.query.trim(),se=(0,b.useMemo)(()=>cC(F.filters),[F.filters]),me=Y.length>0||lC(F.filters),{data:oe=[]}=be({queryKey:[...P.issues.list(h),"command-palette-recent",Uj],queryFn:r(()=>dn.listCompact(h,{limit:Uj,sortField:"updated",sortDir:"desc"}),"queryFn"),enabled:!!h&&e&&k.length===0}),{data:$=[]}=be({queryKey:[...P.issues.search(h,Y,void 0,10),se],queryFn:r(()=>dn.listCompact(h,{...se,...Y.length>0?{q:Y}:{},limit:10,includeRoutineExecutions:!0}),"queryFn"),enabled:!!h&&e&&me,placeholderData:r(he=>he,"placeholderData")});function T(he){t(!1),m(he)}r(T,"go");function te(){T(gz(k,_))}r(te,"goFullSearch");const ce=r(he=>he?C.find(Te=>Te.id===he)?.name??null:null,"agentName"),ae=(0,b.useMemo)(()=>k.length===0?oe:me?$:[],[oe,me,$,k]),Ce=(0,b.useMemo)(()=>{if(U.length===0)return[];const he=U.toLowerCase();return O.map(Te=>({project:Te,score:Sz(Te.name.toLowerCase(),(Te.description??"").toLowerCase(),he)})).filter(Te=>Te.score!==null).sort((Te,Ve)=>Ve.score-Te.score).slice(0,vz).map(Te=>Te.project)},[O,U]),ue=k.length>0,we=ue&&Ce.length>0,Ae=we?yz:jz,je=ue&&ae.length===0&&Ce.length===0;return(0,a.jsxs)(k3,{open:e,onOpenChange:r(he=>{t(he),he&&y&&j(!1)},"onOpenChange"),children:[(0,a.jsx)(l0,{placeholder:"Search tasks, agents, projects...",value:i,onValueChange:l,onKeyDown:r(he=>{if(he.key==="Enter"&&(he.metaKey||he.ctrlKey)){he.preventDefault(),te();return}he.key==="Enter"&&je&&(he.preventDefault(),te())},"onKeyDown")}),(0,a.jsxs)(c0,{children:[(0,a.jsx)(o0,{children:ue?(0,a.jsxs)("span",{children:["No quick task matches. Press"," ",(0,a.jsx)("kbd",{className:"rounded border border-line bg-bg-3 px-1 py-0.5 text-(length:--text-nano)",children:"↵"})," ","to ",(0,a.jsx)("span",{className:"font-medium",children:"search all"})," or keep typing to refine."]}):"No results found."}),ue?(0,a.jsx)(qs,{heading:"Search",children:(0,a.jsxs)(jn,{value:`${hz} ${k}`,onSelect:te,className:"bg-bg-3/40 border border-bg-3 data-[selected=true]:bg-bg-3/60","data-testid":"command-search-all",children:[(0,a.jsx)(Br,{className:"mr-2 h-4 w-4"}),(0,a.jsxs)("span",{className:"flex-1 truncate",children:["Search all for ",(0,a.jsxs)("span",{className:"font-semibold",children:["“",k,"”"]})]}),(0,a.jsxs)("span",{className:"ml-auto inline-flex items-center gap-1 text-xs text-ink-3",children:[(0,a.jsx)("span",{children:"open full search"}),(0,a.jsx)("kbd",{className:"rounded border border-line bg-bg px-1 py-0.5 text-(length:--text-nano)",children:"↵"})]})]})}):null,ue?(0,a.jsx)(Yi,{}):null,(0,a.jsx)(qs,{heading:"Quick filters",children:tz.map(he=>(0,a.jsxs)(jn,{value:`quick-filter ${he}`,onSelect:r(()=>l(Te=>Te.trim()?`${Te.trim()} ${he}`:he),"onSelect"),"data-testid":"command-filter-chip",children:[(0,a.jsx)(Br,{className:"mr-2 h-4 w-4"}),(0,a.jsx)("span",{className:"font-mono text-xs",children:he})]},he))}),(0,a.jsx)(Yi,{}),we&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(qs,{heading:"Projects",children:Ce.map(he=>(0,a.jsxs)(jn,{value:`${k} ${he.name}`,onSelect:r(()=>T(cy(he)),"onSelect"),"data-testid":"command-project-match",children:[(0,a.jsx)(Mp,{className:"mr-2 h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"min-w-0 truncate",children:he.name}),he.description?(0,a.jsx)("span",{className:"ml-2 hidden min-w-0 flex-1 truncate text-xs text-ink-3 sm:inline",children:he.description}):null]},he.id))}),(0,a.jsx)(Yi,{})]}),(0,a.jsxs)(qs,{heading:"Actions",children:[(0,a.jsxs)(jn,{onSelect:r(()=>{t(!1),g()},"onSelect"),children:[(0,a.jsx)(p0,{className:"mr-2 h-4 w-4"}),"Create new task",(0,a.jsx)("span",{className:"ml-auto text-xs text-ink-3",children:"C"})]}),N&&(0,a.jsxs)(jn,{onSelect:r(()=>{t(!1),window.dispatchEvent(new CustomEvent("wardmote:open-file-viewer"))},"onSelect"),children:[(0,a.jsx)(Zk,{className:"mr-2 h-4 w-4"}),"Open file in this issue...",(0,a.jsx)("span",{className:"ml-auto text-xs text-ink-3",children:"g f"})]}),(0,a.jsxs)(jn,{onSelect:r(()=>{t(!1),v()},"onSelect"),children:[(0,a.jsx)(Xa,{className:"mr-2 h-4 w-4"}),"Create new agent"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T("/projects"),"onSelect"),children:[(0,a.jsx)(Xa,{className:"mr-2 h-4 w-4"}),"Create new project"]})]}),(0,a.jsx)(Yi,{}),(0,a.jsxs)(qs,{heading:"Pages",children:[(0,a.jsxs)(jn,{onSelect:r(()=>T("/dashboard"),"onSelect"),children:[(0,a.jsx)(Jg,{className:"mr-2 h-4 w-4"}),"Dashboard"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T(S?"/issues?view=mine":"/inbox"),"onSelect"),children:[(0,a.jsx)(Xg,{className:"mr-2 h-4 w-4"}),S?"My work":"Inbox"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T("/issues"),"onSelect"),children:[(0,a.jsx)(Td,{className:"mr-2 h-4 w-4"}),"Tasks"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T("/projects"),"onSelect"),children:[(0,a.jsx)(Mp,{className:"mr-2 h-4 w-4"}),"Projects"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T("/goals"),"onSelect"),children:[(0,a.jsx)(Qg,{className:"mr-2 h-4 w-4"}),"Goals"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T("/agents"),"onSelect"),children:[(0,a.jsx)(oc,{className:"mr-2 h-4 w-4"}),"Agents"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T("/costs"),"onSelect"),children:[(0,a.jsx)(ES,{className:"mr-2 h-4 w-4"}),"Costs"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T("/activity"),"onSelect"),children:[(0,a.jsx)(m0,{className:"mr-2 h-4 w-4"}),"Activity"]}),E?.enablePixelsOffice===!0?(0,a.jsxs)(jn,{onSelect:r(()=>T("/pixels-office"),"onSelect"),children:[(0,a.jsx)(uT,{className:"mr-2 h-4 w-4"}),"Pixels Office"]}):null,E?.enableConferenceRoomChat===!0?(0,a.jsxs)(jn,{onSelect:r(()=>T("/board-chat"),"onSelect"),children:[(0,a.jsx)(vT,{className:"mr-2 h-4 w-4"}),"Conference Room"]}):null,R?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(jn,{onSelect:r(()=>T("/company/settings/instance/features"),"onSelect"),children:[(0,a.jsx)(v1,{className:"mr-2 h-4 w-4"}),"Features"]}),(0,a.jsxs)(jn,{onSelect:r(()=>T("/company/settings/instance/advanced"),"onSelect"),children:[(0,a.jsx)(Hg,{className:"mr-2 h-4 w-4"}),"Advanced settings"]})]}):null]}),ae.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Yi,{}),(0,a.jsx)(qs,{heading:"Tasks",children:ae.slice(0,Ae).map(he=>(0,a.jsxs)(jn,{value:k.length>0?`${k} ${he.identifier??""} ${he.title}`:void 0,onSelect:r(()=>T(`/issues/${he.identifier??he.id}`),"onSelect"),children:[(0,a.jsx)(Td,{className:"mr-2 h-4 w-4"}),(0,a.jsx)("span",{className:"text-ink-3 mr-2 font-mono text-xs",children:he.identifier??he.id.slice(0,8)}),(0,a.jsx)("span",{className:"flex-1 truncate",children:he.title}),he.assigneeAgentId&&(()=>{const Te=ce(he.assigneeAgentId);return Te?(0,a.jsx)(ql,{agent:C?.find(Ve=>Ve.id===he.assigneeAgentId)??{id:he.assigneeAgentId,name:Te},size:"sm",className:"ml-2 hidden sm:inline-flex"}):null})()]},he.id))})]}),C.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Yi,{}),(0,a.jsx)(qs,{heading:"Agents",children:C.slice(0,10).map(he=>(0,a.jsxs)(jn,{onSelect:r(()=>T(gd(he)),"onSelect"),children:[(0,a.jsx)(oc,{className:"mr-2 h-4 w-4"}),he.name,(0,a.jsx)("span",{className:"text-xs text-ink-3 ml-2",children:he.role})]},he.id))})]}),O.length>0&&!ue&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Yi,{}),(0,a.jsx)(qs,{heading:"Projects",children:O.slice(0,10).map(he=>(0,a.jsxs)(jn,{onSelect:r(()=>T(cy(he)),"onSelect"),children:[(0,a.jsx)(Mp,{className:"mr-2 h-4 w-4"}),he.name]},he.id))})]})]})]})}r(Nz,"CommandPalette");function Cz(){const{hidden:e,loaded:t}=rr();return{visible:t&&!e.has("workspaces.isolation"),loaded:t}}r(Cz,"useWorkspaceIsolationControls");function Az(e){return{...e,items:e.items.map(t=>({...t,lastUpdatedAt:new Date(t.lastUpdatedAt),primaryService:t.primaryService?{...t.primaryService,updatedAt:new Date(t.primaryService.updatedAt)}:null,linkedIssues:t.linkedIssues.map(i=>({...i,updatedAt:new Date(i.updatedAt)}))}))}}r(Az,"normalizeWorkspaceOverview");var Rf={listOverview:r(async(e,t)=>{const i=new URLSearchParams;t?.projectId&&i.set("projectId",t.projectId),t?.status?.length&&i.set("status",t.status.join(",")),t?.limit!==void 0&&i.set("limit",String(t.limit)),t?.offset!==void 0&&i.set("offset",String(t.offset));const l=i.toString();return Az(await Re.get(`/companies/${e}/workspace-overview${l?`?${l}`:""}`))},"listOverview"),listSummaries:r((e,t)=>{const i=new URLSearchParams;t?.projectId&&i.set("projectId",t.projectId),t?.projectWorkspaceId&&i.set("projectWorkspaceId",t.projectWorkspaceId),t?.issueId&&i.set("issueId",t.issueId),t?.status&&i.set("status",t.status),t?.reuseEligible&&i.set("reuseEligible","true"),i.set("summary","true");const l=i.toString();return Re.get(`/companies/${e}/execution-workspaces${l?`?${l}`:""}`)},"listSummaries"),list:r((e,t)=>{const i=new URLSearchParams;t?.projectId&&i.set("projectId",t.projectId),t?.projectWorkspaceId&&i.set("projectWorkspaceId",t.projectWorkspaceId),t?.issueId&&i.set("issueId",t.issueId),t?.status&&i.set("status",t.status),t?.reuseEligible&&i.set("reuseEligible","true");const l=i.toString();return Re.get(`/companies/${e}/execution-workspaces${l?`?${l}`:""}`)},"list"),get:r(e=>Re.get(`/execution-workspaces/${e}`),"get"),getCloseReadiness:r(e=>Re.get(`/execution-workspaces/${e}/close-readiness`),"getCloseReadiness"),listWorkspaceOperations:r(e=>Re.get(`/execution-workspaces/${e}/workspace-operations`),"listWorkspaceOperations"),controlRuntimeServices:r((e,t,i={})=>Re.post(`/execution-workspaces/${e}/runtime-services/${t}`,yy(i)),"controlRuntimeServices"),controlRuntimeCommands:r((e,t,i={})=>Re.post(`/execution-workspaces/${e}/runtime-commands/${t}`,yy(i)),"controlRuntimeCommands"),repair:r(e=>Re.post(`/execution-workspaces/${e}/runtime-commands/repair`,{}),"repair"),requestLoginHandoff:r((e,t)=>Re.post(`/execution-workspaces/${e}/login-handoff`,t?{next:t}:{}),"requestLoginHandoff"),update:r((e,t)=>Re.patch(`/execution-workspaces/${e}`,t),"update"),reconcile:r((e,t)=>Re.post(`/execution-workspaces/${e}/reconcile-branch`,t),"reconcile")},_z="text-violet-700 dark:text-violet-300",Ez="border-violet-500/30",Iz="bg-violet-500/10";function Tz({className:e,label:t="User secret"}){return(0,a.jsxs)(Bn,{variant:"outline",className:G("text-(length:--text-micro)",Ez,Iz,_z,e),children:[(0,a.jsx)(II,{className:"h-3 w-3"}),t]})}r(Tz,"UserSecretChip");function oW(e){switch(e){case"set":return"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300";case"not_set":return"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-300";case"inactive":return"border-bg-3 bg-bg-3 text-ink-3"}}r(oW,"myValueTone");function cW(e){switch(e){case"set":return"Value set";case"not_set":return"Not set";case"inactive":return"Disabled"}}r(cW,"myValueLabel");function uW(e){if(!e)return"—";const t=e.configuredCount+e.missingCount+e.inactiveCount;return`${e.configuredCount} of ${t} set`}r(uW,"coverageSummaryLabel");function Rz({companyId:e,definition:t,existingSecret:i,open:l,onOpenChange:c,onSaved:d}){const m=Rn(),{pushToast:f}=Si(),[h,g]=(0,b.useState)(""),[v,y]=(0,b.useState)(""),[j,k]=(0,b.useState)(null),N=t?.managedMode==="external_reference";(0,b.useEffect)(()=>{l&&(g(""),y(""),k(null))},[l,t?.id]);const S=bn({mutationFn:r(async()=>{if(!t)throw new Error("No definition selected");const R=N?{externalRef:v.trim()}:{value:h.trim()};return i?Bh.rotateMyUserSecret(e,i.id,R):Bh.createMyUserSecret(e,{definitionId:t.id,definitionKey:t.key,...R})},"mutationFn"),onSuccess:r(R=>{m.invalidateQueries({queryKey:P.secrets.myUserSecrets(e)}),m.invalidateQueries({queryKey:P.secrets.userDefinitions(e)}),f({title:i?"Value updated":"Value saved",body:t?.name,tone:"success"}),d?.(R),c(!1)},"onSuccess"),onError:r(R=>{k(R instanceof ji||R instanceof Error?R.message:"Failed to save value")},"onError")}),D=N?v.trim().length>0:h.trim().length>0;return(0,a.jsx)(Ds,{open:l,onOpenChange:c,children:(0,a.jsxs)(Gs,{children:[(0,a.jsxs)(Sc,{children:[(0,a.jsxs)(Qs,{className:"flex items-center gap-2",children:[i?"Update your value":"Set your value",(0,a.jsx)(Tz,{})]}),(0,a.jsx)(Nc,{children:t?(0,a.jsxs)(a.Fragment,{children:["This value is yours only. It is used when you are the user responsible for a run that needs ",(0,a.jsx)("span",{className:"font-mono",children:t.key}),"."]}):null})]}),t?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"rounded-md border border-line bg-bg-3/20 p-3 text-xs",children:[(0,a.jsx)("div",{className:"font-medium text-ink",children:t.name}),t.description?(0,a.jsx)("p",{className:"mt-1 text-ink-3",children:t.description}):null,t.usageGuidance?(0,a.jsx)("p",{className:"mt-1 text-ink-3",children:t.usageGuidance}):null]}),N?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs font-medium text-ink",children:"External reference"}),(0,a.jsx)(aa,{value:v,onChange:r(R=>y(R.target.value),"onChange"),placeholder:"provider reference or ARN",className:"font-mono text-sm",autoFocus:!0}),(0,a.jsx)("p",{className:"text-(length:--text-micro) text-ink-3",children:"Points at your own credential in the configured provider. Wardmote stores the reference, not the value."})]}):(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"text-xs font-medium text-ink",children:"Your value"}),(0,a.jsx)(dS,{value:h,onChange:r(R=>g(R.target.value),"onChange"),placeholder:"Paste your token or credential",className:"font-mono text-sm min-h-(--sz-80px)",autoFocus:!0}),(0,a.jsx)("p",{className:"text-(length:--text-micro) text-ink-3",children:"Stored encrypted. Never shown back to anyone, including admins."})]}),j?(0,a.jsx)("p",{className:"text-xs text-bad",children:j}):null]}):null,(0,a.jsxs)(a0,{children:[(0,a.jsx)(pe,{variant:"ghost",onClick:r(()=>c(!1),"onClick"),disabled:S.isPending,children:"Cancel"}),(0,a.jsx)(pe,{onClick:r(()=>S.mutate(),"onClick"),disabled:!D||S.isPending,children:S.isPending?"Saving…":i?"Update value":"Save value"})]})]})})}r(Rz,"SetMyUserSecretDialog");function Dz({companyId:e,definitionKeys:t,title:i="Set your user secrets",secretsPath:l,className:c}){const[d,m]=(0,b.useState)(null),f=be({queryKey:P.secrets.myUserSecrets(e),queryFn:r(()=>Bh.listMyUserSecrets(e),"queryFn"),retry:!1}),h=t?new Set(t):null,g=(f.data??[]).filter(v=>v.definition.status==="active"&&!v.secret&&(!h||h.has(v.definition.key)));return g.length===0?null:(0,a.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-3 text-xs text-amber-800 dark:text-amber-200"+(c?` ${c}`:""),children:[(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(ki,{className:"mt-0.5 h-4 w-4 shrink-0"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"font-medium",children:i}),(0,a.jsxs)("p",{className:"mt-0.5 text-amber-700/90 dark:text-amber-300/90",children:[g.length," user secret",g.length===1?"":"s"," you are responsible for",g.length===1?" has":" have"," no value yet. Runs that require",g.length===1?" it":" them"," will fail until you set your value."]}),(0,a.jsx)("ul",{className:"mt-2 space-y-1.5",children:g.map(v=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded border border-amber-500/30 bg-bg/40 px-2 py-1",children:[(0,a.jsxs)("span",{className:"min-w-0 truncate",children:[(0,a.jsx)("span",{className:"font-medium text-ink",children:v.definition.name})," ",(0,a.jsx)("code",{className:"text-(length:--text-micro) text-ink-3",children:v.definition.key})]}),(0,a.jsx)(pe,{size:"sm",onClick:r(()=>m(v),"onClick"),children:"Set value"})]},v.definition.id))}),l?(0,a.jsx)(D_,{to:l,className:"mt-2 inline-block text-(length:--text-micro) font-medium underline underline-offset-2",children:"Manage all my secrets"}):null]})]}),(0,a.jsx)(Rz,{companyId:e,definition:d?.definition??null,existingSecret:d?.secret??null,open:d!==null,onOpenChange:r(v=>{v||m(null)},"onOpenChange")})]})}r(Dz,"MissingUserSecretsBanner");function Mz(e){return e==="local-board"?"Board":e.slice(0,5)}r(Mz,"fallbackUserLabel");function Hl(e){const t=e.user?.name?.trim();if(t)return t;const i=e.user?.email?.trim();return i||Mz(e.principalId)}r(Hl,"baseMemberLabel");function dC(e){const t=new Map;for(const i of e??[])i.status==="active"&&(t.has(i.principalId)||t.set(i.principalId,i));return[...t.values()].sort((i,l)=>Hl(i).localeCompare(Hl(l)))}r(dC,"activeUniqueMembers");function Oz(e){const t=new Map;for(const i of e??[])t.set(i.principalId,Hl(i));return t}r(Oz,"buildCompanyUserLabelMap");function Lz(e){const t=new Map;for(const i of e??[])t.set(i.principalId,{label:Hl(i),image:i.user?.image??null});return t}r(Lz,"buildCompanyUserProfileMap");function fC(e,t){const i=new Set([...t?.excludeUserIds??[]].filter(l=>!!l));return dC(e).filter(l=>!i.has(l.principalId)).map(l=>({id:`user:${l.principalId}`,label:Hl(l),searchText:[l.user?.name,l.user?.email,l.principalId].filter(Boolean).join(" ")}))}r(fC,"buildCompanyUserInlineOptions");function zz(e){return dC(e).map(t=>({id:`user:${t.principalId}`,name:Hl(t),kind:"user",userId:t.principalId}))}r(zz,"buildCompanyUserMentionOptions");function ag(e){return e.status!=="terminated"&&e.status!=="pending_approval"&&e.orgChainHealth?.status!=="invalid_org_chain"}r(ag,"isAgentTaskTarget");function Pz(e){const t=[];for(const i of e??[]){const l=i.identifier?.trim();if(!l)continue;const c=i.title?.trim()??"";t.push({id:`issue:${i.id}`,name:c?`${l} ${c}`:l,kind:"issue",issueId:i.id,issueIdentifier:l})}return t}r(Pz,"buildIssueMentionOptions");function Uz(e){return[...zz(e.members),...[...e.agents??[]].filter(ag).sort((t,i)=>t.name.localeCompare(i.name)).map(t=>({id:`agent:${t.id}`,name:t.name,kind:"agent",agentId:t.id,agentIcon:t.icon,agentAppearance:t.appearance})),...[...e.projects??[]].sort((t,i)=>t.name.localeCompare(i.name)).map(t=>({id:`project:${t.id}`,name:t.name,kind:"project",projectId:t.id,projectColor:t.color})),...Pz(e.issues)]}r(Uz,"buildMarkdownMentionOptions");function Rr(e){return e?e.executionWorkspacePolicy?.defaultProjectWorkspaceId??e.workspaces?.find(t=>t.isPrimary)?.id??e.workspaces?.[0]?.id??"":""}r(Rr,"defaultProjectWorkspaceIdForProject");function yd(e){const t=e?.executionWorkspacePolicy?.enabled?e.executionWorkspacePolicy.defaultMode:null;return t==="isolated_workspace"||t==="operator_branch"||t==="adapter_default"?t==="adapter_default"?"agent_default":t:"shared_workspace"}r(yd,"defaultExecutionWorkspaceModeForProject");function $z(e){return e==="isolated_workspace"||e==="operator_branch"||e==="shared_workspace"?e:e==="adapter_managed"||e==="cloud_sandbox"?"agent_default":"shared_workspace"}r($z,"issueExecutionWorkspaceModeForExistingWorkspace");function mC(e,t){if(e.length===0)return[];if(t.length===0)return e;const i=new Map(e.map(c=>[c.id,c])),l=[];for(const c of t){const d=i.get(c);d&&(l.push(d),i.delete(c))}for(const c of i.values())l.push(c);return l}r(mC,"sortProjectsByStoredOrder");function $j(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]!==t[i])return!1;return!0}r($j,"areEqual");function Bj(e,t){return mC(e,t).map(i=>i.id)}r(Bj,"buildOrderIds");function pC({projects:e,companyId:t,userId:i}){const l=Rn(),c=(0,b.useMemo)(()=>P.sidebarPreferences.projectOrder(t??"__none__",i??"__anon__"),[t,i]),{data:d}=be({queryKey:c,queryFn:r(()=>Md.getProjectOrder(t),"queryFn"),enabled:!!(t&&i)}),[m,f]=(0,b.useState)(()=>Bj(e,[]));(0,b.useEffect)(()=>{const g=Bj(e,d?.orderedIds??[]);f(v=>$j(v,g)?v:g)},[d?.orderedIds,e]);const h=bn({mutationFn:r(g=>Md.updateProjectOrder(t,{orderedIds:g}),"mutationFn"),onSuccess:r(g=>{l.setQueryData(c,g)},"onSuccess")});return{orderedProjects:(0,b.useMemo)(()=>mC(e,m),[e,m]),orderedIds:m,persistOrder:(0,b.useCallback)(g=>{const v=new Set(e.map(j=>j.id)),y=g.filter(j=>v.has(j));for(const j of e)y.includes(j.id)||y.push(j.id);f(j=>$j(j,y)?j:y),!(!t||!i)&&(l.setQueryData(c,j=>({orderedIds:y,updatedAt:j?.updatedAt??null})),h.mutate(y))},[t,h,e,l,c,i])}}r(pC,"useProjectOrder");var Qd="wardmote:recent-projects";function sg(){return S3(Qd)}r(sg,"getRecentProjectIds");function Bz(e){try{return localStorage.getItem(`${Qd}:${e}`)??void 0}catch{return}}r(Bz,"getLastProjectId");function Wd(e,t){if(N3(Qd,e),t)try{localStorage.setItem(`${Qd}:${t}`,e)}catch{}}r(Wd,"trackRecentProject");function Gd(){const e=globalThis.crypto;if(typeof e?.randomUUID=="function")return e.randomUUID();const t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let l=0;l<t.length;l++)t[l]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const i=Array.from(t,l=>l.toString(16).padStart(2,"0"));return[i.slice(0,4).join(""),i.slice(4,6).join(""),i.slice(6,8).join(""),i.slice(8,10).join(""),i.slice(10).join("")].join("-")}r(Gd,"createUuid");var Kz=E_.nullable();function hC(e){return Kz.safeParse(e??null)}r(hC,"readExecutionPolicy");function Kj(e){return e.type==="agent"?`agent:${e.agentId}`:`user:${e.userId}`}r(Kj,"principalKey");function qz(e){const t=Pl(e);return t.assigneeAgentId?{type:"agent",agentId:t.assigneeAgentId,userId:null}:t.assigneeUserId?{type:"user",userId:t.assigneeUserId,agentId:null}:null}r(qz,"principalFromSelectionValue");function Fz(e){return e.type==="agent"?`agent:${e.agentId}`:`user:${e.userId}`}r(Fz,"selectionValueFromPrincipal");function dW(e,t){const i=hC(e);return i.success?i.data?.stages.find(l=>l.type===t)?.participants.map(l=>Fz(l))??[]:[]}r(dW,"stageParticipantValues");function qj(e,t){const i=new Map((e??[]).map(c=>[Kj(c),c])),l=[];for(const c of t){const d=qz(c);if(!d)continue;const m=Kj(d),f=i.get(m);l.push({id:f?.id??Gd(),type:d.type,agentId:d.type==="agent"?d.agentId??null:null,userId:d.type==="user"?d.userId??null:null})}return l}r(qj,"mergeParticipants");function Hz(e){const t=hC(e.existingPolicy);if(!t.success)throw new Error("Execution policy is unavailable");const i=t.data,l=i?.mode??"normal",c=[],d=e.existingPolicy?.monitor??null,m=i?.stages.find(v=>v.type==="review"),f=qj(m?.participants,e.reviewerValues);f.length>0&&c.push({id:m?.id??Gd(),type:"review",approvalsNeeded:1,participants:f});const h=i?.stages.find(v=>v.type==="approval"),g=qj(h?.participants,e.approverValues);return g.length>0&&c.push({id:h?.id??Gd(),type:"approval",approvalsNeeded:1,participants:g}),c.length===0&&!d&&!i?.authorizationPolicy&&!i?.reviewPreset&&i?.maxReviewRounds==null?null:{...e.existingPolicy,mode:l,commentRequired:!0,stages:c,...d?{monitor:d}:{}}}r(Hz,"buildExecutionPolicy");function Vz({className:e,...t}){return(0,a.jsx)("div",{className:G("relative z-0 mx-3 -mb-px overflow-hidden rounded-t-xl rounded-b-none border border-b-0 border-line/75 bg-bg-2 shadow-sm",e),...t})}r(Vz,"TaskChatComposerBar");function Qz(e){const t=NE(e);if(!t)return{matched:!1};const i=t.search(/\s/);if((i===-1?t:t.slice(0,i))!=="/goal")return{matched:!1};const l=i===-1?"":t.slice(i).trim();if(!l)return{matched:!0,command:{action:"focus"}};const[c,...d]=l.split(/\s+/);return["edit","pause","resume","clear"].includes(c)?d.length>0?{matched:!0,error:`/goal ${c} does not accept extra arguments.`}:{matched:!0,command:{action:c}}:{matched:!0,command:{action:"create",objective:l}}}r(Qz,"parseRunnerGoalCommand");function Wz(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2).toUpperCase():`${t[0][0]}${t[t.length-1][0]}`.toUpperCase()}r(Wz,"identityInitials");function Gz({assigneeValue:e,label:t,agentMap:i,userProfileMap:l,placement:c}){if(e.startsWith("agent:")){const d=e.slice(6),m=i?.get(d)?.icon??"bot";return(0,a.jsx)("span",{className:"shrink-0","data-assignee-identity":e,"data-assignee-trigger-icon":c==="trigger"?m:void 0,"data-assignee-option-icon":c==="option"?e:void 0,children:(0,a.jsx)(sr,{agent:i?.get(d)??{id:d},size:16})})}if(e.startsWith("user:")){const d=e.slice(5),m=l?.get(d),f=m?.label??t;return(0,a.jsxs)(Id,{size:"xs",className:"shrink-0","data-assignee-identity":e,"data-assignee-trigger-avatar":c==="trigger"?d:void 0,"data-assignee-option-avatar":c==="option"?e:void 0,children:[m?.image?(0,a.jsx)(_d,{src:m.image,alt:""}):null,(0,a.jsx)(Ed,{children:Wz(f)})]})}return null}r(Gz,"AssigneeIdentityAvatar");function Yz(e,t,i){if(i)return e==="planning"?`Plan with ${t}…`:e==="ask"?`Ask ${t}…`:`Message ${t}…`;switch(e){case"planning":return`Plan with ${t} — shapes the plan doc, no code changes…`;case"ask":return`Ask ${t} a question — read-only, nothing runs…`;default:return`Message ${t} — describe what you want done…`}}r(Yz,"modePlaceholder");function Xz(e,t){return(e==="done"||e==="cancelled"||e==="blocked")&&t.startsWith("agent:")}r(Xz,"shouldImplicitlyReopenComment");function ah(e){if(e.startsWith("agent:")){const t=e.slice(6);return t?{assigneeAgentId:t,assigneeUserId:null}:void 0}if(e.startsWith("user:")){const t=e.slice(5);return t?{assigneeAgentId:null,assigneeUserId:t}:void 0}}r(ah,"parseAssigneeValue");function Fj(e){return e.replace(/[[\]]/g,"\\$&")}r(Fj,"escapeMarkdownLabel");function Zz({onAdd:e,creation:t,confirmedSubmissionIds:i,onStop:l,stopPending:c=!1,workMode:d,onWorkModeChange:m,disabled:f=!1,disabledReason:h,placeholder:g,onAttachImage:v,onImageUpload:y,mentions:j,enableReassign:k=!1,conversationMode:N=!1,pendingIssue:S,reassignOptions:D,agentMap:R,companyId:E,userProfileMap:C,currentAssigneeValue:I="",onPendingAssigneeChange:O,issueStatus:z,issueId:B=null,mobile:L=!1,draftKey:_,onReviewConversation:U,queuedEdit:F=null,onSaveQueuedEdit:Y,onCancelQueuedEdit:se,pause:me=null,takeover:oe=null,pendingTakeover:$=null,runnerGoalCapability:T=null,onRunnerGoalCommand:te,onRunnerGoalReassign:ce}){const ae=Bg(),Ce=A3(),ue=UE(l,c),[we,Ae]=(0,b.useState)(()=>_?Cy(_):""),je=t?t.value:we,[he,Te]=(0,b.useState)(!1),[Ve,De]=(0,b.useState)(!1),[Se,ut]=(0,b.useState)(()=>_?Tr(_):null),wt=(0,b.useRef)(_);(0,b.useEffect)(()=>(wt.current=_,ut(_?Tr(_):null),()=>{wt.current=void 0}),[_]);const[kt,$t]=(0,b.useState)(null),[le,Ue]=(0,b.useState)(!1),[Fe,it]=(0,b.useState)(null),[Vt,Qt]=(0,b.useState)(!1),[V,Ct]=(0,b.useState)(null),[_e,ze]=(0,b.useState)(null),[Je,rt]=(0,b.useState)(d),At=t?d:Je,[Wt,mn]=(0,b.useState)(null),[Zt,_t]=(0,b.useState)(null),Et=Yk(),ln=t?.runSettings??Et,Qn=Et.clear;(0,b.useEffect)(()=>{Qn()},[Qn,_,B]);const[dt,wn]=(0,b.useState)(()=>_?Sy(_).map(ie=>({...ie,id:`receipt:${ie.attachmentId}`,status:"attached"})):[]),Dt=(0,b.useRef)(dt);function an(ie){const Ee=typeof ie=="function"?ie(Dt.current):ie;Dt.current=Ee,wn(Ee);const Oe=He.current;Oe&&Oe.draftKey===_&&Ny(Oe.draftKey,Ee.filter(at=>at.status==="attached"&&at.attachmentId).map(at=>({...at,inline:at.inline===!0})),Oe.attemptId)}r(an,"setAttachments");const Mt=(0,b.useRef)(he);Mt.current=he;const pt=(0,b.useRef)(Wt);pt.current=Wt;const Pe=(0,b.useRef)(null),Me=(0,b.useRef)(null),$e=(0,b.useRef)(je);$e.current=je;const He=(0,b.useRef)(null);function Ot(ie){if($e.current=ie,t){t.onChange(ie);return}Ae(ie),$t(null);const Ee=He.current;!Ee||Ee.draftKey!==_||Tr(Ee.draftKey)?.attemptId!==Ee.attemptId||(gi(Ee.draftKey,ie?`${Ee.submittedBody}
|
|
9
|
+
|
|
10
|
+
${ie}`:Ee.submittedBody,Ee.attemptId),Fu(Ee.draftKey,{attemptId:Ee.attemptId,reviewed:!1,nextDraftOffset:Ee.submittedBody.length+(ie?2:0),submittedAttachmentIds:Ee.submittedAttachmentIds}))}r(Ot,"changeBody");const lt=(0,b.useRef)(null),zt=(0,b.useRef)(F);zt.current=F;const Jt=(0,b.useRef)(null),Lt=(0,b.useRef)(null);(0,b.useEffect)(()=>{Ue(!1),it(null)},[oe?.id]),(0,b.useEffect)(()=>{const ie=Lt.current,Ee=F,Oe=Ee?.commentId??null;if(Ee&&ie!==Oe)Jt.current||(Jt.current={body:$e.current,attachments:Dt.current,pendingMode:At,pendingAssignee:pt.current},_&&gi(_,$e.current)),lt.current&&(clearTimeout(lt.current),lt.current=null),$e.current=Ee.body,Ae(Ee.body),an([]),requestAnimationFrame(()=>Me.current?.focus());else if(!Oe&&ie){const at=Jt.current;at&&($e.current=at.body,Ae(at.body),an(at.attachments),rt(at.pendingMode),mn(at.pendingAssignee),_&&gi(_,at.body)),Jt.current=null,requestAnimationFrame(()=>Me.current?.focus())}Lt.current=Oe},[_,At,F]),(0,b.useEffect)(()=>{!_||F||($e.current=Cy(_),Ae($e.current))},[_,F]),(0,b.useEffect)(()=>{_&&an(Sy(_).map(ie=>({...ie,id:`receipt:${ie.attachmentId}`,status:"attached"})))},[_]),(0,b.useEffect)(()=>{!_||F||he||Se||dt!==Dt.current||Ny(_,dt.filter(ie=>ie.status==="attached"&&ie.attachmentId).map(ie=>({attachmentId:ie.attachmentId,name:ie.name,size:ie.size,inline:ie.inline===!0,contentPath:ie.contentPath})))},[dt,_,F,he]),(0,b.useEffect)(()=>{if(!_||F||he){lt.current&&(clearTimeout(lt.current),lt.current=null);return}lt.current&&clearTimeout(lt.current),lt.current=setTimeout(()=>{gi(_,je)},800)},[je,_,F,he]),(0,b.useEffect)(()=>()=>{lt.current&&clearTimeout(lt.current),_&&!zt.current&&!Mt.current&&gi(_,$e.current)},[_]),(0,b.useEffect)(()=>{if(!_)return;const ie=r(()=>{!zt.current&&!Mt.current&&gi(_,$e.current)},"flushDraft");return window.addEventListener("beforeunload",ie),()=>window.removeEventListener("beforeunload",ie)},[_]);const pn=!me&&!F&&!Se&&!!(t||v||y),hn=!!(k&&D&&D.length>0),on=t?I:Wt??I,An=D?.find(ie=>ie.id===on)?.label??"Unassigned",Dn=F?"Edit queued message…":g??Yz(At,An==="Unassigned"?"the agent":An,L),Ja=T?.availability!=="available",ma={id:"action:goal",kind:"action",command:"goal",name:"Goal",description:!T||T.verified===!1?"Support will be verified when the session starts.":"Pursue work across turns.",aliases:["goal","pursue","continue"],disabled:Ja&&T!==null,disabledReason:T?.reason??"Session goals are unsupported by this agent."};function Aa(ie){if(!t&&ie&&E){const Ee=ah(ie);Ee?.assigneeAgentId&&Ld(Ee.assigneeAgentId,E),Ee?.assigneeUserId&&Od(Ee.assigneeUserId,E)}mn(ie),O?.(ie)}r(Aa,"updatePendingAssignee");function es(ie){rt(ie),t&&m?.(ie)}r(es,"changeMode");async function pa(ie){const Ee=crypto.randomUUID();an(Oe=>[...Oe,{id:Ee,name:ie.name,size:ie.size,inline:!0,status:"uploading"}]);try{const Oe=v?await v(ie):void 0,at=v?Oe?.contentPath:await y?.(ie);if(!at)throw new Error("Upload did not return a file URL");if(!Dt.current.some(gt=>gt.id===Ee))throw new Error("Attachment was removed");return an(gt=>gt.map(qt=>qt.id===Ee?{...qt,attachmentId:Oe?.id,contentPath:at,status:"attached"}:qt)),at}catch(Oe){throw an(at=>at.map(gt=>gt.id===Ee?{...gt,status:"error",error:Oe instanceof Error?Oe.message:"Upload failed"}:gt)),Oe}}r(pa,"uploadInlineImage");async function xt(ie){const Ee=`${ie.name}:${ie.size}:${ie.lastModified}:${Math.random().toString(36).slice(2)}`;an(Oe=>[...Oe,{id:Ee,name:ie.name,size:ie.size,status:"uploading"}]);try{if(!v){an(gt=>gt.map(qt=>qt.id===Ee?{...qt,status:"error",error:"This file type cannot be attached here"}:qt));return}const Oe=await v(ie);if(!Oe?.contentPath)throw new Error("Upload did not return a file URL");const at=Oe?.originalFilename??ie.name;an(gt=>gt.map(qt=>qt.id===Ee?{...qt,name:at,attachmentId:Oe?.id,status:"attached",contentPath:Oe?.contentPath}:qt))}catch(Oe){an(at=>at.map(gt=>gt.id===Ee?{...gt,status:"error",error:Oe instanceof Error?Oe.message:"Upload failed"}:gt))}}r(xt,"attachNonImageFile");async function kn(ie){if(!ie.type.startsWith("image/")){await xt(ie);return}try{const Ee=await pa(ie);Me.current?.insertMarkdown(``)}catch{}}r(kn,"attachPickedFile");function Jn(ie){const Ee=ie.target.files;if(Ee&&Ee.length>0){if(t){t.onSelectFiles(Array.from(Ee)),ie.target.value="";return}(async()=>{for(const Oe of Array.from(Ee))await kn(Oe)})()}ie.target.value=""}r(Jn,"handleFileInputChange");function Os(){const ie=$e.current.trim();Ot(/^\/goal(?:\s|$)/.test(ie)?ie:`/goal ${ie}`),_t(null),requestAnimationFrame(()=>Me.current?.focus())}r(Os,"prepareGoal");function Kn(ie){if(me||!pn)return;const Ee=Array.from(ie.clipboardData?.files??[]);if(Ee.length===0)return;if(t){if(y){const at=Ee.filter(gt=>!gt.type.startsWith("image/"));if(at.length===0||(t.onSelectFiles(at),at.length!==Ee.length))return}else t.onSelectFiles(Ee);ie.preventDefault(),ie.stopPropagation();return}const Oe=Ee.filter(at=>!at.type.startsWith("image/"));Oe.length!==0&&(Oe.length===Ee.length&&(ie.preventDefault(),ie.stopPropagation()),(async()=>{for(const at of Oe)await xt(at)})())}r(Kn,"handlePasteCapture");const bs=dt.filter(ie=>ie.status==="attached"&&ie.contentPath&&!ie.inline),Wn=dt.filter(ie=>!ie.inline||ie.status!=="attached"),Sn=!F&&!he&&je.trim().length===0&&dt.length===0&&!!(l||ue.stopping),Ua=dt.some(ie=>ie.status==="uploading"),ba=dt.some(ie=>ie.status==="error"),Mn=!!(oe&&!me&&!F),[_a,_n]=(0,b.useState)(!1),[cn,Ls]=(0,b.useState)(null),[zs,ha]=(0,b.useState)(null),va=R3(L&&Mn),[vs,Ps]=T3("dock",oe?.id??null),Pt=!!(Mn&&oe&&(vs||L&&zs!==oe.id&&cn!==oe.id&&(_a||va))),ts=(0,b.useRef)(Mn);(0,b.useEffect)(()=>{ts.current&&!Mn&&!F&&requestAnimationFrame(()=>Me.current?.focus()),ts.current=Mn},[F,Mn]);const $a=N&&!F&&je.trim()==="/new"&&dt.length===0;async function Ba(){if(f||me&&!$a)return;if(t){if(Mt.current||Ua||ba||t.submitDisabled||!$e.current.trim()&&!t.canSubmitWithoutBody)return;Mt.current=!0,Te(!0),_t(null);try{await t.onSubmit($e.current,At,ln.values)}catch(Ft){_t(Ft instanceof Error?Ft.message:"Failed to create task. Try again.")}finally{Mt.current=!1,Te(!1)}return}if(!e)return;const ie=_&&!F?Tr(_):null;if(ie&&!he){ut(ie);return}const Ee=$e.current,Oe=Dt.current,at=pt.current,gt=Ee.trim(),qt=F?{matched:!1}:Qz(Ee),Ia=F?{matched:!1}:AE(Ee);if(Ia.matched&&"error"in Ia){_t(Ia.error);return}const Z=Ia.matched&&"command"in Ia?Ia.command:null,Ne=Z?.mode,Ke=Z?Z.prompt:Ee;if(qt.matched&&N){_t("Create a separate task for work that needs an ongoing execution goal.");return}if(qt.matched){if("error"in qt){_t(qt.error);return}if(Dt.current.length>0){_t("Remove attachments before using /goal.");return}if(!te){_t(T?.reason??"Session goals are unsupported by this agent.");return}if(T&&T.availability!=="available"){_t(T.reason??"Session goals are unsupported by this agent.");return}try{if(hn&&on!==I&&qt.command.action!=="focus"){const Ft=ah(on);if(!Ft||!ce){_t("Select an agent before starting a session goal.");return}await ce(ln.hasValues&&Ft.assigneeAgentId?{...Ft,modelOverride:ln.values}:Ft),ln.clear(),Aa(null)}await te(qt.command),_t(null),$e.current="",lt.current&&clearTimeout(lt.current),lt.current=null,_&&Pp(_),Ae(""),Me.current?.clear()}catch(Ft){_t(Ft instanceof Error?Ft.message:"The goal action could not be applied.")}return}if(!gt&&bs.length===0||Ua||ba||he||Se||f)return;const Xe=bs.map(Ft=>`[${Fj(Ft.name)}](${Ft.contentPath})`).join(`
|
|
11
|
+
`),Qe=F?Ee:[Ke.trim(),Xe].filter(Boolean).join(`
|
|
12
|
+
|
|
13
|
+
`),ft=hn&&on!==I,vt=ln.hasValues?ln.values:void 0,un=ft?ah(on):void 0,Ln=un?.assigneeAgentId&&vt?{...un,modelOverride:vt}:un,Ta=Xz(z,on)?!0:void 0;$e.current="",lt.current&&(clearTimeout(lt.current),lt.current=null),_&&!F&&(Oe.some(Ft=>Ft.status==="attached"&&Ft.attachmentId)?gi(_,Ee):Pp(_)),Ae(""),Te(!0);let zn=null;try{if(F){if(!Y)return;await Y(F.commentId,Qe),se?.();return}At!==d&&m&&await m(At);const Ft=_?Tr(_):null;if(Ft){ut(Ft),Ae(Ee);return}zn=crypto.randomUUID(),_&&(gi(_,Ee),Fu(_,{attemptId:zn,reviewed:!1}));const Nn=[...new Set(Oe.filter(Gt=>Gt.status==="attached"&&Gt.attachmentId&&(!Gt.inline||Gt.contentPath&&Ke.includes(Gt.contentPath))).map(Gt=>Gt.attachmentId))];_&&(He.current={draftKey:_,attemptId:zn,submittedBody:Ee,submittedAttachmentIds:Nn},Ot($e.current));const ja=await e(Qe,Ta,Ln,Nn.length?Nn:void 0,zn,Ne);if(Ln?.modelOverride&&ln.clear(),_&&Ay(_,zn,wt.current===_?$e.current:void 0),wt.current!==_)return;$t(SE(ja));const Ka=new Set(Oe.map(Gt=>Gt.id));an(Gt=>Gt.filter(ga=>!Ka.has(ga.id))),pt.current===at&&Aa(null)}catch(Ft){if(Ln?.modelOverride&&ln.clear(),wt.current!==_)return;const Nn=$e.current;if(zn&&Ft instanceof pE){const Ka={attemptId:zn,reviewed:!1,nextDraftOffset:Ee.length+(Nn?2:0),submittedAttachmentIds:Oe.flatMap(Gt=>Gt.attachmentId?[Gt.attachmentId]:[])};ut(Ka),_&&Tr(_)?.attemptId===zn&&Fu(_,Ka)}else _&&zn&&E3(_,zn);const ja=Nn?`${Ee}
|
|
14
|
+
|
|
15
|
+
${Nn}`:Ee;$e.current=ja,lt.current&&(clearTimeout(lt.current),lt.current=null),_&&gi(_,ja,zn??void 0),Ae(ja)}finally{He.current?.attemptId===zn&&(He.current=null),Te(!1)}}r(Ba,"submit"),(0,b.useEffect)(()=>{if(!Se||!i?.has(Se.attemptId))return;const ie=Se.nextDraftOffset===void 0?"":$e.current.slice(Se.nextDraftOffset);_&&Ay(_,Se.attemptId,ie),ut(null),$e.current=ie,Ae(ie);const Ee=Se.submittedAttachmentIds;an(Oe=>Ee?Oe.filter(at=>!at.attachmentId||!Ee.includes(at.attachmentId)):[])},[i,_,Se]);async function ya(){if(Se){De(!1);try{if(!U)throw new Error("Review unavailable");if(await U(),wt.current!==_)return;const ie={...Se,reviewed:!0};ut(ie),_&&Tr(_)?.attemptId===ie.attemptId&&Fu(_,ie)}catch{De(!0)}}}r(ya,"reviewUncertainSubmission");function On(){Se?.reviewed&&(_&&Pp(_,Se.attemptId),$e.current="",Ae(""),an([]),ut(null))}r(On,"discardUncertainDraft");function ys(){oe&&(Ue(!0),it(null),Promise.resolve(oe.onSkip()).catch(ie=>{Ue(!1),it(ie instanceof Error?ie.message:"This request could not be skipped.")}))}r(ys,"skipTakeover");const Ea=oe?(0,a.jsxs)(pe,{type:"button",size:"sm",variant:"secondary",disabled:le,onClick:ys,children:[le?(0,a.jsx)(za,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):null,"Skip"]}):null;return me&&(!N||F)?(0,a.jsx)(hy,{...me,hasDraft:!!(je.trim()||dt.length)}):(0,a.jsxs)("div",{className:G("flex min-w-0 flex-col",t?.contextBar?"gap-0":"gap-2"),children:[Pt&&oe?(0,a.jsxs)("button",{type:"button",className:"flex min-h-11 w-full min-w-0 items-center gap-2 rounded-xl border border-line bg-bg-2 px-3 text-left text-(length:--text-compact) shadow-sm dark:border-0 dark:bg-bg-3 dark:shadow-none","aria-expanded":!1,"aria-label":`Show ${oe.label}`,onMouseDown:r(ie=>ie.preventDefault(),"onMouseDown"),onClick:r(()=>{Ps(!1),ha(oe.id)},"onClick"),"data-testid":"task-chat-composer-takeover-summary",children:[(0,a.jsx)(py,{className:"h-4 w-4 shrink-0 text-ink-3","aria-hidden":!0}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:oe.label}),oe.pendingCount>1?(0,a.jsxs)("span",{className:"shrink-0 text-xs text-ink-3",children:[oe.pendingCount," pending"]}):null,(0,a.jsx)(OE,{className:"h-4 w-4 shrink-0 text-ink-3","aria-hidden":!0})]}):null,Mn&&oe?(0,a.jsxs)("section",{className:G("relative rounded-xl border border-line bg-bg-2 p-(--sz-18px) shadow-sm dark:border-0 dark:bg-bg-3 dark:shadow-none",L?"flex max-h-(--tc-interaction-card-max-h-mobile) flex-col overflow-hidden p-(--tc-mobile-card-padding)":"max-h-(--tc-interaction-card-max-h) overflow-y-auto scrollbar-auto-hide",Pt&&"hidden"),"aria-label":oe.label,"data-testid":"task-chat-composer-takeover",onFocus:r(()=>Ls(oe.id),"onFocus"),onBlur:r(ie=>{ie.currentTarget.contains(ie.relatedTarget)||Ls(null)},"onBlur"),children:[(0,a.jsxs)("div",{className:G("flex min-w-0 shrink-0 items-center gap-2",oe.hideLabel&&oe.pendingCount===1?"absolute right-0 top-0 z-10":"mb-3"),"data-testid":"task-chat-composer-takeover-header",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[!Vt&&!oe.hideLabel?(0,a.jsx)("strong",{className:"block truncate text-sm font-medium text-ink",children:oe.label}):null,(0,a.jsx)("div",{ref:Ct,className:"flex min-w-0 items-center","data-testid":"task-chat-composer-takeover-title-slot"})]}),(0,a.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[oe.pendingCount>1?(0,a.jsxs)(pe,{type:"button",size:"sm",variant:"ghost",className:"h-7 px-2",onClick:oe.onShowNext,children:[oe.pendingCount," pending"]}):null,(0,a.jsx)("div",{ref:ze,className:"flex shrink-0 items-center","data-testid":"task-chat-composer-takeover-controls-slot"}),(0,a.jsx)(pe,{type:"button",size:"icon-xs",variant:"ghost","aria-label":"Hide","aria-expanded":!0,"data-testid":"task-chat-composer-takeover-hide",onClick:r(()=>{Ls(null),Ps(!0)},"onClick"),children:(0,a.jsx)($r,{"aria-hidden":!0})}),(0,a.jsx)(pe,{type:"button",size:"icon-xs",variant:"ghost","aria-label":`Dismiss ${oe.label}`,disabled:le,onClick:oe.onDismiss,children:(0,a.jsx)(ia,{"aria-hidden":!0})})]})]}),(0,a.jsx)("div",{className:G(oe.hideLabel&&oe.pendingCount===1?"pr-14":"pr-1",L&&"min-h-0 flex-1 overflow-y-auto overscroll-contain scrollbar-auto-hide"),"data-testid":"task-chat-composer-takeover-body","data-mobile":L||void 0,children:(0,a.jsx)(I3.Provider,{value:{skipButton:oe.inlineSkip&&!oe.hideSkip&&Ea?Ea:null,dismiss:oe.onDismiss,headerSlot:V,controlsSlot:_e,setHeaderClaimed:Qt},children:oe.content})}),Fe?(0,a.jsx)("p",{className:"mt-2 shrink-0 text-sm text-bad",role:"alert",children:Fe}):null,!oe.inlineSkip&&!oe.hideSkip?(0,a.jsx)("div",{className:"mt-3 flex shrink-0 items-center justify-end gap-2","data-slot":"task-chat-takeover-actions",children:Ea}):null]}):null,t?.contextBar?(0,a.jsx)(Vz,{className:"flex h-11 min-w-0 items-center gap-2 px-2.5","data-testid":"task-chat-composer-context",role:"group","aria-label":"Task project and worktrees",children:t.contextBar}):null,(0,a.jsxs)("div",{className:G(Ce?"wardmote-task-chat-composer rounded-(--radius-task-composer) border border-line bg-bg-2 p-(--sz-18px) shadow-(--shadow-task-composer) dark:border-0 dark:bg-bg-3 dark:shadow-none":"wardmote-task-chat-composer rounded-xl bg-bg-2 p-(--sz-18px)",L&&"p-(--tc-mobile-card-padding)"),onKeyDownCapture:r(ie=>{f||F||((ie.key==="."||ie.code==="Period")&&(ie.metaKey||ie.ctrlKey)||ie.key==="Tab"&&ie.shiftKey)&&(ie.preventDefault(),ie.stopPropagation(),es(Mh(At)))},"onKeyDownCapture"),onPasteCapture:Kn,children:[t?.header,Se?(0,a.jsxs)("div",{role:"alert",className:"mb-3 space-y-2 rounded-md border border-line bg-bg-3 p-3 text-sm",children:[(0,a.jsx)("p",{children:"We couldn’t confirm whether this comment was saved. It may already be in the conversation. Review it before starting another draft."}),(0,a.jsx)(pe,{type:"button",variant:"secondary",size:"sm",onClick:ya,children:"Review conversation"}),Ve?(0,a.jsx)("p",{children:"Couldn’t refresh the conversation. Try reviewing it again."}):null,Se.reviewed?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:"Discarding this draft does not remove any saved comment or uploaded file."}),(0,a.jsx)(pe,{type:"button",variant:"secondary",size:"sm",onClick:On,children:"Discard draft and start new"})]}):null]}):null,!Mn&&($||oe)?(0,a.jsxs)("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 rounded-md bg-bg-3/50 px-2.5 py-2 text-left text-xs text-ink-3 transition-colors hover:bg-bg-3 hover:text-ink",onClick:$?.onOpen,"data-testid":"task-chat-pending-input-indicator",children:[(0,a.jsx)(py,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:$?.label??oe?.label??"Pending input"}),(0,a.jsxs)("span",{className:"shrink-0 font-medium",children:[$?.count??oe?.pendingCount??1," pending"]})]}):null,me&&N?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(hy,{...me,hasDraft:!!(je.trim()||dt.length)}),(0,a.jsx)("p",{className:"text-xs text-ink-3",children:"Send /new to start a fresh session and resume this conversation."})]}):null,(0,a.jsx)("div",{"data-testid":"task-chat-composer-input",onFocus:r(ie=>{_n(!0),ie.currentTarget.contains(ie.relatedTarget)||ha(null)},"onFocus"),onBlur:r(ie=>{ie.currentTarget.contains(ie.relatedTarget)||_n(!1)},"onBlur"),children:(0,a.jsx)(qk,{ref:Me,value:je,onChange:Ot,placeholder:f?h??"Composer disabled":Dn,readOnly:f||!!Se||!!(t&&he),mentions:j,actionCommands:t?[]:N?[{id:"action:new",kind:"action",command:"new",name:"New session",description:"Start fresh context here, preserving conversation history.",aliases:["new"],disabled:f}]:[ma],onSubmit:r(()=>{Ba()},"onSubmit"),imageUploadHandler:pn&&(!t||y)?pa:void 0,onDropFile:pn&&!t?xt:void 0,bordered:!1,className:G(f&&"opacity-60"),contentClassName:L?"max-h-(--sz-28dvh) min-h-(--tc-mobile-editor-min-h) overflow-y-auto px-1 py-1 text-base scrollbar-auto-hide":"max-h-(--sz-28dvh) min-h-(--sz-48px) overflow-y-auto px-1 py-1 text-sm scrollbar-auto-hide"})}),Zt?(0,a.jsx)("p",{className:"px-1 text-xs text-bad",role:"alert","data-testid":t?"task-chat-create-error":"task-chat-goal-error",children:Zt}):null,kt?(0,a.jsx)("p",{className:"px-1 text-xs text-ink-3",role:"status","data-testid":"task-chat-delivery-notice",children:kt}):null,Wn.length>0?(0,a.jsx)(dI,{className:"mb-1 px-1","data-testid":"task-chat-composer-attachments",children:Wn.map(ie=>{const Ee=cI(ie.name),Oe=Ee.icon,at=sI(ie.size);return(0,a.jsxs)(uI,{size:"sm",state:ie.status==="uploading"?"uploading":ie.status==="error"?"error":"done",children:[(0,a.jsx)(oI,{children:ie.status==="uploading"?(0,a.jsx)(za,{className:"animate-spin","aria-hidden":!0}):(0,a.jsx)(Oe,{"aria-hidden":!0})}),(0,a.jsxs)(rI,{children:[(0,a.jsx)(lI,{className:"max-w-48",children:ie.name}),(0,a.jsx)(fI,{className:"max-w-48",children:ie.status==="uploading"?"Uploading…":ie.status==="error"?ie.error??"Upload failed":[Ee.label,at].filter(Boolean).join(" · ")})]}),(0,a.jsx)(iI,{children:(0,a.jsx)(mI,{"aria-label":`Remove ${ie.name}`,disabled:!!Se,onClick:r(()=>an(gt=>gt.filter(qt=>qt.id!==ie.id)),"onClick"),children:(0,a.jsx)(ia,{"aria-hidden":!0})})})]},ie.id)})}):null,t?.details,(0,a.jsxs)("div",{className:G("mt-2 flex items-center gap-x-2 gap-y-3",L&&!F?"flex-nowrap":"flex-wrap"),"data-testid":"task-chat-composer-actions",children:[(0,a.jsxs)("div",{className:"flex min-w-0 max-w-full items-center gap-2",children:[pn?(0,a.jsx)("input",{ref:Pe,type:"file",className:"hidden",multiple:!!t,onChange:Jn}):null,(0,a.jsx)(FE,{privacy:t?.privacy,mode:At,onModeChange:!F&&m?es:void 0,onAttachFile:pn?()=>Pe.current?.click():void 0,onGoal:!F&&!N&&dt.length===0&&T?.availability==="available"&&te?Os:void 0,disabled:f||!!Se,mobile:L,triggerTestId:"task-chat-composer-add",menuTestId:"task-chat-composer-add-menu"}),t?.privacy?.private?(0,a.jsx)(KE,{inherited:t.privacy.inherited,onRemove:r(()=>t.privacy.onChange(!1),"onRemove"),disabled:f}):null,F?(0,a.jsx)("span",{className:"px-1 text-xs font-medium text-ink-3",children:F.stale?"Queued message changed":"Editing queued message"}):(0,a.jsx)(BE,{mode:At,onRemove:m?()=>es("standard"):void 0,disabled:f||!!Se,testId:"task-chat-composer-mode",mobile:L})]}),(0,a.jsxs)("div",{className:G("ml-auto flex min-w-0 max-w-full items-center gap-2",L&&!F&&"flex-1 justify-end"),children:[hn&&!F?(0,a.jsx)(PE,{issueId:B,pendingIssue:S,assigneeValue:on,currentAssigneeValue:I,options:D??[],onAssigneeChange:Aa,staging:ln,subtaskRows:!t&&!N&&!!B,draft:!!t,companyId:E,footerSlot:t?.runSettingsFooter,disabled:f,mobile:L,renderAssigneeIdentity:r((ie,Ee,Oe)=>(0,a.jsx)(Gz,{assigneeValue:ie,label:Ee,agentMap:R,userProfileMap:C,placement:Oe}),"renderAssigneeIdentity")}):null,(B||S)&&!hn&&!F?(0,a.jsx)(qE,{issueId:B,pendingIssue:S,subtaskRows:!N&&!!B,disabled:f,mobile:L}):null,F?(0,a.jsx)("button",{type:"button",onClick:se,disabled:he,className:"h-8 shrink-0 rounded-md px-2.5 text-xs font-medium text-ink-3 transition-colors hover:bg-bg-3 hover:text-ink disabled:opacity-50",children:"Cancel"}):null,(0,a.jsx)(pe,{variant:Sn?"danger":"primary",size:"icon-sm",className:"size-8 min-h-8 min-w-8 shrink-0 aspect-square rounded-full",type:"button",onClick:r(()=>{Sn?ue.stop():Ba()},"onClick"),disabled:ae||(Sn?f||ue.stopping:f||!!me&&!$a||he||!!Se||Ua||ba||!!t?.submitDisabled||je.trim().length===0&&bs.length===0&&!t?.canSubmitWithoutBody),title:ae?P_:Sn?ue.stopping?"Stopping…":"Stop response":F?F.stale?"Queue as new message":"Save queued message":Ua?"Waiting for upload to finish":ba?"Remove the failed attachment to send":t?`${t.submitLabel} (⌘+Enter)`:"Send (⌘+Enter)","aria-label":Sn?ue.stopping?"Stopping…":"Stop":F?F.stale?"Queue as new message":"Save queued message":t?.submitLabel??"Send","aria-busy":he,"data-testid":Sn?"task-chat-composer-stop":"task-chat-composer-send","data-slot":"icon-button",children:he||Sn&&ue.stopping?(0,a.jsx)(za,{className:"h-4 w-4 animate-spin","aria-hidden":!0}):Sn?(0,a.jsx)(_I,{className:"h-4 w-4 fill-current","aria-hidden":!0}):(0,a.jsx)(Hk,{className:"h-4 w-4","aria-hidden":!0})})]})]}),ue.error?(0,a.jsx)("p",{role:"alert",className:"text-xs text-bad",children:ue.error}):null]})]})}r(Zz,"TaskChatComposer");var Jz=3;function Fr(e){const t=new Date(e.lastUsedAt).getTime();return Number.isFinite(t)?t:0}r(Fr,"workspaceLastUsedTime");function M0(e,t){const i=e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"});return i!==0?i:e.id.localeCompare(t.id)}r(M0,"compareWorkspaceNames");function eP(e,t){const i=Fr(t)-Fr(e);return i!==0?i:M0(e,t)}r(eP,"compareWorkspaceLastUsedDesc");function tP(e){return e.branchName??e.id.slice(0,8)}r(tP,"workspaceDescription");function nP(e){return[e.name,e.status,e.branchName,e.cwd,e.id].filter(Boolean).join(" ")}r(nP,"workspaceSearchText");function gC(e){const t=new Map;for(const i of e){const l=i.cwd??i.id,c=t.get(l);(!c||Fr(i)>Fr(c))&&t.set(l,i)}return Array.from(t.values())}r(gC,"dedupeReusableExecutionWorkspaces");function aP(e){const t=gC(e).sort(M0);if(t.length<=1)return t;let i=t[0];for(const l of t.slice(1))Fr(l)>Fr(i)&&(i=l);return[i,...t.filter(l=>l.id!==i.id)]}r(aP,"orderReusableExecutionWorkspaces");function fW(e,t={}){const i=(t.now?new Date(t.now).getTime():Date.now())-(t.recentCutoffDays??Jz)*24*60*60*1e3,l=gC(e),c=r((f,h)=>({key:`${h}:${f.id}`,value:f.id,workspaceId:f.id,groupId:h,label:f.name,description:tP(f),searchText:nP(f),workspace:f}),"toOption"),d=l.filter(f=>Fr(f)>=i).sort(eP).map(f=>c(f,"recent")),m=[...l].sort(M0).map(f=>c(f,"all"));return[...d.length>0?[{id:"recent",label:"Recent",options:d}]:[],{id:"all",label:"All workspaces",options:m}]}r(fW,"buildReusableExecutionWorkspaceOptionGroups");function mW(e,t){return sP(e,t)!==null}r(mW,"reusableWorkspaceOptionMatches");function sP(e,t){return O3([{text:e.label,weight:0},{text:e.description,weight:20},{text:e.searchText,weight:40}],t)}r(sP,"scoreReusableWorkspaceOptionMatch");var Hj=[{key:"isolated_workspace",value:"isolated_workspace",mode:"isolated_workspace",label:"New worktree",description:"Start in an isolated checkout."},{key:"shared_workspace",value:"shared_workspace",mode:"shared_workspace",label:"Project workspace",description:"Use the project's shared checkout."},{key:"operator_branch",value:"operator_branch",mode:"operator_branch",label:"New branch",description:"Create a branch in the project workspace."},{key:"agent_default",value:"agent_default",mode:"agent_default",label:"Agent default",description:"Let the agent choose its workspace."},{key:"inherit",value:"inherit",mode:"inherit",label:"Project default",description:"Use the project's worktree settings."}];function iP({mode:e,workspaceId:t,workspaces:i,onChange:l,loading:c,error:d,onRetry:m,disabled:f,mobile:h,contentStyle:g,selectedWorkspaceLabel:v}){const y=(0,b.useMemo)(()=>[{id:"new",options:[Hj[0]]},{id:"reuse",label:"Reuse a worktree",options:aP(i).map(k=>({key:`reuse:${k.id}`,value:`reuse:${k.id}`,workspaceId:k.id,mode:"reuse_existing",label:k.name,description:k.branchName??"Existing workspace",searchText:`${k.branchName??""} ${k.id}`}))},{id:"other",label:"Other options",options:Hj.filter(k=>k.mode==="shared_workspace"||k.mode!=="isolated_workspace"&&k.mode===e)}],[e,i]),j=e==="reuse_existing"?`reuse:${t}`:e;return(0,a.jsx)(LE,{value:j,groups:y,onValueChange:r((k,N)=>l(N.mode,N.workspaceId??""),"onValueChange"),placeholder:"Worktrees",triggerAriaLabel:"Worktrees",mobileTitle:"Worktrees",searchPlaceholder:"Search worktrees...",emptyMessage:"No matching worktrees.",disabled:f,modal:h,contentStyle:g,contentWidth:"auto",className:"min-w-0 flex-1 sm:flex-none sm:max-w-72",triggerClassName:"h-8 gap-1.5 border-0 bg-transparent px-2 text-xs font-medium shadow-none hover:bg-bg-3 focus-visible:bg-bg-3 focus-visible:ring-0",renderValue:r(k=>(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,a.jsx)(Jo,{className:"size-3.5 shrink-0","aria-hidden":!0}),(0,a.jsxs)("span",{className:"truncate",children:[(0,a.jsx)("span",{className:"hidden text-ink-3 sm:inline",children:"Worktrees · "}),k?.label??v??"Select worktree"]})]}),"renderValue"),renderOption:r(k=>{const N=k.workspaceId?Jo:k.mode==="isolated_workspace"?dT:k.mode==="agent_default"?_E:k.mode==="operator_branch"?Jo:bi;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N,{className:"size-4 shrink-0 text-ink-3","aria-hidden":!0}),(0,a.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,a.jsx)("span",{className:"truncate",children:k.label}),(0,a.jsx)("span",{className:"truncate text-xs text-ink-3",children:k.description})]})]})},"renderOption"),listFooter:c||d||i.length===0?(0,a.jsx)("div",{className:"border-t border-line px-3 py-2 text-xs text-ink-3",role:"status",children:c?"Loading existing worktrees…":d?(0,a.jsxs)("span",{className:"flex items-center justify-between gap-2",children:["Couldn't load worktrees.",(0,a.jsx)("button",{type:"button",className:"rounded px-2 py-1 text-ink hover:bg-bg-3",onClick:m,children:"Retry"})]}):"No existing worktrees yet. Choose New worktree to start one."}):void 0})}r(iP,"ComposerWorktreePicker");var pW={standard:"Standard",low_trust_review:"Low-trust review"},hW={standard:"Organization-visible collaboration. This is the default for normal work.",low_trust_review:"Contained for hostile or untrusted input. Narrow Wardmote API, quarantined output. Use for PR review and external-content triage."};function rP(e){return e?.trustPreset==="low_trust_review"?Fs:pk}r(rP,"getTrustPreset");function lP(e){return{...e??{},trustPreset:Fs,reviewPreset:{id:Fs,version:1,rawOutputDisposition:fk}}}r(lP,"buildLowTrustReviewPolicy");function xC(e,t){const i=e??{};if(t==="low_trust_review")return{...i,canCreateAgents:!1,trustPreset:Fs,authorizationPolicy:lP(i.authorizationPolicy)};const l={...i.authorizationPolicy??{}};return delete l.trustPreset,delete l.reviewPreset,delete l.trustBoundary,{...i,trustPreset:pk,authorizationPolicy:l}}r(xC,"buildPermissionsForTrustPreset");function gW(e){const t=e?.authorizationPolicy?.trustBoundary;return t?.mode==="low_trust_review"?t:null}r(gW,"getLowTrustBoundary");function bc(e){return(e?.projectIds?.length??0)+(e?.rootIssueId?1:0)+(e?.issueIds?.length??0)}r(bc,"countBoundaryTargets");function oP(e){if(!e||bc(e)!==1)return null;const t=e.projectIds?.[0];if(t)return{type:"project",id:t};if(e.rootIssueId)return{type:"root_issue",id:e.rootIssueId};const i=e.issueIds?.[0];return i?{type:"issue",id:i}:null}r(oP,"getSingleLowTrustBoundaryTarget");function xW(e){return bc(e)<=1}r(xW,"isCeLowTrustBoundaryEditable");function bW(e,t,i){const l=xC(e,Fs),c=l.authorizationPolicy??{},{projectIds:d,rootIssueId:m,issueIds:f,...h}=c.trustBoundary??{mode:"low_trust_review"},g={...h,mode:Fs,companyId:t,...i.type==="project"?{projectIds:[i.id]}:{},...i.type==="root_issue"?{rootIssueId:i.id}:{},...i.type==="issue"?{issueIds:[i.id]}:{}};return{...l,authorizationPolicy:{...c,trustPreset:Fs,reviewPreset:{id:Fs,version:1,rawOutputDisposition:fk},trustBoundary:g}}}r(bW,"setSingleLowTrustBoundaryTarget");function vW(e){const t=xC(e,Fs),i=t.authorizationPolicy??{},l=i.trustBoundary;if(!l)return t;const{projectIds:c,rootIssueId:d,issueIds:m,...f}=l;return{...t,authorizationPolicy:{...i,trustBoundary:{...f,mode:Fs}}}}r(vW,"clearSingleLowTrustBoundaryTarget");function yW(e){const t=oP(e);return t?.type==="project"?`Project ${t.id.slice(0,8)}`:t?.type==="root_issue"?`Root issue ${t.id.slice(0,8)}`:t?.type==="issue"?`Issue ${t.id.slice(0,8)}`:!e||bc(e)===0?"No boundary selected":`${bc(e)} boundaries`}r(yW,"summarizeLowTrustBoundaryTarget");function jW(e){return bc(e)>0}r(jW,"lowTrustBoundaryHasScope");function wW(e){return!e||e.preset!=="low_trust_review"?null:e.disposition==="promoted"?"Promoted from low-trust":"Low-trust source"}r(wW,"sourceTrustLabel");var O0="wardmote:issue-draft",cP=800;function Vj(){if(typeof window>"u"||!window.visualViewport)return null;const{height:e,offsetTop:t}=window.visualViewport;return!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<0?null:{height:e,offsetTop:t,constrained:e<window.innerHeight}}r(Vj,"readVisualViewportLayout");function uP(e){const[t,i]=(0,b.useState)(()=>e?Vj():null);return(0,b.useEffect)(()=>{if(!e){i(null);return}const l=window.visualViewport;if(!l)return;const c=r(()=>{const d=Vj();d&&i(d)},"updateLayout");return c(),l.addEventListener("resize",c),l.addEventListener("scroll",c),window.addEventListener("resize",c),()=>{l.removeEventListener("resize",c),l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[e]),t}r(uP,"useVisualViewportLayout");function dP(){try{const e=localStorage.getItem(O0);return e?JSON.parse(e):null}catch{return null}}r(dP,"loadDraft");function fP(e){localStorage.setItem(O0,JSON.stringify(e))}r(fP,"saveDraft");function mP(){localStorage.removeItem(O0)}r(mP,"clearDraft");function pP(e){const t=e.name.toLowerCase();return t.endsWith(".md")||t.endsWith(".markdown")||t.endsWith(".txt")||e.type==="text/markdown"||e.type==="text/plain"}r(pP,"isTextDocumentFile");function hP(e){return e.replace(/\.[^.]+$/,"")}r(hP,"fileBaseName");function gP(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"document"}r(gP,"slugifyDocumentKey");function xP(e){return e.split(/[-_ ]+/g).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}r(xP,"titleizeFilename");function bP(e,t){const i=new Set(t.filter(c=>c.kind==="document").map(c=>c.documentKey).filter(c=>!!c));if(!i.has(e))return e;let l=2;for(;i.has(`${e}-${l}`);)l+=1;return`${e}-${l}`}r(bP,"createUniqueDocumentKey");function Qj(e){return e.size<1024?`${e.size} B`:e.size<1048576?`${(e.size/1024).toFixed(1)} KB`:`${(e.size/1048576).toFixed(1)} MB`}r(Qj,"formatFileSize");function L0(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}r(L0,"isRecord$1");function vP(e){return L0(e)&&e.type==="user_secret_ref"&&typeof e.key=="string"&&e.key.trim().length>0&&e.required!==!1&&e.allowMissingOverride!==!0}r(vP,"isRequiredUserSecretBinding");function yP(e){return L0(e)?Object.values(e).flatMap(t=>vP(t)?[t.key.trim()]:[]):[]}r(yP,"collectRequiredUserSecretKeysFromEnv");function jP(e){return[...new Set(e.flatMap(yP))]}r(jP,"uniqueRequiredUserSecretKeys");function wP(e,t){return!!t&&(e==="todo"||e==="in_progress")}r(wP,"shouldWarnAboutRunUserSecrets");function Zu(e,t){return typeof e.executionWorkspaceId=="string"&&e.executionWorkspaceId.length>0?"reuse_existing":typeof e.executionWorkspaceMode=="string"&&e.executionWorkspaceMode.length>0?e.executionWorkspaceMode:yd(t)}r(Zu,"defaultExecutionWorkspaceModeForIssueDefaults");function kP(e){const t=e.code==="Period"||e.key===".";return(e.metaKey||e.ctrlKey)&&t}r(kP,"isWorkModePeriodShortcut");function SP(e){return e.metaKey&&e.key==="Escape"}r(SP,"isWorkModeEscapeShortcut");function NP(){const{visible:e}=Cz(),{newIssueOpen:t,newIssueDefaults:i,closeNewIssue:l}=Ec(),c=uP(t),d=(0,b.useRef)(null),{companies:m,selectedCompanyId:f}=bt(),h=Rn(),g=xa(),{pushToast:v}=Si(),[y,j]=(0,b.useState)(""),[k,N]=(0,b.useState)(!1),[S,D]=(0,b.useState)(""),R=(0,b.useRef)(""),E=(0,b.useRef)(""),[C,I]=(0,b.useState)("todo"),[O,z]=(0,b.useState)(""),[B,L]=(0,b.useState)(""),[_,U]=(0,b.useState)(""),[F,Y]=(0,b.useState)(""),[se,me]=(0,b.useState)(""),[oe,$]=(0,b.useState)(""),[T,te]=(0,b.useState)(""),[ce,ae]=(0,b.useState)(""),Ce=Yk(),ue=Ce.clear,we=Ce.set,[Ae,je]=(0,b.useState)(!0),[he,Te]=(0,b.useState)("new"),[Ve,De]=(0,b.useState)("shared_workspace"),[Se,ut]=(0,b.useState)(""),[wt,kt]=(0,b.useState)("standard"),[$t,le]=(0,b.useState)(!1),{isMobile:Ue}=Zn(),[Fe,it]=(0,b.useState)([]),[Vt,Qt]=(0,b.useState)(!1),V=(0,b.useRef)(null),Ct=(0,b.useRef)(null),_e=(0,b.useRef)(null),ze=(0,b.useRef)(!1),Je=(0,b.useRef)(!1),rt=(0,b.useRef)(null),At=jf(f),Wt=!!i.parentId,mn=i.parentIdentifier??(i.parentId?i.parentId.slice(0,8):""),Zt=i.executionWorkspaceId??"",_t=i.parentExecutionWorkspaceLabel??Zt,{data:Et}=be({queryKey:P.agents.list(f),queryFn:r(()=>Pa.list(f),"queryFn"),enabled:!!f&&t}),{data:ln}=be({queryKey:P.projects.list(f),queryFn:r(()=>ir.list(f),"queryFn"),enabled:!!f&&t}),{data:Qn}=be({queryKey:P.issues.mentionPool(f),queryFn:r(()=>dn.list(f,{limit:100,sortField:"updated",sortDir:"desc"}),"queryFn"),enabled:!!f&&t,staleTime:6e4}),{data:dt,isFetched:wn}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn")}),{data:Dt,isFetched:an}=be({queryKey:P.access.companyUserDirectory(f),queryFn:r(()=>wi.listUserDirectory(f),"queryFn"),enabled:!!f&&t}),{data:Mt}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn"),enabled:t,retry:!1}),pt=dt?.user?.id??dt?.session?.userId??null,Pe=(0,b.useMemo)(()=>ln??[],[ln]),{orderedProjects:Me}=pC({projects:Pe,companyId:f,userId:pt}),$e=Me.find(Z=>Z.id===T),Ot=!!(Mt?.enableIsolatedWorkspaces===!0?$e?.executionWorkspacePolicy??null:null)?.enabled,lt=e&&Ot,{data:zt,isPending:Jt,isError:Lt,refetch:pn}=be({queryKey:P.executionWorkspaces.summaryList(f,{projectId:T,reuseEligible:!0}),queryFn:r(()=>Rf.listSummaries(f,{projectId:T,reuseEligible:!0}),"queryFn"),enabled:!!f&&t&<,retry:!1}),{data:hn,isError:on,refetch:An}=be({queryKey:P.issues.detail(i.parentId??""),queryFn:r(()=>dn.get(i.parentId),"queryFn"),enabled:t&&!!i.parentId,retry:!1}),Dn=Wt&&!hn,Ja=hn?.visibility==="private"||hn?.project?.visibility==="private",ma=(hn?.project?.visibility==="private"?hn.project:null)??(!$t&&$e?.visibility==="private"?$e:null),Aa=hn?.visibility==="private"?`Subtask of private task ${hn.title||i.parentTitle||mn}`:ma?`In private project ${ma.name}`:void 0,es=$t||Ja||Me.some(Z=>Z.id===T&&Z.visibility==="private"),pa=(0,b.useMemo)(()=>Pl(B),[B]),xt=pa.assigneeAgentId,kn=pa.assigneeUserId,Jn=(0,b.useMemo)(()=>(Et??[]).find(Z=>Z.id===xt)??null,[Et,xt]),Os=(0,b.useMemo)(()=>Uz({agents:Et,projects:Me,members:Dt?.users,issues:Qn}),[Et,Dt?.users,Me,Qn]),Kn=bn({mutationFn:r(async({companyId:Z,stagedFiles:Ne,navigateOnCreate:Ke,...Xe})=>{const Qe=await dn.create(Z,Xe),ft=[];for(const vt of Ne)try{if(vt.kind==="document"){const un=await vt.file.text();await dn.upsertDocument(Qe.id,vt.documentKey??"document",{title:vt.documentKey==="plan"?null:vt.title??null,format:"markdown",body:un,baseRevisionId:null})}else await dn.uploadAttachment(Z,Qe.id,vt.file)}catch(un){ft.push({name:vt.file.name,message:un instanceof Error?un.message:"Upload failed"})}return{issue:Qe,companyId:Z,failures:ft,navigateOnCreate:Ke}},"mutationFn"),onSuccess:r(({issue:Z,companyId:Ne,failures:Ke,navigateOnCreate:Xe})=>{Wd(Z.projectId??"",Ne),Z.assigneeAgentId&&Ld(Z.assigneeAgentId,Ne),Z.assigneeUserId&&Od(Z.assigneeUserId,Ne),EM(Z,pt),h.invalidateQueries({queryKey:P.issues.list(Ne)}),h.invalidateQueries({queryKey:P.issues.listMineByMe(Ne)}),h.invalidateQueries({queryKey:P.issues.listTouchedByMe(Ne)}),h.invalidateQueries({queryKey:P.issues.listUnreadTouchedByMe(Ne)}),h.invalidateQueries({queryKey:P.sidebarBadges(Ne)}),V.current&&clearTimeout(V.current);const Qe=(m.find(un=>un.id===Ne)?.issuePrefix??"").trim(),ft=Z.identifier??Z.id,vt=Qe?{label:`Open ${ft}`,href:`/${Qe}/issues/${ft}`}:void 0;Ke.length>0?v({title:`Created ${ft} with upload warnings`,body:`${Ke.length} staged ${Ke.length===1?"file":"files"} could not be added: ${Ke.map(un=>`${un.name} (${un.message})`).join(", ")}`,tone:"warn",action:vt}):v({title:`Created ${ft}`,tone:"success",action:vt}),mP(),ba(),l(),Xe&&g(vt?.href??`/issues/${ft}`)},"onSuccess")}),bs=(0,b.useCallback)(Z=>{V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{(Z.title.trim()||Z.description.trim())&&fP(Z)},cP)},[]),Wn=(0,b.useCallback)((Z,Ne)=>{N(!!Z),R.current=Z,E.current=Ne,j(Z),D(Ne)},[]),Sn=(0,b.useCallback)((Z={})=>{if(!t)return;const Ne=Z.title??R.current,Ke=Z.description??E.current;bs({title:Ne,description:Ke,status:C,priority:O,assigneeValue:B,reviewerValue:_,approverValue:F,watchdogAgentId:se,watchdogInstructions:oe,projectId:T,projectWorkspaceId:ce,executionWorkspaceMode:Ve,selectedExecutionWorkspaceId:Se,workMode:wt,isPrivate:$t,runSettings:Ce.values})},[t,bs,C,O,B,_,F,se,oe,T,ce,Ve,Se,wt,$t,Ce.values]),Ua=(0,b.useCallback)(Z=>{E.current=Z,D(Z),Sn({description:Z})},[Sn]);(0,b.useEffect)(()=>{t&&Sn()},[C,O,B,_,F,se,oe,T,ce,Ve,Se,wt,t,Sn]),(0,b.useEffect)(()=>{if(!t){_e.current=null,ze.current=!1,Je.current=!1;return}const Z=`${f??""}:${JSON.stringify(i)}`;if(_e.current===Z)return;_e.current=Z,Ct.current=null;const Ne=dP();if(Je.current=i.projectId===void 0&&!i.parentId,ze.current=!i.assigneeAgentId&&!i.assigneeUserId,ue(),le(!1),Kn.reset(),i.parentId){const Ke=qu(i.workMode)?i.workMode:"standard",Xe=i.projectId??"",Qe=Me.find(Ln=>Ln.id===Xe),ft=i.projectWorkspaceId!==void 0,vt=i.projectWorkspaceId??Rr(Qe),un=Zu(i,Qe);Wn(i.title??"",i.description??""),I(i.status??"todo"),z(i.priority??""),te(Xe),ae(vt),L(Mr(i)),De(un),kt(Ke),ut(i.executionWorkspaceId??""),Ct.current=(ft||Qe)&&Xe||null}else if(i.title||i.description){const Ke=qu(i.workMode)?i.workMode:"standard";Wn(i.title??"",i.description??""),I(i.status??"todo"),z(i.priority??"");const Xe=i.projectId??"",Qe=Me.find(vt=>vt.id===Xe),ft=i.projectWorkspaceId!==void 0;te(Xe),ae(i.projectWorkspaceId??Rr(Qe)),L(Mr(i)),U(""),Y(""),me(""),$(""),De(Zu(i,Qe)),kt(Ke),ut(i.executionWorkspaceId??""),Ct.current=(ft||i.executionWorkspaceId||Qe)&&Xe||null}else if(Ne&&(Ne.title.trim()||Ne.description.trim())){ze.current=!1,Je.current=!1;const Ke=qu(Ne.workMode)?Ne.workMode:"standard",Xe=i.projectId??Ne.projectId,Qe=Me.find(Ln=>Ln.id===Xe),ft=i.projectWorkspaceId!==void 0,vt=i.executionWorkspaceId!==void 0,un=i.executionWorkspaceMode!==void 0;le(Ne.isPrivate??!1),Wn(Ne.title,Ne.description);for(const[Ln,Ta]of Object.entries(Ne.runSettings??{}))(Ln==="model"||Ln==="thinking")&&we(Ln,Ta??null);I(Ne.status||"todo"),z(Ne.priority),L(i.assigneeAgentId||i.assigneeUserId?Mr(i):Ne.assigneeValue??Ne.assigneeId??""),U(Ne.reviewerValue??""),Y(Ne.approverValue??""),me(Ne.watchdogAgentId??""),$(Ne.watchdogInstructions??""),te(Xe),ae(ft?i.projectWorkspaceId??"":Ne.projectWorkspaceId??Rr(Qe)),De(vt||un?Zu(i,Qe):Ne.executionWorkspaceMode??(Ne.useIsolatedExecutionWorkspace?"isolated_workspace":yd(Qe))),kt(Ke),ut(vt?i.executionWorkspaceId??"":Ne.selectedExecutionWorkspaceId??""),Ct.current=(ft||vt||Ne.projectWorkspaceId||Qe)&&Xe||null}else{kt(qu(i.workMode)?i.workMode:"standard");const Ke=i.projectId??"",Xe=Me.find(ft=>ft.id===Ke),Qe=i.projectWorkspaceId!==void 0;Wn("",""),I(i.status??"todo"),z(i.priority??""),te(Ke),ae(i.projectWorkspaceId??Rr(Xe)),L(Mr(i)),U(""),Y(""),me(""),$(""),De(Zu(i,Xe)),ut(i.executionWorkspaceId??""),Ct.current=(Qe||i.executionWorkspaceId||Xe)&&Ke||null}},[t,i,Me,f,Wn,ue,we]),(0,b.useEffect)(()=>()=>{V.current&&clearTimeout(V.current)},[]);function ba(){rt.current=null,Wn("",""),I("todo"),z(""),L(""),U(""),Y(""),me(""),$(""),te(""),ae(""),ue(),je(!0),Te("new"),De("shared_workspace"),ut(""),kt("standard"),le(!1),it([]),Qt(!1),Ct.current=null,_e.current=null}r(ba,"reset");async function Mn(Z,Ne,Ke){const Xe=R.current.trim(),Qe=Z.trim();if(!f||!Xe&&!Qe||Kn.isPending||Ba||Dn)return;const ft=Ke.model??null,vt=Ke.thinking??null,un=ft||vt?{...ft?{model:ft}:{},...vt?{thinking:vt}:{},inheritToSubtasks:Ae,subtaskScope:he}:null,Ln=Me.find(ns=>ns.id===T),Ta=e&&Mt?.enableIsolatedWorkspaces===!0?Ln?.executionWorkspacePolicy??null:null,zn=ts.find(ns=>ns.id===Se),Ft=Ve==="reuse_existing"?$z(zn?.mode):Ve,Nn=Ta?.enabled?{mode:Ft}:null,ja=lt&&Ve==="reuse_existing"&&zn?zn.projectWorkspaceId:ce,Ka=!e&&i.projectId===T?i.executionWorkspaceId:void 0,Gt=Hz({reviewerValues:_?[_]:[],approverValues:F?[F]:[]}),ga={companyId:f,stagedFiles:Fe,...Xe?{title:Xe}:{},description:Qe||void 0,status:C,priority:O||"medium",workMode:Ne,...es?{visibility:"private"}:{},...xt?{assigneeAgentId:xt}:{},...kn?{assigneeUserId:kn}:{},...i.parentId?{parentId:i.parentId}:{},...i.goalId?{goalId:i.goalId}:{},...T?{projectId:T}:{},...ja?{projectWorkspaceId:ja}:{},...un?{modelOverride:un}:{},...Ta?.enabled?{executionWorkspacePreference:Ve}:{},...lt&&Ve==="reuse_existing"&&Se?{executionWorkspaceId:Se}:{},...Nn?{executionWorkspaceSettings:Nn}:{},...Ka?{executionWorkspaceId:Ka,executionWorkspacePreference:"reuse_existing"}:{},...Gt?{executionPolicy:Gt}:{},...se?{watchdog:{agentId:se,instructions:oe.trim()||null}}:{}},or=JSON.stringify(ga);rt.current?.fingerprint!==or&&(rt.current={fingerprint:or,idempotencyKey:Gd()}),await Kn.mutateAsync({...ga,allowDuplicate:!0,idempotencyKey:rt.current.idempotencyKey,navigateOnCreate:i.navigateOnCreate===!0})}r(Mn,"handleSubmit");function _a(Z){if(kP(Z)){Z.preventDefault(),kt(Ne=>Mh(Ne));return}}r(_a,"handleKeyDown");function _n(Z){Z.length===0||Kn.isPending||it(Ne=>{const Ke=[...Ne];for(const Xe of Z){if(pP(Xe)){const Qe=hP(Xe.name),ft=bP(gP(Qe),Ke);Ke.push({id:`${Xe.name}:${Xe.size}:${Xe.lastModified}:${ft}`,file:Xe,kind:"document",documentKey:ft,title:xP(Qe)});continue}Ke.push({id:`${Xe.name}:${Xe.size}:${Xe.lastModified}`,file:Xe,kind:"attachment"})}return Ke})}r(_n,"stageFiles");function cn(Z){Z.dataTransfer.types.includes("Files")&&(Z.preventDefault(),Qt(!0))}r(cn,"handleFileDragEnter");function Ls(Z){Z.dataTransfer.types.includes("Files")&&(Z.preventDefault(),Z.dataTransfer.dropEffect="copy",Qt(!0))}r(Ls,"handleFileDragOver");function zs(Z){Z.currentTarget.contains(Z.relatedTarget)||Qt(!1)}r(zs,"handleFileDragLeave");function ha(Z){Z.dataTransfer.files.length&&(Z.preventDefault(),Qt(!1),_n(Array.from(Z.dataTransfer.files)))}r(ha,"handleFileDrop");function va(Z){it(Ne=>Ne.filter(Ke=>Ke.id!==Z))}r(va,"removeStagedFile");const vs=xt?(Et??[]).find(Z=>Z.id===xt):null,Ps=rP(vs?.permissions)==="low_trust_review",Pt=(0,b.useMemo)(()=>wP(C,xt)?jP([L0(vs?.adapterConfig)?vs.adapterConfig.env:null,$e?.env??null]):[],[vs?.adapterConfig,$e?.env,xt,C]),ts=zt??[],$a=ts.find(Z=>Z.id===Se),Ba=lt&&Ve==="reuse_existing"&&(Jt||Lt||!$a),ya=Wt&&Ot&&!!Zt&&!(Wt&&Zt&&Ve==="reuse_existing"&&Se===Zt),On=(0,b.useMemo)(()=>C3(),[t]),ys=(0,b.useMemo)(()=>sg(),[t]),Ea=(0,b.useMemo)(()=>[...lS(pt),...fC(Dt?.users,{excludeUserIds:[pt]}),...mS((Et??[]).filter(ag),On).map(Z=>({id:Mr({assigneeAgentId:Z.id}),label:Z.name,searchText:`${Z.name} ${Z.role} ${Z.title??""}`}))],[Et,Dt?.users,pt,On]);(0,b.useEffect)(()=>{if(!t||!f||!ze.current||!Et||!wn||!an||At?.loading)return;ze.current=!1;const Z=new Set(Ea.map(ft=>ft.id)),Ne=Kh(f),Ke=(Ne.length?Ne:Kh().filter(ft=>ft.startsWith("agent:"))).find(ft=>Z.has(ft)),Xe=Et.filter(ag),Qe=Xe.find(ft=>ft.id===At?.primaryAgentId)??Xe.find(ft=>ft.role==="ceo")??Xe[0];L(Ke??(Qe?Mr({assigneeAgentId:Qe.id}):""))},[t,f,Et,Ea,wn,an,At?.loading,At?.primaryAgentId]),(0,b.useEffect)(()=>{if(!t||!f||!Je.current||!ln)return;Je.current=!1;const Z=new Set(Me.filter(Xe=>!Xe.archivedAt).map(Xe=>Xe.id)),Ne=Bz(f),Ke=Ne!==void 0?Z.has(Ne)?Ne:"":sg().find(Xe=>Z.has(Xe))??"";te(Ke)},[t,f,ln,Me]);const ie=(0,b.useMemo)(()=>Me.map(Z=>({id:Z.id,label:Z.name,searchText:Z.description??""})),[Me]),Ee=Fe.filter(Z=>Z.kind==="document"),Oe=Fe.filter(Z=>Z.kind==="attachment"),at=(0,b.useCallback)(Z=>{Je.current=!1,Wd(Z,f??void 0),te(Z);const Ne=Me.find(Ke=>Ke.id===Z);Ct.current=Z||null,ae(Rr(Ne)),De(yd(Ne)),ut("")},[Me,f]);(0,b.useEffect)(()=>{if(!t||!T||Se||Ct.current===T)return;const Z=Me.find(Ne=>Ne.id===T);Z&&(Ct.current=T,ae(Rr(Z)),De(yd(Z)),ut(""))},[t,Me,T,Se]);const gt=(0,b.useMemo)(()=>{const Z={"--new-issue-dialog-top":"var(--new-issue-dialog-top-gap)","--new-issue-dialog-height":"calc(var(--new-issue-visual-viewport-height) - var(--new-issue-dialog-top-gap) - var(--new-issue-dialog-bottom-gap))"};return c?{...Z,"--new-issue-visual-viewport-height":`${c.height}px`,...c.constrained?{top:"var(--new-issue-dialog-top)",maxHeight:"var(--new-issue-dialog-height)",translate:"var(--pct-neg-50)"}:{}}:Z},[c]),qt=(0,b.useMemo)(()=>c?{"--mobile-entity-picker-visual-viewport-height":`${c.height}px`}:{},[c]);(0,b.useEffect)(()=>{if(!c?.constrained)return;const Z=document.activeElement;if(!(Z instanceof HTMLElement)||!d.current?.contains(Z)||typeof Z.scrollIntoView!="function")return;const Ne=window.requestAnimationFrame(()=>{Z.scrollIntoView({block:"nearest"})});return()=>window.cancelAnimationFrame(Ne)},[c]);const Ia=(0,b.useMemo)(()=>new Map((Et??[]).map(Z=>[Z.id,Z])),[Et]);return(0,a.jsx)(Ds,{open:t,onOpenChange:r(Z=>{!Z&&!Kn.isPending&&l()},"onOpenChange"),children:(0,a.jsxs)(Gs,{showCloseButton:!1,"aria-describedby":void 0,style:gt,className:"flex max-h-(--new-issue-dialog-height) flex-col gap-0 overflow-hidden rounded-(--radius-task-composer) border-0 bg-transparent p-0 shadow-none sm:max-w-2xl",onKeyDown:_a,onOpenAutoFocus:r(Z=>{Z.preventDefault(),d.current?.querySelector('[contenteditable="true"]')?.focus()},"onOpenAutoFocus"),onEscapeKeyDown:r(Z=>{Z.defaultPrevented||(SP(Z)?(Z.preventDefault(),kt(Ne=>Mh(Ne))):Kn.isPending&&Z.preventDefault())},"onEscapeKeyDown"),onPointerDownOutside:r(Z=>{const Ne=Z.detail.originalEvent.target;(Kn.isPending||Ne?.closest("[data-radix-popper-content-wrapper], [data-paperclip-floating-ui]"))&&Z.preventDefault()},"onPointerDownOutside"),children:[(0,a.jsx)(Qs,{className:"sr-only",children:Wt?"New sub-task":"New task"}),(0,a.jsx)("div",{ref:d,className:G("min-h-0 overflow-y-auto overscroll-contain",Vt&&"bg-bg-3/20"),onDragEnter:cn,onDragOver:Ls,onDragLeave:zs,onDrop:ha,children:(0,a.jsx)(_3,{mode:"streamlined",children:(0,a.jsx)(Zz,{workMode:wt,onWorkModeChange:kt,disabled:Kn.isPending||!f,placeholder:"Describe a task…",mobile:Ue,mentions:Os,onImageUpload:r(async Z=>{if(!f)throw new Error("No organization selected");return(await fS.uploadImage(f,Z,"issues/drafts")).contentPath},"onImageUpload"),companyId:f,enableReassign:!0,reassignOptions:Ea,agentMap:Ia,currentAssigneeValue:B,onPendingAssigneeChange:r(Z=>{const Ne=Z??"";ze.current=!1;const Ke=Pl(Ne);Ke.assigneeAgentId&&Ld(Ke.assigneeAgentId,f??void 0),Ke.assigneeUserId&&Od(Ke.assigneeUserId,f??void 0),L(Ne),ue(),Ne&&C==="backlog"&&I("todo")},"onPendingAssigneeChange"),creation:{value:S,onChange:Ua,onSubmit:Mn,privacy:Dn?void 0:{private:es,inherited:Aa,onChange:r(Z=>{if(le(Z),!Z&&$e?.visibility==="private"&&at(""),Z&&!T&&pt){const Ne=Me.find(Ke=>Ke.personalOwnerUserId===pt);Ne&&at(Ne.id)}},"onChange")},submitLabel:Wt?"Create sub-task":"Create task",canSubmitWithoutBody:!!y.trim(),onSelectFiles:_n,runSettings:Ce,runSettingsFooter:(0,a.jsx)($E,{inheritToSubtasks:Ae,subtaskScope:he,onInheritChange:je,onScopeChange:Te,testIdPrefix:"new-issue-model-override",disabled:Kn.isPending}),header:k||Wt?(0,a.jsxs)("div",{className:"mb-3 flex flex-col gap-2 text-xs",children:[k?(0,a.jsx)("input",{"aria-label":"Task title",value:y,disabled:Kn.isPending,className:"w-full bg-transparent text-sm text-ink outline-none",onChange:r(Z=>{R.current=Z.target.value,j(Z.target.value),Sn({title:Z.target.value})},"onChange")}):null,Wt?(0,a.jsx)("div",{className:"px-4 pb-2",children:(0,a.jsxs)("div",{className:"max-w-full rounded-md border border-line bg-bg-3/30 px-2.5 py-1.5 text-xs text-ink-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(qS,{className:"h-3.5 w-3.5 shrink-0"}),(0,a.jsx)("span",{className:"shrink-0",children:"Sub-task of"}),(0,a.jsx)("span",{className:"font-medium text-ink",children:mn})]}),i.parentTitle?(0,a.jsx)("div",{className:"pl-5 text-ink/80 truncate",children:i.parentTitle}):null]})}):null]}):void 0,details:(0,a.jsxs)(a.Fragment,{children:[Dn?(0,a.jsxs)("div",{role:on?"alert":"status",className:"mb-2 flex items-center gap-2 text-xs text-ink-3",children:[(0,a.jsx)("span",{children:on?"Couldn't check parent access.":"Checking parent access…"}),on?(0,a.jsx)(pe,{variant:"ghost",size:"sm",onClick:r(()=>{An()},"onClick"),children:"Retry"}):null]}):null,Ba&&!Jt?(0,a.jsx)("p",{role:"alert",className:"mb-2 text-xs text-bad",children:Lt?"Couldn't check the selected worktree. Retry in Worktrees or choose New worktree.":"The selected worktree is no longer available. Choose another worktree or start a new one."}):null,Fe.length>0?(0,a.jsxs)("div",{className:"mt-4 space-y-3 rounded-lg border border-line/70 p-3",children:[Ee.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-ink-3",children:"Documents"}),(0,a.jsx)("div",{className:"space-y-2",children:Ee.map(Z=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 rounded-md border border-line/70 px-3 py-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Bn,{variant:"outline",className:"border-line font-mono text-(length:--text-nano) uppercase tracking-(--tracking-eyebrow) text-ink-3",children:Z.documentKey}),(0,a.jsx)("span",{className:"truncate text-sm",children:Z.file.name})]}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 text-(length:--text-micro) text-ink-3",children:[(0,a.jsx)(Jk,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:Z.title||Z.file.name}),(0,a.jsx)("span",{children:"•"}),(0,a.jsx)("span",{children:Qj(Z.file)})]})]}),(0,a.jsx)(pe,{variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:r(()=>va(Z.id),"onClick"),disabled:Kn.isPending,title:"Remove document",children:(0,a.jsx)(ia,{className:"h-3.5 w-3.5"})})]},Z.id))})]}):null,Oe.length>0?(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-ink-3",children:"Attachments"}),(0,a.jsx)("div",{className:"space-y-2",children:Oe.map(Z=>(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 rounded-md border border-line/70 px-3 py-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(wI,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,a.jsx)("span",{className:"truncate text-sm",children:Z.file.name})]}),(0,a.jsxs)("div",{className:"mt-1 text-(length:--text-micro) text-ink-3",children:[Z.file.type||"application/octet-stream"," • ",Qj(Z.file)]})]}),(0,a.jsx)(pe,{variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:r(()=>va(Z.id),"onClick"),disabled:Kn.isPending,title:"Remove attachment",children:(0,a.jsx)(ia,{className:"h-3.5 w-3.5"})})]},Z.id))})]}):null]}):null,B&&C==="backlog"?(0,a.jsxs)("div",{"data-testid":"new-issue-assigned-backlog-note",className:"mx-4 mb-2 flex items-start gap-2 rounded-md border border-amber-300/70 bg-amber-50/90 px-3 py-2 text-xs text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100",children:[(0,a.jsx)(Yg,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-300"}),(0,a.jsxs)("span",{className:"leading-snug",children:["Assigning implies executable intent - leave status as"," ",(0,a.jsx)("span",{className:"font-medium",children:"Backlog"})," only to deliberately park this. The assignee will not be woken until status moves to ",(0,a.jsx)("span",{className:"font-medium",children:"Todo"})," or"," ",(0,a.jsx)("span",{className:"font-medium",children:"In Progress"}),"."]})]}):null,Jn?.status==="paused"?(0,a.jsx)("div",{"data-testid":"new-issue-paused-assignee-note",className:"mx-4 mb-2",children:(0,a.jsxs)(Ey,{tone:"warning",icon:kS,compact:!0,children:[(0,a.jsx)("span",{className:"font-medium",children:Jn.name})," is paused and will not start work on this task until it is resumed",Jn.pauseReason==="import"?" — it arrived paused from an organization import":"",". You can resume it from the task page after creating the task."]})}):null,Ps?(0,a.jsxs)("div",{"data-testid":"new-issue-low-trust-assignee-note",className:"mx-4 mb-2 flex items-start gap-2 rounded-md border border-amber-300/70 bg-amber-50/90 px-3 py-2 text-xs text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100",children:[(0,a.jsx)(NI,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-300"}),(0,a.jsx)("span",{className:"leading-snug",children:"Low-trust review agent. It can only act inside its assigned review boundary; task, project, or run policy defines the concrete scope."})]}):null,ya?(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsxs)(Ey,{tone:"warning",compact:!0,children:["This sub-task will no longer use the parent task workspace",_t?` (${_t})`:"","."]})}):null,f&&Pt.length>0?(0,a.jsx)(Dz,{companyId:f,definitionKeys:Pt}):null]}),submitDisabled:Ba||Dn,contextBar:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u0,{value:T,options:ie,recentOptionIds:ys,placeholder:"Project",mobileTitle:"Select project",modal:!0,className:"h-8 min-w-0 flex-1 gap-1.5 border-0 bg-transparent px-2 text-xs shadow-none hover:bg-bg-3 focus-visible:bg-bg-3 focus-visible:ring-0 sm:max-w-64 sm:flex-none",disabled:Kn.isPending,triggerDataSlot:"new-issue-compact-control",contentStyle:qt,noneLabel:"No project",noneAtTop:!0,searchPlaceholder:"Search projects...",emptyMessage:"No projects found.",onChange:at,renderTriggerValue:r(Z=>Z&&$e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(bi,{className:"size-3.5 shrink-0",style:{color:$e.color??"var(--project-seed)"},"aria-hidden":!0}),(0,a.jsx)("span",{className:"truncate",children:Z.label}),$e.visibility==="private"?(0,a.jsx)(Ih,{className:"size-3 shrink-0 text-ink-3","aria-label":"Private project"}):null,(0,a.jsx)($r,{className:"size-3 shrink-0 text-ink-3","aria-hidden":!0})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(bi,{className:"size-3.5 shrink-0 text-ink-3","aria-hidden":!0}),(0,a.jsx)("span",{className:"truncate text-ink-3",children:"Project"}),(0,a.jsx)($r,{className:"size-3 shrink-0 text-ink-3","aria-hidden":!0})]}),"renderTriggerValue"),renderOption:r(Z=>{if(!Z.id)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(bi,{className:"size-4 shrink-0 text-ink-3","aria-hidden":!0}),(0,a.jsx)("span",{className:"truncate",children:Z.label})]});const Ne=Me.find(Ke=>Ke.id===Z.id);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(bi,{className:"size-4 shrink-0",style:{color:Ne?.color??"var(--project-seed)"},"aria-hidden":!0}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:Z.label}),Ne?.visibility==="private"?(0,a.jsx)(Ih,{className:"size-3.5 shrink-0 text-ink-3","aria-label":"Private project"}):null]})},"renderOption")}),lt?(0,a.jsx)(iP,{mode:Ve,workspaceId:Se,selectedWorkspaceLabel:$a?.name??(Se===Zt?i.parentExecutionWorkspaceLabel:void 0),workspaces:ts,onChange:r((Z,Ne)=>{if(De(Z),ut(Ne),Ne){const Ke=ts.find(Xe=>Xe.id===Ne);Ke&&ae(Ke.projectWorkspaceId??"")}else ae(Rr($e))},"onChange"),loading:Jt,error:Lt,onRetry:r(()=>{pn()},"onRetry"),disabled:Kn.isPending,mobile:Ue,contentStyle:qt}):null]})}})})})]})})}r(NP,"NewIssueDialog");var bC=r(e=>["project-repositories",e],"repositoryOptionsKey");function CP({companyId:e,selected:t,onChange:i,onConnect:l,disabled:c}){const d=be({queryKey:bC(e),queryFn:r(()=>ir.repositoryOptions(e),"queryFn"),staleTime:3e4}),m=d.isPending?"loading":d.isError?"error":d.data.connectionCount?d.data.failedConnectionCount&&!d.data.repositories.length?"error":d.data.repositories.length?"ready":"empty":"disconnected";return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[(0,a.jsx)(bI,{selected:t.map(f=>d.data?.repositories.find(h=>h.id===f.id)??f),onChange:i,available:d.data?.repositories,state:m,onRetry:r(()=>{d.refetch()},"onRetry"),onConnect:l,disabled:c}),!!d.data?.failedConnectionCount&&d.data.repositories.length>0&&(0,a.jsxs)("div",{role:"alert",className:"flex flex-wrap items-center gap-2 text-xs text-bad",children:["Some GitHub connections could not load. Reconnect them in Apps or try again.",(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"sm",disabled:d.isFetching,onClick:r(()=>{d.refetch()},"onClick"),children:"Try again"})]})]})}r(CP,"ProjectRepositoryInput");function AP(){const{newProjectOpen:e,closeNewProject:t}=Ec(),{selectedCompanyId:i}=bt();return i&&e?(0,a.jsx)(_P,{companyId:i,onClose:t},i):null}r(AP,"NewProjectDialog");function _P({companyId:e,onClose:t}){const i=Rn(),[l,c]=(0,b.useState)(""),[d]=(0,b.useState)(()=>oy[Math.floor(Math.random()*oy.length)]),[m,f]=(0,b.useState)([]),[h,g]=(0,b.useState)(!1),v=(0,b.useRef)(null),y=bn({mutationFn:r(()=>ir.create(e,{name:l.trim(),color:d,status:"planned",repositoryIds:m.map(j=>j.id)}),"mutationFn"),onSuccess:r(j=>{Wd(j.id,e),i.invalidateQueries({queryKey:P.projects.all(e)}),t()},"onSuccess")});return(0,a.jsx)(Ds,{open:!0,onOpenChange:r(j=>{!j&&!y.isPending&&t()},"onOpenChange"),children:(0,a.jsx)(Gs,{showCloseButton:!1,"aria-describedby":void 0,className:"flex max-h-(--sz-calc-18) flex-col gap-0 overflow-hidden p-0 shadow-sm sm:max-w-lg",onOpenAutoFocus:r(j=>{j.preventDefault(),v.current?.focus()},"onOpenAutoFocus"),children:h?(0,a.jsxs)("div",{className:"min-h-0 overflow-y-auto p-5",children:[(0,a.jsx)(Qs,{className:"sr-only",children:"Connect GitHub"}),(0,a.jsx)(V_,{host:"dialog",serviceSlug:"github",forceNewConnection:!0,onCancel:r(()=>g(!1),"onCancel"),onComplete:r(()=>{i.invalidateQueries({queryKey:bC(e)}),g(!1)},"onComplete")})]}):(0,a.jsxs)("form",{className:"flex min-h-0 flex-col overflow-hidden",onSubmit:r(j=>{j.preventDefault(),l.trim()&&!y.isPending&&y.mutate()},"onSubmit"),children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col gap-4 px-5 pb-4 pt-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)(Qs,{className:"text-lg font-semibold",children:"Create project"}),(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm",disabled:y.isPending,"aria-label":"Close new project",onClick:t,children:(0,a.jsx)(ia,{className:"size-4"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-line-strong px-3 focus-within:border-focus focus-within:ring-1 focus-within:ring-focus",children:[(0,a.jsx)(Tk,{color:d,size:"sm"}),(0,a.jsx)("input",{ref:v,"aria-label":"Project name",value:l,disabled:y.isPending,onChange:r(j=>c(j.target.value),"onChange"),placeholder:"Project name",required:!0,className:"h-10 w-full min-w-0 border-0 bg-transparent text-base outline-none placeholder:text-ink-3 md:text-sm"})]})]}),(0,a.jsx)("div",{role:"region","aria-label":"Source repositories",tabIndex:0,className:"min-h-0 overflow-y-auto overscroll-contain px-5 pb-1 outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-focus",children:(0,a.jsx)(CP,{companyId:e,selected:m,onChange:f,onConnect:r(()=>g(!0),"onConnect"),disabled:y.isPending})}),y.isError&&(0,a.jsx)("p",{role:"alert",className:"px-5 pt-3 text-sm text-bad",children:y.error.message}),(0,a.jsxs)("div",{className:"flex shrink-0 justify-end gap-2 px-5 py-5",children:[(0,a.jsx)(pe,{type:"button",variant:"ghost",disabled:y.isPending,onClick:t,children:"Cancel"}),(0,a.jsx)(pe,{type:"submit",disabled:!l.trim()||y.isPending,children:y.isPending?"Creating…":"Create project"})]})]})})})}r(_P,"NewProjectForm");var Wj={list:r(e=>Re.get(`/companies/${e}/goals`),"list"),get:r(e=>Re.get(`/goals/${e}`),"get"),create:r((e,t)=>Re.post(`/companies/${e}/goals`,t),"create"),update:r((e,t)=>Re.patch(`/goals/${e}`,t),"update"),remove:r(e=>Re.delete(`/goals/${e}`),"remove")};function vC(e){return{"--sc":`var(${e})`}}r(vC,"scStyle");function EP(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}r(EP,"sentenceCaseStatus");function IP({status:e,label:t}){return(0,a.jsx)("span",{className:G("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium whitespace-nowrap shrink-0",Nd[e]??"bg-bg-3 text-ink-3"),children:t??e.replace(/[_-]/g," ")})}r(IP,"StatusBadge");function kW({status:e}){const t=nE[e]??"--status-agent-idle",i=e==="active"?"idle":e;return(0,a.jsx)("span",{className:"status-chip inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium leading-none whitespace-nowrap shrink-0",style:vC(t),children:i.replace(/_/g," ")})}r(kW,"AgentStatusBadge");function SW({status:e,externalConversationState:t}){const i=e==="in_review"&&t==="waiting"?"idle":e,l=sE[i]??"--status-task-backlog";return(0,a.jsxs)("span",{className:G("status-chip inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-normal leading-none whitespace-nowrap shrink-0",i==="cancelled"&&"line-through"),style:vC(l),children:[(0,a.jsx)(uE,{status:i,size:"sm"}),EP(i)]})}r(SW,"IssueStatusBadge");var Gj={company:"Organization",team:"Team",agent:"Agent",task:"Task"};function TP(){const{newGoalOpen:e,newGoalDefaults:t,closeNewGoal:i}=Ec(),{selectedCompanyId:l,selectedCompany:c}=bt(),d=Rn(),[m,f]=(0,b.useState)(""),[h,g]=(0,b.useState)(""),[v,y]=(0,b.useState)("planned"),[j,k]=(0,b.useState)("task"),[N,S]=(0,b.useState)(""),[D,R]=(0,b.useState)(!1),[E,C]=(0,b.useState)(!1),[I,O]=(0,b.useState)(!1),[z,B]=(0,b.useState)(!1),L=(0,b.useRef)(null),_=N||t.parentId||"",{data:U}=be({queryKey:P.goals.list(l),queryFn:r(()=>Wj.list(l),"queryFn"),enabled:!!l&&e}),F=bn({mutationFn:r(T=>Wj.create(l,T),"mutationFn"),onSuccess:r(()=>{d.invalidateQueries({queryKey:P.goals.list(l)}),se(),i()},"onSuccess")}),Y=bn({mutationFn:r(async T=>{if(!l)throw new Error("No organization selected");return fS.uploadImage(l,T,"goals/drafts")},"mutationFn")});function se(){f(""),g(""),y("planned"),k("task"),S(""),R(!1)}r(se,"reset");function me(){!l||!m.trim()||F.mutate({title:m.trim(),description:h.trim()||void 0,status:v,level:j,..._?{parentId:_}:{}})}r(me,"handleSubmit");function oe(T){T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),me())}r(oe,"handleKeyDown");const $=(U??[]).find(T=>T.id===_);return(0,a.jsx)(Ds,{open:e,onOpenChange:r(T=>{T||(se(),i())},"onOpenChange"),children:(0,a.jsxs)(Gs,{showCloseButton:!1,className:G("p-0 gap-0",D?"sm:max-w-2xl":"sm:max-w-lg"),onKeyDown:oe,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-line",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-ink-3",children:[c&&(0,a.jsx)("span",{className:"bg-bg-3 px-1.5 py-0.5 rounded text-xs font-medium",children:c.issuePrefix}),(0,a.jsx)("span",{className:"text-ink-3/60",children:"›"}),(0,a.jsx)("span",{children:t.parentId?"New sub-goal":"New goal"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(pe,{variant:"ghost",size:"icon-xs",onClick:r(()=>R(!D),"onClick"),children:D?(0,a.jsx)(XS,{className:"h-3.5 w-3.5"}):(0,a.jsx)(tS,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(pe,{variant:"ghost",size:"icon-xs",onClick:r(()=>{se(),i()},"onClick"),children:(0,a.jsx)("span",{className:"text-lg leading-none",children:"×"})})]})]}),(0,a.jsx)("div",{className:"px-4 pt-4 pb-2 shrink-0",children:(0,a.jsx)("input",{className:"w-full text-lg font-semibold bg-transparent outline-none placeholder:text-ink-3/50",placeholder:"Goal title",value:m,onChange:r(T=>f(T.target.value),"onChange"),onKeyDown:r(T=>{T.key==="Tab"&&!T.shiftKey&&(T.preventDefault(),L.current?.focus())},"onKeyDown"),autoFocus:!0})}),(0,a.jsx)("div",{className:"px-4 pb-2 overflow-y-auto max-h-(--sz-50vh)",children:(0,a.jsx)(qk,{ref:L,value:h,onChange:g,placeholder:"Add description...",bordered:!1,contentClassName:G("text-sm text-ink-3",D?"min-h-(--sz-220px)":"min-h-(--sz-120px)"),imageUploadHandler:r(async T=>(await Y.mutateAsync(T)).contentPath,"imageUploadHandler")})}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 px-4 py-2 border-t border-line flex-wrap",children:[(0,a.jsxs)(xs,{open:E,onOpenChange:C,children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsx)("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-line px-2 py-1 text-xs hover:bg-bg-3/50 transition-colors",children:(0,a.jsx)(IP,{status:v})})}),(0,a.jsx)(gs,{className:"w-40 p-1",align:"start",children:g_.map(T=>(0,a.jsx)("button",{className:G("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50 capitalize",T===v&&"bg-bg-3"),onClick:r(()=>{y(T),C(!1)},"onClick"),children:T},T))})]}),(0,a.jsxs)(xs,{open:I,onOpenChange:O,children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsxs)("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-line px-2 py-1 text-xs hover:bg-bg-3/50 transition-colors",children:[(0,a.jsx)(ff,{className:"h-3 w-3 text-ink-3"}),Gj[j]??j]})}),(0,a.jsx)(gs,{className:"w-40 p-1",align:"start",children:N_.map(T=>(0,a.jsx)("button",{className:G("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",T===j&&"bg-bg-3"),onClick:r(()=>{k(T),O(!1)},"onClick"),children:Gj[T]??T},T))})]}),(0,a.jsxs)(xs,{open:z,onOpenChange:B,children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsxs)("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-line px-2 py-1 text-xs hover:bg-bg-3/50 transition-colors",children:[(0,a.jsx)(Qg,{className:"h-3 w-3 text-ink-3"}),$?$.title:"Parent goal"]})}),(0,a.jsxs)(gs,{className:"w-48 p-1",align:"start",children:[(0,a.jsx)("button",{className:G("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50",!_&&"bg-bg-3"),onClick:r(()=>{S(""),B(!1)},"onClick"),children:"No parent"}),(U??[]).map(T=>(0,a.jsx)("button",{className:G("flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-bg-3/50 truncate",T.id===_&&"bg-bg-3"),onClick:r(()=>{S(T.id),B(!1)},"onClick"),children:T.title},T.id))]})]})]}),(0,a.jsx)("div",{className:"flex items-center justify-end px-4 py-2.5 border-t border-line",children:(0,a.jsx)(pe,{size:"sm",disabled:!m.trim()||F.isPending,onClick:me,children:F.isPending?"Creating…":t.parentId?"Create sub-goal":"Create goal"})})]})})}r(TP,"NewGoalDialog");var sh=r((e,t)=>`/companies/${e}/agents/${t}/dot-binding`,"path"),Ju={create:r(e=>Re.post(`/companies/${e}/dot-invitations`,{}),"create"),connection:r((e,t,i)=>Re.get(sh(e,t),{signal:i}),"connection"),pair:r((e,t,i)=>Re.post(sh(e,t),{replaceBindingId:i}),"pair"),retry:r((e,t,i)=>Re.post(sh(e,t)+"/event-test",{bindingId:i}),"retry")};function RP(e){const t=DP(e),i=MP(e);return`You're invited to join a Wardmote company as an agent.
|
|
16
|
+
|
|
17
|
+
First, respond to your user that you understand the request and are going to onboard into Wardmote. Then work through the steps below.
|
|
18
|
+
|
|
19
|
+
Wardmote onboarding documents to try:
|
|
20
|
+
${t.length>0?t.map(l=>`- ${l}`).join(`
|
|
21
|
+
`):"- (No candidate URLs are available yet.)"}
|
|
22
|
+
|
|
23
|
+
Connectivity guidance:
|
|
24
|
+
Wardmote must be reachable from your runtime. Verify a base URL with: GET <base-url>/api/health
|
|
25
|
+
${t.length===0?`No candidate URLs are available. Ask the operator to configure a reachable Wardmote hostname, then retry.
|
|
26
|
+
Suggested steps for the operator:
|
|
27
|
+
- choose a hostname that resolves to the Wardmote host from your runtime
|
|
28
|
+
- run: npx @tickernelz/wardmote allowed-hostname <host>
|
|
29
|
+
- restart Wardmote
|
|
30
|
+
- verify with: curl -fsS http://<host>:3100/api/health
|
|
31
|
+
- regenerate this agent onboarding prompt`:`If none are reachable, ask the operator to add a reachable Wardmote hostname, restart, and retry.
|
|
32
|
+
Suggested command for the operator:
|
|
33
|
+
- npx @tickernelz/wardmote allowed-hostname <host>
|
|
34
|
+
Then verify with: curl -fsS <base-url>/api/health`}${i?`
|
|
35
|
+
If your runtime exposes a callback or gateway URL, test Wardmote-to-agent reachability with: ${i}?url=<urlencoded-agent-url>.`:""}
|
|
36
|
+
|
|
37
|
+
Join flow:
|
|
38
|
+
1. Read the onboarding.txt document from the first reachable URL above.
|
|
39
|
+
2. Submit an agent join request to the invite registration endpoint.
|
|
40
|
+
3. Use your own agent name for \`agentName\`.
|
|
41
|
+
4. Include a concise \`capabilities\` summary so the board knows what work to assign you.
|
|
42
|
+
5. Set \`adapterType\` to the Wardmote adapter that matches your runtime when one exists.
|
|
43
|
+
6. Put runtime-specific settings in \`agentDefaultsPayload\`.
|
|
44
|
+
7. Wait for board approval before claiming the API key.
|
|
45
|
+
8. Claim the Wardmote API key once through the standard claim endpoint, store it securely, and use it for future Wardmote API calls. Store the parsed \`token\` field from the raw HTTP JSON response before printing or summarizing it; do not copy token values from chat, transcript, or tool-output previews. A token value containing literal \`...\` or \`[redacted]\` is a masked display preview, not a valid key. Do not rotate or invent a Wardmote key manually.
|
|
46
|
+
|
|
47
|
+
After you have connected to Wardmote, review and follow the full onboarding instructions in onboarding.txt.
|
|
48
|
+
|
|
49
|
+
Working through Wardmote:
|
|
50
|
+
${k_}
|
|
51
|
+
`}r(RP,"buildAgentOnboardingPrompt");function DP(e){const t=(e.connectionCandidates??[]).map(d=>d.trim()).filter(Boolean),i=new Set;let l=null;try{l=new URL(e.onboardingTextUrl),i.add(l.toString())}catch{const d=e.onboardingTextUrl.trim();d&&i.add(d)}if(!l){for(const d of t)i.add(d);return Array.from(i)}const c=`${l.pathname}${l.search}`;for(const d of t)try{const m=new URL(d);i.add(`${m.origin}${c}`)}catch{i.add(d)}return Array.from(i)}r(DP,"buildCandidateOnboardingUrls");function MP(e){const t=e.testResolutionUrl?.trim();if(t)return t;try{const i=new URL(e.onboardingTextUrl),l=i.pathname.replace(/\/onboarding\.txt$/,"/test-resolution");return`${i.origin}${l}`}catch{return null}}r(MP,"buildResolutionTestUrl");function OP({children:e,className:t,...i}){const[l,c]=(0,b.useState)(null),d=(0,b.useRef)(null),m=f0();return(0,b.useLayoutEffect)(()=>{const f=l,h=d.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 N=v?.playState==="running"?f.getBoundingClientRect().height:g;if(v?.cancel(),g=k,N===void 0||m||typeof f.animate!="function")return;const S=P3("--motion-ease-out-expo");v=f.animate([{height:`${N}px`},{height:`${k}px`}],{duration:U3("--onboarding-motion-step"),easing:Array.isArray(S)?`cubic-bezier(${S.join(",")})`:S})});return y.observe(h),()=>{y.disconnect(),v?.cancel()}},[l,m]),(0,a.jsx)(Gs,{...i,ref:c,className:G("overflow-hidden p-0",t),children:(0,a.jsx)("div",{ref:d,className:"flex max-h-(--sz-calc-18) shrink-0 flex-col",children:e})})}r(OP,"AnimatedDialogContent");var yC=[{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 LP({onSelect:e,dotDisabledReason:t}){return(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:yC.map(i=>(0,a.jsxs)("button",{type:"button",onClick:r(()=>e(i.id),"onClick"),disabled:i.id==="dot"&&!!t,title:i.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)(jk,{type:i.adapter,className:"size-8"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:i.name}),(0,a.jsx)("span",{className:"sr-only",children:i.description})]},i.id))})}r(LP,"ExternalAgentPresetPicker");var zP=[{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 PP({state:e}){const t={waiting:0,connected:1,subscribed:2,testing:2,finishing:3,ready:3}[e.phase],i=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:zP.map((l,c)=>{const d=c<t,m=c===t&&e.problem==="event_timeout",f=c===t&&!e.problem,h=d?_s:m?Gk:f?za:zE;return(0,a.jsxs)("li",{className:"flex items-start gap-3","aria-current":f?"step":void 0,children:[(0,a.jsx)("span",{className:G("flex size-6 shrink-0 items-center justify-center rounded-full",d?"bg-bg-3 text-ink":m?"text-bad":"text-ink-3"),children:(0,a.jsx)(h,{className:G("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:G("text-sm",d||f||m?"font-medium":"text-ink-3"),children:[l.title,(0,a.jsx)("span",{className:"sr-only",children:d?": complete":m?": needs attention":f?": in progress":": waiting"})]}),d&&(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:G("text-sm leading-relaxed",e.problem&&e.problem!=="prompt_unavailable"?"text-bad":"text-ink-3"),children:i})]})}r(PP,"DotConnectionChecks");function UP({preset:e,prompt:t,companyName:i,connection:l,onSelect:c,onBack:d,onClose:m,onCopied:f,onRetry:h,onNewPrompt:g,dotDisabledReason:v,busy:y=!1,error:j,approvalHref:k}){const N=yC.find(C=>C.id===e),S=e==="dot",D=S&&l.phase==="ready"&&!l.problem,R=S&&l.phase!=="waiting",E=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:[N&&(0,a.jsx)(jk,{type:N.adapter,className:"size-10"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(Qs,{className:"text-xl font-semibold tracking-tight",children:N?S?D?"Your Dot is connected":"Connect your Dot":"Invite your agent":"Invite an external agent"}),(0,a.jsx)(Nc,{className:"text-sm leading-relaxed",children:N?D?`Your Dot can now receive assignments and work with ${i}.`: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.":R?"Your Dot has connected. We’re checking that task updates can travel both ways.":S?"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 ${i}.`})]})]}),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)(pe,{variant:"secondary",disabled:y,onClick:h,children:"Try again"})]}),N?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…"}):S?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"border-t pt-6",children:[(0,a.jsx)(PP,{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)(pe,{variant:"secondary",disabled:y,onClick:h,children:"Retry test event"}),l.problem==="offline"&&(0,a.jsx)(pe,{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 ",i,". You can review its request before granting access."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(LP,{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)(pe,{variant:"ghost",onClick:N?d:m,children:[N&&(0,a.jsx)(Gg,{className:"size-4"}),N?"Back":"Cancel"]}),N&&(k?(0,a.jsx)(pe,{asChild:!0,children:(0,a.jsx)(fn,{to:k,onClick:m,children:"Review approval"})}):D?(0,a.jsx)(pe,{onClick:m,children:"Done"}):R?(0,a.jsxs)(pe,{disabled:!0,"aria-live":"polite",children:[!l.problem&&(0,a.jsx)(za,{className:"size-4 animate-spin motion-reduce:animate-none","aria-hidden":"true"}),E]}):S&&l.problem==="prompt_unavailable"?(0,a.jsx)(pe,{disabled:y,onClick:g,children:"Create a new prompt"}):!t||y?(0,a.jsx)(pe,{disabled:!0,children:y?"Preparing…":"Waiting for Dot…"}):(0,a.jsx)($3,{prompt:t,label:S?"Copy setup prompt":"Copy invitation prompt",title:S?"Connect your Dot":"Invite your agent",description:S?"Send this whole prompt to your Dot in ChatGPT.":"Send this whole prompt to your agent.",agent:S?{name:"Dot",src:"/brands/adapters/openai-dot.svg"}:void 0,align:"end",className:"min-w-0 shrink",onCopied:f},e))]})]})}r(UP,"ExternalAgentInviteContent");function $P({companyId:e,onClose:t,onBack:i}){const l=Rn(),{selectedCompany:c}=bt(),[d,m]=(0,b.useState)(null),[f,h]=(0,b.useState)(null),[g,v]=(0,b.useState)(null),[y,j]=(0,b.useState)(null),[k,N]=(0,b.useState)(""),S=(0,b.useRef)(!1),D=be({queryKey:P.instance.experimentalSettings,queryFn:fa.getExperimental}),R=D.isPending?"Loading available agents…":D.error?"Unable to load feature settings. Try again after refreshing.":!D.data?.enableOpenAiDot||!D.data.enablePublicMcp?"Turn on OpenAI Dot and Assistant connections in Settings > Features.":void 0,E=["dot-binding",e,f?.agent.id],C=be({queryKey:E,queryFn:r(({signal:ce})=>Ju.connection(e,f.agent.id,ce),"queryFn"),enabled:d==="dot"&&!!f,retry:!1,staleTime:0,refetchInterval:r(ce=>ce.state.error||ce.state.data?.agentLifecycleState==="ready"&&ce.state.data.canConfigureConnection&&ce.state.data.binding?.status==="ready"&&ce.state.data.binding.subscriptionVerified?!1:2500,"refetchInterval")}),I=bn({mutationFn:r(async ce=>{if(ce==="dot"){const we=await Ju.create(e);h(we),await l.invalidateQueries({queryKey:P.agents.list(e)});return}const ae=await wi.createCompanyInvite(e,{allowedJoinTypes:"agent",humanRole:null,agentMessage:null});l.invalidateQueries({queryKey:P.access.invites(e,"all",5)});const Ce=ae.onboardingTextUrl??ae.onboardingTextPath??`/api/invites/${ae.token}/onboarding.txt`,ue=await wi.getInviteOnboarding(ae.token).catch(()=>null);N(RP({onboardingTextUrl:new URL(Ce,window.location.origin).href,connectionCandidates:ue?.onboarding.connectivity?.connectionCandidates??null,testResolutionUrl:ue?.onboarding.connectivity?.testResolutionEndpoint?.url??null}))},"mutationFn"),gcTime:0}),O=bn({mutationFn:r(async ce=>{const ae=await Ju.pair(e,f.agent.id,ce);v(ae),j(null)},"mutationFn"),onSuccess:r(()=>{l.invalidateQueries({queryKey:E})},"onSuccess"),onError:r(()=>{C.refetch()},"onError"),gcTime:0}),z=bn({mutationFn:r(()=>Ju.retry(e,f.agent.id,C.data.binding.id),"mutationFn"),onSuccess:r(()=>{l.invalidateQueries({queryKey:E})},"onSuccess")}),B=C.data?.binding,L=d==="dot"&&C.data?.enabled&&!!C.data.resourceUrl&&C.data.canConfigureConnection&&(!B||B.status==="pairing")&&!g&&!C.error&&!O.isError&&!S.current&&(!y||B?.id===y);(0,b.useEffect)(()=>{L&&C.isFetchedAfterMount&&!C.isFetching&&!O.isPending&&(S.current=!0,O.mutate(B?.id))},[L,C.isFetchedAfterMount,C.isFetching,O.isPending,O.mutate,B?.id]),(0,b.useEffect)(()=>{if(!g)return;const ce=window.setTimeout(()=>{S.current=!1,j(g.bindingId),v(null)},Math.max(0,Date.parse(g.expiresAt)-Date.now()));return()=>window.clearTimeout(ce)},[g]);const _=B?.status==="ready"&&B.subscriptionVerified,U=C.data?.agentLifecycleState==="ready"&&C.data.canConfigureConnection,F=["preparing","verifying"].includes(C.data?.agentLifecycleState??"")&&C.data?.canConfigureConnection,Y={phase:_?U?"ready":F?"finishing":"ready":B?.hasPendingChallenge?"testing":B?.subscriptionVerified?"subscribed":B?.connected?"connected":"waiting",problem:C.error?"offline":_&&!U&&!F?"agent_unavailable":B?.status==="pairing"&&!L&&!O.isPending&&!C.isFetching&&!O.isError&&g?.bindingId!==B.id?"prompt_unavailable":B?.challengeExpiresAt&&!B.hasPendingChallenge&&B.status!=="ready"?"event_timeout":void 0},se=(C.data?.agentStatus??f?.agent.status)==="pending_approval",me=C.data&&!C.data.canConfigureConnection&&!se,oe=d==="dot"?g&&g.bindingId===B?.id&&C.data?.resourceUrl&&f?H_({companyId:e,agentId:f.agent.id,resourceUrl:C.data.resourceUrl,...g}):"":k,$=(I.variables===d?I.error:null)??(d==="dot"?(B?.connected?null:O.error)??z.error:null),T=I.isPending||O.isPending||z.isPending||L||d==="dot"&&!!f&&(C.isPending||!oe&&C.isFetching),te=r(()=>{if(me){C.refetch();return}if(C.error){C.refetch();return}if(I.error||!f){d&&I.mutate(d);return}if(O.error&&!B?.connected){O.mutate(B?.status==="pairing"?B.id:void 0);return}z.mutate()},"retry");return(0,a.jsx)(Ds,{open:!0,onOpenChange:r(ce=>{ce||t()},"onOpenChange"),children:(0,a.jsx)(OP,{className:"sm:max-w-(--sz-560px)",children:(0,a.jsx)(UP,{preset:d,prompt:oe,companyName:c?.name??"your organization",connection:Y,dotDisabledReason:R,busy:T,error:$?.message??(me?C.data?.agentLifecycleState==="terminated"?"This agent was terminated. Invite another agent to connect Dot.":"Resume this agent before connecting Dot.":void 0),approvalHref:se&&f?.approvalId?`/approvals/${f.approvalId}`:void 0,onSelect:r(ce=>{m(ce),(ce==="dot"?!f:!k)&&I.mutate(ce)},"onSelect"),onBack:r(()=>m(null),"onBack"),onClose:d?t:i,onCopied:r(()=>{d==="dot"&&C.refetch()},"onCopied"),onRetry:te,onNewPrompt:r(()=>O.mutate(B?.id),"onNewPrompt")})})})}r($P,"ExternalAgentInviteDialog");function BP(){const{newAgentOpen:e,closeNewAgent:t}=Ec(),{selectedCompanyId:i}=bt();return e?(0,a.jsx)(KP,{companyId:i,onClose:t},i):null}r(BP,"NewAgentDialog");function KP({companyId:e,onClose:t}){const i=xa(),[l,c]=(0,b.useState)(!1);return l&&e?(0,a.jsx)($P,{companyId:e,onClose:t,onBack:r(()=>c(!1),"onBack")}):(0,a.jsx)(q_,{open:!0,onClose:t,onInvite:e?()=>c(!0):void 0,onContinue:r(d=>{t(),i(`/agents/new?${Q_(d)}`)},"onContinue")})}r(KP,"NewAgentDialogContent");var qP=[{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 Yj({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(Yj,"KeyCap");function FP(){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"divide-y divide-line border-t border-line",children:qP.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((i,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)(Yj,{children:i})]},i))})]},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)(Yj,{children:"Esc"})," to close · Shortcuts are disabled in text fields"]})})]})}r(FP,"KeyboardShortcutsCheatsheetContent");function HP({open:e,onOpenChange:t}){return(0,a.jsx)(Ds,{open:e,onOpenChange:t,children:(0,a.jsxs)(Gs,{className:"sm:max-w-md gap-0 p-0 overflow-hidden",showCloseButton:!1,children:[(0,a.jsx)(Sc,{className:"px-5 pt-5 pb-3",children:(0,a.jsx)(Qs,{className:"text-base",children:"Keyboard shortcuts"})}),(0,a.jsx)(FP,{})]})})}r(HP,"KeyboardShortcutsCheatsheet");var VP={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"},QP={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 WP({toast:e,onDismiss:t}){const[i,l]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{const c=requestAnimationFrame(()=>l(!0));return()=>cancelAnimationFrame(c)},[]),(0,a.jsx)("li",{className:G("pointer-events-auto rounded-sm border shadow-lg backdrop-blur-xl transition-(--tp-transform-opacity) duration-200 ease-out",i?"translate-y-0 opacity-100":"translate-y-3 opacity-0",VP[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)(sr,{agent:{id:e.actor.id,name:e.actor.name,appearance:e.actor.appearance},size:24}):e.actor?.type==="user"?(0,a.jsxs)(Id,{size:"sm","aria-hidden":"true",children:[e.actor.image&&(0,a.jsx)(_d,{src:e.actor.image,alt:""}),(0,a.jsx)(Ed,{children:qI(e.actor.name)})]}):(0,a.jsx)("span",{className:G("mt-1 h-2 w-2 shrink-0 rounded-full",QP[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)(fn,{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(WP,"AnimatedToast");function GP(){const e=FI(),{dismissToast:t}=Si();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(i=>(0,a.jsx)(WP,{toast:i,onDismiss:t},i.id))})})}r(GP,"ToastViewport");async function Xj(e,t){const i=await fetch(`/api/announcements/${e}`,{credentials:"same-origin",cache:"no-store",...t});if(!i.ok)throw new ji("Announcement request failed",i.status,null);return i}r(Xj,"request");var Zj={async current(e){const t=await(await Xj("current",{signal:e})).json();return t===null?null:h_.parse(t)},async dismiss(e,t,i){await Xj(`${encodeURIComponent(e)}/dismiss`,{method:"POST",signal:i,headers:{"Content-Type":"application/json"},body:JSON.stringify({companyId:t})})}},ig=new Map;function z0(e){return`wardmote.announcement-dismissals.v1:${encodeURIComponent(e)}:`}r(z0,"announcementStoragePrefix");function ed(e){const t=z0(e),i=new Map;try{for(let l=0;l<localStorage.length;l++){const c=localStorage.key(l);if(!c?.startsWith(t))continue;const d=c.slice(t.length),m=localStorage.getItem(c);gk.safeParse(d).success&&(m==="pending"||m==="synced")&&ig.set(c,m==="pending")}}catch{}for(const[l,c]of ig)l.startsWith(t)&&i.set(l.slice(t.length),c);return i}r(ed,"readAnnouncementDismissals");function ih(e,t,i){const l=`${z0(e)}${t}`;ig.set(l,i);try{return localStorage.setItem(l,i?"pending":"synced"),!0}catch{return!1}}r(ih,"saveAnnouncementDismissal");var YP=3e3;function XP(e){const{userId:t,enabled:i}=e,l=(0,b.useRef)(e);l.current=e;const[c,d]=(0,b.useState)(null),m=(0,b.useRef)(()=>{});(0,b.useEffect)(()=>{if(d(null),!t||!i)return;let h=!1,g=0,v=null,y;const j=new Map,k=new Set,N=z0(t);let S=null;try{S=new BroadcastChannel(N)}catch{}const D=r(()=>!h&&l.current.userId===t&&l.current.enabled,"active");async function R(_,U=!0){if(!D()||j.has(_)||!l.current.companyId)return;const F=new AbortController;j.set(_,F);const Y=setTimeout(()=>F.abort(),1e4);try{await Zj.dismiss(_,l.current.companyId,F.signal),D()&&ih(t,_,!1)}catch{D()&&!k.has(_)&&(k.add(_),l.current.onSaveFailure(U))}finally{clearTimeout(Y),j.delete(_)}}r(R,"sync");async function E(){for(const[_,U]of ed(t)){if(!D())return;U&&await R(_)}}r(E,"flush");function C(){g++,clearTimeout(y),v?.abort(),v=null,d(null)}r(C,"suspend");function I(){if(!D()||document.visibilityState==="hidden")return;C();const _=g,U=new AbortController;v=U;const F=r(()=>D()&&g===_&&!U.signal.aborted,"stillCurrent");let Y=!1,se=!1,me=null;const oe=r(()=>{!F()||!Y||!se||me&&!ed(t).has(me.id)&&(!me.expiresAt||Date.parse(me.expiresAt)>Date.now())&&d({userId:t,announcement:me})},"show");y=setTimeout(()=>{Y=!0,oe()},YP),E(),Zj.current(U.signal).then($=>{me=$,se=!0,oe()}).catch(()=>{})}r(I,"resume");function O(){const _=ed(t);d(U=>U?.userId===t&&_.has(U.announcement.id)?null:U)}r(O,"receive");function z(_){_.key?.startsWith(N)&&O()}r(z,"onStorage");function B(){document.visibilityState==="hidden"?C():I()}r(B,"onVisibility");function L(){E()}return r(L,"onOnline"),S&&(S.onmessage=_=>{const U=gk.safeParse(_.data);U.success&&(ed(t).has(U.data)||ih(t,U.data,!0),O())}),m.current=_=>{if(!D())return;const U=ih(t,_,!0);d(null),g++,v?.abort();try{S?.postMessage(_)}catch{}R(_,U)},document.addEventListener("visibilitychange",B),window.addEventListener("online",L),window.addEventListener("storage",z),I(),()=>{h=!0,g++,clearTimeout(y),v?.abort();for(const _ of j.values())_.abort();S?.close(),document.removeEventListener("visibilitychange",B),window.removeEventListener("online",L),window.removeEventListener("storage",z),m.current=()=>{}}},[t,i]);const f=i&&c?.userId===t?c.announcement:null;return(0,b.useEffect)(()=>{if(!f?.expiresAt)return;let h;const g=r(()=>{const v=Date.parse(f.expiresAt)-Date.now();v<=0?d(null):h=setTimeout(g,Math.min(v,2147483647))},"check");return g(),()=>clearTimeout(h)},[f]),{announcement:f,dismiss:(0,b.useCallback)(h=>m.current(h),[])}}r(XP,"useAnnouncement");function ZP(e,t){const i=f0(),l=t??`/api/announcements/${encodeURIComponent(e.id)}/animation`,c=`${l}:${e.animation?.path??""}`,[d,m]=(0,b.useState)(null),f=!!e.animation&&!i;return(0,b.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||m({key:c,document:`<meta http-equiv="Content-Security-Policy" content="${w_}">${y}`})}catch{}finally{clearTimeout(g)}})(),()=>{h.abort(),clearTimeout(g)}},[f,c,l]),f&&d?.key===c?d.document:null}r(ZP,"useAnnouncementAnimation");function Jj({action:e,primary:t,onClick:i}){const l=(0,a.jsxs)(a.Fragment,{children:[e.label,!t&&e.kind==="external"&&(0,a.jsx)(RE,{className:"size-3.5 shrink-0","aria-hidden":"true"})]}),c=r(d=>{d.button===1&&i()},"onAuxClick");return(0,a.jsx)(pe,{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:i,onAuxClick:c,children:l}):(0,a.jsx)(fn,{to:e.path,onClick:i,onAuxClick:c,children:l})})}r(Jj,"Action");function JP({announcement:e,onDismiss:t,imageSrc:i,animationSrc:l,className:c}){const d=(0,b.useId)(),[m,f]=(0,b.useState)(null),h=i??`/api/announcements/${encodeURIComponent(e.id)}/image`,g=!!(e.image&&m!==h),v=ZP(e,l),y=!!v;return(0,a.jsxs)(_c,{role:"region","aria-labelledby":d,className:G("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)(pe,{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:G("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:d,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)(Jj,{action:e.secondaryLink,onClick:t}),(0,a.jsx)("div",{className:"ml-auto min-w-0 max-w-full",children:(0,a.jsx)(Jj,{action:e.primaryAction,primary:!0,onClick:t})})]})]})}r(JP,"AnnouncementCard");var eU='[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"], [aria-modal="true"]:not([data-state="closed"]), dialog[open]';function tU(e){const[t,i]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!e)return;const l=r(()=>i(!!document.querySelector(eU)),"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(tU,"useModalOpen");function nU({health:e}){const{userId:t,settled:i}=qg(),{selectedCompanyId:l,loading:c}=bt(),{onboardingOpen:d}=wf(),m=hf(),f=HI(),h=e?.deploymentMode==="local_trusted"?"local-board":i?t:null,{announcement:g,dismiss:v}=XP({userId:h,companyId:l,enabled:!!(h&&!c&&l&&!d),onSaveFailure:r(j=>m?.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=tU(!!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)(JP,{announcement:g,onDismiss:r(()=>v(g.id),"onDismiss")},g.id)})}r(nU,"AnnouncementWell");function Df(e){const t=e.split("/").filter(Boolean);return t.length===1?t[0]?.toLowerCase()==="onboarding":t.length===2?t[1]?.toLowerCase()==="onboarding":!1}r(Df,"isOnboardingPath");function aU(e){const t=e.split("/").filter(Boolean);if(t.length===2&&t[1]?.toLowerCase()==="onboarding")return t[0]}r(aU,"companyPrefixFromOnboardingPath");function jC(){return 3}r(jC,"onboardingStepForCompany");function sU(e){const{pathname:t,companyPrefix:i,companies:l}=e;if(!Df(t))return null;if(!i)return{initialStep:1};const c=l.find(d=>d.issuePrefix.toUpperCase()===i.toUpperCase())??null;return c?{initialStep:jC(),companyId:c.id}:{initialStep:1}}r(sU,"resolveRouteOnboardingOptions");function NW(e){return!e.agentsLoaded||e.agentsRefreshing||e.agentCount>0?!1:!Df(e.pathname)}r(NW,"shouldRouteAgentlessCompanyToOnboarding");function P0(e){return!e.hasCompanies&&!Df(e.pathname)}r(P0,"shouldRedirectCompanylessRouteToOnboarding");function iU(e){return e.onboardingOpen||!e.routeDismissed}r(iU,"isOnboardingWizardActive");function rU({context:e}){const{slots:t,errorMessage:i}=Cc({slotTypes:["appShellOverlay"],companyId:e.companyId});return i||t.length===0?null:(0,a.jsx)("aside",{className:"plugin-app-shell-overlays","aria-label":"Application extensions",children:t.map(l=>(0,a.jsx)(r0,{slot:l,context:e,className:"plugin-app-shell-overlay"},`${l.pluginId}:${l.pluginVersion}:${l.id}`))})}r(rU,"AppShellEntries");function lU({localTrusted:e=!1}){const{userId:t,settled:i}=qg(),{selectedCompanyId:l,selectedCompany:c,loading:d}=bt(),{onboardingOpen:m,onboardingRouteDismissed:f}=wf(),{pathname:h}=vn(),g=i?t??(e?"local-board":null):null,v=m||!f&&Df(h);if(!g||d||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)(rU,{context:y},JSON.stringify([g,l]))}r(lU,"PluginAppShellOverlays");var ew="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 oU({visible:e}){const{selectedCompanyId:t}=bt(),{sidebarOpen:i,setSidebarOpen:l}=Zn(),c=b0(t),{enabled:d}=xf(),{enabled:m}=Tf(),f=(0,b.useMemo)(()=>[{to:"/dashboard",label:"Home",icon:pT},...m?[]:[{to:"/inbox",label:"Inbox",icon:Xg,badge:c.inbox}],{to:"/issues",label:"Tasks",icon:Eh,badge:m?c.inbox:void 0},...d?[{to:"/chats",label:"Chat",icon:Vh}]:[]],[c.inbox,d,m]);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)(_k,{to:h.to,state:pf,className:r(({isActive:v})=>G(ew,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:G("h-(--sz-18px) w-(--sz-18px)",v&&"stroke-(length:--sw-2_3)")}),h.badge!=null&&h.badge>0&&(0,a.jsx)(Bn,{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":i,onClick:r(()=>l(!0),"onClick"),className:G(ew,i?"text-ink":"text-ink-3"),children:[(0,a.jsx)(QS,{className:"h-(--sz-18px) w-(--sz-18px)"}),(0,a.jsx)("span",{className:"truncate",children:"More"})]})]})})}r(oU,"MobileBottomNav");function Ml(e){if(typeof document>"u")return null;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content")?.trim();return t||null}r(Ml,"readMetaContent");function rg(e){if(!e)return null;const t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]{3}$/.test(t)?`#${t.split("").map(i=>`${i}${i}`).join("").toLowerCase()}`:/^[0-9a-fA-F]{6}$/.test(t)?`#${t.toLowerCase()}`:null}r(rg,"normalizeHexColor");function cU(e){const t=rg(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(cU,"hexToRgb");function rh(e){const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}r(rh,"relativeLuminanceChannel");function uU(e){const{r:t,g:i,b:l}=cU(e),c=.2126*rh(t)+.7152*rh(i)+.0722*rh(l);return 1.05/(c+.05)>=(c+.05)/.05?D3:M3}r(uU,"pickReadableTextColor");function CW(){return Ml("wardmote-worktree-enabled")==="true"}r(CW,"isWorktreeRuntime");function AW(){return Ml("wardmote-instance-id")}r(AW,"getWorktreeInstanceId");function dU(){if(Ml("wardmote-worktree-enabled")!=="true")return null;const e=Ml("wardmote-worktree-name"),t=rg(Ml("wardmote-worktree-color"));return!e||!t?null:{enabled:!0,name:e,color:t,textColor:rg(Ml("wardmote-worktree-text-color"))??uU(t)}}r(dU,"getWorktreeUiBranding");function fU(){const e=dU(),{copied:t,failed:i,copy:l}=B3(),c=(0,b.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!":i?"Copy failed":e.name})]})}):null}r(fU,"WorktreeBanner");var mU=3e4;function pU(e){if(!e)return null;const t=new Date(e).getTime();if(Number.isNaN(t))return null;const i=Date.now()-t;if(i<6e4)return"just now";const l=Math.round(i/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(pU,"formatRelativeTimestamp");function hU(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(hU,"describeReason");function gU({devServer:e}){const[t,i]=(0,b.useState)(!1);if((0,b.useEffect)(()=>{if(!t)return;const h=window.setTimeout(()=>{i(!1)},mU);return()=>window.clearTimeout(h)},[t]),!e?.enabled||!e.restartRequired)return null;const l=e,c=pU(e.lastChangedAt),d=e.changedPathsSample.slice(0,3),m=`${e.activeRunCount} live run${e.activeRunCount===1?"":"s"}`;async function f(){const h=l.activeRunCount>0?`Restart Wardmote now? This may interrupt ${m}.`:"Restart Wardmote now?";if(window.confirm(h)){i(!0);try{await Ac.requestDevServerRestart()}catch(g){i(!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)(ki,{className:"h-3.5 w-3.5 shrink-0"}),(0,a.jsx)("span",{children:"Restart Required"}),e.autoRestartEnabled?(0,a.jsx)(Bn,{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:[hU(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:[d.length>0?(0,a.jsxs)("span",{children:["Changed: ",d.join(", "),e.changedPathCount>d.length?` +${e.changedPathCount-d.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)(TT,{className:"h-3.5 w-3.5"}),(0,a.jsxs)("span",{children:["Waiting for ",m," 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)(ec,{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)(ec,{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)(pe,{variant:"primary",size:"sm",type:"button",onClick:r(()=>{f()},"onClick"),disabled:t,children:[(0,a.jsx)(ec,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:t?"Restart requested":"Restart now"})]})]})]})})}r(gU,"DevRestartBanner");var wC=["standalone","fullscreen","window-controls-overlay"];function xU(e){return`(display-mode: ${e})`}r(xU,"displayModeQuery");function bU(){if(!(typeof window>"u"||typeof window.matchMedia!="function"))return window.matchMedia.bind(window)}r(bU,"defaultMatchMedia");function lg(e=bU(),t=typeof navigator>"u"?void 0:navigator.standalone){return t===!0?!0:e?wC.some(i=>e(xU(i)).matches):!1}r(lg,"isChromelessDisplayMode");function td({label:e,children:t,onClick:i}){return(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{asChild:!0,children:(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm",className:"size-8","aria-label":e,onClick:r(()=>{i()},"onClick"),children:t})}),(0,a.jsx)(Cs,{children:e})]})}r(td,"ControlButton");function vU(e=typeof window>"u"?null:window.history.state){const t=e?.idx;return typeof t=="number"&&t>0}r(vU,"hasInAppHistory");function yU(){const[e,t]=(0,b.useState)(()=>typeof window<"u"?lg():!1);return(0,b.useEffect)(()=>{if(typeof window>"u")return;const i=r(()=>t(lg()),"update");if(i(),typeof window.matchMedia!="function")return;const l=wC.map(c=>window.matchMedia(`(display-mode: ${c})`));return l.every(c=>typeof c.addEventListener=="function")?(l.forEach(c=>c.addEventListener("change",i)),()=>l.forEach(c=>c.removeEventListener("change",i))):(l.forEach(c=>c.addListener(i)),()=>l.forEach(c=>c.removeListener(i)))},[]),e}r(yU,"useChromeless");function tw({mobile:e,onNavigateHome:t}){const i=yU(),l=hf(),c=(0,b.useCallback)(()=>{if(vU()){window.history.back();return}t?t():window.location.assign("/dashboard")},[t]),d=(0,b.useCallback)(()=>{window.location.reload()},[]),m=(0,b.useCallback)(async()=>{const h=window.location.href;try{if(navigator.share){await navigator.share({title:document.title||"Wardmote",url:h});return}await d0(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,b.useCallback)(()=>{window.open(window.location.href,"_blank","noopener,noreferrer")},[]);return i?(0,a.jsxs)("div",{className:G("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)(td,{label:"Back",onClick:c,children:(0,a.jsx)(Gg,{className:"h-4 w-4"})}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)(td,{label:"Refresh",onClick:d,children:(0,a.jsx)(Gl,{className:"h-4 w-4"})}),(0,a.jsx)(td,{label:"Share",onClick:m,children:(0,a.jsx)(NT,{className:"h-4 w-4"})}),(0,a.jsx)(td,{label:"Open in Browser",onClick:f,children:(0,a.jsx)(aI,{className:"h-4 w-4"})})]}):null}r(tw,"StandaloneBrowserControls");function jU(e){return e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}r(jU,"formatTime");function wU(){const e=Bg(),[t,i]=(0,b.useState)(null);return(0,b.useEffect)(()=>{if(!e){i(null);return}let l=!1;const c=new Date;return B_().then(d=>{l||i(d&&d<c?d: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)(OT,{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 ${jU(t)}. `:"Showing what was already loaded. ","Approvals and replies wait until you are back."]})]}):null}r(wU,"OfflineBanner");function kC(){return typeof navigator>"u"?null:navigator.windowControlsOverlay??null}r(kC,"overlay");function kU(e){const t=kC();return t?.addEventListener("geometrychange",e),()=>t?.removeEventListener("geometrychange",e)}r(kU,"subscribe$2");function SU(){return(0,b.useSyncExternalStore)(kU,()=>kC()?.visible===!0,()=>!1)}r(SU,"useWindowControlsOverlayVisible");var NU={WebkitAppRegion:"drag",appRegion:"drag"},CU={WebkitAppRegion:"no-drag",appRegion:"no-drag"};function AU(){const{selectedCompanyId:e}=bt(),{inbox:t}=b0(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:{...NU,marginLeft:"env(titlebar-area-x, 0px)",width:"env(titlebar-area-width, 100%)",height:"env(titlebar-area-height, 33px)"},children:[(0,a.jsx)(n0,{className:"size-4 shrink-0 text-ink","aria-hidden":"true"}),(0,a.jsx)("span",{className:"font-semibold text-ink",children:"Wardmote"}),(0,a.jsxs)(fn,{to:"/inbox",style:CU,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(AU,"TitleBarContent");function _U(){return SU()?(0,a.jsx)(AU,{}):null}r(_U,"WindowTitleBar");var EU=16384,IU=40;function TU(e){if(!e)return;const t=[];for(const i of e.slice(0,EU).split(`
|
|
52
|
+
`).slice(0,41)){const l=/^\s*(?:at|in) ([A-Za-z_$][\w$.-]{0,99})(?:\s|$)/.exec(i)?.[1]??/^([A-Za-z_$][\w$.-]{0,99})@/.exec(i)?.[1];if(l&&t.push(` at ${l}`),t.length===IU)break}return t.length?`
|
|
53
|
+
${t.join(`
|
|
54
|
+
`)}`:void 0}r(TU,"sanitizeComponentStack");function SC(){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(SC,"readBrowserErrorState");function RU(e){const t=TU(e.componentStack);return{tags:{react_error_boundary:e.boundary},contexts:{react:t?{componentStack:t}:{},browser_state:SC()}}}r(RU,"buildBrowserErrorContext");var nw=Promise.resolve();function U0(e){const t=nw.then(e);return nw=t.catch(()=>{}),t}r(U0,"enqueue");var Vl=null;function DU(e,t){return U0(async()=>{if(!Vl)try{const i=await ye(()=>import("./prod-COP_vZWu.js"),__vite__mapDeps([0,1]));i.init(OU(e,t)),Vl=i}catch{}})}r(DU,"initBrowserErrorMonitoring");function MU(){return U0(async()=>{const e=Vl;if(Vl=null,!e)return;const t=e.getClient();try{e.getCurrentScope().setClient(void 0)}catch{}try{await t?.close(2e3)}catch{}})}r(MU,"teardownBrowserErrorMonitoring");function NC(e,t){let i;try{t&&(i=RU(t))}catch{}U0(async()=>{try{i?Vl?.captureException(e,i):Vl?.captureException(e)}catch{}})}r(NC,"captureBrowserException");function OU(e,t){return{dsn:e,environment:t??void 0,release:"8b9f9f69321593fb19386303cbaeac0dd0cc67f5",tracesSampleRate:0,sendDefaultPii:!1,beforeSend:r((i,l)=>{try{if(i.contexts={...i.contexts,browser_state:i.contexts?.browser_state??SC()},i.tags={...i.tags,browser_build_mode:"production"},i.exception?.values?.some(c=>c.mechanism?.type==="onunhandledrejection"||c.mechanism?.type==="auto.browser.global_handlers.onunhandledrejection")){const c=l.originalException;i.tags.browser_rejection_kind=c===null?"null":typeof c}}catch{}return i},"beforeSend"),integrations:r(i=>i.filter(l=>l.name!=="HttpContext"&&l.name!=="Breadcrumbs"),"integrations")}}r(OU,"buildBrowserSentryInitOptions");var LU=class extends b.Component{static{r(this,"RouteErrorBoundaryInner")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){NC(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)(pe,{variant:"secondary",size:"sm",onClick:this.props.onReset,children:"Go back"}),(0,a.jsx)(pe,{size:"sm",onClick:r(()=>window.location.reload(),"onClick"),children:"Reload page"})]})]}):this.props.children}};function zU({children:e}){const t=vn(),i=xa(),l=`${t.pathname}${t.search}`;return(0,a.jsx)(LU,{resetKey:l,onReset:r(()=>i(-1),"onReset"),children:e})}r(zU,"RouteErrorBoundary");function PU({open:e,onOpenChange:t,...i}){return(0,a.jsx)(Ds,{open:e,onOpenChange:t,children:(0,a.jsxs)(Gs,{"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)(Qs,{children:"Chat with an agent"}),i.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)(UU,{...i,onComplete:r(()=>t(!1),"onComplete")},String(e))]})})}r(PU,"AgentChatPicker");function UU({agents:e,onSelect:t,onComplete:i,loading:l,error:c,onRetry:d,existingChatAgentIds:m,renderAgentIcon:f}){const h=(0,b.useRef)(!1),g=(0,b.useRef)(null);(0,b.useEffect)(()=>(h.current=!0,()=>{h.current=!1,g.current?.abort()}),[]);const[v,y]=(0,b.useState)(""),[j,k]=(0,b.useState)(null),[N,S]=(0,b.useState)(null);async function D(R){if(j)return;k(R.id),S(null);const E=new AbortController;g.current=E;try{await t(R,E.signal),h.current&&i()}catch(C){S(C instanceof Error?C.message:"Couldn’t open chat. Try again.")}finally{k(null)}}return r(D,"selectAgent"),(0,a.jsxs)(uS,{children:[(0,a.jsx)(l0,{"aria-label":"Search agents by name or role",placeholder:"Search by name or role…",value:v,onValueChange:y}),N&&(0,a.jsx)("p",{role:"alert",className:"px-4 py-3 text-sm text-bad",children:N}),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."}),d&&(0,a.jsx)(pe,{variant:"secondary",size:"sm",onClick:d,children:"Retry"})]}):l?(0,a.jsx)("p",{role:"status",className:"p-4 text-sm text-ink-3",children:"Loading agents…"}):(0,a.jsxs)(c0,{children:[(0,a.jsx)(o0,{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)(pe,{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)(qs,{children:e.map(R=>(0,a.jsxs)(jn,{value:R.id,keywords:[R.name,R.title??"",R.role],onSelect:r(()=>{D(R)},"onSelect"),disabled:j!==null,className:"gap-3 px-3 py-3",children:[f?f(R):(0,a.jsx)(Dh,{icon:R.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:R.name}),(0,a.jsx)("span",{className:"truncate text-xs text-ink-3",children:R.title??R.role})]}),m&&(0,a.jsx)("span",{className:"shrink-0 text-xs text-ink-3",children:m.includes(R.id)?"Open chat":"New chat"}),R.status==="paused"&&(0,a.jsx)("span",{className:"text-xs text-(--status-agent-paused)",children:"Paused"}),R.status==="terminated"&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Terminated"}),R.status==="pending_approval"&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Awaiting approval"})]},R.id))})]})]})}r(UU,"AgentChatPickerResults");function $U({agents:e,existingChatAgentIds:t,availableAgents:i=e,activeId:l,previews:c={},loading:d=!1,error:m,onRetry:f,initialSearch:h="",onSelect:g,onBrowse:v,onAddChat:y,historyLoading:j,historyError:k,onRetryHistory:N}){const S=xa(),[D,R]=(0,b.useState)(!1),[E,C]=(0,b.useState)(h),I=(0,b.useRef)(null),O=(0,b.useId)(),z=E.trim().toLocaleLowerCase(),B=e.filter(_=>`${_.name} ${_.title??""} ${_.role}`.toLocaleLowerCase().includes(z));function L(){C(""),I.current?.focus()}return r(L,"focusSearch"),(0,a.jsxs)("aside",{"aria-labelledby":O,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:O,className:"text-sm font-semibold",children:"Chat"}),(0,a.jsx)(pe,{variant:"secondary",size:"icon-sm","aria-label":"Add chat",title:"Add chat",onClick:r(()=>R(!0),"onClick"),children:(0,a.jsx)(Xa,{className:"size-4"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(Br,{"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)(aa,{ref:I,"aria-label":"Search agents",placeholder:"Find an agent",value:E,onChange:r(_=>C(_.target.value),"onChange"),onKeyDown:r(_=>{_.key==="Escape"&&(_.stopPropagation(),C(""))},"onKeyDown"),className:"h-8 pl-8 pr-8 text-xs md:text-xs"}),E&&(0,a.jsx)(pe,{variant:"ghost",size:"icon-xs","aria-label":"Clear search",className:"absolute right-1 top-1/2 -translate-y-1/2",onClick:L,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:z?"Search results":"Teammates"}),(0,a.jsx)("span",{role:"status",className:"sr-only",children:d?"Loading agents":`${B.length} ${B.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)(pe,{variant:"secondary",size:"sm",onClick:N,children:"Retry chat history"})]}),m?(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)(pe,{variant:"secondary",size:"sm",onClick:f,children:"Try again"})]}):d?(0,a.jsx)("div",{"aria-hidden":"true",className:"flex flex-col gap-1",children:[0,1,2,3].map(_=>(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"})]})]},_))}):B.length?(0,a.jsx)("nav",{"aria-label":"Agent conversations",className:"flex flex-col gap-1",children:B.map(_=>(0,a.jsxs)(fn,{to:`/chats/${encodeURIComponent(_.status==="terminated"?_.id:ar(_))}`,"aria-current":l===_.id?"page":void 0,title:`${_.name}${_.title?` · ${_.title}`:""}`,onClick:r(U=>{g&&(U.preventDefault(),g(_))},"onClick"),className:G("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===_.id?Kl.active:Kl.rest),children:[(0,a.jsx)(sr,{agent:_,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:_.name}),(0,a.jsx)("span",{className:"truncate text-xs text-ink-3",children:_.status==="terminated"?"Terminated":_.status==="paused"?"Paused":c[_.id]??_.title??"Start a conversation"})]})]},_.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)(pe,{variant:"secondary",size:"sm",onClick:r(()=>R(!0),"onClick"),children:"Choose an agent"}),e.length>0&&(0,a.jsx)(pe,{variant:"secondary",size:"sm",onClick:L,children:"Clear search"})]})]}),(0,a.jsx)("div",{className:"shrink-0 px-3 py-4",children:(0,a.jsx)(pe,{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)(Kr,{className:"size-4"}),"Browse all agents"]}):(0,a.jsxs)(fn,{to:"/agents/all",children:[(0,a.jsx)(Kr,{className:"size-4"}),"Browse all agents"]})})}),(0,a.jsx)(PU,{agents:i,open:D,onOpenChange:R,existingChatAgentIds:t??e.map(_=>_.id),loading:d,error:m,onRetry:f,renderAgentIcon:r(_=>(0,a.jsx)(sr,{agent:_,size:32}),"renderAgentIcon"),onSelect:r(async(_,U)=>{y?await y(_,U):g?await g(_,U):S(`/chats/${encodeURIComponent(ar(_))}`),U?.aborted||C("")},"onSelect")})]})}r($U,"AgentConversationSidebar");function BU(){const{selectedCompanyId:e}=bt(),{enabled:t,loaded:i}=xf(),l=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn")}),c=l.data?.user?.id??l.data?.session?.userId??null;return{companyId:e,userId:c,enabled:t,loaded:i,agents:be({queryKey:P.agents.list(e),queryFn:r(()=>Pa.list(e),"queryFn"),enabled:t&&!!e}),chats:be({queryKey:P.agentChats.list(e,c),queryFn:r(()=>hS.list(e),"queryFn"),enabled:t&&!!e&&l.isSuccess}),session:l}}r(BU,"useAgentChatNavigation");function KU(e,t){const i=Rn(),l=xa(),{isMobile:c,setSidebarOpen:d}=Zn(),m=(0,b.useRef)({companyId:e,userId:t,mounted:!0});return(0,b.useEffect)(()=>{const f={companyId:e,userId:t,mounted:!0};return m.current=f,()=>{f.mounted=!1}},[e,t]),(0,b.useCallback)(async(f,h)=>{if(!e||f.companyId!==e)throw new Error("Choose an agent from this company.");const g=m.current,v=await hS.ensure(e,f.id);i.setQueryData(P.agentChats.detail(e,t,f.id),v),i.setQueryData(P.issues.detail(v.id),v),i.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||m.current!==g||h?.aborted)&&(l(`/chats/${encodeURIComponent(ar(f))}`),c&&d(!1))},[i,e,t,l,c,d])}r(KU,"useOpenAgentChat");function qU(){const{companyId:e,userId:t,agents:i,chats:l,session:c}=BU(),d=KU(e,t),m=xa(),f=g0(e),{isMobile:h,setSidebarOpen:g}=Zn(),{pathname:v}=vn(),y=v.split("/chats/")[1]?.split("/")[0],j=i.data??[],k=i.isSuccess?[...new Set((l.data??[]).flatMap(O=>O.conversationAgentId&&!j.some(z=>z.id===O.conversationAgentId)?[O.conversationAgentId]:[]))]:[],N=Kg({queries:k.map(O=>({queryKey:P.agents.detail(O),queryFn:r(()=>Pa.get(O,e),"queryFn")}))}),S=new Map(j.map(O=>[O.id,O]));for(const O of N)O.data&&S.set(O.data.id,O.data);const D=[...S.values()].find(O=>O.id===y||O.status!=="terminated"&&encodeURIComponent(ar(O))===y),R=(l.data??[]).flatMap(O=>{const z=O.conversationAgentId?S.get(O.conversationAgentId):void 0;return z?[z]:[]});D&&!R.some(O=>O.id===D.id)&&R.unshift(D);const E=new Set(R.map(O=>O.id)),C=j.filter(O=>!E.has(O.id)&&O.status!=="terminated"&&(!f.isSuccess||P1(f.data,"agent",O.id)!=="left")).sort((O,z)=>O.name.localeCompare(z.name,void 0,{sensitivity:"base"})),I=Object.fromEntries((l.data??[]).filter(O=>O.conversationState==="active").map(O=>[O.conversationAgentId,"Working…"]));return(0,a.jsx)($U,{agents:[...R,...C],availableAgents:j,existingChatAgentIds:R.map(O=>O.id),activeId:D?.id,previews:I,loading:i.isPending||l.isPending||c.isPending,error:i.error??l.error??c.error,onRetry:r(()=>{i.refetch(),l.refetch(),c.refetch()},"onRetry"),historyLoading:N.some(O=>O.isPending),historyError:N.find(O=>O.error)?.error,onRetryHistory:r(()=>{N.filter(O=>O.isError).forEach(O=>{O.refetch()})},"onRetryHistory"),onAddChat:d,onSelect:r(O=>{m(`/chats/${encodeURIComponent(O.status==="terminated"?O.id:ar(O))}`),h&&g(!1)},"onSelect")},`${e}:${t}`)}r(qU,"AgentConversationsSidebar");var nd=232,og=208,cg=420,aw=16;function Yd(e){return Math.min(cg,Math.max(og,e))}r(Yd,"clampSidebarWidth");function sw(e){if(typeof window>"u")return nd;try{const t=window.localStorage.getItem(e);if(!t)return nd;const i=Number.parseInt(t,10);return Number.isFinite(i)?Yd(i):nd}catch{return nd}}r(sw,"readStoredSidebarWidth");function iw(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,String(Yd(t)))}catch{}}r(iw,"writeStoredSidebarWidth");function FU({children:e,open:t,collapsed:i=!1,peeking:l=!1,resizable:c=!1,storageKey:d="wardmote.sidebar.width",className:m,onPanelMouseEnter:f,onPanelMouseLeave:h,onPanelFocusCapture:g,onPanelBlurCapture:v}){const[y,j]=(0,b.useState)(()=>sw(d)),[k,N]=(0,b.useState)(!1),S=(0,b.useRef)(y),D=(0,b.useRef)(null);(0,b.useEffect)(()=>{const se=sw(d);S.current=se,j(se)},[d]);const R=t?y:0,E=t?i?72:R:0,C=t?i&&!l?72:R:0,I=C>E,O=c&&t&&!i,z=(0,b.useMemo)(()=>({width:`${E}px`}),[E]),B=(0,b.useMemo)(()=>({width:`${C}px`}),[C]),L=(0,b.useCallback)(se=>{const me=Yd(se);S.current=me,j(me),iw(d,me)},[d]),_=(0,b.useCallback)(se=>{O&&(se.preventDefault(),se.currentTarget.setPointerCapture(se.pointerId),D.current={startX:se.clientX,startWidth:S.current},N(!0))},[O]),U=(0,b.useCallback)(se=>{if(!D.current)return;const me=Yd(D.current.startWidth+se.clientX-D.current.startX);S.current=me,j(me)},[]),F=(0,b.useCallback)(()=>{D.current&&(D.current=null,N(!1),iw(d,S.current))},[d]),Y=(0,b.useCallback)(se=>{O&&(se.key==="ArrowLeft"?(se.preventDefault(),L(y-aw)):se.key==="ArrowRight"?(se.preventDefault(),L(y+aw)):se.key==="Home"?(se.preventDefault(),L(og)):se.key==="End"&&(se.preventDefault(),L(cg)))},[O,L,y]);return(0,a.jsxs)("div",{className:G("relative h-full shrink-0",m),style:z,children:[(0,a.jsx)("div",{className:G("absolute inset-y-0 left-0 flex flex-col overflow-hidden",I?"z-30 border-r border-line bg-bg shadow-lg":"z-0"),style:B,"data-sidebar-overlay":I?"":void 0,onMouseEnter:f,onMouseLeave:h,onFocusCapture:g,onBlurCapture:v,children:e}),O?(0,a.jsx)("div",{role:"separator","aria-label":"Resize sidebar","aria-orientation":"vertical","aria-valuemin":og,"aria-valuemax":cg,"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:_,onPointerMove:U,onPointerUp:F,onPointerCancel:F,onLostPointerCapture:F,onKeyDown:Y,children:(0,a.jsx)("div",{className:G("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(FU,"SidebarShell");function ad({children:e,className:t}){return(0,a.jsx)("div",{"data-secondary-sidebar":"",className:G("h-full w-full min-w-0 overflow-hidden",t),children:(0,a.jsx)(sS,{children:e})})}r(ad,"SecondarySidebar");function HU(e,t){if(!t)return!1;if(t.source==="local_implicit"||t.isInstanceAdmin)return!0;if(!e)return!1;const i=t.memberships?.find(l=>l.companyId===e&&l.status==="active");return i?.membershipRole==="owner"||i?.membershipRole==="admin"||i?.membershipRole==="operator"||i?.membershipRole==="member"}r(HU,"canInviteCompanyMembers");function VU(){const e=J_(),t=be({queryKey:P.access.currentBoardAccess,queryFn:r(()=>wi.getCurrentBoardAccess(),"queryFn"),retry:!1,staleTime:3e4});return HU(e?.selectedCompanyId,t.data)}r(VU,"useCanInviteCompanyMembers");function QU(e){return e?.trim().toLowerCase().replace(/['"]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||null}r(QU,"slugifyUserPart");function WU(e){const t=[e?.id,e?.name,e?.email?.split("@")[0],e?.email];for(const i of t){const l=QU(i);if(l)return`/u/${l}`}return"/u/me"}r(WU,"userProfilePath");var vc=null,CC=!1,ug=!1,dg=new Set;function yc(){for(const e of dg)e()}r(yc,"emit");function GU(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(GU,"isIosSafariLike");function YU(e=window){const t=r(l=>{l.preventDefault(),vc=l,yc()},"onPrompt"),i=r(()=>{vc=null,CC=!0,yc()},"onInstalled");return e.addEventListener("beforeinstallprompt",t),e.addEventListener("appinstalled",i),()=>{e.removeEventListener("beforeinstallprompt",t),e.removeEventListener("appinstalled",i)}}r(YU,"captureInstallPrompt");function XU(){return CC||lg()?"installed":vc?"prompt":GU()?"ios-manual":"unavailable"}r(XU,"installAvailability");async function ZU(){const e=vc;if(!e)return"unavailable";vc=null,yc(),await e.prompt();const{outcome:t}=await e.userChoice;return t}r(ZU,"promptInstall");function fg(e){ug!==e&&(ug=e,yc())}r(fg,"setIosInstallHelpOpen");function JU(){return ug}r(JU,"iosInstallHelpOpen");function e$(){return(0,b.useSyncExternalStore)($0,JU,()=>!1)}r(e$,"useIosInstallHelpOpen");function $0(e){return dg.add(e),()=>{dg.delete(e)}}r($0,"subscribe$1");function AC(){return(0,b.useSyncExternalStore)($0,XU,()=>"unavailable")}r(AC,"useInstallAvailability");function _W(e){const t=AC();return(0,b.useSyncExternalStore)($0,()=>a$(t,e),()=>!1)}r(_W,"useInstallNudgeVisible");var t$=2592e6,mg="wardmote.install.visits",rw="wardmote.install.visit-counted",_C="wardmote.install.snoozed-until";function pg(e,t){const i=Number(e.getItem(t));return Number.isFinite(i)?i:0}r(pg,"readNumber");function n$(e=window.localStorage,t=window.sessionStorage){try{if(t.getItem(rw))return;t.setItem(rw,"1"),e.setItem(mg,String(pg(e,mg)+1))}catch{return}}r(n$,"recordAppVisit");function a$(e,t,i=Date.now(),l=window.localStorage){if(e!=="prompt"&&e!=="ios-manual"||/^\/(?:[^/]+\/)?onboarding(?:\/|$)/.test(t))return!1;try{return pg(l,mg)>=3&&pg(l,_C)<=i}catch{return!1}}r(a$,"installNudgeVisible");function EW(e=Date.now(),t=window.localStorage){try{t.setItem(_C,String(e+t$))}catch{return}finally{yc()}}r(EW,"snoozeInstallNudge");var lw="Install app",s$="Add Wardmote to your home screen or dock.";function i$({variant:e,onAfterAction:t}){const i=AC();if(i==="installed"||i==="unavailable")return null;const l=r(()=>{i==="ios-manual"?fg(!0):ZU(),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)(Fh,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:lw})]}):(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)(Fh,{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:lw}),(0,a.jsx)("span",{className:"block text-xs text-ink-3",children:s$})]})]})}r(i$,"InstallAppMenuAction");function r$(){const e=e$();return(0,a.jsx)(Ds,{open:e,onOpenChange:fg,children:(0,a.jsxs)(Gs,{children:[(0,a.jsxs)(Sc,{children:[(0,a.jsx)(Qs,{children:"Install Wardmote"}),(0,a.jsx)(Nc,{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)(lh,{index:1,icon:(0,a.jsx)(CT,{className:"size-4"}),children:["Tap ",(0,a.jsx)("strong",{children:"Share"})," in the Safari toolbar."]}),(0,a.jsxs)(lh,{index:2,icon:(0,a.jsx)(_T,{className:"size-4"}),children:["Choose ",(0,a.jsx)("strong",{children:"Add to Home Screen"}),"."]}),(0,a.jsxs)(lh,{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)(a0,{children:(0,a.jsx)(pe,{type:"button",onClick:r(()=>fg(!1),"onClick"),children:"Done"})})]})})}r(r$,"IosInstallHelpDialog");function lh({index:e,icon:t,children:i}){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:i})]})]})}r(lh,"InstallStep");function l$(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(l$,"formatTimestamp");function o$(e){return!!e&&!Number.isNaN(new Date(e).getTime())}r(o$,"isValidTimestamp");function c$(e){return e?.devServer?.lastRestartAt??e?.serverInfo?.processStartedAt??null}r(c$,"restartTimestamp");function u$(e){const t=e?.serverInfo?.git;return t?.available?`${t.shortSha} · ${t.subject}`:"Commit unavailable"}r(u$,"commitLabel");function d$(e){const t=e?.serverInfo?.git;if(!t?.available)return"Unavailable";const i=t.localChanges;if(!i||!i.available)return"Change status unavailable";if(!i.hasLocalChanges)return"Clean checkout";const l=[[i.stagedFileCount,"staged"],[i.unstagedFileCount,"unstaged"],[i.untrackedFileCount,"untracked"]].filter(([c])=>Number(c)>0).map(([c,d])=>`${c} ${d}`);return l.length>0?`Local changes present (${l.join(", ")})`:"Local changes present"}r(d$,"localChangesLabel");function oh({icon:e,label:t,value:i,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:i}):(0,a.jsx)("span",{className:"block break-words text-xs text-ink-3",children:i})]})]})}r(oh,"ServerInfoRow");function f$(){const e=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn")}).data?.enableServerInfoDebugView===!0,t=be({queryKey:P.health,queryFn:r(()=>Ac.get(),"queryFn"),enabled:e,refetchOnMount:"always",refetchInterval:r(v=>v.state.data?.devServer?.enabled?2e3:!1,"refetchInterval")});if(!e)return null;const i=t.data,l=t.isLoading&&!i,c=t.isError,d=c$(i),m=o$(d),f=c?"Health unavailable":l?"Loading...":l$(d),h=c?"Health unavailable":l?"Loading...":u$(i),g=c?"Health unavailable":l?"Loading...":d$(i);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)(oh,{icon:lT,label:"Last restarted",value:f,dateTime:!c&&!l&&m?d:null}),(0,a.jsx)(oh,{icon:fT,label:"Running commit",value:h}),(0,a.jsx)(oh,{icon:oT,label:"Checkout state",value:g})]})}r(f$,"SidebarServerInfo");var m$="/company/settings/members?tab=invites",p$="https://github.com/tickernelz/wardmote/tree/main/docs",h$="https://github.com/tickernelz/wardmote/issues";function g$(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(g$,"deriveInitials");function ch({label:e,icon:t,onClick:i,href:l,external:c=!1}){const d="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",m=(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:d,onClick:i,children:m}):(0,a.jsx)(fn,{to:l,className:d,onClick:i,children:m}):(0,a.jsx)("button",{type:"button",className:d,onClick:i,children:m})}r(ch,"MenuAction");function ow({deploymentMode:e,open:t,onOpenChange:i,forceExpanded:l=!1}){const{hidden:c,loaded:d}=rr(),m=VU()?m$:null,f=d&&m!==null&&!Sd(c,"company.members")&&!Sd(c,"company.invites"),[h,g]=(0,b.useState)(!1),{isMobile:v,setSidebarOpen:y,collapsed:j,peeking:k}=Zn(),N=j&&!k&&!l,S=t??h,D=i??g,{data:R}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),retry:!1}),E=I0({onSignedOut:B}),C=R?.user.name?.trim()||"Board",I=R?.user.email?.trim()||(e==="authenticated"?"Signed in":"Local workspace board"),O=g$(C),z=WU(R?.user);function B(){D(!1),v&&y(!1)}r(B,"closeNavigationChrome");function L(){E.mutate()}return r(L,"handleSignOut"),(0,a.jsx)("div",{className:"bg-line/50 px-3 py-2 dark:bg-bg-3",children:(0,a.jsxs)("div",{className:G("flex items-center gap-0.5",!N&&"px-2"),children:[(0,a.jsxs)(xs,{open:S,onOpenChange:D,children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",className:G("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",N?"w-full px-3 py-2":"flex-1 px-2 py-1.5"),"aria-label":"Open account menu",children:[(0,a.jsxs)(Id,{size:"sm",children:[R?.user.image?(0,a.jsx)(_d,{src:R.user.image,alt:C}):null,(0,a.jsx)(Ed,{children:O})]}),(0,a.jsx)("span",{className:G("min-w-0 flex-1 truncate",N&&"block w-0 min-w-0 -ms-2.5 overflow-hidden whitespace-nowrap text-transparent select-none"),children:C})]})}),(0,a.jsxs)(gs,{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)(fn,{to:z,"aria-label":"View profile",onClick:B,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)(Id,{className:"pointer-events-none relative size-9",children:[R?.user.image?(0,a.jsx)(_d,{src:R.user.image,alt:C}):null,(0,a.jsx)(Ed,{className:"text-xs text-ink",children:O})]}),(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:C}),(0,a.jsx)("p",{className:"truncate text-(length:--text-micro) leading-(--profile-popover-meta-line-height) text-ink-3",children:I})]})]}),(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)(ch,{label:"Settings",icon:aS,href:"/company/settings",onClick:B}),f&&m?(0,a.jsx)(ch,{label:"Invite",icon:k1,href:m,onClick:B}):null,(0,a.jsx)(ch,{label:"Documentation",icon:aT,href:p$,external:!0,onClick:r(()=>D(!1),"onClick")}),(0,a.jsx)(yI,{variant:"compact-menu-action",onAfterToggle:r(()=>D(!1),"onAfterToggle")}),(0,a.jsx)(i$,{variant:"compact-menu-action",onAfterAction:r(()=>D(!1),"onAfterAction")}),e==="authenticated"?(0,a.jsxs)("button",{type:"button",className:G("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",E.isPending&&"cursor-not-allowed opacity-60"),onClick:L,disabled:E.isPending,children:[(0,a.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center text-ink-3",children:(0,a.jsx)(bf,{className:"size-4"})}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:E.isPending?"Signing out...":"Sign out"})]}):null,(0,a.jsx)(f$,{})]})]})]}),N?null:(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{asChild:!0,children:(0,a.jsx)("a",{href:h$,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)(Yg,{className:"h-4 w-4","aria-hidden":"true"})})}),(0,a.jsx)(Cs,{side:"top",children:"Share feedback"})]})]})})}r(ow,"SidebarAccountMenu");var x$=["input","textarea","select","[contenteditable='true']","[contenteditable='plaintext-only']","[role='textbox']","[role='combobox']"].join(", "),b$="[data-page-search-target='true']",v$=new Set(["Shift","Meta","Control","Alt"]);function Jl(e){return e instanceof HTMLElement?e.isContentEditable?!0:!!e.closest(x$):!1}r(Jl,"isKeyboardShortcutTextInputTarget");function hg(e=document){return!!e.querySelector("[role='dialog'][aria-modal='true']")}r(hg,"hasBlockingShortcutDialog");function y$(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(y$,"isVisibleShortcutTarget");function j$(e=document){return Array.from(e.querySelectorAll(b$)).find(t=>y$(t))??null}r(j$,"findPageSearchShortcutTarget");function w$(e=document){const t=j$(e);return t?(t.focus(),(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select(),!0):!1}r(w$,"focusPageSearchShortcutTarget");function k$({key:e,isComposing:t}){return e==="Enter"&&!t}r(k$,"shouldBlurPageSearchOnEnter");function S$({key:e,isComposing:t,currentValue:i}){return e==="Escape"&&!t&&i.length===0}r(S$,"shouldBlurPageSearchOnEscape");function Mf(e){return v$.has(e)}r(Mf,"isModifierOnlyKey");function IW({defaultPrevented:e,key:t,metaKey:i,ctrlKey:l,altKey:c,target:d,hasOpenDialog:m,hasSelection:f}){if(e||i||l||c||Mf(t)||m||Jl(d))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(IW,"resolveAttentionQueueKeyAction");function TW({armed:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:d,target:m,hasOpenDialog:f}){return!e||t||l||c||d||Mf(i)||f||Jl(m)?"ignore":i.toLowerCase()==="y"?"archive":"ignore"}r(TW,"resolveInboxQuickArchiveKeyAction");function RW({hasUndoableArchive:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:d,target:m,hasOpenDialog:f}){return!e||t||l||c||d||Mf(i)||f||Jl(m)?"ignore":i==="u"?"undo_archive":"ignore"}r(RW,"resolveInboxUndoArchiveKeyAction");function N$({armed:e,defaultPrevented:t,key:i,metaKey:l,ctrlKey:c,altKey:d,target:m,hasOpenDialog:f}){if(t)return e?"disarm":"ignore";if(l||c||d||Mf(i))return"ignore";if(f||Jl(m))return e?"disarm":"ignore";const h=i.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(N$,"resolveIssueDetailGoKeyAction");function C$({onNewIssue:e,onSearch:t,onToggleSidebar:i,onTogglePanel:l,onShowShortcuts:c,onGoToInbox:d}){(0,b.useEffect)(()=>{let m=!1,f=null;const h=r(()=>{f!==null&&(window.clearTimeout(f),f=null)},"clearGoChordTimeout"),g=r(()=>{m=!1,h()},"disarmGoChord"),v=r(()=>{m=!0,h(),f=window.setTimeout(()=>{m=!1,f=null},1200)},"armGoChord");function y(N){if(N.defaultPrevented){g();return}if(d){const S=N$({armed:m,defaultPrevented:N.defaultPrevented,key:N.key,metaKey:N.metaKey,ctrlKey:N.ctrlKey,altKey:N.altKey,target:N.target,hasOpenDialog:hg()});if(S==="arm"){v();return}if(S==="navigate_inbox"){g(),N.preventDefault(),d();return}if(S==="focus_comment"||S==="open_file_viewer"){g(),N.preventDefault();return}S==="disarm"&&g()}if(!Jl(N.target)&&!hg()){if(N.key==="/"&&!N.metaKey&&!N.ctrlKey&&!N.altKey){N.preventDefault(),w$()||t?.();return}if(N.key==="?"&&!N.metaKey&&!N.ctrlKey&&!N.altKey){N.preventDefault(),c?.();return}N.key==="c"&&!N.metaKey&&!N.ctrlKey&&!N.altKey&&(N.preventDefault(),e?.()),N.key==="["&&!N.metaKey&&!N.ctrlKey&&(N.preventDefault(),i?.()),N.key==="]"&&!N.metaKey&&!N.ctrlKey&&(N.preventDefault(),l?.())}}r(y,"handleKeyDown");const j=r(()=>g(),"handlePointerDown"),k=r(N=>{N.target instanceof HTMLElement&&N.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,i,l,c,d])}r(C$,"useKeyboardShortcuts");var A$=new Set(["auth","invite","board-claim","cli-auth","docs","s"]);function EC(e){const t=(e.split("?")[0]??"").split("/").filter(Boolean);if(t.length===0)return!0;const[i]=t;return!A$.has(i)}r(EC,"isRememberableCompanyPath");function _$(e){const t=Ad(e.companyPrefix);return e.companies.find(i=>Ad(i.issuePrefix)===t)??null}r(_$,"findCompanyByPrefix");function E$(e){const t=Ek(e.pathname);return t?_$({companies:e.companies,companyPrefix:t})?.id??null:e.fallbackCompanyId}r(E$,"getRememberedPathOwnerCompanyId");function I$(e){const t=e.path?df(e.path):"/dashboard";if(!EC(t))return"/dashboard";const[i,l]=(t.split("?")[0]??"").split("/").filter(Boolean);if(i==="issues"&&l){const c=/^([A-Za-z]+)-\d+$/.exec(l);if(c&&Ad(c[1]??"")!==Ad(e.companyPrefix))return"/dashboard"}return t}r(I$,"sanitizeRememberedPathForCompany");var IC="wardmote.companyPaths";function TC(){try{const e=localStorage.getItem(IC);if(e)return JSON.parse(e)}catch{}return{}}r(TC,"getCompanyPaths");function T$(e,t){const i=TC();i[e]=t,localStorage.setItem(IC,JSON.stringify(i))}r(T$,"saveCompanyPath");function R$(){const{companies:e,selectedCompanyId:t,selectedCompany:i,selectionSource:l}=bt(),c=vn(),d=xa(),m=(0,b.useRef)(t),f=(0,b.useMemo)(()=>E$({companies:e,pathname:c.pathname,fallbackCompanyId:m.current}),[e,c.pathname]),h=c.pathname+c.search;(0,b.useEffect)(()=>{const g=f,v=df(h);g&&EC(v)&&T$(g,v)},[h,f]),(0,b.useEffect)(()=>{if(t){if(m.current!==null&&t!==m.current&&l!=="route_sync"&&i){const g=TC(),v=I$({path:g[t],companyPrefix:i.issuePrefix});d(`/${i.issuePrefix}${v}`,{replace:!0})}m.current=t}},[i,t,l,d])}r(R$,"useCompanyPageMemory");var D$=class{static{r(this,"MobileNavScrollTracker")}options;lastTop;lastMaxTop;visible=!0;direction=0;distance=0;constructor(e,t,i){this.options=e,this.lastTop=t,this.lastMaxTop=i}update(e,t){const i=Math.max(0,Math.min(e,t)),l=i-Math.max(this.lastTop,this.options.topZone),c=t!==this.lastMaxTop;if(this.lastTop=i,this.lastMaxTop=t,i<=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 d=Math.sign(l);d!==this.direction&&(this.distance=0),this.direction=d,this.distance+=Math.abs(l);const m=d>0?this.options.hideDistance:this.options.showDistance;this.distance>=m&&(this.visible=d<0,this.distance=0)}return this.visible}};function M$(e,t){const[i,l]=(0,b.useState)(!0);return(0,b.useEffect)(()=>{if(l(!0),!e)return;const c=getComputedStyle(document.documentElement),d=r(y=>Number.parseFloat(c.getPropertyValue(y))||0,"distance"),m=r(()=>{const y=document.scrollingElement??document.documentElement;return{top:window.scrollY||y.scrollTop||0,max:Math.max(0,y.scrollHeight-y.clientHeight)}},"scrollBounds"),f=m(),h=new D$({topZone:d("--mobile-nav-scroll-top-zone"),hideDistance:d("--mobile-nav-scroll-hide-distance"),showDistance:d("--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}=m(),k=h.visible,N=h.update(y,j);N!==k&&l(N)}))},"onScroll");return window.addEventListener("scroll",v,{passive:!0}),()=>{window.removeEventListener("scroll",v),g!==null&&cancelAnimationFrame(g)}},[e,t]),i}r(M$,"useMobileNavVisibility");function O$(e){const{matchedCompany:t,selectedCompanyId:i,companies:l}=e;return!t||t.status!=="archived"||i===t.id?null:l.find(c=>c.id===i&&c.status!=="archived")??l.find(c=>c.status!=="archived")??null}r(O$,"resolveArchivedCompanyBounce");function DW(e){const{archivedCompanyId:t,companies:i}=e,l=i.find(c=>c.id!==t&&c.status!=="archived");return l?{kind:"company",company:l}:{kind:"companies_list"}}r(DW,"resolveCompanyArchiveDeparture");function L$(e){const{selectionSource:t,selectedCompanyId:i,routeCompanyId:l}=e;return!(i===l||t==="manual"&&i)}r(L$,"shouldSyncCompanySelectionFromRoute");function z$(e,t){return e instanceof HTMLElement?!(t instanceof HTMLElement)||!document.contains(t)||t===document.body||t===document.documentElement?!0:!e.contains(t):!1}r(z$,"shouldFocusMainContentAfterNavigation");function P$(e){if(!(e instanceof HTMLElement))return()=>{};const t=window.requestAnimationFrame(()=>{z$(e,document.activeElement)&&e.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(t)}r(P$,"scheduleMainContentFocus");function U$(e=document,t=window){const i=r(()=>{e.documentElement.scrollTop!==0&&(e.documentElement.scrollTop=0),e.body.scrollTop!==0&&(e.body.scrollTop=0)},"onScroll");return t.addEventListener("scroll",i,{capture:!0}),()=>t.removeEventListener("scroll",i,{capture:!0})}r(U$,"pinDocumentScrollToZero");var $$=m_({NotFoundPage:r(()=>nr,"NotFoundPage")});function nr({scope:e="global",requestedPrefix:t}){const i=vn(),{setBreadcrumbs:l}=cS(),{companies:c,selectedCompany:d}=bt();(0,b.useEffect)(()=>{l([{label:"Not Found"}])},[l]);const m=d??c[0]??null,f=m?`/${m.issuePrefix}/dashboard`:"/",h=`${i.pathname}${i.search}${i.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)(_c,{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)(ki,{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)(pe,{asChild:!0,children:(0,a.jsxs)(fn,{to:f,children:[(0,a.jsx)(Ak,{className:"mr-1.5 h-4 w-4"}),"Open dashboard"]})}),(0,a.jsx)(pe,{variant:"secondary",asChild:!0,children:(0,a.jsx)(fn,{to:"/",children:"Go home"})})]})]})})}r(nr,"NotFoundPage$1");function B$(e,t){return YN(e,t)[0]?.toLowerCase()??null}r(B$,"getCompanyRouteSegment");var K$=new Set(["browse","connections","assistant-connection","connect","chat","vercel-connect","review","attention","gateways","advanced","app"]);function q$({sidebarSections:e}){const{sidebarOpen:t,setSidebarOpen:i,toggleSidebar:l,collapsed:c,peeking:d,setPeeking:m,isMobile:f,isTablet:h}=Zn(),{openNewIssue:g,openOnboarding:v}=Ms(),{togglePanelVisible:y}=T0(),j=hf()?.pushToast??null,{companies:k,loading:N,selectedCompany:S,selectedCompanyId:D,selectionSource:R,setSelectedCompanyId:E}=bt(),{companyPrefix:C,pluginRoutePath:I,agentId:O,routineId:z}=Rs(),B=xa(),L=vn(),_=R_(),U=LL(L.pathname,C),F=U.builtInContextualSurface==="settings",Y=U.companySegments,se=U.isTaskDetail,{enabled:me}=xf(),oe=me&&Y[0]?.toLowerCase()==="chats",$=se||oe,T=Y[0]?.toLowerCase()==="tools",te=Y[0]?.toLowerCase()==="apps",ce=te&&Y[1]&&!K$.has(Y[1].toLowerCase())?Y[1]:null,ae=te&&Y[1]?.toLowerCase()==="app"&&Y[2]?Y[2]:null,Ce=(0,b.useRef)(!1),ue=(0,b.useRef)(null),we=(0,b.useRef)(null),Ae=(0,b.useRef)(new UI),je=(0,b.useRef)(L.key),he=M$(f&&!se,L.pathname),[Te,Ve]=(0,b.useState)(!1),De=(0,b.useMemo)(()=>{if(!C)return null;const Pe=C.toUpperCase();return k.find(Me=>Me.issuePrefix.toUpperCase()===Pe)??null},[k,C]),Se=!!C&&!N&&k.length>0&&!De,ut=(0,b.useMemo)(()=>I?.toLowerCase()??B$(L.pathname,C),[C,L.pathname,I]),wt=De?.id??null,kt=De?.issuePrefix??null,{slots:$t}=Cc({slotTypes:["page","routeSidebar"],companyId:wt,enabled:!!(wt&&ut)}),le=(0,b.useMemo)(()=>o3($t,ut),[ut,$t]),Ue=(0,b.useMemo)(()=>({companyId:wt,companyPrefix:kt}),[wt,kt]),Fe=F?(0,a.jsx)($L,{}):ce?(0,a.jsx)(_j,{kind:"connection",connectionId:ce}):ae?(0,a.jsx)(_j,{kind:"application",applicationId:ae}):te||T?(0,a.jsx)(e4,{}):le?(0,a.jsx)(Mc,{surface:`plugin:${le.id}`,title:le.displayName,children:(0,a.jsx)(r0,{slot:le,context:Ue,className:"min-h-0 flex-1",missingBehavior:"placeholder"})}):null,it=oe?(0,a.jsx)(qU,{}):U.builtInContextualSurface==="agent"&&O?(0,a.jsx)(c4,{agentRef:O}):U.builtInContextualSurface==="routine"&&z?(0,a.jsx)(RI,{children:(0,a.jsx)(m4,{routineId:z})}):U.builtInContextualSurface==="skills"?(0,a.jsx)(g4,{}):Fe,Vt=it!=null,Qt=Vt&&(oe||U.builtInContextualSurface==="skills"||U.builtInContextualSurface==="agent"||U.builtInContextualSurface==="routine"||te||T),V=F&&(f||h),Ct=Vt&&!Qt&&!(h&&F),_e=Qt,ze=Vt?le&&!U.builtInContextualSurface?`plugin:${le.id}`:U.builtInContextualSurface:null,Je=(0,b.useRef)(null),{data:rt}=be({queryKey:P.health,queryFn:r(()=>Ac.get(),"queryFn"),retry:!1,refetchInterval:r(Pe=>Pe.state.data?.devServer?.enabled?2e3:!1,"refetchInterval"),refetchIntervalInBackground:!1});(0,b.useEffect)(()=>{const Pe=Je.current;ze&&C&&Pe&&Pe.surface!==ze&&Pe.pathname!==L.pathname&&zL({surface:ze,companyPrefix:C,previousPathname:Pe.pathname}),Je.current={pathname:L.pathname,surface:ze}},[C,ze,L.pathname]),(0,b.useEffect)(()=>{N||Ce.current||rt?.deploymentMode!=="authenticated"&&k.length===0&&(Ce.current=!0,v())},[k,N,v,rt?.deploymentMode]),(0,b.useEffect)(()=>{if(!C||N||k.length===0)return;if(!De){const Me=(D?k.find($e=>$e.id===D):null)??k[0]??null;Me&&D!==Me.id&&E(Me.id,{source:"route_sync"});return}if(C!==De.issuePrefix){const Me=L.pathname.replace(/^\/[^/]+/,"");B(`/${De.issuePrefix}${Me}${L.search}`,{replace:!0});return}const Pe=O$({matchedCompany:De,selectedCompanyId:D,companies:k});if(Pe){j?.({title:`${De.name} is archived`,body:`Switched to ${Pe.name}.`,tone:"info",dedupeKey:`archived-company-bounce:${De.id}`}),E(Pe.id,{source:"route_sync"}),B(`/${Pe.issuePrefix}/dashboard`,{replace:!0});return}L$({selectionSource:R,selectedCompanyId:D,routeCompanyId:De.id})&&E(De.id,{source:"route_sync"})},[C,k,N,De,L.pathname,L.search,B,j,R,D,E]);const At=y,Wt=(0,b.useCallback)(()=>{document.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,bubbles:!0,cancelable:!0}))},[]),mn=(0,b.useRef)(null),Zt=(0,b.useRef)(!1),_t=(0,b.useRef)(!1),Et=(0,b.useCallback)(()=>{mn.current!==null&&(window.clearTimeout(mn.current),mn.current=null)},[]),ln=(0,b.useCallback)(()=>{Et(),mn.current=window.setTimeout(()=>m(!0),50)},[Et,m]),Qn=(0,b.useCallback)(()=>{Et(),m(!0)},[Et,m]),dt=(0,b.useCallback)(()=>{Et(),mn.current=window.setTimeout(()=>m(!1),120)},[Et,m]),wn=(0,b.useCallback)(()=>{Zt.current=!0,c&&!_t.current&&ln()},[c,ln]),Dt=(0,b.useCallback)(()=>{Zt.current=!1,_t.current=!1,dt()},[dt]),an=(0,b.useCallback)(()=>{_t.current||Qn()},[Qn]),Mt=(0,b.useCallback)(()=>{Zt.current||dt()},[dt]);(0,b.useEffect)(()=>Et,[Et]);const pt=(0,b.useRef)(c);return(0,b.useEffect)(()=>{c!==pt.current&&(c?(Et(),m(!1),_t.current=Zt.current):_t.current=!1,pt.current=c)},[c,Et,m]),(0,b.useEffect)(()=>{if(!d)return;const Pe=r(Me=>{Me.key==="Escape"&&(Et(),m(!1))},"onKeyDown");return window.addEventListener("keydown",Pe),()=>window.removeEventListener("keydown",Pe)},[d,Et,m]),R$(),C$({onNewIssue:r(()=>g(),"onNewIssue"),onSearch:Wt,onToggleSidebar:l,onTogglePanel:At,onShowShortcuts:r(()=>Ve(!0),"onShowShortcuts"),onGoToInbox:r(()=>B("/inbox"),"onGoToInbox")}),(0,b.useEffect)(()=>{if(!f)return;const Pe=30,Me=50,$e=75;let He=0,Ot=0;const lt=r(Jt=>{const Lt=Jt.touches[0];He=Lt.clientX,Ot=Lt.clientY},"onTouchStart"),zt=r(Jt=>{const Lt=Jt.changedTouches[0],pn=Lt.clientX-He;if(!(Math.abs(Lt.clientY-Ot)>$e)){if(!t&&He<Pe&&pn>Me){i(!0);return}t&&pn<-50&&i(!1)}},"onTouchEnd");return document.addEventListener("touchstart",lt,{passive:!0}),document.addEventListener("touchend",zt,{passive:!0}),()=>{document.removeEventListener("touchstart",lt),document.removeEventListener("touchend",zt)}},[f,t,i]),(0,b.useEffect)(()=>{const Pe=document.body.style.overflow;return document.body.style.overflow=f?"visible":"clip",()=>{document.body.style.overflow=Pe}},[f]),(0,b.useEffect)(()=>{if(!f)return U$()},[f]),(0,b.useEffect)(()=>{if(typeof document>"u")return;const Pe=we.current;return P$(Pe)},[L.pathname]),(0,b.useEffect)(()=>{const Pe=we.current;if(!Pe)return;const Me=r(()=>{Ae.current.remember(je.current,Pe.scrollTop)},"recordScroll");return Pe.addEventListener("scroll",Me,{passive:!0}),()=>Pe.removeEventListener("scroll",Me)},[]),(0,b.useLayoutEffect)(()=>{const Pe=we.current,Me=PI({previousPathname:ue.current,pathname:L.pathname,navigationType:_,state:L.state});ue.current=L.pathname;const $e=_==="POP",He=$e?Ae.current.recall(L.key):0;if(je.current=L.key,$e){xy(Pe,He);const Ot=requestAnimationFrame(()=>xy(Pe,He));return()=>cancelAnimationFrame(Ot)}Me&&BI(Pe)},[L.key,L.pathname,L.state,_]),(0,a.jsx)(TI,{children:(0,a.jsxs)("div",{"data-app-shell":"",className:G("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)(fU,{}),(0,a.jsx)(gU,{devServer:rt?.devServer}),(0,a.jsx)(wU,{}),(0,a.jsxs)("div",{className:G("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(()=>i(!1),"onClick"),"aria-label":"Close sidebar"}),f?(0,a.jsxs)("div",{className:G("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)(ad,{children:it}):(0,a.jsx)(Cj,{children:e})})}),(0,a.jsx)(ow,{deploymentMode:rt?.deploymentMode,forceExpanded:Ct})]}):(0,a.jsxs)(FU,{open:t,collapsed:Ct?!1:c,peeking:Ct?!1:d,resizable:!0,onPanelMouseEnter:Ct?void 0:wn,onPanelMouseLeave:Ct?void 0:Dt,onPanelFocusCapture:!Ct&&c?an:void 0,onPanelBlurCapture:!Ct&&c?Mt:void 0,children:[(0,a.jsx)("div",{className:"flex flex-1 min-h-0",children:Ct?(0,a.jsx)(ad,{children:it}):(0,a.jsx)(Cj,{children:e})}),(0,a.jsx)(ow,{deploymentMode:rt?.deploymentMode,forceExpanded:Ct})]}),!f&&_e&&!Qt?(0,a.jsx)(ad,{className:"w-60 shrink-0",children:it}):null,(0,a.jsxs)("div",{className:G("flex min-w-0 flex-col",f?"w-full":"h-full flex-1"),children:[(0,a.jsxs)("div",{"data-slot":f?"mobile-topbar":void 0,className:G(!f&&$&&"hidden",f&&"sticky top-0 z-20 bg-bg/95 backdrop-blur supports-[backdrop-filter]:bg-bg/85"),children:[(0,a.jsx)(tw,{mobile:f,onNavigateHome:r(()=>B("/dashboard"),"onNavigateHome")}),(0,a.jsx)(Tj,{}),V?(0,a.jsx)("div",{className:"border-b border-line px-4 pb-3",children:(0,a.jsx)(HL,{})}):null]}),(0,a.jsxs)("div",{className:G(f?"block":"relative flex flex-1 min-h-0",!f&&$&&"streamlined-task-detail-surface"),children:[!f&&Qt?(0,a.jsx)(ad,{className:"w-60 shrink-0 bg-bg",children:it}):null,(0,a.jsxs)("div",{className:G(!f&&$?"flex min-w-0 flex-1 flex-col":"contents"),children:[!f&&$?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(tw,{mobile:!1,onNavigateHome:r(()=>B("/dashboard"),"onNavigateHome")}),(0,a.jsx)(Tj,{taskDetailLayout:!0})]}):null,(0,a.jsx)("main",{id:"main-content",ref:we,tabIndex:-1,style:f?{"--tc-composer-bottom":"var(--sz-calc-14)"}:void 0,className:G("flex-1 p-4 outline-none md:p-6",!f&&$&&"pt-0 md:pt-0",f?"overflow-visible pb-(--sz-calc-14)":"overflow-auto [scrollbar-gutter:stable]"),children:Se?(0,a.jsx)(nr,{scope:"invalid_company_prefix",requestedPrefix:C??S?.issuePrefix}):(0,a.jsx)(zU,{children:(0,a.jsx)(b.Suspense,{fallback:(0,a.jsx)(Es,{}),children:(0,a.jsx)(Wl,{})})})})]}),(0,a.jsx)(O4,{taskDetailLayout:!f&&$})]})]})]}),f&&(0,a.jsx)(oU,{visible:he}),(0,a.jsx)(Nz,{}),(0,a.jsx)(NP,{}),(0,a.jsx)(AP,{}),(0,a.jsx)(TP,{}),(0,a.jsx)(BP,{}),(0,a.jsx)(HP,{open:Te,onOpenChange:Ve}),(0,a.jsx)(GP,{}),(0,a.jsx)(nU,{health:rt}),(0,a.jsx)(lU,{localTrusted:rt?.deploymentMode==="local_trusted"})]})})}r(q$,"Layout");var cw=null;function F$(){return cw??=new uf,cw}r(F$,"getDetachedClient");function H$(){const e=(0,b.useContext)($g),{data:t,isFetched:i}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn"),enabled:e!=null},e??F$());return e?{enabled:t?.enableConferenceRoomChat===!0,loaded:i}:{enabled:!1,loaded:!0}}r(H$,"useConferenceRoomChatEnabled");function V$(){const{enabled:e,loaded:t}=H$();return t?e?(0,a.jsx)(Wl,{}):(0,a.jsx)(Ge,{to:"/dashboard",replace:!0}):null}r(V$,"ConferenceRoomChatGate");function Wi({children:e}){const{data:t,isFetched:i}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn")});return i?t?.enablePipelines!==!0?(0,a.jsx)(Ge,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(Wi,"PipelinesExperimentalGate");function uw({children:e}){const{data:t,isFetched:i}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn")});return i?t?.enableCases!==!0?(0,a.jsx)(Ge,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(uw,"CasesExperimentalGate");function dw({children:e}){const{data:t,isFetched:i}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn")});return i?t?.enableStatusCards!==!0?(0,a.jsx)(Ge,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(dw,"StatusCardsExperimentalGate");function Q$({children:e}){const{data:t,isFetched:i}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn")});return i?t?.enablePixelsOffice!==!0?(0,a.jsx)(Ge,{to:"/dashboard",replace:!0}):(0,a.jsx)(a.Fragment,{children:e}):null}r(Q$,"PixelsOfficeExperimentalGate");function Ss({pageKey:e}){const{hidden:t,loaded:i}=rr();return i?t.has(e)?(0,a.jsx)(Ge,{to:"/company/settings",replace:!0}):(0,a.jsx)(Wl,{}):null}r(Ss,"HiddenSettingsPageGate");function uh(){const{data:e,isFetched:t}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn")});return t?e?.enableIsolatedWorkspaces!==!0?(0,a.jsx)(Ge,{to:"/dashboard",replace:!0}):(0,a.jsx)(Wl,{}):null}r(uh,"IsolatedWorkspacesRouteGate");function _l(){const e=vn(),{workspaceId:t}=Rs(),{companies:i,loading:l}=bt(),c=be({queryKey:P.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Rf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t)return(0,a.jsx)(nr,{scope:"global"});if(l||c.isPending)return(0,a.jsx)(Es,{});if(c.isError)return(0,a.jsx)(nr,{scope:"global"});const d=i.find(m=>m.id===c.data.companyId);return d?(0,a.jsx)(Ge,{to:`/${d.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):(0,a.jsx)(nr,{scope:"global"})}r(_l,"UnprefixedExecutionWorkspaceRedirect");function W$(){const{companyPrefix:e,workspaceId:t}=Rs(),{companies:i,loading:l}=bt(),c=be({queryKey:P.executionWorkspaces.detail(t??"__missing__"),queryFn:r(()=>Rf.get(t),"queryFn"),enabled:!!t,retry:!1});if(!t||!e)return(0,a.jsx)(nr,{scope:"global"});if(l||c.isPending)return(0,a.jsx)(Es,{});if(c.isError)return(0,a.jsx)(nr,{scope:"global"});const d=i.find(m=>m.issuePrefix.toUpperCase()===e.toUpperCase());return!d||d.id!==c.data.companyId?(0,a.jsx)(nr,{scope:"global"}):(0,a.jsx)(Wl,{})}r(W$,"ExecutionWorkspaceCompanyGate");function G$(e){return{heartbeat:{enabled:e?.heartbeatEnabled??dy.heartbeatEnabled,intervalSec:e?.intervalSec??dy.intervalSec,wakeOnDemand:!0,skipTimerWhenNoActionableWork:!0,cooldownSec:10,maxConcurrentRuns:20}}}r(G$,"buildNewAgentRuntimeConfig");var dh=["omp","custom-providers"],Y$={"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"},X$={"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"},jd={id:"",name:"",contextWindow:"",maxTokens:"",reasoning:!1,images:!1};function Z$(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??"",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:[{...jd}]}}r(Z$,"initialState");function RC(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(RC,"keyInput");function El(e){const t=Number(e.replace(/[_,\s]/g,""));return e.trim()&&Number.isInteger(t)&&t>0?t:void 0}r(El,"positive");function DC(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(DC,"headersInput");function J$(e){return{baseUrl:e.baseUrl.trim(),api:e.api||null,apiKey:RC(e),authHeader:e.authHeader,disableStrictTools:e.disableStrictTools,headers:DC(e),discovery:e.discovery?{type:e.discovery,...El(e.discoveryTimeout)?{timeoutMs:El(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()}:{},...El(t.contextWindow)?{contextWindow:El(t.contextWindow)}:{},...El(t.maxTokens)?{maxTokens:El(t.maxTokens)}:{},...t.reasoning?{reasoning:!0}:{},...t.images?{images:!0}:{}}))}}r(J$,"toInput");function Xd(e){if(e instanceof ji){const t=e.body?.details;if(Array.isArray(t)){const i=t.map(l=>typeof l?.message=="string"?`${Array.isArray(l.path)?`${l.path.join(".")}: `:""}${l.message}`:null).filter(l=>!!l);if(i.length)return i}return[e.message]}return[e instanceof Error?e.message:"Something went wrong"]}r(Xd,"problemsOf");function Go({label:e,hint:t,children:i}){return(0,a.jsxs)("label",{className:"flex min-w-0 flex-col gap-1.5 text-sm font-medium",children:[e,i,t?(0,a.jsx)("span",{className:"text-xs font-normal text-ink-3",children:t}):null]})}r(Go,"Field");function fh({label:e,hint:t,checked:i,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)(pS,{checked:i,onCheckedChange:l,"aria-label":e})]})}r(fh,"Toggle");function eB({provider:e,takenNames:t,onSaved:i,onCancel:l}){const[c,d]=(0,b.useState)(()=>Z$(e)),[m,f]=(0,b.useState)(null),h=r(E=>d(C=>({...C,...E})),"set"),g=r((E,C)=>d(I=>({...I,models:I.models.map((O,z)=>z===E?{...O,...C}:O)})),"setModel"),v=r((E,C)=>d(I=>({...I,headers:I.headers.map((O,z)=>z===E?{...O,...C}:O)})),"setHeader"),y=e!==null,j=!y&&c.name&&!x_.test(c.name)?"Use letters, digits, dot, dash or underscore":!y&&t.includes(c.name)?"A provider with this name already exists; edit it instead":null,k=bn({mutationFn:r(()=>vi.saveCustomProvider(c.name.trim(),J$(c)),"mutationFn"),onSuccess:i}),N=bn({mutationFn:r(()=>vi.probeCustomProvider({...y?{name:e.name}:{},baseUrl:c.baseUrl.trim(),apiKey:RC(c),authHeader:c.authHeader,headers:DC(c),...c.models[0]?.id.trim()?{modelId:c.models[0].id.trim()}:{}}),"mutationFn"),onSuccess:r(E=>{f(E),d(C=>({...C,api:E.suggestedApi??C.api,models:C.models.some(I=>I.id.trim())||!E.usedModel?C.models:[{...jd,id:E.usedModel}]}))},"onSuccess"),onError:r(()=>f(null),"onError")});function S(E){E.preventDefault(),j||k.mutate()}r(S,"submit");const D=[...y&&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"}],R=m?.models.filter(E=>!c.models.some(C=>C.id===E))??[];return(0,a.jsxs)("form",{onSubmit:S,"aria-label":y?`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:y?`Edit ${e.name}`:"Add a custom provider"}),(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:l,children:(0,a.jsx)(ia,{"aria-hidden":"true"})})]}),y&&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)(Go,{label:"Name",hint:j??"Used in model ids, e.g. my-gateway/model",children:(0,a.jsx)(aa,{value:c.name,onChange:r(E=>h({name:E.target.value}),"onChange"),disabled:y,required:!0,"aria-invalid":!!j,placeholder:"my-gateway",autoComplete:"off"})}),(0,a.jsx)(Go,{label:"Base URL",hint:"Usually ends in /v1",children:(0,a.jsx)(aa,{value:c.baseUrl,onChange:r(E=>h({baseUrl:E.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)(V3,{"aria-label":"Where the key comes from",className:"flex-wrap self-start",children:D.map(({mode:E,label:C})=>(0,a.jsx)(H3,{selected:c.keyMode===E,onClick:r(()=>h({keyMode:E,keyValue:""}),"onClick"),children:C},E))}),c.keyMode==="literal"?(0,a.jsx)(aa,{value:c.keyValue,onChange:r(E=>h({keyValue:E.target.value}),"onChange"),type:"password",autoComplete:"off",required:!0,"aria-label":"API key",placeholder:"sk-..."}):c.keyMode==="env"?(0,a.jsx)(aa,{value:c.keyValue,onChange:r(E=>h({keyValue:E.target.value.toUpperCase()}),"onChange"),required:!0,"aria-label":"Environment variable name",placeholder:"MY_GATEWAY_KEY",autoComplete:"off"}):c.keyMode==="command"?(0,a.jsx)(aa,{value:c.keyValue,onChange:r(E=>h({keyValue:E.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:c.keyMode==="keep"?`The saved ${e?.apiKey.kind==="env"?`variable ${e.apiKey.name}`:e?.apiKey.kind==="command"?"command":"key"} stays as it is.`:c.keyMode==="env"?"OMP reads the key from this variable on the machine that runs agents.":c.keyMode==="command"?"OMP runs this command and uses what it prints.":c.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)(Go,{label:"Wire format (api)",hint:"Picking the wrong one is the most common mistake. Test connection suggests the right one.",children:(0,a.jsxs)(Iy,{value:c.api,onChange:r(E=>h({api:E.target.value}),"onChange"),className:"w-full",children:[(0,a.jsx)("option",{value:"",children:"Set per model"}),b_.map(E=>(0,a.jsx)("option",{value:E,children:Y$[E]??E},E))]})}),(0,a.jsx)(pe,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!c.baseUrl.trim()||N.isPending,onClick:r(()=>N.mutate(),"onClick"),children:N.isPending?"Testing...":"Test connection"}),N.error?(0,a.jsx)(Ul,{tone:"bad",children:Xd(N.error).join(" ")}):null,m?(0,a.jsxs)(Ul,{tone:m.suggestedApi?"ok":"bad",children:[m.suggestedApi?`${m.suggestedApi} answered${m.usedModel?` for ${m.usedModel}`:""}, so the wire format is set to it.`:m.usedModel?`No wire format answered for ${m.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:m.attempts.map(E=>(0,a.jsxs)("li",{className:"break-all",children:[E.api,": ",E.status??"no answer",E.detail&&!E.ok?` (${E.detail})`:""]},E.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"}),c.models.map((E,C)=>(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:[(0,a.jsx)(aa,{"aria-label":`Model ${C+1} id`,value:E.id,onChange:r(I=>g(C,{id:I.target.value}),"onChange"),placeholder:"model id",className:"col-span-2 sm:col-span-1",autoComplete:"off"}),(0,a.jsx)(aa,{"aria-label":`Model ${C+1} name`,value:E.name,onChange:r(I=>g(C,{name:I.target.value}),"onChange"),placeholder:"Display name",className:"col-span-2 sm:col-span-1"}),(0,a.jsx)(aa,{"aria-label":`Model ${C+1} context window`,value:E.contextWindow,onChange:r(I=>g(C,{contextWindow:I.target.value}),"onChange"),placeholder:"Context",inputMode:"numeric"}),(0,a.jsx)(aa,{"aria-label":`Model ${C+1} max output tokens`,value:E.maxTokens,onChange:r(I=>g(C,{maxTokens:I.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:E.reasoning,onChange:r(I=>g(C,{reasoning:I.target.checked}),"onChange")}),"Thinks"]}),(0,a.jsxs)("label",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("input",{type:"checkbox",checked:E.images,onChange:r(I=>g(C,{images:I.target.checked}),"onChange")}),"Images"]}),(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Remove model ${C+1}`,onClick:r(()=>h({models:c.models.filter((I,O)=>O!==C)}),"onClick"),children:(0,a.jsx)(Oh,{"aria-hidden":"true"})})]})]},C)),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(pe,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>h({models:[...c.models,{...jd}]}),"onClick"),children:[(0,a.jsx)(Xa,{"aria-hidden":"true"}),"Add model"]}),R.length?(0,a.jsxs)(pe,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>h({models:[...c.models.filter(E=>E.id.trim()),...R.map(E=>({...jd,id:E}))]}),"onClick"),children:["Add ",R.length," listed ",R.length===1?"model":"models"]}):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)(fh,{label:"Send the key as an Authorization header",hint:"OpenAI wire formats already do. Turn on for discovery or proxies that need it.",checked:c.authHeader,onChange:r(E=>h({authHeader:E}),"onChange")}),(0,a.jsx)(fh,{label:"Disable strict tools",hint:"For Anthropic-style proxies that reject strict tool schemas.",checked:c.disableStrictTools,onChange:r(E=>h({disableStrictTools:E}),"onChange")}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsx)(Go,{label:"Model discovery",hint:"Ask the server for its models instead of listing them",children:(0,a.jsxs)(Iy,{value:c.discovery,onChange:r(E=>h({discovery:E.target.value}),"onChange"),className:"w-full",children:[(0,a.jsx)("option",{value:"",children:"Off"}),C_.map(E=>(0,a.jsx)("option",{value:E,children:X$[E]??E},E))]})}),c.discovery?(0,a.jsx)(Go,{label:"Discovery timeout (ms)",children:(0,a.jsx)(aa,{value:c.discoveryTimeout,onChange:r(E=>h({discoveryTimeout:E.target.value}),"onChange"),inputMode:"numeric",placeholder:"OMP default"})}):null]}),c.discovery==="openai-models-list"?(0,a.jsx)(fh,{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:c.injectV1,onChange:r(E=>h({injectV1:E}),"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"}),c.headers.map((E,C)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2",children:[(0,a.jsx)(aa,{"aria-label":`Header ${C+1} name`,value:E.name,onChange:r(I=>v(C,{name:I.target.value}),"onChange"),placeholder:"X-Header",disabled:E.saved}),(0,a.jsx)(aa,{"aria-label":`Header ${C+1} value`,value:E.value,onChange:r(I=>v(C,{value:I.target.value}),"onChange"),placeholder:E.saved?"Saved; type to replace":"value",type:"password",autoComplete:"off"}),(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove header ${C+1}`,onClick:r(()=>h({headers:c.headers.filter((I,O)=>O!==C)}),"onClick"),children:(0,a.jsx)(Oh,{"aria-hidden":"true"})})]},C)),(0,a.jsxs)(pe,{type:"button",variant:"secondary",size:"sm",className:"self-start",onClick:r(()=>h({headers:[...c.headers,{name:"",value:"",saved:!1}]}),"onClick"),children:[(0,a.jsx)(Xa,{"aria-hidden":"true"}),"Add header"]})]})]})]}),k.error?(0,a.jsx)(Ul,{tone:"bad",children:(0,a.jsx)("ul",{className:"flex flex-col gap-0.5",children:Xd(k.error).map(E=>(0,a.jsx)("li",{children:E},E))})}):null,(0,a.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,a.jsx)(pe,{type:"button",variant:"ghost",onClick:l,children:"Cancel"}),(0,a.jsx)(pe,{type:"submit",disabled:k.isPending||!!j,children:k.isPending?"Checking with OMP...":"Save provider"})]})]})}r(eB,"CustomProviderForm");function tB(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(tB,"keySummary");function nB({onChanged:e}){const t=Rn(),i=be({queryKey:dh,queryFn:r(()=>vi.customProviders(),"queryFn")}),[l,c]=(0,b.useState)(null),d=bn({mutationFn:r(f=>vi.removeCustomProvider(f),"mutationFn"),onSuccess:r(f=>{t.setQueryData(dh,f),e?.()},"onSuccess")}),m=i.data?.providers??[];return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[i.error?(0,a.jsx)(Ul,{tone:"bad",children:Xd(i.error).join(" ")}):null,i.data?.parseError?(0,a.jsxs)(Ul,{tone:"bad",children:[i.data.parseError,". Fix ",i.data.modelsPath," by hand; Wardmote will not overwrite it."]}):null,m.length?(0,a.jsx)("ul",{"aria-label":"Custom providers",className:"flex flex-col divide-y divide-line rounded-lg border border-line",children:m.map(f=>(0,a.jsxs)("li",{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:f.name}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-ink-3",children:[f.baseUrl,f.api,tB(f),f.discovery?`discovery: ${f.discovery.type}`:`${f.models.length} ${f.models.length===1?"model":"models"}`].filter(Boolean).join(" · ")}),(0,a.jsxs)("span",{className:"flex gap-1",children:[(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Edit ${f.name}`,onClick:r(()=>c(f),"onClick"),children:(0,a.jsx)(e0,{"aria-hidden":"true"})}),(0,a.jsx)(pe,{type:"button",variant:"ghost",size:"icon-sm","aria-label":`Remove ${f.name}`,disabled:d.isPending,onClick:r(()=>{window.confirm(`Remove ${f.name} from OMP's models.yml? A backup stays in models.yml.bak.`)&&d.mutate(f.name)},"onClick"),children:(0,a.jsx)(Oh,{"aria-hidden":"true"})})]})]},f.name))}):i.isLoading?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"Reading models.yml..."}):null,d.error?(0,a.jsx)(Ul,{tone:"bad",children:Xd(d.error).join(" ")}):null,l?(0,a.jsx)(eB,{provider:l==="new"?null:l,takenNames:m.map(f=>f.name),onCancel:r(()=>c(null),"onCancel"),onSaved:r(f=>{t.setQueryData(dh,f),c(null),e?.()},"onSaved")},l==="new"?"new":l.name):(0,a.jsxs)(pe,{type:"button",variant:"secondary",size:"sm",className:"self-start",disabled:!!i.data?.parseError,onClick:r(()=>c("new"),"onClick"),children:[(0,a.jsx)(Xa,{"aria-hidden":"true"}),"Add custom provider"]}),i.data?(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Saved to ",i.data.modelsPath,", with the previous copy in models.yml.bak."]}):null]})}r(nB,"CustomProviders");var aB=["Check OMP","Connect a model","First task"],gg="Atlas",sB="general";var iB="Only an instance admin can set up OMP on this server.";function mh(e){return e?e.status===403?{message:iB,retry:!1}:{message:e.message||"Could not check OMP on this server.",retry:!0}:null}r(mh,"statusFailure");var rB={anthropic:"Anthropic",openai:"OpenAI","openai-codex":"OpenAI",openrouter:"OpenRouter",google:"Google",deepseek:"DeepSeek"};function lB(e){return e?rB[e]??e:null}r(lB,"providerLabel");function oB(e){return e.state==="ready"?"ready":e.state==="missing"?e.network==="offline"?"offline":"install":"old"}r(oB,"checkView");function cB(e){return(e?.models.length??0)>0}r(cB,"hasModel");function uB(e){return e.state!=="ready"?null:cB(e)?2:1}r(uB,"nextStepAfterCheck");function dB(e){return!e.connected||e.state!=="ready"?null:e.modelCount>0?2:1}r(dB,"nextStepAfterRemote");function fB(e){return e.copies.slice(1).filter(t=>t.version!==e.version)}r(fB,"olderCopies");function mB(e){const t=e.trim().split(/\r?\n/,1)[0]?.trim()??"";return t.length<=120?t:`${t.slice(0,119).trimEnd()}…`}r(mB,"taskTitle");function fw(e){const t=e?.replace(/[\\/]+$/,"").split(/[\\/]/).pop()?.trim();return t||"My company"}r(fw,"companyNameForFolder");function pB(e){return e?.recommendedModel?e.models.find(t=>t.id===e.recommendedModel)?.label??e.recommendedModel:null}r(pB,"recommendedModelLabel");function hB(e){return e?.recommendedModel?lB(e.models.find(t=>t.id===e.recommendedModel)?.provider??e.recommendedModel.split("/",1)[0]):null}r(hB,"signedInProvider");var Zd="Wardmote",MC=2e3,sd=["onboarding","omp-status"],gB={ok:(0,a.jsx)(_s,{className:"size-3.5","aria-hidden":!0}),bad:(0,a.jsx)(ia,{className:"size-3.5","aria-hidden":!0}),warn:(0,a.jsx)(ki,{className:"size-3.5","aria-hidden":!0}),wait:(0,a.jsx)(VE,{className:"size-3.5","aria-hidden":!0}),run:(0,a.jsx)(Gl,{className:"size-3.5 motion-safe:animate-spin","aria-hidden":!0})},xB={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 Ol({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(i=>(0,a.jsxs)("li",{"data-check":i.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:G("grid size-5.5 shrink-0 place-items-center rounded-full",xB[i.state]),children:gB[i.state]}),(0,a.jsx)("span",{className:"min-w-0",children:i.label}),i.value?(0,a.jsx)("span",{className:"ms-auto min-w-0 truncate font-mono text-xs text-ink-3",children:i.value}):null]},i.label))})})}r(Ol,"Checks");function xg({command:e}){const[t,i]=(0,b.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)(pe,{type:"button",variant:"secondary",size:"sm",onClick:r(()=>{d0(e).then(()=>i(!0))},"onClick"),children:[t?(0,a.jsx)(_s,{className:"size-3.5","aria-hidden":!0}):(0,a.jsx)(eI,{className:"size-3.5","aria-hidden":!0}),t?"Copied":"Copy command"]})]})}r(xg,"CommandBlock");function Jd({tone:e,children:t}){return(0,a.jsxs)("div",{role:e==="bad"?"alert":"note",className:G("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)(ki,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{children:t})]})}r(Jd,"Note");function bB({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:aB.map((t,i)=>(0,a.jsxs)("li",{className:"flex items-center gap-1.5","aria-current":i===e?"step":void 0,children:[i>0?(0,a.jsx)("span",{"aria-hidden":!0,className:"h-px w-5.5 bg-line"}):null,(0,a.jsx)("span",{className:G("grid size-5 place-items-center rounded-full border border-line-strong text-(length:--text-micro) font-semibold",i<e&&"border-ok bg-ok text-bg",i===e&&"border-accent text-accent"),children:i<e?(0,a.jsx)(_s,{className:"size-3","aria-hidden":!0}):i+1}),(0,a.jsx)("span",{className:G(i===e?"font-semibold text-ink":"max-sm:sr-only"),children:t})]},t))})}r(bB,"Steps");function er({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(er,"Heading");function OC({title:e,paragraphs:t}){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:e}),t.map(i=>(0,a.jsx)("p",{className:"text-sm text-ink-2",children:i},i))]})}r(OC,"SideText");var vB=(0,a.jsx)(OC,{title:"Why OMP",paragraphs:[`${Zd} runs every agent on OMP. OMP talks to the model and uses the tools; ${Zd} 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 jc({children:e}){return(0,a.jsx)("div",{className:"mt-auto flex flex-wrap items-center gap-2 pt-2",children:e})}r(jc,"Actions");function bg(e){if(e instanceof ji){const t=e.body;if(t&&typeof t.error=="string")return t.error}return e instanceof Error?e.message:String(e)}r(bg,"errorMessage$1");function yB({open:e,onOpenChange:t,onPick:i}){const[l,c]=(0,b.useState)(null),d=be({queryKey:["onboarding","omp-browse",l],queryFn:r(()=>vi.browse(l),"queryFn"),enabled:e});return(0,a.jsx)(Ds,{open:e,onOpenChange:t,children:(0,a.jsxs)(Gs,{className:"sm:max-w-lg",children:[(0,a.jsxs)(Sc,{children:[(0,a.jsx)(Qs,{children:"Choose omp"}),(0,a.jsx)(Nc,{className:"truncate font-mono text-xs",children:d.data?.path??"…"})]}),(0,a.jsxs)("ul",{className:"-mx-2 max-h-80 overflow-y-auto",children:[d.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(d.data?.parent??null),"onClick"),children:[(0,a.jsx)(bi,{className:"size-4 text-ink-3","aria-hidden":!0}),".."]})}):null,d.data?.entries.map(m=>(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(()=>{m.kind==="directory"?c(m.path):(i(m.path),t(!1))},"onClick"),children:[m.kind==="directory"?(0,a.jsx)(bi,{className:"size-4 text-ink-3","aria-hidden":!0}):(0,a.jsx)(cT,{className:"size-4 text-accent","aria-hidden":!0}),(0,a.jsx)("span",{className:"truncate",children:m.name})]})},m.path)),d.isError?(0,a.jsx)("li",{className:"px-2 py-2 text-sm text-bad",children:bg(d.error)}):null]})]})})}r(yB,"OmpFilePicker");function jB({status:e,failure:t,command:i,onChooseCommand:l,onRemote:c,onRetry:d}){const[m,f]=(0,b.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)(er,{title:"Install OMP",lede:"Looking for OMP on this computer."}),(0,a.jsx)(Ol,{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)(Jd,{tone:"bad",children:t.message}):null]});const g=oB(e);if(g==="old"){const v=fB(e);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(er,{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. ${Zd} needs OMP ${e.minVersion} or newer.`}),(0,a.jsx)(xg,{command:e.updateCommand}),(0,a.jsx)(Ol,{label:"OMP checks",rows:[{state:"ok",label:"omp found",value:e.path},h(e)]}),v.length>0?(0,a.jsxs)(Jd,{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)(er,{title:"You are offline",lede:"Installing needs the internet once. Connect, or point to an omp you already copied here."}),(0,a.jsx)(Ol,{label:"OMP checks",rows:[{state:"bad",label:"omp.sh not reachable",value:"3 tries"},i?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)(pe,{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:G("truncate",i?"font-mono text-xs":"text-ink-3"),children:i??"Choose file"}),(0,a.jsx)(bi,{className:"size-4","aria-hidden":!0})]})]}),(0,a.jsx)(yB,{open:m,onOpenChange:f,onPick:l}),(0,a.jsx)(jc,{children:(0,a.jsxs)(pe,{type:"button",variant:"secondary",onClick:d,children:[(0,a.jsx)(Gl,{className:"size-3.5","aria-hidden":!0}),"Try again"]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(er,{title:"Install OMP",lede:"Run this in a terminal on this computer. This page moves on by itself."}),(0,a.jsx)(xg,{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)(Ol,{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)(jc,{children:(0,a.jsx)(pe,{type:"button",variant:"ghost",onClick:c,children:"Run agents on another machine"})}):null]})}r(jB,"CheckOmpScreen");function wB({remote:e,pending:t,error:i,onCheck:l,onLocal:c}){const[d,m]=(0,b.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)(er,{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(d.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)(aa,{id:"onboarding-ssh-address",value:d,onChange:r(h=>m(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)(Ol,{label:"Remote checks",rows:f}):null,i?(0,a.jsx)(Jd,{tone:"bad",children:i}):null,(0,a.jsxs)(jc,{children:[(0,a.jsx)(pe,{type:"button",variant:"ghost",onClick:c,children:"Use this computer"}),(0,a.jsx)("span",{className:"flex-1"}),(0,a.jsx)(pe,{type:"submit",form:"onboarding-remote-form",disabled:t||d.trim().length===0,children:t?"Checking…":"Continue"})]})]})}r(wB,"RemoteScreen");function kB({remote:e,onSignedIn:t}){const[i,l]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{if(!e)return;const c=window.setInterval(t,MC);return()=>window.clearInterval(c)},[e,t]),e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(er,{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)(xg,{command:`ssh -t ${e.username}@${e.host}${e.port!==22?` -p ${e.port}`:""} omp login`})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(er,{title:"Connect a model",lede:i?"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."}),i?(0,a.jsx)(nB,{onChanged:t}):(0,a.jsx)(F3,{autoFocus:!0,onSignedIn:t}),(0,a.jsxs)(jc,{children:[(0,a.jsx)(pe,{type:"button",variant:"link",size:"sm",onClick:r(()=>l(c=>!c),"onClick"),children:i?"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(kB,"ConnectScreen");function SB({status:e,remote:t,pending:i,error:l,onStart:c}){const[d,m]=(0,b.useState)(""),f=t?t.homeFolder:e?.projectFolder,h=t?null:pB(e);return(0,a.jsxs)("form",{className:"contents",onSubmit:r(g=>{g.preventDefault(),d.trim()&&c(d.trim())},"onSubmit"),children:[(0,a.jsx)(er,{title:"What should your first agent do?",lede:`${gg} 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)(dS,{id:"onboarding-first-task",value:d,onChange:r(g=>m(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"}),gg,", 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)(Jd,{tone:"bad",children:l}):null,(0,a.jsxs)(jc,{children:[(0,a.jsx)("span",{className:"flex-1"}),(0,a.jsxs)(pe,{type:"submit",disabled:i||d.trim().length===0,children:[(0,a.jsx)(t0,{className:"size-3.5","aria-hidden":!0}),i?"Starting…":"Start"]})]})]})}r(SB,"TaskScreen");function NB(){const{onboardingOpen:e,onboardingOptions:t,closeOnboarding:i,onboardingRouteDismissed:l,setOnboardingRouteDismissed:c}=Ec(),{companies:d,loading:m}=bt(),f=vn(),h=aU(f.pathname),g=h&&m?null:sU({pathname:f.pathname,companyPrefix:h,companies:d});if(!(e||g!==null&&!l))return null;const v=(e?t.companyId:g?.companyId)??null;return(0,a.jsx)(CB,{companyId:v,onClose:r(()=>{i(),c(!0)},"onClose")})}r(NB,"OnboardingFlow");function CB({companyId:e,onClose:t}){const i=Rn(),l=xa(),{setSelectedCompanyId:c}=bt(),[d,m]=(0,b.useState)(0),[f,h]=(0,b.useState)("local"),[g,v]=(0,b.useState)(null),[y,j]=(0,b.useState)(null),[k,N]=(0,b.useState)(null),S=be({queryKey:[...sd,g],queryFn:r(()=>vi.status({command:g}),"queryFn"),retry:r((L,_)=>(mh(_)?.retry??!0)&&L<2,"retry"),refetchInterval:r(L=>mh(L.state.error)?.retry===!1||d===2&&L.state.data?!1:MC,"refetchInterval")}),D=S.data,R=mh(S.error),E=be({queryKey:[...sd,"network",g],queryFn:r(()=>vi.status({command:g,network:!0}),"queryFn"),enabled:D?.state==="missing"&&f==="local",refetchInterval:3e4}),C=(0,b.useMemo)(()=>{if(D)return D.state!=="missing"?D:{...D,network:E.data?.network??null}},[D,E.data]);(0,b.useEffect)(()=>{if(f!=="local"||!D||d===2)return;const L=uB(D);L!==null&&L>d&&m(L)},[f,D,d]);const I=bn({mutationFn:r(L=>vi.remote(L),"mutationFn"),onSuccess:r(L=>{j(L);const _=dB(L);_!==null&&m(_)},"onSuccess")}),O=(0,b.useCallback)(()=>{if(!y){i.invalidateQueries({queryKey:sd});return}vi.remote(y.address).then(L=>{j(L),L.modelCount>0&&m(2)}).catch(()=>{})},[y,i]),z=bn({mutationFn:r(async L=>{const _=f==="remote"?y?.homeFolder??null:D?.projectFolder??null;let U=e;U||(U=(await uy.create({name:fw(f==="remote"?y?.host:_)})).id,await i.invalidateQueries({queryKey:P.companies.all}));let F=null;f==="remote"&&y?.homeFolder&&(F=(await z3.create(U,{name:y.host,driver:"ssh",config:{host:y.host,port:y.port,username:y.username,remoteWorkspacePath:y.homeFolder}})).id);const Y={};f==="local"&&D?.recommendedModel&&(Y.model=D.recommendedModel),_&&(Y.cwd=_),g&&(Y.command=g);const se=await Pa.hire(U,{name:gg,role:sB,appearance:__(),adapterType:"omp_local",adapterConfig:Y,onboardingFirstAgent:!0,runtimeConfig:G$(),...F?{defaultEnvironmentId:F}:{}});se.approval&&await G1.approve(se.approval.id,"Approved during onboarding first-agent setup.");const me=await ir.create(U,{name:fw(_),status:"in_progress",...f==="local"&&_?{workspace:{sourceType:"local_path",cwd:_,isPrimary:!0}}:{}}),oe=await dn.create(U,{title:mB(L),description:L,status:"todo",assigneeAgentId:se.agent.id,projectId:me.id});return{companyId:U,issue:oe}},"mutationFn"),onMutate:r(()=>N(null),"onMutate"),onError:r(L=>N(bg(L)),"onError"),onSuccess:r(async({companyId:L,issue:_})=>{await Promise.all([i.invalidateQueries({queryKey:P.companies.all}),i.invalidateQueries({queryKey:P.agents.list(L)}),i.invalidateQueries({queryKey:P.projects.list(L)}),i.invalidateQueries({queryKey:P.issues.list(L)})]);const U=(await uy.list()).find(Y=>Y.id===L)?.issuePrefix??null;c(L,{source:"route_sync"}),t();const F=_.identifier??_.id;l(U?`/${U}/issues/${F}`:`/issues/${F}`)},"onSuccess")}),B=d===1?(0,a.jsx)(OC,{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."]}):d===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)(Ol,{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 ${D?.version??""}`.trim()},{state:"ok",label:`${hB(D)??"Model"} signed in`,value:"imported"},{state:"ok",label:"Project folder",value:D?.projectFolder}]})]}):vB;return(0,a.jsx)(Ds,{open:!0,onOpenChange:r(L=>{L||t()},"onOpenChange"),children:(0,a.jsxs)(JI,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-50 bg-bg"}),(0,a.jsxs)("div",{"data-testid":"onboarding-flow","data-step":d,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(L=>{L.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)(n0,{className:"size-6.5 shrink-0 text-ink","aria-hidden":"true"}),(0,a.jsx)("b",{className:"text-base font-semibold",children:Zd})]}),(0,a.jsx)(bB,{step:d}),d===0&&f==="local"?(0,a.jsx)(jB,{status:C,failure:R,command:g,onChooseCommand:v,onRemote:r(()=>h("remote"),"onRemote"),onRetry:r(()=>{i.invalidateQueries({queryKey:sd})},"onRetry")}):null,d===0&&f==="remote"?(0,a.jsx)(wB,{remote:y,pending:I.isPending,error:I.isError?bg(I.error):null,onCheck:r(L=>I.mutate(L),"onCheck"),onLocal:r(()=>{h("local"),j(null)},"onLocal")}):null,d===1?(0,a.jsx)(kB,{remote:f==="remote"?y:null,onSignedIn:O}):null,d===2?(0,a.jsx)(SB,{status:D,remote:f==="remote"?y:null,pending:z.isPending,error:k,onStart:r(L=>z.mutate(L),"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:B})]})]})})}r(CB,"OnboardingFlowDialog");function AB(){const{openNewIssue:e}=Ms();return(0,b.useEffect)(()=>{e()},[e]),(0,a.jsx)(Ge,{to:"/issues",replace:!0})}r(AB,"NewTaskShortcut");var _B="npx @tickernelz/wardmote auth bootstrap-ceo";function ph({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)(EI,{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:_B})]})}r(ph,"CliFallback");function id({children:e}){return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsx)(_c,{className:"block p-6",children:e})})}r(id,"StateChrome");function EB(e){return e.user.email||e.user.name||e.user.id}r(EB,"displayIdentity");function IB(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(IB,"claimErrorCopy");function TB({claimAvailable:e,hasActiveInvite:t=!1,session:i,claimState:l,claimError:c,onClaim:d}){if(!e)return(0,a.jsxs)(id,{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)(ph,{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)(id,{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)(Rd,{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)(za,{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)(pe,{asChild:!0,variant:"secondary",children:(0,a.jsx)("a",{href:"/",children:"Continue to dashboard"})})})]});if(!i)return(0,a.jsxs)(id,{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)(pe,{asChild:!0,children:(0,a.jsx)(fn,{to:"/auth?next=/",children:"Sign in / Create account"})})}),(0,a.jsx)(ph,{hasActiveInvite:t})]});const m=IB(c),f=l==="claiming";return(0,a.jsxs)(id,{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)(pe,{onClick:d,disabled:f,children:[f&&(0,a.jsx)(za,{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:EB(i)})]})]}),(0,a.jsxs)("p",{className:"mt-3 text-xs text-ink-3",children:["Wrong account?"," ",(0,a.jsx)(fn,{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)(ki,{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:m.title}),m.body&&(0,a.jsx)("p",{className:"mt-1 text-bad/90",children:m.body})]})]}),(0,a.jsx)(ph,{hasActiveInvite:t})]})}r(TB,"BootstrapPendingPage");var rd=5e3;function RB({temporary:e,retrying:t,onRetry:i}){return(0,a.jsxs)("div",{className:"mx-auto flex max-w-xl flex-col gap-4 px-4 py-16",children:[(0,a.jsx)(Gl,{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)(pe,{variant:"secondary",onClick:i,disabled:t,children:t?"Connecting…":"Try again"})})]})}r(RB,"CloudAccessError");function DB(){return(0,a.jsx)("div",{className:"mx-auto max-w-xl py-10",children:(0,a.jsxs)(_c,{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(DB,"NoBoardAccessPage");function mw({allowMembershipRequest:e=!1}={}){const t=vn(),i=Rn(),[l,c]=(0,b.useState)(!1),d=be({queryKey:P.health,queryFn:r(()=>Ac.get(),"queryFn"),retry:!1,refetchInterval:r(C=>{if(C.state.error)return Ir(C.state.error)?rd:!1;const I=C.state.data;return I?.status==="starting"?rd:I?.deploymentMode==="authenticated"&&I.bootstrapStatus==="bootstrap_pending"?2e3:!1},"refetchInterval"),refetchIntervalInBackground:!0}),m=d.data?.deploymentMode==="authenticated",f=m&&d.data?.bootstrapStatus==="bootstrap_pending",h=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),enabled:m,retry:!1,refetchInterval:r(C=>Ir(C.state.error)?rd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),g=be({queryKey:P.access.currentBoardAccess,queryFn:r(()=>wi.getCurrentBoardAccess(),"queryFn"),enabled:m&&!f&&!!h.data,retry:!1,refetchInterval:r(C=>Ir(C.state.error)?rd:!1,"refetchInterval"),refetchIntervalInBackground:!0}),v=bn({mutationFn:r(()=>wi.claimBootstrapAdmin(),"mutationFn"),onSuccess:r(async()=>{await i.invalidateQueries({queryKey:P.auth.session}),await i.invalidateQueries({queryKey:P.health}),await i.invalidateQueries({queryKey:P.companies.all}),await i.invalidateQueries({queryKey:P.companies.stats}),await i.invalidateQueries({queryKey:P.access.currentBoardAccess})},"onSuccess")}),y=[d,...m?[h]:[],...m&&!f&&h.data?[g]:[]],j=d.data?.status==="starting",k=j||y.some(C=>Ir(C.error)),N=y.find(C=>C.error&&!(C.data!==void 0&&Ir(C.error)))?.error,S=d.isLoading||m&&h.isLoading||m&&!f&&!!h.data&&g.isLoading,D=e||!m||!!g.data?.isInstanceAdmin||(g.data?.companyIds.length??0)>0,R=!S&&!N&&!f&&(!m||!!h.data)&&D;(0,b.useEffect)(()=>{R?d.data?.status==="ok"&&c(!0):c(!1)},[R,d.data?.status]);const E=(0,b.useRef)(!1);if((0,b.useEffect)(()=>{k?E.current=!0:E.current&&!S&&!N&&(E.current=!1,i.invalidateQueries({predicate:r(C=>Ir(C.state.error),"predicate")}))},[k,S,N,i]),N||j&&!l)return(0,a.jsx)(RB,{temporary:N?Ir(N):!0,retrying:y.some(C=>C.isFetching),onRetry:r(()=>{for(const C of y)(C.error||C===d&&j)&&C.refetch({cancelRefetch:!1})},"onRetry")});if(S)return(0,a.jsx)(Es,{});if(f){const C=d.data;if(!C)return(0,a.jsx)(Es,{});const I=v.error instanceof ji?{status:v.error.status,message:v.error.message}:v.error instanceof Error?{message:v.error.message}:null;return(0,a.jsx)(TB,{claimAvailable:C.deploymentExposure==="private",hasActiveInvite:C.bootstrapInviteActive,session:h.data,claimState:v.isSuccess?"success":v.isPending?"claiming":"idle",claimError:I,onClaim:r(()=>v.mutate(),"onClaim")})}if(m&&!h.data){const C=encodeURIComponent(`${t.pathname}${t.search}`);return(0,a.jsx)(Ge,{to:`/auth?next=${C}`,replace:!0})}return D?(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)(Wl,{})]}):(0,a.jsx)(DB,{})}r(mw,"CloudAccessGate");var LC=["all","active","paused","error","builtin"];function MB({endpointId:e,children:t}){const i=be({queryKey:P.chatEndpoints.detail(e),queryFn:r(()=>oS.get(e),"queryFn")}),{enabled:l,githubEnabled:c}=Fg();return i.isError?(0,a.jsxs)("div",{className:"space-y-3 p-6",children:[(0,a.jsx)("p",{role:"alert",className:"text-sm text-bad",children:i.error.message}),(0,a.jsx)(pe,{variant:"secondary",onClick:r(()=>{i.refetch()},"onClick"),children:"Retry"})]}):i.data?Sk(i.data.provider,l,c)?(0,a.jsx)(a.Fragment,{children:t}):(0,a.jsx)(Ge,{to:"/apps",replace:!0}):null}r(MB,"ProviderEndpointGate");function ld({children:e}){const{enabled:t,githubEnabled:i,loaded:l}=Fg(),[c]=vk(),{endpointId:d}=Rs();return!d&&c.get("provider")==="agentmail"?(0,a.jsx)(a.Fragment,{children:e}):l?d?(0,a.jsx)(MB,{endpointId:d,children:e}):Sk(c.get("provider"),t,i)?(0,a.jsx)(a.Fragment,{children:e}):(0,a.jsx)(Ge,{to:"/apps",replace:!0}):null}r(ld,"ChatConnectorsExperimentalGate");ke(()=>ye(()=>import("./TaskChatLab-B0aJ05Zn.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,120])));var OB=ke(()=>ye(()=>import("./Cases-gjrf6tmu.js").then(e=>e.Cases),__vite__mapDeps([121,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,123,40,124,125,7,9,126,127,98,128,129,130,38,131,54]))),LB=ke(()=>ye(()=>import("./CaseDetail-X0DGQoca.js").then(e=>e.CaseDetail),__vite__mapDeps([132,1,3,16,17,20,133,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,93,115,83,84,4,41,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,97,14,100,54,92,91,102,36,37,134,52,135,82,85,86,87,88,89,77,90,94,95,96,76,40,136,44,46,137,138,139,140,12,103,126,141,142,143,144,145,53,47,45,18,35,48,49,51,55,13,146,119,147,127,101,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,78,163,164,165,166,167,168,169,170,171,129,172,117,118,173,98,128,174,175,176,177,178,179,130,180,181]))),zB=ke(()=>ye(()=>import("./Dashboard-C_87MSE2.js").then(e=>e.Dashboard),__vite__mapDeps([182,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,76,41,183,184,7,9,57,185,92,91,60,70,186,147,127,148,187,188,37,189,190,95,128,150,164,162,78,100,177,73,191,10,13,166,58,59,61,62,4,43,63,64,6,34,65,66,67,68,69,50,38,71,72,54,126,192,167,168,169,193,194,195,111,196,197,198,199,142,200,201,52,122,110,82,83,84,85,86,87,88,89,77,90,94,96,202,101,203,144,145,40,204,205,154,206,207,115,116,208,156,14,209,163,210,119,176,211,212,213,98,214,102,215,216,56,12,157,107,173,217,218,219,220,221,222,223,39,224,225,226,174,175,227,228,229,230,231,232,233,234,235,236,237,36,238,239,240,35,11,153,151,241,46,81,53,97,99,242,118,104,149,243,120,112,244,245,103,117,155,109,246,247,160,161,165,248,249,250,251,252,106,253,80,45,18,47,48,49,51,55,254]))),PB=ke(()=>ye(()=>import("./DashboardLive-CdHY1mHk.js").then(e=>e.DashboardLive),__vite__mapDeps([255,1,3,21,20,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,203,128,194,195,111,186,147,150,91,60,92,93,196,197,198,199,142,200,201,52,7,9,122,4,110,82,59,61,83,84,85,86,87,88,89,77,90,54,94,95,96,202,101,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,239,240,35,11,153,151,58,62,63,65,67,69,50,72,73,241,46,81,53,97,99,242,118,104,149,243,120,112,244,245,103,117,177,155,109,246,247,160,161,165,248,249,250,251,168,252,106,253,80,45,18,47,48,49,51,55]))),UB=ke(()=>ye(()=>import("./Companies-BbbaWb0v.js").then(e=>e.Companies),__vite__mapDeps([256,1,3,20,22,21,115,25,8,83,26,27,84,4,41,5,143,29,116,7,9,257,13,173,104,54,126,98,128,177]))),$B=ke(()=>ye(()=>import("./Agents-BTZu-vy-.js").then(e=>e.Agents),__vite__mapDeps([258,1,3,17,16,20,195,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,135,83,84,9,76,7,48,10,56,257,13,100,91,60,92,93,37,70,111,142,186,147,259,101,52,54,260,261,128,223,39,224,40,176,164,162,78,174,85,86,175,230,231,233,177,262,201,263]))),hh=ke(()=>ye(()=>import("./AgentDetail-BbpgFl_G.js").then(e=>e.AgentDetail),__vite__mapDeps([264,1,3,16,17,20,265,195,197,22,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,239,42,44,45,18,35,46,47,48,49,50,51,53,55,266,267,268,80,58,62,63,65,67,69,72,73,81,97,99,111,148,113,134,185,127,269,270,246,165,248,249,250,155,271,272,108,273,274,275,120,276,262,277,278,279,280,11,281,282,283,177,284]))),BB=ke(()=>ye(()=>import("./Projects-B7XDgtru.js").then(e=>e.Projects),__vite__mapDeps([285,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,123,4,7,9,13,127,128,177,278,279,263]))),Dr=ke(()=>ye(()=>import("./ProjectDetail-Cie7YkeD.js").then(e=>e.ProjectDetail),__vite__mapDeps([286,1,3,16,17,20,22,197,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,135,143,62,287,288,177,111,186,147,127,148,187,189,190,289,290,58,63,65,67,69,50,72,73,178,179,170,278,279,291,270,292,246,293,294,103,141,277]))),KB=ke(()=>ye(()=>import("./ProjectWorkspaceDetail-4Eh2xMnt.js").then(e=>e.ProjectWorkspaceDetail),__vite__mapDeps([295,1,3,16,17,20,139,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,140,34,7,9,12,14,103,126,141,142,135,83,84,202,101,52,54,203,4,127,187,188,37,189,190,128,177,170,87,296]))),qB=ke(()=>ye(()=>import("./Workspaces-J1XIkM6C.js").then(e=>e.Workspaces),__vite__mapDeps([297,1,3,20,265,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,142,128,291,76,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,69,70,50,38,71,72,73,157,126,37,101,52,54,164,162,78,100,174,85,86,83,40,175,270,197,198,199,200,201,122,110,82,84,87,88,89,77,90,91,92,93,94,95,96,202,203,144,145,41,204,205,154,206,207,115,116,208,156,13,14,209,163,210,119,176,211,212,213,98,214,102,183,215,216,56,12,57,107,173,217,188,218,219,220,221,222,223,39,224,225,226,227,228,229,230,231,232,233,234,235,236,237,36,238,292,111,246,294,103,127,141,277]))),FB=ke(()=>ye(()=>import("./Issues-BrnnvHeE.js").then(e=>e.Issues),__vite__mapDeps([298,1,3,16,17,20,265,195,299,22,138,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,135,83,84,9,62,123,4,41,63,64,215,7,11,13,14,100,90,54,188,92,93,37,70,111,142,186,147,127,101,52,148,300,149,128,150,91,60,177,73,301,58,59,61,43,6,34,65,66,67,68,69,50,38,71,72,163,57,170,87,201,115,82,85,86,88,89,77,94,95,96,140,145,40,42,44,45,18,35,12,36,46,47,48,49,51,53,55,56,302,103,102,223,39,224,176,228,229,119,222,230,76,247,271,252,106,253,80,81,97,98,99]))),HB=ke(()=>ye(()=>import("./Search-CBYkMobM.js").then(e=>e.Search),__vite__mapDeps([303,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,115,83,84,41,135,9,123,40,304,46,7,35,13,14,100,273,90,54,188,126,91,60,92,93,70,127,98,218,128,150,176,73,134,52]))),VB=ke(()=>ye(()=>import("./IssueDetail-CdKGl1_O.js").then(e=>e.t).then(e=>e.IssueDetail),__vite__mapDeps([305,1,3,25,8,16,17,20,265,195,22,197,198,199,142,21,19,23,24,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,18,35,138,239,306,108,167,168,169,133,58,62,63,65,67,69,50,72,73,97,134,249,250,307,308,309,310,135,123,53,266,267,268,80,46,45,47,48,49,51,55,81,99,111,148,113,42,44,311,136,75,79,103,104,105,304,312,313,137,139,140,141,143,146,147,127,149,150,151,152,153,155,158,159,160,161,165,166,170,171,129,106,241,242,118,243,120,112,244,245,11,257,314,15,74,109,114,117,315,186,259,300,187,189,190,269,289,253,316,317,318,196,240,177,246,247,248,251,319,320,301,179,290,178,271,321,191,10,322,272,273,192]))),QB=ke(()=>ye(()=>import("./AgentChats-DztS4ACV.js").then(e=>e.AgentChats),__vite__mapDeps([323,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,91,60,92,93,128,324]))),WB=ke(()=>ye(()=>import("./AgentChat-DTQT-Wek.js").then(e=>e.AgentChat),__vite__mapDeps([325,1,3,16,17,20,22,305,25,8,265,195,197,198,199,142,21,19,23,24,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,18,35,138,239,306,108,167,168,169,133,58,62,63,65,67,69,50,72,73,97,134,249,250,307,308,309,310,135,123,53,266,267,268,80,46,45,47,48,49,51,55,81,99,111,148,113,42,44,311,136,75,79,103,104,105,304,312,313,137,139,140,141,143,146,147,127,149,150,151,152,153,155,158,159,160,161,165,166,170,171,129,106,241,242,118,243,120,112,244,245,11,257,314,15,74,109,114,117,315,186,259,300,187,189,190,269,289,253,316,317,318,196,240,177,246,247,248,251,319,320,301,179,290,178,271,321,191,10,322,272,273,192,326,324]))),GB=ke(()=>ye(()=>import("./IssueChatLongThreadPerf-CjaD3woT.js").then(e=>e.IssueChatLongThreadPerf),__vite__mapDeps([327,1,3,126,8,9,177,196,16,17,20,197,22,198,199,142,21,19,23,24,25,26,27,28,29,5,30,31,32,33,200,201,52,7,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,239,240,35,11,153,151,58,62,63,65,67,69,50,72,73,241,46,81,53,97,99,242,118,104,149,243,120,112,244,245,103,117,111,155,109,246,247,160,161,165,248,249,250,251,168]))),YB=ke(()=>ye(()=>import("./Routines-BOD80kz-.js").then(e=>e.Routines),__vite__mapDeps([328,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,82,59,60,61,83,52,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,123,4,40,41,7,9,13,146,37,70,111,186,147,127,101,148,329,128,152,151,153,154,174,175,177,330,201,115,116,173,98,134,331,110,204,205,206,6,312,66,313,257,126,142,102,231,38,171]))),XB=ke(()=>ye(()=>import("./Pipelines-lSbZ6-uQ.js").then(e=>e.Learnings),__vite__mapDeps([332,1,3,16,17,20,22,333,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,127,148,149,133,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,134,52,122,82,85,86,87,88,89,77,90,94,95,96,123,145,40,175,44,46,334,78,241,197,198,199,142,200,201,110,202,101,203,144,76,204,205,154,206,162,207,208,156,13,209,163,210,119,126,176,211,212,213,98,214,183,215,216,56,12,157,57,107,173,217,188,218,219,220,128,221,222,223,39,224,164,225,226,174,227,228,229,230,231,232,233,234,235,236,237,238,81,53,35,99,242,118,104,243,120,112,244,245,315,111,177,196,239,240,11,153,151,103,117,155,109,246,247,160,161,165,248,249,250,251,168,159,319,179,55,181,335]))),ZB=ke(()=>ye(()=>import("./Pipelines-lSbZ6-uQ.js").then(e=>e.PipelineItemDetail),__vite__mapDeps([332,1,3,16,17,20,22,333,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,127,148,149,133,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,134,52,122,82,85,86,87,88,89,77,90,94,95,96,123,145,40,175,44,46,334,78,241,197,198,199,142,200,201,110,202,101,203,144,76,204,205,154,206,162,207,208,156,13,209,163,210,119,126,176,211,212,213,98,214,183,215,216,56,12,157,57,107,173,217,188,218,219,220,128,221,222,223,39,224,164,225,226,174,227,228,229,230,231,232,233,234,235,236,237,238,81,53,35,99,242,118,104,243,120,112,244,245,315,111,177,196,239,240,11,153,151,103,117,155,109,246,247,160,161,165,248,249,250,251,168,159,319,179,55,181,335]))),JB=ke(()=>ye(()=>import("./Pipelines-lSbZ6-uQ.js").then(e=>e.PipelineItemLegacyRedirect),__vite__mapDeps([332,1,3,16,17,20,22,333,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,127,148,149,133,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,134,52,122,82,85,86,87,88,89,77,90,94,95,96,123,145,40,175,44,46,334,78,241,197,198,199,142,200,201,110,202,101,203,144,76,204,205,154,206,162,207,208,156,13,209,163,210,119,126,176,211,212,213,98,214,183,215,216,56,12,157,57,107,173,217,188,218,219,220,128,221,222,223,39,224,164,225,226,174,227,228,229,230,231,232,233,234,235,236,237,238,81,53,35,99,242,118,104,243,120,112,244,245,315,111,177,196,239,240,11,153,151,103,117,155,109,246,247,160,161,165,248,249,250,251,168,159,319,179,55,181,335]))),gh=ke(()=>ye(()=>import("./Pipelines-lSbZ6-uQ.js").then(e=>e.Pipelines),__vite__mapDeps([332,1,3,16,17,20,22,333,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,127,148,149,133,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,134,52,122,82,85,86,87,88,89,77,90,94,95,96,123,145,40,175,44,46,334,78,241,197,198,199,142,200,201,110,202,101,203,144,76,204,205,154,206,162,207,208,156,13,209,163,210,119,126,176,211,212,213,98,214,183,215,216,56,12,157,57,107,173,217,188,218,219,220,128,221,222,223,39,224,164,225,226,174,227,228,229,230,231,232,233,234,235,236,237,238,81,53,35,99,242,118,104,243,120,112,244,245,315,111,177,196,239,240,11,153,151,103,117,155,109,246,247,160,161,165,248,249,250,251,168,159,319,179,55,181,335]))),e6=ke(()=>ye(()=>import("./Pipelines-lSbZ6-uQ.js").then(e=>e.ReviewQueue),__vite__mapDeps([332,1,3,16,17,20,22,333,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,127,148,149,133,93,115,83,84,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,50,38,71,72,73,116,97,14,54,92,91,102,36,37,134,52,122,82,85,86,87,88,89,77,90,94,95,96,123,145,40,175,44,46,334,78,241,197,198,199,142,200,201,110,202,101,203,144,76,204,205,154,206,162,207,208,156,13,209,163,210,119,126,176,211,212,213,98,214,183,215,216,56,12,157,57,107,173,217,188,218,219,220,128,221,222,223,39,224,164,225,226,174,227,228,229,230,231,232,233,234,235,236,237,238,81,53,35,99,242,118,104,243,120,112,244,245,315,111,177,196,239,240,11,153,151,103,117,155,109,246,247,160,161,165,248,249,250,251,168,159,319,179,55,181,335]))),t6=ke(()=>ye(()=>import("./PipelineSettings-CY-XoAGe.js").then(e=>e.PipelineSettings),__vite__mapDeps([336,1,3,16,17,20,22,333,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,100,70,127,148,149,200,115,83,84,4,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,140,62,145,161,40,207,204,7,9,205,101,154,206,162,116,208,156,68,13,14,209,163,210,119,126,37,176,211,11,12,173,142,98,128,214,102,152,151,222,153,335,337,110,43,174,175]))),pw=ke(()=>ye(()=>import("./StatusCards-BfwQO3yd.js").then(e=>e.StatusCards),__vite__mapDeps([338,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,122,4,115,83,84,41,135,9,40,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,69,70,50,38,71,72,73,116,183,13,157,100,339,119,88,86,126,91,92,93,101,52,54,98,128,102,153,151,154,164,162,78,174,85,175,134,292,111,246]))),n6=ke(()=>ye(()=>import("./PixelsOffice-s8WCydt9.js").then(e=>e.PixelsOffice),__vite__mapDeps([340,1,3,20,59,60,61,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,267,83,85,86,341,34,215,7,9,11,12,314,54,188,126,37,70,111,148,94,95,128,177,134,52,342,241,197,198,199,142,200,201,122,4,110,82,84,87,88,89,77,90,91,92,93,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,176,211,212,213,98,214,102,38,183,66,216,56,157,57,107,173,100,217,218,219,220,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,63,58,62,65,67,69,50,72,73,46,81,53,97,35,99,242,118,104,149,243,120,112,244,245,335,293]))),hw=ke(()=>ye(()=>import("./RoutineDetail-CxBrkRyy.js").then(e=>e.RoutineDetail),__vite__mapDeps([343,1,3,16,17,20,133,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,93,115,83,84,4,41,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,97,14,100,54,92,91,102,36,37,134,52,110,82,85,86,87,88,89,77,90,94,95,96,140,144,268,162,207,40,204,205,101,154,206,208,156,13,209,163,210,119,126,176,211,344,257,12,314,146,173,345,217,188,111,127,98,148,218,128,214,152,151,222,153,226,174,175,232,177,277,280,201,11,180,346,164,78,331,312,313,142,231,171,337,200,347]))),a6=ke(()=>ye(()=>import("./UserProfile-DUpHIz3U.js").then(e=>e.UserProfile),__vite__mapDeps([348,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,162,7,9,210,260,261,128]))),Il=ke(()=>ye(()=>import("./ExecutionWorkspaceDetail-w0tph5fx.js").then(e=>e.ExecutionWorkspaceDetail),__vite__mapDeps([349,1,3,16,17,20,139,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,140,34,7,9,12,14,103,126,141,142,135,83,84,4,40,6,146,100,37,70,111,186,147,127,98,187,188,189,190,94,95,128,102,38,177,170,87,277,291,76,58,59,60,61,62,43,63,64,65,66,67,68,69,50,71,72,73,157,101,52,54,164,162,78,174,85,86,175,270,197,198,199,200,201,122,110,82,88,89,77,90,91,92,93,96,202,203,144,145,41,204,205,154,206,207,115,116,208,156,13,209,163,210,119,176,211,212,213,214,183,215,216,56,57,107,173,217,218,219,220,221,222,223,39,224,225,226,227,228,229,230,231,232,233,234,235,236,237,36,238,292,246,296,331,312,313,257,152,151,153,171]))),s6=ke(()=>ye(()=>import("./Goals-0Q2Gnko1.js").then(e=>e.Goals),__vite__mapDeps([350,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,13,128,351,41]))),gw=ke(()=>ye(()=>import("./Artifacts-DAtpWAuL.js").then(e=>e.Artifacts),__vite__mapDeps([352,1,3,16,17,20,265,18,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,4,6,34,35,12,36,37,38,115,83,84,41,203,7,9,54,126,98,128,322]))),i6=ke(()=>ye(()=>import("./GoalDetail-B2jZMNHQ.js").then(e=>e.GoalDetail),__vite__mapDeps([353,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,135,83,84,9,7,13,70,127,128,221,290,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,58,62,4,43,63,64,6,34,65,66,67,68,69,50,38,71,72,73,178,179,40,175,170,263,351,41]))),xw=ke(()=>ye(()=>import("./Approvals-CLeSmmEV.js").then(e=>e.Approvals),__vite__mapDeps([354,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,135,83,84,9,57,126,70,128,320,63,64,7,150,91,60,92,93,177,301,58,59,61,62,4,43,6,34,65,66,67,68,69,50,38,71,72,73,163]))),r6=ke(()=>ye(()=>import("./ApprovalDetail-DVVR3EtT.js").then(e=>e.ApprovalDetail),__vite__mapDeps([355,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,41,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,92,93,128,150,91,102,301,163,57]))),l6=ke(()=>ye(()=>import("./CompanyActivity-D1j2INEB.js").then(e=>e.CompanyActivity),__vite__mapDeps([356,1,3,357,16,17,20,265,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,135,83,84,9,140,358,145,76,40,41,341,7,10,69,13,14,302,163,288,100,98,177,188,126,60,92,93,91,37,70,111,101,52,54,148,218,329,94,95,128,150,174,85,86,4,175,120,192,167,168,169,359,360,293,347,361]))),od=ke(()=>ye(()=>import("./AuditHub-C6U9wM2v.js").then(e=>e.AuditHub),__vite__mapDeps([357,1,3,16,17,20,265,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,135,83,84,9,140,358,145,76,40,41,341,7,10,69,13,14,302,163,288,100,98,177,188,126,60,92,93,91,37,70,111,101,52,54,148,218,329,94,95,128,150,174,85,86,4,175,120,192,167,168,169,359,360,293,347,361]))),o6=ke(()=>ye(()=>import("./WhatNeedsMe-s8nEWFq9.js").then(e=>e.WhatNeedsMe),__vite__mapDeps([362,1,3,16,17,20,22,363,265,195,59,60,61,249,250,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,122,4,115,83,84,41,144,123,89,40,175,63,64,58,62,43,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,172,241,197,198,199,142,201,52,110,82,85,86,87,88,77,90,54,91,92,93,94,95,96,202,101,203,145,76,204,205,154,206,162,207,208,156,13,14,209,163,210,119,126,37,176,211,212,213,98,214,102,183,215,216,56,12,157,57,107,173,100,217,188,218,219,220,128,221,222,223,39,224,164,78,225,226,174,227,228,229,230,231,232,233,234,235,236,237,36,238,46,81,53,97,35,99,242,118,104,149,243,120,112,244,245,309,364,148,167,168,169,342,111,186,147]))),c6=ke(()=>ye(()=>import("./DecisionQueuePage-BZrUoCk3.js").then(e=>e.DecisionQueuePage),__vite__mapDeps([365,1,3,16,17,20,22,363,265,195,59,60,61,249,250,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,122,4,115,83,84,41,144,123,89,40,175,63,64,58,62,43,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,116,172,241,197,198,199,142,201,52,110,82,85,86,87,88,77,90,54,91,92,93,94,95,96,202,101,203,145,76,204,205,154,206,162,207,208,156,13,14,209,163,210,119,126,37,176,211,212,213,98,214,102,183,215,216,56,12,157,57,107,173,100,217,188,218,219,220,128,221,222,223,39,224,164,78,225,226,174,227,228,229,230,231,232,233,234,235,236,237,36,238,46,81,53,97,35,99,242,118,104,149,243,120,112,244,245,309,364,148,167,168,169,342]))),u6=ke(()=>ye(()=>import("./BoardChat-BTFAl90K.js").then(e=>e.BoardChat),__vite__mapDeps([366,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,115,83,84,4,41,140,39,40,162,367,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,46,172,279,97,35,368,315,100,90,185,119,88,86,91,92,93,186,147,95,128,177,114,116,117,118,54,101,52,102,36,37,134]))),d6=ke(()=>ye(()=>import("./CompanySettings-8ROAg5aG.js").then(e=>e.CompanySettings),__vite__mapDeps([369,1,3,16,17,20,22,21,201,25,8,52,26,27,7,9,126,37,142,98,261,128,221,222,174,85,86,83,4,40,175,229,41,43,119,88,101,54,230,76,30,244,370,197,198,199,19,23,24,28,29,5,31,32,33,200,122,110,82,59,60,61,84,87,89,77,90,91,92,93,94,95,96,202,203,144,145,204,205,154,206,162,64,6,207,115,116,208,156,68,13,14,209,163,210,176,211,34,212,213,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,223,39,224,164,78,225,226,227,228,231,232,71,233,234,235,236,237,36,238,359]))),f6=ke(()=>ye(()=>import("./CompanyConnections-CZOQquHF.js").then(e=>e.CompanyConnections),__vite__mapDeps([371,1,3,20,197,16,17,22,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,370,359,360]))),xh=ke(()=>ye(()=>import("./CompanyEnvironments-DDbrQrMB.js").then(e=>e.CompanyEnvironments),__vite__mapDeps([372,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,201,52,7,9,203,4,207,115,83,84,41,40,204,54,205,101,154,206,162,116,208,156,68,13,14,209,163,210,119,88,86,126,37,176,211,216,12,157,173,70,142,128,214,227,122,110,98,102,174,85,175,229,43,222,230,76,231,233,310]))),m6=ke(()=>ye(()=>import("./BootstrapSetupUxLab-DbE6ARGg.js").then(e=>e.BootstrapSetupUxLab),__vite__mapDeps([373,1,3,7,8,9,57,33,100,177]))),p6=ke(()=>ye(()=>import("./ResponsibleUserDenialUxLab-CFDLXQbq.js").then(e=>e.ResponsibleUserDenialUxLab),__vite__mapDeps([374,1,3,177,272,239,108,273]))),h6=ke(()=>ye(()=>import("./CrossIssueCollaborationUxLab-BNEDnULO.js").then(e=>e.CrossIssueCollaborationUxLab),__vite__mapDeps([375,1,3,306,239,144,64,208,57,108,167,168,169,93,25,8,26,92,177,251,119,88,86,126,9]))),g6=ke(()=>ye(()=>import("./CompanySettingsPluginPage-B-79nVuk.js").then(e=>e.CompanySettingsPluginPage),__vite__mapDeps([376,1,3,16,17,21,20,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,187,188,37,189,190,128]))),x6=ke(()=>ye(()=>import("./CompanyAccess-Dmq_cs8a.js").then(e=>e.CompanyAccess),__vite__mapDeps([377,1,3,16,17,20,265,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,135,83,84,9,4,6,7,57,173,126,37,70,101,52,54,148,187,188,189,190,260,261,128,38]))),b6=ke(()=>ye(()=>import("./CompanyAccess-Dmq_cs8a.js").then(e=>e.CompanyAccessLegacyRoute),__vite__mapDeps([377,1,3,16,17,20,265,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,93,135,83,84,9,4,6,7,57,173,126,37,70,101,52,54,148,187,188,189,190,260,261,128,38]))),bw=ke(()=>ye(()=>import("./AdvancedToolsRoute-dQcLG_fZ.js").then(e=>e.AdvancedToolsRoute),__vite__mapDeps([378,1,3,16,17,20,197,22,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,143,367,287,10,379,104,127,148,177,120,134,283,254,380,381,195]))),vw=ke(()=>ye(()=>import("./ProfileWizardRoute-DQ8Wf6CN.js").then(e=>e.ProfileWizardRoute),__vite__mapDeps([382,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,122,4,110,40,41,7,9,242,13,54,126,37,98,219,128,102,225,91,60,92,93,218,174,85,86,83,175,176,283,100,177,381,195,70,127,94,95,383,163,148]))),v6=ke(()=>ye(()=>import("./ProfileDetailRoute-CY9Zo_L-.js").then(e=>e.ProfileDetailRoute),__vite__mapDeps([384,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,110,143,6,7,9,257,57,173,169,126,37,101,52,54,98,219,128,102,283,100,177,380,381,195,70,127,94,95,383,163,148]))),y6=ke(()=>ye(()=>import("./Browse-0mLkYDuT.js").then(e=>e.Browse),__vite__mapDeps([385,1,3,20,195,22,386,16,17,198,199,142,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,201,52,7,9,122,4,41,157,100,210,92,93,111,101,54,98,218,219,50,164,162,78,226,361,387,115,83,84,110,308,116,34,216,213,173,119,88,86,91,60,37,70,148,269,220,128,238,112,388,389,135,6,242,185,38,232,102,71]))),zC=ke(()=>ye(()=>import("./AppsConnect-C35NNIiG.js").then(e=>e.AppsConnect),__vite__mapDeps([390,1,3,16,17,20,197,22,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,387,391]))),j6=ke(()=>ye(()=>import("./ChatEndpointSetup-XspGek-A.js").then(e=>e.ChatEndpointSetup),__vite__mapDeps([392,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,110,43,6,34,208,156,7,9,100,217,188,119,88,86,91,60,92,93,37,70,142,127,101,52,54,98,261,269,128,102,225,41,218,38,237,36,393,203,144,219,177,112,245,277,281,163,229,40,222,230,76,394]))),yw=ke(()=>ye(()=>import("./ChatEndpointDetail-Co2K-j6p.js").then(e=>e.ChatEndpointDetail),__vite__mapDeps([395,1,3,16,17,20,265,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,201,52,7,9,122,4,115,83,84,41,110,82,59,60,61,85,86,87,88,89,77,90,54,91,92,93,94,95,96,140,358,145,40,43,58,62,63,64,6,34,65,66,67,68,69,70,50,38,71,72,73,116,11,12,13,157,173,100,119,126,37,101,98,148,269,219,220,128,102,222,236,235,112,277,396,225,218,226,393,203,144,127,177,245,281,163,229,230,76,394]))),w6=ke(()=>ye(()=>import("./ChatIdentityConfirm-m3fNvAJx.js").then(e=>e.ChatIdentityConfirm),__vite__mapDeps([397,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,261,269]))),k6=ke(()=>ye(()=>import("./AppsReview-lab3deOa.js").then(e=>e.AppsReview),__vite__mapDeps([398,1,3,21,20,22,128,399,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,4,58,59,60,61,62,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,241,197,198,199,142,200,201,52,122,110,82,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,207,115,116,208,156,13,14,209,163,210,119,126,37,176,211,212,213,98,214,102,183,215,216,56,12,157,57,107,173,100,217,188,218,219,220,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,233,234,235,236,237,36,238,46,81,53,97,35,99,242,118,104,149,243,120,112,244,245]))),S6=ke(()=>ye(()=>import("./AppDetail-Bw4J28Ak.js").then(e=>e.AppDetail),__vite__mapDeps([400,1,3,16,17,20,22,197,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,386,111,50,361,387,257,148,316,388,391,396,393,127,177,112,245,277,281,399,58,62,63,65,67,69,72,73,241,46,81,53,97,35,99,242,118,104,149,243,120,244]))),jw=ke(()=>ye(()=>import("./AppNotConnected-CBliUH8m.js").then(e=>e.AppNotConnected),__vite__mapDeps([401,1,3,16,17,20,197,22,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,400,386,111,50,361,387,257,148,316,388,391,396,393,127,177,112,245,277,281,399,58,62,63,65,67,69,72,73,241,46,81,53,97,35,99,242,118,104,149,243,120,244]))),ww=ke(()=>ye(()=>import("./GatewaysList-C3fEQHRs.js").then(e=>e.GatewaysList),__vite__mapDeps([402,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,70,127,98,218,219,128,222,283,100,126,177,403,140,6,68,101,52,54,38]))),N6=ke(()=>ye(()=>import("./GatewayDetail-Cf6WshG5.js").then(e=>e.GatewayDetail),__vite__mapDeps([404,1,3,16,17,20,265,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,76,268,4,40,53,41,175,204,7,9,54,205,52,101,154,206,43,318,6,68,287,257,13,368,119,88,86,37,70,127,98,218,219,128,222,38,283,100,126,177,403,140]))),C6=ke(()=>ye(()=>import("./CompanySkills-BfBhMNaP.js").then(e=>e.CompanySkills),__vite__mapDeps([405,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,115,83,84,41,135,9,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,93,94,95,96,203,40,53,162,43,58,62,63,64,6,34,65,66,67,68,7,69,70,50,38,71,72,73,318,116,156,46,183,313,216,79,11,257,13,157,209,315,163,57,173,100,104,185,119,126,37,127,101,98,128,150,102,164,78,225,218,236,235,36,276,277,180,406,330,201,134,407]))),kw=ke(()=>ye(()=>import("./SkillSources-B7fG3KBv.js").then(e=>e.SkillSources),__vite__mapDeps([408,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,115,83,84,4,41,162,136,34,46,7,9,13,157,100,101,52,54,98,50,128,205,238,55,407,409,78,126,391]))),bh=ke(()=>ye(()=>import("./SkillStudio-BEAfNXcI.js").then(e=>e.SkillStudio),__vite__mapDeps([410,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,93,115,83,84,4,41,110,135,9,82,59,60,61,52,85,86,87,88,89,77,90,54,91,92,94,95,96,203,40,204,7,205,101,154,206,411,76,156,212,122,6,68,213,163,119,126,37,98,214,102,38,339,64,58,62,43,63,34,65,66,67,69,70,50,71,72,73,116,46,183,334,78,48,241,197,198,199,142,201,202,144,145,162,207,208,13,14,209,210,176,211,215,216,56,12,157,57,107,173,100,217,188,218,219,220,128,221,222,223,39,224,164,225,226,174,175,227,228,229,230,231,232,233,234,235,236,237,36,238,81,53,97,35,99,242,118,104,149,243,120,112,244,245,257,150,151,177,51,55,179,134,276,263,180,131,406,407,405,318,313,79,11,315,185,127,277,330,412,413]))),A6=ke(()=>ye(()=>import("./Secrets-Bu6q9QVj.js").then(e=>e.Secrets),__vite__mapDeps([414,1,3,16,17,20,21,22,122,25,8,4,115,83,26,27,84,41,5,135,9,23,24,143,62,144,53,162,63,311,6,116,34,212,110,68,7,213,163,119,88,86,126,91,60,92,93,37,101,52,54,98,214,102,38,66,125,215,78,216,344,257,13,157,31,57,173,100,210,104,70,148,260,261,218,128,225,174,85,40,175,211,36,134]))),_6=ke(()=>ye(()=>import("./CompanyImport-DbbCQEFp.js").then(e=>e.CompanyImport),__vite__mapDeps([415,1,3,20,22,197,16,17,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,58,62,63,65,67,69,50,72,73,416,417,418]))),E6=ke(()=>ye(()=>import("./DesignGuide-B38yltct.js").then(e=>e.DesignGuide),__vite__mapDeps([419,1,3,16,17,20,197,22,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,267,135,240,35,11,153,151,58,62,63,65,67,69,50,72,73,75,42,44,45,18,46,47,48,49,51,53,55,79,80,81,97,99,103,104,105,184,106,420,241,242,118,149,243,120,112,244,245,421,364,185,257,315,177,109,111,317,318,146,300,158,290,178,179,166,170,134,278,279,282,283,263,131,406,193,194,195,186,147,150,196,239,117,155,246,247,160,161,165,248,249,250,251,168,252,253,409,346,412,413]))),I6=ke(()=>ye(()=>import("./InstanceFeatures-CPYwZmZk.js").then(e=>e.InstanceFeatures),__vite__mapDeps([422,1,3,19,16,17,20,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,126,9,98,190,128,423,142,260,261,222]))),T6=ke(()=>ye(()=>import("./AgentDefaults-xGoI264I.js").then(e=>e.AgentDefaults),__vite__mapDeps([424,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,144,70,128,274,275,7,9,14,54,126,174,85,86,83,4,40,175,120]))),R6=ke(()=>ye(()=>import("./OmpAllSettings-fSc31cIu.js").then(e=>e.n).then(e=>e.OmpAllSettingsPage),__vite__mapDeps([284,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,203,7,9,14,126,70,98,128,102,222,174,85,86,83,4,40,175,176,274,275,54,120]))),D6=ke(()=>ye(()=>import("./ModelsAndProviders-B0gYOLvd.js").then(e=>e.ModelsAndProviders),__vite__mapDeps([425,1,3,20,21,22,7,8,9,13,157,70,128,426,34,98,174,85,25,86,83,26,27,4,40,175,274]))),M6=ke(()=>ye(()=>import("./InstanceAdvanced-C8uDSsPL.js").then(e=>e.InstanceAdvanced),__vite__mapDeps([427,1,3,7,8,9,12,14,100,126,128,423,20,142,260,261,222]))),O6=ke(()=>ye(()=>import("./InstanceAccess-DyQFxK_O.js").then(e=>e.InstanceAccess),__vite__mapDeps([428,1,3,20,22,122,25,8,4,7,9,57,32,37,148,128,177]))),L6=ke(()=>ye(()=>import("./ProfileSettings-Bfeh1MlI.js").then(e=>e.ProfileSettings),__vite__mapDeps([429,1,3,20,22,21,93,25,8,26,110,215,7,9,12,209,368,173,70,98,128,221,222,225,122,4,23,24,27,41,91,60,92,218,226,174,85,86,83,40,175,177]))),z6=ke(()=>ye(()=>import("./PluginManager-BLY48Rdb.js").then(e=>e.PluginManager),__vite__mapDeps([430,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,110,183,7,9,13,379,315,173,100,126,37,101,52,54,98,189,128,177]))),P6=ke(()=>ye(()=>import("./PluginSettings-DugaPtGC.js").then(e=>e.PluginSettings),__vite__mapDeps([431,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,135,83,84,9,202,101,52,7,54,203,89,63,64,66,209,163,100,345,126,189,187,188,37,190,128,227,122,4,110,40,41,162,208,156,68,13,173,98,214,102,174,85,86,175,177,170,87,141,142]))),Sw=ke(()=>ye(()=>import("./AdapterManager-8ofINbXH.js").then(e=>e.AdapterManager),__vite__mapDeps([432,1,3,20,21,22,110,25,8,202,33,101,52,26,27,7,9,54,30,66,13,379,157,173,100,126,37,98,128,228,23,24,40,223,39,224,4,31,176,229,41,43,119,88,86,222,230,76,234,235,177]))),Nw=ke(()=>ye(()=>import("./PluginPage-CIvrzBLJ.js").then(e=>e.PluginPage),__vite__mapDeps([433,1,3,16,17,20,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,203,7,9,189,187,188,37,190,128]))),U6=ke(()=>ye(()=>import("./NewAgent-E1cSVMu1.js").then(e=>e.NewAgent),__vite__mapDeps([434,1,3,16,17,20,197,22,198,199,142,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,200,201,52,7,9,122,4,110,82,59,60,61,83,84,85,86,87,88,89,77,90,54,91,92,93,94,95,96,202,101,203,144,145,76,40,41,204,205,154,206,162,43,64,6,207,115,116,208,156,68,13,14,209,163,210,119,126,37,176,211,34,212,213,98,214,102,38,183,66,215,216,56,12,157,57,107,173,100,217,188,70,218,219,220,128,221,222,223,39,224,164,78,225,226,174,175,227,228,229,230,231,232,71,233,234,235,236,237,36,238,426]))),$6=ke(()=>ye(()=>import("./Auth-BdXfGiLC.js").then(e=>e.AuthPage),__vite__mapDeps([435,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,421,364,185,72,261,436]))),B6=ke(()=>ye(()=>import("./BoardClaim-Cv56WNDU.js").then(e=>e.BoardClaimPage),__vite__mapDeps([437,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,148,177]))),K6=ke(()=>ye(()=>import("./AssistantConnection-gcHktiyu.js").then(e=>e.AssistantConnection),__vite__mapDeps([389,1,3,20,21,22,19,16,17,23,24,25,8,26,27,28,29,5,30,31,32,33,135,83,84,9,4,6,34,7,242,185,92,93,128,38,232,54,102,71,388]))),Cw=ke(()=>ye(()=>import("./McpConnect-BJhgeezW.js").then(e=>e.McpConnectPage),__vite__mapDeps([438,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,7,9,185,92,93,98,177,388]))),q6=ke(()=>ye(()=>import("./McpConnect-BJhgeezW.js").then(e=>e.McpDevicePage),__vite__mapDeps([438,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,7,9,185,92,93,98,177,388]))),F6=ke(()=>ye(()=>import("./McpConnect-BJhgeezW.js").then(e=>e.AssistantConnectionsPage),__vite__mapDeps([438,1,3,16,17,20,19,21,22,23,24,25,8,26,27,28,29,5,30,31,32,33,122,4,7,9,185,92,93,98,177,388]))),H6=ke(()=>ye(()=>import("./CliAuth-CTkJ-3kI.js").then(e=>e.CliAuthPage),__vite__mapDeps([439,1,3,16,17,20,22,19,21,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,148,177]))),V6=ke(()=>ye(()=>import("./InviteLanding-o-enK_RP.js").then(e=>e.InviteLandingPage),__vite__mapDeps([440,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,7,9,148,261,230,76,436]))),Aw=ke(()=>ye(()=>import("./PublicIssueSharePage-D7UqYVp1.js").then(e=>e.PublicIssueSharePage),__vite__mapDeps([441,1,3,16,17,20,203,58,59,60,61,21,22,19,23,24,25,8,26,27,28,29,5,30,31,32,33,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,74,46,47,92,93,218,321]))),Q6=ke(()=>ye(()=>import("./JoinRequestQueue-D2RLtri2.js").then(e=>e.JoinRequestQueue),__vite__mapDeps([442,1,3,20,21,22,7,8,9,126,37,148,128,177]))),PC=ke(()=>ye(()=>Promise.resolve().then(()=>$$).then(e=>e.NotFoundPage),void 0)),Yo=ke(()=>ye(()=>import("./Inbox-Bk8khlSh.js").then(e=>e.n).then(e=>e.Inbox),__vite__mapDeps([299,1,3,16,17,20,22,138,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,135,83,84,9,62,123,4,41,63,64,215,7,11,13,14,100,90,54,188,92,93,37,70,111,142,186,147,127,101,52,148,300,149,128,150,91,60,177,73,301,58,59,61,43,6,34,65,66,67,68,69,50,38,71,72,163,57,170,87]))),W6=ke(()=>ye(()=>import("./CompanyExport-B0eLuNvu.js").then(e=>e.CompanyExport),__vite__mapDeps([443,1,3,16,17,20,22,21,19,23,24,25,8,26,27,28,29,5,30,31,32,33,58,59,60,61,62,4,43,63,64,6,34,65,66,67,68,7,9,69,70,50,38,71,72,73,14,54,37,127,128,55,418]))),G6=ke(()=>ye(()=>import("./Terminal-_XGdPaFV.js").then(e=>e.Terminal),__vite__mapDeps([444,1,3,20,307,25,8,115,83,26,27,84,4,41,5,39,224,308,6,7,9,309,31,54,98,38,36,37,310,21,22,19,16,17,23,24,28,29,30,32,33,110,13,49,173,101,52,148,128,231,412])));function Y6({children:e}){return(0,a.jsx)(b.Suspense,{fallback:(0,a.jsx)(Es,{}),children:e})}r(Y6,"ProductionSurface");function X6(e){const t=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M,{index:!0,element:(0,a.jsx)(Ge,{to:"dashboard",replace:!0})}),(0,a.jsx)(M,{path:"dashboard",element:(0,a.jsx)(zB,{})}),(0,a.jsx)(M,{path:"dashboard/live",element:(0,a.jsx)(PB,{})}),(0,a.jsx)(M,{path:"timeline",element:(0,a.jsx)(Ks,{to:"/activity/timeline"})}),(0,a.jsx)(M,{path:"onboarding",element:(0,a.jsx)(BC,{})}),(0,a.jsx)(M,{path:"companies",element:(0,a.jsx)(UB,{})}),(0,a.jsx)(M,{path:"company/settings",element:(0,a.jsx)(d6,{})}),(0,a.jsx)(M,{path:"company/settings/connections",element:(0,a.jsx)(f6,{})}),(0,a.jsx)(M,{path:"company/settings/agent-defaults",element:(0,a.jsx)(T6,{})}),(0,a.jsx)(M,{path:"company/settings/agent-defaults/all",element:(0,a.jsx)(R6,{})}),(0,a.jsx)(M,{path:"company/settings/models",element:(0,a.jsx)(D6,{})}),(0,a.jsx)(M,{path:"company/settings/environments",element:(0,a.jsx)(Ge,{to:"/company/settings/instance/environments",replace:!0})}),(0,a.jsx)(M,{path:"company/settings/cloud-upstream",element:(0,a.jsx)(Ge,{to:"/company/export",replace:!0})}),(0,a.jsxs)(M,{element:(0,a.jsx)(Ss,{pageKey:"company.members"}),children:[(0,a.jsx)(M,{path:"company/settings/members",element:(0,a.jsx)(x6,{})}),(0,a.jsx)(M,{path:"company/settings/access",element:(0,a.jsx)(b6,{})})]}),(0,a.jsx)(M,{element:(0,a.jsx)(Ss,{pageKey:"company.invites"}),children:(0,a.jsx)(M,{path:"company/settings/invites",element:(0,a.jsx)(Ge,{to:"/company/settings/members?tab=invites",replace:!0})})}),(0,a.jsx)(M,{element:(0,a.jsx)(Ss,{pageKey:"company.export"}),children:(0,a.jsx)(M,{path:"company/export/*",element:(0,a.jsx)(b.Suspense,{fallback:(0,a.jsx)(Es,{}),children:(0,a.jsx)(W6,{})})})}),(0,a.jsx)(M,{element:(0,a.jsx)(Ss,{pageKey:"company.import"}),children:(0,a.jsx)(M,{path:"company/import",element:(0,a.jsx)(_6,{})})}),(0,a.jsx)(M,{element:(0,a.jsx)(Ss,{pageKey:"company.secrets"}),children:(0,a.jsx)(M,{path:"company/settings/secrets",element:(0,a.jsx)(A6,{})})}),(0,a.jsx)(M,{path:"company/settings/tools",element:(0,a.jsx)(Iw,{})}),(0,a.jsx)(M,{path:"company/settings/tools/:tab",element:(0,a.jsx)(Iw,{})}),(0,a.jsx)(M,{path:"tools",element:(0,a.jsx)(Tw,{})}),(0,a.jsx)(M,{path:"tools/:tab",element:(0,a.jsx)(Tw,{})}),(0,a.jsx)(M,{path:"apps",element:(0,a.jsx)(y6,{})}),(0,a.jsx)(M,{path:"apps/assistant-connection",element:(0,a.jsx)(K6,{})}),(0,a.jsx)(M,{path:"apps/browse",element:(0,a.jsx)(Ge,{to:"/apps",replace:!0})}),(0,a.jsx)(M,{path:"apps/connections",element:(0,a.jsx)(Ge,{to:"/apps",replace:!0})}),(0,a.jsx)(M,{path:"apps/byo",element:(0,a.jsx)(zC,{byoOnly:!0})}),(0,a.jsx)(M,{path:"apps/vercel-connect",element:(0,a.jsx)(_w,{credentialSource:"vercel_connect"})}),(0,a.jsx)(M,{path:"apps/connect",element:(0,a.jsx)(_w,{})}),(0,a.jsx)(M,{path:"apps/chat/connect",element:(0,a.jsx)(ld,{children:(0,a.jsx)(j6,{})})}),(0,a.jsx)(M,{path:"apps/chat/:endpointId",element:(0,a.jsx)(ld,{children:(0,a.jsx)(Ge,{to:"settings",replace:!0})})}),(0,a.jsx)(M,{path:"apps/chat/:endpointId/reviews/:reviewId",element:(0,a.jsx)(ld,{children:(0,a.jsx)(yw,{})})}),(0,a.jsx)(M,{path:"apps/chat/:endpointId/:tab",element:(0,a.jsx)(ld,{children:(0,a.jsx)(yw,{})})}),(0,a.jsx)(M,{path:"apps/connect/:appKey",element:(0,a.jsx)(Ge,{to:"/apps",replace:!0})}),(0,a.jsx)(M,{path:"apps/connect/:appKey/:stage",element:(0,a.jsx)(Ge,{to:"/apps",replace:!0})}),(0,a.jsx)(M,{path:"apps/review",element:(0,a.jsx)(k6,{})}),(0,a.jsx)(M,{path:"apps/attention",element:(0,a.jsx)(Ge,{to:"/apps",replace:!0})}),(0,a.jsx)(M,{path:"apps/gateways",element:(0,a.jsx)(ww,{})}),(0,a.jsx)(M,{path:"apps/gateways/:gatewayId",element:(0,a.jsx)(Ge,{to:"overview",replace:!0})}),(0,a.jsx)(M,{path:"apps/gateways/:gatewayId/:tab",element:(0,a.jsx)(N6,{})}),(0,a.jsx)(M,{path:"apps/advanced",element:(0,a.jsx)(bw,{})}),(0,a.jsx)(M,{path:"apps/advanced/gateways",element:(0,a.jsx)(ww,{})}),(0,a.jsx)(M,{path:"apps/advanced/profiles/new",element:(0,a.jsx)(vw,{mode:"new"})}),(0,a.jsx)(M,{path:"apps/advanced/profiles/:profileId/edit",element:(0,a.jsx)(vw,{mode:"edit"})}),(0,a.jsx)(M,{path:"apps/advanced/profiles/:profileId",element:(0,a.jsx)(v6,{})}),(0,a.jsx)(M,{path:"apps/advanced/audit",element:(0,a.jsx)(Ge,{to:"/apps",replace:!0})}),(0,a.jsx)(M,{path:"apps/advanced/run-your-own",element:(0,a.jsx)(Ge,{to:"/apps",replace:!0})}),(0,a.jsx)(M,{path:"apps/advanced/:tab",element:(0,a.jsx)(bw,{})}),(0,a.jsx)(M,{path:"apps/app/:applicationId",element:(0,a.jsx)(jw,{})}),(0,a.jsx)(M,{path:"apps/app/:applicationId/:tab",element:(0,a.jsx)(jw,{})}),(0,a.jsx)(M,{path:"apps/:connectionId",element:(0,a.jsx)(Ge,{to:"permissions",replace:!0})}),(0,a.jsx)(M,{path:"apps/:connectionId/:tab",element:(0,a.jsx)(S6,{})}),(0,a.jsx)(M,{path:"company/settings/instance",element:(0,a.jsx)(Ge,{to:"/company/settings",replace:!0})}),(0,a.jsx)(M,{element:(0,a.jsx)(Ss,{pageKey:"instance.profile"}),children:(0,a.jsx)(M,{path:"company/settings/instance/profile",element:(0,a.jsx)(L6,{})})}),(0,a.jsx)(M,{path:"company/settings/instance/general",element:(0,a.jsx)(Ge,{to:"/company/settings",replace:!0})}),(0,a.jsx)(M,{path:"company/settings/instance/heartbeats",element:(0,a.jsx)(Ge,{to:"/company/settings",replace:!0})}),(0,a.jsxs)(M,{element:(0,a.jsx)(Ss,{pageKey:"instance.environments"}),children:[(0,a.jsx)(M,{path:"company/settings/instance/environments",element:(0,a.jsx)(xh,{})}),(0,a.jsx)(M,{path:"company/settings/instance/environments/new",element:(0,a.jsx)(xh,{mode:"create"})}),(0,a.jsx)(M,{path:"company/settings/instance/environments/:environmentId/edit",element:(0,a.jsx)(xh,{mode:"edit"})})]}),(0,a.jsx)(M,{element:(0,a.jsx)(Ss,{pageKey:"instance.access"}),children:(0,a.jsx)(M,{path:"company/settings/instance/access",element:(0,a.jsx)(O6,{})})}),(0,a.jsxs)(M,{element:(0,a.jsx)(Ss,{pageKey:"instance.experimental"}),children:[(0,a.jsx)(M,{path:"company/settings/instance/features",element:(0,a.jsx)(I6,{})}),(0,a.jsx)(M,{path:"company/settings/instance/advanced",element:(0,a.jsx)(M6,{})}),(0,a.jsx)(M,{path:"company/settings/instance/experimental",element:(0,a.jsx)(Ge,{to:"/company/settings/instance/features",replace:!0})})]}),(0,a.jsxs)(M,{element:(0,a.jsx)(Ss,{pageKey:"instance.plugins"}),children:[(0,a.jsx)(M,{path:"company/settings/instance/plugins",element:(0,a.jsx)(z6,{})}),(0,a.jsx)(M,{path:"company/settings/instance/plugins/:pluginId",element:(0,a.jsx)(P6,{})})]}),(0,a.jsx)(M,{element:(0,a.jsx)(Ss,{pageKey:"instance.adapters"}),children:(0,a.jsx)(M,{path:"company/settings/instance/adapters",element:(0,a.jsx)(Sw,{})})}),(0,a.jsx)(M,{path:"company/settings/:settingsRoutePath/*",element:(0,a.jsx)(g6,{})}),(0,a.jsx)(M,{path:"skills/sources",element:(0,a.jsx)(kw,{})}),(0,a.jsx)(M,{path:"skills/sources/:sourceId",element:(0,a.jsx)(kw,{})}),(0,a.jsx)(M,{path:"skills/studio",element:(0,a.jsx)(bh,{})}),(0,a.jsx)(M,{path:"skills/studio/new",element:(0,a.jsx)(bh,{})}),(0,a.jsx)(M,{path:"skills/studio/:skillId",element:(0,a.jsx)(bh,{})}),(0,a.jsx)(M,{path:"skills/:skillId/studio",element:(0,a.jsx)(UC,{})}),(0,a.jsx)(M,{path:"skills/*",element:(0,a.jsx)(C6,{})}),(0,a.jsx)(M,{path:"settings",element:(0,a.jsx)(Or,{})}),(0,a.jsx)(M,{path:"settings/*",element:(0,a.jsx)(Or,{})}),(0,a.jsx)(M,{path:"plugins/:pluginId",element:(0,a.jsx)(Nw,{})}),(0,a.jsx)(M,{path:"org",element:(0,a.jsx)(Ge,{to:"/agents/all",replace:!0})}),(0,a.jsx)(M,{path:"agents",element:(0,a.jsx)(Ge,{to:"/agents/all",replace:!0})}),LC.map(i=>(0,a.jsx)(M,{path:`agents/${i}`,element:(0,a.jsx)($B,{})},i)),(0,a.jsx)(M,{path:"agents/new",element:(0,a.jsx)(U6,{})}),(0,a.jsx)(M,{path:"agents/:agentId",element:(0,a.jsx)(hh,{})}),(0,a.jsx)(M,{path:"agents/:agentId/:tab",element:(0,a.jsx)(hh,{})}),(0,a.jsx)(M,{path:"agents/:agentId/runs/:runId",element:(0,a.jsx)(hh,{})}),(0,a.jsx)(M,{path:"projects",element:(0,a.jsx)(BB,{})}),(0,a.jsx)(M,{path:"projects/:projectId",element:(0,a.jsx)(Dr,{})}),(0,a.jsx)(M,{path:"projects/:projectId/overview",element:(0,a.jsx)(Dr,{})}),(0,a.jsx)(M,{path:"projects/:projectId/issues",element:(0,a.jsx)(Dr,{})}),(0,a.jsx)(M,{path:"projects/:projectId/issues/:filter",element:(0,a.jsx)(Dr,{})}),(0,a.jsx)(M,{element:(0,a.jsx)(uh,{}),children:(0,a.jsx)(M,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,a.jsx)(KB,{})})}),(0,a.jsx)(M,{path:"projects/:projectId/workspaces",element:(0,a.jsx)(Dr,{})}),(0,a.jsx)(M,{path:"projects/:projectId/configuration",element:(0,a.jsx)(Dr,{})}),(0,a.jsx)(M,{path:"projects/:projectId/budget",element:(0,a.jsx)(Dr,{})}),(0,a.jsx)(M,{element:(0,a.jsx)(uh,{}),children:(0,a.jsx)(M,{path:"workspaces",element:(0,a.jsx)(qB,{})})}),(0,a.jsx)(M,{path:"terminal",element:(0,a.jsx)(Y6,{children:(0,a.jsx)(G6,{})})}),(0,a.jsx)(M,{path:"issues",element:(0,a.jsx)(FB,{})}),(0,a.jsx)(M,{path:"tasks",element:(0,a.jsx)(Ge,{to:"/issues",replace:!0})}),(0,a.jsx)(M,{path:"tasks/new",element:(0,a.jsx)(AB,{})}),(0,a.jsx)(M,{path:"search",element:(0,a.jsx)(HB,{})}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M,{path:"issues/all",element:(0,a.jsx)(ms,{view:"all"})}),(0,a.jsx)(M,{path:"issues/active",element:(0,a.jsx)(ms,{view:"active"})}),(0,a.jsx)(M,{path:"issues/backlog",element:(0,a.jsx)(ms,{view:"backlog"})}),(0,a.jsx)(M,{path:"issues/done",element:(0,a.jsx)(ms,{view:"done"})}),(0,a.jsx)(M,{path:"issues/recent",element:(0,a.jsx)(ms,{view:"recent"})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M,{path:"issues/all",element:(0,a.jsx)(Ge,{to:"/issues",replace:!0})}),(0,a.jsx)(M,{path:"issues/active",element:(0,a.jsx)(Ge,{to:"/issues",replace:!0})}),(0,a.jsx)(M,{path:"issues/backlog",element:(0,a.jsx)(Ge,{to:"/issues",replace:!0})}),(0,a.jsx)(M,{path:"issues/done",element:(0,a.jsx)(Ge,{to:"/issues",replace:!0})}),(0,a.jsx)(M,{path:"issues/recent",element:(0,a.jsx)(Ge,{to:"/issues",replace:!0})})]}),(0,a.jsx)(M,{path:"chats",element:(0,a.jsx)(QB,{})}),(0,a.jsx)(M,{path:"chats/:agentRef",element:(0,a.jsx)(WB,{})}),(0,a.jsx)(M,{path:"issues/:issueId",element:(0,a.jsx)(VB,{})}),null,(0,a.jsx)(M,{path:"routines",element:(0,a.jsx)(YB,{})}),(0,a.jsx)(M,{path:"cases",element:(0,a.jsx)(uw,{children:(0,a.jsx)(OB,{})})}),(0,a.jsx)(M,{path:"cases/:caseIdentifier",element:(0,a.jsx)(uw,{children:(0,a.jsx)(LB,{})})}),(0,a.jsx)(M,{path:"pixels-office",element:(0,a.jsx)(Q$,{children:(0,a.jsx)(n6,{})})}),(0,a.jsx)(M,{path:"status",element:(0,a.jsx)(dw,{children:(0,a.jsx)(pw,{})})}),(0,a.jsx)(M,{path:"status/:cardId",element:(0,a.jsx)(dw,{children:(0,a.jsx)(pw,{})})}),(0,a.jsx)(M,{path:"status-cards",element:(0,a.jsx)(Rw,{})}),(0,a.jsx)(M,{path:"status-cards/:cardId",element:(0,a.jsx)(Rw,{})}),(0,a.jsx)(M,{path:"review-queue",element:(0,a.jsx)(Wi,{children:(0,a.jsx)(e6,{})})}),(0,a.jsx)(M,{path:"learnings",element:(0,a.jsx)(Wi,{children:(0,a.jsx)(XB,{})})}),(0,a.jsx)(M,{path:"pipelines",element:(0,a.jsx)(Wi,{children:(0,a.jsx)(gh,{})})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId",element:(0,a.jsx)(Wi,{children:(0,a.jsx)(gh,{})})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId/add",element:(0,a.jsx)(Wi,{children:(0,a.jsx)(gh,{})})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId/settings",element:(0,a.jsx)(Wi,{children:(0,a.jsx)(t6,{})})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId/items/:caseId",element:(0,a.jsx)(Wi,{children:(0,a.jsx)(ZB,{})})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,a.jsx)(Wi,{children:(0,a.jsx)(JB,{})})}),(0,a.jsx)(M,{path:"routines/:routineId",element:(0,a.jsx)(hw,{})}),(0,a.jsx)(M,{path:"routines/:routineId/:section",element:(0,a.jsx)(hw,{})}),(0,a.jsx)(M,{element:(0,a.jsx)(uh,{}),children:(0,a.jsxs)(M,{element:(0,a.jsx)(W$,{}),children:[(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId",element:(0,a.jsx)(Il,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/services",element:(0,a.jsx)(Il,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/configuration",element:(0,a.jsx)(Il,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,a.jsx)(Il,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/issues",element:(0,a.jsx)(Il,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/routines",element:(0,a.jsx)(Il,{})})]})}),(0,a.jsx)(M,{path:"goals",element:(0,a.jsx)(s6,{})}),(0,a.jsx)(M,{path:"goals/:goalId",element:(0,a.jsx)(i6,{})}),(0,a.jsx)(M,{path:"artifacts",element:(0,a.jsx)(gw,{})}),(0,a.jsx)(M,{path:"approvals",element:(0,a.jsx)(Ge,{to:"/approvals/pending",replace:!0})}),(0,a.jsx)(M,{path:"approvals/pending",element:(0,a.jsx)(xw,{})}),(0,a.jsx)(M,{path:"approvals/all",element:(0,a.jsx)(xw,{})}),(0,a.jsx)(M,{path:"approvals/:approvalId",element:(0,a.jsx)(r6,{})}),(0,a.jsx)(M,{path:"activity",element:(0,a.jsx)(l6,{})}),(0,a.jsx)(M,{path:"activity/runs",element:(0,a.jsx)(od,{section:"runs"})}),(0,a.jsx)(M,{path:"activity/costs",element:(0,a.jsx)(od,{section:"costs"})}),(0,a.jsx)(M,{path:"activity/budgets",element:(0,a.jsx)(od,{section:"budgets"})}),(0,a.jsx)(M,{path:"activity/timeline",element:(0,a.jsx)(od,{section:"timeline"})}),(0,a.jsx)(M,{path:"audit",element:(0,a.jsx)(Ks,{to:"/activity",forceAgentMode:!0})}),(0,a.jsx)(M,{path:"audit/activity",element:(0,a.jsx)(Ks,{to:"/activity"})}),(0,a.jsx)(M,{path:"audit/runs",element:(0,a.jsx)(Ks,{to:"/activity/runs"})}),(0,a.jsx)(M,{path:"audit/costs",element:(0,a.jsx)(Ks,{to:"/activity/costs"})}),(0,a.jsx)(M,{path:"audit/budgets",element:(0,a.jsx)(Ks,{to:"/activity/budgets"})}),(0,a.jsx)(M,{path:"audit/timeline",element:(0,a.jsx)(Ks,{to:"/activity/timeline"})}),(0,a.jsx)(M,{path:"runs",element:(0,a.jsx)(Ks,{to:"/activity/runs"})}),(0,a.jsx)(M,{path:"costs",element:(0,a.jsx)(Ks,{to:"/activity/costs"})}),(0,a.jsx)(M,{path:"budgets",element:(0,a.jsx)(Ks,{to:"/activity/budgets"})}),(0,a.jsxs)(M,{element:(0,a.jsx)(V$,{}),children:[(0,a.jsx)(M,{path:"board-chat",element:(0,a.jsx)(u6,{})}),(0,a.jsx)(M,{path:"artifacts",element:(0,a.jsx)(gw,{})})]}),null,(0,a.jsx)(M,{path:"decisions",element:(0,a.jsx)(o6,{})}),(0,a.jsx)(M,{path:"decisions/queues/:key",element:(0,a.jsx)(c6,{})}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M,{path:"inbox",element:(0,a.jsx)(Ew,{})}),(0,a.jsx)(M,{path:"inbox/mine",element:(0,a.jsx)(ms,{view:"mine"})}),(0,a.jsx)(M,{path:"inbox/recent",element:(0,a.jsx)(ms,{view:"recent"})}),(0,a.jsx)(M,{path:"inbox/unread",element:(0,a.jsx)(ms,{view:"unread"})}),(0,a.jsx)(M,{path:"inbox/blocked",element:(0,a.jsx)(ms,{view:"blocked"})}),(0,a.jsx)(M,{path:"inbox/all",element:(0,a.jsx)(ms,{view:"everything"})}),(0,a.jsx)(M,{path:"inbox/new",element:(0,a.jsx)(ms,{view:"mine"})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M,{path:"inbox",element:(0,a.jsx)(Ew,{})}),(0,a.jsx)(M,{path:"inbox/mine",element:(0,a.jsx)(Yo,{})}),(0,a.jsx)(M,{path:"inbox/recent",element:(0,a.jsx)(Yo,{})}),(0,a.jsx)(M,{path:"inbox/unread",element:(0,a.jsx)(Yo,{})}),(0,a.jsx)(M,{path:"inbox/blocked",element:(0,a.jsx)(Yo,{})}),(0,a.jsx)(M,{path:"inbox/all",element:(0,a.jsx)(Yo,{})}),(0,a.jsx)(M,{path:"inbox/new",element:(0,a.jsx)(Ge,{to:"/inbox/mine",replace:!0})})]}),(0,a.jsx)(M,{path:"inbox/requests",element:(0,a.jsx)(Q6,{})}),(0,a.jsx)(M,{path:"u/:userSlug",element:(0,a.jsx)(a6,{})}),(0,a.jsx)(M,{path:"design-guide",element:(0,a.jsx)(E6,{})}),(0,a.jsx)(M,{path:"instance/settings/adapters",element:(0,a.jsx)(Sw,{})}),(0,a.jsx)(M,{path:":pluginRoutePath/*",element:(0,a.jsx)(Nw,{})}),(0,a.jsx)(M,{path:"*",element:(0,a.jsx)(PC,{scope:"board"})})]})}r(X6,"boardRoutes");function _w({credentialSource:e="wardmote_vault"}={}){const t=vn(),i=new URLSearchParams(t.search),{enabled:l,githubEnabled:c}=Fg();return K3(i,{chatConnectorsEnabled:l,githubReviewBotsEnabled:c})?(0,a.jsx)(zC,{credentialSource:e}):(0,a.jsx)(Ge,{to:"/apps",replace:!0})}r(_w,"AppsConnectEntryRoute");function Ew(){const{enabled:e}=Tf();return e?(0,a.jsx)(ms,{view:mE(rj())}):(0,a.jsx)(Ge,{to:`/inbox/${rj()}`,replace:!0})}r(Ew,"InboxRootRedirect");function ms({view:e}){const t=vn(),i=new URLSearchParams(t.search);return i.set(cE,e),(0,a.jsx)(Ge,{to:`/issues?${i.toString()}${t.hash}`,replace:!0})}r(ms,"TaskViewRedirect");function UC(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=bt(),{companyPrefix:c,skillId:d}=Rs();if(l)return null;const m=(c?t.find(f=>f.issuePrefix.toUpperCase()===c.toUpperCase()):null)??i??t[0]??null;return!m||!d?(0,a.jsx)(Ge,{to:"/skills/studio",replace:!0}):(0,a.jsx)(Ge,{to:`/${m.issuePrefix}/skills/studio/${encodeURIComponent(d)}${e.search}${e.hash}`,replace:!0})}r(UC,"LegacySkillStudioRedirect");function Or(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=bt(),{companyPrefix:c}=Rs(),{hidden:d}=rr();if(l)return(0,a.jsx)(Es,{});const m=(c?t.find(h=>h.issuePrefix.toUpperCase()===c.toUpperCase()):null)??i??t[0]??null;if(!m)return P0({pathname:e.pathname,hasCompanies:!1})?(0,a.jsx)(Ge,{to:"/onboarding",replace:!0}):(0,a.jsx)(B0,{});const f=r3(l3(`${e.pathname}${e.search}${e.hash}`),d);return(0,a.jsx)(Ge,{to:`/${m.issuePrefix}${f}`,replace:!0})}r(Or,"LegacySettingsRedirect");function Iw(){const{tab:e}=Rs();return(0,a.jsx)(Ge,{to:$C(e),replace:!0})}r(Iw,"LegacyToolsSettingsRedirect");function Tw(){const{tab:e}=Rs();return(0,a.jsx)(Ge,{to:$C(e),replace:!0})}r(Tw,"LegacyToolsRedirect");function $C(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($C,"legacyToolsRedirectTarget");function BC(){const{companies:e}=bt(),{openOnboarding:t}=Ms(),{t:i}=M1(),{onboardingOpen:l,onboardingRouteDismissed:c}=wf(),{companyPrefix:d}=Rs(),m=d?e.find(g=>g.issuePrefix.toUpperCase()===d.toUpperCase())??null:null;if(iU({onboardingOpen:l,routeDismissed:c}))return null;const f=m?`Add another agent to ${m.name}`:e.length>0?"Create another organization":"Create your first organization",h=m?"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)(pe,{onClick:r(()=>m?t({initialStep:jC(),companyId:m.id}):t(),"onClick"),children:m?"Add Agent":"Start Onboarding"})})]})})}r(BC,"OnboardingRoutePage");function Z6(){const{companies:e,selectedCompany:t,loading:i}=bt(),l=vn();if(i)return(0,a.jsx)(Es,{});const c=t??e[0]??null;return c?(0,a.jsx)(Ge,{to:`/${c.issuePrefix}/dashboard`,replace:!0}):P0({pathname:l.pathname,hasCompanies:!1})?(0,a.jsx)(Ge,{to:"/onboarding",replace:!0}):(0,a.jsx)(B0,{})}r(Z6,"CompanyRootRedirect");function Rw(){const{cardId:e}=Rs(),t=dE(),i=t?`/${t}`:"";return(0,a.jsx)(Ge,{to:`${i}/status${e?`/${e}`:""}`,replace:!0})}r(Rw,"StatusCardsLegacyRedirect");function Ks({to:e,forceAgentMode:t=!1}){const i=vn(),l=new URLSearchParams(i.search);t&&l.set("mode","agents");const c=l.toString();return(0,a.jsx)(Ge,{to:`${e}${c?`?${c}`:""}${i.hash}`,replace:!0})}r(Ks,"AuditCompatibilityRedirect");function Ze(){const e=vn(),{companies:t,selectedCompany:i,loading:l}=bt();if(l)return(0,a.jsx)(Es,{});const c=i??t[0]??null;return c?(0,a.jsx)(Ge,{to:`/${c.issuePrefix}${e.pathname}${e.search}${e.hash}`,replace:!0}):P0({pathname:e.pathname,hasCompanies:!1})?(0,a.jsx)(Ge,{to:"/onboarding",replace:!0}):(0,a.jsx)(B0,{})}r(Ze,"UnprefixedBoardRedirect");function B0(){const{openOnboarding:e}=Ms(),{t}=M1();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)(pe,{onClick:r(()=>e(),"onClick"),children:t("app.noCompanies.newCompany",{defaultValue:"New Organization"})})})]})})}r(B0,"NoCompaniesStartPage");function J6(){const{enabled:e}=Tf();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.Suspense,{fallback:(0,a.jsx)(Es,{}),children:(0,a.jsxs)(M_,{children:[(0,a.jsx)(M,{path:"auth",element:(0,a.jsx)($6,{})}),(0,a.jsx)(M,{path:"board-claim/:token",element:(0,a.jsx)(B6,{})}),(0,a.jsx)(M,{path:"mcp-connect/:id",element:(0,a.jsx)(Cw,{})}),(0,a.jsx)(M,{path:"dot-connect/:id",element:(0,a.jsx)(Cw,{agentPairingOnly:!0})}),(0,a.jsx)(M,{path:"mcp-device",element:(0,a.jsx)(q6,{})}),(0,a.jsx)(M,{path:"assistant-connections",element:(0,a.jsx)(F6,{})}),(0,a.jsx)(M,{path:"cli-auth/:id",element:(0,a.jsx)(H6,{})}),(0,a.jsx)(M,{path:"invite/:token",element:(0,a.jsx)(V6,{})}),(0,a.jsx)(M,{path:"s/:token",element:(0,a.jsx)(Aw,{})}),(0,a.jsx)(M,{path:"s/:token/issues/:issueId",element:(0,a.jsx)(Aw,{})}),(0,a.jsx)(M,{element:(0,a.jsx)(mw,{allowMembershipRequest:!0}),children:(0,a.jsx)(M,{path:"chat-identity/confirm",element:(0,a.jsx)(w6,{})})}),(0,a.jsx)(M,{path:"tests/perf/long-thread",element:(0,a.jsx)(GB,{})}),(0,a.jsx)(M,{path:"ux-lab/bootstrap-setup",element:(0,a.jsx)(m6,{})}),(0,a.jsx)(M,{path:"ux-lab/responsible-user-denial",element:(0,a.jsx)(p6,{})}),(0,a.jsx)(M,{path:"ux-lab/cross-issue-collaboration",element:(0,a.jsx)(h6,{})}),(0,a.jsxs)(M,{element:(0,a.jsx)(mw,{}),children:[(0,a.jsx)(M,{index:!0,element:(0,a.jsx)(Z6,{})}),(0,a.jsx)(M,{path:"onboarding",element:(0,a.jsx)(BC,{})}),(0,a.jsx)(M,{path:"instance",element:(0,a.jsx)(Or,{})}),(0,a.jsx)(M,{path:"instance/settings",element:(0,a.jsx)(Or,{})}),(0,a.jsx)(M,{path:"instance/settings/*",element:(0,a.jsx)(Or,{})}),(0,a.jsx)(M,{path:"companies",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"dashboard",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"inbox/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"issues",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"tasks",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"tasks/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"issues/:issueId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"routines",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"routines/:routineId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"review-queue",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"learnings",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"cases",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"cases/:caseIdentifier",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"pixels-office",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"status",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"status/:cardId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"status-cards",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"status-cards/:cardId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"pipelines",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId/add",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId/settings",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId/items/:caseId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"pipelines/:pipelineId/cases/:caseId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"artifacts",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"audit",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"audit/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"activity",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"activity/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"runs",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"costs",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"budgets",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"decisions",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"u/:userSlug",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"skills/studio",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"skills/studio/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"skills/studio/:skillId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"skills/:skillId/studio",element:(0,a.jsx)(UC,{})}),(0,a.jsx)(M,{path:"skills/*",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"settings",element:(0,a.jsx)(Or,{})}),(0,a.jsx)(M,{path:"settings/*",element:(0,a.jsx)(Or,{})}),(0,a.jsx)(M,{path:"agents",element:(0,a.jsx)(Ze,{})}),LC.map(t=>(0,a.jsx)(M,{path:`agents/${t}`,element:(0,a.jsx)(Ze,{})},t)),(0,a.jsx)(M,{path:"agents/new",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"agents/:agentId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"agents/:agentId/:tab",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"agents/:agentId/runs/:runId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"projects",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"projects/:projectId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"projects/:projectId/overview",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"projects/:projectId/issues",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"projects/:projectId/issues/:filter",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"projects/:projectId/workspaces",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"projects/:projectId/workspaces/:workspaceId",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"projects/:projectId/configuration",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"workspaces",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"terminal",element:(0,a.jsx)(Ze,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId",element:(0,a.jsx)(_l,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/services",element:(0,a.jsx)(_l,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/configuration",element:(0,a.jsx)(_l,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/runtime-logs",element:(0,a.jsx)(_l,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/issues",element:(0,a.jsx)(_l,{})}),(0,a.jsx)(M,{path:"execution-workspaces/:workspaceId/routines",element:(0,a.jsx)(_l,{})}),(0,a.jsx)(M,{path:":companyPrefix",element:(0,a.jsx)(q$,{}),children:X6(e)}),(0,a.jsx)(M,{path:"*",element:(0,a.jsx)(PC,{scope:"global"})})]})]})}),(0,a.jsx)(NB,{}),(0,a.jsx)(r$,{})]})}r(J6,"App");var e8=class extends b.Component{static{r(this,"AppErrorBoundary")}state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){NC(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 t8(){const{data:e}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),retry:!1}),t=e?.sentryDsn,i=e?.sentryEnvironment??void 0;return(0,b.useEffect)(()=>{if(t)return DU(t,i),()=>{MU()}},[t,i]),null}r(t8,"SentryGate");function n8(){let e;return{promise:new Promise(t=>{e=t}),resolve:e}}r(n8,"createDeferred");function a8(e,t=300){const i=new Map;let l=null,c=null;const d=r(async()=>{l!==null&&(clearTimeout(l),l=null);const h=c;if(c=null,i.size===0){h?.resolve();return}const g=[...i.values()];i.clear();try{await Promise.all(g.map(v=>e.invalidateQueries(cf().visible?v:{...v,refetchType:"none"})))}finally{h?.resolve()}},"flush");return{schedule:r(h=>(i.set(s8(h),h),c===null&&(c=n8()),l===null&&(l=setTimeout(()=>{d()},t)),c.promise),"schedule"),flush:d,dispose:r(()=>{l!==null&&(clearTimeout(l),l=null),i.clear(),c?.resolve(),c=null},"dispose")}}r(a8,"createInvalidationBatcher");var Dw=0;function s8(e){if(typeof e.predicate=="function")return`__predicate__:${Dw+=1}`;try{return JSON.stringify([e.queryKey??null,e.refetchType??null,e.exact??null,e.type??null])}catch{return`__nonserializable__:${Dw+=1}`}}r(s8,"serializeFilters");function i8(e,t){return new Proxy(e,{get(i,l){if(l==="invalidateQueries")return d=>t.schedule(d??{});const c=Reflect.get(i,l,i);return typeof c=="function"?c.bind(i):c}})}r(i8,"createCoalescingQueryClient");function r8(e,t){if(!e)return e;const i=e.filter(l=>l.id!==t);return i.length===e.length?e:i}r(r8,"removeRunFromList");function l8(e,t,i){if(!e)return{next:e,present:!1};let l=!1,c=!1;const d=e.map(m=>m.id!==t||(l=!0,m.status===i)?m:(c=!0,{...m,status:i}));return{next:c?d:e,present:l}}r(l8,"patchRunStatusInList");function o8(e,t){if(!e)return e;const i=e.filter(l=>l.id!==t);return i.length===e.length?e:i}r(o8,"removeLiveRunById");function c8(e,t){return!e||e.executionRunId!==t?e:{...e,executionRunId:null,executionAgentNameKey:null,executionLockedAt:null}}r(c8,"clearIssueExecutionRun");var u8=3e4,d8=["status","priority","title","assigneeAgentId","assigneeUserId","projectId","parentId"],f8=new Set(["issue.read_marked","issue.read_unmarked","issue.inbox_archived","issue.inbox_unarchived"]);function vg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}r(vg,"isRecord");function K0(e){return vg(e)&&Array.isArray(e.pages)}r(K0,"isInfiniteIssueData");function m8(e){return Array.isArray(e)?e.length:K0(e)?e.pages.reduce((t,i)=>t+(Array.isArray(i)?i.length:0),0):0}r(m8,"issueListRowCount");function p8(e){const t=e.state.data;return K0(t)||m8(t)>=100}r(p8,"isLargeIssueListQuery");function h8(e,t,i){const l={},c=vg(t?.changes)?t.changes:null;if(e==="issue.updated"&&c)for(const d of d8){const m=c[d];!vg(m)||m.updated===!0||!("to"in m)||(l[d]=m.to)}return i&&e&&!f8.has(e)&&!Number.isNaN(Date.parse(i))&&(l.lastActivityAt=i),l}r(h8,"readIssueListPatchFromActivity");function g8(e,t){let i=null;for(const[l,c]of Object.entries(t)){if(l==="lastActivityAt"){const d=e.lastActivityAt?new Date(e.lastActivityAt).getTime():0;if(new Date(c).getTime()<=d)continue}else if(!(l in e)||e[l]===c)continue;i??={...e},i[l]=c}return i??e}r(g8,"patchIssueRow");function Mw(e,t,i){const l=e.findIndex(m=>m?.id===t);if(l<0)return e;const c=g8(e[l],i);if(c===e[l])return e;const d=e.slice();return d[l]=c,d}r(Mw,"patchIssueRows");function x8(e,t,i){if(Array.isArray(e))return Mw(e,t,i);if(!K0(e))return e;let l=!1;const c=e.pages.map(d=>{if(!Array.isArray(d))return d;const m=Mw(d,t,i);return m!==d&&(l=!0),m});return l?{...e,pages:c}:e}r(x8,"patchIssueListData");function b8(e,t,i,l){if(Object.keys(l).length===0)return 0;let c=0;for(const[d,m]of e.getQueriesData({queryKey:P.issues.list(t)})){const f=x8(m,i,l);f!==m&&(e.setQueryData(d,f),c+=1)}return c}r(b8,"patchIssueInListCaches");function v8(e,t){for(const i of e.getQueryCache().findAll({queryKey:P.issues.list(t)}))e.invalidateQueries({queryKey:i.queryKey,exact:!0,...p8(i)?{refetchType:"none"}:{}})}r(v8,"invalidateIssueListsForActivity");function y8(e,t){const i=r(l=>l.state.isInvalidated,"predicate");return Promise.all([e.refetchQueries({queryKey:P.issues.list(t),type:"active",predicate:i}),e.refetchQueries({queryKey:P.heartbeats(t),type:"active",predicate:i})])}r(y8,"refreshInvalidatedLiveLists");function Ll(e){return typeof e=="string"&&e.length>0?e:null}r(Ll,"readString$1");function j8(e){return e.length===3&&e[0]==="issues"&&e[2]==="agent-todo"}r(j8,"isAgentTodoQueryKey");function w8(e){if(e.type!=="heartbeat.run.event")return null;const t=e.payload??{};if(t.eventType!=="agent.todo")return null;const i=Ll(t.runId),l=Ll(t.agentId),c=Ll(t.issueId),d=t.seq;if(!i||!l||!c||typeof d!="number"||!Number.isInteger(d))return null;const m=y_(t.payload);return m?{...m,runId:i,agentId:l,issueId:c,seq:d,createdAt:Ll(t.lastEventAt)??e.createdAt,runStatus:"running"}:null}r(w8,"readAgentTodoSnapshotFromLiveEvent");function Ow(e,t){if(t.type==="heartbeat.run.status"){const l=t.payload??{},c=Ll(l.runId),d=Ll(l.status);if(!c||!d)return;e.setQueriesData({predicate:r(m=>j8(m.queryKey),"predicate")},m=>m&&m.runId===c&&m.runStatus!==d?{...m,runStatus:d}:m);return}const i=w8(t);i&&e.setQueryData(P.issues.agentTodo(i.issueId),l=>l&&l.runId===i.runId&&l.seq>=i.seq?l:i)}r(Ow,"applyAgentTodoLiveEvent");function k8(e){const t=e.trim().toLowerCase();return t==="0.0.0.0"||t==="::"||t==="[::]"}r(k8,"isWildcardHost");function S8(e=window.location){return k8(e.hostname)?e.port?`localhost:${e.port}`:"localhost":e.host}r(S8,"browserReachableHost");function N8(e,t=window.location){const i=t.protocol==="https:"?"wss":"ws",l=e.startsWith("/")?e:`/${e}`;return`${i}://${S8(t)}${l}`}r(N8,"buildSameOriginWebSocketUrl");function C8(e){try{return new WebSocket(e)}catch{return null}}r(C8,"tryCreateWebSocket");var A8="/pwa-192x192.png",_8="/pwa-monochrome-512x512.png";function q0(){return typeof window<"u"&&"Notification"in window}r(q0,"notificationsSupported");function F0(){return q0()?Notification.permission:"unsupported"}r(F0,"notificationPermission");async function E8(){return q0()?Notification.permission!=="default"?Notification.permission:Notification.requestPermission():"unsupported"}r(E8,"requestNotificationPermission");function I8(){return typeof navigator<"u"&&"serviceWorker"in navigator&&typeof window<"u"&&"PushManager"in window}r(I8,"pushSupported");function MW(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(MW,"isIosWithoutHomeScreenInstall");async function KC(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{return await navigator.serviceWorker.getRegistration()??null}catch{return null}}r(KC,"getServiceWorkerRegistration");var qC="wardmote.notifications.seen.v1",T8="wardmote.notifications.claim",R8=6e5,D8=200,M8=new Map;function O8(){let e=null;try{e=typeof localStorage>"u"?null:localStorage}catch{e=null}const t=typeof navigator<"u"&&navigator.locks?{request:r((i,l)=>navigator.locks.request(i,l),"request")}:null;return{storage:e,locks:t,now:r(()=>Date.now(),"now"),memory:M8}}r(O8,"defaultEnv");function L8(e){const t=e.storage?.getItem(qC);if(!t)return new Map(e.memory);try{const i=JSON.parse(t),l=new Map(e.memory);for(const[c,d]of Object.entries(i))typeof d=="number"&&l.set(c,d);return l}catch{return new Map(e.memory)}}r(L8,"readSeen");function vh(e,t){const i=t.now(),l=L8(t);for(const[d,m]of l)i-m>R8&&l.delete(d);if(l.has(e))return!1;l.set(e,i);const c=[...l.entries()].sort((d,m)=>m[1]-d[1]).slice(0,D8);t.memory.clear();for(const[d,m]of c)t.memory.set(d,m);return z8(t,c),!0}r(vh,"claimInsideLock");function z8(e,t){try{e.storage?.setItem(qC,JSON.stringify(Object.fromEntries(t)))}catch{return}}r(z8,"writeSeen");async function P8(e,t=O8()){if(!t.locks)return vh(e,t);try{return await t.locks.request(T8,()=>vh(e,t))}catch{return vh(e,t)}}r(P8,"claimNotificationKey");var U8="paperclip-notifications",ef="custom-sounds";function $8(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($8,"validateCustomSoundFile");function FC(e){return new Promise((t,i)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>i(e.error)})}r(FC,"requestResult");var cd=null;function B8(){if(typeof indexedDB>"u")return Promise.reject(new Error("IndexedDB is unavailable."));if(!cd){const e=indexedDB.open(U8,1);e.onupgradeneeded=()=>{e.result.objectStoreNames.contains(ef)||e.result.createObjectStore(ef,{keyPath:"kind"})},cd=FC(e).catch(t=>{throw cd=null,t})}return cd}r(B8,"openDb");async function H0(e,t){return FC(t((await B8()).transaction(ef,e).objectStore(ef)))}r(H0,"withStore");var yg=new Set;function K8(e){return yg.add(e),()=>yg.delete(e)}r(K8,"subscribeCustomSounds");function HC(){for(const e of yg)e()}r(HC,"notifyCustomSoundsChanged");async function OW(e,t){const i=$8(t);if(!i.ok)throw new Error(i.error);const l={kind:e,name:t.name,type:t.type,size:t.size,blob:t,updatedAt:new Date().toISOString()};return await H0("readwrite",c=>c.put(l)),HC(),l}r(OW,"saveCustomSound");async function q8(e){try{return await H0("readonly",t=>t.get(e))??null}catch{return null}}r(q8,"loadCustomSound");async function LW(e){await H0("readwrite",t=>t.delete(e)),HC()}r(LW,"removeCustomSound");var F8=[{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"}],zW="custom",PW="none",jg={approval:"confirmation",question:"question",comment:"pluck",assignment:"maximize",review:"glass",run_failed:"error",join_request:"bong"},UW={approval:"Approvals",question:"Agent questions",comment:"Comments",assignment:"Assignments",review:"Ready for review",run_failed:"Failed runs",join_request:"Join requests"},VC=new Set(F8.map(e=>e.id));function H8(e){return typeof e=="string"&&(VC.has(e)||e==="custom"||e==="none")}r(H8,"isKnownSoundId");function V8(e){return VC.has(e)}r(V8,"isLibrarySoundId");function Lw(e,t){return`/sounds/${e}.${t}`}r(Lw,"librarySoundUrl");var wg=new Map,tf=new Map,zw=!1,ud=null;function QC(){return typeof Audio<"u"}r(QC,"audioSupported");function Pw(){return ud||(ud=new Audio().canPlayType('audio/ogg; codecs="vorbis"')?"ogg":"mp3",ud)}r(Pw,"libraryFormat");function WC(e){let t=wg.get(e);return t||(t=new Audio,t.preload="auto",t.src=e,wg.set(e,t)),t}r(WC,"audioFor");function Q8(){for(const e of tf.values())e.then(t=>{t&&(wg.delete(t),URL.revokeObjectURL(t))});tf.clear()}r(Q8,"revokeCustomSounds");function W8(e){zw||(zw=!0,K8(Q8));let t=tf.get(e);return t||(t=q8(e).then(i=>i?URL.createObjectURL(i.blob):null),tf.set(e,t)),t}r(W8,"customSoundUrl");async function GC(e,t){if(t==="none")return null;if(t==="custom"){const i=await W8(e);return i||Lw(jg[e],Pw())}return Lw(V8(t)?t:jg[e],Pw())}r(GC,"resolveSoundUrl");async function G8(e,t,i){if(!QC())return!1;const l=await GC(e,t);if(!l)return!1;const c=WC(l);c.volume=Math.min(1,Math.max(0,i)),c.currentTime=0;try{return await c.play(),!0}catch{return!1}}r(G8,"playSound");function Y8(e,t){return G8(e,t.kinds[e].soundId,t.volume)}r(Y8,"playKindSound");function Uw(e){if(!(!QC()||!e.enabled))for(const[t,i]of Object.entries(e.kinds))i.enabled&&GC(t,i.soundId).then(l=>{l&&WC(l)})}r(Uw,"preloadNotificationSounds");var kg={getWebPushConfig:r(()=>Re.get("/notifications/web-push/config"),"getWebPushConfig"),upsertWebPushSubscription:r(e=>Re.put("/notifications/web-push/subscription",e),"upsertWebPushSubscription"),deleteWebPushSubscription:r(e=>Re.deleteWithBody("/notifications/web-push/subscription",e),"deleteWebPushSubscription"),sendWebPushTest:r(()=>Re.post("/notifications/web-push/test",{}),"sendWebPushTest")},YC="wardmote.notifications.v1",X8=.6;function Sg(){const e={};for(const t of zg)e[t]={enabled:!0,soundId:jg[t]};return{enabled:!0,volume:X8,pushEnabled:!0,kinds:e}}r(Sg,"defaultNotificationSettings");function yh(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}r(yh,"asRecord");function XC(e){const t=Sg(),i=yh(e);if(!i)return t;const l=typeof i.volume=="number"&&Number.isFinite(i.volume)?Math.min(1,Math.max(0,i.volume)):t.volume,c=yh(i.kinds)??{},d={...t.kinds};for(const m of zg){const f=yh(c[m]);f&&(d[m]={enabled:typeof f.enabled=="boolean"?f.enabled:t.kinds[m].enabled,soundId:H8(f.soundId)?f.soundId:t.kinds[m].soundId})}return{enabled:typeof i.enabled=="boolean"?i.enabled:t.enabled,volume:l,pushEnabled:typeof i.pushEnabled=="boolean"?i.pushEnabled:t.pushEnabled,kinds:d}}r(XC,"normalizeNotificationSettings");function nf(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}r(nf,"storage");function Z8(){const e=nf()?.getItem(YC);if(!e)return Sg();try{return XC(JSON.parse(e))}catch{return Sg()}}r(Z8,"readStored");var af,Zo=null,wd=new Set,dd=!1;function Hr(){const e=nf()?.getItem("wardmote.notifications.v1")??null;return Zo&&e===af||(af=e,Zo=Z8()),Zo}r(Hr,"getNotificationSettings");function ZC(){for(const e of wd)e()}r(ZC,"notify");function JC(e){const t=XC(typeof e=="function"?e(Hr()):e);try{nf()?.setItem(YC,JSON.stringify(t))}catch{af=void 0}return Zo=t,af=nf()?.getItem("wardmote.notifications.v1")??null,ZC(),t}r(JC,"setNotificationSettings");function $W(e,t){return JC(i=>({...i,kinds:{...i.kinds,[e]:{...i.kinds[e],...t}}}))}r($W,"updateKindSettings");function J8(e){return e.enabled?zg.filter(t=>e.kinds[t].enabled):[]}r(J8,"enabledNotificationKinds");function $w(e){e.key!==null&&e.key!=="wardmote.notifications.v1"||ZC()}r($w,"onStorage");function eA(e){return wd.add(e),!dd&&typeof window<"u"&&(dd=!0,window.addEventListener("storage",$w)),()=>{wd.delete(e),wd.size===0&&dd&&typeof window<"u"&&(dd=!1,window.removeEventListener("storage",$w))}}r(eA,"subscribeNotificationSettings");function BW(){return(0,b.useSyncExternalStore)(eA,Hr,Hr)}r(BW,"useNotificationSettings");var rc={status:"unknown",error:null},Ng=new Set,Cg=null,Bw=Promise.resolve();function Kw(e){if(!(e.status===rc.status&&e.error===rc.error)){rc=e;for(const t of Ng)t()}}r(Kw,"setPushState");function qw(){return rc}r(qw,"getPushState");function eK(){return rc.status==="active"}r(eK,"hasActivePushSubscription");function tK(e){return Ng.add(e),()=>Ng.delete(e)}r(tK,"subscribePushState");function KW(){return(0,b.useSyncExternalStore)(tK,qw,qw)}r(KW,"usePushState");function tA(e){const t=e.padEnd(e.length+(4-e.length%4)%4,"=").replace(/-/g,"+").replace(/_/g,"/"),i=atob(t),l=new Uint8Array(new ArrayBuffer(i.length));for(let c=0;c<i.length;c+=1)l[c]=i.charCodeAt(c);return l}r(tA,"urlBase64ToUint8Array");function nK(e,t){const i=e.options?.applicationServerKey;if(!i)return!0;const l=tA(t),c=new Uint8Array(i);return c.length===l.length&&c.every((d,m)=>d===l[m])}r(nK,"sameApplicationServerKey");async function Fw(e){await kg.deleteWebPushSubscription({endpoint:e.endpoint}).catch(()=>{}),await e.unsubscribe().catch(()=>!1),Cg=null}r(Fw,"forgetSubscription");async function aK(e,t){if(!I8())return{status:"unsupported",error:null};const i=await KC();if(!i)return{status:"unsupported",error:null};let l=await i.pushManager.getSubscription();if(!(e.enabled&&e.pushEnabled))return l&&await Fw(l),{status:"off",error:null};if(F0()!=="granted")return{status:"permission",error:null};const c=await kg.getWebPushConfig();if(!c.enabled||!c.publicKey)return{status:"server-disabled",error:null};l&&!nK(l,c.publicKey)&&(await Fw(l),l=null),l||(l=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:tA(c.publicKey)}));const d=l.toJSON(),m=d.keys?.p256dh,f=d.keys?.auth;if(!m||!f)return{status:"error",error:"The browser returned an incomplete push subscription."};const h=J8(e),g=[t,l.endpoint,...h].join("|");return g!==Cg&&(await kg.upsertWebPushSubscription({endpoint:l.endpoint,keys:{p256dh:m,auth:f},kinds:h}),Cg=g),{status:"active",error:null}}r(aK,"reconcile");function Ag(e,t){const i=Bw.then(async()=>{try{const l=await aK(e,t);return Kw(l),l}catch(l){const c={status:"error",error:l instanceof Error?l.message:"Push subscription failed."};return Kw(c),c}});return Bw=i.catch(()=>{}),i}r(Ag,"syncPushSubscription");function nA(e,t){return t.enabled&&t.kinds[e.kind]?.enabled===!0}r(nA,"kindEnabled");function sK(e){const{payload:t,userId:i,settings:l}=e;return!i||!t.recipientUserIds.includes(i)||!nA(t.notification,l)?"none":e.visible?"sound":e.pushActive?"none":"os"}r(sK,"decideLiveNotification");function iK(e){return!e.visible||!nA(e.notification,e.settings)?"none":"sound"}r(iK,"decideServiceWorkerNotification");async function rK(e){if(F0()!=="granted")return;const t={body:e.body,tag:e.key,data:{url:e.url},icon:A8,badge:_8},i=await KC();if(i){await i.showNotification(e.title,t);return}new Notification(e.title,t)}r(rK,"showOsNotification");var aA={claim:r(e=>P8(e),"claim"),playSound:r((e,t)=>Y8(e.kind,t),"playSound"),showOsNotification:rK};async function sA(e,t,i,l){return e==="none"?e:await l.claim(t.key)?(e==="sound"?await l.playSound(t,i):await l.showOsNotification(t),e):"none"}r(sA,"perform");function lK(e,t,i=aA,l={}){const c=l.settings??Hr();return sA(sK({payload:e,userId:t,settings:c,visible:l.visible??cf().visible,pushActive:l.pushActive??eK()}),e.notification,c,i)}r(lK,"deliverLiveNotification");function oK(e,t=aA,i={}){const l=i.settings??Hr();return sA(iK({notification:e,settings:l,visible:i.visible??cf().visible}),e,l,t)}r(oK,"deliverServiceWorkerNotification");function iA(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(iA,"readNotification");function cK(e){if(!e||typeof e!="object")return null;const t=e,i=iA(t.notification);return!i||!Array.isArray(t.recipientUserIds)?null:{notification:i,recipientUserIds:t.recipientUserIds.filter(l=>typeof l=="string")}}r(cK,"readNotificationCreatedPayload");function uK(e){if(!e||typeof e!="object")return null;const t=e;if(t.type==="wardmote.notification"){const i=iA(t.notification);return i?{type:"notification",notification:i}:null}return t.type==="wardmote.navigate"&&typeof t.url=="string"&&t.url.startsWith("/")?{type:"navigate",url:t.url}:null}r(uK,"readServiceWorkerMessage");var dK=1e4,fK=3,mK=2e3,pK=3e5,hK=2e3,gK=15e3,xK=0,bK=1,wc=new Set(["succeeded","interrupted","failed","cancelled","timed_out"]),rA=(0,b.createContext)(null);function vK(e,t,i){if(i.companyId===t)for(const l of Array.from(e))try{l(i)}catch{}}r(vK,"dispatchLiveEventToSubscribers");function qW(e){const t=(0,b.useContext)(rA),i=(0,b.useRef)(e);(0,b.useEffect)(()=>{i.current=e}),(0,b.useEffect)(()=>{if(t)return t.subscribe(l=>{i.current(l)})},[t])}r(qW,"useCompanyLiveEvent");function xe(e){return typeof e=="string"&&e.length>0?e:null}r(xe,"readString");function Gr(e){return typeof e!="object"||e===null||Array.isArray(e)?null:e}r(Gr,"readRecord");function sf(e){return e.slice(0,8)}r(sf,"shortId");function lA(e,t,i){const l=e.getQueryData(P.agents.list(t))?.find(c=>c.id===i);return l?.name?l.name:e.getQueryData(P.agents.detail(i))?.name??null}r(lA,"resolveAgentName");function yK(e,t,i){const l=e.getQueryData(P.access.companyUserDirectory(t));if(!l)return null;const c=l.users.find(d=>d.principalId===i);return c?.user?.name?.trim()||c?.user?.email?.trim()||null}r(yK,"resolveUserName");function Lr(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}r(Lr,"truncate");function jK(e,t,i,l){return i==="agent"&&l?lA(e,t,l)??`Agent ${sf(l)}`:i==="system"?"System":i==="user"&&l?yK(e,t,l)??(l==="board"||l==="local-board"?"Board":`User ${sf(l)}`):i==="plugin"?"Plugin":"Unknown actor"}r(jK,"resolveActorLabel");function V0(e,t,i,l){const c=new Set([i]),d=e.getQueryData(P.issues.detail(i)),m=e.getQueryData(P.issues.list(t)),f=xe(l?.identifier)??xe(l?.issueIdentifier);f&&c.add(f),d?.id&&c.add(d.id),d?.identifier&&c.add(d.identifier);const h=m?.find(g=>!!(g.id===i||g.identifier&&g.identifier===i||f&&g.identifier===f));return h?.id&&c.add(h.id),h?.identifier&&c.add(h.identifier),Array.from(c)}r(V0,"resolveIssueQueryRefs");function wK(e,t,i,l){const c=V0(e,t,i,l),d=c.map(v=>e.getQueryData(P.issues.detail(v))).find(v=>!!v),m=e.getQueryData(P.issues.list(t))?.find(v=>c.some(y=>v.id===y||v.identifier===y)),f=d??m??null,h=xe(l?.identifier)??xe(l?.issueIdentifier)??f?.identifier??`Task ${sf(i)}`,g=xe(l?.title)??xe(l?.issueTitle)??f?.title??null;return{ref:h,title:g,label:g?`${h} - ${Lr(g,72)}`:h,href:`/issues/${f?.identifier??i}`}}r(wK,"resolveIssueToastContext");function oA(){return!(typeof document>"u"||document.visibilityState!=="visible"||typeof document.hasFocus=="function"&&!document.hasFocus())}r(oA,"isPageForegrounded");function lr(e,t,i){if(!(i?.isForegrounded??oA()))return null;const l=df(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,N=Ek(t),S=e.getQueryData(P.companies.list(k))?.companies.find(E=>E.issuePrefix.toUpperCase()===N?.toUpperCase());if(!S)return null;const D=e.getQueryData(P.agents.list(S.id))?.find(E=>E.id===c||ar(E)===c);if(!D)return null;const R=e.getQueryData(P.agentChats.detail(S.id,k,D.id));if(!R)return null;c=R.id}const d=e.getQueryData(P.issues.detail(c))??null,m=new Set([c]);d?.id&&m.add(d.id),d?.identifier&&m.add(d.identifier);function f(j,k){const N=e.getQueryData(P.issues.activeRun(j)),S=e.getQueryData(P.issues.liveRuns(j))??[],D=e.getQueryData(P.issues.runs(j))??[];N?.id&&k.add(N.id);for(const R of S)R.id&&k.add(R.id);for(const R of D)R.runId&&k.add(R.runId)}r(f,"collectCachedIssueRunIds");const h=new Set;for(const j of m)f(j,h);const g=new Set(m),v=new Set,y=new Set(h);if(d?.companyId&&d.id){const j=e.getQueryData(P.issues.listByDescendantRoot(d.companyId,d.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(d?.companyId){const j=e.getQueryData(P.liveRuns(d.companyId))??[];for(const k of j)k.issueId&&g.has(k.issueId)&&y.add(k.id)}return{routeIssueRef:c,issueRefs:m,assigneeAgentId:d?.assigneeAgentId??null,runIds:h,subtreeIssueRefs:g,subtreeAgentIds:v,subtreeRunIds:y}}r(lr,"resolveVisibleIssueRouteContext");function Of(e,t){const i=new Set([e]),l=xe(t?.identifier)??xe(t?.issueIdentifier);return l&&i.add(l),i}r(Of,"buildIssueRefsForPayload");function Lf(e,t){for(const i of e)if(t.has(i))return!0;return!1}r(Lf,"overlaps");function kK(e,t,i,l){const c=xe(i.entityType),d=xe(i.entityId);if(c!=="issue"||!d)return!1;const m=lr(e,t,l);return m?Lf(m.subtreeIssueRefs,Of(d,Gr(i.details))):!1}r(kK,"shouldSuppressActivityToastForVisibleIssue");function SK(e,t,i,l){if(!(l?.isForegrounded??oA()))return!1;const c=df(t).match(/^\/agents\/[^/]+\/runs\/([^/]+)/)?.[1];if(c&&decodeURIComponent(c)===xe(i.runId))return!0;const d=lr(e,t,l);if(!d)return!1;const m=xe(i.issueId);if(m)return d.subtreeIssueRefs.has(m);const f=xe(i.runId);if(f)return d.subtreeRunIds.has(f);const h=xe(i.agentId);return!!h&&(h===d.assigneeAgentId||d.subtreeAgentIds.has(h))}r(SK,"shouldSuppressRunStatusToastForVisibleIssue");function Hw(e,t,i,l){const c=lr(e,t,l);if(!c)return!1;const d=xe(i.runId),m=xe(i.agentId);if(!(d!==null&&c.runIds.has(d)||m&&c.assigneeAgentId&&m===c.assigneeAgentId))return!1;const f=xe(i.status);if(d&&f&&wc.has(f))for(const v of c.issueRefs)e.invalidateQueries({queryKey:P.issues.comments(v)}),e.setQueryData(P.issues.liveRuns(v),y=>o8(y,d)),e.setQueryData(P.issues.activeRun(v),y=>y?.id===d?null:y),e.setQueryData(P.issues.detail(v),y=>c8(y,d));const h=!!f&&wc.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(Hw,"invalidateVisibleIssueRunQueries");function Xo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r(Xo,"hasPatchKey");function cA(e,t){return e.id!==t.runId?e:{...e,...Xo(t,"message")?{currentStatusMessage:t.message}:{},...Xo(t,"updatedAt")?{currentStatusUpdatedAt:t.updatedAt}:{},...Xo(t,"currentToolName")?{currentToolName:t.currentToolName}:{},...Xo(t,"lastAssistantSnippet")?{lastAssistantSnippet:t.lastAssistantSnippet}:{},...Xo(t,"lastEventAt")?{lastEventAt:t.lastEventAt}:{}}}r(cA,"applyRunLiveStatusPatch");function Vw(e,t){if(!e)return e;let i=!1;const l=e.map(c=>c.id!==t.runId?c:(i=!0,cA(c,t)));return i?l:e}r(Vw,"applyRunLiveStatusPatchToArray");function NK(e,t,i){const l=xe(e.runId);if(!l)return null;const c={runId:l,agentId:xe(e.agentId),issueId:xe(e.issueId)};if(i==="heartbeat.run.progress")return c.message=xe(e.message),c.updatedAt=xe(e.updatedAt)??t,c.currentToolName=xe(e.currentToolName),c.lastAssistantSnippet=xe(e.lastAssistantSnippet),c.lastEventAt=xe(e.lastEventAt)??c.updatedAt,c;if(i==="heartbeat.run.log")return c.lastEventAt=xe(e.ts)??t,c;if(i==="heartbeat.run.event"){const d=xe(e.message);d&&(c.message=d),c.updatedAt=xe(e.updatedAt)??t;const m=xe(e.currentToolName);m&&(c.currentToolName=m);const f=xe(e.lastAssistantSnippet);return f&&(c.lastAssistantSnippet=f),c.lastEventAt=xe(e.lastEventAt)??t,c}return null}r(NK,"readRunLiveStatusPatchFromPayload");var CK=1e3;function AK(e=CK){const t=new Map,i=new Map,l=r(c=>{const d=t.get(c);if(!d){i.delete(c);return}t.delete(c),i.set(c,setTimeout(()=>l(c),e)),d.apply(d.patch)},"release");return{submit:r((c,d)=>{if(i.has(c.runId)){t.set(c.runId,{patch:c,apply:d});return}i.set(c.runId,setTimeout(()=>l(c.runId),e)),d(c)},"submit"),dispose:r(()=>{for(const c of i.values())clearTimeout(c);i.clear(),t.clear()},"dispose")}}r(AK,"createRunLogPatchThrottle");function _K(e,t,i,l,c){let d=!1;e.setQueryData(P.liveRuns(t),h=>{const g=Vw(h,l);return g!==h&&(d=!0),g});const m=new Set;if(l.issueId)for(const h of V0(e,t,l.issueId,null))m.add(h);const f=lr(e,i,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)m.add(h);for(const h of m)e.setQueryData(P.issues.activeRun(h),g=>!g||g.id!==l.runId?g:(d=!0,cA(g,l))),e.setQueryData(P.issues.liveRuns(h),g=>{const v=Vw(g,l);return v!==g&&(d=!0),v});return d}r(_K,"applyRunLiveStatusPatchToCaches");function EK(e,t,i,l){const c=lr(e,t,l);if(!c)return!1;const d=xe(i.agentId);return!!d&&(d===c.assigneeAgentId||c.subtreeAgentIds.has(d))}r(EK,"shouldSuppressAgentStatusToastForVisibleIssue");function IK(e,t,i,l){const c=xe(i.entityType),d=xe(i.entityId),m=xe(i.actorType),f=xe(i.action),h=Gr(i.details);if(c!=="issue"||!d||m!=="agent"&&m!=="system"||f!=="issue.updated"||xe(h?.source)==="comment")return!1;const g=lr(e,t,l);return g?Lf(g.issueRefs,Of(d,h)):!1}r(IK,"shouldDeferIssueRefetchForVisibleAgentActivity");function uA(e,t,i,l){const c=xe(i.entityType),d=xe(i.entityId),m=xe(i.action),f=Gr(i.details);if(c!=="issue"||!d||m!=="issue.comment_added")return!1;const h=lr(e,t,l);return h?Lf(h.issueRefs,Of(d,f)):!1}r(uA,"shouldDeferVisibleIssueCommentActivity");async function TK(e,t,i,l){const c=xe(i.entityType),d=xe(i.action),m=Gr(i.details),f=xe(m?.commentId);if(c!=="issue"||d!=="issue.comment_added"||!f)return!1;const h=lr(e,t,l);if(!h)return!1;const g=xe(i.entityId);if(!g||!Lf(h.issueRefs,Of(g,m)))return!1;try{const v=await dn.getComment(h.routeIssueRef,f);for(const y of h.issueRefs)e.setQueryData(P.issues.comments(y),j=>j?{...j,pages:rE(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(TK,"hydrateVisibleIssueComment");var RK=new Set(["issue.created","issue.updated","issue.comment_added"]),Qw=new Set(["issue.document_created","issue.document_updated","issue.document_restored","issue.document_deleted"]),DK=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"]),MK=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"]),OK=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"]),LK=new Set(["error"]),zK=new Set(["failed","timed_out","cancelled"]);function PK(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 i=xe(e.reopenedFrom);t.push(i?`reopened from ${i.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(PK,"describeIssueUpdate");function UK(e,t,i,l){const c=xe(i.entityType),d=xe(i.entityId),m=xe(i.action),f=Gr(i.details),h=xe(i.actorId),g=xe(i.actorType);if(c!=="issue"||!d||!m||!RK.has(m))return null;const v=wK(e,t,d,f),y=xe(xe(i.actorName)?.trim())??jK(e,t,g,h),j=g==="agent"&&h?e.getQueryData(P.agents.list(t))?.find(B=>B.id===h)??e.getQueryData(P.agents.detail(h)):void 0,k=g==="user"&&h?e.getQueryData(P.access.companyUserDirectory(t))?.users.find(B=>B.principalId===h)?.user:void 0,N=h&&(g==="user"||g==="agent")?{type:g,id:h,name:y,image:i.actorImage!==void 0?xe(i.actorImage):k?.image,appearance:g==="agent"?I_(i.actorAppearance!==void 0?i.actorAppearance:j?.appearance,h):void 0}:void 0;if(g==="user"&&l.userId&&h===l.userId||g==="agent"&&l.agentId&&h===l.agentId)return null;if(m==="issue.created")return{actor:N,title:`${y} created ${v.ref}`,body:v.title?Lr(v.title,96):void 0,tone:"success",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${d}`};if(m==="issue.updated"){if(xe(f?.source)==="comment")return null;const B=PK(f),L=B?v.title?`${Lr(v.title,64)} - ${B}`:B:v.title?Lr(v.title,96):v.label;return{actor:N,title:`${y} updated ${v.ref}`,body:Lr(L,100),tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${d}`}}const S=xe(f?.commentId),D=xe(f?.bodySnippet),R=f?.reopened===!0,E=f?.updated===!0,C=xe(f?.reopenedFrom),I=R?C?`reopened from ${C.replace(/_/g," ")}`:"reopened":null,O=R?`${y} reopened and commented on ${v.ref}`:E?`${y} commented and updated ${v.ref}`:`${y} commented on ${v.ref}`,z=D?I?`${I} - ${D.replace(/^#+\s*/m,"").replace(/\n/g," ")}`:D.replace(/^#+\s*/m,"").replace(/\n/g," "):I?v.title?`${I} - ${v.title}`:I:v.title??void 0;return{actor:N,title:O,body:z?Lr(z,96):void 0,tone:"info",action:{label:`View ${v.ref}`,href:v.href},dedupeKey:`activity:${m}:${d}:${S??"na"}`}}r(UK,"buildActivityToast");function $K(e){const t=xe(e.entityType),i=xe(e.action),l=xe(e.entityId),c=Gr(e.details);return t!=="join_request"||!i||!l||i!=="join.requested"&&i!=="join.request_replayed"?null:{title:`${xe(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($K,"buildJoinRequestToast");function BK(e,t,i,l){const c=xe(e.agentId),d=xe(e.status);if(!c||!d||!LK.has(d))return null;const m=d==="error"?"error":"info",f=t(c)??`Agent ${sf(c)}`;return{title:d==="running"?`${f} started`:`${f} errored`,body:i.getQueryData(P.agents.list(l))?.find(h=>h.id===c)?.title??void 0,tone:m,action:{label:"View agent",href:`/agents/${c}`},dedupeKey:`agent-status:${c}:${d}`}}r(BK,"buildAgentStatusToast");function KK(e,t){const i=xe(e.runId),l=xe(e.agentId),c=xe(e.status);if(!i||!l||!c||!zK.has(c))return null;const d=xe(e.error),m=xe(e.errorCode);if(m==="operator_interrupted"||m==="workspace_busy")return null;const f=xe(e.contextSource),h=xe(e.triggerDetail),g=t(l)??"Agent";if(c==="failed"&&m==="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:${i}:${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 d?j=Lr(d,100):h&&(j=`Trigger: ${h}`),{title:y,body:j,tone:v,ttlMs:c==="succeeded"?5e3:7e3,action:{label:"View run",href:`/agents/${l}/runs/${i}`},dedupeKey:`run-status:${i}:${c}`}}r(KK,"buildRunStatusToast");function qK(e,t,i){const l=xe(i.runId),c=xe(i.status);if(!l||!c)return!1;if(e.setQueryData(P.runDetail(l),m=>{if(!m)return m;const f=r(h=>Object.prototype.hasOwnProperty.call(i,h),"has");return{...m,status:c,...f("invocationSource")?{invocationSource:xe(i.invocationSource)??m.invocationSource}:{},...f("triggerDetail")?{triggerDetail:xe(i.triggerDetail)}:{},...f("error")?{error:xe(i.error)}:{},...f("errorCode")?{errorCode:xe(i.errorCode)}:{},...f("startedAt")?{startedAt:xe(i.startedAt)}:{},...f("finishedAt")?{finishedAt:xe(i.finishedAt)}:{}}}),wc.has(c))return e.setQueryData(P.liveRuns(t),m=>r8(m,l)),!0;let d=!1;return e.setQueryData(P.liveRuns(t),m=>{const f=l8(m,l,c);return d=f.present,f.next}),d}r(qK,"applyRunLifecycleToCompanyLiveRuns");function FK(e,t,i){const l=xe(i.status);l&&wc.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=xe(i.agentId);c&&(e.invalidateQueries({queryKey:P.agents.detail(c)}),e.invalidateQueries({queryKey:P.heartbeats(t,c)}));const d=xe(i.runId);d&&e.invalidateQueries({queryKey:P.runDetail(d)})}r(FK,"invalidateHeartbeatQueries");function HK(e,t,i){const l=xe(i.agentId);l&&e.invalidateQueries({queryKey:P.agents.detail(l)})}r(HK,"invalidateHeartbeatProgressQueries");var VK=new Set(["approval","attention_source","budget_incident","decision","decision_queue","issue_recovery_action","join_request"]),QK=["issue.blockers_","issue.dependency_recovery_","issue.disposition_repair_","issue.execution_recovery_","issue.interaction_","issue.recovery_action_","issue.stalled_review_","issue.thread_interaction_"],WK=new Set(["failed","timed_out"]);function GK(e,t,i){return t?.startsWith("inbox.")||e&&VK.has(e)?!0:e!=="issue"||!t?!1:QK.some(l=>t.startsWith(l))||t==="issue.reviewers_updated"||t==="issue.status_decision_recorded"?!0:(t==="issue.created"||t==="issue.updated")&&(i?.status!==void 0||i?.blockedByIssueIds!==void 0)}r(GK,"activityChangesAttention");function Ww(e,t,i,l){return e.getQueriesData({queryKey:P.attention(t)}).some(([,c])=>c?"items"in c?Array.isArray(c.items)&&c.items.some(i):"count"in c&&l(c):!1)}r(Ww,"cachedAttentionIncludes");function _g(e,t){e.invalidateQueries({queryKey:P.attention(t)})}r(_g,"invalidateAttentionQueries");function YK(e,t,i,l,c){e.invalidateQueries({queryKey:P.activity(t)}),e.invalidateQueries({queryKey:P.dashboard(t)}),e.invalidateQueries({queryKey:P.sidebarBadges(t)});const d=xe(i.entityType),m=xe(i.entityId),f=xe(i.action),h=xe(i.actorType),g=xe(i.actorId),v=Gr(i.details),y=h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId;if(GK(d,f,v)&&_g(e,t),d==="decision"&&(e.invalidateQueries({queryKey:["decisions",t]}),m&&e.invalidateQueries({queryKey:P.decisions.detail(m)})),(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=xe(v?.userId);(!j||j===l.userId)&&e.invalidateQueries({queryKey:P.resourceMemberships.mine(t)})}if(d==="issue"){const j=P.agentChats.list(t,l.userId);if((m&&e.getQueryData(j)?.some(k=>k.id===m)||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"]}),m&&b8(e,t,m,h8(f,v,c?.occurredAt??null)),v8(e,t),GE(e,t,i),m){const k=(f==="issue.comment_added"||f==="issue.updated"&&xe(v?.source)==="comment")&&(h==="user"&&!!l.userId&&g===l.userId||h==="agent"&&!!l.agentId&&g===l.agentId),N=!!c?.pathname&&IK(e,c.pathname,i,{isForegrounded:c.isForegrounded}),S=!!c?.pathname&&uA(e,c.pathname,i,{isForegrounded:c.isForegrounded}),D=V0(e,t,m,v);for(const R of D){const E=k||N||S?{refetchType:"inactive"}:void 0;if(e.invalidateQueries({queryKey:P.issues.detail(R),...E}),e.invalidateQueries({queryKey:P.issues.activity(R),...E}),(f==="issue.comment_added"||f==="issue.conversation_session_started")&&e.invalidateQueries({queryKey:P.issues.comments(R),...E}),(f==="issue.comment_added"||f?.startsWith("issue.queued_comment"))&&e.invalidateQueries({queryKey:P.issues.queuedComments(R)}),(f?.startsWith("issue.attachment_")||f?.startsWith("issue.work_product_"))&&(e.invalidateQueries({queryKey:P.issues.attachments(R)}),e.invalidateQueries({queryKey:P.issues.workProducts(R)})),f==="issue.conversation_session_started"&&(e.invalidateQueries({queryKey:["issues","tree-control-state",R]}),e.invalidateQueries({queryKey:P.issues.interactions(R)})),f&&Qw.has(f)){const C=xe(v?.key);e.invalidateQueries({queryKey:P.issues.documents(R),...E}),C?(e.invalidateQueries({queryKey:P.issues.document(R,C),...E}),e.invalidateQueries({queryKey:P.issues.documentRevisions(R,C),...E})):(e.invalidateQueries({queryKey:["issues","document",R],...E}),e.invalidateQueries({queryKey:["issues","document-revisions",R],...E}))}if(f&&(Qw.has(f)||DK.has(f))){const C=xe(v?.key)??xe(v?.documentKey);e.invalidateQueries({queryKey:C?["issues","document-annotations",R,C]:["issues","document-annotations",R],...E})}(f?.startsWith("issue.thread_interaction_")||(f==="issue.updated"||f==="issue.status_decision_recorded")&&xe(v?.source)==="native_status_decision")&&(e.invalidateQueries({queryKey:P.issues.interactions(R)}),e.invalidateQueries({queryKey:P.tools.actionRequests(t,"pending")}),e.invalidateQueries({queryKey:P.apps.attention(t)}),e.invalidateQueries({queryKey:P.tools.trustRules(t)}))}}return}if(d==="agent"){e.invalidateQueries({queryKey:P.agents.list(t)}),e.invalidateQueries({queryKey:P.org(t)}),m&&(e.invalidateQueries({queryKey:P.agents.detail(m)}),e.invalidateQueries({queryKey:P.heartbeats(t,m)}));return}if(d==="project"){const j=xe(i.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:P.issues.activity(j)}),e.invalidateQueries({queryKey:P.projects.all(t)}),m&&e.invalidateQueries({queryKey:P.projects.detail(m)});return}if(d==="company_skill"){const j=xe(i.details?.sourceIssueId);j&&e.invalidateQueries({queryKey:P.issues.activity(j)}),m&&e.invalidateQueries({queryKey:P.companySkills.detail(t,m)}),e.invalidateQueries({queryKey:P.companySkills.list(t)});return}if(d==="goal"){e.invalidateQueries({queryKey:P.goals.list(t)}),m&&e.invalidateQueries({queryKey:P.goals.detail(m)});return}if(d==="approval"){e.invalidateQueries({queryKey:P.approvals.list(t)});return}if(d==="join_request"){e.invalidateQueries({queryKey:P.access.joinRequests(t)});return}if(d==="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(d==="routine"||d==="routine_trigger"||d==="routine_run"){if(e.invalidateQueries({queryKey:["routines"]}),d==="routine"&&f&&MK.has(f)&&m){const j=xe(v?.key)??xe(v?.documentKey)??"description",k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:["routines","document-annotations",m,j],...k})}return}if(d==="case"){if(e.invalidateQueries({queryKey:P.cases.list(t)}),m&&(e.invalidateQueries({queryKey:P.cases.detail(m)}),e.invalidateQueries({queryKey:P.cases.events(m)}),f&&OK.has(f))){const j=xe(v?.key)??xe(v?.documentKey),k=y?{refetchType:"inactive"}:void 0;e.invalidateQueries({queryKey:j?["cases","document-annotations",m,j]:["cases","document-annotations",m],...k})}return}if(d==="summary_slot"){const j=xe(v?.scopeKind),k=xe(v?.slotKey),N=xe(v?.scopeId);j&&k&&(e.invalidateQueries({queryKey:P.summarySlots.detail(t,j,k,N)}),e.invalidateQueries({queryKey:P.summarySlots.revisions(t,j,k,N)}));return}d==="company"&&e.invalidateQueries({queryKey:P.companies.all})}r(YK,"invalidateActivityQueries");function XK(e,t){const i=t.payload??{},l=xe(i.runId),c=xe(i.status);if(!l||!c||!wc.has(c))return!1;const d=`${t.companyId}:${l}:${c}`,m=e.observedRunOutcomes.has(d);e.observedRunOutcomes.delete(d),e.observedRunOutcomes.add(d),e.observedRunOutcomes.size>hK&&e.observedRunOutcomes.delete(e.observedRunOutcomes.values().next().value);const f=Date.parse(xe(i.finishedAt)??""),h=Date.parse(t.createdAt);return m||h-f>pK}r(XK,"observeRunOutcome");function ZK(e,t){const i=Date.now();if(i<e.suppressUntil)return!0;const l=e.cooldownHits.get(t);if(!l)return!1;const c=l.filter(d=>i-d<dK);return e.cooldownHits.set(t,c),c.length>=fK}r(ZK,"shouldSuppressToast");function JK(e,t){const i=Date.now(),l=e.cooldownHits.get(t)??[];l.push(i),e.cooldownHits.set(t,l)}r(JK,"recordToastHit");function jh(e,t,i,l){ZK(e,i)||t(l)!==null&&JK(e,i)}r(jh,"gatedPushToast");function eq(e,t,i,l,c,d,m,f){if(l.companyId!==t)return;const h=r(k=>lA(e,t,k),"nameOf"),g=l.payload??{},v=l.type==="heartbeat.run.status"&&(XK(d,l)||SK(e,i,g)),y=NK(g,l.createdAt,l.type);let j=!1;if(y){const k=r(N=>{j=_K(e,t,i,N)},"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=qK(e,t,g);if(FK(e,t,g),Ow(e,l),k||e.invalidateQueries({queryKey:P.liveRuns(t)}),Hw(e,i,g,{runLifecycleEvent:!0}),(l.type==="heartbeat.run.status"&&WK.has(xe(g.status)??"")||l.type==="heartbeat.run.queued"&&Ww(e,t,N=>N.sourceKind==="failed_run",N=>(N.countsBySourceKind?.failed_run??0)>0))&&_g(e,t),l.type==="heartbeat.run.status"){const N=KK(g,h);N&&!v&&jh(d,c,"run-status",N)}return}if(l.type==="heartbeat.run.progress"){HK(e,t,g),Hw(e,i,g,{liveStatusAlreadyPatched:j});return}if(l.type==="heartbeat.run.event"){Ow(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=xe(g.agentId);k&&e.invalidateQueries({queryKey:P.agents.detail(k)}),(xe(g.status)==="error"||k&&Ww(e,t,S=>S.sourceKind==="agent_error_alert"&&S.subject?.id===k,S=>S.errorAgentIds?.includes(k)===!0))&&_g(e,t);const N=BK(g,h,e,t);N&&!EK(e,i,g)&&jh(d,c,"agent-status",N);return}if(l.type==="activity.logged"){YK(e,t,g,m,{pathname:i,occurredAt:l.createdAt??null}),uA(e,i,g)&&TK(e,i,g);const k=xe(g.action),N=UK(e,t,g,m)??$K(g);N&&!kK(e,i,g)&&jh(d,c,`activity:${k??"unknown"}`,N)}}}r(eq,"handleLiveEvent");function tq(e,t){return e&&e===t?e:null}r(tq,"resolveLiveCompanyId");function Gw(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null}r(Gw,"resetSocketHandlers");function Yw(e,t){if(e){if(e.readyState===xK){e.onopen=()=>{Gw(e),e.close(1e3,t)},e.onmessage=null,e.onerror=()=>{},e.onclose=null;return}Gw(e),e.readyState===bK&&e.close(1e3,t)}}r(Yw,"closeSocketQuietly");function nq(e,t,i){return e==="success"&&(t||i==="local_trusted")}r(nq,"canUseLiveSession");function aq({children:e}){const{visible:t}=yk(),i=(0,b.useRef)(!t),{selectedCompanyId:l,selectedCompany:c}=bt(),d=Rn(),{pushToast:m}=Si(),f=vn(),h=(0,b.useRef)({cooldownHits:new Map,suppressUntil:0,observedRunOutcomes:new Set}),g=(0,b.useRef)(f.pathname),{data:v,status:y}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),retry:!1}),{data:j}=be({queryKey:P.health,queryFn:Ac.get}),k=v?.user?.id??v?.session?.userId??(j?.deploymentMode==="local_trusted"?"local-board":null),N=v?.session?.id??k??"signed_out",S=tq(l,c?.id??null),D=nq(y,v!=null,j?.deploymentMode)&&S!==null,R=(0,b.useRef)({userId:k,agentId:null}),E=(0,b.useRef)(new Set),C=(0,b.useCallback)(L=>(E.current.add(L),()=>{E.current.delete(L)}),[]),I=(0,b.useMemo)(()=>({subscribe:C}),[C]),O=(0,b.useMemo)(()=>a8(d),[d]),z=(0,b.useMemo)(()=>i8(d,O),[d,O]),B=(0,b.useMemo)(()=>AK(),[]);return(0,b.useEffect)(()=>()=>{O.dispose(),B.dispose()},[O,B]),(0,b.useEffect)(()=>{g.current=f.pathname},[f.pathname]),(0,b.useEffect)(()=>{R.current={userId:k,agentId:null}},[k]),(0,b.useEffect)(()=>{if(!t||!D||!S)return;const L=window.setInterval(()=>{y8(d,S)},u8);return()=>window.clearInterval(L)},[D,S,d,t]),(0,b.useEffect)(()=>{if(!t){i.current=!0,O.dispose(),B.dispose();return}if(!D||!S)return;i.current&&(i.current=!1,d.invalidateQueries({type:"active"},{cancelRefetch:!1}));let L=!1,_=0,U=null,F=null,Y=null;const se=r(()=>{U!==null&&(window.clearTimeout(U),U=null)},"clearReconnect"),me=r(()=>{F!==null&&(window.clearInterval(F),F=null)},"stopPolling"),oe=r(()=>{L||F!==null||(F=window.setInterval(()=>{d.invalidateQueries({type:"active"},{cancelRefetch:!1})},gK))},"startPolling"),$=r(()=>{if(L||U!==null)return;_+=1;const ce=Math.min(15e3,1e3*2**Math.min(_-1,4));U=window.setTimeout(()=>{U=null,T()},ce)},"scheduleReconnect"),T=r(()=>{if(L)return;const ce=N8(`/api/companies/${encodeURIComponent(S)}/events/ws`),ae=C8(ce);if(!ae){oe(),$();return}Y=ae,ae.onopen=()=>{if(L||Y!==ae){Yw(ae,"stale_connection");return}me(),_>0&&(h.current.suppressUntil=Date.now()+mK),d.invalidateQueries({type:"active"},{cancelRefetch:!1}),_=0},ae.onmessage=Ce=>{if(!cf().visible)return;const ue=typeof Ce.data=="string"?Ce.data:"";if(ue)try{const we=JSON.parse(ue);if(eq(z,S,g.current,we,m,h.current,{userId:R.current.userId,agentId:R.current.agentId},B),vK(E.current,S,we),we.type==="notification.created"){const Ae=cK(we.payload);Ae&&lK(Ae,R.current.userId)}}catch{}},ae.onerror=()=>{},ae.onclose=()=>{Y===ae&&(Y=null,!L&&(oe(),$()))}},"connect"),te=window.setTimeout(T,0);return()=>{L=!0,window.clearTimeout(te),se(),me();const ce=Y;Y=null,Yw(ce,"provider_unmount")}},[t,O,B,d,z,S,m,D,N]),(0,a.jsx)(rA.Provider,{value:I,children:e})}r(aq,"LiveUpdatesProvider");function sq(e){let t=Hr();Uw(t),Ag(t,e.userId);const i=eA(()=>{const d=Hr();d!==t&&(t=d,Uw(d),Ag(d,e.userId))}),l=typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:null,c=r(d=>{const m=uK(d.data);m&&(m.type==="navigate"?e.navigate(m.url):oK(m.notification))},"onMessage");return l?.addEventListener("message",c),l?.startMessages(),()=>{i(),l?.removeEventListener("message",c)}}r(sq,"startNotificationRuntime");function iq(){const e=xa(),t=(0,b.useRef)(e),{data:i}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),retry:!1}),l=i?.user?.id??i?.session?.userId??null;return(0,b.useEffect)(()=>{t.current=e},[e]),(0,b.useEffect)(()=>{if(l)return sq({userId:l,navigate:r(c=>t.current(c),"navigate")})},[l]),null}r(iq,"NotificationRuntime");var rq=36e5,lq=3e3,oq=2e3,Xw="wardmote.skip-waiting",cq="wardmote.build-id",dA=null,Eg=new Set;function uq(e){dA=e;for(const t of Eg)t()}r(uq,"publishUpdate");function dq(e){return Eg.add(e),()=>{Eg.delete(e)}}r(dq,"subscribe");function fq(){return(0,b.useSyncExternalStore)(dq,()=>dA,()=>null)}r(fq,"useServiceWorkerUpdate");function mq(e){return new Promise(t=>{const i=new MessageChannel,l=r(d=>{clearTimeout(c),i.port1.close(),t(d)},"finish"),c=setTimeout(()=>l(null),oq);i.port1.onmessage=d=>{l(typeof d.data?.buildId=="string"?d.data.buildId:null)},e.postMessage({type:cq},[i.port2])})}r(mq,"requestWorkerBuildId");function pq(e={}){const t=e.container??(typeof navigator<"u"&&"serviceWorker"in navigator?navigator.serviceWorker:void 0);if(!t)return()=>{};const i=e.documentRef??document,l=e.reload??(()=>window.location.reload()),c=e.updateIntervalMs??rq,d=e.onUpdateReady??uq;let m=!!t.controller,f=!1,h=!1,g,v=!1;const y=r(async I=>e.pageBuildId?await mq(I)!==e.pageBuildId:!0,"servesNewerBuild"),j=r(()=>{h||(h=!0,g!==void 0&&clearTimeout(g),l())},"reloadOnce"),k=r(async I=>{const O=await y(I);if(!v){if(!O){I.postMessage({type:Xw});return}d(()=>{f=!0,I.postMessage({type:Xw}),g=setTimeout(j,lq)})}},"offerWaiting"),N=r(()=>{if(!m){m=!0;return}if(f){j();return}const I=t.controller;I&&y(I).then(O=>{O&&!v&&!f&&d(j)})},"onControllerChange");t.addEventListener("controllerchange",N);let S;const D=r(()=>{const I=S?.installing;I&&I.addEventListener("statechange",()=>{I.state==="installed"&&t.controller&&k(I)})},"watchInstalling"),R=r(()=>{S?.update().catch(()=>{})},"checkForUpdates"),E=r(()=>{i.visibilityState==="visible"&&R()},"onVisibilityChange");i.addEventListener("visibilitychange",E);const C=setInterval(R,c);return t.register("/sw.js").then(I=>{S=I,I.waiting&&t.controller&&k(I.waiting),I.addEventListener("updatefound",D)}).catch(()=>{}),()=>{v=!0,t.removeEventListener("controllerchange",N),i.removeEventListener("visibilitychange",E),S?.removeEventListener("updatefound",D),clearInterval(C),g!==void 0&&clearTimeout(g)}}r(pq,"startServiceWorkerUpdates");var fA="wardmote.notifications.asked-after-decision";function hq(){try{return window.localStorage.getItem(fA)==="1"}catch{return!0}}r(hq,"alreadyAsked");function gq(){try{window.localStorage.setItem(fA,"1")}catch{return}}r(gq,"markAsked");async function xq(e){const t=await E8();if(t!=="granted")return t;const i=JC(l=>({...l,enabled:!0,pushEnabled:!0}));return e&&await Ag(i,e),t}r(xq,"enableNotificationsAfterDecision");function bq(){const{pushToast:e}=Si(),{data:t}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),retry:!1}),i=t?.user?.id??t?.session?.userId??null;(0,b.useEffect)(()=>z_(()=>{hq()||!q0()||F0()!=="default"||(gq(),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(()=>{xq(i)},"onClick")}}))}),[e,i])}r(bq,"useFirstDecisionNotificationPrompt");var vq="wardmote-update-ready";function yq(){const{pushToast:e}=Si(),t=fq(),i=Rn(),l=Bg(),c=(0,b.useRef)(l);return(0,b.useEffect)(()=>{t&&e({id:vq,title:"A new version is ready.",tone:"info",persistent:!0,action:{label:"Reload",onClick:t}})},[t,e]),(0,b.useEffect)(()=>{if(l){c.current=!0;return}c.current&&(c.current=!1,i.invalidateQueries())},[l,i]),bq(),null}r(yq,"PwaRuntime");var mA={get:r(e=>Re.get(`/companies/${e}/primary-agent/me`),"get"),set:r((e,t)=>Re.put(`/companies/${e}/primary-agent/me`,t),"set")};function jq(e){const t=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn")}),i=t.data?.user?.id??t.data?.session?.userId??"local-board",l=be({queryKey:P.primaryAgent.mine(e??"__none__",i),queryFn:r(()=>mA.get(e),"queryFn"),enabled:!!e&&t.isSuccess});return{...l,userId:i,loading:!!e&&(t.isPending||l.isPending&&!t.error),error:t.error??l.error,retry:r(()=>t.isError?t.refetch():l.refetch(),"retry")}}r(jq,"usePrimaryAgent");function wq({children:e}){const{selectedCompanyId:t}=bt(),i=jq(t),l=Rn(),{pushToast:c}=Si(),d=(0,b.useRef)({companyId:t,userId:i.userId});d.current={companyId:t,userId:i.userId};const m=r(j=>P.primaryAgent.mine(j.companyId,j.userId),"keyFor"),f=r(j=>j.companyId===d.current.companyId&&j.userId===d.current.userId,"isCurrentScope"),h=be({queryKey:P.agents.list(t),queryFn:r(()=>Pa.list(t),"queryFn"),enabled:!!t}),g=bn({mutationFn:r(j=>mA.set(j.companyId,{primaryAgentId:j.agentId}),"mutationFn"),onMutate:r(async j=>{const k=m(j);await l.cancelQueries({queryKey:k});const N=l.getQueryData(k);return l.setQueryData(k,{companyId:j.companyId,userId:j.userId,primaryAgentId:j.agentId,initialized:!0}),{previous:N}},"onMutate"),onError:r((j,k,N)=>{l.setQueryData(m(k),N?.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(m(k),j),"onSuccess"),onSettled:r((j,k,N)=>{l.invalidateQueries({queryKey:m(N)}),l.invalidateQueries({queryKey:P.resourceMemberships.mine(N.companyId)})},"onSettled")}),v=h.data?.find(j=>j.id===i.data?.primaryAgentId&&j.status!=="terminated")??null,y=i.error??h.error;return(0,a.jsx)(lM,{value:t?{companyId:t,primaryAgentId:v?.id??null,primaryAgent:v,loading:i.loading||h.isPending,error:y?.message,onRetry:r(()=>{i.retry(),h.refetch()},"onRetry"),pendingAgentId:g.isPending&&f(g.variables)?g.variables.agentId:null,onChange:r(j=>g.mutate({companyId:t,userId:i.userId,agentId:j}),"onChange")}:null,children:e})}r(wq,"PrimaryAgentProvider");var Zw="min-h-9",kq={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 FW(e,t){const i={name:"",path:"",kind:"dir",children:[]};for(const c of Object.keys(e)){const d=c.split("/").filter(Boolean);let m=i,f="";for(let h=0;h<d.length;h++){const g=d[h];f=f?`${f}/${g}`:g;const v=h===d.length-1;let y=m.children.find(j=>j.name===g);y||(y={name:g,path:f,kind:v?"file":"dir",children:[],action:v?t?.get(c)??null:null},m.children.push(y)),m=y}}function l(c){c.children.sort((d,m)=>d.kind!==m.kind?d.kind==="file"?-1:1:d.name.localeCompare(m.name)),c.children.forEach(l)}return r(l,"sortNode"),l(i),i.children}r(FW,"buildFileTree");function Sq(e){let t=0;for(const i of e)i.kind==="file"?t++:t+=Sq(i.children);return t}r(Sq,"countFiles");function pA(e,t="all"){const i=new Set;for(const l of e){(t==="all"||l.kind===t)&&i.add(l.path);for(const c of pA(l.children,t))i.add(c)}return i}r(pA,"collectAllPaths");function Nq(e){return e.endsWith(".yaml")||e.endsWith(".yml")?Zk:Jk}r(Nq,"fileIcon");function hA(e,t,i=0){const l=[];for(const c of e)l.push({node:c,depth:i}),c.kind==="dir"&&t.has(c.path)&&l.push(...hA(c.children,t,i+1));return l}r(hA,"flattenVisibleNodes");function Cq(e,t){if(e.kind==="file")return{allChecked:t.has(e.path),someChecked:!1};const i=[...pA(e.children,"file")],l=i.length>0&&i.every(c=>t.has(c));return{allChecked:l,someChecked:i.some(c=>t.has(c))&&!l}}r(Cq,"checkboxState");function HW(e){const t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return null;const i={},l=t[1],c=t[2];let d=null,m=null;for(const f of l.split(`
|
|
55
|
+
`)){const h=f.trim();if(!h||h.startsWith("#"))continue;if(h.startsWith("- ")&&d){m||(m=[]),m.push(h.slice(2).trim().replace(/^["']|["']$/g,""));continue}d&&m&&(i[d]=m,m=null,d=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"){d=null;continue}y?(i[v]=y,d=null):d=v}}return d&&m&&(i[d]=m),Object.keys(i).length>0?{data:i,body:c}:null}r(HW,"parseFrontmatter");var VW={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 Aq({nodes:e,selectedFile:t,expandedDirs:i,checkedFiles:l,onToggleDir:c,onSelectFile:d,onToggleCheck:m,fileBadges:f,fileTones:h,renderFileExtra:g,renderLabel:v,checkboxLabel:y,getCheckboxState:j,renderNodeExtra:k,visiblePaths:N,disabled:S=!1,fileRowClassName:D,layout:R="default",showCheckboxes:E=!0,wrapLabels:C=!0,loading:I=!1,error:O,empty:z,ariaLabel:B="Files"}){const L=l??new Set,_=(0,b.useMemo)(()=>hA(e,i).filter(({node:T})=>!N||N.has(T.path)),[i,e,N]),[U,F]=(0,b.useState)(null),Y=(0,b.useRef)(new Map),se=_.some(({node:T})=>T.path===U)?U:_[0]?.node.path;function me(T){F(T),window.requestAnimationFrame(()=>{Y.current.get(T)?.focus()})}r(me,"focusPath");function oe(T){S||(T.kind==="dir"?c(T.path):d(T.path))}r(oe,"toggleNode");function $(T,te,ce){if(!S)switch(T.key){case"ArrowDown":{T.preventDefault();const ae=_[Math.min(te+1,_.length-1)];ae&&me(ae.node.path);break}case"ArrowUp":{T.preventDefault();const ae=_[Math.max(te-1,0)];ae&&me(ae.node.path);break}case"ArrowRight":ce.kind==="dir"&&!i.has(ce.path)&&(T.preventDefault(),c(ce.path));break;case"ArrowLeft":ce.kind==="dir"&&i.has(ce.path)&&(T.preventDefault(),c(ce.path));break;case"Enter":T.preventDefault(),oe(ce);break;case" ":E&&m&&j?.(ce)!==null&&(T.preventDefault(),m(ce.path,ce.kind))}}return r($,"handleRowKeyDown"),I?(0,a.jsx)("div",{"aria-busy":"true","aria-label":B,role:"tree",className:"py-1",children:[0,1,2,3].map(T=>(0,a.jsxs)("div",{className:G("flex items-center gap-2 px-4",Zw),children:[(0,a.jsx)(ct,{className:"h-4 w-4 shrink-0 rounded-sm"}),(0,a.jsx)(ct,{className:G("h-3.5",T===1?"w-3/5":"w-4/5")})]},T))}):O?(0,a.jsx)("div",{"aria-label":B,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)(Bn,{variant:"ghost",className:G("px-2.5",Nd.error??"bg-bg-3 text-ink-3"),children:"error"}),(0,a.jsx)("span",{className:"min-w-0 text-bad",children:O.message})]}),O.retry&&(0,a.jsx)(pe,{type:"button",size:"xs",variant:"secondary",onClick:O.retry,children:"Retry"})]})}):_.length===0?(0,a.jsx)("div",{"aria-label":B,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:z?.title??"No files"}),(0,a.jsx)("div",{className:"mt-1 text-xs text-ink-3",children:z?.description??"Files will appear here when they are available."})]})}):(0,a.jsx)("div",{"aria-label":B,role:"tree",children:_.map(({node:T,depth:te},ce)=>{const ae=T.kind==="dir"&&i.has(T.path),Ce=j?.(T),ue=E&&Ce!==null,{allChecked:we,someChecked:Ae}=Ce==null?Cq(T,L):{allChecked:Ce==="checked",someChecked:Ce==="mixed"},je=f?.[T.path],he=h?.[T.path]??"default",Te=T.kind==="file"?D?.(T,we):void 0,Ve=T.kind==="file"?Nq(T.name):null,De=T.kind==="file"&&T.path===t;return(0,a.jsxs)("div",{ref:r(Se=>{Se?Y.current.set(T.path,Se):Y.current.delete(T.path)},"ref"),role:"treeitem","aria-level":te+1,"aria-expanded":T.kind==="dir"?ae:void 0,"aria-selected":T.kind==="file"?De:void 0,"aria-checked":ue?Ae?"mixed":we:void 0,"aria-disabled":S||void 0,tabIndex:se===T.path?0:-1,className:G(R==="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":T.kind==="dir"?E?"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",R==="explorer"?"h-8":Zw,R==="explorer"&&"file-tree-row-explorer",De&&"text-ink bg-bg-3/20",kq[he],Te,S&&"opacity-50","file-tree-row","outline-none focus-visible:ring-2 focus-visible:ring-focus/50 focus-visible:ring-inset"),style:{"--file-tree-depth":te},onFocus:r(()=>F(T.path),"onFocus"),onClick:r(()=>oe(T),"onClick"),onKeyDown:r(Se=>$(Se,ce,T),"onKeyDown"),"data-file-tree-path":T.path,children:[R==="explorer"&&(T.kind==="dir"?(0,a.jsx)("button",{type:"button",disabled:S,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(Se=>{Se.stopPropagation(),c(T.path)},"onClick"),"aria-label":ae?`Collapse ${T.name}`:`Expand ${T.name}`,children:ae?(0,a.jsx)($r,{className:"size-3.5"}):(0,a.jsx)(tr,{className:"size-3.5"})}):(0,a.jsx)("span",{className:"size-4 shrink-0","aria-hidden":"true"})),ue?(0,a.jsx)("label",{className:G("flex items-center",R==="explorer"?"size-4 shrink-0 justify-center":"pl-2"),onClick:r(Se=>Se.stopPropagation(),"onClick"),children:(0,a.jsx)("input",{type:"checkbox","aria-label":y?.(T)??`Select ${T.path}`,disabled:S,checked:we,ref:r(Se=>{Se&&(Se.indeterminate=Ae)},"ref"),onChange:r(()=>m?.(T.path,T.kind),"onChange"),className:R==="explorer"?"size-3.5 shrink-0 accent-ink":"mr-2 accent-ink"})}):E&&R==="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:T.kind==="dir"?ae?(0,a.jsx)(eS,{className:"h-3.5 w-3.5"}):(0,a.jsx)(bi,{className:"h-3.5 w-3.5"}):Ve?(0,a.jsx)(Ve,{className:"h-3.5 w-3.5"}):null}),(0,a.jsx)("span",{className:G("min-w-0",R==="explorer"&&"flex-1",C?"break-all leading-4":"truncate"),children:v?v(T):T.name})]}),je&&(0,a.jsx)(Bn,{variant:"ghost",className:G("ml-3 text-(length:--text-nano) uppercase tracking-wide",Nd[je.status]??"bg-bg-3 text-ink-3"),title:je.tooltip,children:je.label}),k?.(T),T.kind==="file"&&g?.(T,we),T.kind==="dir"&&R==="default"&&(0,a.jsx)("button",{type:"button",disabled:S,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(Se=>{Se.stopPropagation(),c(T.path)},"onClick"),"aria-label":ae?`Collapse ${T.name}`:`Expand ${T.name}`,children:ae?(0,a.jsx)($r,{className:"h-3.5 w-3.5"}):(0,a.jsx)(tr,{className:"h-3.5 w-3.5"})})]},T.path)})})}r(Aq,"FileTree");function _q(e,t){return e.visible?e.focused?t.visibleMs:t.unfocusedMs??t.visibleMs:t.hiddenMs??!1}r(_q,"resolvePollingInterval");function Eq(e,t){if(e<=0)return 0;const i=Math.min(Math.max(t(),0),.999999);return Math.round(i*e)}r(Eq,"computeStartupJitterMs");function Iq(e){const t=yk(),i=(0,b.useRef)(null);i.current===null&&(e.jitter===!1?i.current=0:i.current=Eq(Math.min(e.jitterMaxMs??1e3,Math.round(e.visibleMs*.2)),Math.random));const l=i.current;return(0,b.useMemo)(()=>{const c=_q(t,e);return c===!1?!1:c+l},[t,e.visibleMs,e.unfocusedMs,e.hiddenMs,l])}r(Iq,"useVisibilityRefetchInterval");var gA={listForIssue:r(e=>Re.get(`/issues/${e}/external-objects`),"listForIssue"),getIssueSummary:r(e=>Re.get(`/issues/${e}/external-object-summary`),"getIssueSummary"),getIssueSummaries:r((e,t)=>Re.post(`/companies/${e}/issues/external-object-summaries`,{issueIds:t}),"getIssueSummaries"),refreshIssueObjects:r((e,t)=>Re.post(`/issues/${e}/external-objects/refresh`,t??{}),"refreshIssueObjects"),getProjectSummary:r(e=>Re.get(`/projects/${e}/external-object-summary`),"getProjectSummary")};async function Tq(e,t){const i={};for(let l=0;l<t.length;l+=500){const c=t.slice(l,l+500),d=await gA.getIssueSummaries(e,c);Object.assign(i,d.summaries)}return{summaries:i}}r(Tq,"fetchIssueExternalObjectSummariesInBatches");function Rq(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(Rq,"formatMentionSourceLabel");function xA(){const e=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn"),retry:!1});return{isEnabled:e.data?.enableExternalObjects===!0,isLoaded:e.data!==void 0||e.isError}}r(xA,"useExternalObjectsFeature");function QW(e){const t=xA(),i=t.isEnabled&&!!e,l=be({queryKey:P.externalObjects.byIssue(e??"__none__"),queryFn:r(()=>gA.listForIssue(e),"queryFn"),enabled:i,staleTime:6e4}),c=(0,b.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(Rq)));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]),d=(0,b.useMemo)(()=>{const f={};for(const{group:h}of c){const g=h.object;if(!g)continue;const v=gy(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=gy(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]),m=(0,b.useCallback)(()=>{l.refetch()},[l.refetch]);return{isEnabled:t.isEnabled,groups:c,markdownReferences:d,isLoading:i&&l.isLoading,isError:l.isError,refetch:m}}r(QW,"useIssueExternalObjects");function Dq(e,t){const i=xA(),l=(0,b.useMemo)(()=>[...new Set(t.filter(m=>m.length>0))].sort(),[t]),c=i.isEnabled&&!!e&&l.length>0,d=be({queryKey:P.externalObjects.issueSummaries(e??"__none__",l),queryFn:r(()=>Tq(e,l),"queryFn"),enabled:c,staleTime:6e4});return{summaries:(0,b.useMemo)(()=>new Map(Object.entries(d.data?.summaries??{})),[d.data?.summaries]),isLoading:c&&d.isLoading,isReady:i.isLoaded&&(!c||d.isSuccess)}}r(Dq,"useIssueExternalObjectSummaries");var WW={relevance:"Relevance",updated:"Recently updated",created:"Newest created",priority:"Priority"},Mq={"24h":"Last 24 hours","7d":"Last 7 days","30d":"Last 30 days","90d":"Last 90 days"};function bA(e){return Mq[e]??`Updated ≤ ${e}`}r(bA,"updatedWithinLabel");var Oq=new Set(p_);function GW(e){const t=e.get("sort");return t&&Oq.has(t)?t:"relevance"}r(GW,"parseSearchSort");function YW(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(YW,"countActiveFilters");function XW(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(XW,"assigneeToken");function ZW(e,t,i){const l={...e};return delete l.assigneeAgentId,delete l.assigneeUserId,t&&(t==="none"?l.assigneeAgentId=null:t==="me"?i&&(l.assigneeUserId=i):t.startsWith("agent:")?l.assigneeAgentId=t.slice(6):t.startsWith("user:")&&(l.assigneeUserId=t.slice(5))),l}r(ZW,"applyAssigneeToken");function lc(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(lc,"humanize$1");function Lq(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(Lq,"assigneeChipLabel");function JW(e,t){const i=[];for(const l of e.status??[])i.push({id:`status:${l}`,label:`Status: ${lc(l)}`,remove:r(c=>{const d={...c},m=(c.status??[]).filter(f=>f!==l);return m.length>0?d.status=m:delete d.status,d},"remove")});for(const l of e.priority??[])i.push({id:`priority:${l}`,label:`Priority: ${lc(l)}`,remove:r(c=>{const d={...c},m=(c.priority??[]).filter(f=>f!==l);return m.length>0?d.priority=m:delete d.priority,d},"remove")});return(e.assigneeAgentId!==void 0||e.assigneeUserId)&&i.push({id:"assignee",label:`Assignee: ${Lq(e,t)}`,remove:r(l=>{const c={...l};return delete c.assigneeAgentId,delete c.assigneeUserId,c},"remove")}),e.projectId&&i.push({id:"project",label:`Project: ${t.projectName(e.projectId)??"Project"}`,remove:r(l=>{const c={...l};return delete c.projectId,c},"remove")}),e.labelId&&i.push({id:"label",label:`Label: ${t.labelName(e.labelId)??"Label"}`,remove:r(l=>{const c={...l};return delete c.labelId,c},"remove")}),e.updatedWithin&&i.push({id:"updated",label:`Updated: ${bA(e.updatedWithin)}`,remove:r(l=>{const c={...l};return delete c.updatedWithin,delete c.updatedAfter,c},"remove")}),i}r(JW,"buildFilterChips");function eG(e,t,i){switch(e){case"status":return`Status: ${t.map(lc).join(", ")}`;case"priority":return`Priority: ${t.map(lc).join(", ")}`;case"assigneeAgentId":return`Assignee: ${t.map(l=>i.agentName(l)??"Agent").join(", ")}`;case"assigneeUserId":return`Assignee: ${t.map(l=>l===i.currentUserId?"Me":i.userName(l)??"User").join(", ")}`;case"projectId":return`Project: ${t.map(l=>i.projectName(l)??"Project").join(", ")}`;case"labelId":return`Label: ${t.map(l=>i.labelName(l)??"Label").join(", ")}`;case"updatedWithin":case"updatedAfter":return"Updated window";default:return lc(e)}}r(eG,"describeLoosenSuggestion");function tG(e,t){const i={...e};switch(t){case"status":delete i.status;break;case"priority":delete i.priority;break;case"assigneeAgentId":case"assigneeUserId":delete i.assigneeAgentId,delete i.assigneeUserId;break;case"projectId":delete i.projectId;break;case"labelId":delete i.labelId;break;case"updatedWithin":case"updatedAfter":delete i.updatedWithin,delete i.updatedAfter}return i}r(tG,"clearFilterDimension");var zq='Search title, ID, description… (pick a field or type "exact phrase")';function Jw(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(Jw,"humanize");function wh(e,t,i,l=""){const c=t?t.kind==="text"&&i.trim()?zr(t.key,i):"":i;return[...e,l,c].filter(d=>d.trim().length>0).join(" ")}r(wh,"composeRaw");function Pq(e,t){typeof e=="function"?e(t):e&&(e.current=t)}r(Pq,"assignRef");function ek(e,t,i){const l=!!(t.currentUserId||t.currentAgentId);switch(e){case"status":return[...kc.map(c=>({id:c,label:Jw(c),token:`status:${c}`})),...i.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 Pg.map(c=>({id:c,label:Jw(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:zr("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:zr("author",c.name)}))];case"label":return(t.labels??[]).map(c=>({id:c.id,label:c.name,token:zr("label",c.name)}));case"project":return(t.projects??[]).map(c=>({id:c.id,label:c.name,token:zr("project",c.name)}));case"updated":return hk.map(c=>({id:c,label:bA(c),token:`updated:>${c}`}));default:return[]}}r(ek,"pickerOptions");function Uq(e,t){if(!t)return e;const i=[],l=[];for(const c of e){const d=c.label.toLowerCase();d.startsWith(t)||c.id.toLowerCase().startsWith(t)?i.push(c):d.includes(t)&&l.push(c)}return[...i,...l]}r(Uq,"rankOptions");function $q({value:e,onChange:t,context:i={},operatorKeys:l=rC,debounceMs:c=250,placeholder:d=zq,ariaLabel:m="Search",className:f,fieldClassName:h,inputClassName:g,clearOnEscape:v=!1,inputRef:y,autoFocus:j,pageSearchTarget:k,trailing:N,onKeyDown:S}){const D=(0,b.useId)(),R=(0,b.useRef)(null),[E,C]=(0,b.useState)(()=>Wo(e,l).tokens),[I,O]=(0,b.useState)(()=>Wo(e,l).text),[z,B]=(0,b.useState)(null),[L,_]=(0,b.useState)(""),[U,F]=(0,b.useState)(!1),[Y,se]=(0,b.useState)(-1),me=(0,b.useRef)(e),oe=(0,b.useRef)(i);oe.current=i;const $=(0,b.useRef)(t);$.current=t;const T=(0,b.useRef)(l);T.current=l;const te=(0,b.useMemo)(()=>ez.filter(le=>le.kind==="text"||l.includes(le.key)),[l]),ce=wh(E,z,I,z?L:"");(0,b.useEffect)(()=>{if(e===me.current)return;me.current=e;const le=Wo(e,T.current);C(le.tokens),O(le.text),B(null),_("")},[e]);const ae=(0,b.useCallback)(le=>{me.current=le;const Ue=Fl(le,{...oe.current,operatorKeys:T.current}),Fe={raw:le,q:Ue.query,filters:Ue.filters};c<=0?$.current(Fe):(0,b.startTransition)(()=>$.current(Fe))},[c]);(0,b.useEffect)(()=>{if(ce===me.current)return;if(c<=0){ae(ce);return}const le=window.setTimeout(()=>{ce!==me.current&&ae(ce)},c);return()=>window.clearTimeout(le)},[c,ae,ce]);const Ce=(0,b.useCallback)(le=>te.find(Ue=>Ue.key===le.toLowerCase())??null,[te]),ue=(0,b.useMemo)(()=>{if(z){if(z.kind==="text")return[];const Fe=I.trim().replace(/"/g,"").toLowerCase();return Uq(ek(z.key,i,l),Fe)}const{token:le}=eh(I);if(le.includes(":")||le.startsWith('"'))return[];const Ue=le.toLowerCase();return te.filter(Fe=>!Ue||Fe.key.startsWith(Ue)||Fe.label.toLowerCase().startsWith(Ue)).map(Fe=>({id:Fe.key,label:Fe.label,description:Fe.description,field:Fe}))},[i,I,te,l,z]),we=U&&ue.length>0;(0,b.useEffect)(()=>{se(z&&z.kind==="picker"?0:-1)},[z,I]);const Ae=r(()=>R.current?.focus(),"focusInput"),je=r((le,Ue)=>{_(Ue.trim()),B(le),O(""),F(!0),Ae()},"startField"),he=r(()=>{B(null),O(L?`${L} `:""),_("")},"releaseHeldText"),Te=r((le,Ue=!0)=>{C(Fe=>[...Fe,le]),he(),F(Ue),Ae()},"commitToken"),Ve=r((le,Ue=!0)=>{if(le.field){je(le.field,I.slice(0,eh(I).start));return}le.token&&Te(le.token,Ue)},"selectOption"),De=r(le=>{const Ue=/\s$/.test(le);if(Ue&&F(!0),z){O(le);return}const{start:Fe,token:it}=eh(le),Vt=/^([a-zA-Z]+):$/.exec(it),Qt=Vt?Ce(Vt[1]):null;if(Qt){je(Qt,le.slice(0,Fe));return}const V=Wo(le,l,!Ue);if(V.tokens.length>0){C(Ct=>[...Ct,...V.tokens]),O(V.text&&Ue?`${V.text} `:V.text);return}O(le)},"handleDraftChange"),Se=r(le=>{C(Ue=>Ue.filter((Fe,it)=>it!==le)),Ae()},"removeToken"),ut=r(()=>{if(!z)return!1;const le=I.trim();if(!le)return!1;if(z.kind==="text")return Te(zr(z.key,le)),!0;const Ue=le.toLowerCase(),Fe=ek(z.key,i,l).find(it=>it.label.toLowerCase()===Ue||it.id.toLowerCase()===Ue)??(we&&Y>=0?ue[Y]:void 0)??(ue.length===1?ue[0]:void 0);return Fe?.token?(Te(Fe.token),!0):!1},"commitPendingDraft"),wt=r(le=>{const Ue=le.nativeEvent.isComposing;if(!Ue&&le.key==="Tab"&&!le.shiftKey&&(z||we)){if(le.preventDefault(),ut())return;if(!z&&we&&Y>=0&&ue[Y]){Ve(ue[Y]);return}z||F(!1);return}if(!Ue&&le.key==="ArrowDown"){if(le.preventDefault(),!U){F(!0);return}ue.length>0&&se(Fe=>(Fe+1)%ue.length);return}if(!Ue&&le.key==="ArrowUp"&&we){le.preventDefault(),se(Fe=>Fe<=0?ue.length-1:Fe-1);return}if(!Ue&&le.key==="Enter"){if(we&&Y>=0&&ue[Y]){le.preventDefault(),Ve(ue[Y],!1);return}let Fe=ce;if(z?.kind==="text"&&I.trim()){const it=zr(z.key,I.trim());Te(it,!1),Fe=wh([...E,it],null,L)}else if(!z){const it=Wo(I,l);it.tokens.length>0&&(C([...E,...it.tokens]),O(it.text),Fe=wh([...E,...it.tokens],null,it.text))}Fe!==me.current&&ae(Fe),F(!1)}if(!Ue&&le.key==="Escape"&&we&&(F(!1),I.length>0||z)){le.preventDefault();return}if(!Ue&&le.key==="Escape"&&v&&ce.length>0){le.preventDefault(),C([]),B(null),_(""),O(""),me.current="",$.current({raw:"",q:"",filters:{}});return}if(!Ue&&le.key==="Backspace"&&le.currentTarget.selectionStart===0&&le.currentTarget.selectionEnd===0){if(z){le.preventDefault(),he();return}if(E.length>0){le.preventDefault(),C(Fe=>Fe.slice(0,-1));return}}S?.(le)},"handleKeyDown"),kt=E.map(le=>sz(le,i)),$t=z?z.kind==="text"?`${z.label}: type text, Tab or Enter to add`:`Pick ${z.label.toLowerCase()}…`:E.length>0?"":d;return(0,a.jsxs)("div",{className:G("relative",f),"data-testid":"scoped-search",children:[(0,a.jsxs)("div",{className:G("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(le=>{le.target===le.currentTarget&&(le.preventDefault(),Ae())},"onMouseDown"),children:[(0,a.jsx)(Br,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ink-3"}),kt.map((le,Ue)=>(0,a.jsxs)(Bn,{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:le.label}),(0,a.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg/60","aria-label":`Remove ${le.label}`,onMouseDown:r(Fe=>Fe.preventDefault(),"onMouseDown"),onClick:r(()=>Se(Ue),"onClick"),children:(0,a.jsx)(ia,{className:"h-3 w-3"})})]},`${E[Ue]}:${Ue}`)),z?(0,a.jsxs)(Bn,{variant:"outline",className:"gap-1 pr-0.5 font-normal","data-testid":"scoped-search-pending-field",children:[(0,a.jsxs)("span",{children:[z.key,":"]}),(0,a.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg-3","aria-label":`Remove ${z.label} field`,onMouseDown:r(le=>le.preventDefault(),"onMouseDown"),onClick:r(()=>{he(),Ae()},"onClick"),children:(0,a.jsx)(ia,{className:"h-3 w-3"})})]}):null,(0,a.jsx)("input",{ref:r(le=>{R.current=le,Pq(y,le)},"ref"),role:"combobox","aria-label":m,"aria-expanded":we,"aria-controls":D,"aria-autocomplete":"list","aria-activedescendant":we&&Y>=0?`${D}-${Y}`:void 0,autoFocus:j,value:I,placeholder:$t,"data-page-search-target":k?"true":void 0,className:G("h-full min-w-24 flex-1 bg-transparent text-base outline-none placeholder:text-ink-3 md:text-sm",g),onChange:r(le=>De(le.target.value),"onChange"),onFocus:r(()=>F(!0),"onFocus"),onBlur:r(()=>F(!1),"onBlur"),onKeyDown:wt}),N]}),we?(0,a.jsx)("div",{id:D,role:"listbox","aria-label":z?`${z.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:ue.map((le,Ue)=>(0,a.jsxs)("div",{id:`${D}-${Ue}`,role:"option","aria-selected":Ue===Y,className:G("flex cursor-pointer items-center justify-between gap-3 rounded-sm px-2 py-1.5 text-sm",Ue===Y?"bg-bg-3 text-ink":"hover:bg-bg-3/50"),onMouseDown:r(Fe=>Fe.preventDefault(),"onMouseDown"),onMouseEnter:r(()=>se(Ue),"onMouseEnter"),onClick:r(()=>Ve(le),"onClick"),children:[(0,a.jsx)("span",{className:"truncate",children:le.label}),le.description?(0,a.jsx)("span",{className:"hidden truncate text-xs text-ink-3 sm:inline",children:le.description}):null]},le.id))}):null]})}r($q,"ScopedSearchInput");function vA(e){if(e.length<=1)return[...e];const t=r((v,y)=>{const j=tk(v.createdAt),k=tk(y.createdAt);return j!==k?j-k:v.id<y.id?-1:v.id>y.id?1:0},"tieBreakAsc"),i=new Map;for(const v of e)i.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||!i.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(i.get(y),i.get(j)));const d=[];for(const v of e)c.get(v.id)===0&&d.push(v);d.sort(t);const m=new Set,f=[],h=r(v=>{let y=0,j=d.length;for(;y<j;){const k=y+j>>>1;t(d[k],v)<=0?y=k+1:j=k}d.splice(y,0,v)},"insertReady"),g=r(v=>{for(const y of l.get(v)??[]){if(m.has(y))continue;const j=(c.get(y)??0)-1;if(c.set(y,j),j===0){const k=i.get(y);k&&h(k)}}},"releaseSuccessors");for(;d.length>0;){let v=d.shift();for(;v&&!m.has(v.id);){f.push(v),m.add(v.id),g(v.id);const y=l.get(v.id)??[];if(y.length!==1)break;const j=y[0];if(m.has(j)||(c.get(j)??0)!==0)break;const k=d.findIndex(N=>N.id===j);if(k<0)break;[v]=d.splice(k,1)}}return m.size<e.length?[...e].sort(t):f}r(vA,"workflowSort");function tk(e){if(!e)return 0;const t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isFinite(t)?t:0}r(tk,"toTimestamp");var Bq=2;function Kq(e,t){return e===!0&&t>=Bq}r(Kq,"shouldRenderSubIssueProgressSummary");function qq(e){const t={},i=e.filter(f=>f.status!=="cancelled");for(const f of i)t[f.status]=(t[f.status]??0)+1;const l=vA(i),c=l.find(f=>Fq(f.status))??null,d=l.filter(f=>!Hq(f.status)),m=c===null&&d.length>0&&d.every(f=>f.status==="blocked")?d[0]:null;return{totalCount:i.length,doneCount:t.done??0,inProgressCount:t.in_progress??0,blockedCount:t.blocked??0,countsByStatus:t,target:c?{issue:c,kind:"next"}:m?{issue:m,kind:"blocked"}:null}}r(qq,"buildSubIssueProgressSummary");function Fq(e){return e!=="done"&&e!=="cancelled"&&e!=="blocked"}r(Fq,"isActionableStatus");function Hq(e){return e==="done"||e==="cancelled"}r(Hq,"isTerminalStatus");function Tl(e,t){const i={};for(const l of e){const c=t(l);i[c]||(i[c]=[]),i[c].push(l)}return i}r(Tl,"groupBy");function Vq(e){return e==="queued"||e==="running"}r(Vq,"isLiveRunStatus");var Qq=new Set(["done","cancelled"]);function Ig(e){return Qq.has(e)}r(Ig,"isTerminalIssueStatus");function yA(e,t){return Vq(e.status)&&!Ig(t)}r(yA,"isLiveIssueRun");function Wq(e){const t=new Map;for(const i of e??[]){const l={status:i.status,updatedAtMs:Gq(i.updatedAt)},c=t.get(i.id);(!c||Yq(c,l))&&t.set(i.id,l)}return new Map([...t].map(([i,l])=>[i,l.status]))}r(Wq,"collectIssueStatusById");function Gq(e){if(e==null)return null;const t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isFinite(t)?t:null}r(Gq,"issueUpdatedAtMs");function Yq(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!Ig(e.status)&&Ig(t.status)}r(Yq,"shouldReplaceIssueStatusSnapshot");function Xq(e,t){const i=new Set,l=Wq(t);for(const c of e??[])c.issueId&&yA(c,l.get(c.issueId))&&i.add(c.issueId);return i}r(Xq,"collectLiveIssueIds");function jA(e,t){const i=new Map;if(!e||e.length===0||t.size===0)return i;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 d=new Set([c]);let m=l.get(c)??null;for(;m&&!d.has(m);)d.add(m),i.set(m,(i.get(m)??0)+1),m=l.get(m)??null}return i}r(jA,"collectSubtreeLiveCounts");var Zq=["assignee","kickedOffBy","project","workspace","parent","labels","updated"],Jq={status:"Status",id:"ID",assignee:"Responsible",kickedOffBy:"Kicked off by",project:"Project",workspace:"Workspace",parent:"Parent task",labels:"Tags",updated:"Last updated"},e9={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 t9(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.":e9[e]}r(t9,"issueColumnDescription");function rf(e){return fE(e.lastActivityAt??e.lastExternalCommentAt??e.updatedAt)}r(rf,"issueActivityTimestamp");function n9(e){return`Updated ${rf(e)}`}r(n9,"issueActivityText");function a9(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(a9,"issueTrailingGridTemplate");function s9({availableColumns:e,visibleColumnSet:t,onToggleColumn:i,showDateGroupSeparators:l,onToggleDateGroupSeparators:c,onResetColumns:d,title:m,iconOnly:f=!1,rowPresentation:h="legacy"}){return(0,a.jsxs)(Wr,{children:[(0,a.jsx)(Vr,{asChild:!0,children:(0,a.jsxs)(pe,{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)(JE,{className:f?"h-3.5 w-3.5":"mr-1 h-3.5 w-3.5"}),!f&&"Columns"]})}),(0,a.jsxs)(Qr,{align:"end",className:"w-(--sz-300px) rounded-xl border-line/70 p-1.5 shadow-xl shadow-black/10",children:[(0,a.jsx)(Kk,{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:m})]})}),(0,a.jsx)(yi,{}),e.map(g=>(0,a.jsx)(my,{checked:t.has(g),onSelect:r(v=>v.preventDefault(),"onSelect"),onCheckedChange:r(v=>i(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:Jq[g]}),(0,a.jsx)("span",{className:"text-xs leading-relaxed text-ink-3",children:t9(g,h)})]})},g)),l!==void 0&&c?(0,a.jsx)(my,{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)(yi,{}),(0,a.jsxs)(Cn,{onSelect:d,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(s9,"IssueColumnPicker");function i9(){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:G("relative inline-flex h-2 w-2 rounded-full","bg-blue-500")})]})}r(i9,"LiveRunDot");function r9(){return(0,a.jsxs)(Bn,{variant:"ghost",className:G("px-1.5 sm:gap-1.5 sm:px-2","bg-blue-500/10"),children:[(0,a.jsx)(i9,{}),(0,a.jsx)("span",{className:G("hidden text-(length:--text-micro) font-medium sm:inline","text-blue-600 dark:text-blue-400"),children:"Live"})]})}r(r9,"LiveRunBadge");function nk({issue:e,isLive:t,subtreeLiveCount:i=0,showSubtreeLiveChip:l=!0,showStatus:c=!0,showIdentifier:d=!0,statusSlot:m,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:m??(0,a.jsx)(Vs,{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,d?(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)(r9,{}),l&&!t&&i>0&&(0,a.jsxs)(Bn,{variant:"outline",className:G("px-1.5 sm:gap-1.5 sm:px-2","border-line bg-transparent"),title:`${i} sub-task${i===1?"":"s"} running below`,children:[(0,a.jsx)("span",{className:G("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:[i," live below"]})]})]})}r(nk,"InboxIssueMetaLeading");function l9({issue:e,columns:t,projectName:i,projectColor:l,workspaceId:c,workspaceName:d,assigneeName:m,assigneeAgent:f,creatorAgent:h,assigneeUserName:g,assigneeUserAvatarUrl:v,creatorAgentName:y,creatorUserName:j,creatorUserAvatarUrl:k,viaAgentName:N,currentUserId:S,parentIdentifier:D,parentTitle:R,assigneeContent:E,onFilterWorkspace:C}){const I=rf(e),O=g??Pr(e.assigneeUserId,S)??"User",z=wk(e),B=z?.kind==="user"?z.id:null,L=j??Pr(B,S)??"User";return(0,a.jsx)("span",{className:"grid items-center gap-2",style:{gridTemplateColumns:a9(t)},children:t.map(_=>{if(_==="assignee")return E?(0,a.jsx)("span",{className:"min-w-0",children:E},_):e.assigneeAgentId?(0,a.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,a.jsx)(ql,{agent:f??{id:e.assigneeAgentId,name:m??e.assigneeAgentId.slice(0,8)},size:"sm",className:"min-w-0"})},_):e.assigneeUserId?(0,a.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,a.jsx)(Lh,{name:O,avatarUrl:v,size:"sm",className:"min-w-0"})},_):(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"Unassigned"},_);if(_==="kickedOffBy"){if(z?.kind==="agent"){const U=y??z.id.slice(0,8);return(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{asChild:!0,children:(0,a.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,a.jsx)(ql,{agent:h??{id:z.id,name:U},size:"sm",className:"min-w-0"})})}),(0,a.jsx)(Cs,{side:"top",sideOffset:6,children:U})]},_)}if(z?.kind==="user"){const U=N?`${L} · via ${N}`:L;return(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{asChild:!0,children:(0,a.jsx)("span",{className:"min-w-0 text-xs text-ink",children:(0,a.jsx)(Lh,{name:L,avatarUrl:k,size:"sm",className:"min-w-0"})})}),(0,a.jsx)(Cs,{side:"top",sideOffset:6,children:U})]},_)}return(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"Unknown"},_)}if(_==="project"){if(i){const U=l??"#64748b";return(0,a.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-2 text-xs font-medium",style:{color:_y(U,.12)},children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:U}}),(0,a.jsx)("span",{className:"truncate",children:i})]},_)}return(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:"No project"},_)}return _==="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(U=>(0,a.jsx)(Bn,{variant:"outline",className:"min-w-0 max-w-full px-1.5 py-0 text-(length:--text-nano)",style:{borderColor:U.color,color:_y(U.color,.12),backgroundColor:`${U.color}1f`},children:(0,a.jsx)("span",{className:"truncate",children:U.name})},U.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]},_):(0,a.jsx)("span",{className:"min-w-0","aria-hidden":"true"},_):_==="workspace"?d?(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",children:c&&C?(0,a.jsxs)(As,{children:[(0,a.jsx)(Ns,{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(U=>{U.preventDefault(),U.stopPropagation(),C(c)},"onClick"),children:d})}),(0,a.jsx)(Cs,{side:"top",sideOffset:6,children:"Filter by workspace"})]}):d},_):(0,a.jsx)("span",{className:"min-w-0","aria-hidden":"true"},_):_==="parent"?e.parentId?(0,a.jsx)("span",{className:"min-w-0 truncate text-xs text-ink-3",title:R??void 0,children:D?(0,a.jsx)("span",{className:"font-mono",children:D}):(0,a.jsx)("span",{className:"italic",children:"Sub-task"})},_):(0,a.jsx)("span",{className:"min-w-0","aria-hidden":"true"},_):_==="updated"?(0,a.jsx)("span",{className:"min-w-0 truncate text-right text-(length:--text-micro) font-medium text-ink-3",children:I},_):null})})}r(l9,"InboxIssueTrailingColumns");function o9({icon:e,title:t,message:i,description:l,action:c,onAction:d,hideActionIcon:m=!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:i})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-ink mb-1",children:i}),l&&(0,a.jsx)("p",{className:"max-w-md text-sm text-ink-3 mb-4",children:l})]}),c&&d&&(0,a.jsxs)(pe,{onClick:d,children:[!m&&(0,a.jsx)(Xa,{className:"h-4 w-4 mr-1.5"}),c]})]})}r(o9,"EmptyState");function c9({label:e,collapsible:t=!1,collapsed:i=!1,onToggle:l,trailing:c,className:d}){return(0,a.jsxs)("div",{className:G("flex items-center py-1.5 pl-1 pr-3",d),children:[t?(0,a.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left","aria-expanded":!i,onClick:l,children:[(0,a.jsx)("span",{className:"inline-flex w-4 shrink-0 items-center justify-center",children:(0,a.jsx)(tr,{className:G("h-3.5 w-3.5 shrink-0 text-ink-3 transition-transform",!i&&"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(c9,"IssueGroupHeader");var kh={critical:{icon:ki,color:Ku.critical??"text-yellow-600 dark:text-yellow-400",label:"Critical"},high:{icon:Hk,color:Ku.high??"text-yellow-600 dark:text-yellow-400",label:"High"},medium:{icon:vI,color:Ku.medium??"text-yellow-600 dark:text-yellow-400",label:"Medium"},low:{icon:EE,color:Ku.low??"text-yellow-600 dark:text-yellow-400",label:"Low"}},u9=["critical","high","medium","low"];function nG({priority:e,onChange:t,className:i,showLabel:l}){const[c,d]=(0,b.useState)(!1),m=kh[e]??kh.medium,f=m.icon,h=(0,a.jsx)("span",{className:G("inline-flex items-center justify-center shrink-0",m.color,t&&!l&&"cursor-pointer",i),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:m.label})]}):h;const g=l?(0,a.jsxs)("button",{type:"button","aria-label":`Change priority (current: ${m.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:m.label})]}):(0,a.jsx)("button",{type:"button","data-slot":"icon-button","aria-label":`Change priority (current: ${m.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)(xs,{open:c,onOpenChange:d,children:[(0,a.jsx)(hs,{asChild:!0,children:g}),(0,a.jsx)(gs,{className:"w-36 p-1",align:"start",children:u9.map(v=>{const y=kh[v],j=y.icon;return(0,a.jsxs)(pe,{active:v===e,variant:"ghost",size:"sm",className:G("w-full justify-start gap-2 text-xs"),onClick:r(()=>{t(v),d(!1)},"onClick"),children:[(0,a.jsx)(j,{className:G("h-3.5 w-3.5",y.color)}),y.label]},v)})})]})}r(nG,"PriorityIcon");var d9=[["everything","All categories"],["issues_i_touched","My recent tasks"],["join_requests","Join requests"],["approvals","Approvals"],["failed_runs","Failed runs"],["alerts","Alerts"]],f9=[["all","All approval statuses"],["actionable","Needs action"],["resolved","Resolved"]],Sh=6;function Nh({value:e,onChange:t,label:i}){return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(Br,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-ink-3"}),(0,a.jsx)(aa,{value:e,onChange:r(l=>t(l.target.value),"onChange"),placeholder:`Search ${i.toLowerCase()}...`,"aria-label":`Search ${i.toLowerCase()}`,className:"h-8 pl-7 text-xs"})]})}r(Nh,"FilterOptionSearch");function m9({state:e,onChange:t,activeFilterCount:i,agents:l,projects:c,labels:d,currentUserId:m,enableExternalObjectFilters:f=!0,enableRoutineVisibilityFilter:h=!1,buttonVariant:g="ghost",iconOnly:v=!1,creators:y,presentation:j="legacy",inboxScopeFilters:k}){const N=j==="streamlined",[S,D]=(0,b.useState)(""),[R,E]=(0,b.useState)(""),[C,I]=(0,b.useState)(""),[O,z]=(0,b.useState)(""),B=(0,b.useMemo)(()=>zp(l,R,$=>$.name),[l,R]),L=(0,b.useMemo)(()=>zp(c,C,$=>$.name),[c,C]),_=(0,b.useMemo)(()=>zp(d,O,$=>$.name),[d,O]),U=y??[],F=(0,b.useMemo)(()=>new Map(U.map($=>[$.id,$])),[U]),Y=S.trim().toLowerCase(),se=(0,b.useMemo)(()=>Y?U.filter($=>`${$.label} ${$.searchText??""}`.toLowerCase().includes(Y)):U,[U,Y]),me=(0,b.useMemo)(()=>e.creators.map($=>{const T=F.get($);if(T)return T;if($.startsWith("agent:"))return{id:$,label:$.slice(6).slice(0,8),kind:"agent"};const te=$.startsWith("user:")?$.slice(5):$;return{id:$,label:Pr(te,m)??te.slice(0,5),kind:"user"}}),[F,m,e.creators]),oe=r(()=>{t(iS),k?.onClear()},"clearFilters");return(0,a.jsxs)(xs,{children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsxs)(pe,{variant:g,size:v?"icon":"sm",className:`text-xs ${v?"relative h-8 w-8 shrink-0":""}`,title:v?i>0?`Filters: ${i}`:"Filter":void 0,children:[(0,a.jsx)(hI,{className:v?"h-3.5 w-3.5":"h-3.5 w-3.5 sm:h-3 sm:w-3 sm:mr-1"}),!v&&(0,a.jsx)("span",{className:"hidden sm:inline",children:i>0?`Filters: ${i}`:"Filter"}),!v&&i>0?(0,a.jsx)("span",{className:"ml-0.5 text-(length:--text-nano) font-medium sm:hidden",children:i}):null,v&&i>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:i}):null,!v&&i>0?(0,a.jsx)(ia,{className:"ml-1 hidden h-3 w-3 sm:block",onClick:r($=>{$.stopPropagation(),oe()},"onClick")}):null]})}),(0,a.jsx)(gs,{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"}),i>0?(0,a.jsx)("button",{type:"button",className:"text-xs text-ink-3 hover:text-ink",onClick:oe,children:"Clear"}):null]}),k?(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:d9.map(([$,T])=>{const te=k.category===$;return(0,a.jsxs)("button",{type:"button","aria-pressed":te,className:G("flex w-full items-center justify-between rounded-sm px-2 py-1 text-left text-sm",te?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"),onClick:r(()=>k.onCategoryChange($),"onClick"),children:[(0,a.jsx)("span",{children:T}),te?(0,a.jsx)(_s,{className:"h-3.5 w-3.5"}):null]},$)})})]}),k.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:f9.map(([$,T])=>{const te=k.approvalStatus===$;return(0,a.jsxs)("button",{type:"button","aria-pressed":te,className:G("flex w-full items-center justify-between rounded-sm px-2 py-1 text-left text-sm",te?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"),onClick:r(()=>k.onApprovalStatusChange($),"onClick"),children:[(0,a.jsx)("span",{children:T}),te?(0,a.jsx)(_s,{className:"h-3.5 w-3.5"}):null]},$)})})]}):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:a3.map($=>{const T=i3(e.statuses,$.statuses);return(0,a.jsx)(L3,{selected:T,onClick:r(()=>t({statuses:T?[]:[...$.statuses]}),"onClick"),children:$.label},$.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:Dd.map($=>(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)(hi,{checked:e.statuses.includes($),onCheckedChange:r(()=>t({statuses:Qi(e.statuses,$)}),"onCheckedChange")}),(0,a.jsx)(Vs,{status:$}),(0,a.jsx)("span",{className:"text-sm",children:Uh($)})]},$))})]}),!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)+(m?2:1)>Sh?(0,a.jsx)(Nh,{value:R,onChange:E,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)(hi,{checked:e.assignees.includes("__unassigned"),onCheckedChange:r(()=>t({assignees:Qi(e.assignees,"__unassigned")}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:"No responsible"})]}),m?(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)(hi,{checked:e.assignees.includes("__me"),onCheckedChange:r(()=>t({assignees:Qi(e.assignees,"__me")}),"onCheckedChange")}),(0,a.jsx)(zl,{className:"h-3.5 w-3.5 text-ink-3"}),(0,a.jsx)("span",{className:"text-sm",children:"Me"})]}):null,(N?B:l??[]).map($=>(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)(hi,{checked:e.assignees.includes($.id),onCheckedChange:r(()=>t({assignees:Qi(e.assignees,$.id)}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:$.name})]},$.id))]})]}),U.length>0?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Creator"}),me.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:me.map($=>(0,a.jsxs)(Bn,{variant:"secondary",className:"gap-1 pr-1",children:[$.kind==="agent"?(0,a.jsx)(oc,{className:"h-3 w-3"}):(0,a.jsx)(zl,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:$.label}),(0,a.jsx)("button",{type:"button",className:"rounded-full p-0.5 hover:bg-bg-3",onClick:r(()=>t({creators:e.creators.filter(T=>T!==$.id)}),"onClick"),"aria-label":`Remove creator ${$.label}`,children:(0,a.jsx)(ia,{className:"h-3 w-3"})})]},$.id))}):null,(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(Br,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-ink-3"}),(0,a.jsx)(aa,{value:S,onChange:r($=>D($.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:se.length>0?se.map($=>{const T=e.creators.includes($.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 ${T?"bg-bg-3 text-ink":"text-ink-3 hover:bg-bg-3/50 hover:text-ink"}`,onClick:r(()=>t({creators:Qi(e.creators,$.id)}),"onClick"),children:[$.kind==="agent"?(0,a.jsx)(oc,{className:"h-3.5 w-3.5"}):(0,a.jsx)(zl,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate",children:$.label}),T?(0,a.jsx)(ia,{className:"h-3 w-3"}):null]},$.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>Sh?(0,a.jsx)(Nh,{value:C,onChange:I,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?L:c).map($=>(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)(hi,{checked:e.projects.includes($.id),onCheckedChange:r(()=>t({projects:Qi(e.projects,$.id)}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:$.name})]},$.id))})]}):null]}),(0,a.jsxs)("div",{className:"min-w-0 space-y-3",children:[d&&d.length>0?(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-ink-3",children:"Labels"}),N&&d.length>Sh?(0,a.jsx)(Nh,{value:O,onChange:z,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?_:d).map($=>(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)(hi,{checked:e.labels.includes($.id),onCheckedChange:r(()=>t({labels:Qi(e.labels,$.id)}),"onCheckedChange")}),(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:$.color}}),(0,a.jsx)("span",{className:"text-sm",children:$.name})]},$.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:e3.map($=>{const T=$==="failed"?"failed":$==="waiting"?"waiting":$==="running"?"running":$==="auth_required"?"auth_required":$==="unreachable"?"unreachable":$==="stale"?"unknown":"closed",te=Xk(T),ce=(tE[T]??"").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)(hi,{checked:e.externalObjectStatuses.includes($),onCheckedChange:r(()=>t({externalObjectStatuses:Qi(e.externalObjectStatuses,$)}),"onCheckedChange")}),(0,a.jsx)(te,{className:`h-3.5 w-3.5 shrink-0 ${ce}`,"aria-hidden":"true"}),(0,a.jsx)("span",{className:"text-sm",children:n3($)})]},$)})})]}):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)(hi,{checked:e.liveOnly,onCheckedChange:r($=>t({liveOnly:$===!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)(hi,{checked:e.hideRoutineExecutions,onCheckedChange:r($=>t({hideRoutineExecutions:$===!0}),"onCheckedChange")}),(0,a.jsx)("span",{className:"text-sm",children:"Hide routine runs"})]}):null]})]})]})]})})]})}r(m9,"IssueFiltersPopover");function p9(e){return e.objects.find(t=>t.statusTone===e.highestSeverity)?.statusCategory??"unknown"}r(p9,"dominantCategory");function h9(e){return e.objects.find(t=>t.statusTone===e.highestSeverity)??null}r(h9,"dominantObject");function g9(e){const t=[];for(const[i,l]of Object.entries(e.byStatusCategory))l&&t.push(`${l} ${ZE(i).toLowerCase()}`);return e.staleCount>0&&t.push(`${e.staleCount} stale`),t.push(`${e.total} total`),`External objects: ${t.join(", ")}`}r(g9,"buildBreakdownTitle");function ak({summary:e,compact:t,className:i}){const l=f0(),c=QE(e),d=e?.total??0;if(!e||d===0||!c)return null;const m=h9(e),f=m?.statusCategory??p9(e),h=YE(m?.statusIconKey)??Xk(f),g=lE[f]??"bg-bg-3 text-ink-3",v=WE(e),y=g9(e),j=f==="running"&&!l?"animate-spin":"";return(0,a.jsxs)("span",{role:"img","aria-label":y,title:y,className:G("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",i),"data-external-status":f,"data-external-tone":c,children:[(0,a.jsx)(h,{"aria-hidden":"true",className:G("h-3 w-3 shrink-0",j)}),(0,a.jsx)("span",{children:v>0?v:d})]})}r(ak,"ExternalObjectStatusSummary");function sk({onArchive:e,disabled:t,compact:i=!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:G("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",i?"h-5 py-0":"py-1"),"aria-label":"Archive",children:[(0,a.jsx)(Fk,{className:"h-3.5 w-3.5"}),"Archive"]})}r(sk,"InboxArchiveButton");function x9({issue:e,issueLinkState:t,selected:i=!1,presentation:l="legacy",leadingControl:c,statusSlot:d,metadata:m,actions:f,showIdentifier:h=!0,mobileLeading:g,desktopMetaLeading:v,desktopLeadingSpacer:y=!1,mobileMeta:j,mobileTitleMeta:k,desktopTrailing:N,externalObjectSummary:S,trailingMeta:D,titleSuffix:R,titleClassName:E,checklistStepNumber:C=null,checklistCurrentStep:I=!1,checklistDependencyChips:O,checklistRowId:z,unreadState:B=null,onMarkRead:L,onArchive:_,archiveDisabled:U,className:F,onMouseEnter:Y,treeGuides:se=0,chevronInGuide:me=!1,showDivider:oe=!1}){const $=e.identifier??e.id,T=e.identifier??e.id.slice(0,8),te=B!=null,ce=B==="visible"||B==="fading",ae=(0,a.jsx)("button",{type:"button","data-slot":"icon-button",onClick:r(Te=>{Te.preventDefault(),Te.stopPropagation(),L?.()},"onClick"),onKeyDown:r(Te=>{(Te.key==="Enter"||Te.key===" ")&&(Te.preventDefault(),Te.stopPropagation(),L?.())},"onKeyDown"),className:G("inline-flex h-4 w-4 items-center justify-center rounded-full transition-colors",i?"hover:bg-bg-3/80":"hover:bg-blue-500/20"),"aria-label":"Mark as read",children:(0,a.jsx)("span",{className:G("block h-2 w-2 rounded-full transition-opacity duration-300",i?"bg-ink-3/70":"bg-blue-600 dark:bg-blue-400",B==="fading"?"opacity-0":"opacity-100")})}),Ce=i?"!text-ink-3 !border-ink-3":void 0,ue=Vg(t,e),we=C!==null?(0,a.jsxs)("span",{className:"shrink-0 font-mono text-xs text-ink-3","aria-hidden":"true",children:[C,"."]}):null,Ae=e.activeRecoveryAction??null,je=Ae&&!G_(Ae.cause)?b9(Ae,i,{scheduledRetry:e.scheduledRetry??null}):null,he=Z3(e.blockedBy)?(0,a.jsxs)(Bn,{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)(Yg,{className:"h-2.5 w-2.5","aria-hidden":!0}),"Blocked by parked work"]}):null;if(l==="task"){const Te=B==="visible"||B==="fading";return(0,a.jsxs)("div",{onMouseEnter:Y,"data-slot":"task-row","data-unread":Te?"true":void 0,className:G("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",te?"pl-4":"pl-2 sm:pl-4","[&_button]:relative [&_button]:z-10",i?"bg-bg-3/50 hover:bg-bg-3/50":"hover:bg-bg-3/50",I&&"bg-accent/5",F),children:[(0,a.jsx)(fn,{to:Cd($),state:ue,disableIssueQuicklook:!0,issuePrefetch:e,"data-inbox-issue-link":!0,id:z,"aria-current":I?"step":void 0,onClickCapture:r(()=>Rh($,ue),"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 ",T,": ",e.title]})}),te?(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:ce?ae: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:[se>0?Array.from({length:se},(Ve,De)=>{const Se=me&&De===se-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:Se?(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-${De}`)}):null,c,d??(0,a.jsx)(Vs,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ce}),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:G("min-w-0 line-clamp-2 text-sm sm:truncate sm:line-clamp-none",Te&&"font-semibold",E),children:[e.title,R]}),je,k?(0,a.jsx)("span",{className:"ml-auto shrink-0 whitespace-nowrap text-right text-xs text-ink-3 sm:hidden",children:k}):null]}),O?(0,a.jsx)("span",{className:"flex flex-wrap gap-1",children:O}):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:[S?(0,a.jsx)(ak,{summary:S,compact:!0}):null,m?(0,a.jsx)("span",{"data-slot":"task-row-metadata",className:"min-w-0",children:m}):null,N,f?(0,a.jsx)("span",{"data-slot":"task-row-actions",className:"flex shrink-0 items-center gap-1",children:f}):null,_?(0,a.jsx)(sk,{onArchive:_,disabled:U,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:T}):null,D?(0,a.jsx)("span",{"data-slot":"task-row-timestamp",className:"w-24 shrink-0 truncate text-right text-xs text-ink-3",children:D}):null]})]})}return(0,a.jsxs)("div",{onMouseEnter:Y,className:G("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",te?"pl-4":"pl-2","[&_button]:relative [&_button]:z-10",oe&&"border-b border-line last:border-b-0",i?"hover:bg-transparent":"hover:bg-bg-3/50",I?"bg-accent/5":null,F),children:[(0,a.jsx)(fn,{to:Cd($),state:ue,disableIssueQuicklook:!0,issuePrefetch:e,"data-inbox-issue-link":!0,id:z,"aria-current":I?"step":void 0,onClickCapture:r(()=>Rh($,ue),"onClickCapture"),className:G("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 ",T,": ",e.title]})}),(0,a.jsxs)("span",{className:"flex shrink-0 items-center gap-1 pt-px sm:hidden",children:[g??(0,a.jsx)(Vs,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ce}),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:G("min-w-0 line-clamp-2 text-sm sm:truncate sm:line-clamp-none",E),children:[e.title,R]}),je]}),O?(0,a.jsx)("span",{className:"flex flex-wrap gap-1 sm:order-3 sm:ml-(--sz-calc-13)",children:O}):null,(0,a.jsxs)("span",{className:"flex items-center gap-2 self-stretch sm:order-1 sm:shrink-0",children:[te?(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:ce?ae:null}):null,se>0?Array.from({length:se},(Te,Ve)=>{const De=me&&Ve===se-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:De?(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-${Ve}`)}):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)(Vs,{status:e.status,externalConversationState:e.externalConversationState,blockerAttention:e.blockerAttention,size:"md",className:Ce})}),we,(0,a.jsx)("span",{className:"shrink-0 font-mono text-xs text-ink-3",children:T}),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]})]}),_||N||D||S?(0,a.jsxs)("span",{className:"ml-auto hidden shrink-0 items-center gap-2 sm:order-3 sm:flex sm:gap-3",children:[_?(0,a.jsx)(sk,{onArchive:_,disabled:U}):null,S?(0,a.jsx)(ak,{summary:S,compact:!0}):null,N,D?(0,a.jsx)("span",{className:"text-xs text-ink-3",children:D}):null]}):null,ce?(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:ae}):null]})}r(x9,"IssueRow");function b9(e,t,i){const l=Q3(e,i);if(!l)return null;const c=G3[l],d=c.icon,m=W3(e,i),f=X3(l,e.kind,m),h=m?Y3(m):null;return(0,a.jsxs)(Bn,{variant:"outline","data-testid":"issue-row-recovery-indicator","data-recovery-state":l,"data-recovery-kind":e.kind,"data-recovery-lane":m?.lane,role:"status","aria-label":h?`${f} — ${h}`:f,className:G("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)(d,{className:"h-2.5 w-2.5","aria-hidden":!0}),f]})}r(b9,"renderRecoveryChip");var v9="Kembali ke model utama.";function y9(e,t){return e instanceof Error&&e.message?e.message:t}r(y9,"errorMessage");function j9({issueId:e,run:t,companyId:i,taskLabel:l,className:c}){const d=Rn(),[m,f]=(0,b.useState)(!1),h=t?.modelFallback??null,g=bn({mutationFn:r(async()=>{if(!e||!t)throw new Error("This task has no run on a fallback model.");return await gf.cancel(t.id),dn.addComment(e,v9,void 0,void 0,void 0,crypto.randomUUID())},"mutationFn"),onSuccess:r(()=>{i&&d.invalidateQueries({queryKey:P.liveRuns(i)}),e&&(d.invalidateQueries({queryKey:P.issues.liveRuns(e)}),d.invalidateQueries({queryKey:P.issues.activeRun(e)}),d.invalidateQueries({queryKey:P.issues.runs(e)}),d.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:G("inline-flex min-w-0 items-center gap-1.5",c),children:[(0,a.jsxs)(pe,{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)(ec,{"aria-hidden":"true"}),g.isPending?"Restoring…":"Back to primary model"]}),g.error?(0,a.jsx)("span",{role:"alert",className:"text-xs text-bad",children:y9(g.error,"Couldn’t restore the primary model.")}):null,(0,a.jsx)(Bk,{open:m,onOpenChange:f,children:(0,a.jsxs)(Lk,{children:[(0,a.jsxs)($k,{children:[(0,a.jsxs)(Ok,{children:["Back to the primary model",v,"?"]}),(0,a.jsxs)(Mk,{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)(Pk,{children:[(0,a.jsx)(Uk,{children:"Keep running"}),(0,a.jsx)(zk,{onClick:r(()=>{f(!1),g.mutate()},"onClick"),children:"Stop and switch"})]})]})})]})}r(j9,"RestorePrimaryModelControl");function w9({context:e,search:t,controls:i,actions:l,feedback:c,className:d,ariaLabel:m="Collection controls"}){return(0,a.jsxs)("div",{"data-slot":"collection-toolbar",className:G("flex flex-col gap-2",d),role:"toolbar","aria-label":m,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,i||l?(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-1 sm:ml-auto sm:flex-nowrap",children:[i?(0,a.jsx)("div",{"data-slot":"collection-toolbar-controls",className:"flex min-w-0 flex-wrap items-center gap-1",children:i}):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(w9,"CollectionToolbar");function k9({variant:e="list"}){return e==="dashboard"?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(ct,{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,i)=>(0,a.jsx)(ct,{className:"h-24 w-full"},i))}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:Array.from({length:4}).map((t,i)=>(0,a.jsx)(ct,{className:"h-44 w-full"},i))}),(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,a.jsx)(ct,{className:"h-72 w-full"}),(0,a.jsx)(ct,{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)(ct,{className:"h-9 w-44"})}),(0,a.jsx)("div",{className:"grid gap-3",children:Array.from({length:3}).map((t,i)=>(0,a.jsx)(ct,{className:"h-36 w-full"},i))})]}):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,i)=>(0,a.jsx)(ct,{className:"h-9 w-28"},i))}),(0,a.jsx)(ct,{className:"h-40 w-full"}),(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,a.jsx)(ct,{className:"h-72 w-full"}),(0,a.jsx)(ct,{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)(ct,{className:"h-9 w-56"}),(0,a.jsx)(ct,{className:"h-8 w-40"})]}),(0,a.jsx)("div",{className:"space-y-5",children:Array.from({length:3}).map((t,i)=>(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(ct,{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)(ct,{className:"h-14 w-full rounded-none"},c))})]},i))})]}):e==="org-chart"?(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsx)(ct,{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)(ct,{className:"h-3 w-64"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ct,{className:"h-6 w-6"}),(0,a.jsx)(ct,{className:"h-6 w-6"}),(0,a.jsx)(ct,{className:"h-7 w-48"})]}),(0,a.jsx)(ct,{className:"h-4 w-40"})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(ct,{className:"h-10 w-full"}),(0,a.jsx)(ct,{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)(ct,{className:"h-8 w-24"}),(0,a.jsx)(ct,{className:"h-8 w-24"}),(0,a.jsx)(ct,{className:"h-8 w-24"})]}),(0,a.jsx)(ct,{className:"h-24 w-full"}),(0,a.jsx)(ct,{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)(ct,{className:"h-9 w-64"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ct,{className:"h-8 w-16"}),(0,a.jsx)(ct,{className:"h-8 w-16"}),(0,a.jsx)(ct,{className:"h-8 w-16"}),(0,a.jsx)(ct,{className:"h-8 w-24"})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(ct,{className:"h-4 w-40"}),(0,a.jsx)("div",{className:"space-y-1",children:Array.from({length:8}).map((t,i)=>(0,a.jsx)(ct,{className:"h-11 w-full rounded-none"},i))})]})]}):(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)(ct,{className:"h-9 w-44"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ct,{className:"h-8 w-20"}),(0,a.jsx)(ct,{className:"h-8 w-24"})]})]}),(0,a.jsx)("div",{className:"space-y-1",children:Array.from({length:7}).map((t,i)=>(0,a.jsx)(ct,{className:"h-11 w-full rounded-none"},i))})]})}r(k9,"PageSkeleton");var aG="issue.successful_run_handoff_required",sG="issue.successful_run_handoff_escalated";function wA(e){const t=e.successfulRunHandoff;return t?.required!==!0?!1:t.hasLiveContinuation?e.scheduledRetry?.status==="scheduled_retry":!0}r(wA,"isSuccessfulRunHandoffRequired");function iG(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)||S9(t)}r(iG,"isSuccessfulRunHandoffComment");function S9(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(S9,"isSuccessfulRunHandoffEscalationComment");function rG(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(rG,"successfulRunHandoffActivityTone");var kA=[10,25,50];var N9=["backlog","done","cancelled"],Tg=["backlog","todo","in_progress","in_review","blocked","done","cancelled"],C9={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:""},A9={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 _9(e){return A9[e]??C9}r(_9,"getKanbanColumnTone");function Ch(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}r(Ch,"statusLabel");function E9(e,t){return Tg.includes(e)?e:t.find(i=>i.id===e)?.status??null}r(E9,"resolveKanbanTargetStatus");function I9({status:e,issues:t,agents:i,liveIssueIds:l,subtreeLiveCounts:c,compactCards:d=!1,collapsed:m=!1,visibleCount:f,revealIncrement:h,onShowMore:g}){const{setNodeRef:v,isOver:y}=UN({id:e});t.length;const j=m?[]:t.slice(0,f),k=Math.max(t.length-j.length,0),N=Math.min(h,k),S=_9(e);return m?(0,a.jsxs)("div",{ref:v,className:G("flex min-h-(--sz-220px) w-(--sz-52px) shrink-0 flex-col items-center rounded-md border px-1.5 py-2 transition-colors",S.rail,y&&S.railOver),title:`${Ch(e)}: ${t.length}`,children:[(0,a.jsx)(Vs,{status:e}),(0,a.jsx)("span",{className:G("mt-2 [writing-mode:vertical-rl] rotate-180 text-(length:--text-nano) font-semibold uppercase tracking-wide",S.header),children:Ch(e)}),(0,a.jsx)(Bn,{variant:"ghost",className:G("mt-auto bg-bg px-1.5 text-(length:--text-nano) tabular-nums",S.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)(Vs,{status:e}),(0,a.jsx)("span",{className:G("text-xs font-semibold uppercase tracking-wide",S.header),children:Ch(e)}),(0,a.jsx)("span",{className:G("ml-auto text-xs tabular-nums",S.count),children:t.length})]}),(0,a.jsxs)("div",{ref:v,className:G("flex-1 min-h-(--sz-120px) rounded-md p-2 space-y-1 transition-colors",y?S.bodyOver:S.body),children:[(0,a.jsx)(_0,{items:j.map(D=>D.id),strategy:BN,children:j.map(D=>(0,a.jsx)(SA,{issue:D,agents:i,isLive:l?.has(D.id),subtreeLiveCount:c?.get(D.id)??0,compact:d,className:S.card},D.id))}),k>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:g,children:["Show ",N," more"]}):null,t.length>0&&(k>0||t.length>=f)?(0,a.jsxs)("p",{className:"px-1 pt-1 text-(length:--text-micro) text-ink-3",children:["Showing ",j.length," of ",t.length]}):null]})]})}r(I9,"KanbanColumn");function SA({issue:e,agents:t,isLive:i,subtreeLiveCount:l=0,isOverlay:c,compact:d=!1,className:m}){const{attributes:f,listeners:h,setNodeRef:g,transform:v,transition:y,isDragging:j}=E0({id:e.id,data:{issue:e}}),k={transform:Ws.Transform.toString(v),transition:y},N=r(S=>!S||!t?null:t.find(D=>D.id===S)?.name??null,"agentName");return(0,a.jsx)(_c,{ref:g,style:k,...f,...h,className:G("block cursor-grab active:cursor-grabbing transition-shadow",j&&!c?"opacity-30":"",c?"shadow-lg ring-1 ring-accent/20":"hover:shadow-sm",d?"p-2":"p-2.5",m),children:(0,a.jsxs)(fn,{to:`/issues/${e.identifier??e.id}`,disableIssueQuicklook:!0,className:"block no-underline text-inherit",onClick:r(S=>{j&&S.preventDefault()},"onClick"),children:[(0,a.jsxs)("div",{className:`flex items-start gap-1.5 ${d?"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)}),wA(e)?(0,a.jsxs)(Bn,{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)(ki,{className:"h-3 w-3"}),"Next step"]}):null,i&&(0,a.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 text-(length:--text-nano) font-medium text-blue-600 dark:text-blue-400",children:[(0,a.jsxs)("span",{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"}),(0,a.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),d?"Live":null]}),!i&&l>0&&(0,a.jsxs)(Bn,{variant:"outline",className:"border-line px-1.5 text-(length:--text-nano) text-ink-3",title:`${l} sub-task${l===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"}),l," live below"]})]}),(0,a.jsx)("p",{className:`${d?"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 S=N(e.assigneeAgentId);return S?(0,a.jsx)(ql,{agent:t?.find(D=>D.id===e.assigneeAgentId)??{id:e.assigneeAgentId,name:S},size:"xs"}):(0,a.jsx)("span",{className:"text-xs text-ink-3 font-mono",children:e.assigneeAgentId.slice(0,8)})})()]})]})})}r(SA,"KanbanCard");function T9({issues:e,agents:t,liveIssueIds:i,compactCards:l=!1,collapsedStatuses:c=[],initialVisibleCount:d=10,revealIncrement:m=10,onUpdateIssue:f}){const[h,g]=(0,b.useState)(null),v=`${d}:${m}`,[y,j]=(0,b.useState)({paginationKey:v,counts:{}}),k=y.paginationKey===v?y.counts:{},N=(0,b.useMemo)(()=>new Set(c),[c]),S=j0(hc(_f,{activationConstraint:{distance:5}})),D=(0,b.useMemo)(()=>{const z={};for(const B of Tg)z[B]=[];for(const B of e)z[B.status]&&z[B.status].push(B);return z},[e]),R=(0,b.useMemo)(()=>h?e.find(z=>z.id===h):null,[h,e]),E=(0,b.useMemo)(()=>jA(e,i??new Set),[e,i]);function C(z){g(z.active.id)}r(C,"handleDragStart");function I(z){g(null);const{active:B,over:L}=z;if(!L)return;const _=B.id,U=e.find(Y=>Y.id===_);if(!U)return;const F=E9(L.id,e);F&&F!==U.status&&f(_,{status:F})}r(I,"handleDragEnd");function O(z){}return r(O,"handleDragOver"),(0,a.jsxs)(C0,{sensors:S,onDragStart:C,onDragOver:O,onDragEnd:I,children:[(0,a.jsx)("div",{className:"flex gap-3 overflow-x-auto pb-4 -mx-2 px-2",children:Tg.map(z=>(0,a.jsx)(I9,{status:z,issues:D[z]??[],agents:t,liveIssueIds:i,subtreeLiveCounts:E,compactCards:l,collapsed:N.has(z)||N.size>0&&D[z].length===0,visibleCount:k[z]??d,revealIncrement:m,onShowMore:r(()=>{j(B=>{const L=B.paginationKey===v?B.counts:{};return{paginationKey:v,counts:{...L,[z]:(L[z]??d)+m}}})},"onShowMore")},z))}),(0,a.jsx)(nL,{children:R?(0,a.jsx)(SA,{issue:R,agents:t,isOverlay:!0,compact:l}):null})]})}r(T9,"KanbanBoard");function lf(e,t){const i=new Set(e.map(m=>m.id)),l=r(m=>!m.parentId||!i.has(m.parentId)||t?.has(m.id)===!0,"isRoot"),c=e.filter(l),d=new Map;for(const m of e)if(m.parentId&&!l(m)){const f=d.get(m.parentId)??[];f.push(m),d.set(m.parentId,f)}return{roots:c,childMap:d}}r(lf,"buildIssueTree");function NA(e,t){return(t.get(e)??[]).reduce((i,l)=>i+1+NA(l.id,t),0)}r(NA,"countDescendants");function lG(e,t){const i=new Map;for(const m of t){if(!m.parentId)continue;const f=i.get(m.parentId)??[];f.push(m),i.set(m.parentId,f)}const l=[],c=new Set([e]);let d=[e];for(;d.length>0;){const m=[];for(const f of d)for(const h of i.get(f)??[])c.has(h.id)||(c.add(h.id),l.push(h),m.push(h.id));d=m}return l}r(lG,"filterIssueDescendants");function R9(e,t){const i=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}:{},...i?{parentExecutionWorkspaceLabel:i}:{},...e.assigneeAgentId?{assigneeAgentId:e.assigneeAgentId}:{},...l?{assigneeUserId:l}:{}}}r(R9,"buildSubIssueDefaultsForViewer");function CA(){return typeof localStorage>"u"?null:localStorage}r(CA,"browserStorage");function Ah(e,t){if(!t)return null;try{const i=e.getItem(t);return i==null?null:JSON.parse(i)}catch{return null}}r(Ah,"parseStoredJson");function AA({companyId:e,collectionKey:t}){return`wardmote:task-collection:v1:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}r(AA,"taskCollectionPreferencesStorageKey");function D9(e,t){if(!e||typeof e!="object")return!1;const i=e;return i.version===1&&i.companyId===t.companyId&&i.collectionKey===t.collectionKey&&"viewState"in i&&Array.isArray(i.columns)}r(D9,"isCurrentEnvelope");function Rg(e,t,i=CA()){if(!i)return;const l={version:1,companyId:e.companyId,collectionKey:e.collectionKey,viewState:t.viewState,viewStateSource:t.viewStateSource??"stored",columns:t.columns};try{i.setItem(AA(e),JSON.stringify(l)),e.legacyViewStorageKey&&i.setItem(e.legacyViewStorageKey,JSON.stringify(t.viewState)),e.legacyColumnsStorageKey&&i.setItem(e.legacyColumnsStorageKey,JSON.stringify(t.columns))}catch{}}r(Rg,"saveTaskCollectionPreferences");function M9({storage:e=CA(),defaultViewState:t,defaultColumns:i,normalizeViewState:l,normalizeColumns:c,...d}){if(!e)return{viewState:t,columns:i,migrated:!1,source:"default"};const m=Ah(e,AA(d));if(D9(m,d))return{viewState:l(m.viewState),columns:c(m.columns),migrated:!1,source:m.viewStateSource==="default"?"default":"current"};const f=Ah(e,d.legacyViewStorageKey),h=Ah(e,d.legacyColumnsStorageKey),g=f!==null||h!==null,v={viewState:f===null?t:l(f),columns:h===null?i:c(h)};return g&&Rg(d,{...v,viewStateSource:f===null?"default":"stored"},e),{...v,migrated:g,source:f!==null?"legacy":"default"}}r(M9,"loadTaskCollectionPreferences");var O9={today:"Today",yesterday:"Yesterday",earlier:"Earlier"};function ik(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}r(ik,"localCalendarOrdinal");function L9(e,t=new Date){const i=e instanceof Date?e:new Date(e);if(Number.isNaN(i.getTime()))return"earlier";const l=Math.round((ik(t)-ik(i))/864e5);return l<=0?"today":l===1?"yesterday":"earlier"}r(L9,"taskDateGroup");function z9(e,t){return e===t||e===null&&t==="earlier"?null:O9[t]}r(z9,"taskDateGroupSeparator");var fd=200,md=200;function rk(e){const t=new Date(e.startedAt??e.createdAt).getTime();return Number.isFinite(t)?t:0}r(rk,"runStartMs");function P9(e,t){const i=new Map(t.map(c=>[c.id,c.status])),l=new Map;for(const c of e??[]){if(!c.issueId||!c.modelFallback||!yA(c,i.get(c.issueId)))continue;const d=l.get(c.issueId);(!d||rk(c)>rk(d))&&l.set(c.issueId,c)}return l}r(P9,"fallbackRunsByIssueId");function pd(e){return e.type==="group"?`group:${e.key}`:`issue:${e.issue.id}`}r(pd,"issuesListNavEntryKey");function Dg(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}r(Dg,"escapeAttrValue");var _A=100,U9=150,$9=320;function hd(e){if(!e||typeof window>"u")return null;let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){const i=window.getComputedStyle(t).overflowY;if(i==="auto"||i==="scroll"||i==="overlay")return t;t=t.parentElement}return null}r(hd,"findIssuesScrollContainer");var B9=12,K9=24;function EA(e){if(!e)return{top:0,bottom:window.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.top+e.clientHeight}}r(EA,"issuesViewportBounds");function q9(e,t,i){const l=e.querySelectorAll("[data-issue-row-id]"),c=EA(t);let d=0,m=l.length;for(;d<m;){const h=d+m>>1;l[h].getBoundingClientRect().bottom<=c.top?d=h+1:m=h}const f=[];for(let h=d;h<l.length&&f.length<B9;h+=1){const g=l[h].getBoundingClientRect();if(g.top>=c.bottom)break;f.push({id:l[h].dataset.issueRowId,top:g.top-c.top})}return{identity:i,rows:f}}r(q9,"captureIssueRowScrollAnchor");function F9(e,t,i){const l=EA(t),c=[];if(i.rows.forEach(({id:f,top:h},g)=>{const v=e.querySelector(`[data-issue-row-id="${Dg(f)}"]`);v&&c.push({shift:Math.round(v.getBoundingClientRect().top-l.top-h),index:g})}),c.length===0)return null;c.sort((f,h)=>f.shift-h.shift);let d=null,m=0;for(let f=1;f<=c.length;f+=1){if(f<c.length&&c[f].shift-c[f-1].shift<=K9)continue;const h=c.slice(m,f),g=h.reduce((v,y)=>y.index<v.index?y:v);(!d||h.length>d.count||h.length===d.count&&g.index<d.first.index)&&(d={count:h.length,first:g}),m=f}return d.first.shift}r(F9,"issueRowAnchorShift");var H9=kc,V9={backlog:"Backlog",todo:"Todo",in_progress:"In progress",in_review:"In review",done:"Done",blocked:"Blocked",cancelled:"Cancelled"},Q9={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={...iS,sortField:"updated",sortDir:"desc",groupBy:"none",viewMode:"list",nestingEnabled:!0,showDateGroupSeparators:!0,collapsedGroups:[],collapsedParents:[],boardCardDensity:"auto",boardColdLaneMode:"expanded",boardColumnPageSize:10};function W9(e){return e==="compact"||e==="comfortable"||e==="auto"?e:"auto"}r(W9,"normalizeBoardCardDensity");function G9(e){return e==="collapsed"||e==="expanded"||e==="auto"?e:"auto"}r(G9,"normalizeBoardColdLaneMode");function Y9(e){return kA.includes(e)?e:10}r(Y9,"normalizeBoardColumnPageSize");function X9(e){const t=e&&typeof e=="object"?e:{};return{...kd,...t,...t3(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(i=>typeof i=="string"):[],collapsedParents:Array.isArray(t.collapsedParents)?t.collapsedParents.filter(i=>typeof i=="string"):[],boardCardDensity:W9(t.boardCardDensity),boardColdLaneMode:G9(t.boardColdLaneMode),boardColumnPageSize:Y9(t.boardColumnPageSize)}}r(X9,"normalizeIssueViewState");function Z9(e,t,i){const l=e.source==="default"&&i?{...e.viewState,sortField:i,sortDir:"asc"}:e.viewState;return t?{...l,assignees:t,statuses:[]}:l}r(Z9,"getInitialViewState");function lk(e,t,i,l,c){const d=Z9(e,t,l),m=i?{...d,workspaces:i,statuses:[]}:d;return c?{...m,statuses:c}:m}r(lk,"getInitialWorkspaceViewState");function J9(e){return`${e}:issue-columns`}r(J9,"getIssueColumnsStorageKey");function ok(e){return M9({...e,defaultViewState:kd,defaultColumns:nN,normalizeViewState:X9,normalizeColumns:r(t=>iN(Array.isArray(t)?t:[]),"normalizeColumns")})}r(ok,"loadIssueCollectionPreferences");function e7(e,t){if(t.sortField==="workflow"){const c=vA(e);return t.sortDir==="desc"?[...c].reverse():c}const i=[...e],l=t.sortDir==="asc"?1:-1;return i.sort((c,d)=>{switch(t.sortField){case"status":return l*(Dd.indexOf(c.status)-Dd.indexOf(d.status));case"priority":return l*(Ph.indexOf(c.priority)-Ph.indexOf(d.priority));case"title":return l*c.title.localeCompare(d.title);case"created":return l*(new Date(c.createdAt).getTime()-new Date(d.createdAt).getTime());case"updated":return l*n7(c,d);default:return 0}}),i}r(e7,"sortIssues");function t7(e,t,i,l){const c=Math.min(i.length,_A);if(!e||e.identity!==t)return c;if(e.ids===i)return Math.min(i.length,Math.max(e.limit,l,c));const d=new Map;i.forEach((h,g)=>d.set(h,g));const m=Math.min(e.limit,e.ids.length);let f=-1;for(let h=0;h<m;h+=1){const g=d.get(e.ids[h]);g!==void 0&&g>f&&(f=g)}return Math.min(i.length,Math.max(f+1,l,c))}r(t7,"nextIssueRowRenderLimit");function Mg(e){return e.lastActivityAt??e.updatedAt}r(Mg,"issueRecencyDate");function n7(e,t){const i=new Date(Mg(e)).getTime()-new Date(Mg(t)).getTime();return i!==0?i:new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}r(n7,"compareIssueRecency");function a7(e){return e.sortDir!=="desc"?null:e.sortField==="created"?t=>t.createdAt:e.sortField==="updated"?Mg:null}r(a7,"issueDateSeparatorDate");var IA=864e5,s7=7*IA;function i7(e,t=Date.now()){const i=t-new Date(e).getTime();return i<IA?0:i<s7?1:2}r(i7,"issueAgeBucket");function r7(e){return e===1?"Older than a day":"Older than a week"}r(r7,"issueAgeSeparatorLabel");function l7(e,t){const i=[];return e<1&&t>=1&&i.push(1),e<2&&t>=2&&i.push(2),i}r(l7,"issueAgeBucketsCrossed");function ck({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(ck,"IssueDateSeparator");function o7(e){return e!=="done"&&e!=="cancelled"&&e!=="blocked"}r(o7,"isActionableWorkflowStatus");function c7(e,t){const i=new Map;if(!t)return e.forEach((m,f)=>{i.set(m.id,String(f+1))}),i;const{roots:l,childMap:c}=lf(e),d=r((m,f)=>{m.forEach((h,g)=>{const v=f?`${f}.${g+1}`:String(g+1);i.set(h.id,v),d(c.get(h.id)??[],v)})},"visit");return d(l,null),e.forEach((m,f)=>{i.has(m.id)||i.set(m.id,String(f+1))}),i}r(c7,"buildChecklistStepNumberMap");function u7(e,t){const i=new Map;if(!t){const m=new Map;for(const f of e){if(!f.parentId)continue;const h=m.get(f.parentId);h&&i.set(f.id,h.id),m.set(f.parentId,f)}return i}const{roots:l,childMap:c}=lf(e),d=r(m=>{m.forEach((f,h)=>{const g=h>0?m[h-1]:null;f.parentId&&g?.parentId===f.parentId&&i.set(f.id,g.id),d(c.get(f.id)??[])})},"visit");return d(l),i}r(u7,"buildPreviousSiblingIssueIdMap");function d7(e,t,i){return!!(e.parentId&&i&&(e.blockedBy??[]).length===1&&t.length===1&&t[0]===i)}r(d7,"shouldSuppressSinglePreviousSiblingBlockerChip");function f7({context:e,search:t,controls:i}){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:i})]})}r(f7,"LegacyIssuesToolbar");function m7({value:e,context:t,onDebouncedChange:i}){return(0,a.jsx)($q,{value:e,context:t,onChange:r(({raw:l})=>i(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(k$({key:l.key,isComposing:l.nativeEvent.isComposing})){l.currentTarget.blur();return}S$({key:l.key,isComposing:l.nativeEvent.isComposing,currentValue:l.currentTarget.value})&&l.currentTarget.blur()},"onKeyDown")})}r(m7,"IssueSearchInput");function p7({summary:e,issueLinkState:t,parentIssueIdForCostSummary:i}){const l=e.target,c=l?.issue??null,d=c?.identifier??c?.id??"",m=c?Vg(t,c):void 0,f=kc.map(k=>({status:k,count:e.countsByStatus[k]??0})).filter(k=>k.count>0),h=e.inProgressCount>0,g=Iq({visibleMs:5e3}),{data:v}=be({queryKey:P.issues.costSummary(i??"pending",{excludeRoot:!0}),queryFn:r(()=>dn.getCostSummary(i,{excludeRoot:!0}),"queryFn"),enabled:!!i,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:[T_(y)," tokens"]}),(0,a.jsxs)("span",{className:"text-ink-3 tabular-nums",children:[A_(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:N})=>(0,a.jsx)("span",{className:G("h-full",Q9[k]),style:{width:`${N/e.totalCount*100}%`},title:`${V9[k]}: ${N}`,"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)(fn,{to:Cd(d),state:m,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(p7,"SubIssueProgressSummaryStrip");var uk=["","pl-4 sm:pl-0","pl-8 sm:pl-0","pl-12 sm:pl-0","pl-16 sm:pl-0"];function h7(e){return(0,a.jsx)(g7,{...e})}r(h7,"IssuesList");function g7({issues:e,isLoading:t,error:i,agents:l,projects:c,liveIssueIds:d,liveRuns:m,projectId:f,viewStateKey:h,issueLinkState:g,initialAssignees:v,initialWorkspaces:y,initialStatuses:j,initialSearch:k,searchFilters:N,searchWithinLoadedIssues:S=!1,baseCreateIssueDefaults:D,createIssueLabel:R,defaultSortField:E,showProgressSummary:C=!1,parentIssueIdForCostSummary:I,enableRoutineVisibilityFilter:O=!1,hasMoreIssues:z=!1,isLoadingMoreIssues:B=!1,mutedIssueIds:L,issueBadgeById:_,onLoadMoreIssues:U,onSearchChange:F,rowPresentation:Y="legacy",toolbarContext:se,toolbarPresentation:me="legacy",listHeader:oe,onUpdateIssue:$}){const T=(0,b.useRef)(null),te=xa(),ce=Rn(),[ae,Ce]=(0,b.useState)(null),ue=(0,b.useRef)(!0);(0,b.useEffect)(()=>{const H=r(()=>{ue.current=!0},"handlePointerMove");return window.addEventListener("mousemove",H,{passive:!0}),()=>window.removeEventListener("mousemove",H)},[]);const we=(0,b.useRef)(null),Ae=(0,b.useCallback)(H=>{ue.current&&(we.current=H,Ce(Q=>Q===null?Q:null))},[]),{selectedCompanyId:je}=bt(),{openNewIssue:he}=Ms(),{data:Te}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn")}),{data:Ve}=be({queryKey:P.access.companyUserDirectory(je),queryFn:r(()=>wi.listUserDirectory(je),"queryFn"),enabled:!!je}),{data:De}=be({queryKey:P.instance.experimentalSettings,queryFn:r(()=>fa.getExperimental(),"queryFn"),retry:!1}),Se=Te?.user?.id??Te?.session?.userId??null,ut=De!==void 0,wt=De?.enableIsolatedWorkspaces===!0,kt=De?.enableExternalObjects===!0,$t=je?`${h}:${je}`:h,le={companyId:je??"__unscoped__",collectionKey:h,legacyViewStorageKey:$t,legacyColumnsStorageKey:J9($t)},Ue=v?.join("|")??"",Fe=y?.join("|")??"",it=j?`set:${j.join("|")}`:"",Vt=(0,b.useRef)(null);Vt.current===null&&(Vt.current=ok(le));const Qt=Vt.current,[V,Ct]=(0,b.useState)(()=>lk(Qt,v,y,E,j)),[_e,ze]=(0,b.useState)(null),[Je,rt]=(0,b.useState)(""),[At,Wt]=(0,b.useState)(k??""),[mn,Zt]=(0,b.useState)(_A),[_t,Et]=(0,b.useState)(Qt.columns),ln=(0,b.useRef)(!1),[Qn,dt]=(0,b.useState)(!1),wn=(0,b.useDeferredValue)(At).trim().toLowerCase();(0,b.useEffect)(()=>{Wt(k??"")},[k]);const{data:Dt}=be({queryKey:P.issues.labels(je),queryFn:r(()=>dn.listLabels(je),"queryFn"),enabled:!!je}),an=(0,b.useMemo)(()=>({currentUserId:Se,agents:l,projects:c,labels:Dt}),[l,Se,Dt,c]),Mt=(0,b.useMemo)(()=>Fl(wn,an),[wn,an]),pt=Mt.query,Pe=pt.length>0||lC(Mt.filters),Me=Pe&&!S;(0,b.useEffect)(()=>{Pe||dt(!1)},[Pe]);const $e=(0,b.useRef)(`${$t}::${Ue}::${Fe}::${it}`);(0,b.useEffect)(()=>{const H=`${$t}::${Ue}::${Fe}::${it}`;if($e.current!==H){$e.current=H;const Q=ok(le);Ct(lk(Q,v,y,E,j)),Et(Q.columns)}},[$t,v,Ue,y,Fe,j,it,E,le.companyId,le.collectionKey,le.legacyViewStorageKey,le.legacyColumnsStorageKey]);const He=(0,b.useCallback)(H=>{Ct(Q=>{const X={...Q,...H};return Rg(le,{viewState:X,columns:_t}),X})},[le.companyId,le.collectionKey,le.legacyColumnsStorageKey,le.legacyViewStorageKey,_t]);(0,b.useEffect)(()=>{!ut||kt||V.externalObjectStatuses.length===0||He({externalObjectStatuses:[]})},[ut,kt,He,V.externalObjectStatuses.length]),(0,b.useEffect)(()=>{const H=new Set(e.map(X=>X.parentId).filter(Boolean)),Q=V.collapsedParents.filter(X=>H.has(X));Q.length!==V.collapsedParents.length&&He({collapsedParents:Q})},[e]);const Ot=(0,b.useMemo)(()=>{if(!Pe)return{};const H={...dz(V),...cC(Mt.filters)};return f&&(H.projectId=f),H},[Pe,Mt.filters,f,V]),{data:lt=[]}=be({queryKey:[...P.issues.search(je,pt,f),N??{},Ot,"compact",fd,O?"with-routine-executions":"without-routine-executions"],queryFn:r(({signal:H})=>dn.listCompact(je,{...Ot,...pt.length>0?{q:pt}:{},projectId:f,limit:fd,...N,...O?{includeRoutineExecutions:!0}:{}},{signal:H}).then(Q=>Q),"queryFn"),enabled:!!je&&Me,placeholderData:r(H=>H,"placeholderData")}),zt=Kg({queries:H9.map(H=>({queryKey:[...P.issues.list(je??"__no-company__"),"board-column",H,pt,Ot,f??"__all-projects__",N??{},"compact",md,O?"with-routine-executions":"without-routine-executions"],queryFn:r(({signal:Q})=>Ot.status&&!Ot.status.split(",").includes(H)?Promise.resolve([]):dn.listCompact(je,{...Ot,...N,...pt.length>0?{q:pt}:{},projectId:f,status:H,limit:md,...O?{includeRoutineExecutions:!0}:{}},{signal:Q}).then(X=>X),"queryFn"),enabled:!!je&&V.viewMode==="board"&&!S,placeholderData:r(Q=>Q,"placeholderData")}))}),{data:Jt=[]}=be({queryKey:je?P.executionWorkspaces.summaryList(je):["execution-workspaces","__disabled__"],queryFn:r(()=>Rf.listSummaries(je),"queryFn"),enabled:!!je&&wt}),Lt=(0,b.useCallback)(H=>!H||!l?null:l.find(Q=>Q.id===H)?.name??null,[l]),pn=(0,b.useMemo)(()=>Oz(Ve?.users),[Ve?.users]),hn=(0,b.useMemo)(()=>Lz(Ve?.users),[Ve?.users]),on=(0,b.useMemo)(()=>{const H=new Map;for(const Q of c??[])H.set(Q.id,{name:Q.name,color:Q.color??null});return H},[c]),An=(0,b.useMemo)(()=>{const H=new Map;for(const Q of c??[])for(const X of Q.workspaces??[])H.set(X.id,{name:X.name||Q.name,projectId:Q.id});return H},[c]),Dn=(0,b.useMemo)(()=>{const H=new Map;for(const Q of c??[]){const X=Q.executionWorkspacePolicy?.defaultProjectWorkspaceId??Q.primaryWorkspace?.id??null;X&&H.set(Q.id,X)}return H},[c]),Ja=(0,b.useMemo)(()=>new Set(Dn.values()),[Dn]),ma=(0,b.useMemo)(()=>{const H=new Map;for(const Q of Jt){const X=Q.projectWorkspaceId?An.get(Q.projectWorkspaceId)??null:null;H.set(Q.id,{name:Q.name,mode:Q.mode,projectWorkspaceId:Q.projectWorkspaceId??null,projectId:X?.projectId??null})}return H},[Jt,An]),Aa=(0,b.useMemo)(()=>({executionWorkspaceById:ma,defaultProjectWorkspaceIdByProjectId:Dn}),[Dn,ma]),es=(0,b.useMemo)(()=>{const H=new Map;for(const[Q,X]of An)wy({id:Q},Ja)&&H.set(Q,X.name);for(const[Q,X]of ma)wy({id:Q,mode:X.mode,projectWorkspaceId:X.projectWorkspaceId},Ja)&&H.set(Q,X.name);return H},[Ja,ma,An]),pa=(0,b.useMemo)(()=>{const H=new Map,Q=new Set;Se&&H.set(`user:${Se}`,{id:`user:${Se}`,label:Se==="local-board"?"Board":"Me",kind:"user",searchText:Se==="local-board"?"board me human local-board":`me board human ${Se}`});for(const X of e)if(X.createdByUserId){const Ie=`user:${X.createdByUserId}`;H.has(Ie)||H.set(Ie,{id:Ie,label:Pr(X.createdByUserId,Se)??X.createdByUserId.slice(0,5),kind:"user",searchText:`${X.createdByUserId} board user human`})}for(const X of l??[]){Q.add(X.id);const Ie=`agent:${X.id}`;H.has(Ie)||H.set(Ie,{id:Ie,label:X.name,kind:"agent",searchText:`${X.name} ${X.id} agent`})}for(const X of e)if(X.createdByAgentId&&!Q.has(X.createdByAgentId)){const Ie=`agent:${X.createdByAgentId}`;H.has(Ie)||H.set(Ie,{id:Ie,label:X.createdByAgentId.slice(0,8),kind:"agent",searchText:`${X.createdByAgentId} agent`})}return[...H.values()].sort((X,Ie)=>X.kind!==Ie.kind?X.kind==="user"?-1:1:X.label.localeCompare(Ie.label))},[l,Se,e]),xt=(0,b.useMemo)(()=>new Set(_t),[_t]),kn=(0,b.useMemo)(()=>FM(wt),[wt]),Jn=(0,b.useMemo)(()=>new Set(kn),[kn]),Os=(0,b.useMemo)(()=>jA(e,d??new Set),[e,d]),Kn=(0,b.useMemo)(()=>P9(m,e),[e,m]),bs=(0,b.useMemo)(()=>Zq.filter(H=>xt.has(H)&&Jn.has(H)&&(Y==="legacy"||H!=="updated")),[Jn,Y,xt]),Wn=(0,b.useMemo)(()=>{const H=new Map;for(const Q of e)H.set(Q.id,Q);return H},[e]),Sn=(0,b.useMemo)(()=>{const H=new Map;for(const Q of e)H.set(Q.id,Q.identifier?`${Q.identifier}: ${Q.title}`:Q.title);return H},[e]),Ua=(0,b.useMemo)(()=>{if(V.viewMode!=="board"||S)return null;const H=new Map;let Q=!1;for(const X of zt){Q||=X.isPending;for(const Ie of X.data??[])H.set(Ie.id,Ie)}return H.size>0?[...H.values()]:Q?e:[]},[zt,e,S,V.viewMode]),ba=(0,b.useMemo)(()=>V.viewMode==="board"&&!S&&zt.some(H=>(H.data?.length??0)===md),[zt,S,V.viewMode]),Mn=(0,b.useMemo)(()=>Ua??(Me?lt:e),[Ua,e,Me,lt]),_a=(0,b.useMemo)(()=>{if(!Pe||!S)return Mn;const H=uC(pt);return Mn.filter(Q=>fz(Q,H)&&mz(Q,Mt.filters))},[Pe,pt,Mt.filters,S,Mn]),_n=Me&&!Qn&&V.viewMode==="list",cn=V.externalObjectStatuses.length>0,Ls=(0,b.useMemo)(()=>V.viewMode==="list"||cn?_a.map(H=>H.id):[],[cn,_a,V.viewMode]),{summaries:zs,isLoading:ha,isReady:va}=Dq(je,Ls),vs=(0,b.useMemo)(()=>({...Aa,externalObjectSummaryByIssueId:zs,externalObjectSummariesReady:va&&!ha}),[ha,va,zs,Aa]),Ps=cn&&ha&&!va,Pt=(0,b.useMemo)(()=>{const H=rS(_a,V,Se,O,d,vs);return _n?H:e7(H,V)},[_n,_a,V,Se,O,d,vs]),ts=(0,b.useMemo)(()=>Kq(C,e.length)?qq(e):null,[e,C]),$a=(0,b.useMemo)(()=>E==="workflow"&&V.groupBy==="none",[E,V.groupBy]),Ba=(0,b.useMemo)(()=>{if(!$a)return null;const H=new Set(Pt.map(et=>et.id)),Q=c7(Pt,V.nestingEnabled),X=u7(Pt,V.nestingEnabled),Ie=new Map;return Pt.forEach(et=>{const Ut=(et.blockedBy??[]).map(ot=>ot.id).filter(ot=>{if(!H.has(ot))return!1;const sn=Wn.get(ot);return sn?sn.status!=="done"&&sn.status!=="cancelled":!1}),En=d7(et,Ut,X.get(et.id));Ie.set(et.id,En?[]:Ut)}),{stepNumberByIssueId:Q,unresolvedVisibleBlockersByIssueId:Ie,currentStepIssueId:(Pt.find(et=>o7(et.status))??null??Pt.find(et=>et.status==="blocked")??null)?.id??null}},[$a,Pt,Wn,V.nestingEnabled]),ya=s3(V,O),On=V.viewMode==="board"&&Pt.length>100,ys=V.boardCardDensity==="compact"||V.boardCardDensity==="auto"&&On,Ea=(0,b.useMemo)(()=>V.boardColdLaneMode==="collapsed"||V.boardColdLaneMode==="auto"&&On?[...N9]:[],[On,V.boardColdLaneMode]),ie=V.boardCardDensity!=="auto"||V.boardColdLaneMode!=="auto"||V.boardColumnPageSize!==10,Ee=(0,b.useMemo)(()=>{if(V.groupBy==="none")return[{key:"__all",label:null,items:Pt}];if(V.groupBy==="status"){const Q=Tl(Pt,X=>X.status);return Dd.filter(X=>Q[X]?.length).map(X=>({key:X,label:Uh(X),items:Q[X]}))}if(V.groupBy==="priority"){const Q=Tl(Pt,X=>X.priority);return Ph.filter(X=>Q[X]?.length).map(X=>({key:X,label:Uh(X),items:Q[X]}))}if(V.groupBy==="workspace"){const Q=Tl(Pt,X=>jy(X,Aa)??"__no_workspace");return Object.keys(Q).sort((X,Ie)=>X==="__no_workspace"?1:Ie==="__no_workspace"?-1:(Q[Ie]?.length??0)-(Q[X]?.length??0)).map(X=>({key:X,label:X==="__no_workspace"?"No Workspace":es.get(X)??X.slice(0,8),items:Q[X]}))}if(V.groupBy==="project"){const Q=Tl(Pt,X=>X.projectId??"__no_project");return Object.keys(Q).sort((X,Ie)=>{if(X==="__no_project")return 1;if(Ie==="__no_project")return-1;const et=on.get(X)?.name??X,Ut=on.get(Ie)?.name??Ie;return et.localeCompare(Ut)}).map(X=>({key:X,label:X==="__no_project"?"No Project":on.get(X)?.name??X.slice(0,8),items:Q[X]}))}if(V.groupBy==="parent"){const Q=Tl(Pt,X=>X.parentId??"__no_parent");return Object.keys(Q).sort((X,Ie)=>X==="__no_parent"?1:Ie==="__no_parent"?-1:(Q[Ie]?.length??0)-(Q[X]?.length??0)).map(X=>({key:X,label:X==="__no_parent"?"No Parent":Sn.get(X)??X.slice(0,8),items:Q[X]}))}const H=Tl(Pt,Q=>Q.assigneeAgentId??(Q.assigneeUserId?`__user:${Q.assigneeUserId}`:"__unassigned"));return Object.keys(H).map(Q=>({key:Q,label:Q==="__unassigned"?"Unassigned":Q.startsWith("__user:")?Pr(Q.slice(7),Se,pn)??"User":Lt(Q)??Q.slice(0,8),items:H[Q]}))},[Pt,Aa,V.groupBy,l,Lt,Se,es,Sn,pn,on]),Oe=(0,b.useMemo)(()=>JSON.stringify([$t,wn,V.statuses,V.priorities,V.assignees,V.creators,V.labels,V.projects,V.workspaces,V.liveOnly??!1,V.externalObjectStatuses,V.hideRoutineExecutions,V.sortField,V.sortDir,V.groupBy,V.viewMode,V.nestingEnabled,_n]),[$t,wn,V.statuses,V.priorities,V.assignees,V.creators,V.labels,V.projects,V.workspaces,V.liveOnly,V.externalObjectStatuses,V.hideRoutineExecutions,V.sortField,V.sortDir,V.groupBy,V.viewMode,V.nestingEnabled,_n]),at=(0,b.useRef)({identity:"",keptRootIds:new Set,seenIds:new Set,knownIds:new Set}),gt=(0,b.useMemo)(()=>{const H=new Map;if(V.viewMode!=="list")return H;const Q=at.current.identity===Oe?at.current:null;for(const X of Ee){if(!V.nestingEnabled){H.set(X.key,{roots:X.items,childMap:new Map});continue}let Ie;if(Q){Ie=new Set(Q.keptRootIds);for(const et of X.items)et.parentId&&!Q.knownIds.has(et.id)&&Q.seenIds.has(et.parentId)&&Ie.add(et.id)}H.set(X.key,lf(X.items,Ie))}return H},[Ee,Oe,V.nestingEnabled,V.viewMode]),qt=r(H=>gt.get(H.key)??(V.nestingEnabled?lf(H.items):{roots:H.items,childMap:new Map}),"issueTreeForGroup"),Ia=(0,b.useMemo)(()=>{if(V.viewMode!=="list")return[];const H=[];let Q=0;for(const X of Ee){const Ie=!!X.label&&V.collapsedGroups.includes(X.key);X.label&&H.push({type:"group",key:X.key,collapsed:Ie});const{roots:et,childMap:Ut}=qt(X),En=r(ot=>{Q+=1;const sn=Ut.get(ot.id)??[],It=!V.collapsedParents.includes(ot.id);if(Ie||H.push({type:"issue",issue:ot,hasChildren:sn.length>0,expanded:It,budgetOrdinal:Q}),It)for(const ve of sn)En(ve)},"walk");for(const ot of et)En(ot)}return H},[Ee,V.viewMode,V.collapsedGroups,V.collapsedParents,V.nestingEnabled]),Z=(0,b.useRef)({flatNavEntries:Ia,selectedNavKey:ae,viewMode:V.viewMode,issueLinkState:g,collapsedGroups:V.collapsedGroups,collapsedParents:V.collapsedParents,updateView:He});Z.current={flatNavEntries:Ia,selectedNavKey:ae,viewMode:V.viewMode,issueLinkState:g,collapsedGroups:V.collapsedGroups,collapsedParents:V.collapsedParents,updateView:He};const Ne=(0,b.useCallback)(H=>{if(H.startsWith("group:")){const X=T.current?.querySelector(`[data-issues-group-key="${Dg(H.slice(6))}"]`);return X instanceof HTMLElement?X:null}const Q=T.current?.querySelector(`[data-issue-row-id="${Dg(H.slice(6))}"]`)?.querySelector("[data-inbox-issue-link]");return Q instanceof HTMLElement?Q:null},[]);(0,b.useEffect)(()=>{const H=r(Q=>{if(Q.defaultPrevented)return;const X=Q.target;if(!(X instanceof HTMLElement)||Jl(X)||hg(document)||Q.metaKey||Q.ctrlKey||Q.altKey)return;const Ie=Z.current;if(Ie.viewMode!=="list"||Ie.flatNavEntries.length===0)return;const et=r(ot=>ot?Ie.flatNavEntries.findIndex(sn=>pd(sn)===ot):-1,"indexOfKey"),Ut=et(we.current),En=ue.current&&Ut>=0?Ut:et(Ie.selectedNavKey);switch(Q.key){case"j":case"ArrowDown":case"k":case"ArrowUp":{Q.preventDefault(),ue.current=!1;const ot=Q.key==="j"||Q.key==="ArrowDown"?"next":"previous",sn=GM(En,Ie.flatNavEntries.length,ot),It=Ie.flatNavEntries[sn];if(!It)break;Ce(pd(It)),It.type==="issue"&&Zt(ve=>Math.max(ve,It.budgetOrdinal+1));break}case"ArrowLeft":case"ArrowRight":{const ot=Ie.flatNavEntries[En];if(!ot)return;const sn=Q.key==="ArrowLeft";if(ot.type==="group"){Q.preventDefault(),ue.current=!1,Ce(pd(ot)),Ie.updateView({collapsedGroups:sn?Ie.collapsedGroups.includes(ot.key)?Ie.collapsedGroups:[...Ie.collapsedGroups,ot.key]:Ie.collapsedGroups.filter(It=>It!==ot.key)});break}if(!ot.hasChildren)return;Q.preventDefault(),ue.current=!1,Ce(pd(ot)),Ie.updateView({collapsedParents:sn?Ie.collapsedParents.includes(ot.issue.id)?Ie.collapsedParents:[...Ie.collapsedParents,ot.issue.id]:Ie.collapsedParents.filter(It=>It!==ot.issue.id)});break}case"Enter":{const ot=Ie.flatNavEntries[En];if(!ot||ot.type!=="issue")return;Q.preventDefault();const sn=ot.issue,It=sn.identifier??sn.id,ve=Vg(Ie.issueLinkState,sn);Rh(It,ve),oE(ce,It,{issue:sn}),te(Cd(It),{state:ve});break}default:return}},"handleKeyDown");return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[te,ce]);const Ke=(0,b.useMemo)(()=>{if(V.viewMode!=="list")return[];const H=[];for(const Q of Ee){const{roots:X,childMap:Ie}=qt(Q),et=r(Ut=>{if(H.push(Ut.id),!V.collapsedParents.includes(Ut.id))for(const En of Ie.get(Ut.id)??[])et(En)},"walk");for(const Ut of X)et(Ut)}return H},[Ee,V.collapsedParents,V.nestingEnabled,V.viewMode]),Xe=(0,b.useRef)(null),Qe=(0,b.useMemo)(()=>V.viewMode==="list"?t7(Xe.current,Oe,Ke,mn):mn,[Ke,Oe,mn,V.viewMode]);(0,b.useLayoutEffect)(()=>{V.viewMode==="list"&&(Xe.current={identity:Oe,ids:Ke,limit:Qe},mn!==Qe&&Zt(Qe))},[Ke,Oe,Qe,mn,V.viewMode]),(0,b.useEffect)(()=>{ae&&Ne(ae)?.scrollIntoView({block:"nearest"})},[Ne,Qe,ae]),(0,b.useLayoutEffect)(()=>{if(!V.nestingEnabled||V.viewMode!=="list")return;const H=at.current,Q=H.identity===Oe?H:{identity:Oe,keptRootIds:new Set,seenIds:new Set,knownIds:new Set},X=Ke.slice(0,Qe);for(const Ie of X)Q.seenIds.add(Ie);for(const Ie of Ee)for(const et of Ie.items)Q.knownIds.add(et.id);for(const Ie of gt.values())for(const et of Ie.roots)et.parentId&&(Q.seenIds.has(et.id)||Q.knownIds.has(et.parentId))&&Q.keptRootIds.add(et.id);at.current=Q},[Ke,Ee,gt,Oe,Qe,V.nestingEnabled,V.viewMode]);const ft=(0,b.useRef)(null),vt=(0,b.useCallback)(()=>{const H=T.current;if(!H||V.viewMode!=="list"){ft.current=null;return}ft.current=q9(H,hd(H),Oe)},[Oe,V.viewMode]);(0,b.useEffect)(()=>{if(V.viewMode!=="list")return;const H=hd(T.current)??window;return H.addEventListener("scroll",vt,{passive:!0}),()=>H.removeEventListener("scroll",vt)},[vt,V.viewMode]),(0,b.useLayoutEffect)(()=>{const H=T.current,Q=ft.current;if(H&&Q&&Q.identity===Oe&&V.viewMode==="list"){const X=hd(H),Ie=F9(H,X,Q);if(Ie===null)return;Ie!==0&&(X?X.scrollTop+=Ie:window.scrollBy(0,Ie))}vt()},[Ke,vt,Oe,Qe,V.viewMode]);const un=(0,b.useRef)(null),Ln=!!oe&&V.viewMode==="list"&&!V.liveOnly&&wn.length===0;(0,b.useLayoutEffect)(()=>{const H=un.current;if(!Ln||!H||typeof ResizeObserver>"u")return;const Q=new ResizeObserver(()=>vt());return Q.observe(H),()=>Q.disconnect()},[vt,Ln]);const Ta=V.viewMode==="list"&&Qe<Pt.length,zn=Math.max(Pt.length-Qe,0),Ft=(0,b.useCallback)(()=>{if(V.viewMode==="list"){if(Ta){Zt(Math.min(Pt.length,Qe+U9));return}z&&!B&&U?.()}},[Pt.length,z,Ta,B,U,Qe,V.viewMode]),Nn=V.viewMode==="list"&&!t&&(Ta||z&&!B);(0,b.useEffect)(()=>{if(!Nn)return;let H=null;const Q=hd(T.current),X=Q??window,Ie=r((En="scroll")=>{H===null&&(H=window.requestAnimationFrame(()=>{H=null;const ot=Q?.scrollHeight??document.documentElement.scrollHeight;if(ot===0)return;const sn=Q?.clientHeight??window.innerHeight,It=Q?Q.scrollTop+Q.clientHeight:window.scrollY+window.innerHeight,ve=ot>sn+1;if(It>=ot-$9){if(En==="initial"&&!Ta&&z&&!ve){if(ln.current)return;ln.current=!0}Ft()}}))},"checkScrollPosition"),et=r(()=>Ie("scroll"),"handleScroll"),Ut=r(()=>Ie("resize"),"handleResize");return X.addEventListener("scroll",et,{passive:!0}),window.addEventListener("resize",Ut),Ie("initial"),()=>{X.removeEventListener("scroll",et),window.removeEventListener("resize",Ut),H!==null&&window.cancelAnimationFrame(H)}},[Nn,z,Ta,Ft]);const ja=(0,b.useCallback)(H=>{const Q=H?.key,X={...D??{}};if(f&&X.projectId===void 0&&(X.projectId=f),Q){if(V.groupBy==="status")X.status=Q;else if(V.groupBy==="priority")X.priority=Q;else if(V.groupBy==="assignee"&&Q!=="__unassigned")Q.startsWith("__user:")?X.assigneeUserId=Q.slice(7):X.assigneeAgentId=Q;else if(V.groupBy==="project"&&Q!=="__no_project")X.projectId=Q;else if(V.groupBy==="workspace"&&Q!=="__no_workspace"){const Ie=H?.items.find(Ut=>Ut.executionWorkspaceId===Q||Ut.projectWorkspaceId===Q)??null,et=ma.get(Q);if(et){X.executionWorkspaceId=Q,X.executionWorkspaceMode="reuse_existing",et.projectWorkspaceId&&(X.projectWorkspaceId=et.projectWorkspaceId);const Ut=et.projectId??(et.projectWorkspaceId?An.get(et.projectWorkspaceId)?.projectId:null)??(Ie?.executionWorkspaceId===Q?Ie.projectId:null);Ut&&(X.projectId=Ut)}else{const Ut=An.get(Q);Ut&&(X.projectWorkspaceId=Q,X.projectId=Ut.projectId)}}else if(V.groupBy==="parent"&&Q!=="__no_parent"){const Ie=Wn.get(Q);Ie?Object.assign(X,R9(Ie,Se)):X.parentId=Q}}return X},[D,Se,ma,Wn,f,An,V.groupBy]),Ka=R?`Create ${R}`:"Create Task",Gt=R?`New ${R}`:"New Task",ga=(0,b.useCallback)(H=>{he(ja(H))},[ja,he]),or=(0,b.useCallback)(H=>{He({workspaces:[H]})},[He]),ns=(0,b.useCallback)(H=>{const Q=iN(H);Et(Q),Rg(le,{viewState:V,columns:Q})},[le.companyId,le.collectionKey,le.legacyColumnsStorageKey,le.legacyViewStorageKey,V]),Oc=(0,b.useCallback)((H,Q)=>{if(Q){ns([..._t,H]);return}ns(_t.filter(X=>X!==H))},[ns,_t]),Ys=(0,b.useCallback)((H,Q,X=null)=>{$(H,{assigneeAgentId:Q,assigneeUserId:X}),ze(null),rt("")},[$]);let qa=V.viewMode==="list"?Qe:Number.POSITIVE_INFINITY;return(0,a.jsxs)("div",{ref:T,className:"wardmote-issue-list space-y-4",children:[ts?(0,a.jsx)(p7,{summary:ts,issueLinkState:g,parentIssueIdForCostSummary:I}):null,(0,a.jsx)(me==="collection"?w9:f7,{className:"wardmote-task-list-toolbar",ariaLabel:me==="collection"?"Task controls":void 0,context:se?(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[se,(0,a.jsxs)(pe,{size:"sm",variant:"secondary","aria-label":Gt,onClick:r(()=>ga(),"onClick"),children:[(0,a.jsx)(Xa,{className:"h-4 w-4 sm:mr-1"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:Gt})]})]}):(0,a.jsxs)(pe,{size:"sm",variant:"secondary","aria-label":Gt,onClick:r(()=>ga(),"onClick"),children:[(0,a.jsx)(Xa,{className:"h-4 w-4 sm:mr-1"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:Gt})]}),search:(0,a.jsx)(m7,{value:At,context:an,onDebouncedChange:r(H=>{Wt(H),F?.(H)},"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 ${V.viewMode==="list"?"bg-bg-3 text-ink":"text-ink-3 hover:text-ink"}`,onClick:r(()=>He({viewMode:"list"}),"onClick"),title:"List view","aria-label":"List view","aria-pressed":V.viewMode==="list",children:(0,a.jsx)(bT,{className:"h-3.5 w-3.5"})}),(0,a.jsx)("button",{className:`flex h-8 w-8 items-center justify-center transition-colors ${V.viewMode==="board"?"bg-bg-3 text-ink":"text-ink-3 hover:text-ink"}`,onClick:r(()=>He({viewMode:"board"}),"onClick"),title:"Board view","aria-label":"Board view","aria-pressed":V.viewMode==="board",children:(0,a.jsx)(AT,{className:"h-3.5 w-3.5"})})]}),V.viewMode==="list"&&(0,a.jsx)(pe,{active:V.nestingEnabled,type:"button",variant:"secondary",size:"icon",className:G("hidden h-8 w-8 shrink-0 sm:inline-flex"),onClick:r(()=>He({nestingEnabled:!V.nestingEnabled}),"onClick"),title:V.nestingEnabled?"Disable parent-child nesting":"Enable parent-child nesting",children:(0,a.jsx)(qS,{className:"h-3.5 w-3.5"})}),V.viewMode==="board"&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(pe,{active:ys,type:"button",variant:"secondary",size:"icon",className:G("h-8 w-8 shrink-0"),onClick:r(()=>He({boardCardDensity:ys?"comfortable":"compact"}),"onClick"),title:ys?"Use comfortable cards":"Use compact cards",children:(0,a.jsx)(iT,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(pe,{active:Ea.length>0,type:"button",variant:"secondary",size:"icon",className:G("h-8 w-8 shrink-0"),onClick:r(()=>He({boardColdLaneMode:Ea.length>0?"expanded":"collapsed"}),"onClick"),title:Ea.length>0?"Expand cold lanes":"Collapse cold lanes",children:(0,a.jsx)(jT,{className:"h-3.5 w-3.5"})}),(0,a.jsxs)(xs,{children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsxs)(pe,{active:V.boardColumnPageSize!==10,type:"button",variant:"secondary",size:"sm",className:G("h-8 shrink-0 gap-1.5 px-2"),title:"Cards per column",children:[(0,a.jsx)(xT,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"min-w-4 text-xs tabular-nums",children:V.boardColumnPageSize})]})}),(0,a.jsx)(gs,{align:"end",className:"w-40 p-0",children:(0,a.jsx)("div",{className:"p-2 space-y-0.5",children:kA.map(H=>(0,a.jsxs)("button",{type:"button",className:G("flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-sm",V.boardColumnPageSize===H?"bg-bg-3/50 text-ink":"text-ink-3 hover:bg-bg-3/50"),onClick:r(()=>He({boardColumnPageSize:H}),"onClick"),children:[(0,a.jsxs)("span",{children:[H," per column"]}),V.boardColumnPageSize===H&&(0,a.jsx)(_s,{className:"h-3.5 w-3.5"})]},H))})})]}),(0,a.jsx)(pe,{type:"button",variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",onClick:r(()=>He({boardCardDensity:"auto",boardColdLaneMode:"expanded",boardColumnPageSize:10}),"onClick"),disabled:!ie,title:"Reset board density",children:(0,a.jsx)(ec,{className:"h-3.5 w-3.5"})})]}),(0,a.jsx)(s9,{availableColumns:kn,visibleColumnSet:xt,onToggleColumn:Oc,showDateGroupSeparators:V.showDateGroupSeparators,onToggleDateGroupSeparators:r(H=>He({showDateGroupSeparators:H}),"onToggleDateGroupSeparators"),onResetColumns:r(()=>ns(nN),"onResetColumns"),title:"Choose which task columns stay visible",iconOnly:!0,rowPresentation:Y}),(0,a.jsx)(m9,{state:V,onChange:He,buttonVariant:"secondary",activeFilterCount:ya,agents:l,creators:pa,projects:c?.map(H=>({id:H.id,name:H.name})),labels:Dt?.map(H=>({id:H.id,name:H.name,color:H.color})),currentUserId:Se,enableExternalObjectFilters:kt,enableRoutineVisibilityFilter:O,iconOnly:!0,presentation:Y==="task"?"streamlined":"legacy"}),V.viewMode==="list"&&(0,a.jsxs)(xs,{children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsx)(pe,{variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",title:"Sort",children:(0,a.jsx)(TE,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(gs,{align:"end",className:"w-48 p-0",children:(0,a.jsxs)("div",{className:"p-2 space-y-0.5",children:[Me&&(0,a.jsx)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${_n?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>dt(!1),"onClick"),children:(0,a.jsx)("span",{children:"Relevance"})}),[["workflow","Workflow"],["status","Status"],["priority","Priority"],["title","Title"],["created","Created"],["updated","Updated"]].filter(([H])=>H!=="priority").map(([H,Q])=>(0,a.jsxs)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${!_n&&V.sortField===H?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>{Me&&dt(!0),_n?He({sortField:H,sortDir:H==="updated"||H==="created"?"desc":"asc"}):V.sortField===H?He({sortDir:V.sortDir==="asc"?"desc":"asc"}):He({sortField:H,sortDir:"asc"})},"onClick"),children:[(0,a.jsx)("span",{children:Q}),!_n&&V.sortField===H&&(0,a.jsx)("span",{className:"text-xs text-ink-3",children:V.sortDir==="asc"?"↑":"↓"})]},H))]})})]}),V.viewMode==="list"&&(0,a.jsxs)(xs,{children:[(0,a.jsx)(hs,{asChild:!0,children:(0,a.jsx)(pe,{variant:"secondary",size:"icon",className:"h-8 w-8 shrink-0",title:"Group",children:(0,a.jsx)(ff,{className:"h-3.5 w-3.5"})})}),(0,a.jsx)(gs,{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(([H])=>H!=="priority").map(([H,Q])=>(0,a.jsxs)("button",{className:`flex items-center justify-between w-full px-2 py-1.5 text-sm rounded-sm ${V.groupBy===H?"bg-bg-3/50 text-ink":"hover:bg-bg-3/50 text-ink-3"}`,onClick:r(()=>He({groupBy:H}),"onClick"),children:[(0,a.jsx)("span",{children:Q}),V.groupBy===H&&(0,a.jsx)(_s,{className:"h-3.5 w-3.5"})]},H))})})]})]})}),Ln?(0,a.jsx)("div",{ref:un,children:oe}):null,(t||Ps)&&(0,a.jsx)(k9,{variant:"issues-list"}),i&&(0,a.jsx)("p",{className:"text-sm text-bad",children:i.message}),Me&<.length===fd&&(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Showing up to ",fd," matches. Refine the search to narrow further."]}),ba&&(0,a.jsxs)("p",{className:"text-xs text-ink-3",children:["Some board columns are showing up to ",md," tasks. Refine filters or search to reveal the rest."]}),!t&&!Ps&&Pt.length===0&&V.viewMode==="list"&&(0,a.jsx)(o9,{icon:Td,message:"No tasks match the current filters or search.",action:Ka,onAction:r(()=>ga(),"onAction")}),V.viewMode==="board"?(0,a.jsx)(T9,{issues:Pt,agents:l,liveIssueIds:d,compactCards:ys,collapsedStatuses:Ea,initialVisibleCount:V.boardColumnPageSize,revealIncrement:V.boardColumnPageSize,onUpdateIssue:$}):(0,a.jsxs)("div",{className:"-mx-2 sm:mx-0",children:[Ee.map(H=>qa<=0?null:(0,a.jsxs)(Dk,{open:!V.collapsedGroups.includes(H.key),onOpenChange:r(Q=>{He({collapsedGroups:Q?V.collapsedGroups.filter(X=>X!==H.key):[...V.collapsedGroups,H.key]})},"onOpenChange"),children:[H.label&&(0,a.jsx)("div",{"data-issues-group-key":H.key,className:G("rounded-lg px-3 sm:pl-0 sm:pr-4",ae===`group:${H.key}`?"bg-bg-3/50":"hover:bg-bg-3/50"),onClick:r(()=>Ce(`group:${H.key}`),"onClick"),onMouseEnter:r(()=>Ae(`group:${H.key}`),"onMouseEnter"),children:(0,a.jsx)(c9,{label:H.label,collapsible:!0,collapsed:V.collapsedGroups.includes(H.key),onToggle:r(()=>{He({collapsedGroups:V.collapsedGroups.includes(H.key)?V.collapsedGroups.filter(Q=>Q!==H.key):[...V.collapsedGroups,H.key]})},"onToggle"),trailing:(0,a.jsx)(pe,{variant:"ghost",size:"icon-xs",className:"-mr-2",title:`New task in ${H.label}`,"aria-label":`New task in ${H.label}`,onClick:r(()=>ga(H),"onClick"),children:(0,a.jsx)(Xa,{className:"h-3 w-3"})})})}),(0,a.jsx)(Rk,{children:(()=>{const{roots:Q,childMap:X}=qt(H),Ie=r((ve,as)=>{if(qa<=0)return null;qa-=1;const ra=(X.get(ve.id)??[]).length>0,Fa=ra?NA(ve.id,X):0,ea=!V.collapsedParents.includes(ve.id),eo=!(ra&&ea),Ni=ve.projectId?on.get(ve.projectId)??null:null,cr=ve.parentId?Wn.get(ve.parentId)??null:null,Yr=_?.get(ve.id),zf=L?.has(ve.id)===!0,ur=ve.assigneeUserId?hn.get(ve.assigneeUserId)??null:null,Lc=Pr(ve.assigneeUserId,Se,pn)??ur?.label??null,Xr=wk(ve),dr=Xr?.kind==="user"?Xr.id:null,zc=Xr?.kind==="user"?Xr.viaAgentId??null:null,to=r(qe=>{qe.preventDefault(),qe.stopPropagation(),He({collapsedParents:ea?[...V.collapsedParents,ve.id]:V.collapsedParents.filter(wa=>wa!==ve.id)})},"toggleCollapse"),Xs=Ba,no=Xs?.stepNumberByIssueId.get(ve.id)??null,ao=Xs?.unresolvedVisibleBlockersByIssueId.get(ve.id)??[],Pf=Xs?`issue-workflow-row-${ve.id}`:void 0,Pc=Xs&&ve.status==="done"?"text-ink-3":void 0,so=ao.map(qe=>{const wa=Wn.get(qe);if(!wa)return null;const Uc=wa.identifier??wa.id.slice(0,8),Zs=Xs?.stepNumberByIssueId.get(qe);return{blockerId:qe,chipLabel:`blocked by ${Uc}${Zs?` · step ${Zs}`:""}`}}).filter(qe=>qe!==null),fr=so[0]??null,io=Math.max(so.length-1,0),Uf=io>0?` ... and ${io} more`:"",ro=fr?`${fr.chipLabel}${Uf}`:"",lo=so.slice(1).map(qe=>qe.chipLabel).join(", "),Ci=io>0?`${ro}: ${lo}`:ro,$f=Xs&&fr?(0,a.jsx)("button",{type:"button","data-slot":"icon-button",onClick:r(qe=>{qe.preventDefault(),qe.stopPropagation();const wa=document.getElementById(`issue-workflow-row-${fr.blockerId}`);wa&&(wa.scrollIntoView({behavior:"smooth",block:"nearest"}),wa.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:Ci,"aria-label":Ci,children:ro},fr.blockerId):null,oo=Kn.get(ve.id)??null,co=oo?(0,a.jsx)(j9,{issueId:ve.id,run:oo,companyId:je,taskLabel:ve.identifier??ve.id.slice(0,8)}):void 0;return(0,a.jsx)("div",{"data-issue-row-id":ve.id,className:G(Y==="legacy"&&as>0&&uk[Math.min(as,uk.length-1)],eo&&"wardmote-issue-list-row-deferred")||void 0,children:(0,a.jsx)(x9,{issue:ve,presentation:Y,issueLinkState:g,selected:ae===`issue:${ve.id}`,onMouseEnter:r(()=>Ae(`issue:${ve.id}`),"onMouseEnter"),treeGuides:as,chevronInGuide:as>0&&ra,checklistStepNumber:no,checklistCurrentStep:Xs?.currentStepIssueId===ve.id,checklistDependencyChips:$f,checklistRowId:Pf,titleClassName:Pc,externalObjectSummary:zs.get(ve.id)??null,titleSuffix:(0,a.jsxs)(a.Fragment,{children:[ra&&!ea?(0,a.jsxs)("span",{className:"ml-1.5 text-xs text-ink-3",children:["(",Fa," sub-task",Fa!==1?"s":"",")"]}):null,Yr?Yr==="Paused"?(0,a.jsxs)(Bn,{variant:"ghost",className:G("ml-1.5 px-1.5 text-(length:--text-nano)",Nd.paused),"aria-label":"Paused",title:"Paused",children:[(0,a.jsx)(rT,{className:"h-3 w-3"}),"Paused"]}):(0,a.jsx)(Bn,{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:Yr}):null,wA(ve)?(0,a.jsxs)(Bn,{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)(Td,{className:"h-3 w-3"}),"Needs next step"]}):null]}),className:G(zf&&"opacity-70",ae===`issue:${ve.id}`&&"bg-bg-3/50 hover:bg-bg-3/50"),leadingControl:Y==="task"?ra?(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":ea?"Collapse sub-tasks":"Expand sub-tasks",onClick:to,children:(0,a.jsx)(tr,{className:G("h-3.5 w-3.5 transition-transform",ea&&"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:Y==="task"?(0,a.jsxs)("span",{className:"relative inline-flex items-start self-stretch sm:items-center",onClick:r(qe=>{qe.preventDefault(),qe.stopPropagation()},"onClick"),children:[(0,a.jsx)(Vs,{status:ve.status,externalConversationState:ve.externalConversationState,size:"md",blockerAttention:ve.blockerAttention,onChange:r(qe=>$(ve.id,{status:qe}),"onChange")}),ra&&ea?(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:Y==="task"?(0,a.jsx)(nk,{issue:ve,isLive:d?.has(ve.id)===!0,subtreeLiveCount:Os.get(ve.id)??0,showStatus:!1,showIdentifier:!1,checklistStepNumber:no}):void 0,actions:co,showIdentifier:xt.has("id")&&Jn.has("id"),mobileLeading:ra?(0,a.jsx)("button",{type:"button","data-slot":"icon-button",onClick:to,children:(0,a.jsx)(tr,{className:G("h-3.5 w-3.5 transition-transform",ea&&"rotate-90")})}):(0,a.jsx)("span",{className:"inline-flex items-center",onClick:r(qe=>{qe.preventDefault(),qe.stopPropagation()},"onClick"),children:(0,a.jsx)(Vs,{status:ve.status,externalConversationState:ve.externalConversationState,size:"md",blockerAttention:ve.blockerAttention,onChange:r(qe=>$(ve.id,{status:qe}),"onChange")})}),desktopMetaLeading:Y==="legacy"?(0,a.jsxs)(a.Fragment,{children:[ra?(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:to,children:(0,a.jsx)(tr,{className:G("h-3.5 w-3.5 transition-transform",ea&&"rotate-90")})}):(0,a.jsx)("span",{className:"hidden w-4 shrink-0 sm:block"}),(0,a.jsx)(nk,{issue:ve,isLive:d?.has(ve.id)===!0,subtreeLiveCount:Os.get(ve.id)??0,showStatus:xt.has("status")&&Jn.has("status"),showIdentifier:xt.has("id")&&Jn.has("id"),checklistStepNumber:no,statusSlot:(0,a.jsx)("span",{className:"inline-flex items-center",onClick:r(qe=>{qe.preventDefault(),qe.stopPropagation()},"onClick"),children:(0,a.jsx)(Vs,{status:ve.status,externalConversationState:ve.externalConversationState,size:"md",blockerAttention:ve.blockerAttention,onChange:r(qe=>$(ve.id,{status:qe}),"onChange")})})})]}):void 0,mobileTitleMeta:Y==="task"?rf(ve):void 0,mobileMeta:Y==="legacy"?n9(ve).toLowerCase():co,trailingMeta:Y==="task"&&xt.has("updated")&&Jn.has("updated")?rf(ve):void 0,desktopTrailing:bs.length>0?(0,a.jsx)(l9,{issue:ve,columns:bs,projectName:Ni?.name??null,projectColor:Ni?.color??null,workspaceId:jy(ve,Aa),workspaceName:rN(ve,{executionWorkspaceById:ma,projectWorkspaceById:An,defaultProjectWorkspaceIdByProjectId:Dn}),onFilterWorkspace:or,assigneeName:Lt(ve.assigneeAgentId),assigneeAgent:l?.find(qe=>qe.id===ve.assigneeAgentId),creatorAgent:l?.find(qe=>qe.id===ve.createdByAgentId),assigneeUserName:Lc,assigneeUserAvatarUrl:ur?.image??null,creatorAgentName:Lt(ve.createdByAgentId),creatorUserName:dr?hn.get(dr)?.label??null:null,creatorUserAvatarUrl:dr?hn.get(dr)?.image??null:null,viaAgentName:zc?Lt(zc):null,currentUserId:Se,parentIdentifier:cr?.identifier??null,parentTitle:cr?.title??null,assigneeContent:(0,a.jsxs)(xs,{open:_e===ve.id,onOpenChange:r(qe=>{ze(qe?ve.id:null),qe||rt("")},"onOpenChange"),children:[(0,a.jsx)(hs,{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(qe=>{qe.preventDefault(),qe.stopPropagation()},"onClick"),children:ve.assigneeAgentId&&Lt(ve.assigneeAgentId)?(0,a.jsx)(ql,{agent:l.find(qe=>qe.id===ve.assigneeAgentId),size:"sm",className:"min-w-0"}):ve.assigneeUserId?(0,a.jsx)(Lh,{name:Lc??"User",avatarUrl:ur?.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)(zl,{className:"h-3.5 w-3.5"})}),"Assignee"]})})}),(0,a.jsxs)(gs,{className:"w-56 p-1",align:"end",onClick:r(qe=>qe.stopPropagation(),"onClick"),onPointerDownOutside:r(()=>rt(""),"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:Je,onChange:r(qe=>rt(qe.target.value),"onChange"),autoFocus:!0}),(0,a.jsxs)("div",{className:"max-h-48 overflow-y-auto overscroll-contain",children:[(0,a.jsx)("button",{className:G("flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-bg-3/50",!ve.assigneeAgentId&&!ve.assigneeUserId&&"bg-bg-3"),onClick:r(qe=>{qe.preventDefault(),qe.stopPropagation(),Ys(ve.id,null,null)},"onClick"),children:"No responsible"}),Se&&(0,a.jsxs)("button",{className:G("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-bg-3/50",ve.assigneeUserId===Se&&"bg-bg-3"),onClick:r(qe=>{qe.preventDefault(),qe.stopPropagation(),Ys(ve.id,null,Se)},"onClick"),children:[(0,a.jsx)(zl,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,a.jsx)("span",{children:"Me"})]}),(l??[]).filter(qe=>Je.trim()?qe.name.toLowerCase().includes(Je.toLowerCase()):!0).map(qe=>(0,a.jsx)("button",{className:G("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs hover:bg-bg-3/50",ve.assigneeAgentId===qe.id&&"bg-bg-3"),onClick:r(wa=>{wa.preventDefault(),wa.stopPropagation(),Ys(ve.id,qe.id,null)},"onClick"),children:(0,a.jsx)(ql,{agent:qe,size:"sm",className:"min-w-0"})},qe.id))]})]})]})}):void 0})},ve.id)},"renderIssueRow"),et=V.showDateGroupSeparators&&!_n?a7(V):null,Ut=new Date,En=[];let ot=null,sn=null;const It=r((ve,as)=>{const ra=Ie(ve,as);if(ra!==null){if(et&&Y==="task"){const Fa=L9(et(ve),Ut),ea=z9(ot,Fa);ea&&En.push((0,a.jsx)(ck,{label:ea},`date-sep-${ve.id}-${Fa}`)),ot=Fa}else if(et){const Fa=i7(et(ve),Ut.getTime());for(const ea of sn===null?[]:l7(sn,Fa))En.push((0,a.jsx)(ck,{label:r7(ea)},`date-sep-${ve.id}-${ea}`));sn=Fa}if(En.push(ra),!V.collapsedParents.includes(ve.id))for(const Fa of X.get(ve.id)??[])It(Fa,as+1)}},"appendIssueRow");for(const ve of Q)It(ve,0);return En})()})]},H.key)),(zn>0||z||B)&&(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:B?"Loading more tasks...":zn>0?`Rendering ${Math.min(Qe,Pt.length)} of ${Pt.length} tasks`:"Scroll to load more tasks"})})]})]})}r(g7,"StreamlinedIssuesList");function x7(e){return e?new Date(e).toLocaleString():"Never"}r(x7,"formatLastRunTimestamp");function b7(e){return e?e.replaceAll("_"," "):null}r(b7,"formatRoutineRunStatus");function oG(e,t){return e==="archived"&&t||t?"active":"paused"}r(oG,"nextRoutineStatus");function v7({routine:e,projectById:t,agentById:i,runningRoutineId:l,statusMutationRoutineId:c,href:d,configureLabel:m="Edit",managedByLabel:f,secondaryDetails:h,runNowButton:g=!1,disableRunNow:v=!1,disableToggle:y=!1,hideArchiveAction:j=!1,divider:k=!0,selected:N=!1,selectMode:S=!1,extraMenuItems:D,onSelectChange:R,onRunNow:E,onToggleEnabled:C,onToggleArchived:I}){const O=e.status==="active",z=e.status==="archived",B=c===e.id,L=e.projectId?t.get(e.projectId)??null:null,_=e.assigneeAgentId?i.get(e.assigneeAgentId)??null:null,U=!z&&!e.assigneeAgentId,F=l===e.id||z||v;return(0,a.jsxs)(fn,{to:d,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:[S?(0,a.jsx)("div",{className:"flex items-start pt-0.5 sm:pt-1",onClick:r(Y=>{Y.preventDefault(),Y.stopPropagation()},"onClick"),children:(0,a.jsx)("input",{type:"checkbox",className:"h-4 w-4 rounded border-line",checked:N,"aria-label":`Select ${e.title}`,onChange:r(Y=>R?.(e,Y.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}),z||e.status==="paused"||U?(0,a.jsx)("span",{className:"text-xs text-ink-3",children:z?"archived":U?"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:L?.color??"var(--project-none)"}}),(0,a.jsx)("span",{children:e.projectId?L?.name??"Unknown project":"No project"})]}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[e.assigneeAgentId?(0,a.jsx)(sr,{agent:{..._,id:e.assigneeAgentId},size:16,className:"h-3.5 w-3.5 shrink-0"}):null,(0,a.jsx)("span",{children:e.assigneeAgentId?_?.name??"Unknown agent":"No default agent"})]}),(0,a.jsxs)("span",{children:[x7(e.lastRun?.triggeredAt),e.lastRun?` · ${b7(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(Y=>{Y.preventDefault(),Y.stopPropagation()},"onClick"),children:[g?(0,a.jsxs)(pe,{variant:"secondary",size:"sm",disabled:F,onClick:r(()=>E(e),"onClick"),children:[(0,a.jsx)(t0,{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)(pS,{size:"lg",checked:O,onCheckedChange:r(()=>C(e,O),"onCheckedChange"),disabled:B||z||y,"aria-label":O?`Disable ${e.title}`:`Enable ${e.title}`}),(0,a.jsx)("span",{className:"w-12 text-xs text-ink-3",children:z?"Archived":U?"Draft":O?"On":"Off"})]}),(0,a.jsxs)(Wr,{children:[(0,a.jsx)(Vr,{asChild:!0,children:(0,a.jsx)(pe,{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)(Qr,{align:"end",children:[(0,a.jsx)(Cn,{asChild:!0,children:(0,a.jsx)(fn,{to:d,children:m})}),(0,a.jsx)(Cn,{disabled:F,onClick:r(()=>E(e),"onClick"),children:l===e.id?"Running...":"Run now"}),D?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(yi,{}),D]}):null,(0,a.jsx)(yi,{}),(0,a.jsx)(Cn,{onClick:r(()=>C(e,O),"onClick"),disabled:B||z||y,children:O?"Pause":"Enable"}),!j&&I?(0,a.jsx)(Cn,{onClick:r(()=>I(e),"onClick"),disabled:B,children:e.status==="archived"?"Restore":"Archive"}):null]})]})]})]})}r(v7,"RoutineListRow");function y7(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(y7,"managedRoutineToRow");function j7({routines:e,agents:t=[],projects:i=[],pluginDisplayName:l=null,emptyMessage:c="No managed routines.",runningRoutineKey:d=null,statusMutationRoutineKey:m=null,reconcilingRoutineKey:f=null,resettingRoutineKey:h=null,onRunNow:g,onToggleEnabled:v,onReconcile:y,onReset:j}){const k=new Map(t.map(S=>[S.id,S])),N=new Map(i.map(S=>[S.id,{name:S.name,color:S.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(S=>{const D=y7(S),R=S.href??(S.routineId?`/routines/${S.routineId}`:"/routines"),E=S.missingRefs??[],C=!!(S.routineId&&S.resourceKey&&E.length===0),I=S.managedByPluginDisplayName??l,O=!!(y||j);return(0,a.jsxs)("div",{className:"last:[&_a]:border-b-0",children:[(0,a.jsx)(v7,{routine:D,projectById:N,agentById:k,runningRoutineId:d,statusMutationRoutineId:m,href:R,configureLabel:"Configure",managedByLabel:I?`Managed by ${I}`:null,runNowButton:!0,hideArchiveAction:!0,disableRunNow:!C,disableToggle:!C,secondaryDetails:(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[S.resourceKey?(0,a.jsx)("span",{children:S.resourceKey}):null,S.cronExpression?(0,a.jsxs)("span",{children:["Schedule ",S.cronExpression]}):null]}),onRunNow:r(()=>g?.(S),"onRunNow"),onToggleEnabled:r(()=>v?.(S,D.status==="active"),"onToggleEnabled")}),O?(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(z=>{z.preventDefault(),z.stopPropagation()},"onClick"),children:[(0,a.jsx)("span",{children:E.length?`Missing ${E.map(z=>`${z.resourceKind}:${z.resourceKey}`).join(", ")}`:"Routine defaults can be repaired."}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[y?(0,a.jsx)(pe,{size:"sm",variant:"ghost",disabled:f===S.key,onClick:r(()=>y(S),"onClick"),children:f===S.key?"Reconciling...":"Reconcile"}):null,j?(0,a.jsx)(pe,{size:"sm",variant:"ghost",disabled:h===S.key,onClick:r(()=>j(S),"onClick"),children:h===S.key?"Resetting...":"Reset"}):null]})]}):null]},S.key)})})}r(j7,"ManagedRoutinesList");function dk(e){return new Set(e??[])}r(dk,"toPathSet");function w7({expandedPaths:e,checkedPaths:t,selectedFile:i=null,showCheckboxes:l=!1,onToggleDir:c,onSelectFile:d,...m}){return(0,b.createElement)(Aq,{...m,selectedFile:i,expandedDirs:dk(e),checkedFiles:t?dk(t):void 0,showCheckboxes:l,onToggleDir:c??(()=>{}),onSelectFile:d??(()=>{})})}r(w7,"PluginSdkFileTree");function k7(e){const[t,i]=(0,b.useState)(null);return(0,b.useEffect)(()=>{let l=!1;return ye(()=>import("./MarkdownEditor-CCqgqbbX.js").then(c=>c.n).then(c=>{l||i(()=>c.MarkdownEditor)}),__vite__mapDeps([82,1,3,25,8,17,20,59,60,61,21,22,83,27,26,52,84,85,86,24,87,88,28,89,77,90,54,91,92,93,94,95,96])),()=>{l=!0}},[]),t?(0,b.createElement)(t,e):(0,b.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(k7,"PluginSdkMarkdownEditor");function S7(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""&&t!==!1))}r(S7,"compactIssueFilters");function N7({companyId:e,projectId:t=null,filters:i,viewStateKey:l="wardmote:plugin-issues-view",initialSearch:c,createIssueLabel:d,searchWithinLoadedIssues:m=!0}){const f=Rn(),h=(0,b.useMemo)(()=>S7({...i??{},projectId:i?.projectId??t??void 0}),[i,t]),g=h.originKindPrefix??null,v=h.projectId??t??null,y=(0,b.useMemo)(()=>["plugins","sdk-ui","issues-list",e??"__no-company__",h],[e,h]),{data:j}=be({queryKey:P.agents.list(e??"__no-company__"),queryFn:r(()=>Pa.list(e),"queryFn"),enabled:!!e}),{data:k}=be({queryKey:P.projects.list(e??"__no-company__",{includeArchived:!0}),queryFn:r(()=>ir.list(e,{includeArchived:!0}),"queryFn"),enabled:!!e}),N=P.liveRuns(e??"__no-company__"),S=cc({companyId:e,resourceKey:"live-runs",queryKey:N,enabled:!!e,refetchInterval:!1,leaderOnly:!0}),{data:D,dataUpdatedAt:R}=be({queryKey:N,queryFn:r(()=>gf.liveRunsForCompany(e),"queryFn"),enabled:S.enabled,refetchInterval:S.refetchInterval});uc(S,D,R);const{data:E,isLoading:C,error:I}=be({queryKey:y,queryFn:r(()=>dn.list(e,h),"queryFn"),enabled:!!e}),O=(0,b.useMemo)(()=>Xq(D,E),[E,D]),z=bn({mutationFn:r(({id:B,data:L})=>dn.update(B,L),"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,b.createElement)(h7,{issues:E??[],isLoading:C,error:I,agents:j,projects:k,liveIssueIds:O,projectId:v??void 0,viewStateKey:l,initialSearch:c,createIssueLabel:d,searchWithinLoadedIssues:m,onUpdateIssue:r((B,L)=>z.mutate({id:B,data:L}),"onUpdateIssue")}):(0,b.createElement)("div",{className:"text-sm text-ink-3"},"Select an organization to view tasks.")}r(N7,"PluginSdkIssuesList");function C7({companyId:e,value:t,onChange:i,placeholder:l="Responsible",noneLabel:c="No responsible",searchPlaceholder:d="Search responsible...",emptyMessage:m="No responsible found.",includeUsers:f=!0,includeTerminatedAgents:h=!1,className:g,onConfirm:v}){const y=i0(),j=e??y.companyId??null,{data:k}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn"),enabled:f}),N=k?.user?.id??k?.session?.userId??null,{data:S}=be({queryKey:P.agents.list(j??"__no-company__"),queryFn:r(()=>Pa.list(j),"queryFn"),enabled:!!j}),{data:D}=be({queryKey:P.access.companyUserDirectory(j??"__no-company__"),queryFn:r(()=>wi.listUserDirectory(j),"queryFn"),enabled:!!j&&f}),R=(0,b.useMemo)(()=>Kh(),[]),E=(0,b.useMemo)(()=>R.map(B=>B.startsWith("agent:")?B.slice(6):null).filter(B=>!!B),[R]),C=(0,b.useMemo)(()=>mS((S??[]).filter(B=>h||B.status!=="terminated"),E),[S,h,E]),I=(0,b.useMemo)(()=>[...f?lS(N):[],...f?fC(D?.users,{excludeUserIds:[N]}):[],...C.map(B=>({id:Mr({assigneeAgentId:B.id}),label:B.name,searchText:`${B.name} ${B.role} ${B.title??""}`}))],[D?.users,N,f,C]),O=Pl(t),z=O.assigneeAgentId?C.find(B=>B.id===O.assigneeAgentId):null;return(0,b.createElement)(u0,{value:t,options:I,recentOptionIds:R,placeholder:l,noneLabel:c,searchPlaceholder:d,emptyMessage:m,className:g,onConfirm:v,onChange:r(B=>{const L=Pl(B);L.assigneeAgentId&&Ld(L.assigneeAgentId),L.assigneeUserId&&Od(L.assigneeUserId),i(B,L)},"onChange"),renderTriggerValue:r(B=>B?z?(0,b.createElement)(of,null,(0,b.createElement)(Dh,{icon:z.icon,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,b.createElement)("span",{className:"truncate"},B.label)):(0,b.createElement)("span",{className:"truncate"},B.label):(0,b.createElement)("span",{className:"text-ink-3"},l),"renderTriggerValue"),renderOption:r(B=>{if(!B.id)return(0,b.createElement)("span",{className:"truncate"},B.label);const L=Pl(B.id),_=L.assigneeAgentId?C.find(U=>U.id===L.assigneeAgentId):null;return(0,b.createElement)(of,null,_?(0,b.createElement)(Dh,{icon:_.icon,className:"h-3.5 w-3.5 shrink-0 text-ink-3"}):(0,b.createElement)(zl,{className:"h-3.5 w-3.5 shrink-0 text-ink-3"}),(0,b.createElement)("span",{className:"truncate"},B.label))},"renderOption")})}r(C7,"PluginSdkAssigneePicker");function A7({companyId:e,value:t,onChange:i,placeholder:l="Project",noneLabel:c="No project",searchPlaceholder:d="Search projects...",emptyMessage:m="No projects found.",includeArchived:f=!1,className:h,onConfirm:g}){const v=i0(),y=e??v.companyId??null,{data:j}=be({queryKey:P.auth.session,queryFn:r(()=>Xn.getSession(),"queryFn")}),k=j?.user?.id??j?.session?.userId??null,{data:N}=be({queryKey:P.projects.list(y??"__no-company__",{includeArchived:f}),queryFn:r(()=>ir.list(y,{includeArchived:f}),"queryFn"),enabled:!!y}),S=(0,b.useMemo)(()=>(N??[]).filter(I=>f||!I.archivedAt),[f,N]),{orderedProjects:D}=pC({projects:S,companyId:y,userId:k}),R=(0,b.useMemo)(()=>sg(),[]),E=(0,b.useMemo)(()=>D.map(I=>({id:I.id,label:I.name,searchText:I.description??""})),[D]),C=D.find(I=>I.id===t)??null;return(0,b.createElement)(u0,{value:t,options:E,recentOptionIds:R,placeholder:l,noneLabel:c,searchPlaceholder:d,emptyMessage:m,className:h,onConfirm:g,onChange:r(I=>{I&&Wd(I),i(I)},"onChange"),renderTriggerValue:r(I=>!I||!C?(0,b.createElement)("span",{className:"text-ink-3"},l):(0,b.createElement)(of,null,(0,b.createElement)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:C.color??"#6366f1"}}),(0,b.createElement)("span",{className:"truncate"},I.label)),"renderTriggerValue"),renderOption:r(I=>{if(!I.id)return(0,b.createElement)("span",{className:"truncate"},I.label);const O=D.find(z=>z.id===I.id);return(0,b.createElement)(of,null,(0,b.createElement)("span",{className:"h-3.5 w-3.5 shrink-0 rounded-sm",style:{backgroundColor:O?.color??"#6366f1"}}),(0,b.createElement)("span",{className:"truncate"},I.label))},"renderOption")})}r(A7,"PluginSdkProjectPicker");function of({children:e}){return(0,b.createElement)("span",{className:"contents"},e)}r(of,"FragmentSafe");function _7({label:e,status:t}){const i={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,b.createElement)("span",{className:`inline-flex w-fit items-center rounded-full border px-2 py-0.5 text-xs font-medium ${i}`},e)}r(_7,"PluginSdkStatusBadge");function E7({columns:e,rows:t,loading:i,emptyMessage:l="No rows."}){if(i)return(0,b.createElement)("div",{className:"text-sm text-ink-3"},"Loading...");if(!t.length)return(0,b.createElement)("div",{className:"text-sm text-ink-3"},l);const c=e.map(d=>d.width??"minmax(0, 1fr)").join(" ");return(0,b.createElement)("div",{className:"overflow-hidden rounded-md border"},(0,b.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(d=>(0,b.createElement)("div",{key:d.key},d.header))),(0,b.createElement)("div",{className:"divide-y"},t.map((d,m)=>(0,b.createElement)("div",{key:String(d.id??m),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,b.createElement)("div",{key:f.key,className:"min-w-0 text-sm"},(0,b.createElement)("div",{className:"mb-1 text-[11px] font-medium uppercase tracking-wide text-ink-3 md:hidden"},f.header),f.render?f.render(d[f.key],d):String(d[f.key]??"")))))))}r(E7,"PluginSdkDataTable");function I7({pairs:e}){return(0,b.createElement)("dl",{className:"grid gap-x-4 gap-y-1 text-sm sm:grid-cols-[max-content_minmax(0,1fr)]"},e.flatMap(t=>[(0,b.createElement)("dt",{key:`${t.label}:label`,className:"text-ink-3"},t.label),(0,b.createElement)("dd",{key:`${t.label}:value`,className:"min-w-0"},t.value)]))}r(I7,"PluginSdkKeyValueList");function T7({label:e,value:t,unit:i}){return(0,b.createElement)("div",{className:"rounded-md border bg-bg-2 p-3"},(0,b.createElement)("div",{className:"text-xs font-medium uppercase tracking-wide text-ink-3"},e),(0,b.createElement)("div",{className:"mt-1 text-lg font-semibold"},`${t}${i??""}`))}r(T7,"PluginSdkMetricCard");function R7({data:e}){return(0,b.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(R7,"PluginSdkJsonTree");function D7({label:e="Loading"}){return(0,b.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(D7,"PluginSdkSpinner");var M7=class extends b.Component{static{r(this,"PluginSdkErrorBoundary")}state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback??(0,b.createElement)("div",{className:"rounded-md border border-bad/30 p-3 text-sm text-bad"},"Plugin UI failed to render."):this.props.children}};function O7(e,t){globalThis.__paperclipPluginBridge__={react:e,reactJsxRuntime:a,reactDom:t,sdkUi:{usePluginData:u3,usePluginAction:c3,useHostContext:i0,useHostLocation:d3,useHostNavigation:g3,usePluginStream:m3,usePluginToast:f3,copyTextToClipboard:d0,MarkdownBlock:r(({content:i,className:l,enableWikiLinks:c,wikiLinkRoot:d,resolveWikiLinkHref:m})=>(0,b.createElement)(XE,{className:l,softBreaks:!1,enableWikiLinks:c,wikiLinkRoot:d,resolveWikiLinkHref:m,children:i}),"MarkdownBlock"),MetricCard:T7,StatusBadge:_7,DataTable:E7,KeyValueList:I7,JsonTree:R7,Spinner:D7,ErrorBoundary:M7,MarkdownEditor:k7,FileTree:w7,IssuesList:N7,AssigneePicker:C7,ProjectPicker:A7,ManagedRoutinesList:j7}}}r(O7,"initPluginBridge");var L7=1e4;function z7(e=L7){if(typeof performance>"u"||typeof performance.clearMeasures!="function")return()=>{};const i=setInterval(r(()=>{globalThis.__paperclipKeepPerfMeasures||performance.clearMeasures()},"reap"),e);return()=>clearInterval(i)}r(z7,"startPerfMeasureReaper");var P7=Ql((e=>{function t($,T){var te=$.length;$.push(T);e:for(;0<te;){var ce=te-1>>>1,ae=$[ce];if(0<c(ae,T))$[ce]=T,$[te]=ae,te=ce;else break e}}r(t,"push");function i($){return $.length===0?null:$[0]}r(i,"peek");function l($){if($.length===0)return null;var T=$[0],te=$.pop();if(te!==T){$[0]=te;e:for(var ce=0,ae=$.length,Ce=ae>>>1;ce<Ce;){var ue=2*(ce+1)-1,we=$[ue],Ae=ue+1,je=$[Ae];if(0>c(we,te))Ae<ae&&0>c(je,we)?($[ce]=je,$[Ae]=te,ce=Ae):($[ce]=we,$[ue]=te,ce=ue);else if(Ae<ae&&0>c(je,te))$[ce]=je,$[Ae]=te,ce=Ae;else break e}}return T}r(l,"pop");function c($,T){var te=$.sortIndex-T.sortIndex;return te!==0?te:$.id-T.id}if(r(c,"compare"),e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;e.unstable_now=function(){return d.now()}}else{var m=Date,f=m.now();e.unstable_now=function(){return m.now()-f}}var h=[],g=[],v=1,y=null,j=3,k=!1,N=!1,S=!1,D=!1,R=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function I($){for(var T=i(g);T!==null;){if(T.callback===null)l(g);else if(T.startTime<=$)l(g),T.sortIndex=T.expirationTime,t(h,T);else break;T=i(g)}}r(I,"advanceTimers");function O($){if(S=!1,I($),!N)if(i(h)!==null)N=!0,z||(z=!0,Y());else{var T=i(g);T!==null&&oe(O,T.startTime-$)}}r(O,"handleTimeout");var z=!1,B=-1,L=5,_=-1;function U(){return D?!0:!(e.unstable_now()-_<L)}r(U,"shouldYieldToHost");function F(){if(D=!1,z){var $=e.unstable_now();_=$;var T=!0;try{e:{N=!1,S&&(S=!1,E(B),B=-1),k=!0;var te=j;try{t:{for(I($),y=i(h);y!==null&&!(y.expirationTime>$&&U());){var ce=y.callback;if(typeof ce=="function"){y.callback=null,j=y.priorityLevel;var ae=ce(y.expirationTime<=$);if($=e.unstable_now(),typeof ae=="function"){y.callback=ae,I($),T=!0;break t}y===i(h)&&l(h),I($)}else l(h);y=i(h)}if(y!==null)T=!0;else{var Ce=i(g);Ce!==null&&oe(O,Ce.startTime-$),T=!1}}break e}finally{y=null,j=te,k=!1}T=void 0}}finally{T?Y():z=!1}}}r(F,"performWorkUntilDeadline");var Y;if(typeof C=="function")Y=r(function(){C(F)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var se=new MessageChannel,me=se.port2;se.port1.onmessage=F,Y=r(function(){me.postMessage(null)},"schedulePerformWorkUntilDeadline")}else Y=r(function(){R(F,0)},"schedulePerformWorkUntilDeadline");function oe($,T){B=R(function(){$(e.unstable_now())},T)}r(oe,"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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$||(L=0<$?Math.floor(1e3/$):5)},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function($){switch(j){case 1:case 2:case 3:var T=3;break;default:T=j}var te=j;j=T;try{return $()}finally{j=te}},e.unstable_requestPaint=function(){D=!0},e.unstable_runWithPriority=function($,T){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var te=j;j=$;try{return T()}finally{j=te}},e.unstable_scheduleCallback=function($,T,te){var ce=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?ce+te:ce):te=ce,$){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=te+ae,$={id:v++,callback:T,priorityLevel:$,startTime:te,expirationTime:ae,sortIndex:-1},te>ce?($.sortIndex=te,t(g,$),i(h)===null&&$===i(g)&&(S?(E(B),B=-1):S=!0,oe(O,te-ce))):($.sortIndex=ae,t(h,$),N||k||(N=!0,z||(z=!0,Y()))),$},e.unstable_shouldYield=U,e.unstable_wrapCallback=function($){var T=j;return function(){var te=j;j=T;try{return $.apply(this,arguments)}finally{j=te}}}})),U7=Ql(((e,t)=>{t.exports=P7()})),$7=Ql((e=>{var t=U7(),i=Lg(),l=bk();function c(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}r(c,"formatProdErrorMessage");function d(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}r(d,"isValidContainer");function m(n){var s=n,o=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(o=s.return),n=s.return;while(n)}return s.tag===3?o:null}r(m,"getNearestMountedFiber");function f(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}r(f,"getSuspenseInstanceFromFiber");function h(n){if(n.tag===31){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}r(h,"getActivityInstanceFromFiber");function g(n){if(m(n)!==n)throw Error(c(188))}r(g,"assertIsMounted");function v(n){var s=n.alternate;if(!s){if(s=m(n),s===null)throw Error(c(188));return s!==n?null:n}for(var o=n,u=s;;){var p=o.return;if(p===null)break;var x=p.alternate;if(x===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===o)return g(p),n;if(x===u)return g(p),s;x=x.sibling}throw Error(c(188))}if(o.return!==u.return)o=p,u=x;else{for(var w=!1,A=p.child;A;){if(A===o){w=!0,o=p,u=x;break}if(A===u){w=!0,u=p,o=x;break}A=A.sibling}if(!w){for(A=x.child;A;){if(A===o){w=!0,o=x,u=p;break}if(A===u){w=!0,u=x,o=p;break}A=A.sibling}if(!w)throw Error(c(189))}}if(o.alternate!==u)throw Error(c(190))}if(o.tag!==3)throw Error(c(188));return o.stateNode.current===o?n:s}r(v,"findCurrentFiberUsingSlowPath");function y(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=y(n),s!==null)return s;n=n.sibling}return null}r(y,"findCurrentHostFiberImpl");var j=Object.assign,k=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),I=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function se(n){return n===null||typeof n!="object"?null:(n=Y&&n[Y]||n["@@iterator"],typeof n=="function"?n:null)}r(se,"getIteratorFn");var me=Symbol.for("react.client.reference");function oe(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===me?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case D:return"Fragment";case E:return"Profiler";case R:return"StrictMode";case z:return"Suspense";case B:return"SuspenseList";case U:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case I:return n.displayName||"Context";case C:return(n._context.displayName||"Context")+".Consumer";case O:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return s=n.displayName||null,s!==null?s:oe(n.type)||"Memo";case _:s=n._payload,n=n._init;try{return oe(n(s))}catch{}}return null}r(oe,"getComponentNameFromType");var $=Array.isArray,T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},ae=[],Ce=-1;function ue(n){return{current:n}}r(ue,"createCursor");function we(n){0>Ce||(n.current=ae[Ce],ae[Ce]=null,Ce--)}r(we,"pop");function Ae(n,s){Ce++,ae[Ce]=n.current,n.current=s}r(Ae,"push");var je=ue(null),he=ue(null),Te=ue(null),Ve=ue(null);function De(n,s){switch(Ae(Te,s),Ae(he,n),Ae(je,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?Mv(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=Mv(s),n=Ov(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}we(je),Ae(je,n)}r(De,"pushHostContainer");function Se(){we(je),we(he),we(Te)}r(Se,"popHostContainer");function ut(n){n.memoizedState!==null&&Ae(Ve,n);var s=je.current,o=Ov(s,n.type);s!==o&&(Ae(he,n),Ae(je,o))}r(ut,"pushHostContext");function wt(n){he.current===n&&(we(je),we(he)),Ve.current===n&&(we(Ve),qo._currentValue=ce)}r(wt,"popHostContext");var kt,$t;function le(n){if(kt===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);kt=s&&s[1]||"",$t=-1<o.stack.indexOf(`
|
|
56
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
57
|
+
`+kt+n+$t}r(le,"describeBuiltInComponentFrame");var Ue=!1;function Fe(n,s){if(!n||Ue)return"";Ue=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:r(function(){try{if(s){var ge=r(function(){throw Error()},"Fake");if(Object.defineProperty(ge.prototype,"props",{set:r(function(){throw Error()},"set")}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(re){var ne=re}Reflect.construct(n,[],ge)}else{try{ge.call()}catch(re){ne=re}n.call(ge.prototype)}}else{try{throw Error()}catch(re){ne=re}(ge=n())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(re){if(re&&ne&&typeof re.stack=="string")return[re.stack,ne.stack]}return[null,null]},"DetermineComponentFrameRoot")};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=u.DetermineComponentFrameRoot(),w=x[0],A=x[1];if(w&&A){var K=w.split(`
|
|
58
|
+
`),ee=A.split(`
|
|
59
|
+
`);for(p=u=0;u<K.length&&!K[u].includes("DetermineComponentFrameRoot");)u++;for(;p<ee.length&&!ee[p].includes("DetermineComponentFrameRoot");)p++;if(u===K.length||p===ee.length)for(u=K.length-1,p=ee.length-1;1<=u&&0<=p&&K[u]!==ee[p];)p--;for(;1<=u&&0<=p;u--,p--)if(K[u]!==ee[p]){if(u!==1||p!==1)do if(u--,p--,0>p||K[u]!==ee[p]){var de=`
|
|
60
|
+
`+K[u].replace(" at new "," at ");return n.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",n.displayName)),de}while(1<=u&&0<=p);break}}}finally{Ue=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?le(o):""}r(Fe,"describeNativeComponentFrame");function it(n,s){switch(n.tag){case 26:case 27:case 5:return le(n.type);case 16:return le("Lazy");case 13:return n.child!==s&&s!==null?le("Suspense Fallback"):le("Suspense");case 19:return le("SuspenseList");case 0:case 15:return Fe(n.type,!1);case 11:return Fe(n.type.render,!1);case 1:return Fe(n.type,!0);case 31:return le("Activity");default:return""}}r(it,"describeFiber");function Vt(n){try{var s="",o=null;do s+=it(n,o),o=n,n=n.return;while(n);return s}catch(u){return`
|
|
61
|
+
Error generating stack: `+u.message+`
|
|
62
|
+
`+u.stack}}r(Vt,"getStackByFiberInDevAndProd");var Qt=Object.prototype.hasOwnProperty,V=t.unstable_scheduleCallback,Ct=t.unstable_cancelCallback,_e=t.unstable_shouldYield,ze=t.unstable_requestPaint,Je=t.unstable_now,rt=t.unstable_getCurrentPriorityLevel,At=t.unstable_ImmediatePriority,Wt=t.unstable_UserBlockingPriority,mn=t.unstable_NormalPriority,Zt=t.unstable_LowPriority,_t=t.unstable_IdlePriority,Et=t.log,ln=t.unstable_setDisableYieldValue,Qn=null,dt=null;function wn(n){if(typeof Et=="function"&&ln(n),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Qn,n)}catch{}}r(wn,"setIsStrictModeForDevtools");var Dt=Math.clz32?Math.clz32:pt,an=Math.log,Mt=Math.LN2;function pt(n){return n>>>=0,n===0?32:31-(an(n)/Mt|0)|0}r(pt,"clz32Fallback");var Pe=256,Me=262144,$e=4194304;function He(n){var s=n&42;if(s!==0)return s;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}r(He,"getHighestPriorityLanes");function Ot(n,s,o){var u=n.pendingLanes;if(u===0)return 0;var p=0,x=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var A=u&134217727;return A!==0?(u=A&~x,u!==0?p=He(u):(w&=A,w!==0?p=He(w):o||(o=A&~n,o!==0&&(p=He(o))))):(A=u&~x,A!==0?p=He(A):w!==0?p=He(w):o||(o=u&~n,o!==0&&(p=He(o)))),p===0?0:s!==0&&s!==p&&(s&x)===0&&(x=p&-p,o=s&-s,x>=o||x===32&&(o&4194048)!==0)?s:p}r(Ot,"getNextLanes");function lt(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}r(lt,"checkIfRootIsPrerendering");function zt(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}r(zt,"computeExpirationTime");function Jt(){var n=$e;return $e<<=1,($e&62914560)===0&&($e=4194304),n}r(Jt,"claimNextRetryLane");function Lt(n){for(var s=[],o=0;31>o;o++)s.push(n);return s}r(Lt,"createLaneMap");function pn(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}r(pn,"markRootUpdated$1");function hn(n,s,o,u,p,x){var w=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var A=n.entanglements,K=n.expirationTimes,ee=n.hiddenUpdates;for(o=w&~o;0<o;){var de=31-Dt(o),ge=1<<de;A[de]=0,K[de]=-1;var ne=ee[de];if(ne!==null)for(ee[de]=null,de=0;de<ne.length;de++){var re=ne[de];re!==null&&(re.lane&=-536870913)}o&=~ge}u!==0&&on(n,u,0),x!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=x&~(w&~s))}r(hn,"markRootFinished");function on(n,s,o){n.pendingLanes|=s,n.suspendedLanes&=~s;var u=31-Dt(s);n.entangledLanes|=s,n.entanglements[u]=n.entanglements[u]|1073741824|o&261930}r(on,"markSpawnedDeferredLane");function An(n,s){var o=n.entangledLanes|=s;for(n=n.entanglements;o;){var u=31-Dt(o),p=1<<u;p&s|n[u]&s&&(n[u]|=s),o&=~p}}r(An,"markRootEntangled");function Dn(n,s){var o=s&-s;return o=(o&42)!==0?1:Ja(o),(o&(n.suspendedLanes|s))!==0?0:o}r(Dn,"getBumpedLaneForHydration");function Ja(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}r(Ja,"getBumpedLaneForHydrationByLane");function ma(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}r(ma,"lanesToEventPriority");function Aa(){var n=te.p;return n!==0?n:(n=window.event,n===void 0?32:ny(n.type))}r(Aa,"resolveUpdatePriority");function es(n,s){var o=te.p;try{return te.p=n,s()}finally{te.p=o}}r(es,"runWithPriority");var pa=Math.random().toString(36).slice(2),xt="__reactFiber$"+pa,kn="__reactProps$"+pa,Jn="__reactContainer$"+pa,Os="__reactEvents$"+pa,Kn="__reactListeners$"+pa,bs="__reactHandles$"+pa,Wn="__reactResources$"+pa,Sn="__reactMarker$"+pa;function Ua(n){delete n[xt],delete n[kn],delete n[Os],delete n[Kn],delete n[bs]}r(Ua,"detachDeletedInstance");function ba(n){var s=n[xt];if(s)return s;for(var o=n.parentNode;o;){if(s=o[Jn]||o[xt]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(n=Kv(n);n!==null;){if(o=n[xt])return o;n=Kv(n)}return s}n=o,o=n.parentNode}return null}r(ba,"getClosestInstanceFromNode");function Mn(n){if(n=n[xt]||n[Jn]){var s=n.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return n}return null}r(Mn,"getInstanceFromNode");function _a(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(c(33))}r(_a,"getNodeFromInstance");function _n(n){var s=n[Wn];return s||(s=n[Wn]={hoistableStyles:new Map,hoistableScripts:new Map}),s}r(_n,"getResourcesFromRoot");function cn(n){n[Sn]=!0}r(cn,"markNodeAsHoistable");var Ls=new Set,zs={};function ha(n,s){va(n,s),va(n+"Capture",s)}r(ha,"registerTwoPhaseEvent");function va(n,s){for(zs[n]=s,n=0;n<s.length;n++)Ls.add(s[n])}r(va,"registerDirectEvent");var vs=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ps={},Pt={};function ts(n){return Qt.call(Pt,n)?!0:Qt.call(Ps,n)?!1:vs.test(n)?Pt[n]=!0:(Ps[n]=!0,!1)}r(ts,"isAttributeNameSafe");function $a(n,s,o){if(ts(s))if(o===null)n.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var u=s.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+o)}}r($a,"setValueForAttribute");function Ba(n,s,o){if(o===null)n.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+o)}}r(Ba,"setValueForKnownAttribute");function ya(n,s,o,u){if(u===null)n.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(s,o,""+u)}}r(ya,"setValueForNamespacedAttribute");function On(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}r(On,"getToStringValue");function ys(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}r(ys,"isCheckable");function Ea(n,s,o){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,s);if(!n.hasOwnProperty(s)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,x=u.set;return Object.defineProperty(n,s,{configurable:!0,get:r(function(){return p.call(this)},"get"),set:r(function(w){o=""+w,x.call(this,w)},"set")}),Object.defineProperty(n,s,{enumerable:u.enumerable}),{getValue:r(function(){return o},"getValue"),setValue:r(function(w){o=""+w},"setValue"),stopTracking:r(function(){n._valueTracker=null,delete n[s]},"stopTracking")}}}r(Ea,"trackValueOnNode");function ie(n){if(!n._valueTracker){var s=ys(n)?"checked":"value";n._valueTracker=Ea(n,s,""+n[s])}}r(ie,"track");function Ee(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var o=s.getValue(),u="";return n&&(u=ys(n)?n.checked?"true":"false":n.value),n=u,n!==o?(s.setValue(n),!0):!1}r(Ee,"updateValueIfChanged");function Oe(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}r(Oe,"getActiveElement");var at=/[\n"\\]/g;function gt(n){return n.replace(at,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}r(gt,"escapeSelectorAttributeValueInsideDoubleQuotes");function qt(n,s,o,u,p,x,w,A){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),s!=null?w==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+On(s)):n.value!==""+On(s)&&(n.value=""+On(s)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),s!=null?Z(n,w,On(s)):o!=null?Z(n,w,On(o)):u!=null&&n.removeAttribute("value"),p==null&&x!=null&&(n.defaultChecked=!!x),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?n.name=""+On(A):n.removeAttribute("name")}r(qt,"updateInput");function Ia(n,s,o,u,p,x,w,A){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(n.type=x),s!=null||o!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){ie(n);return}o=o!=null?""+On(o):"",s=s!=null?""+On(s):o,A||s===n.value||(n.value=s),n.defaultValue=s}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=A?n.checked:!!u,n.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),ie(n)}r(Ia,"initInput");function Z(n,s,o){s==="number"&&Oe(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}r(Z,"setDefaultValue");function Ne(n,s,o,u){if(n=n.options,s){s={};for(var p=0;p<o.length;p++)s["$"+o[p]]=!0;for(o=0;o<n.length;o++)p=s.hasOwnProperty("$"+n[o].value),n[o].selected!==p&&(n[o].selected=p),p&&u&&(n[o].defaultSelected=!0)}else{for(o=""+On(o),s=null,p=0;p<n.length;p++){if(n[p].value===o){n[p].selected=!0,u&&(n[p].defaultSelected=!0);return}s!==null||n[p].disabled||(s=n[p])}s!==null&&(s.selected=!0)}}r(Ne,"updateOptions");function Ke(n,s,o){if(s!=null&&(s=""+On(s),s!==n.value&&(n.value=s),o==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=o!=null?""+On(o):""}r(Ke,"updateTextarea");function Xe(n,s,o,u){if(s==null){if(u!=null){if(o!=null)throw Error(c(92));if($(u)){if(1<u.length)throw Error(c(93));u=u[0]}o=u}o??="",s=o}o=On(s),n.defaultValue=o,u=n.textContent,u===o&&u!==""&&u!==null&&(n.value=u),ie(n)}r(Xe,"initTextarea");function Qe(n,s){if(s){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=s;return}}n.textContent=s}r(Qe,"setTextContent");var ft=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function vt(n,s,o){var u=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":u?n.setProperty(s,o):typeof o!="number"||o===0||ft.has(s)?s==="float"?n.cssFloat=o:n[s]=(""+o).trim():n[s]=o+"px"}r(vt,"setValueForStyle");function un(n,s,o){if(s!=null&&typeof s!="object")throw Error(c(62));if(n=n.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||s!=null&&s.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var p in s)u=s[p],s.hasOwnProperty(p)&&o[p]!==u&&vt(n,p,u)}else for(var x in s)s.hasOwnProperty(x)&&vt(n,x,s[x])}r(un,"setValueForStyles");function Ln(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}r(Ln,"isCustomElement");var Ta=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),zn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ft(n){return zn.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}r(Ft,"sanitizeURL");function Nn(){}r(Nn,"noop$1");var ja=null;function Ka(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}r(Ka,"getEventTarget");var Gt=null,ga=null;function or(n){var s=Mn(n);if(s&&(n=s.stateNode)){var o=n[kn]||null;e:switch(n=s.stateNode,s.type){case"input":if(qt(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+gt(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var u=o[s];if(u!==n&&u.form===n.form){var p=u[kn]||null;if(!p)throw Error(c(90));qt(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<o.length;s++)u=o[s],u.form===n.form&&Ee(u)}break e;case"textarea":Ke(n,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&Ne(n,!!o.multiple,s,!1)}}}r(or,"restoreStateOfTarget");var ns=!1;function Oc(n,s,o){if(ns)return n(s,o);ns=!0;try{return n(s)}finally{if(ns=!1,(Gt!==null||ga!==null)&&(ju(),Gt&&(s=Gt,n=ga,ga=Gt=null,or(s),n)))for(s=0;s<n.length;s++)or(n[s])}}r(Oc,"batchedUpdates$1");function Ys(n,s){var o=n.stateNode;if(o===null)return null;var u=o[kn]||null;if(u===null)return null;o=u[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(c(231,s,typeof o));return o}r(Ys,"getListener");var qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H=!1;if(qa)try{var Q={};Object.defineProperty(Q,"passive",{get:r(function(){H=!0},"get")}),window.addEventListener("test",Q,Q),window.removeEventListener("test",Q,Q)}catch{H=!1}var X=null,Ie=null,et=null;function Ut(){if(et)return et;var n,s=Ie,o=s.length,u,p="value"in X?X.value:X.textContent,x=p.length;for(n=0;n<o&&s[n]===p[n];n++);var w=o-n;for(u=1;u<=w&&s[o-u]===p[x-u];u++);return et=p.slice(n,1<u?1-u:void 0)}r(Ut,"getData");function En(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}r(En,"getEventCharCode");function ot(){return!0}r(ot,"functionThatReturnsTrue");function sn(){return!1}r(sn,"functionThatReturnsFalse");function It(n){function s(o,u,p,x,w){this._reactName=o,this._targetInst=p,this.type=u,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var A in n)n.hasOwnProperty(A)&&(o=n[A],this[A]=o?o(x):x[A]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ot:sn,this.isPropagationStopped=sn,this}return r(s,"SyntheticBaseEvent"),j(s.prototype,{preventDefault:r(function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=ot)},"preventDefault"),stopPropagation:r(function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=ot)},"stopPropagation"),persist:r(function(){},"persist"),isPersistent:ot}),s}r(It,"createSyntheticEvent");var ve={eventPhase:0,bubbles:0,cancelable:0,timeStamp:r(function(n){return n.timeStamp||Date.now()},"timeStamp"),defaultPrevented:0,isTrusted:0},as=It(ve),ra=j({},ve,{view:0,detail:0}),Fa=It(ra),ea,eo,Ni,cr=j({},ra,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ao,button:0,buttons:0,relatedTarget:r(function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},"relatedTarget"),movementX:r(function(n){return"movementX"in n?n.movementX:(n!==Ni&&(Ni&&n.type==="mousemove"?(ea=n.screenX-Ni.screenX,eo=n.screenY-Ni.screenY):eo=ea=0,Ni=n),ea)},"movementX"),movementY:r(function(n){return"movementY"in n?n.movementY:eo},"movementY")}),Yr=It(cr),zf=It(j({},cr,{dataTransfer:0})),ur=It(j({},ra,{relatedTarget:0})),Lc=It(j({},ve,{animationName:0,elapsedTime:0,pseudoElement:0})),Xr=It(j({},ve,{clipboardData:r(function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData},"clipboardData")})),dr=It(j({},ve,{data:0})),zc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},to={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function no(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=Xs[n])?!!s[n]:!1}r(no,"modifierStateGetter");function ao(){return no}r(ao,"getEventModifierState");var Pf=It(j({},ra,{key:r(function(n){if(n.key){var s=zc[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=En(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?to[n.keyCode]||"Unidentified":""},"key"),code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ao,charCode:r(function(n){return n.type==="keypress"?En(n):0},"charCode"),keyCode:r(function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},"keyCode"),which:r(function(n){return n.type==="keypress"?En(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0},"which")})),Pc=It(j({},cr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),so=It(j({},ra,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ao})),fr=It(j({},ve,{propertyName:0,elapsedTime:0,pseudoElement:0})),io=It(j({},cr,{deltaX:r(function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},"deltaX"),deltaY:r(function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},"deltaY"),deltaZ:0,deltaMode:0})),Uf=It(j({},ve,{newState:0,oldState:0})),ro=[9,13,27,32],lo=qa&&"CompositionEvent"in window,Ci=null;qa&&"documentMode"in document&&(Ci=document.documentMode);var $f=qa&&"TextEvent"in window&&!Ci,oo=qa&&(!lo||Ci&&8<Ci&&11>=Ci),co=" ",qe=!1;function wa(n,s){switch(n){case"keyup":return ro.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}r(wa,"isFallbackCompositionEnd");function Uc(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}r(Uc,"getDataFromCustomEvent");var Zs=!1;function RA(n,s){switch(n){case"compositionend":return Uc(s);case"keypress":return s.which!==32?null:(qe=!0,co);case"textInput":return n=s.data,n===co&&qe?null:n;default:return null}}r(RA,"getNativeBeforeInputChars");function DA(n,s){if(Zs)return n==="compositionend"||!lo&&wa(n,s)?(n=Ut(),et=Ie=X=null,Zs=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return oo&&s.locale!=="ko"?null:s.data;default:return null}}r(DA,"getFallbackBeforeInputChars");var MA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Q0(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!MA[n.type]:s==="textarea"}r(Q0,"isTextInputElement");function W0(n,s,o,u){Gt?ga?ga.push(u):ga=[u]:Gt=u,s=_u(s,"onChange"),0<s.length&&(o=new as("onChange","change",null,o,u),n.push({event:o,listeners:s}))}r(W0,"createAndAccumulateChangeEvent");var uo=null,fo=null;function OA(n){Av(n,0)}r(OA,"runEventInBatch");function $c(n){if(Ee(_a(n)))return n}r($c,"getInstIfValueChanged");function G0(n,s){if(n==="change")return s}r(G0,"getTargetInstForChangeEvent");var Y0=!1;if(qa){var Bf;if(qa){var Kf="oninput"in document;if(!Kf){var X0=document.createElement("div");X0.setAttribute("oninput","return;"),Kf=typeof X0.oninput=="function"}Bf=Kf}else Bf=!1;Y0=Bf&&(!document.documentMode||9<document.documentMode)}function Z0(){uo&&(uo.detachEvent("onpropertychange",J0),fo=uo=null)}r(Z0,"stopWatchingForValueChange");function J0(n){if(n.propertyName==="value"&&$c(fo)){var s=[];W0(s,fo,n,Ka(n)),Oc(OA,s)}}r(J0,"handlePropertyChange");function LA(n,s,o){n==="focusin"?(Z0(),uo=s,fo=o,uo.attachEvent("onpropertychange",J0)):n==="focusout"&&Z0()}r(LA,"handleEventsForInputEventPolyfill");function zA(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return $c(fo)}r(zA,"getTargetInstForInputEventPolyfill");function PA(n,s){if(n==="click")return $c(s)}r(PA,"getTargetInstForClickEvent");function UA(n,s){if(n==="input"||n==="change")return $c(s)}r(UA,"getTargetInstForInputOrChangeEvent");function $A(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}r($A,"is");var Ha=typeof Object.is=="function"?Object.is:$A;function mo(n,s){if(Ha(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var o=Object.keys(n),u=Object.keys(s);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!Qt.call(s,p)||!Ha(n[p],s[p]))return!1}return!0}r(mo,"shallowEqual");function ex(n){for(;n&&n.firstChild;)n=n.firstChild;return n}r(ex,"getLeafNode");function tx(n,s){var o=ex(n);n=0;for(var u;o;){if(o.nodeType===3){if(u=n+o.textContent.length,n<=s&&u>=s)return{node:o,offset:s-n};n=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ex(o)}}r(tx,"getNodeForCharacterOffset");function nx(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?nx(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}r(nx,"containsNode");function ax(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=Oe(n.document);s instanceof n.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)n=s.contentWindow;else break;s=Oe(n.document)}return s}r(ax,"getActiveElementDeep");function qf(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}r(qf,"hasSelectionCapabilities");var BA=qa&&"documentMode"in document&&11>=document.documentMode,Zr=null,Ff=null,po=null,Hf=!1;function sx(n,s,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Hf||Zr==null||Zr!==Oe(u)||(u=Zr,"selectionStart"in u&&qf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),po&&mo(po,u)||(po=u,u=_u(Ff,"onSelect"),0<u.length&&(s=new as("onSelect","select",null,s,o),n.push({event:s,listeners:u}),s.target=Zr)))}r(sx,"constructSelectEvent");function mr(n,s){var o={};return o[n.toLowerCase()]=s.toLowerCase(),o["Webkit"+n]="webkit"+s,o["Moz"+n]="moz"+s,o}r(mr,"makePrefixMap");var Jr={animationend:mr("Animation","AnimationEnd"),animationiteration:mr("Animation","AnimationIteration"),animationstart:mr("Animation","AnimationStart"),transitionrun:mr("Transition","TransitionRun"),transitionstart:mr("Transition","TransitionStart"),transitioncancel:mr("Transition","TransitionCancel"),transitionend:mr("Transition","TransitionEnd")},Vf={},ix={};qa&&(ix=document.createElement("div").style,"AnimationEvent"in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),"TransitionEvent"in window||delete Jr.transitionend.transition);function pr(n){if(Vf[n])return Vf[n];if(!Jr[n])return n;var s=Jr[n],o;for(o in s)if(s.hasOwnProperty(o)&&o in ix)return Vf[n]=s[o];return n}r(pr,"getVendorPrefixedEventName");var rx=pr("animationend"),lx=pr("animationiteration"),ox=pr("animationstart"),KA=pr("transitionrun"),qA=pr("transitionstart"),FA=pr("transitioncancel"),cx=pr("transitionend"),ux=new Map,Qf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Qf.push("scrollEnd");function js(n,s){ux.set(n,s),ha(s,[n])}r(js,"registerSimpleEvent");var Bc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}},ss=[],el=0,Wf=0;function Kc(){for(var n=el,s=Wf=el=0;s<n;){var o=ss[s];ss[s++]=null;var u=ss[s];ss[s++]=null;var p=ss[s];ss[s++]=null;var x=ss[s];if(ss[s++]=null,u!==null&&p!==null){var w=u.pending;w===null?p.next=p:(p.next=w.next,w.next=p),u.pending=p}x!==0&&dx(o,p,x)}}r(Kc,"finishQueueingConcurrentUpdates");function qc(n,s,o,u){ss[el++]=n,ss[el++]=s,ss[el++]=o,ss[el++]=u,Wf|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}r(qc,"enqueueUpdate$1");function Gf(n,s,o,u){return qc(n,s,o,u),Fc(n)}r(Gf,"enqueueConcurrentHookUpdate");function hr(n,s){return qc(n,null,null,s),Fc(n)}r(hr,"enqueueConcurrentRenderForLane");function dx(n,s,o){n.lanes|=o;var u=n.alternate;u!==null&&(u.lanes|=o);for(var p=!1,x=n.return;x!==null;)x.childLanes|=o,u=x.alternate,u!==null&&(u.childLanes|=o),x.tag===22&&(n=x.stateNode,n===null||n._visibility&1||(p=!0)),n=x,x=x.return;return n.tag===3?(x=n.stateNode,p&&s!==null&&(p=31-Dt(o),n=x.hiddenUpdates,u=n[p],u===null?n[p]=[s]:u.push(s),s.lane=o|536870912),x):null}r(dx,"markUpdateLaneFromFiberToRoot");function Fc(n){if(50<Lo)throw Lo=0,sp=null,Error(c(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}r(Fc,"getRootForUpdatedFiber");var tl={};function HA(n,s,o,u){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}r(HA,"FiberNode");function Va(n,s,o,u){return new HA(n,s,o,u)}r(Va,"createFiberImplClass");function Yf(n){return n=n.prototype,!(!n||!n.isReactComponent)}r(Yf,"shouldConstruct");function Js(n,s){var o=n.alternate;return o===null?(o=Va(n.tag,s,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=s,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,s=n.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}r(Js,"createWorkInProgress");function fx(n,s){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=s,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,s=o.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}r(fx,"resetWorkInProgress");function Hc(n,s,o,u,p,x){var w=0;if(u=n,typeof n=="function")Yf(n)&&(w=1);else if(typeof n=="string")w=X2(n,o,je.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case U:return n=Va(31,o,s,p),n.elementType=U,n.lanes=x,n;case D:return gr(o.children,p,x,s);case R:w=8,p|=24;break;case E:return n=Va(12,o,s,p|2),n.elementType=E,n.lanes=x,n;case z:return n=Va(13,o,s,p),n.elementType=z,n.lanes=x,n;case B:return n=Va(19,o,s,p),n.elementType=B,n.lanes=x,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case I:w=10;break e;case C:w=9;break e;case O:w=11;break e;case L:w=14;break e;case _:w=16,u=null;break e}w=29,o=Error(c(130,n===null?"null":typeof n,"")),u=null}return s=Va(w,o,s,p),s.elementType=n,s.type=u,s.lanes=x,s}r(Hc,"createFiberFromTypeAndProps");function gr(n,s,o,u){return n=Va(7,n,u,s),n.lanes=o,n}r(gr,"createFiberFromFragment");function Xf(n,s,o){return n=Va(6,n,null,s),n.lanes=o,n}r(Xf,"createFiberFromText");function mx(n){var s=Va(18,null,null,0);return s.stateNode=n,s}r(mx,"createFiberFromDehydratedFragment");function Zf(n,s,o){return s=Va(4,n.children!==null?n.children:[],n.key,s),s.lanes=o,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}r(Zf,"createFiberFromPortal");var px=new WeakMap;function is(n,s){if(typeof n=="object"&&n!==null){var o=px.get(n);return o!==void 0?o:(s={value:n,source:s,stack:Vt(s)},px.set(n,s),s)}return{value:n,source:s,stack:Vt(s)}}r(is,"createCapturedValueAtFiber");var nl=[],al=0,Vc=null,ho=0,rs=[],ls=0,Ai=null,Us=1,$s="";function ei(n,s){nl[al++]=ho,nl[al++]=Vc,Vc=n,ho=s}r(ei,"pushTreeFork");function hx(n,s,o){rs[ls++]=Us,rs[ls++]=$s,rs[ls++]=Ai,Ai=n;var u=Us;n=$s;var p=32-Dt(u)-1;u&=~(1<<p),o+=1;var x=32-Dt(s)+p;if(30<x){var w=p-p%5;x=(u&(1<<w)-1).toString(32),u>>=w,p-=w,Us=1<<32-Dt(s)+p|o<<p|u,$s=x+n}else Us=1<<x|o<<p|u,$s=n}r(hx,"pushTreeId");function Jf(n){n.return!==null&&(ei(n,1),hx(n,1,0))}r(Jf,"pushMaterializedTreeId");function em(n){for(;n===Vc;)Vc=nl[--al],nl[al]=null,ho=nl[--al],nl[al]=null;for(;n===Ai;)Ai=rs[--ls],rs[ls]=null,$s=rs[--ls],rs[ls]=null,Us=rs[--ls],rs[ls]=null}r(em,"popTreeContext");function gx(n,s){rs[ls++]=Us,rs[ls++]=$s,rs[ls++]=Ai,Us=s.id,$s=s.overflow,Ai=n}r(gx,"restoreSuspendedTreeContext");var la=null,gn=null,Tt=!1,_i=null,os=!1,tm=Error(c(519));function Ei(n){throw go(is(Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML","")),n)),tm}r(Ei,"throwOnHydrationMismatch");function xx(n){var s=n.stateNode,o=n.type,u=n.memoizedProps;switch(s[xt]=n,s[kn]=u,o){case"dialog":jt("cancel",s),jt("close",s);break;case"iframe":case"object":case"embed":jt("load",s);break;case"video":case"audio":for(o=0;o<Po.length;o++)jt(Po[o],s);break;case"source":jt("error",s);break;case"img":case"image":case"link":jt("error",s),jt("load",s);break;case"details":jt("toggle",s);break;case"input":jt("invalid",s),Ia(s,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":jt("invalid",s);break;case"textarea":jt("invalid",s),Xe(s,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||u.suppressHydrationWarning===!0||Rv(s.textContent,o)?(u.popover!=null&&(jt("beforetoggle",s),jt("toggle",s)),u.onScroll!=null&&jt("scroll",s),u.onScrollEnd!=null&&jt("scrollend",s),u.onClick!=null&&(s.onclick=Nn),s=!0):s=!1,s||Ei(n,!0)}r(xx,"prepareToHydrateHostInstance");function bx(n){for(la=n.return;la;)switch(la.tag){case 5:case 31:case 13:os=!1;return;case 27:case 3:os=!0;return;default:la=la.return}}r(bx,"popToNextHostParent");function sl(n){if(n!==la)return!1;if(!Tt)return bx(n),Tt=!0,!1;var s=n.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||bp(n.type,n.memoizedProps)),o=!o),o&&gn&&Ei(n),bx(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(c(317));gn=Bv(n)}else if(s===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(c(317));gn=Bv(n)}else s===27?(s=gn,Bi(n.type)?(n=kp,kp=null,gn=n):gn=s):gn=la?ds(n.stateNode.nextSibling):null;return!0}r(sl,"popHydrationState");function xr(){gn=la=null,Tt=!1}r(xr,"resetHydrationState");function nm(){var n=_i;return n!==null&&(Oa===null?Oa=n:Oa.push.apply(Oa,n),_i=null),n}r(nm,"upgradeHydrationErrorsToRecoverable");function go(n){_i===null?_i=[n]:_i.push(n)}r(go,"queueHydrationError");var am=ue(null),br=null,ti=null;function Ii(n,s,o){Ae(am,s._currentValue),s._currentValue=o}r(Ii,"pushProvider");function ni(n){n._currentValue=am.current,we(am)}r(ni,"popProvider");function sm(n,s,o){for(;n!==null;){var u=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),n===o)break;n=n.return}}r(sm,"scheduleContextWorkOnParentPath");function im(n,s,o,u){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var x=p.dependencies;if(x!==null){var w=p.child;x=x.firstContext;e:for(;x!==null;){var A=x;x=p;for(var K=0;K<s.length;K++)if(A.context===s[K]){x.lanes|=o,A=x.alternate,A!==null&&(A.lanes|=o),sm(x.return,o,n),u||(w=null);break e}x=A.next}}else if(p.tag===18){if(w=p.return,w===null)throw Error(c(341));w.lanes|=o,x=w.alternate,x!==null&&(x.lanes|=o),sm(w,o,n),w=null}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===n){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}}r(im,"propagateContextChanges");function il(n,s,o,u){n=null;for(var p=s,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var w=p.alternate;if(w===null)throw Error(c(387));if(w=w.memoizedProps,w!==null){var A=p.type;Ha(p.pendingProps.value,w.value)||(n!==null?n.push(A):n=[A])}}else if(p===Ve.current){if(w=p.alternate,w===null)throw Error(c(387));w.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(qo):n=[qo])}p=p.return}n!==null&&im(s,n,o,u),s.flags|=262144}r(il,"propagateParentContextChanges");function Qc(n){for(n=n.firstContext;n!==null;){if(!Ha(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}r(Qc,"checkIfContextChanged");function vr(n){br=n,ti=null,n=n.dependencies,n!==null&&(n.firstContext=null)}r(vr,"prepareToReadContext");function oa(n){return vx(br,n)}r(oa,"readContext");function Wc(n,s){return br===null&&vr(n),vx(n,s)}r(Wc,"readContextDuringReconciliation");function vx(n,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},ti===null){if(n===null)throw Error(c(308));ti=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else ti=ti.next=s;return o}r(vx,"readContextForConsumer");var VA=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:r(function(o,u){n.push(u)},"addEventListener")};this.abort=function(){s.aborted=!0,n.forEach(function(o){return o()})}},QA=t.unstable_scheduleCallback,WA=t.unstable_NormalPriority,qn={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rm(){return{controller:new VA,data:new Map,refCount:0}}r(rm,"createCache");function xo(n){n.refCount--,n.refCount===0&&QA(WA,function(){n.controller.abort()})}r(xo,"releaseCache");var bo=null,lm=0,rl=0,ll=null;function GA(n,s){if(bo===null){var o=bo=[];lm=0,rl=up(),ll={status:"pending",value:void 0,then:r(function(u){o.push(u)},"then")}}return lm++,s.then(yx,yx),s}r(GA,"entangleAsyncAction");function yx(){if(--lm===0&&bo!==null){ll!==null&&(ll.status="fulfilled");var n=bo;bo=null,rl=0,ll=null;for(var s=0;s<n.length;s++)(0,n[s])()}}r(yx,"pingEngtangledActionScope");function YA(n,s){var o=[],u={status:"pending",value:null,reason:null,then:r(function(p){o.push(p)},"then")};return n.then(function(){u.status="fulfilled",u.value=s;for(var p=0;p<o.length;p++)(0,o[p])(s)},function(p){for(u.status="rejected",u.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),u}r(YA,"chainThenableValue");var jx=T.S;T.S=function(n,s){tv=Je(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&GA(n,s),jx!==null&&jx(n,s)};var yr=ue(null);function om(){var n=yr.current;return n!==null?n:rn.pooledCache}r(om,"peekCacheFromPool");function Gc(n,s){s===null?Ae(yr,yr.current):Ae(yr,s.pool)}r(Gc,"pushTransition");function wx(){var n=om();return n===null?null:{parent:qn._currentValue,pool:n}}r(wx,"getSuspendedCache");var ol=Error(c(460)),cm=Error(c(474)),Yc=Error(c(542)),Xc={then:r(function(){},"then")};function kx(n){return n=n.status,n==="fulfilled"||n==="rejected"}r(kx,"isThenableResolved");function Sx(n,s,o){switch(o=n[o],o===void 0?n.push(s):o!==s&&(s.then(Nn,Nn),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,Cx(n),n;default:if(typeof s.status=="string")s.then(Nn,Nn);else{if(n=rn,n!==null&&100<n.shellSuspendCounter)throw Error(c(482));n=s,n.status="pending",n.then(function(u){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=u}},function(u){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=u}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,Cx(n),n}throw wr=s,ol}}r(Sx,"trackUsedThenable");function jr(n){try{var s=n._init;return s(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(wr=o,ol):o}}r(jr,"resolveLazy");var wr=null;function Nx(){if(wr===null)throw Error(c(459));var n=wr;return wr=null,n}r(Nx,"getSuspendedThenable");function Cx(n){if(n===ol||n===Yc)throw Error(c(483))}r(Cx,"checkIfUseWrappedInAsyncCatch");var cl=null,vo=0;function Zc(n){var s=vo;return vo+=1,cl===null&&(cl=[]),Sx(cl,n,s)}r(Zc,"unwrapThenable");function yo(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}r(yo,"coerceRef");function Jc(n,s){throw s.$$typeof===k?Error(c(525)):(n=Object.prototype.toString.call(s),Error(c(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}r(Jc,"throwOnInvalidObjectTypeImpl");function Ax(n){function s(W,q){if(n){var J=W.deletions;J===null?(W.deletions=[q],W.flags|=16):J.push(q)}}r(s,"deleteChild");function o(W,q){if(!n)return null;for(;q!==null;)s(W,q),q=q.sibling;return null}r(o,"deleteRemainingChildren");function u(W){for(var q=new Map;W!==null;)W.key!==null?q.set(W.key,W):q.set(W.index,W),W=W.sibling;return q}r(u,"mapRemainingChildren");function p(W,q){return W=Js(W,q),W.index=0,W.sibling=null,W}r(p,"useFiber");function x(W,q,J){return W.index=J,n?(J=W.alternate,J!==null?(J=J.index,J<q?(W.flags|=67108866,q):J):(W.flags|=67108866,q)):(W.flags|=1048576,q)}r(x,"placeChild");function w(W){return n&&W.alternate===null&&(W.flags|=67108866),W}r(w,"placeSingleChild");function A(W,q,J,fe){return q===null||q.tag!==6?(q=Xf(J,W.mode,fe),q.return=W,q):(q=p(q,J),q.return=W,q)}r(A,"updateTextNode");function K(W,q,J,fe){var We=J.type;return We===D?de(W,q,J.props.children,fe,J.key):q!==null&&(q.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===_&&jr(We)===q.type)?(q=p(q,J.props),yo(q,J),q.return=W,q):(q=Hc(J.type,J.key,J.props,null,W.mode,fe),yo(q,J),q.return=W,q)}r(K,"updateElement");function ee(W,q,J,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==J.containerInfo||q.stateNode.implementation!==J.implementation?(q=Zf(J,W.mode,fe),q.return=W,q):(q=p(q,J.children||[]),q.return=W,q)}r(ee,"updatePortal");function de(W,q,J,fe,We){return q===null||q.tag!==7?(q=gr(J,W.mode,fe,We),q.return=W,q):(q=p(q,J),q.return=W,q)}r(de,"updateFragment");function ge(W,q,J){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Xf(""+q,W.mode,J),q.return=W,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case N:return J=Hc(q.type,q.key,q.props,null,W.mode,J),yo(J,q),J.return=W,J;case S:return q=Zf(q,W.mode,J),q.return=W,q;case _:return q=jr(q),ge(W,q,J)}if($(q)||se(q))return q=gr(q,W.mode,J,null),q.return=W,q;if(typeof q.then=="function")return ge(W,Zc(q),J);if(q.$$typeof===I)return ge(W,Wc(W,q),J);Jc(W,q)}return null}r(ge,"createChild");function ne(W,q,J,fe){var We=q!==null?q.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return We!==null?null:A(W,q,""+J,fe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case N:return J.key===We?K(W,q,J,fe):null;case S:return J.key===We?ee(W,q,J,fe):null;case _:return J=jr(J),ne(W,q,J,fe)}if($(J)||se(J))return We!==null?null:de(W,q,J,fe,null);if(typeof J.then=="function")return ne(W,q,Zc(J),fe);if(J.$$typeof===I)return ne(W,q,Wc(W,J),fe);Jc(W,J)}return null}r(ne,"updateSlot");function re(W,q,J,fe,We){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return W=W.get(J)||null,A(q,W,""+fe,We);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case N:return W=W.get(fe.key===null?J:fe.key)||null,K(q,W,fe,We);case S:return W=W.get(fe.key===null?J:fe.key)||null,ee(q,W,fe,We);case _:return fe=jr(fe),re(W,q,J,fe,We)}if($(fe)||se(fe))return W=W.get(J)||null,de(q,W,fe,We,null);if(typeof fe.then=="function")return re(W,q,J,Zc(fe),We);if(fe.$$typeof===I)return re(W,q,J,Wc(q,fe),We);Jc(q,fe)}return null}r(re,"updateFromMap");function Le(W,q,J,fe){for(var We=null,Bt=null,Be=q,ht=q=0,Nt=null;Be!==null&&ht<J.length;ht++){Be.index>ht?(Nt=Be,Be=null):Nt=Be.sibling;var Kt=ne(W,Be,J[ht],fe);if(Kt===null){Be===null&&(Be=Nt);break}n&&Be&&Kt.alternate===null&&s(W,Be),q=x(Kt,q,ht),Bt===null?We=Kt:Bt.sibling=Kt,Bt=Kt,Be=Nt}if(ht===J.length)return o(W,Be),Tt&&ei(W,ht),We;if(Be===null){for(;ht<J.length;ht++)Be=ge(W,J[ht],fe),Be!==null&&(q=x(Be,q,ht),Bt===null?We=Be:Bt.sibling=Be,Bt=Be);return Tt&&ei(W,ht),We}for(Be=u(Be);ht<J.length;ht++)Nt=re(Be,W,ht,J[ht],fe),Nt!==null&&(n&&Nt.alternate!==null&&Be.delete(Nt.key===null?ht:Nt.key),q=x(Nt,q,ht),Bt===null?We=Nt:Bt.sibling=Nt,Bt=Nt);return n&&Be.forEach(function(Vi){return s(W,Vi)}),Tt&&ei(W,ht),We}r(Le,"reconcileChildrenArray");function tt(W,q,J,fe){if(J==null)throw Error(c(151));for(var We=null,Bt=null,Be=q,ht=q=0,Nt=null,Kt=J.next();Be!==null&&!Kt.done;ht++,Kt=J.next()){Be.index>ht?(Nt=Be,Be=null):Nt=Be.sibling;var Vi=ne(W,Be,Kt.value,fe);if(Vi===null){Be===null&&(Be=Nt);break}n&&Be&&Vi.alternate===null&&s(W,Be),q=x(Vi,q,ht),Bt===null?We=Vi:Bt.sibling=Vi,Bt=Vi,Be=Nt}if(Kt.done)return o(W,Be),Tt&&ei(W,ht),We;if(Be===null){for(;!Kt.done;ht++,Kt=J.next())Kt=ge(W,Kt.value,fe),Kt!==null&&(q=x(Kt,q,ht),Bt===null?We=Kt:Bt.sibling=Kt,Bt=Kt);return Tt&&ei(W,ht),We}for(Be=u(Be);!Kt.done;ht++,Kt=J.next())Kt=re(Be,W,ht,Kt.value,fe),Kt!==null&&(n&&Kt.alternate!==null&&Be.delete(Kt.key===null?ht:Kt.key),q=x(Kt,q,ht),Bt===null?We=Kt:Bt.sibling=Kt,Bt=Kt);return n&&Be.forEach(function(d_){return s(W,d_)}),Tt&&ei(W,ht),We}r(tt,"reconcileChildrenIterator");function nn(W,q,J,fe){if(typeof J=="object"&&J!==null&&J.type===D&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case N:e:{for(var We=J.key;q!==null;){if(q.key===We){if(We=J.type,We===D){if(q.tag===7){o(W,q.sibling),fe=p(q,J.props.children),fe.return=W,W=fe;break e}}else if(q.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===_&&jr(We)===q.type){o(W,q.sibling),fe=p(q,J.props),yo(fe,J),fe.return=W,W=fe;break e}o(W,q);break}else s(W,q);q=q.sibling}J.type===D?(fe=gr(J.props.children,W.mode,fe,J.key),fe.return=W,W=fe):(fe=Hc(J.type,J.key,J.props,null,W.mode,fe),yo(fe,J),fe.return=W,W=fe)}return w(W);case S:e:{for(We=J.key;q!==null;){if(q.key===We)if(q.tag===4&&q.stateNode.containerInfo===J.containerInfo&&q.stateNode.implementation===J.implementation){o(W,q.sibling),fe=p(q,J.children||[]),fe.return=W,W=fe;break e}else{o(W,q);break}else s(W,q);q=q.sibling}fe=Zf(J,W.mode,fe),fe.return=W,W=fe}return w(W);case _:return J=jr(J),nn(W,q,J,fe)}if($(J))return Le(W,q,J,fe);if(se(J)){if(We=se(J),typeof We!="function")throw Error(c(150));return J=We.call(J),tt(W,q,J,fe)}if(typeof J.then=="function")return nn(W,q,Zc(J),fe);if(J.$$typeof===I)return nn(W,q,Wc(W,J),fe);Jc(W,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,q!==null&&q.tag===6?(o(W,q.sibling),fe=p(q,J),fe.return=W,W=fe):(o(W,q),fe=Xf(J,W.mode,fe),fe.return=W,W=fe),w(W)):o(W,q)}return r(nn,"reconcileChildFibersImpl"),function(W,q,J,fe){try{vo=0;var We=nn(W,q,J,fe);return cl=null,We}catch(Be){if(Be===ol||Be===Yc)throw Be;var Bt=Va(29,Be,null,W.mode);return Bt.lanes=fe,Bt.return=W,Bt}}}r(Ax,"createChildReconciler");var kr=Ax(!0),_x=Ax(!1),Ti=!1;function um(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}r(um,"initializeUpdateQueue");function dm(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}r(dm,"cloneUpdateQueue");function Sr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}r(Sr,"createUpdate");function Nr(n,s,o){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Ht&2)!==0){var p=u.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),u.pending=s,s=Fc(n),dx(n,null,o),s}return qc(n,u,s,o),Fc(n)}r(Nr,"enqueueUpdate");function jo(n,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var u=s.lanes;u&=n.pendingLanes,o|=u,s.lanes=o,An(n,o)}}r(jo,"entangleTransitions");function fm(n,s){var o=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,x=null;if(o=o.firstBaseUpdate,o!==null){do{var w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};x===null?p=x=w:x=x.next=w,o=o.next}while(o!==null);x===null?p=x=s:x=x.next=s}else p=x=s;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:u.shared,callbacks:u.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=s:n.next=s,o.lastBaseUpdate=s}r(fm,"enqueueCapturedUpdate");var mm=!1;function wo(){if(mm){var n=ll;if(n!==null)throw n}}r(wo,"suspendIfUpdateReadFromEntangledAsyncAction");function ko(n,s,o,u){mm=!1;var p=n.updateQueue;Ti=!1;var x=p.firstBaseUpdate,w=p.lastBaseUpdate,A=p.shared.pending;if(A!==null){p.shared.pending=null;var K=A,ee=K.next;K.next=null,w===null?x=ee:w.next=ee,w=K;var de=n.alternate;de!==null&&(de=de.updateQueue,A=de.lastBaseUpdate,A!==w&&(A===null?de.firstBaseUpdate=ee:A.next=ee,de.lastBaseUpdate=K))}if(x!==null){var ge=p.baseState;w=0,de=ee=K=null,A=x;do{var ne=A.lane&-536870913,re=ne!==A.lane;if(re?(St&ne)===ne:(u&ne)===ne){ne!==0&&ne===rl&&(mm=!0),de!==null&&(de=de.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Le=n,tt=A;ne=s;var nn=o;switch(tt.tag){case 1:if(Le=tt.payload,typeof Le=="function"){ge=Le.call(nn,ge,ne);break e}ge=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=tt.payload,ne=typeof Le=="function"?Le.call(nn,ge,ne):Le,ne==null)break e;ge=j({},ge,ne);break e;case 2:Ti=!0}}ne=A.callback,ne!==null&&(n.flags|=64,re&&(n.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ne]:re.push(ne))}else re={lane:ne,tag:A.tag,payload:A.payload,callback:A.callback,next:null},de===null?(ee=de=re,K=ge):de=de.next=re,w|=ne;if(A=A.next,A===null){if(A=p.shared.pending,A===null)break;re=A,A=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);de===null&&(K=ge),p.baseState=K,p.firstBaseUpdate=ee,p.lastBaseUpdate=de,x===null&&(p.shared.lanes=0),Li|=w,n.lanes=w,n.memoizedState=ge}}r(ko,"processUpdateQueue");function Ex(n,s){if(typeof n!="function")throw Error(c(191,n));n.call(s)}r(Ex,"callCallback");function Ix(n,s){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)Ex(o[n],s)}r(Ix,"commitCallbacks");var ul=ue(null),eu=ue(0);function Tx(n,s){n=di,Ae(eu,n),Ae(ul,s),di=n|s.baseLanes}r(Tx,"pushHiddenContext");function pm(){Ae(eu,di),Ae(ul,ul.current)}r(pm,"reuseHiddenContextOnStack");function hm(){di=eu.current,we(ul),we(eu)}r(hm,"popHiddenContext");var Qa=ue(null),cs=null;function Ri(n){var s=n.alternate;Ae(Pn,Pn.current&1),Ae(Qa,n),cs===null&&(s===null||ul.current!==null||s.memoizedState!==null)&&(cs=n)}r(Ri,"pushPrimaryTreeSuspenseHandler");function gm(n){Ae(Pn,Pn.current),Ae(Qa,n),cs===null&&(cs=n)}r(gm,"pushDehydratedActivitySuspenseHandler");function Rx(n){n.tag===22?(Ae(Pn,Pn.current),Ae(Qa,n),cs===null&&(cs=n)):Di(n)}r(Rx,"pushOffscreenSuspenseHandler");function Di(){Ae(Pn,Pn.current),Ae(Qa,Qa.current)}r(Di,"reuseSuspenseHandlerOnStack");function Wa(n){we(Qa),cs===n&&(cs=null),we(Pn)}r(Wa,"popSuspenseHandler");var Pn=ue(0);function tu(n){for(var s=n;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||jp(o)||wp(o)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}r(tu,"findFirstSuspended");var ai=0,mt=null,en=null,Fn=null,nu=!1,dl=!1,Cr=!1,au=0,So=0,fl=null,XA=0;function In(){throw Error(c(321))}r(In,"throwInvalidHookError");function xm(n,s){if(s===null)return!1;for(var o=0;o<s.length&&o<n.length;o++)if(!Ha(n[o],s[o]))return!1;return!0}r(xm,"areHookInputsEqual");function bm(n,s,o,u,p,x){return ai=x,mt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,T.H=n===null||n.memoizedState===null?hb:Dm,Cr=!1,x=o(u,p),Cr=!1,dl&&(x=Mx(s,o,u,p)),Dx(n),x}r(bm,"renderWithHooks");function Dx(n){T.H=Ao;var s=en!==null&&en.next!==null;if(ai=0,Fn=en=mt=null,nu=!1,So=0,fl=null,s)throw Error(c(300));n===null||Hn||(n=n.dependencies,n!==null&&Qc(n)&&(Hn=!0))}r(Dx,"finishRenderingHooks");function Mx(n,s,o,u){mt=n;var p=0;do{if(dl&&(fl=null),So=0,dl=!1,25<=p)throw Error(c(301));if(p+=1,Fn=en=null,n.updateQueue!=null){var x=n.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}T.H=gb,x=s(o,u)}while(dl);return x}r(Mx,"renderWithHooksAgain");function ZA(){var n=T.H,s=n.useState()[0];return s=typeof s.then=="function"?No(s):s,n=n.useState()[0],(en!==null?en.memoizedState:null)!==n&&(mt.flags|=1024),s}r(ZA,"TransitionAwareHostComponent");function vm(){var n=au!==0;return au=0,n}r(vm,"checkDidRenderIdHook");function ym(n,s,o){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~o}r(ym,"bailoutHooks");function jm(n){if(nu){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}nu=!1}ai=0,Fn=en=mt=null,dl=!1,So=au=0,fl=null}r(jm,"resetHooksOnUnwind");function ka(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fn===null?mt.memoizedState=Fn=n:Fn=Fn.next=n,Fn}r(ka,"mountWorkInProgressHook");function Un(){if(en===null){var n=mt.alternate;n=n!==null?n.memoizedState:null}else n=en.next;var s=Fn===null?mt.memoizedState:Fn.next;if(s!==null)Fn=s,en=n;else{if(n===null)throw mt.alternate===null?Error(c(467)):Error(c(310));en=n,n={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},Fn===null?mt.memoizedState=Fn=n:Fn=Fn.next=n}return Fn}r(Un,"updateWorkInProgressHook");function su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}r(su,"createFunctionComponentUpdateQueue");function No(n){var s=So;return So+=1,fl===null&&(fl=[]),n=Sx(fl,n,s),s=mt,(Fn===null?s.memoizedState:Fn.next)===null&&(s=s.alternate,T.H=s===null||s.memoizedState===null?hb:Dm),n}r(No,"useThenable");function iu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return No(n);if(n.$$typeof===I)return oa(n)}throw Error(c(438,String(n)))}r(iu,"use");function wm(n){var s=null,o=mt.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var u=mt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(s={data:u.data.map(function(p){return p.slice()}),index:0})))}if(s??={data:[],index:0},o===null&&(o=su(),mt.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(n),u=0;u<n;u++)o[u]=F;return s.index++,o}r(wm,"useMemoCache");function si(n,s){return typeof s=="function"?s(n):s}r(si,"basicStateReducer");function ru(n){return km(Un(),en,n)}r(ru,"updateReducer");function km(n,s,o){var u=n.queue;if(u===null)throw Error(c(311));u.lastRenderedReducer=o;var p=n.baseQueue,x=u.pending;if(x!==null){if(p!==null){var w=p.next;p.next=x.next,x.next=w}s.baseQueue=p=x,u.pending=null}if(x=n.baseState,p===null)n.memoizedState=x;else{s=p.next;var A=w=null,K=null,ee=s,de=!1;do{var ge=ee.lane&-536870913;if(ge!==ee.lane?(St&ge)===ge:(ai&ge)===ge){var ne=ee.revertLane;if(ne===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ge===rl&&(de=!0);else if((ai&ne)===ne){ee=ee.next,ne===rl&&(de=!0);continue}else ge={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},K===null?(A=K=ge,w=x):K=K.next=ge,mt.lanes|=ne,Li|=ne;ge=ee.action,Cr&&o(x,ge),x=ee.hasEagerState?ee.eagerState:o(x,ge)}else ne={lane:ge,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},K===null?(A=K=ne,w=x):K=K.next=ne,mt.lanes|=ge,Li|=ge;ee=ee.next}while(ee!==null&&ee!==s);if(K===null?w=x:K.next=A,!Ha(x,n.memoizedState)&&(Hn=!0,de&&(o=ll,o!==null)))throw o;n.memoizedState=x,n.baseState=w,n.baseQueue=K,u.lastRenderedState=x}return p===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}r(km,"updateReducerImpl");function Sm(n){var s=Un(),o=s.queue;if(o===null)throw Error(c(311));o.lastRenderedReducer=n;var u=o.dispatch,p=o.pending,x=s.memoizedState;if(p!==null){o.pending=null;var w=p=p.next;do x=n(x,w.action),w=w.next;while(w!==p);Ha(x,s.memoizedState)||(Hn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),o.lastRenderedState=x}return[x,u]}r(Sm,"rerenderReducer");function Ox(n,s,o){var u=mt,p=Un(),x=Tt;if(x){if(o===void 0)throw Error(c(407));o=o()}else o=s();var w=!Ha((en||p).memoizedState,o);if(w&&(p.memoizedState=o,Hn=!0),p=p.queue,Am(Px.bind(null,u,p,n),[n]),p.getSnapshot!==s||w||Fn!==null&&Fn.memoizedState.tag&1){if(u.flags|=2048,ml(9,{destroy:void 0},zx.bind(null,u,p,o,s),null),rn===null)throw Error(c(349));x||(ai&127)!==0||Lx(u,s,o)}return o}r(Ox,"updateSyncExternalStore");function Lx(n,s,o){n.flags|=16384,n={getSnapshot:s,value:o},s=mt.updateQueue,s===null?(s=su(),mt.updateQueue=s,s.stores=[n]):(o=s.stores,o===null?s.stores=[n]:o.push(n))}r(Lx,"pushStoreConsistencyCheck");function zx(n,s,o,u){s.value=o,s.getSnapshot=u,Ux(s)&&$x(n)}r(zx,"updateStoreInstance");function Px(n,s,o){return o(function(){Ux(s)&&$x(n)})}r(Px,"subscribeToStore");function Ux(n){var s=n.getSnapshot;n=n.value;try{var o=s();return!Ha(n,o)}catch{return!0}}r(Ux,"checkIfSnapshotChanged");function $x(n){var s=hr(n,2);s!==null&&La(s,n,2)}r($x,"forceStoreRerender");function Nm(n){var s=ka();if(typeof n=="function"){var o=n;if(n=o(),Cr){wn(!0);try{o()}finally{wn(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:n},s}r(Nm,"mountStateImpl");function Bx(n,s,o,u){return n.baseState=o,km(n,en,typeof u=="function"?u:si)}r(Bx,"updateOptimisticImpl");function JA(n,s,o,u,p){if(cu(n))throw Error(c(485));if(n=s.action,n!==null){var x={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:r(function(w){x.listeners.push(w)},"then")};T.T!==null?o(!0):x.isTransition=!1,u(x),o=s.pending,o===null?(x.next=s.pending=x,Kx(s,x)):(x.next=o.next,s.pending=o.next=x)}}r(JA,"dispatchActionState");function Kx(n,s){var o=s.action,u=s.payload,p=n.state;if(s.isTransition){var x=T.T,w={};T.T=w;try{var A=o(p,u),K=T.S;K!==null&&K(w,A),qx(n,s,A)}catch(ee){Cm(n,s,ee)}finally{x!==null&&w.types!==null&&(x.types=w.types),T.T=x}}else try{x=o(p,u),qx(n,s,x)}catch(ee){Cm(n,s,ee)}}r(Kx,"runActionStateAction");function qx(n,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){Fx(n,s,u)},function(u){return Cm(n,s,u)}):Fx(n,s,o)}r(qx,"handleActionReturnValue");function Fx(n,s,o){s.status="fulfilled",s.value=o,Hx(s),n.state=o,s=n.pending,s!==null&&(o=s.next,o===s?n.pending=null:(o=o.next,s.next=o,Kx(n,o)))}r(Fx,"onActionSuccess");function Cm(n,s,o){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do s.status="rejected",s.reason=o,Hx(s),s=s.next;while(s!==u)}n.action=null}r(Cm,"onActionError");function Hx(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}r(Hx,"notifyActionListeners");function Vx(n,s){return s}r(Vx,"actionStateReducer");function Qx(n,s){if(Tt){var o=rn.formState;if(o!==null){e:{var u=mt;if(Tt){if(gn){t:{for(var p=gn,x=os;p.nodeType!==8;){if(!x){p=null;break t}if(p=ds(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){gn=ds(p.nextSibling),u=p.data==="F!";break e}}Ei(u)}u=!1}u&&(s=o[0])}}return o=ka(),o.memoizedState=o.baseState=s,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vx,lastRenderedState:s},o.queue=u,o=fb.bind(null,mt,u),u.dispatch=o,u=Nm(!1),x=Rm.bind(null,mt,!1,u.queue),u=ka(),p={state:s,dispatch:null,action:n,pending:null},u.queue=p,o=JA.bind(null,mt,p,x,o),p.dispatch=o,u.memoizedState=n,[s,o,!1]}r(Qx,"mountActionState");function Wx(n){return Gx(Un(),en,n)}r(Wx,"updateActionState");function Gx(n,s,o){if(s=km(n,s,Vx)[0],n=ru(si)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var u=No(s)}catch(w){throw w===ol?Yc:w}else u=s;s=Un();var p=s.queue,x=p.dispatch;return o!==s.memoizedState&&(mt.flags|=2048,ml(9,{destroy:void 0},e2.bind(null,p,o),null)),[u,x,n]}r(Gx,"updateActionStateImpl");function e2(n,s){n.action=s}r(e2,"actionStateActionEffect");function Yx(n){var s=Un(),o=en;if(o!==null)return Gx(s,o,n);Un(),s=s.memoizedState,o=Un();var u=o.queue.dispatch;return o.memoizedState=n,[s,u,!1]}r(Yx,"rerenderActionState");function ml(n,s,o,u){return n={tag:n,create:o,deps:u,inst:s,next:null},s=mt.updateQueue,s===null&&(s=su(),mt.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=n.next=n:(u=o.next,o.next=n,n.next=u,s.lastEffect=n),n}r(ml,"pushSimpleEffect");function Xx(){return Un().memoizedState}r(Xx,"updateRef");function lu(n,s,o,u){var p=ka();mt.flags|=n,p.memoizedState=ml(1|s,{destroy:void 0},o,u===void 0?null:u)}r(lu,"mountEffectImpl");function ou(n,s,o,u){var p=Un();u=u===void 0?null:u;var x=p.memoizedState.inst;en!==null&&u!==null&&xm(u,en.memoizedState.deps)?p.memoizedState=ml(s,x,o,u):(mt.flags|=n,p.memoizedState=ml(1|s,x,o,u))}r(ou,"updateEffectImpl");function Zx(n,s){lu(8390656,8,n,s)}r(Zx,"mountEffect");function Am(n,s){ou(2048,8,n,s)}r(Am,"updateEffect");function t2(n){mt.flags|=4;var s=mt.updateQueue;if(s===null)s=su(),mt.updateQueue=s,s.events=[n];else{var o=s.events;o===null?s.events=[n]:o.push(n)}}r(t2,"useEffectEventImpl");function Jx(n){var s=Un().memoizedState;return t2({ref:s,nextImpl:n}),function(){if((Ht&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}r(Jx,"updateEvent");function eb(n,s){return ou(4,2,n,s)}r(eb,"updateInsertionEffect");function tb(n,s){return ou(4,4,n,s)}r(tb,"updateLayoutEffect");function nb(n,s){if(typeof s=="function"){n=n();var o=s(n);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}r(nb,"imperativeHandleEffect");function ab(n,s,o){o=o!=null?o.concat([n]):null,ou(4,4,nb.bind(null,s,n),o)}r(ab,"updateImperativeHandle");function _m(){}r(_m,"mountDebugValue");function sb(n,s){var o=Un();s=s===void 0?null:s;var u=o.memoizedState;return s!==null&&xm(s,u[1])?u[0]:(o.memoizedState=[n,s],n)}r(sb,"updateCallback");function ib(n,s){var o=Un();s=s===void 0?null:s;var u=o.memoizedState;if(s!==null&&xm(s,u[1]))return u[0];if(u=n(),Cr){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,s],u}r(ib,"updateMemo");function Em(n,s,o){return o===void 0||(ai&1073741824)!==0&&(St&261930)===0?n.memoizedState=s:(n.memoizedState=o,n=av(),mt.lanes|=n,Li|=n,o)}r(Em,"mountDeferredValueImpl");function rb(n,s,o,u){return Ha(o,s)?o:ul.current!==null?(n=Em(n,o,u),Ha(n,s)||(Hn=!0),n):(ai&42)===0||(ai&1073741824)!==0&&(St&261930)===0?(Hn=!0,n.memoizedState=o):(n=av(),mt.lanes|=n,Li|=n,s)}r(rb,"updateDeferredValueImpl");function lb(n,s,o,u,p){var x=te.p;te.p=x!==0&&8>x?x:8;var w=T.T,A={};T.T=A,Rm(n,!1,s,o);try{var K=p(),ee=T.S;ee!==null&&ee(A,K),K!==null&&typeof K=="object"&&typeof K.then=="function"?Co(n,s,YA(K,u),us(n)):Co(n,s,u,us(n))}catch(de){Co(n,s,{then:r(function(){},"then"),status:"rejected",reason:de},us())}finally{te.p=x,w!==null&&A.types!==null&&(w.types=A.types),T.T=w}}r(lb,"startTransition");function n2(){}r(n2,"noop");function Im(n,s,o,u){if(n.tag!==5)throw Error(c(476));var p=ob(n).queue;lb(n,p,s,ce,o===null?n2:function(){return cb(n),o(u)})}r(Im,"startHostTransition");function ob(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:ce},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:si,lastRenderedState:o},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}r(ob,"ensureFormComponentIsStateful");function cb(n){var s=ob(n);s.next===null&&(s=n.alternate.memoizedState),Co(n,s.next.queue,{},us())}r(cb,"requestFormReset$1");function Tm(){return oa(qo)}r(Tm,"useHostTransitionStatus");function ub(){return Un().memoizedState}r(ub,"updateId");function db(){return Un().memoizedState}r(db,"updateRefresh");function a2(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var o=us();n=Sr(o);var u=Nr(s,n,o);u!==null&&(La(u,s,o),jo(u,s,o)),s={cache:rm()},n.payload=s;return}s=s.return}}r(a2,"refreshCache");function s2(n,s,o){var u=us();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},cu(n)?mb(s,o):(o=Gf(n,s,o,u),o!==null&&(La(o,n,u),pb(o,s,u)))}r(s2,"dispatchReducerAction");function fb(n,s,o){Co(n,s,o,us())}r(fb,"dispatchSetState");function Co(n,s,o,u){var p={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(cu(n))mb(s,p);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var w=s.lastRenderedState,A=x(w,o);if(p.hasEagerState=!0,p.eagerState=A,Ha(A,w))return qc(n,s,p,0),rn===null&&Kc(),!1}catch{}if(o=Gf(n,s,p,u),o!==null)return La(o,n,u),pb(o,s,u),!0}return!1}r(Co,"dispatchSetStateInternal");function Rm(n,s,o,u){if(u={lane:2,revertLane:up(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},cu(n)){if(s)throw Error(c(479))}else s=Gf(n,o,u,2),s!==null&&La(s,n,2)}r(Rm,"dispatchOptimisticSetState");function cu(n){var s=n.alternate;return n===mt||s!==null&&s===mt}r(cu,"isRenderPhaseUpdate");function mb(n,s){dl=nu=!0;var o=n.pending;o===null?s.next=s:(s.next=o.next,o.next=s),n.pending=s}r(mb,"enqueueRenderPhaseUpdate");function pb(n,s,o){if((o&4194048)!==0){var u=s.lanes;u&=n.pendingLanes,o|=u,s.lanes=o,An(n,o)}}r(pb,"entangleTransitionUpdate");var Ao={readContext:oa,use:iu,useCallback:In,useContext:In,useEffect:In,useImperativeHandle:In,useLayoutEffect:In,useInsertionEffect:In,useMemo:In,useReducer:In,useRef:In,useState:In,useDebugValue:In,useDeferredValue:In,useTransition:In,useSyncExternalStore:In,useId:In,useHostTransitionStatus:In,useFormState:In,useActionState:In,useOptimistic:In,useMemoCache:In,useCacheRefresh:In};Ao.useEffectEvent=In;var hb={readContext:oa,use:iu,useCallback:r(function(n,s){return ka().memoizedState=[n,s===void 0?null:s],n},"useCallback"),useContext:oa,useEffect:Zx,useImperativeHandle:r(function(n,s,o){o=o!=null?o.concat([n]):null,lu(4194308,4,nb.bind(null,s,n),o)},"useImperativeHandle"),useLayoutEffect:r(function(n,s){return lu(4194308,4,n,s)},"useLayoutEffect"),useInsertionEffect:r(function(n,s){lu(4,2,n,s)},"useInsertionEffect"),useMemo:r(function(n,s){var o=ka();s=s===void 0?null:s;var u=n();if(Cr){wn(!0);try{n()}finally{wn(!1)}}return o.memoizedState=[u,s],u},"useMemo"),useReducer:r(function(n,s,o){var u=ka();if(o!==void 0){var p=o(s);if(Cr){wn(!0);try{o(s)}finally{wn(!1)}}}else p=s;return u.memoizedState=u.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},u.queue=n,n=n.dispatch=s2.bind(null,mt,n),[u.memoizedState,n]},"useReducer"),useRef:r(function(n){var s=ka();return n={current:n},s.memoizedState=n},"useRef"),useState:r(function(n){n=Nm(n);var s=n.queue,o=fb.bind(null,mt,s);return s.dispatch=o,[n.memoizedState,o]},"useState"),useDebugValue:_m,useDeferredValue:r(function(n,s){return Em(ka(),n,s)},"useDeferredValue"),useTransition:r(function(){var n=Nm(!1);return n=lb.bind(null,mt,n.queue,!0,!1),ka().memoizedState=n,[!1,n]},"useTransition"),useSyncExternalStore:r(function(n,s,o){var u=mt,p=ka();if(Tt){if(o===void 0)throw Error(c(407));o=o()}else{if(o=s(),rn===null)throw Error(c(349));(St&127)!==0||Lx(u,s,o)}p.memoizedState=o;var x={value:o,getSnapshot:s};return p.queue=x,Zx(Px.bind(null,u,x,n),[n]),u.flags|=2048,ml(9,{destroy:void 0},zx.bind(null,u,x,o,s),null),o},"useSyncExternalStore"),useId:r(function(){var n=ka(),s=rn.identifierPrefix;if(Tt){var o=$s,u=Us;o=(u&~(1<<32-Dt(u)-1)).toString(32)+o,s="_"+s+"R_"+o,o=au++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=XA++,s="_"+s+"r_"+o.toString(32)+"_";return n.memoizedState=s},"useId"),useHostTransitionStatus:Tm,useFormState:Qx,useActionState:Qx,useOptimistic:r(function(n){var s=ka();s.memoizedState=s.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=Rm.bind(null,mt,!0,o),o.dispatch=s,[n,s]},"useOptimistic"),useMemoCache:wm,useCacheRefresh:r(function(){return ka().memoizedState=a2.bind(null,mt)},"useCacheRefresh"),useEffectEvent:r(function(n){var s=ka(),o={impl:n};return s.memoizedState=o,function(){if((Ht&2)!==0)throw Error(c(440));return o.impl.apply(void 0,arguments)}},"useEffectEvent")},Dm={readContext:oa,use:iu,useCallback:sb,useContext:oa,useEffect:Am,useImperativeHandle:ab,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:ib,useReducer:ru,useRef:Xx,useState:r(function(){return ru(si)},"useState"),useDebugValue:_m,useDeferredValue:r(function(n,s){return rb(Un(),en.memoizedState,n,s)},"useDeferredValue"),useTransition:r(function(){var n=ru(si)[0],s=Un().memoizedState;return[typeof n=="boolean"?n:No(n),s]},"useTransition"),useSyncExternalStore:Ox,useId:ub,useHostTransitionStatus:Tm,useFormState:Wx,useActionState:Wx,useOptimistic:r(function(n,s){return Bx(Un(),en,n,s)},"useOptimistic"),useMemoCache:wm,useCacheRefresh:db};Dm.useEffectEvent=Jx;var gb={readContext:oa,use:iu,useCallback:sb,useContext:oa,useEffect:Am,useImperativeHandle:ab,useInsertionEffect:eb,useLayoutEffect:tb,useMemo:ib,useReducer:Sm,useRef:Xx,useState:r(function(){return Sm(si)},"useState"),useDebugValue:_m,useDeferredValue:r(function(n,s){var o=Un();return en===null?Em(o,n,s):rb(o,en.memoizedState,n,s)},"useDeferredValue"),useTransition:r(function(){var n=Sm(si)[0],s=Un().memoizedState;return[typeof n=="boolean"?n:No(n),s]},"useTransition"),useSyncExternalStore:Ox,useId:ub,useHostTransitionStatus:Tm,useFormState:Yx,useActionState:Yx,useOptimistic:r(function(n,s){var o=Un();return en!==null?Bx(o,en,n,s):(o.baseState=n,[n,o.queue.dispatch])},"useOptimistic"),useMemoCache:wm,useCacheRefresh:db};gb.useEffectEvent=Jx;function Mm(n,s,o,u){s=n.memoizedState,o=o(u,s),o=o==null?s:j({},s,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}r(Mm,"applyDerivedStateFromProps");var Om={enqueueSetState:r(function(n,s,o){n=n._reactInternals;var u=us(),p=Sr(u);p.payload=s,o!=null&&(p.callback=o),s=Nr(n,p,u),s!==null&&(La(s,n,u),jo(s,n,u))},"enqueueSetState"),enqueueReplaceState:r(function(n,s,o){n=n._reactInternals;var u=us(),p=Sr(u);p.tag=1,p.payload=s,o!=null&&(p.callback=o),s=Nr(n,p,u),s!==null&&(La(s,n,u),jo(s,n,u))},"enqueueReplaceState"),enqueueForceUpdate:r(function(n,s){n=n._reactInternals;var o=us(),u=Sr(o);u.tag=2,s!=null&&(u.callback=s),s=Nr(n,u,o),s!==null&&(La(s,n,o),jo(s,n,o))},"enqueueForceUpdate")};function xb(n,s,o,u,p,x,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,x,w):s.prototype&&s.prototype.isPureReactComponent?!mo(o,u)||!mo(p,x):!0}r(xb,"checkShouldComponentUpdate");function bb(n,s,o,u){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,u),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,u),s.state!==n&&Om.enqueueReplaceState(s,s.state,null)}r(bb,"callComponentWillReceiveProps");function Ar(n,s){var o=s;if("ref"in s){o={};for(var u in s)u!=="ref"&&(o[u]=s[u])}if(n=n.defaultProps){o===s&&(o=j({},o));for(var p in n)o[p]===void 0&&(o[p]=n[p])}return o}r(Ar,"resolveClassComponentProps");function i2(n){Bc(n)}r(i2,"defaultOnUncaughtError");function r2(n){}r(r2,"defaultOnCaughtError");function l2(n){Bc(n)}r(l2,"defaultOnRecoverableError");function uu(n,s){try{var o=n.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(u){setTimeout(function(){throw u})}}r(uu,"logUncaughtError");function vb(n,s,o){try{var u=n.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}r(vb,"logCaughtError");function Lm(n,s,o){return o=Sr(o),o.tag=3,o.payload={element:null},o.callback=function(){uu(n,s)},o}r(Lm,"createRootErrorUpdate");function yb(n){return n=Sr(n),n.tag=3,n}r(yb,"createClassErrorUpdate");function jb(n,s,o,u){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var x=u.value;n.payload=function(){return p(x)},n.callback=function(){vb(s,o,u)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){vb(s,o,u),typeof p!="function"&&(zi===null?zi=new Set([this]):zi.add(this));var A=u.stack;this.componentDidCatch(u.value,{componentStack:A!==null?A:""})})}r(jb,"initializeClassErrorUpdate");function o2(n,s,o,u,p){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(s=o.alternate,s!==null&&il(s,o,p,!0),o=Qa.current,o!==null){switch(o.tag){case 31:case 13:return cs===null?wu():o.alternate===null&&Tn===0&&(Tn=3),o.flags&=-257,o.flags|=65536,o.lanes=p,u===Xc?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([u]):s.add(u),lp(n,u,p)),!1;case 22:return o.flags|=65536,u===Xc?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([u]):o.add(u)),lp(n,u,p)),!1}throw Error(c(435,o.tag))}return lp(n,u,p),wu(),!1}if(Tt)return s=Qa.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,u!==tm&&(n=Error(c(422),{cause:u}),go(is(n,o)))):(u!==tm&&(s=Error(c(423),{cause:u}),go(is(s,o))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,u=is(u,o),p=Lm(n.stateNode,u,p),fm(n,p),Tn!==4&&(Tn=2)),!1;var x=Error(c(520),{cause:u});if(x=is(x,o),Oo===null?Oo=[x]:Oo.push(x),Tn!==4&&(Tn=2),s===null)return!0;u=is(u,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,n=p&-p,o.lanes|=n,n=Lm(o.stateNode,u,n),fm(o,n),!1;case 1:if(s=o.type,x=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(zi===null||!zi.has(x))))return o.flags|=65536,p&=-p,o.lanes|=p,p=yb(p),jb(p,n,o,u),fm(o,p),!1}o=o.return}while(o!==null);return!1}r(o2,"throwException");var zm=Error(c(461)),Hn=!1;function ca(n,s,o,u){s.child=n===null?_x(s,null,o,u):kr(s,n.child,o,u)}r(ca,"reconcileChildren");function wb(n,s,o,u,p){o=o.render;var x=s.ref;if("ref"in u){var w={};for(var A in u)A!=="ref"&&(w[A]=u[A])}else w=u;return vr(s),u=bm(n,s,o,w,x,p),A=vm(),n!==null&&!Hn?(ym(n,s,p),ii(n,s,p)):(Tt&&A&&Jf(s),s.flags|=1,ca(n,s,u,p),s.child)}r(wb,"updateForwardRef");function kb(n,s,o,u,p){if(n===null){var x=o.type;return typeof x=="function"&&!Yf(x)&&x.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=x,Sb(n,s,x,u,p)):(n=Hc(o.type,null,u,s,s.mode,p),n.ref=s.ref,n.return=s,s.child=n)}if(x=n.child,!Hm(n,p)){var w=x.memoizedProps;if(o=o.compare,o=o!==null?o:mo,o(w,u)&&n.ref===s.ref)return ii(n,s,p)}return s.flags|=1,n=Js(x,u),n.ref=s.ref,n.return=s,s.child=n}r(kb,"updateMemoComponent");function Sb(n,s,o,u,p){if(n!==null){var x=n.memoizedProps;if(mo(x,u)&&n.ref===s.ref)if(Hn=!1,s.pendingProps=u=x,Hm(n,p))(n.flags&131072)!==0&&(Hn=!0);else return s.lanes=n.lanes,ii(n,s,p)}return Pm(n,s,o,u,p)}r(Sb,"updateSimpleMemoComponent");function Nb(n,s,o,u){var p=u.children,x=n!==null?n.memoizedState:null;if(n===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|o:o,n!==null){for(u=s.child=n.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~x}else u=0,s.child=null;return Cb(n,s,x,o,u)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gc(s,x!==null?x.cachePool:null),x!==null?Tx(s,x):pm(),Rx(s);else return u=s.lanes=536870912,Cb(n,s,x!==null?x.baseLanes|o:o,o,u)}else x!==null?(Gc(s,x.cachePool),Tx(s,x),Di(s),s.memoizedState=null):(n!==null&&Gc(s,null),pm(),Di(s));return ca(n,s,p,o),s.child}r(Nb,"updateOffscreenComponent");function _o(n,s){return n!==null&&n.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}r(_o,"bailoutOffscreenComponent");function Cb(n,s,o,u,p){var x=om();return x=x===null?null:{parent:qn._currentValue,pool:x},s.memoizedState={baseLanes:o,cachePool:x},n!==null&&Gc(s,null),pm(),Rx(s),n!==null&&il(n,s,u,!0),s.childLanes=p,null}r(Cb,"deferHiddenOffscreenComponent");function du(n,s){return s=mu({mode:s.mode,children:s.children},n.mode),s.ref=n.ref,n.child=s,s.return=n,s}r(du,"mountActivityChildren");function Ab(n,s,o){return kr(s,n.child,null,o),n=du(s,s.pendingProps),n.flags|=2,Wa(s),s.memoizedState=null,n}r(Ab,"retryActivityComponentWithoutHydrating");function c2(n,s,o){var u=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,n===null){if(Tt){if(u.mode==="hidden")return n=du(s,u),s.lanes=536870912,_o(null,n);if(gm(s),(n=gn)?(n=$v(n,os),n=n!==null&&n.data==="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:Ai!==null?{id:Us,overflow:$s}:null,retryLane:536870912,hydrationErrors:null},o=mx(n),o.return=s,s.child=o,la=s,gn=null)):n=null,n===null)throw Ei(s);return s.lanes=536870912,null}return du(s,u)}var x=n.memoizedState;if(x!==null){var w=x.dehydrated;if(gm(s),p)if(s.flags&256)s.flags&=-257,s=Ab(n,s,o);else if(s.memoizedState!==null)s.child=n.child,s.flags|=128,s=null;else throw Error(c(558));else if(Hn||il(n,s,o,!1),p=(o&n.childLanes)!==0,Hn||p){if(u=rn,u!==null&&(w=Dn(u,o),w!==0&&w!==x.retryLane))throw x.retryLane=w,hr(n,w),La(u,n,w),zm;wu(),s=Ab(n,s,o)}else n=x.treeContext,gn=ds(w.nextSibling),la=s,Tt=!0,_i=null,os=!1,n!==null&&gx(s,n),s=du(s,u),s.flags|=4096;return s}return n=Js(n.child,{mode:u.mode,children:u.children}),n.ref=s.ref,s.child=n,n.return=s,n}r(c2,"updateActivityComponent");function fu(n,s){var o=s.ref;if(o===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(c(284));(n===null||n.ref!==o)&&(s.flags|=4194816)}}r(fu,"markRef");function Pm(n,s,o,u,p){return vr(s),o=bm(n,s,o,u,void 0,p),u=vm(),n!==null&&!Hn?(ym(n,s,p),ii(n,s,p)):(Tt&&u&&Jf(s),s.flags|=1,ca(n,s,o,p),s.child)}r(Pm,"updateFunctionComponent");function _b(n,s,o,u,p,x){return vr(s),s.updateQueue=null,o=Mx(s,u,o,p),Dx(n),u=vm(),n!==null&&!Hn?(ym(n,s,x),ii(n,s,x)):(Tt&&u&&Jf(s),s.flags|=1,ca(n,s,o,x),s.child)}r(_b,"replayFunctionComponent");function Eb(n,s,o,u,p){if(vr(s),s.stateNode===null){var x=tl,w=o.contextType;typeof w=="object"&&w!==null&&(x=oa(w)),x=new o(u,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Om,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=u,x.state=s.memoizedState,x.refs={},um(s),w=o.contextType,x.context=typeof w=="object"&&w!==null?oa(w):tl,x.state=s.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(Mm(s,o,w,u),x.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(w=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),w!==x.state&&Om.enqueueReplaceState(x,x.state,null),ko(s,u,x,p),wo(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),u=!0}else if(n===null){x=s.stateNode;var A=s.memoizedProps,K=Ar(o,A);x.props=K;var ee=x.context,de=o.contextType;w=tl,typeof de=="object"&&de!==null&&(w=oa(de));var ge=o.getDerivedStateFromProps;de=typeof ge=="function"||typeof x.getSnapshotBeforeUpdate=="function",A=s.pendingProps!==A,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A||ee!==w)&&bb(s,x,u,w),Ti=!1;var ne=s.memoizedState;x.state=ne,ko(s,u,x,p),wo(),ee=s.memoizedState,A||ne!==ee||Ti?(typeof ge=="function"&&(Mm(s,o,ge,u),ee=s.memoizedState),(K=Ti||xb(s,o,K,u,ne,ee,w))?(de||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=ee),x.props=u,x.state=ee,x.context=w,u=K):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),u=!1)}else{x=s.stateNode,dm(n,s),w=s.memoizedProps,de=Ar(o,w),x.props=de,ge=s.pendingProps,ne=x.context,ee=o.contextType,K=tl,typeof ee=="object"&&ee!==null&&(K=oa(ee)),A=o.getDerivedStateFromProps,(ee=typeof A=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(w!==ge||ne!==K)&&bb(s,x,u,K),Ti=!1,ne=s.memoizedState,x.state=ne,ko(s,u,x,p),wo();var re=s.memoizedState;w!==ge||ne!==re||Ti||n!==null&&n.dependencies!==null&&Qc(n.dependencies)?(typeof A=="function"&&(Mm(s,o,A,u),re=s.memoizedState),(de=Ti||xb(s,o,de,u,ne,re,K)||n!==null&&n.dependencies!==null&&Qc(n.dependencies))?(ee||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,re,K),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,re,K)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||w===n.memoizedProps&&ne===n.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&ne===n.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=re),x.props=u,x.state=re,x.context=K,u=de):(typeof x.componentDidUpdate!="function"||w===n.memoizedProps&&ne===n.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&ne===n.memoizedState||(s.flags|=1024),u=!1)}return x=u,fu(n,s),u=(s.flags&128)!==0,x||u?(x=s.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,n!==null&&u?(s.child=kr(s,n.child,null,p),s.child=kr(s,null,o,p)):ca(n,s,o,p),s.memoizedState=x.state,n=s.child):n=ii(n,s,p),n}r(Eb,"updateClassComponent");function Ib(n,s,o,u){return xr(),s.flags|=256,ca(n,s,o,u),s.child}r(Ib,"mountHostRootWithoutHydrating");var Um={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $m(n){return{baseLanes:n,cachePool:wx()}}r($m,"mountSuspenseOffscreenState");function Bm(n,s,o){return n=n!==null?n.childLanes&~o:0,s&&(n|=Ya),n}r(Bm,"getRemainingWorkInPrimaryTree");function Tb(n,s,o){var u=s.pendingProps,p=!1,x=(s.flags&128)!==0,w;if((w=x)||(w=n!==null&&n.memoizedState===null?!1:(Pn.current&2)!==0),w&&(p=!0,s.flags&=-129),w=(s.flags&32)!==0,s.flags&=-33,n===null){if(Tt){if(p?Ri(s):Di(s),(n=gn)?(n=$v(n,os),n=n!==null&&n.data!=="&"?n:null,n!==null&&(s.memoizedState={dehydrated:n,treeContext:Ai!==null?{id:Us,overflow:$s}:null,retryLane:536870912,hydrationErrors:null},o=mx(n),o.return=s,s.child=o,la=s,gn=null)):n=null,n===null)throw Ei(s);return wp(n)?s.lanes=32:s.lanes=536870912,null}var A=u.children;return u=u.fallback,p?(Di(s),p=s.mode,A=mu({mode:"hidden",children:A},p),u=gr(u,p,o,null),A.return=s,u.return=s,A.sibling=u,s.child=A,u=s.child,u.memoizedState=$m(o),u.childLanes=Bm(n,w,o),s.memoizedState=Um,_o(null,u)):(Ri(s),Km(s,A))}var K=n.memoizedState;if(K!==null&&(A=K.dehydrated,A!==null)){if(x)s.flags&256?(Ri(s),s.flags&=-257,s=qm(n,s,o)):s.memoizedState!==null?(Di(s),s.child=n.child,s.flags|=128,s=null):(Di(s),A=u.fallback,p=s.mode,u=mu({mode:"visible",children:u.children},p),A=gr(A,p,o,null),A.flags|=2,u.return=s,A.return=s,u.sibling=A,s.child=u,kr(s,n.child,null,o),u=s.child,u.memoizedState=$m(o),u.childLanes=Bm(n,w,o),s.memoizedState=Um,s=_o(null,u));else if(Ri(s),wp(A)){if(w=A.nextSibling&&A.nextSibling.dataset,w)var ee=w.dgst;w=ee,u=Error(c(419)),u.stack="",u.digest=w,go({value:u,source:null,stack:null}),s=qm(n,s,o)}else if(Hn||il(n,s,o,!1),w=(o&n.childLanes)!==0,Hn||w){if(w=rn,w!==null&&(u=Dn(w,o),u!==0&&u!==K.retryLane))throw K.retryLane=u,hr(n,u),La(w,n,u),zm;jp(A)||wu(),s=qm(n,s,o)}else jp(A)?(s.flags|=192,s.child=n.child,s=null):(n=K.treeContext,gn=ds(A.nextSibling),la=s,Tt=!0,_i=null,os=!1,n!==null&&gx(s,n),s=Km(s,u.children),s.flags|=4096);return s}return p?(Di(s),A=u.fallback,p=s.mode,K=n.child,ee=K.sibling,u=Js(K,{mode:"hidden",children:u.children}),u.subtreeFlags=K.subtreeFlags&65011712,ee!==null?A=Js(ee,A):(A=gr(A,p,o,null),A.flags|=2),A.return=s,u.return=s,u.sibling=A,s.child=u,_o(null,u),u=s.child,A=n.child.memoizedState,A===null?A=$m(o):(p=A.cachePool,p!==null?(K=qn._currentValue,p=p.parent!==K?{parent:K,pool:K}:p):p=wx(),A={baseLanes:A.baseLanes|o,cachePool:p}),u.memoizedState=A,u.childLanes=Bm(n,w,o),s.memoizedState=Um,_o(n.child,u)):(Ri(s),o=n.child,n=o.sibling,o=Js(o,{mode:"visible",children:u.children}),o.return=s,o.sibling=null,n!==null&&(w=s.deletions,w===null?(s.deletions=[n],s.flags|=16):w.push(n)),s.child=o,s.memoizedState=null,o)}r(Tb,"updateSuspenseComponent");function Km(n,s){return s=mu({mode:"visible",children:s},n.mode),s.return=n,n.child=s}r(Km,"mountSuspensePrimaryChildren");function mu(n,s){return n=Va(22,n,null,s),n.lanes=0,n}r(mu,"mountWorkInProgressOffscreenFiber");function qm(n,s,o){return kr(s,n.child,null,o),n=Km(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}r(qm,"retrySuspenseComponentWithoutHydrating");function Rb(n,s,o){n.lanes|=s;var u=n.alternate;u!==null&&(u.lanes|=s),sm(n.return,s,o)}r(Rb,"scheduleSuspenseWorkOnFiber");function Fm(n,s,o,u,p,x){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p,treeForkCount:x}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=o,w.tailMode=p,w.treeForkCount=x)}r(Fm,"initSuspenseListRenderState");function Db(n,s,o){var u=s.pendingProps,p=u.revealOrder,x=u.tail;u=u.children;var w=Pn.current,A=(w&2)!==0;if(A?(w=w&1|2,s.flags|=128):w&=1,Ae(Pn,w),ca(n,s,u,o),u=Tt?ho:0,!A&&n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Rb(n,o,s);else if(n.tag===19)Rb(n,o,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"forwards":for(o=s.child,p=null;o!==null;)n=o.alternate,n!==null&&tu(n)===null&&(p=o),o=o.sibling;o=p,o===null?(p=s.child,s.child=null):(p=o.sibling,o.sibling=null),Fm(s,!1,p,o,x,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=s.child,s.child=null;p!==null;){if(n=p.alternate,n!==null&&tu(n)===null){s.child=p;break}n=p.sibling,p.sibling=o,o=p,p=n}Fm(s,!0,o,null,x,u);break;case"together":Fm(s,!1,null,null,void 0,u);break;default:s.memoizedState=null}return s.child}r(Db,"updateSuspenseListComponent");function ii(n,s,o){if(n!==null&&(s.dependencies=n.dependencies),Li|=s.lanes,(o&s.childLanes)===0)if(n!==null){if(il(n,s,o,!1),(o&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(c(153));if(s.child!==null){for(n=s.child,o=Js(n,n.pendingProps),s.child=o,o.return=s;n.sibling!==null;)n=n.sibling,o=o.sibling=Js(n,n.pendingProps),o.return=s;o.sibling=null}return s.child}r(ii,"bailoutOnAlreadyFinishedWork");function Hm(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&Qc(n)))}r(Hm,"checkScheduledUpdateOrContext");function u2(n,s,o){switch(s.tag){case 3:De(s,s.stateNode.containerInfo),Ii(s,qn,n.memoizedState.cache),xr();break;case 27:case 5:ut(s);break;case 4:De(s,s.stateNode.containerInfo);break;case 10:Ii(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,gm(s),null;break;case 13:var u=s.memoizedState;if(u!==null)return u.dehydrated!==null?(Ri(s),s.flags|=128,null):(o&s.child.childLanes)!==0?Tb(n,s,o):(Ri(s),n=ii(n,s,o),n!==null?n.sibling:null);Ri(s);break;case 19:var p=(n.flags&128)!==0;if(u=(o&s.childLanes)!==0,u||(il(n,s,o,!1),u=(o&s.childLanes)!==0),p){if(u)return Db(n,s,o);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Ae(Pn,Pn.current),u)break;return null;case 22:return s.lanes=0,Nb(n,s,o,s.pendingProps);case 24:Ii(s,qn,n.memoizedState.cache)}return ii(n,s,o)}r(u2,"attemptEarlyBailoutIfNoScheduledUpdate");function Mb(n,s,o){if(n!==null)if(n.memoizedProps!==s.pendingProps)Hn=!0;else{if(!Hm(n,o)&&(s.flags&128)===0)return Hn=!1,u2(n,s,o);Hn=(n.flags&131072)!==0}else Hn=!1,Tt&&(s.flags&1048576)!==0&&hx(s,ho,s.index);switch(s.lanes=0,s.tag){case 16:e:{var u=s.pendingProps;if(n=jr(s.elementType),s.type=n,typeof n=="function")Yf(n)?(u=Ar(n,u),s.tag=1,s=Eb(null,s,n,u,o)):(s.tag=0,s=Pm(null,s,n,u,o));else{if(n!=null){var p=n.$$typeof;if(p===O){s.tag=11,s=wb(null,s,n,u,o);break e}else if(p===L){s.tag=14,s=kb(null,s,n,u,o);break e}}throw s=oe(n)||n,Error(c(306,s,""))}}return s;case 0:return Pm(n,s,s.type,s.pendingProps,o);case 1:return u=s.type,p=Ar(u,s.pendingProps),Eb(n,s,u,p,o);case 3:e:{if(De(s,s.stateNode.containerInfo),n===null)throw Error(c(387));u=s.pendingProps;var x=s.memoizedState;p=x.element,dm(n,s),ko(s,u,null,o);var w=s.memoizedState;if(u=w.cache,Ii(s,qn,u),u!==x.cache&&im(s,[qn],o,!0),wo(),u=w.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:w.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=Ib(n,s,u,o);break e}else if(u!==p){p=is(Error(c(424)),s),go(p),s=Ib(n,s,u,o);break e}else for(n=s.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,gn=ds(n.firstChild),la=s,Tt=!0,_i=null,os=!0,o=_x(s,null,u,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(xr(),u===p){s=ii(n,s,o);break e}ca(n,s,u,o)}s=s.child}return s;case 26:return fu(n,s),n===null?(o=Vv(s.type,null,s.pendingProps,null))?s.memoizedState=o:Tt||(o=s.type,n=s.pendingProps,u=Eu(Te.current).createElement(o),u[xt]=s,u[kn]=n,ua(u,o,n),cn(u),s.stateNode=u):s.memoizedState=Vv(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return ut(s),n===null&&Tt&&(u=s.stateNode=qv(s.type,s.pendingProps,Te.current),la=s,os=!0,p=gn,Bi(s.type)?(kp=p,gn=ds(u.firstChild)):gn=p),ca(n,s,s.pendingProps.children,o),fu(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&Tt&&((p=u=gn)&&(u=P2(u,s.type,s.pendingProps,os),u!==null?(s.stateNode=u,la=s,gn=ds(u.firstChild),os=!1,p=!0):p=!1),p||Ei(s)),ut(s),p=s.type,x=s.pendingProps,w=n!==null?n.memoizedProps:null,u=x.children,bp(p,x)?u=null:w!==null&&bp(p,w)&&(s.flags|=32),s.memoizedState!==null&&(p=bm(n,s,ZA,null,null,o),qo._currentValue=p),fu(n,s),ca(n,s,u,o),s.child;case 6:return n===null&&Tt&&((n=o=gn)&&(o=U2(o,s.pendingProps,os),o!==null?(s.stateNode=o,la=s,gn=null,n=!0):n=!1),n||Ei(s)),null;case 13:return Tb(n,s,o);case 4:return De(s,s.stateNode.containerInfo),u=s.pendingProps,n===null?s.child=kr(s,null,u,o):ca(n,s,u,o),s.child;case 11:return wb(n,s,s.type,s.pendingProps,o);case 7:return ca(n,s,s.pendingProps,o),s.child;case 8:return ca(n,s,s.pendingProps.children,o),s.child;case 12:return ca(n,s,s.pendingProps.children,o),s.child;case 10:return u=s.pendingProps,Ii(s,s.type,u.value),ca(n,s,u.children,o),s.child;case 9:return p=s.type._context,u=s.pendingProps.children,vr(s),p=oa(p),u=u(p),s.flags|=1,ca(n,s,u,o),s.child;case 14:return kb(n,s,s.type,s.pendingProps,o);case 15:return Sb(n,s,s.type,s.pendingProps,o);case 19:return Db(n,s,o);case 31:return c2(n,s,o);case 22:return Nb(n,s,o,s.pendingProps);case 24:return vr(s),u=oa(qn),n===null?(p=om(),p===null&&(p=rn,x=rm(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=o),p=x),s.memoizedState={parent:u,cache:p},um(s),Ii(s,qn,p)):((n.lanes&o)!==0&&(dm(n,s),ko(s,null,null,o),wo()),p=n.memoizedState,x=s.memoizedState,p.parent!==u?(p={parent:u,cache:u},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),Ii(s,qn,u)):(u=x.cache,Ii(s,qn,u),u!==p.cache&&im(s,[qn],o,!0))),ca(n,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(c(156,s.tag))}r(Mb,"beginWork");function ri(n){n.flags|=4}r(ri,"markUpdate");function Vm(n,s,o,u,p){if((s=(n.mode&32)!==0)&&(s=!1),s){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(lv())n.flags|=8192;else throw wr=Xc,cm}else n.flags&=-16777217}r(Vm,"preloadInstanceAndSuspendIfNeeded");function Ob(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Xv(s))if(lv())n.flags|=8192;else throw wr=Xc,cm}r(Ob,"preloadResourceAndSuspendIfNeeded");function pu(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?Jt():536870912,n.lanes|=s,xl|=s)}r(pu,"scheduleRetryEffect");function Eo(n,s){if(!Tt)switch(n.tailMode){case"hidden":s=n.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}r(Eo,"cutOffTailIfNeeded");function xn(n){var s=n.alternate!==null&&n.alternate.child===n.child,o=0,u=0;if(s)for(var p=n.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=u,n.childLanes=o,s}r(xn,"bubbleProperties");function d2(n,s,o){var u=s.pendingProps;switch(em(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(s),null;case 1:return xn(s),null;case 3:return o=s.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),ni(qn),Se(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(sl(s)?ri(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,nm())),xn(s),null;case 26:var p=s.type,x=s.memoizedState;return n===null?(ri(s),x!==null?(xn(s),Ob(s,x)):(xn(s),Vm(s,p,null,u,o))):x?x!==n.memoizedState?(ri(s),xn(s),Ob(s,x)):(xn(s),s.flags&=-16777217):(n=n.memoizedProps,n!==u&&ri(s),xn(s),Vm(s,p,n,u,o)),null;case 27:if(wt(s),o=Te.current,p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==u&&ri(s);else{if(!u){if(s.stateNode===null)throw Error(c(166));return xn(s),null}n=je.current,sl(s)?xx(s,n):(n=qv(p,u,o),s.stateNode=n,ri(s))}return xn(s),null;case 5:if(wt(s),p=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==u&&ri(s);else{if(!u){if(s.stateNode===null)throw Error(c(166));return xn(s),null}if(x=je.current,sl(s))xx(s,x);else{var w=Eu(Te.current);switch(x){case 1:x=w.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=w.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=w.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=w.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?x.multiple=!0:u.size&&(x.size=u.size);break;default:x=typeof u.is=="string"?w.createElement(p,{is:u.is}):w.createElement(p)}}x[xt]=s,x[kn]=u;e:for(w=s.child;w!==null;){if(w.tag===5||w.tag===6)x.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===s)break e;for(;w.sibling===null;){if(w.return===null||w.return===s)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}s.stateNode=x;e:switch(ua(x,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ri(s)}}return xn(s),Vm(s,s.type,n===null?null:n.memoizedProps,s.pendingProps,o),null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==u&&ri(s);else{if(typeof u!="string"&&s.stateNode===null)throw Error(c(166));if(n=Te.current,sl(s)){if(n=s.stateNode,o=s.memoizedProps,u=null,p=la,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}n[xt]=s,n=!!(n.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||Rv(n.nodeValue,o)),n||Ei(s,!0)}else n=Eu(n).createTextNode(u),n[xt]=s,s.stateNode=n}return xn(s),null;case 31:if(o=s.memoizedState,n===null||n.memoizedState!==null){if(u=sl(s),o!==null){if(n===null){if(!u)throw Error(c(318));if(n=s.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(c(557));n[xt]=s}else xr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xn(s),n=!1}else o=nm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return s.flags&256?(Wa(s),s):(Wa(s),null);if((s.flags&128)!==0)throw Error(c(558))}return xn(s),null;case 13:if(u=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=sl(s),u!==null&&u.dehydrated!==null){if(n===null){if(!p)throw Error(c(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(c(317));p[xt]=s}else xr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;xn(s),p=!1}else p=nm(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(Wa(s),s):(Wa(s),null)}return Wa(s),(s.flags&128)!==0?(s.lanes=o,s):(o=u!==null,n=n!==null&&n.memoizedState!==null,o&&(u=s.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==p&&(u.flags|=2048)),o!==n&&o&&(s.child.flags|=8192),pu(s,s.updateQueue),xn(s),null);case 4:return Se(),n===null&&_v(s.stateNode.containerInfo),xn(s),null;case 10:return ni(s.type),xn(s),null;case 19:if(we(Pn),u=s.memoizedState,u===null)return xn(s),null;if(p=(s.flags&128)!==0,x=u.rendering,x===null)if(p)Eo(u,!1);else{if(Tn!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(x=tu(n),x!==null){for(s.flags|=128,Eo(u,!1),n=x.updateQueue,s.updateQueue=n,pu(s,n),s.subtreeFlags=0,n=o,o=s.child;o!==null;)fx(o,n),o=o.sibling;return Ae(Pn,Pn.current&1|2),Tt&&ei(s,u.treeForkCount),s.child}n=n.sibling}u.tail!==null&&Je()>vu&&(s.flags|=128,p=!0,Eo(u,!1),s.lanes=4194304)}else{if(!p)if(n=tu(x),n!==null){if(s.flags|=128,p=!0,n=n.updateQueue,s.updateQueue=n,pu(s,n),Eo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!x.alternate&&!Tt)return xn(s),null}else 2*Je()-u.renderingStartTime>vu&&o!==536870912&&(s.flags|=128,p=!0,Eo(u,!1),s.lanes=4194304);u.isBackwards?(x.sibling=s.child,s.child=x):(n=u.last,n!==null?n.sibling=x:s.child=x,u.last=x)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Je(),n.sibling=null,o=Pn.current,Ae(Pn,p?o&1|2:o&1),Tt&&ei(s,u.treeForkCount),n):(xn(s),null);case 22:case 23:return Wa(s),hm(),u=s.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(s.flags|=8192):u&&(s.flags|=8192),u?(o&536870912)!==0&&(s.flags&128)===0&&(xn(s),s.subtreeFlags&6&&(s.flags|=8192)):xn(s),o=s.updateQueue,o!==null&&pu(s,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),u=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),u!==o&&(s.flags|=2048),n!==null&&we(yr),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),ni(qn),xn(s),null;case 25:return null;case 30:return null}throw Error(c(156,s.tag))}r(d2,"completeWork");function f2(n,s){switch(em(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return ni(qn),Se(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return wt(s),null;case 31:if(s.memoizedState!==null){if(Wa(s),s.alternate===null)throw Error(c(340));xr()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 13:if(Wa(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(c(340));xr()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return we(Pn),null;case 4:return Se(),null;case 10:return ni(s.type),null;case 22:case 23:return Wa(s),hm(),n!==null&&we(yr),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return ni(qn),null;case 25:return null;default:return null}}r(f2,"unwindWork");function Lb(n,s){switch(em(s),s.tag){case 3:ni(qn),Se();break;case 26:case 27:case 5:wt(s);break;case 4:Se();break;case 31:s.memoizedState!==null&&Wa(s);break;case 13:Wa(s);break;case 19:we(Pn);break;case 10:ni(s.type);break;case 22:case 23:Wa(s),hm(),n!==null&&we(yr);break;case 24:ni(qn)}}r(Lb,"unwindInterruptedWork");function Io(n,s){try{var o=s.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var p=u.next;o=p;do{if((o.tag&n)===n){u=void 0;var x=o.create,w=o.inst;u=x(),w.destroy=u}o=o.next}while(o!==p)}}catch(A){Xt(s,s.return,A)}}r(Io,"commitHookEffectListMount");function Mi(n,s,o){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var x=p.next;u=x;do{if((u.tag&n)===n){var w=u.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,p=s;var K=o,ee=A;try{ee()}catch(de){Xt(p,K,de)}}}u=u.next}while(u!==x)}}catch(de){Xt(s,s.return,de)}}r(Mi,"commitHookEffectListUnmount");function zb(n){var s=n.updateQueue;if(s!==null){var o=n.stateNode;try{Ix(s,o)}catch(u){Xt(n,n.return,u)}}}r(zb,"commitClassCallbacks");function Pb(n,s,o){o.props=Ar(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(u){Xt(n,s,u)}}r(Pb,"safelyCallComponentWillUnmount");function To(n,s){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof o=="function"?n.refCleanup=o(u):o.current=u}}catch(p){Xt(n,s,p)}}r(To,"safelyAttachRef");function Bs(n,s){var o=n.ref,u=n.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(p){Xt(n,s,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){Xt(n,s,p)}else o.current=null}r(Bs,"safelyDetachRef");function Ub(n){var s=n.type,o=n.memoizedProps,u=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(p){Xt(n,n.return,p)}}r(Ub,"commitHostMount");function Qm(n,s,o){try{var u=n.stateNode;R2(u,n.type,o,s),u[kn]=s}catch(p){Xt(n,n.return,p)}}r(Qm,"commitHostUpdate");function $b(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Bi(n.type)||n.tag===4}r($b,"isHostParent");function Wm(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||$b(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Bi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}r(Wm,"getHostSibling");function Gm(n,s,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(n),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=Nn));else if(u!==4&&(u===27&&Bi(n.type)&&(o=n.stateNode,s=null),n=n.child,n!==null))for(Gm(n,s,o),n=n.sibling;n!==null;)Gm(n,s,o),n=n.sibling}r(Gm,"insertOrAppendPlacementNodeIntoContainer");function hu(n,s,o){var u=n.tag;if(u===5||u===6)n=n.stateNode,s?o.insertBefore(n,s):o.appendChild(n);else if(u!==4&&(u===27&&Bi(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(hu(n,s,o),n=n.sibling;n!==null;)hu(n,s,o),n=n.sibling}r(hu,"insertOrAppendPlacementNode");function Bb(n){var s=n.stateNode,o=n.memoizedProps;try{for(var u=n.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);ua(s,u,o),s[xt]=n,s[kn]=o}catch(x){Xt(n,n.return,x)}}r(Bb,"commitHostSingletonAcquisition");var li=!1,Vn=!1,Ym=!1,Kb=typeof WeakSet=="function"?WeakSet:Set,ta=null;function m2(n,s){if(n=n.containerInfo,gp=Lu,n=ax(n),qf(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var w=0,A=-1,K=-1,ee=0,de=0,ge=n,ne=null;t:for(;;){for(var re;ge!==o||p!==0&&ge.nodeType!==3||(A=w+p),ge!==x||u!==0&&ge.nodeType!==3||(K=w+u),ge.nodeType===3&&(w+=ge.nodeValue.length),(re=ge.firstChild)!==null;)ne=ge,ge=re;for(;;){if(ge===n)break t;if(ne===o&&++ee===p&&(A=w),ne===x&&++de===u&&(K=w),(re=ge.nextSibling)!==null)break;ge=ne,ne=ge.parentNode}ge=re}o=A===-1||K===-1?null:{start:A,end:K}}else o=null}o=o||{start:0,end:0}}else o=null;for(xp={focusedElem:n,selectionRange:o},Lu=!1,ta=s;ta!==null;)if(s=ta,n=s.child,(s.subtreeFlags&1028)!==0&&n!==null)n.return=s,ta=n;else for(;ta!==null;){switch(s=ta,x=s.alternate,n=s.flags,s.tag){case 0:if((n&4)!==0&&(n=s.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)p=n[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&x!==null){n=void 0,o=s,p=x.memoizedProps,x=x.memoizedState,u=o.stateNode;try{var Le=Ar(o.type,p);n=u.getSnapshotBeforeUpdate(Le,x),u.__reactInternalSnapshotBeforeUpdate=n}catch(tt){Xt(o,o.return,tt)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,o=n.nodeType,o===9)yp(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":yp(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(c(163))}if(n=s.sibling,n!==null){n.return=s.return,ta=n;break}ta=s.return}}r(m2,"commitBeforeMutationEffects");function qb(n,s,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:ci(n,o),u&4&&Io(5,o);break;case 1:if(ci(n,o),u&4)if(n=o.stateNode,s===null)try{n.componentDidMount()}catch(w){Xt(o,o.return,w)}else{var p=Ar(o.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(p,s,n.__reactInternalSnapshotBeforeUpdate)}catch(w){Xt(o,o.return,w)}}u&64&&zb(o),u&512&&To(o,o.return);break;case 3:if(ci(n,o),u&64&&(n=o.updateQueue,n!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{Ix(n,s)}catch(w){Xt(o,o.return,w)}}break;case 27:s===null&&u&4&&Bb(o);case 26:case 5:ci(n,o),s===null&&u&4&&Ub(o),u&512&&To(o,o.return);break;case 12:ci(n,o);break;case 31:ci(n,o),u&4&&Vb(n,o);break;case 13:ci(n,o),u&4&&Qb(n,o),u&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=w2.bind(null,o),$2(n,o))));break;case 22:if(u=o.memoizedState!==null||li,!u){s=s!==null&&s.memoizedState!==null||Vn,p=li;var x=Vn;li=u,(Vn=s)&&!x?ui(n,o,(o.subtreeFlags&8772)!==0):ci(n,o),li=p,Vn=x}break;case 30:break;default:ci(n,o)}}r(qb,"commitLayoutEffectOnFiber");function Fb(n){var s=n.alternate;s!==null&&(n.alternate=null,Fb(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&Ua(s)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}r(Fb,"detachFiberAfterEffects");var yn=null,Ra=!1;function oi(n,s,o){for(o=o.child;o!==null;)Hb(n,s,o),o=o.sibling}r(oi,"recursivelyTraverseDeletionEffects");function Hb(n,s,o){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(Qn,o)}catch{}switch(o.tag){case 26:Vn||Bs(o,s),oi(n,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Vn||Bs(o,s);var u=yn,p=Ra;Bi(o.type)&&(yn=o.stateNode,Ra=!1),oi(n,s,o),$o(o.stateNode),yn=u,Ra=p;break;case 5:Vn||Bs(o,s);case 6:if(u=yn,p=Ra,yn=null,oi(n,s,o),yn=u,Ra=p,yn!==null)if(Ra)try{(yn.nodeType===9?yn.body:yn.nodeName==="HTML"?yn.ownerDocument.body:yn).removeChild(o.stateNode)}catch(x){Xt(o,s,x)}else try{yn.removeChild(o.stateNode)}catch(x){Xt(o,s,x)}break;case 18:yn!==null&&(Ra?(n=yn,Pv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),Nl(n)):Pv(yn,o.stateNode));break;case 4:u=yn,p=Ra,yn=o.stateNode.containerInfo,Ra=!0,oi(n,s,o),yn=u,Ra=p;break;case 0:case 11:case 14:case 15:Mi(2,o,s),Vn||Mi(4,o,s),oi(n,s,o);break;case 1:Vn||(Bs(o,s),u=o.stateNode,typeof u.componentWillUnmount=="function"&&Pb(o,s,u)),oi(n,s,o);break;case 21:oi(n,s,o);break;case 22:Vn=(u=Vn)||o.memoizedState!==null,oi(n,s,o),Vn=u;break;default:oi(n,s,o)}}r(Hb,"commitDeletionEffectsOnFiber");function Vb(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Nl(n)}catch(o){Xt(s,s.return,o)}}}r(Vb,"commitActivityHydrationCallbacks");function Qb(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Nl(n)}catch(o){Xt(s,s.return,o)}}r(Qb,"commitSuspenseHydrationCallbacks");function p2(n){switch(n.tag){case 31:case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new Kb),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new Kb),s;default:throw Error(c(435,n.tag))}}r(p2,"getRetryCache");function gu(n,s){var o=p2(n);s.forEach(function(u){if(!o.has(u)){o.add(u);var p=k2.bind(null,n,u);u.then(p,p)}})}r(gu,"attachSuspenseRetryListeners");function Da(n,s){var o=s.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u],x=n,w=s,A=w;e:for(;A!==null;){switch(A.tag){case 27:if(Bi(A.type)){yn=A.stateNode,Ra=!1;break e}break;case 5:yn=A.stateNode,Ra=!1;break e;case 3:case 4:yn=A.stateNode.containerInfo,Ra=!0;break e}A=A.return}if(yn===null)throw Error(c(160));Hb(x,w,p),yn=null,Ra=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Wb(s,n),s=s.sibling}r(Da,"recursivelyTraverseMutationEffects");var ws=null;function Wb(n,s){var o=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Da(s,n),Ma(n),u&4&&(Mi(3,n,n.return),Io(3,n),Mi(5,n,n.return));break;case 1:Da(s,n),Ma(n),u&512&&(Vn||o===null||Bs(o,o.return)),u&64&&li&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var p=ws;if(Da(s,n),Ma(n),u&512&&(Vn||o===null||Bs(o,o.return)),u&4){var x=o!==null?o.memoizedState:null;if(u=n.memoizedState,o===null)if(u===null)if(n.stateNode===null){e:{u=n.type,o=n.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":x=p.getElementsByTagName("title")[0],(!x||x[Sn]||x[xt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(u),p.head.insertBefore(x,p.querySelector("head > title"))),ua(x,u,o),x[xt]=n,cn(x),u=x;break e;case"link":var w=Gv("link","href",p).get(u+(o.href||""));if(w){for(var A=0;A<w.length;A++)if(x=w[A],x.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&x.getAttribute("rel")===(o.rel==null?null:o.rel)&&x.getAttribute("title")===(o.title==null?null:o.title)&&x.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){w.splice(A,1);break t}}x=p.createElement(u),ua(x,u,o),p.head.appendChild(x);break;case"meta":if(w=Gv("meta","content",p).get(u+(o.content||""))){for(A=0;A<w.length;A++)if(x=w[A],x.getAttribute("content")===(o.content==null?null:""+o.content)&&x.getAttribute("name")===(o.name==null?null:o.name)&&x.getAttribute("property")===(o.property==null?null:o.property)&&x.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&x.getAttribute("charset")===(o.charSet==null?null:o.charSet)){w.splice(A,1);break t}}x=p.createElement(u),ua(x,u,o),p.head.appendChild(x);break;default:throw Error(c(468,u))}x[xt]=n,cn(x),u=x}n.stateNode=u}else Yv(p,n.type,n.stateNode);else n.stateNode=Wv(p,u,n.memoizedProps);else x!==u?(x===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):x.count--,u===null?Yv(p,n.type,n.stateNode):Wv(p,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Qm(n,n.memoizedProps,o.memoizedProps)}break;case 27:Da(s,n),Ma(n),u&512&&(Vn||o===null||Bs(o,o.return)),o!==null&&u&4&&Qm(n,n.memoizedProps,o.memoizedProps);break;case 5:if(Da(s,n),Ma(n),u&512&&(Vn||o===null||Bs(o,o.return)),n.flags&32){p=n.stateNode;try{Qe(p,"")}catch(Le){Xt(n,n.return,Le)}}u&4&&n.stateNode!=null&&(p=n.memoizedProps,Qm(n,p,o!==null?o.memoizedProps:p)),u&1024&&(Ym=!0);break;case 6:if(Da(s,n),Ma(n),u&4){if(n.stateNode===null)throw Error(c(162));u=n.memoizedProps,o=n.stateNode;try{o.nodeValue=u}catch(Le){Xt(n,n.return,Le)}}break;case 3:if(Ru=null,p=ws,ws=Iu(s.containerInfo),Da(s,n),ws=p,Ma(n),u&4&&o!==null&&o.memoizedState.isDehydrated)try{Nl(s.containerInfo)}catch(Le){Xt(n,n.return,Le)}Ym&&(Ym=!1,Gb(n));break;case 4:u=ws,ws=Iu(n.stateNode.containerInfo),Da(s,n),Ma(n),ws=u;break;case 12:Da(s,n),Ma(n);break;case 31:Da(s,n),Ma(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,gu(n,u)));break;case 13:Da(s,n),Ma(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(bu=Je()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,gu(n,u)));break;case 22:p=n.memoizedState!==null;var K=o!==null&&o.memoizedState!==null,ee=li,de=Vn;if(li=ee||p,Vn=de||K,Da(s,n),Vn=de,li=ee,Ma(n),u&8192)e:for(s=n.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(o===null||K||li||Vn||_r(n)),o=null,s=n;;){if(s.tag===5||s.tag===26){if(o===null){K=o=s;try{if(x=K.stateNode,p)w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{A=K.stateNode;var ge=K.memoizedProps.style,ne=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;A.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Le){Xt(K,K.return,Le)}}}else if(s.tag===6){if(o===null){K=s;try{K.stateNode.nodeValue=p?"":K.memoizedProps}catch(Le){Xt(K,K.return,Le)}}}else if(s.tag===18){if(o===null){K=s;try{var re=K.stateNode;p?Uv(re,!0):Uv(K.stateNode,!1)}catch(Le){Xt(K,K.return,Le)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===n)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}u&4&&(u=n.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,gu(n,o))));break;case 19:Da(s,n),Ma(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,gu(n,u)));break;case 30:break;case 21:break;default:Da(s,n),Ma(n)}}r(Wb,"commitMutationEffectsOnFiber");function Ma(n){var s=n.flags;if(s&2){try{for(var o,u=n.return;u!==null;){if($b(u)){o=u;break}u=u.return}if(o==null)throw Error(c(160));switch(o.tag){case 27:var p=o.stateNode;hu(n,Wm(n),p);break;case 5:var x=o.stateNode;o.flags&32&&(Qe(x,""),o.flags&=-33),hu(n,Wm(n),x);break;case 3:case 4:var w=o.stateNode.containerInfo;Gm(n,Wm(n),w);break;default:throw Error(c(161))}}catch(A){Xt(n,n.return,A)}n.flags&=-3}s&4096&&(n.flags&=-4097)}r(Ma,"commitReconciliationEffects");function Gb(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;Gb(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}r(Gb,"recursivelyResetForms");function ci(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)qb(n,s.alternate,s),s=s.sibling}r(ci,"recursivelyTraverseLayoutEffects");function _r(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:Mi(4,s,s.return),_r(s);break;case 1:Bs(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&Pb(s,s.return,o),_r(s);break;case 27:$o(s.stateNode);case 26:case 5:Bs(s,s.return),_r(s);break;case 22:s.memoizedState===null&&_r(s);break;case 30:_r(s);break;default:_r(s)}n=n.sibling}}r(_r,"recursivelyTraverseDisappearLayoutEffects");function ui(n,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var u=s.alternate,p=n,x=s,w=x.flags;switch(x.tag){case 0:case 11:case 15:ui(p,x,o),Io(4,x);break;case 1:if(ui(p,x,o),u=x,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ee){Xt(u,u.return,ee)}if(u=x,p=u.updateQueue,p!==null){var A=u.stateNode;try{var K=p.shared.hiddenCallbacks;if(K!==null)for(p.shared.hiddenCallbacks=null,p=0;p<K.length;p++)Ex(K[p],A)}catch(ee){Xt(u,u.return,ee)}}o&&w&64&&zb(x),To(x,x.return);break;case 27:Bb(x);case 26:case 5:ui(p,x,o),o&&u===null&&w&4&&Ub(x),To(x,x.return);break;case 12:ui(p,x,o);break;case 31:ui(p,x,o),o&&w&4&&Vb(p,x);break;case 13:ui(p,x,o),o&&w&4&&Qb(p,x);break;case 22:x.memoizedState===null&&ui(p,x,o),To(x,x.return);break;case 30:break;default:ui(p,x,o)}s=s.sibling}}r(ui,"recursivelyTraverseReappearLayoutEffects");function Xm(n,s){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&xo(o))}r(Xm,"commitOffscreenPassiveMountEffects");function Zm(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&xo(n))}r(Zm,"commitCachePassiveMountEffect");function ks(n,s,o,u){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Yb(n,s,o,u),s=s.sibling}r(ks,"recursivelyTraversePassiveMountEffects");function Yb(n,s,o,u){var p=s.flags;switch(s.tag){case 0:case 11:case 15:ks(n,s,o,u),p&2048&&Io(9,s);break;case 1:ks(n,s,o,u);break;case 3:ks(n,s,o,u),p&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&xo(n)));break;case 12:if(p&2048){ks(n,s,o,u),n=s.stateNode;try{var x=s.memoizedProps,w=x.id,A=x.onPostCommit;typeof A=="function"&&A(w,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(K){Xt(s,s.return,K)}}else ks(n,s,o,u);break;case 31:ks(n,s,o,u);break;case 13:ks(n,s,o,u);break;case 23:break;case 22:x=s.stateNode,w=s.alternate,s.memoizedState!==null?x._visibility&2?ks(n,s,o,u):Ro(n,s):x._visibility&2?ks(n,s,o,u):(x._visibility|=2,pl(n,s,o,u,(s.subtreeFlags&10256)!==0||!1)),p&2048&&Xm(w,s);break;case 24:ks(n,s,o,u),p&2048&&Zm(s.alternate,s);break;default:ks(n,s,o,u)}}r(Yb,"commitPassiveMountOnFiber");function pl(n,s,o,u,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=n,w=s,A=o,K=u,ee=w.flags;switch(w.tag){case 0:case 11:case 15:pl(x,w,A,K,p),Io(8,w);break;case 23:break;case 22:var de=w.stateNode;w.memoizedState!==null?de._visibility&2?pl(x,w,A,K,p):Ro(x,w):(de._visibility|=2,pl(x,w,A,K,p)),p&&ee&2048&&Xm(w.alternate,w);break;case 24:pl(x,w,A,K,p),p&&ee&2048&&Zm(w.alternate,w);break;default:pl(x,w,A,K,p)}s=s.sibling}}r(pl,"recursivelyTraverseReconnectPassiveEffects");function Ro(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=n,u=s,p=u.flags;switch(u.tag){case 22:Ro(o,u),p&2048&&Xm(u.alternate,u);break;case 24:Ro(o,u),p&2048&&Zm(u.alternate,u);break;default:Ro(o,u)}s=s.sibling}}r(Ro,"recursivelyTraverseAtomicPassiveEffects");var Do=8192;function hl(n,s,o){if(n.subtreeFlags&Do)for(n=n.child;n!==null;)Xb(n,s,o),n=n.sibling}r(hl,"recursivelyAccumulateSuspenseyCommit");function Xb(n,s,o){switch(n.tag){case 26:hl(n,s,o),n.flags&Do&&n.memoizedState!==null&&Z2(o,ws,n.memoizedState,n.memoizedProps);break;case 5:hl(n,s,o);break;case 3:case 4:var u=ws;ws=Iu(n.stateNode.containerInfo),hl(n,s,o),ws=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=Do,Do=16777216,hl(n,s,o),Do=u):hl(n,s,o));break;default:hl(n,s,o)}}r(Xb,"accumulateSuspenseyCommitOnFiber");function Zb(n){var s=n.alternate;if(s!==null&&(n=s.child,n!==null)){s.child=null;do s=n.sibling,n.sibling=null,n=s;while(n!==null)}}r(Zb,"detachAlternateSiblings");function Mo(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var u=s[o];ta=u,ev(u,n)}Zb(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Jb(n),n=n.sibling}r(Mo,"recursivelyTraversePassiveUnmountEffects");function Jb(n){switch(n.tag){case 0:case 11:case 15:Mo(n),n.flags&2048&&Mi(9,n,n.return);break;case 3:Mo(n);break;case 12:Mo(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,xu(n)):Mo(n);break;default:Mo(n)}}r(Jb,"commitPassiveUnmountOnFiber");function xu(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var u=s[o];ta=u,ev(u,n)}Zb(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:Mi(8,s,s.return),xu(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,xu(s));break;default:xu(s)}n=n.sibling}}r(xu,"recursivelyTraverseDisconnectPassiveEffects");function ev(n,s){for(;ta!==null;){var o=ta;switch(o.tag){case 0:case 11:case 15:Mi(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:xo(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,ta=u;else e:for(o=n;ta!==null;){u=ta;var p=u.sibling,x=u.return;if(Fb(u),u===o){ta=null;break e}if(p!==null){p.return=x,ta=p;break e}ta=x}}}r(ev,"commitPassiveUnmountEffectsInsideOfDeletedTree_begin");var h2={getCacheForType:r(function(n){var s=oa(qn),o=s.data.get(n);return o===void 0&&(o=n(),s.data.set(n,o)),o},"getCacheForType"),cacheSignal:r(function(){return oa(qn).controller.signal},"cacheSignal")},g2=typeof WeakMap=="function"?WeakMap:Map,Ht=0,rn=null,yt=null,St=0,Yt=0,Ga=null,Oi=!1,gl=!1,Jm=!1,di=0,Tn=0,Li=0,Er=0,ep=0,Ya=0,xl=0,Oo=null,Oa=null,tp=!1,bu=0,tv=0,vu=1/0,yu=null,zi=null,Gn=0,Pi=null,bl=null,fi=0,np=0,ap=null,nv=null,Lo=0,sp=null;function us(){return(Ht&2)!==0&&St!==0?St&-St:T.T!==null?up():Aa()}r(us,"requestUpdateLane");function av(){if(Ya===0)if((St&536870912)===0||Tt){var n=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),Ya=n}else Ya=536870912;return n=Qa.current,n!==null&&(n.flags|=32),Ya}r(av,"requestDeferredLane");function La(n,s,o){(n===rn&&(Yt===2||Yt===9)||n.cancelPendingCommit!==null)&&(vl(n,0),Ui(n,St,Ya,!1)),pn(n,o),((Ht&2)===0||n!==rn)&&(n===rn&&((Ht&2)===0&&(Er|=o),Tn===4&&Ui(n,St,Ya,!1)),mi(n))}r(La,"scheduleUpdateOnFiber");function sv(n,s,o){if((Ht&6)!==0)throw Error(c(327));var u=!o&&(s&127)===0&&(s&n.expiredLanes)===0||lt(n,s),p=u?v2(n,s):rp(n,s,!0),x=u;do{if(p===0){gl&&!u&&Ui(n,s,0,!1);break}else{if(o=n.current.alternate,x&&!x2(o)){p=rp(n,s,!1),x=!1;continue}if(p===2){if(x=s,n.errorRecoveryDisabledLanes&x)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){s=w;e:{var A=n;p=Oo;var K=A.current.memoizedState.isDehydrated;if(K&&(vl(A,w).flags|=256),w=rp(A,w,!1),w!==2){if(Jm&&!K){A.errorRecoveryDisabledLanes|=x,Er|=x,p=4;break e}x=Oa,Oa=p,x!==null&&(Oa===null?Oa=x:Oa.push.apply(Oa,x))}p=w}if(x=!1,p!==2)continue}}if(p===1){vl(n,0),Ui(n,s,0,!0);break}e:{switch(u=n,x=p,x){case 0:case 1:throw Error(c(345));case 4:if((s&4194048)!==s)break;case 6:Ui(u,s,Ya,!Oi);break e;case 2:Oa=null;break;case 3:case 5:break;default:throw Error(c(329))}if((s&62914560)===s&&(p=bu+300-Je(),10<p)){if(Ui(u,s,Ya,!Oi),Ot(u,0,!0)!==0)break e;fi=s,u.timeoutHandle=Lv(iv.bind(null,u,o,Oa,yu,tp,s,Ya,Er,xl,Oi,x,"Throttled",-0,0),p);break e}iv(u,o,Oa,yu,tp,s,Ya,Er,xl,Oi,x,null,-0,0)}}break}while(!0);mi(n)}r(sv,"performWorkOnRoot");function iv(n,s,o,u,p,x,w,A,K,ee,de,ge,ne,re){if(n.timeoutHandle=-1,ge=s.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Nn},Xb(s,x,ge);var Le=(x&62914560)===x?bu-Je():(x&4194048)===x?tv-Je():0;if(Le=J2(ge,Le),Le!==null){fi=x,n.cancelPendingCommit=Le(mv.bind(null,n,s,x,o,u,p,w,A,K,de,ge,null,ne,re)),Ui(n,x,w,!ee);return}}mv(n,s,x,o,u,p,w,A,K)}r(iv,"commitRootWhenReady");function x2(n){for(var s=n;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var p=o[u],x=p.getSnapshot;p=p.value;try{if(!Ha(x(),p))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}r(x2,"isRenderConsistentWithExternalStores");function Ui(n,s,o,u){s&=~ep,s&=~Er,n.suspendedLanes|=s,n.pingedLanes&=~s,u&&(n.warmLanes|=s),u=n.expirationTimes;for(var p=s;0<p;){var x=31-Dt(p),w=1<<x;u[x]=-1,p&=~w}o!==0&&on(n,o,s)}r(Ui,"markRootSuspended");function ju(){return(Ht&6)===0?(zo(0,!1),!1):!0}r(ju,"flushSyncWork$1");function ip(){if(yt!==null){if(Yt===0)var n=yt.return;else n=yt,ti=br=null,jm(n),cl=null,vo=0,n=yt;for(;n!==null;)Lb(n.alternate,n),n=n.return;yt=null}}r(ip,"resetWorkInProgressStack");function vl(n,s){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,O2(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),fi=0,ip(),rn=n,yt=o=Js(n.current,null),St=s,Yt=0,Ga=null,Oi=!1,gl=lt(n,s),Jm=!1,xl=Ya=ep=Er=Li=Tn=0,Oa=Oo=null,tp=!1,(s&8)!==0&&(s|=s&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=s;0<u;){var p=31-Dt(u),x=1<<p;s|=n[p],u&=~x}return di=s,Kc(),o}r(vl,"prepareFreshStack");function rv(n,s){mt=null,T.H=Ao,s===ol||s===Yc?(s=Nx(),Yt=3):s===cm?(s=Nx(),Yt=4):Yt=s===zm?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Ga=s,yt===null&&(Tn=1,uu(n,is(s,n.current)))}r(rv,"handleThrow");function lv(){var n=Qa.current;return n===null?!0:(St&4194048)===St?cs===null:(St&62914560)===St||(St&536870912)!==0?n===cs:!1}r(lv,"shouldRemainOnPreviousScreen");function ov(){var n=T.H;return T.H=Ao,n===null?Ao:n}r(ov,"pushDispatcher");function cv(){var n=T.A;return T.A=h2,n}r(cv,"pushAsyncDispatcher");function wu(){Tn=4,Oi||(St&4194048)!==St&&Qa.current!==null||(gl=!0),(Li&134217727)===0&&(Er&134217727)===0||rn===null||Ui(rn,St,Ya,!1)}r(wu,"renderDidSuspendDelayIfPossible");function rp(n,s,o){var u=Ht;Ht|=2;var p=ov(),x=cv();(rn!==n||St!==s)&&(yu=null,vl(n,s)),s=!1;var w=Tn;e:do try{if(Yt!==0&&yt!==null){var A=yt,K=Ga;switch(Yt){case 8:ip(),w=6;break e;case 3:case 2:case 9:case 6:Qa.current===null&&(s=!0);var ee=Yt;if(Yt=0,Ga=null,yl(n,A,K,ee),o&&gl){w=0;break e}break;default:ee=Yt,Yt=0,Ga=null,yl(n,A,K,ee)}}b2(),w=Tn;break}catch(de){rv(n,de)}while(!0);return s&&n.shellSuspendCounter++,ti=br=null,Ht=u,T.H=p,T.A=x,yt===null&&(rn=null,St=0,Kc()),w}r(rp,"renderRootSync");function b2(){for(;yt!==null;)uv(yt)}r(b2,"workLoopSync");function v2(n,s){var o=Ht;Ht|=2;var u=ov(),p=cv();rn!==n||St!==s?(yu=null,vu=Je()+500,vl(n,s)):gl=lt(n,s);e:do try{if(Yt!==0&&yt!==null){s=yt;var x=Ga;t:switch(Yt){case 1:Yt=0,Ga=null,yl(n,s,x,1);break;case 2:case 9:if(kx(x)){Yt=0,Ga=null,dv(s);break}s=r(function(){Yt!==2&&Yt!==9||rn!==n||(Yt=7),mi(n)},"lanes"),x.then(s,s);break e;case 3:Yt=7;break e;case 4:Yt=5;break e;case 7:kx(x)?(Yt=0,Ga=null,dv(s)):(Yt=0,Ga=null,yl(n,s,x,7));break;case 5:var w=null;switch(yt.tag){case 26:w=yt.memoizedState;case 5:case 27:var A=yt;if(w?Xv(w):A.stateNode.complete){Yt=0,Ga=null;var K=A.sibling;if(K!==null)yt=K;else{var ee=A.return;ee!==null?(yt=ee,ku(ee)):yt=null}break t}}Yt=0,Ga=null,yl(n,s,x,5);break;case 6:Yt=0,Ga=null,yl(n,s,x,6);break;case 8:ip(),Tn=6;break e;default:throw Error(c(462))}}y2();break}catch(de){rv(n,de)}while(!0);return ti=br=null,T.H=u,T.A=p,Ht=o,yt!==null?0:(rn=null,St=0,Kc(),Tn)}r(v2,"renderRootConcurrent");function y2(){for(;yt!==null&&!_e();)uv(yt)}r(y2,"workLoopConcurrentByScheduler");function uv(n){var s=Mb(n.alternate,n,di);n.memoizedProps=n.pendingProps,s===null?ku(n):yt=s}r(uv,"performUnitOfWork");function dv(n){var s=n,o=s.alternate;switch(s.tag){case 15:case 0:s=_b(o,s,s.pendingProps,s.type,void 0,St);break;case 11:s=_b(o,s,s.pendingProps,s.type.render,s.ref,St);break;case 5:jm(s);default:Lb(o,s),s=yt=fx(s,di),s=Mb(o,s,di)}n.memoizedProps=n.pendingProps,s===null?ku(n):yt=s}r(dv,"replaySuspendedUnitOfWork");function yl(n,s,o,u){ti=br=null,jm(s),cl=null,vo=0;var p=s.return;try{if(o2(n,p,s,o,St)){Tn=1,uu(n,is(o,n.current)),yt=null;return}}catch(x){if(p!==null)throw yt=p,x;Tn=1,uu(n,is(o,n.current)),yt=null;return}s.flags&32768?(Tt||u===1?n=!0:gl||(St&536870912)!==0?n=!1:(Oi=n=!0,(u===2||u===9||u===3||u===6)&&(u=Qa.current,u!==null&&u.tag===13&&(u.flags|=16384))),fv(s,n)):ku(s)}r(yl,"throwAndUnwindWorkLoop");function ku(n){var s=n;do{if((s.flags&32768)!==0){fv(s,Oi);return}n=s.return;var o=d2(s.alternate,s,di);if(o!==null){yt=o;return}if(s=s.sibling,s!==null){yt=s;return}yt=s=n}while(s!==null);Tn===0&&(Tn=5)}r(ku,"completeUnitOfWork");function fv(n,s){do{var o=f2(n.alternate,n);if(o!==null){o.flags&=32767,yt=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(n=n.sibling,n!==null)){yt=n;return}yt=n=o}while(n!==null);Tn=6,yt=null}r(fv,"unwindUnitOfWork");function mv(n,s,o,u,p,x,w,A,K){n.cancelPendingCommit=null;do Su();while(Gn!==0);if((Ht&6)!==0)throw Error(c(327));if(s!==null){if(s===n.current)throw Error(c(177));if(x=s.lanes|s.childLanes,x|=Wf,hn(n,o,x,w,A,K),n===rn&&(yt=rn=null,St=0),bl=s,Pi=n,fi=o,np=x,ap=p,nv=u,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,S2(mn,function(){return bv(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||u){u=T.T,T.T=null,p=te.p,te.p=2,w=Ht,Ht|=4;try{m2(n,s,o)}finally{Ht=w,te.p=p,T.T=u}}Gn=1,pv(),hv(),gv()}}r(mv,"commitRoot");function pv(){if(Gn===1){Gn=0;var n=Pi,s=bl,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=T.T,T.T=null;var u=te.p;te.p=2;var p=Ht;Ht|=4;try{Wb(s,n);var x=xp,w=ax(n.containerInfo),A=x.focusedElem,K=x.selectionRange;if(w!==A&&A&&A.ownerDocument&&nx(A.ownerDocument.documentElement,A)){if(K!==null&&qf(A)){var ee=K.start,de=K.end;if(de===void 0&&(de=ee),"selectionStart"in A)A.selectionStart=ee,A.selectionEnd=Math.min(de,A.value.length);else{var ge=A.ownerDocument||document,ne=ge&&ge.defaultView||window;if(ne.getSelection){var re=ne.getSelection(),Le=A.textContent.length,tt=Math.min(K.start,Le),nn=K.end===void 0?tt:Math.min(K.end,Le);!re.extend&&tt>nn&&(w=nn,nn=tt,tt=w);var W=tx(A,tt),q=tx(A,nn);if(W&&q&&(re.rangeCount!==1||re.anchorNode!==W.node||re.anchorOffset!==W.offset||re.focusNode!==q.node||re.focusOffset!==q.offset)){var J=ge.createRange();J.setStart(W.node,W.offset),re.removeAllRanges(),tt>nn?(re.addRange(J),re.extend(q.node,q.offset)):(J.setEnd(q.node,q.offset),re.addRange(J))}}}}for(ge=[],re=A;re=re.parentNode;)re.nodeType===1&&ge.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ge.length;A++){var fe=ge[A];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Lu=!!gp,xp=gp=null}finally{Ht=p,te.p=u,T.T=o}}n.current=s,Gn=2}}r(pv,"flushMutationEffects");function hv(){if(Gn===2){Gn=0;var n=Pi,s=bl,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=T.T,T.T=null;var u=te.p;te.p=2;var p=Ht;Ht|=4;try{qb(n,s.alternate,s)}finally{Ht=p,te.p=u,T.T=o}}Gn=3}}r(hv,"flushLayoutEffects");function gv(){if(Gn===4||Gn===3){Gn=0,ze();var n=Pi,s=bl,o=fi,u=nv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Gn=5:(Gn=0,bl=Pi=null,xv(n,n.pendingLanes));var p=n.pendingLanes;if(p===0&&(zi=null),ma(o),s=s.stateNode,dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(Qn,s,void 0,(s.current.flags&128)===128)}catch{}if(u!==null){s=T.T,p=te.p,te.p=2,T.T=null;try{for(var x=n.onRecoverableError,w=0;w<u.length;w++){var A=u[w];x(A.value,{componentStack:A.stack})}}finally{T.T=s,te.p=p}}(fi&3)!==0&&Su(),mi(n),p=n.pendingLanes,(o&261930)!==0&&(p&42)!==0?n===sp?Lo++:(Lo=0,sp=n):Lo=0,zo(0,!1)}}r(gv,"flushSpawnedWork");function xv(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,xo(s)))}r(xv,"releaseRootPooledCache");function Su(){return pv(),hv(),gv(),bv()}r(Su,"flushPendingEffects");function bv(){if(Gn!==5)return!1;var n=Pi,s=np;np=0;var o=ma(fi),u=T.T,p=te.p;try{te.p=32>o?32:o,T.T=null,o=ap,ap=null;var x=Pi,w=fi;if(Gn=0,bl=Pi=null,fi=0,(Ht&6)!==0)throw Error(c(331));var A=Ht;if(Ht|=4,Jb(x.current),Yb(x,x.current,w,o),Ht=A,zo(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Qn,x)}catch{}return!0}finally{te.p=p,T.T=u,xv(n,s)}}r(bv,"flushPassiveEffects");function vv(n,s,o){s=is(o,s),s=Lm(n.stateNode,s,2),n=Nr(n,s,2),n!==null&&(pn(n,2),mi(n))}r(vv,"captureCommitPhaseErrorOnRoot");function Xt(n,s,o){if(n.tag===3)vv(n,n,o);else for(;s!==null;){if(s.tag===3){vv(s,n,o);break}else if(s.tag===1){var u=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(zi===null||!zi.has(u))){n=is(o,n),o=yb(2),u=Nr(s,o,2),u!==null&&(jb(o,u,s,n),pn(u,2),mi(u));break}}s=s.return}}r(Xt,"captureCommitPhaseError");function lp(n,s,o){var u=n.pingCache;if(u===null){u=n.pingCache=new g2;var p=new Set;u.set(s,p)}else p=u.get(s),p===void 0&&(p=new Set,u.set(s,p));p.has(o)||(Jm=!0,p.add(o),n=j2.bind(null,n,s,o),s.then(n,n))}r(lp,"attachPingListener");function j2(n,s,o){var u=n.pingCache;u!==null&&u.delete(s),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,rn===n&&(St&o)===o&&(Tn===4||Tn===3&&(St&62914560)===St&&300>Je()-bu?(Ht&2)===0&&vl(n,0):ep|=o,xl===St&&(xl=0)),mi(n)}r(j2,"pingSuspendedRoot");function yv(n,s){s===0&&(s=Jt()),n=hr(n,s),n!==null&&(pn(n,s),mi(n))}r(yv,"retryTimedOutBoundary");function w2(n){var s=n.memoizedState,o=0;s!==null&&(o=s.retryLane),yv(n,o)}r(w2,"retryDehydratedSuspenseBoundary");function k2(n,s){var o=0;switch(n.tag){case 31:case 13:var u=n.stateNode,p=n.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(c(314))}u!==null&&u.delete(s),yv(n,o)}r(k2,"resolveRetryWakeable");function S2(n,s){return V(n,s)}r(S2,"scheduleCallback$1");var Nu=null,jl=null,op=!1,Cu=!1,cp=!1,$i=0;function mi(n){n!==jl&&n.next===null&&(jl===null?Nu=jl=n:jl=jl.next=n),Cu=!0,op||(op=!0,C2())}r(mi,"ensureRootIsScheduled");function zo(n,s){if(!cp&&Cu){cp=!0;do for(var o=!1,u=Nu;u!==null;){if(!s)if(n!==0){var p=u.pendingLanes;if(p===0)var x=0;else{var w=u.suspendedLanes,A=u.pingedLanes;x=(1<<31-Dt(42|n)+1)-1,x&=p&~(w&~A),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(o=!0,Sv(u,x))}else x=St,x=Ot(u,u===rn?x:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(x&3)===0||lt(u,x)||(o=!0,Sv(u,x));u=u.next}while(o);cp=!1}}r(zo,"flushSyncWorkAcrossRoots_impl");function N2(){jv()}r(N2,"processRootScheduleInImmediateTask");function jv(){Cu=op=!1;var n=0;$i!==0&&M2()&&(n=$i);for(var s=Je(),o=null,u=Nu;u!==null;){var p=u.next,x=wv(u,s);x===0?(u.next=null,o===null?Nu=p:o.next=p,p===null&&(jl=o)):(o=u,(n!==0||(x&3)!==0)&&(Cu=!0)),u=p}Gn!==0&&Gn!==5||zo(n,!1),$i!==0&&($i=0)}r(jv,"processRootScheduleInMicrotask");function wv(n,s){for(var o=n.suspendedLanes,u=n.pingedLanes,p=n.expirationTimes,x=n.pendingLanes&-62914561;0<x;){var w=31-Dt(x),A=1<<w,K=p[w];K===-1?((A&o)===0||(A&u)!==0)&&(p[w]=zt(A,s)):K<=s&&(n.expiredLanes|=A),x&=~A}if(s=rn,o=St,o=Ot(n,n===s?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,o===0||n===s&&(Yt===2||Yt===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&Ct(u),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||lt(n,o)){if(s=o&-o,s===n.callbackPriority)return s;switch(u!==null&&Ct(u),ma(o)){case 2:case 8:o=Wt;break;case 32:o=mn;break;case 268435456:o=_t;break;default:o=mn}return u=kv.bind(null,n),o=V(o,u),n.callbackPriority=s,n.callbackNode=o,s}return u!==null&&u!==null&&Ct(u),n.callbackPriority=2,n.callbackNode=null,2}r(wv,"scheduleTaskForRootDuringMicrotask");function kv(n,s){if(Gn!==0&&Gn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Su()&&n.callbackNode!==o)return null;var u=St;return u=Ot(n,n===rn?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(sv(n,u,s),wv(n,Je()),n.callbackNode!=null&&n.callbackNode===o?kv.bind(null,n):null)}r(kv,"performWorkOnRootViaSchedulerTask");function Sv(n,s){if(Su())return null;sv(n,s,!0)}r(Sv,"performSyncWorkOnRoot");function C2(){L2(function(){(Ht&6)!==0?V(At,N2):jv()})}r(C2,"scheduleImmediateRootScheduleTask");function up(){if($i===0){var n=rl;n===0&&(n=Pe,Pe<<=1,(Pe&261888)===0&&(Pe=256)),$i=n}return $i}r(up,"requestTransitionLane");function Nv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Ft(""+n)}r(Nv,"coerceFormActionProp");function Cv(n,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,n.id&&o.setAttribute("form",n.id),s.parentNode.insertBefore(o,s),n=new FormData(n),o.parentNode.removeChild(o),n}r(Cv,"createFormDataWithSubmitter");function A2(n,s,o,u,p){if(s==="submit"&&o&&o.stateNode===p){var x=Nv((p[kn]||null).action),w=u.submitter;w&&(s=(s=w[kn]||null)?Nv(s.formAction):w.getAttribute("formAction"),s!==null&&(x=s,w=null));var A=new as("action","action",null,u,p);n.push({event:A,listeners:[{instance:null,listener:r(function(){if(u.defaultPrevented){if($i!==0){var K=w?Cv(p,w):new FormData(p);Im(o,{pending:!0,data:K,method:p.method,action:x},null,K)}}else typeof x=="function"&&(A.preventDefault(),K=w?Cv(p,w):new FormData(p),Im(o,{pending:!0,data:K,method:p.method,action:x},x,K))},"listener"),currentTarget:p}]})}}r(A2,"extractEvents$1");for(var dp=0;dp<Qf.length;dp++){var fp=Qf[dp];js(fp.toLowerCase(),"on"+(fp[0].toUpperCase()+fp.slice(1)))}js(rx,"onAnimationEnd"),js(lx,"onAnimationIteration"),js(ox,"onAnimationStart"),js("dblclick","onDoubleClick"),js("focusin","onFocus"),js("focusout","onBlur"),js(KA,"onTransitionRun"),js(qA,"onTransitionStart"),js(FA,"onTransitionCancel"),js(cx,"onTransitionEnd"),va("onMouseEnter",["mouseout","mouseover"]),va("onMouseLeave",["mouseout","mouseover"]),va("onPointerEnter",["pointerout","pointerover"]),va("onPointerLeave",["pointerout","pointerover"]),ha("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ha("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ha("onBeforeInput",["compositionend","keypress","textInput","paste"]),ha("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ha("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ha("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Po="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Po));function Av(n,s){s=(s&4)!==0;for(var o=0;o<n.length;o++){var u=n[o],p=u.event;u=u.listeners;e:{var x=void 0;if(s)for(var w=u.length-1;0<=w;w--){var A=u[w],K=A.instance,ee=A.currentTarget;if(A=A.listener,K!==x&&p.isPropagationStopped())break e;x=A,p.currentTarget=ee;try{x(p)}catch(de){Bc(de)}p.currentTarget=null,x=K}else for(w=0;w<u.length;w++){if(A=u[w],K=A.instance,ee=A.currentTarget,A=A.listener,K!==x&&p.isPropagationStopped())break e;x=A,p.currentTarget=ee;try{x(p)}catch(de){Bc(de)}p.currentTarget=null,x=K}}}}r(Av,"processDispatchQueue");function jt(n,s){var o=s[Os];o===void 0&&(o=s[Os]=new Set);var u=n+"__bubble";o.has(u)||(Ev(s,n,2,!1),o.add(u))}r(jt,"listenToNonDelegatedEvent");function mp(n,s,o){var u=0;s&&(u|=4),Ev(o,n,u,s)}r(mp,"listenToNativeEvent");var Au="_reactListening"+Math.random().toString(36).slice(2);function _v(n){if(!n[Au]){n[Au]=!0,Ls.forEach(function(o){o!=="selectionchange"&&(_2.has(o)||mp(o,!1,n),mp(o,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[Au]||(s[Au]=!0,mp("selectionchange",!1,s))}}r(_v,"listenToAllSupportedEvents");function Ev(n,s,o,u){switch(ny(s)){case 2:var p=s_;break;case 8:p=i_;break;default:p=_p}o=p.bind(null,s,o,n),p=void 0,!H||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),u?p!==void 0?n.addEventListener(s,o,{capture:!0,passive:p}):n.addEventListener(s,o,!0):p!==void 0?n.addEventListener(s,o,{passive:p}):n.addEventListener(s,o,!1)}r(Ev,"addTrappedEventListener");function pp(n,s,o,u,p){var x=u;if((s&1)===0&&(s&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var A=u.stateNode.containerInfo;if(A===p)break;if(w===4)for(w=u.return;w!==null;){var K=w.tag;if((K===3||K===4)&&w.stateNode.containerInfo===p)return;w=w.return}for(;A!==null;){if(w=ba(A),w===null)return;if(K=w.tag,K===5||K===6||K===26||K===27){u=x=w;continue e}A=A.parentNode}}u=u.return}Oc(function(){var ee=x,de=Ka(o),ge=[];e:{var ne=ux.get(n);if(ne!==void 0){var re=as,Le=n;switch(n){case"keypress":if(En(o)===0)break e;case"keydown":case"keyup":re=Pf;break;case"focusin":Le="focus",re=ur;break;case"focusout":Le="blur",re=ur;break;case"beforeblur":case"afterblur":re=ur;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Yr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=zf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=so;break;case rx:case lx:case ox:re=Lc;break;case cx:re=fr;break;case"scroll":case"scrollend":re=Fa;break;case"wheel":re=io;break;case"copy":case"cut":case"paste":re=Xr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Pc;break;case"toggle":case"beforetoggle":re=Uf}var tt=(s&4)!==0,nn=!tt&&(n==="scroll"||n==="scrollend"),W=tt?ne!==null?ne+"Capture":null:ne;tt=[];for(var q=ee,J;q!==null;){var fe=q;if(J=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||J===null||W===null||(fe=Ys(q,W),fe!=null&&tt.push(Uo(q,fe,J))),nn)break;q=q.return}0<tt.length&&(ne=new re(ne,Le,null,o,de),ge.push({event:ne,listeners:tt}))}}if((s&7)===0){e:{if(ne=n==="mouseover"||n==="pointerover",re=n==="mouseout"||n==="pointerout",ne&&o!==ja&&(Le=o.relatedTarget||o.fromElement)&&(ba(Le)||Le[Jn]))break e;if((re||ne)&&(ne=de.window===de?de:(ne=de.ownerDocument)?ne.defaultView||ne.parentWindow:window,re?(Le=o.relatedTarget||o.toElement,re=ee,Le=Le?ba(Le):null,Le!==null&&(nn=m(Le),tt=Le.tag,Le!==nn||tt!==5&&tt!==27&&tt!==6)&&(Le=null)):(re=null,Le=ee),re!==Le)){if(tt=Yr,fe="onMouseLeave",W="onMouseEnter",q="mouse",(n==="pointerout"||n==="pointerover")&&(tt=Pc,fe="onPointerLeave",W="onPointerEnter",q="pointer"),nn=re==null?ne:_a(re),J=Le==null?ne:_a(Le),ne=new tt(fe,q+"leave",re,o,de),ne.target=nn,ne.relatedTarget=J,fe=null,ba(de)===ee&&(tt=new tt(W,q+"enter",Le,o,de),tt.target=J,tt.relatedTarget=nn,fe=tt),nn=fe,re&&Le)t:{for(tt=E2,W=re,q=Le,J=0,fe=W;fe;fe=tt(fe))J++;fe=0;for(var We=q;We;We=tt(We))fe++;for(;0<J-fe;)W=tt(W),J--;for(;0<fe-J;)q=tt(q),fe--;for(;J--;){if(W===q||q!==null&&W===q.alternate){tt=W;break t}W=tt(W),q=tt(q)}tt=null}else tt=null;re!==null&&Iv(ge,ne,re,tt,!1),Le!==null&&nn!==null&&Iv(ge,nn,Le,tt,!0)}}e:{if(ne=ee?_a(ee):window,re=ne.nodeName&&ne.nodeName.toLowerCase(),re==="select"||re==="input"&&ne.type==="file")var Bt=G0;else if(Q0(ne))if(Y0)Bt=UA;else{Bt=zA;var Be=LA}else re=ne.nodeName,!re||re.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&Ln(ee.elementType)&&(Bt=G0):Bt=PA;if(Bt&&(Bt=Bt(n,ee))){W0(ge,Bt,o,de);break e}Be&&Be(n,ne,ee),n==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Z(ne,"number",ne.value)}switch(Be=ee?_a(ee):window,n){case"focusin":(Q0(Be)||Be.contentEditable==="true")&&(Zr=Be,Ff=ee,po=null);break;case"focusout":po=Ff=Zr=null;break;case"mousedown":Hf=!0;break;case"contextmenu":case"mouseup":case"dragend":Hf=!1,sx(ge,o,de);break;case"selectionchange":if(BA)break;case"keydown":case"keyup":sx(ge,o,de)}var ht;if(lo)e:{switch(n){case"compositionstart":var Nt="onCompositionStart";break e;case"compositionend":Nt="onCompositionEnd";break e;case"compositionupdate":Nt="onCompositionUpdate";break e}Nt=void 0}else Zs?wa(n,o)&&(Nt="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(Nt="onCompositionStart");Nt&&(oo&&o.locale!=="ko"&&(Zs||Nt!=="onCompositionStart"?Nt==="onCompositionEnd"&&Zs&&(ht=Ut()):(X=de,Ie="value"in X?X.value:X.textContent,Zs=!0)),Be=_u(ee,Nt),0<Be.length&&(Nt=new dr(Nt,n,null,o,de),ge.push({event:Nt,listeners:Be}),ht?Nt.data=ht:(ht=Uc(o),ht!==null&&(Nt.data=ht)))),(ht=$f?RA(n,o):DA(n,o))&&(Nt=_u(ee,"onBeforeInput"),0<Nt.length&&(Be=new dr("onBeforeInput","beforeinput",null,o,de),ge.push({event:Be,listeners:Nt}),Be.data=ht)),A2(ge,n,ee,o,de)}Av(ge,s)})}r(pp,"dispatchEventForPluginEventSystem");function Uo(n,s,o){return{instance:n,listener:s,currentTarget:o}}r(Uo,"createDispatchListener");function _u(n,s){for(var o=s+"Capture",u=[];n!==null;){var p=n,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=Ys(n,o),p!=null&&u.unshift(Uo(n,p,x)),p=Ys(n,s),p!=null&&u.push(Uo(n,p,x))),n.tag===3)return u;n=n.return}return[]}r(_u,"accumulateTwoPhaseListeners");function E2(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}r(E2,"getParent");function Iv(n,s,o,u,p){for(var x=s._reactName,w=[];o!==null&&o!==u;){var A=o,K=A.alternate,ee=A.stateNode;if(A=A.tag,K!==null&&K===u)break;A!==5&&A!==26&&A!==27||ee===null||(K=ee,p?(ee=Ys(o,x),ee!=null&&w.unshift(Uo(o,ee,K))):p||(ee=Ys(o,x),ee!=null&&w.push(Uo(o,ee,K)))),o=o.return}w.length!==0&&n.push({event:s,listeners:w})}r(Iv,"accumulateEnterLeaveListenersForEvent");var I2=/\r\n?/g,T2=/\u0000|\uFFFD/g;function Tv(n){return(typeof n=="string"?n:""+n).replace(I2,`
|
|
63
|
+
`).replace(T2,"")}r(Tv,"normalizeMarkupForTextOrAttribute");function Rv(n,s){return s=Tv(s),Tv(n)===s}r(Rv,"checkForUnmatchedText");function tn(n,s,o,u,p,x){switch(o){case"children":typeof u=="string"?s==="body"||s==="textarea"&&u===""||Qe(n,u):(typeof u=="number"||typeof u=="bigint")&&s!=="body"&&Qe(n,""+u);break;case"className":Ba(n,"class",u);break;case"tabIndex":Ba(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Ba(n,o,u);break;case"style":un(n,u,x);break;case"data":if(s!=="object"){Ba(n,"data",u);break}case"src":case"href":if(u===""&&(s!=="a"||o!=="href")){n.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=Ft(""+u),n.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(o==="formAction"?(s!=="input"&&tn(n,s,"name",p.name,p,null),tn(n,s,"formEncType",p.formEncType,p,null),tn(n,s,"formMethod",p.formMethod,p,null),tn(n,s,"formTarget",p.formTarget,p,null)):(tn(n,s,"encType",p.encType,p,null),tn(n,s,"method",p.method,p,null),tn(n,s,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(o);break}u=Ft(""+u),n.setAttribute(o,u);break;case"onClick":u!=null&&(n.onclick=Nn);break;case"onScroll":u!=null&&jt("scroll",n);break;case"onScrollEnd":u!=null&&jt("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(c(61));if(o=u.__html,o!=null){if(p.children!=null)throw Error(c(60));n.innerHTML=o}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}o=Ft(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""+u):n.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":u===!0?n.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(o,u):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(o,u):n.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(o):n.setAttribute(o,u);break;case"popover":jt("beforetoggle",n),jt("toggle",n),$a(n,"popover",u);break;case"xlinkActuate":ya(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":ya(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":ya(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":ya(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":ya(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":ya(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":ya(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":ya(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":ya(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":$a(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Ta.get(o)||o,$a(n,o,u))}}r(tn,"setProp");function hp(n,s,o,u,p,x){switch(o){case"style":un(n,u,x);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(c(61));if(o=u.__html,o!=null){if(p.children!=null)throw Error(c(60));n.innerHTML=o}}break;case"children":typeof u=="string"?Qe(n,u):(typeof u=="number"||typeof u=="bigint")&&Qe(n,""+u);break;case"onScroll":u!=null&&jt("scroll",n);break;case"onScrollEnd":u!=null&&jt("scrollend",n);break;case"onClick":u!=null&&(n.onclick=Nn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zs.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),s=o.slice(2,p?o.length-7:void 0),x=n[kn]||null,x=x!=null?x[o]:null,typeof x=="function"&&n.removeEventListener(s,x,p),typeof u=="function")){typeof x!="function"&&x!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(s,u,p);break e}o in n?n[o]=u:u===!0?n.setAttribute(o,""):$a(n,o,u)}}}r(hp,"setPropOnCustomElement");function ua(n,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",n),jt("load",n);var u=!1,p=!1,x;for(x in o)if(o.hasOwnProperty(x)){var w=o[x];if(w!=null)switch(x){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,s));default:tn(n,s,x,w,o,null)}}p&&tn(n,s,"srcSet",o.srcSet,o,null),u&&tn(n,s,"src",o.src,o,null);return;case"input":jt("invalid",n);var A=x=w=p=null,K=null,ee=null;for(u in o)if(o.hasOwnProperty(u)){var de=o[u];if(de!=null)switch(u){case"name":p=de;break;case"type":w=de;break;case"checked":K=de;break;case"defaultChecked":ee=de;break;case"value":x=de;break;case"defaultValue":A=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(c(137,s));break;default:tn(n,s,u,de,o,null)}}Ia(n,x,A,K,ee,w,p,!1);return;case"select":jt("invalid",n),u=w=x=null;for(p in o)if(o.hasOwnProperty(p)&&(A=o[p],A!=null))switch(p){case"value":x=A;break;case"defaultValue":w=A;break;case"multiple":u=A;default:tn(n,s,p,A,o,null)}s=x,o=w,n.multiple=!!u,s!=null?Ne(n,!!u,s,!1):o!=null&&Ne(n,!!u,o,!0);return;case"textarea":jt("invalid",n),x=p=u=null;for(w in o)if(o.hasOwnProperty(w)&&(A=o[w],A!=null))switch(w){case"value":u=A;break;case"defaultValue":p=A;break;case"children":x=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(c(91));break;default:tn(n,s,w,A,o,null)}Xe(n,u,p,x);return;case"option":for(K in o)o.hasOwnProperty(K)&&(u=o[K],u!=null)&&(K==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":tn(n,s,K,u,o,null));return;case"dialog":jt("beforetoggle",n),jt("toggle",n),jt("cancel",n),jt("close",n);break;case"iframe":case"object":jt("load",n);break;case"video":case"audio":for(u=0;u<Po.length;u++)jt(Po[u],n);break;case"image":jt("error",n),jt("load",n);break;case"details":jt("toggle",n);break;case"embed":case"source":case"link":jt("error",n),jt("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in o)if(o.hasOwnProperty(ee)&&(u=o[ee],u!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,s));default:tn(n,s,ee,u,o,null)}return;default:if(Ln(s)){for(de in o)o.hasOwnProperty(de)&&(u=o[de],u!==void 0&&hp(n,s,de,u,o,void 0));return}}for(A in o)o.hasOwnProperty(A)&&(u=o[A],u!=null&&tn(n,s,A,u,o,null))}r(ua,"setInitialProperties");function R2(n,s,o,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,w=null,A=null,K=null,ee=null,de=null;for(re in o){var ge=o[re];if(o.hasOwnProperty(re)&&ge!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":K=ge;default:u.hasOwnProperty(re)||tn(n,s,re,null,u,ge)}}for(var ne in u){var re=u[ne];if(ge=o[ne],u.hasOwnProperty(ne)&&(re!=null||ge!=null))switch(ne){case"type":x=re;break;case"name":p=re;break;case"checked":ee=re;break;case"defaultChecked":de=re;break;case"value":w=re;break;case"defaultValue":A=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(c(137,s));break;default:re!==ge&&tn(n,s,ne,re,u,ge)}}qt(n,w,A,K,ee,de,x,p);return;case"select":re=w=A=ne=null;for(x in o)if(K=o[x],o.hasOwnProperty(x)&&K!=null)switch(x){case"value":break;case"multiple":re=K;default:u.hasOwnProperty(x)||tn(n,s,x,null,u,K)}for(p in u)if(x=u[p],K=o[p],u.hasOwnProperty(p)&&(x!=null||K!=null))switch(p){case"value":ne=x;break;case"defaultValue":A=x;break;case"multiple":w=x;default:x!==K&&tn(n,s,p,x,u,K)}s=A,o=w,u=re,ne!=null?Ne(n,!!o,ne,!1):!!u!=!!o&&(s!=null?Ne(n,!!o,s,!0):Ne(n,!!o,o?[]:"",!1));return;case"textarea":re=ne=null;for(A in o)if(p=o[A],o.hasOwnProperty(A)&&p!=null&&!u.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:tn(n,s,A,null,u,p)}for(w in u)if(p=u[w],x=o[w],u.hasOwnProperty(w)&&(p!=null||x!=null))switch(w){case"value":ne=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(c(91));break;default:p!==x&&tn(n,s,w,p,u,x)}Ke(n,ne,re);return;case"option":for(var Le in o)ne=o[Le],o.hasOwnProperty(Le)&&ne!=null&&!u.hasOwnProperty(Le)&&(Le==="selected"?n.selected=!1:tn(n,s,Le,null,u,ne));for(K in u)ne=u[K],re=o[K],u.hasOwnProperty(K)&&ne!==re&&(ne!=null||re!=null)&&(K==="selected"?n.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":tn(n,s,K,ne,u,re));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var tt in o)ne=o[tt],o.hasOwnProperty(tt)&&ne!=null&&!u.hasOwnProperty(tt)&&tn(n,s,tt,null,u,ne);for(ee in u)if(ne=u[ee],re=o[ee],u.hasOwnProperty(ee)&&ne!==re&&(ne!=null||re!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(c(137,s));break;default:tn(n,s,ee,ne,u,re)}return;default:if(Ln(s)){for(var nn in o)ne=o[nn],o.hasOwnProperty(nn)&&ne!==void 0&&!u.hasOwnProperty(nn)&&hp(n,s,nn,void 0,u,ne);for(de in u)ne=u[de],re=o[de],!u.hasOwnProperty(de)||ne===re||ne===void 0&&re===void 0||hp(n,s,de,ne,u,re);return}}for(var W in o)ne=o[W],o.hasOwnProperty(W)&&ne!=null&&!u.hasOwnProperty(W)&&tn(n,s,W,null,u,ne);for(ge in u)ne=u[ge],re=o[ge],!u.hasOwnProperty(ge)||ne===re||ne==null&&re==null||tn(n,s,ge,ne,u,re)}r(R2,"updateProperties");function Dv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}r(Dv,"isLikelyStaticResource");function D2(){if(typeof performance.getEntriesByType=="function"){for(var n=0,s=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var p=o[u],x=p.transferSize,w=p.initiatorType,A=p.duration;if(x&&A&&Dv(w)){for(w=0,A=p.responseEnd,u+=1;u<o.length;u++){var K=o[u],ee=K.startTime;if(ee>A)break;var de=K.transferSize,ge=K.initiatorType;de&&Dv(ge)&&(K=K.responseEnd,w+=de*(K<A?1:(A-ee)/(K-ee)))}if(--u,s+=8*(x+w)/(p.duration/1e3),n++,10<n)break}}if(0<n)return s/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}r(D2,"estimateBandwidth");var gp=null,xp=null;function Eu(n){return n.nodeType===9?n:n.ownerDocument}r(Eu,"getOwnerDocumentFromRootContainer");function Mv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}r(Mv,"getOwnHostContext");function Ov(n,s){if(n===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&s==="foreignObject"?0:n}r(Ov,"getChildHostContextProd");function bp(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}r(bp,"shouldSetTextContent");var vp=null;function M2(){var n=window.event;return n&&n.type==="popstate"?n===vp?!1:(vp=n,!0):(vp=null,!1)}r(M2,"shouldAttemptEagerTransition");var Lv=typeof setTimeout=="function"?setTimeout:void 0,O2=typeof clearTimeout=="function"?clearTimeout:void 0,zv=typeof Promise=="function"?Promise:void 0,L2=typeof queueMicrotask=="function"?queueMicrotask:typeof zv<"u"?function(n){return zv.resolve(null).then(n).catch(z2)}:Lv;function z2(n){setTimeout(function(){throw n})}r(z2,"handleErrorInNextTick");function Bi(n){return n==="head"}r(Bi,"isSingletonScope");function Pv(n,s){var o=s,u=0;do{var p=o.nextSibling;if(n.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(u===0){n.removeChild(p),Nl(s);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")$o(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,$o(o);for(var x=o.firstChild;x;){var w=x.nextSibling,A=x.nodeName;x[Sn]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&x.rel.toLowerCase()==="stylesheet"||o.removeChild(x),x=w}}else o==="body"&&$o(n.ownerDocument.body);o=p}while(o);Nl(s)}r(Pv,"clearHydrationBoundary");function Uv(n,s){var o=n;n=0;do{var u=o.nextSibling;if(o.nodeType===1?s?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(s?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=u}while(o)}r(Uv,"hideOrUnhideDehydratedBoundary");function yp(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":yp(o),Ua(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}r(yp,"clearContainerSparingly");function P2(n,s,o,u){for(;n.nodeType===1;){var p=o;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[Sn])switch(s){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(x=n.getAttribute("rel"),x==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(x!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(x=n.getAttribute("src"),(x!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(s==="input"&&n.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===x)return n}else return n;if(n=ds(n.nextSibling),n===null)break}return null}r(P2,"canHydrateInstance");function U2(n,s,o){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=ds(n.nextSibling),n===null))return null;return n}r(U2,"canHydrateTextInstance");function $v(n,s){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!s||(n=ds(n.nextSibling),n===null))return null;return n}r($v,"canHydrateHydrationBoundary");function jp(n){return n.data==="$?"||n.data==="$~"}r(jp,"isSuspenseInstancePending");function wp(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}r(wp,"isSuspenseInstanceFallback");function $2(n,s){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=s;else if(n.data!=="$?"||o.readyState!=="loading")s();else{var u=r(function(){s(),o.removeEventListener("DOMContentLoaded",u)},"listener");o.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}r($2,"registerSuspenseInstanceRetry");function ds(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return n}r(ds,"getNextHydratable");var kp=null;function Bv(n){n=n.nextSibling;for(var s=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(s===0)return ds(n.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}n=n.nextSibling}return null}r(Bv,"getNextHydratableInstanceAfterHydrationBoundary");function Kv(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(s===0)return n;s--}else o!=="/$"&&o!=="/&"||s++}n=n.previousSibling}return null}r(Kv,"getParentHydrationBoundary");function qv(n,s,o){switch(s=Eu(o),n){case"html":if(n=s.documentElement,!n)throw Error(c(452));return n;case"head":if(n=s.head,!n)throw Error(c(453));return n;case"body":if(n=s.body,!n)throw Error(c(454));return n;default:throw Error(c(451))}}r(qv,"resolveSingletonInstance");function $o(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);Ua(n)}r($o,"releaseSingletonInstance");var fs=new Map,Fv=new Set;function Iu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}r(Iu,"getHoistableRoot");var pi=te.d;te.d={f:B2,r:K2,D:q2,C:F2,L:H2,m:V2,X:W2,S:Q2,M:G2};function B2(){var n=pi.f(),s=ju();return n||s}r(B2,"flushSyncWork");function K2(n){var s=Mn(n);s!==null&&s.tag===5&&s.type==="form"?cb(s):pi.r(n)}r(K2,"requestFormReset");var wl=typeof document>"u"?null:document;function Hv(n,s,o){var u=wl;if(u&&typeof s=="string"&&s){var p=gt(s);p='link[rel="'+n+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),Fv.has(p)||(Fv.add(p),n={rel:n,crossOrigin:o,href:s},u.querySelector(p)===null&&(s=u.createElement("link"),ua(s,"link",n),cn(s),u.head.appendChild(s)))}}r(Hv,"preconnectAs");function q2(n){pi.D(n),Hv("dns-prefetch",n,null)}r(q2,"prefetchDNS");function F2(n,s){pi.C(n,s),Hv("preconnect",n,s)}r(F2,"preconnect");function H2(n,s,o){pi.L(n,s,o);var u=wl;if(u&&n&&s){var p='link[rel="preload"][as="'+gt(s)+'"]';s==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+gt(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+gt(o.imageSizes)+'"]')):p+='[href="'+gt(n)+'"]';var x=p;switch(s){case"style":x=kl(n);break;case"script":x=Sl(n)}fs.has(x)||(n=j({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:n,as:s},o),fs.set(x,n),u.querySelector(p)!==null||s==="style"&&u.querySelector(Bo(x))||s==="script"&&u.querySelector(Ko(x))||(s=u.createElement("link"),ua(s,"link",n),cn(s),u.head.appendChild(s)))}}r(H2,"preload");function V2(n,s){pi.m(n,s);var o=wl;if(o&&n){var u=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+gt(u)+'"][href="'+gt(n)+'"]',x=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Sl(n)}if(!fs.has(x)&&(n=j({rel:"modulepreload",href:n},s),fs.set(x,n),o.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ko(x)))return}u=o.createElement("link"),ua(u,"link",n),cn(u),o.head.appendChild(u)}}}r(V2,"preloadModule");function Q2(n,s,o){pi.S(n,s,o);var u=wl;if(u&&n){var p=_n(u).hoistableStyles,x=kl(n);s=s||"default";var w=p.get(x);if(!w){var A={loading:0,preload:null};if(w=u.querySelector(Bo(x)))A.loading=5;else{n=j({rel:"stylesheet",href:n,"data-precedence":s},o),(o=fs.get(x))&&Sp(n,o);var K=w=u.createElement("link");cn(K),ua(K,"link",n),K._p=new Promise(function(ee,de){K.onload=ee,K.onerror=de}),K.addEventListener("load",function(){A.loading|=1}),K.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Tu(w,s,u)}w={type:"stylesheet",instance:w,count:1,state:A},p.set(x,w)}}}r(Q2,"preinitStyle");function W2(n,s){pi.X(n,s);var o=wl;if(o&&n){var u=_n(o).hoistableScripts,p=Sl(n),x=u.get(p);x||(x=o.querySelector(Ko(p)),x||(n=j({src:n,async:!0},s),(s=fs.get(p))&&Np(n,s),x=o.createElement("script"),cn(x),ua(x,"link",n),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(p,x))}}r(W2,"preinitScript");function G2(n,s){pi.M(n,s);var o=wl;if(o&&n){var u=_n(o).hoistableScripts,p=Sl(n),x=u.get(p);x||(x=o.querySelector(Ko(p)),x||(n=j({src:n,async:!0,type:"module"},s),(s=fs.get(p))&&Np(n,s),x=o.createElement("script"),cn(x),ua(x,"link",n),o.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},u.set(p,x))}}r(G2,"preinitModuleScript");function Vv(n,s,o,u){var p=(p=Te.current)?Iu(p):null;if(!p)throw Error(c(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=kl(o.href),o=_n(p).hoistableStyles,u=o.get(s),u||(u={type:"style",instance:null,count:0,state:null},o.set(s,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=kl(o.href);var x=_n(p).hoistableStyles,w=x.get(n);if(w||(p=p.ownerDocument||p,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(n,w),(x=p.querySelector(Bo(n)))&&!x._p&&(w.instance=x,w.state.loading=5),fs.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},fs.set(n,o),x||Y2(p,n,o,w.state))),s&&u===null)throw Error(c(528,""));return w}if(s&&u!==null)throw Error(c(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Sl(o),o=_n(p).hoistableScripts,u=o.get(s),u||(u={type:"script",instance:null,count:0,state:null},o.set(s,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,n))}}r(Vv,"getResource");function kl(n){return'href="'+gt(n)+'"'}r(kl,"getStyleKey");function Bo(n){return'link[rel="stylesheet"]['+n+"]"}r(Bo,"getStylesheetSelectorFromKey");function Qv(n){return j({},n,{"data-precedence":n.precedence,precedence:null})}r(Qv,"stylesheetPropsFromRawProps");function Y2(n,s,o,u){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?u.loading=1:(s=n.createElement("link"),u.preload=s,s.addEventListener("load",function(){return u.loading|=1}),s.addEventListener("error",function(){return u.loading|=2}),ua(s,"link",o),cn(s),n.head.appendChild(s))}r(Y2,"preloadStylesheet");function Sl(n){return'[src="'+gt(n)+'"]'}r(Sl,"getScriptKey");function Ko(n){return"script[async]"+n}r(Ko,"getScriptSelectorFromKey");function Wv(n,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var u=n.querySelector('style[data-href~="'+gt(o.href)+'"]');if(u)return s.instance=u,cn(u),u;var p=j({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),cn(u),ua(u,"style",p),Tu(u,o.precedence,n),s.instance=u;case"stylesheet":p=kl(o.href);var x=n.querySelector(Bo(p));if(x)return s.state.loading|=4,s.instance=x,cn(x),x;u=Qv(o),(p=fs.get(p))&&Sp(u,p),x=(n.ownerDocument||n).createElement("link"),cn(x);var w=x;return w._p=new Promise(function(A,K){w.onload=A,w.onerror=K}),ua(x,"link",u),s.state.loading|=4,Tu(x,o.precedence,n),s.instance=x;case"script":return x=Sl(o.src),(p=n.querySelector(Ko(x)))?(s.instance=p,cn(p),p):(u=o,(p=fs.get(x))&&(u=j({},o),Np(u,p)),n=n.ownerDocument||n,p=n.createElement("script"),cn(p),ua(p,"link",u),n.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(c(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(u=s.instance,s.state.loading|=4,Tu(u,o.precedence,n));return s.instance}r(Wv,"acquireResource");function Tu(n,s,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,x=p,w=0;w<u.length;w++){var A=u[w];if(A.dataset.precedence===s)x=A;else if(x!==p)break}x?x.parentNode.insertBefore(n,x.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(n,s.firstChild))}r(Tu,"insertStylesheet");function Sp(n,s){n.crossOrigin??=s.crossOrigin,n.referrerPolicy??=s.referrerPolicy,n.title??=s.title}r(Sp,"adoptPreloadPropsForStylesheet");function Np(n,s){n.crossOrigin??=s.crossOrigin,n.referrerPolicy??=s.referrerPolicy,n.integrity??=s.integrity}r(Np,"adoptPreloadPropsForScript");var Ru=null;function Gv(n,s,o){if(Ru===null){var u=new Map,p=Ru=new Map;p.set(o,u)}else p=Ru,u=p.get(o),u||(u=new Map,p.set(o,u));if(u.has(n))return u;for(u.set(n,null),o=o.getElementsByTagName(n),p=0;p<o.length;p++){var x=o[p];if(!(x[Sn]||x[xt]||n==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var w=x.getAttribute(s)||"";w=n+w;var A=u.get(w);A?A.push(x):u.set(w,[x])}}return u}r(Gv,"getHydratableHoistableCache");function Yv(n,s,o){n=n.ownerDocument||n,n.head.insertBefore(o,s==="title"?n.querySelector("head > title"):null)}r(Yv,"mountHoistable");function X2(n,s,o){if(o===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(n=s.disabled,typeof s.precedence=="string"&&n==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}r(X2,"isHostHoistableType");function Xv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}r(Xv,"preloadResource");function Z2(n,s,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=kl(u.href),x=s.querySelector(Bo(p));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(n.count++,n=Du.bind(n),s.then(n,n)),o.state.loading|=4,o.instance=x,cn(x);return}x=s.ownerDocument||s,u=Qv(u),(p=fs.get(p))&&Sp(u,p),x=x.createElement("link"),cn(x);var w=x;w._p=new Promise(function(A,K){w.onload=A,w.onerror=K}),ua(x,"link",u),o.instance=x}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=Du.bind(n),s.addEventListener("load",o),s.addEventListener("error",o))}}r(Z2,"suspendResource");var Cp=0;function J2(n,s){return n.stylesheets&&n.count===0&&Ou(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var u=setTimeout(function(){if(n.stylesheets&&Ou(n,n.stylesheets),n.unsuspend){var x=n.unsuspend;n.unsuspend=null,x()}},6e4+s);0<n.imgBytes&&Cp===0&&(Cp=62500*D2());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Ou(n,n.stylesheets),n.unsuspend)){var x=n.unsuspend;n.unsuspend=null,x()}},(n.imgBytes>Cp?50:800)+s);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}r(J2,"waitForCommitToBeReady");function Du(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ou(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}r(Du,"onUnsuspend");var Mu=null;function Ou(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Mu=new Map,s.forEach(e_,n),Mu=null,Du.call(n))}r(Ou,"insertSuspendedStylesheets");function e_(n,s){if(!(s.state.loading&4)){var o=Mu.get(n);if(o)var u=o.get(null);else{o=new Map,Mu.set(n,o);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var w=p[x];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),u=w)}u&&o.set(null,u)}p=s.instance,w=p.getAttribute("data-precedence"),x=o.get(w)||u,x===u&&o.set(null,p),o.set(w,p),this.count++,u=Du.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),x?x.parentNode.insertBefore(p,x.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),s.state.loading|=4}}r(e_,"insertStylesheetIntoRoot");var qo={$$typeof:I,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function t_(n,s,o,u,p,x,w,A,K){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lt(0),this.hiddenUpdates=Lt(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}r(t_,"FiberRootNode");function n_(n,s,o,u,p,x,w,A,K,ee,de,ge){return n=new t_(n,s,o,w,K,ee,de,ge,A),s=1,x===!0&&(s|=24),x=Va(3,null,null,s),n.current=x,x.stateNode=n,s=rm(),s.refCount++,n.pooledCache=s,s.refCount++,x.memoizedState={element:u,isDehydrated:o,cache:s},um(x),n}r(n_,"createFiberRoot");function a_(n){return n?(n=tl,n):tl}r(a_,"getContextForSubtree");function Zv(n,s,o,u,p,x){p=a_(p),u.context===null?u.context=p:u.pendingContext=p,u=Sr(s),u.payload={element:o},x=x===void 0?null:x,x!==null&&(u.callback=x),o=Nr(n,u,s),o!==null&&(La(o,n,s),jo(o,n,s))}r(Zv,"updateContainerImpl");function Jv(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<s?o:s}}r(Jv,"markRetryLaneImpl");function Ap(n,s){Jv(n,s),(n=n.alternate)&&Jv(n,s)}r(Ap,"markRetryLaneIfNotHydrated");function ey(n){if(n.tag===13||n.tag===31){var s=hr(n,67108864);s!==null&&La(s,n,67108864),Ap(n,67108864)}}r(ey,"attemptContinuousHydration");function ty(n){if(n.tag===13||n.tag===31){var s=us();s=Ja(s);var o=hr(n,s);o!==null&&La(o,n,s),Ap(n,s)}}r(ty,"attemptHydrationAtCurrentPriority");var Lu=!0;function s_(n,s,o,u){var p=T.T;T.T=null;var x=te.p;try{te.p=2,_p(n,s,o,u)}finally{te.p=x,T.T=p}}r(s_,"dispatchDiscreteEvent");function i_(n,s,o,u){var p=T.T;T.T=null;var x=te.p;try{te.p=8,_p(n,s,o,u)}finally{te.p=x,T.T=p}}r(i_,"dispatchContinuousEvent");function _p(n,s,o,u){if(Lu){var p=Ep(u);if(p===null)pp(n,s,u,zu,o),ay(n,u);else if(l_(p,n,s,o,u))u.stopPropagation();else if(ay(n,u),s&4&&-1<r_.indexOf(n)){for(;p!==null;){var x=Mn(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var w=He(x.pendingLanes);if(w!==0){var A=x;for(A.pendingLanes|=2,A.entangledLanes|=2;w;){var K=1<<31-Dt(w);A.entanglements[1]|=K,w&=~K}mi(x),(Ht&6)===0&&(vu=Je()+500,zo(0,!1))}}break;case 31:case 13:A=hr(x,2),A!==null&&La(A,x,2),ju(),Ap(x,2)}if(x=Ep(u),x===null&&pp(n,s,u,zu,o),x===p)break;p=x}p!==null&&u.stopPropagation()}else pp(n,s,u,null,o)}}r(_p,"dispatchEvent");function Ep(n){return n=Ka(n),Ip(n)}r(Ep,"findInstanceBlockingEvent");var zu=null;function Ip(n){if(zu=null,n=ba(n),n!==null){var s=m(n);if(s===null)n=null;else{var o=s.tag;if(o===13){if(n=f(s),n!==null)return n;n=null}else if(o===31){if(n=h(s),n!==null)return n;n=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return zu=n,null}r(Ip,"findInstanceBlockingTarget");function ny(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(rt()){case At:return 2;case Wt:return 8;case mn:case Zt:return 32;case _t:return 268435456;default:return 32}default:return 32}}r(ny,"getEventPriority");var Tp=!1,Ki=null,qi=null,Fi=null,Fo=new Map,Ho=new Map,Hi=[],r_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ay(n,s){switch(n){case"focusin":case"focusout":Ki=null;break;case"dragenter":case"dragleave":qi=null;break;case"mouseover":case"mouseout":Fi=null;break;case"pointerover":case"pointerout":Fo.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ho.delete(s.pointerId)}}r(ay,"clearIfContinuousEvent");function Vo(n,s,o,u,p,x){return n===null||n.nativeEvent!==x?(n={blockedOn:s,domEventName:o,eventSystemFlags:u,nativeEvent:x,targetContainers:[p]},s!==null&&(s=Mn(s),s!==null&&ey(s)),n):(n.eventSystemFlags|=u,s=n.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),n)}r(Vo,"accumulateOrCreateContinuousQueuedReplayableEvent");function l_(n,s,o,u,p){switch(s){case"focusin":return Ki=Vo(Ki,n,s,o,u,p),!0;case"dragenter":return qi=Vo(qi,n,s,o,u,p),!0;case"mouseover":return Fi=Vo(Fi,n,s,o,u,p),!0;case"pointerover":var x=p.pointerId;return Fo.set(x,Vo(Fo.get(x)||null,n,s,o,u,p)),!0;case"gotpointercapture":return x=p.pointerId,Ho.set(x,Vo(Ho.get(x)||null,n,s,o,u,p)),!0}return!1}r(l_,"queueIfContinuousEvent");function sy(n){var s=ba(n.target);if(s!==null){var o=m(s);if(o!==null){if(s=o.tag,s===13){if(s=f(o),s!==null){n.blockedOn=s,es(n.priority,function(){ty(o)});return}}else if(s===31){if(s=h(o),s!==null){n.blockedOn=s,es(n.priority,function(){ty(o)});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}r(sy,"attemptExplicitHydrationTarget");function Pu(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var o=Ep(n.nativeEvent);if(o===null){o=n.nativeEvent;var u=new o.constructor(o.type,o);ja=u,o.target.dispatchEvent(u),ja=null}else return s=Mn(o),s!==null&&ey(s),n.blockedOn=o,!1;s.shift()}return!0}r(Pu,"attemptReplayContinuousQueuedEvent");function iy(n,s,o){Pu(n)&&o.delete(s)}r(iy,"attemptReplayContinuousQueuedEventInMap");function o_(){Tp=!1,Ki!==null&&Pu(Ki)&&(Ki=null),qi!==null&&Pu(qi)&&(qi=null),Fi!==null&&Pu(Fi)&&(Fi=null),Fo.forEach(iy),Ho.forEach(iy)}r(o_,"replayUnblockedEvents");function Uu(n,s){n.blockedOn===s&&(n.blockedOn=null,Tp||(Tp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,o_)))}r(Uu,"scheduleCallbackIfUnblocked");var $u=null;function ry(n){$u!==n&&($u=n,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){$u===n&&($u=null);for(var s=0;s<n.length;s+=3){var o=n[s],u=n[s+1],p=n[s+2];if(typeof u!="function"){if(Ip(u||o)===null)continue;break}var x=Mn(o);x!==null&&(n.splice(s,3),s-=3,Im(x,{pending:!0,data:p,method:o.method,action:u},u,p))}}))}r(ry,"scheduleReplayQueueIfNeeded");function Nl(n){function s(K){return Uu(K,n)}r(s,"unblock"),Ki!==null&&Uu(Ki,n),qi!==null&&Uu(qi,n),Fi!==null&&Uu(Fi,n),Fo.forEach(s),Ho.forEach(s);for(var o=0;o<Hi.length;o++){var u=Hi[o];u.blockedOn===n&&(u.blockedOn=null)}for(;0<Hi.length&&(o=Hi[0],o.blockedOn===null);)sy(o),o.blockedOn===null&&Hi.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var p=o[u],x=o[u+1],w=p[kn]||null;if(typeof x=="function")w||ry(o);else if(w){var A=null;if(x&&x.hasAttribute("formAction")){if(p=x,w=x[kn]||null)A=w.formAction;else if(Ip(p)!==null)continue}else A=w.action;typeof A=="function"?o[u+1]=A:(o.splice(u,3),u-=3),ry(o)}}}r(Nl,"retryIfBlockedOn");function c_(){function n(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:r(function(){return new Promise(function(w){return p=w})},"handler"),focusReset:"manual",scroll:"manual"})}r(n,"handleNavigate");function s(){p!==null&&(p(),p=null),u||setTimeout(o,20)}r(s,"handleNavigateComplete");function o(){if(!u&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(r(o,"startFakeNavigation"),typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}r(c_,"defaultOnDefaultTransitionIndicator");function Rp(n){this._internalRoot=n}r(Rp,"ReactDOMRoot"),Dp.prototype.render=Rp.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(c(409));var o=s.current;Zv(o,us(),n,s,null,null)},Dp.prototype.unmount=Rp.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;Zv(n.current,2,null,n,null,null),ju(),s[Jn]=null}};function Dp(n){this._internalRoot=n}r(Dp,"ReactDOMHydrationRoot"),Dp.prototype.unstable_scheduleHydration=function(n){if(n){var s=Aa();n={blockedOn:null,target:n,priority:s};for(var o=0;o<Hi.length&&s!==0&&s<Hi[o].priority;o++);Hi.splice(o,0,n),o===0&&sy(n)}};var ly=i.version;if(ly!=="19.2.8")throw Error(c(527,ly,"19.2.8"));te.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(c(188)):(n=Object.keys(n).join(","),Error(c(268,n)));return n=v(s),n=n!==null?y(n):null,n=n===null?null:n.stateNode,n};var u_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bu.isDisabled&&Bu.supportsFiber)try{Qn=Bu.inject(u_),dt=Bu}catch{}}e.createRoot=function(n,s){if(!d(n))throw Error(c(299));var o=!1,u="",p=i2,x=r2,w=l2;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError)),s=n_(n,1,!1,null,null,o,u,null,p,x,w,c_),n[Jn]=s.current,_v(n),new Rp(s)}})),B7=Ql(((e,t)=>{function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch{}}r(i,"checkDCE"),i(),t.exports=$7()})),K7=B7();function q7(e,t,i=K7.createRoot){const l=e;if(l.__paperclipReactRoot)return l.__paperclipReactRoot;const c=i(t);return l.__paperclipReactRoot=c,c}r(q7,"getOrCreateWardmoteReactRoot");function F7(e){return(e.split("/").pop()??"").replace(/\.js$/,"").replace(/[^A-Za-z0-9_-]/g,"-")||"build"}r(F7,"serviceWorkerBuildIdFromFileName");O7(b,Dl);z7();YU();n$();window.addEventListener("load",()=>{pq({pageBuildId:F7(new URL(import.meta.url).pathname)})});var H7=new uf({defaultOptions:{queries:{staleTime:3e4,gcTime:3e5,refetchOnWindowFocus:!0,networkMode:"offlineFirst"},mutations:{networkMode:"always"}}});function V7({children:e}){const{selectedCompany:t}=bt();return(0,a.jsx)(j3,{companyName:t?.name??null,children:e})}r(V7,"CompanyAwareBreadcrumbProvider");var TA=document.getElementById("root");if(!TA)throw new Error("Wardmote root element is missing");q7(window,TA).render((0,a.jsx)(b.StrictMode,{children:(0,a.jsx)(e8,{children:(0,a.jsxs)(L_,{client:H7,children:[(0,a.jsx)(t8,{}),(0,a.jsx)(q3,{children:(0,a.jsx)(O_,{children:(0,a.jsx)(eE,{children:(0,a.jsx)(CE,{children:(0,a.jsx)(VI,{children:(0,a.jsx)(wq,{children:(0,a.jsxs)(aq,{children:[(0,a.jsx)(iq,{}),(0,a.jsx)(yq,{}),(0,a.jsx)(KI,{children:(0,a.jsx)(V7,{children:(0,a.jsx)(zI,{children:(0,a.jsx)(b4,{children:(0,a.jsx)(_O,{children:(0,a.jsx)(oM,{children:(0,a.jsx)(J6,{})})})})})})})]})})})})})})})]})})}));export{pA as $,g0 as $i,cz as $n,_f as $r,CW as $t,rf as A,fT as Aa,DQ as Ai,Vz as An,i4 as Ar,nB as At,XW as B,tT as Ba,EQ as Bi,fC as Bn,VL as Br,k$ as Bt,nG as C,bf as Ca,KQ as Ci,yW as Cn,T0 as Cr,I8 as Ct,l9 as D,hT as Da,zQ as Di,mW as Dn,JQ as Dr,LC as Dt,nk as E,gT as Ea,aj as Ei,aP as En,f4 as Er,N8 as Et,Ig as F,NS as Fa,UQ as Fi,Wd as Fn,eC as Fr,Jl as Ft,GW as G,PM as Gi,Rz as Gn,_0 as Gr,AC as Gt,tG as H,IQ as Hi,Lz as Hn,GN as Hr,ZU as Ht,Tl as I,kS as Ia,rN as Ii,pC as In,GQ as Ir,IW as It,QW as J,EM as Ji,cW as Jn,E0 as Jr,KU as Jt,bA as K,G1 as Ki,Tz as Kn,A0 as Kr,_W as Kt,$q as L,sT as La,NQ as Li,yd as Ln,GL as Lr,TW as Lt,Xq as M,Fh as Ma,HM as Mi,hC as Mn,r4 as Mr,nr as Mt,jA as N,ES as Na,iN as Ni,dW as Nn,XQ as Nr,DW as Nt,s9 as O,pT as Oa,SQ as Oi,sP as On,ic as Or,RB as Ot,yA as P,lT as Pa,OQ as Pi,sg as Pn,ZL as Pr,hg as Pt,FW as Q,B1 as Qi,rC as Qn,k0 as Qr,AW as Qt,WW as R,aT as Ra,AQ as Ri,Rr as Rn,YQ as Rr,RW as Rt,m9 as S,Vh as Sa,sO as Si,wW as Sn,k4 as Sr,F0 as St,o9 as T,qS as Ta,YM as Ti,gC as Tn,eW as Tr,C8 as Tt,YW as U,PQ as Ui,Uz as Un,QN as Ur,fg as Ut,JW as V,LQ as Vi,Oz as Vn,BL as Vr,S$ as Vt,eG as W,VQ as Wi,ag as Wn,I0 as Wr,EW as Wt,VW as X,U1 as Xi,Rf as Xn,C0 as Xr,PU as Xt,Iq as Y,q1 as Yi,oW as Yn,BN as Yr,$U as Yt,Aq as Z,P1 as Zi,Cz as Zn,nL as Zr,NC as Zt,k9 as _,NT as _a,BQ as _i,oP as _n,v4 as _r,LW as _t,L9 as a,yQ as aa,mN as ai,OP as an,Fl as ar,Hr as at,sk as b,kT as ba,GM as bi,jW as bn,y4 as br,$8 as bt,Rg as c,ke as ca,uO as ci,IP as cn,cC as cr,BW as ct,sG as d,DT as da,nN as di,bC as dn,sW as dr,zW as dt,dM as ea,yN as ei,jC as en,lC as er,Sq as et,aG as f,RT as fa,kQ as fi,hW as fn,aW as fr,jg as ft,rG as g,d1 as ga,HQ as gi,gW as gn,A4 as gr,q8 as gt,wA as h,AT as ha,qQ as hi,vW as hn,E4 as hr,PW as ht,hd as i,wf as ia,Ws as ii,LP as in,rW as ir,KW as it,Zq as j,dT as ja,_Q as ji,Hz as jn,ZQ as jr,G$ as jt,i9 as k,mT as ka,CQ as ki,Zz as kn,s4 as kr,_B as kt,R9 as l,MT as la,QQ as li,Wj as ln,Tf as lr,kg as lt,S9 as m,ET as ma,FQ as mi,xC as mn,tW as mr,F8 as mt,oG as n,cM as na,hc as ni,JP as nn,mz as nr,qW as nt,z9 as o,jQ as oa,cO as oi,kW as on,iW as or,JC as ot,iG as p,IT as pa,wQ as pi,pW as pn,nW as pr,UW as pt,Dq as q,zM as qi,uW as qn,xL as qr,BU as qt,h7 as r,Ms as ra,j0 as ri,PP as rn,uC as rr,Ag as rt,M9 as s,jf as sa,b0 as si,SW as sn,lW as sr,$W as st,v7 as t,uM as ta,UN as ti,NW as tn,fz as tr,HW as tt,lG as u,k1 as ua,Ud as ui,CP as un,L4 as ur,G8 as ut,w9 as v,ST as va,TQ as vi,rP as vn,j4 as vr,OW as vt,c9 as w,bT as wa,$Q as wi,fW as wn,p4 as wr,E8 as wt,x9 as x,n1 as xa,RQ as xi,bW as xn,Ij as xr,MW as xt,j9 as y,m0 as ya,FM as yi,xW as yn,w4 as yr,K8 as yt,ZW as z,iQ as za,MQ as zi,$z as zn,WQ as zr,N$ as zt};
|