yepanywhere 0.10.2 → 0.11.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/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts +6 -0
- package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/capability-ids.js +6 -0
- package/bundled/@yep-anywhere/shared/dist/capability-ids.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.d.ts +4 -4
- package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.js +3 -3
- package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/issues.d.ts +16 -0
- package/bundled/@yep-anywhere/shared/dist/issues.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/issues.js +27 -0
- package/bundled/@yep-anywhere/shared/dist/issues.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/project-service.d.ts +12 -0
- package/bundled/@yep-anywhere/shared/dist/project-service.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/project-service.js +56 -0
- package/bundled/@yep-anywhere/shared/dist/project-service.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +50 -50
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +48 -50
- package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.d.ts +6 -0
- package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/types.js +5 -0
- package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/package.json +1 -1
- package/client-dist/assets/{AboutSettings-DnDy6BEd.js → AboutSettings-Ck7P-jDQ.js} +1 -1
- package/client-dist/assets/{ActivityPage-MFWjNC-D.js → ActivityPage-lGdcdJ-e.js} +1 -1
- package/client-dist/assets/{AgentContextSettings-D8g4_T92.js → AgentContextSettings-UprX6zdD.js} +1 -1
- package/client-dist/assets/{AgentsPage-CXHC9oBL.js → AgentsPage-BNPVqFjZ.js} +1 -1
- package/client-dist/assets/App-3o8SyXXM.js +2 -0
- package/client-dist/assets/AppearanceSettings-DMW7A_Rf.js +2 -0
- package/client-dist/assets/{AppsSettings-BPk1YKiU.js → AppsSettings-D9Fdhvnq.js} +1 -1
- package/client-dist/assets/{AttachmentChip-BRmKgPA9.js → AttachmentChip-qYXy0CtC.js} +1 -1
- package/client-dist/assets/{AuthContext-BPHX3zIQ.js → AuthContext-IbT77aGw.js} +1 -1
- package/client-dist/assets/{BangCommandDisplayObject-DpwVa9Ll.js → BangCommandDisplayObject-BOag7vGT.js} +1 -1
- package/client-dist/assets/{BangCommandsPage-B8zpyOBf.js → BangCommandsPage--PeiFzRy.js} +1 -1
- package/client-dist/assets/{BlameBrowser-BLuAT9qK.js → BlameBrowser-DrfV_lH3.js} +1 -1
- package/client-dist/assets/{BrowserDebugToolbarButton-BXfPrxyA.js → BrowserDebugToolbarButton-DhIc8BpN.js} +1 -1
- package/client-dist/assets/{BrowserExtensionSettings-CZ0s6ASb.js → BrowserExtensionSettings-DAMeZFOL.js} +1 -1
- package/client-dist/assets/{CacheMissBillingSettings-ue0Jahu3.js → CacheMissBillingSettings-BW6Nf5ut.js} +1 -1
- package/client-dist/assets/{CodexUpdatePrompt-DXdrlvWV.js → CodexUpdatePrompt-H0-B1yB-.js} +1 -1
- package/client-dist/assets/{CommittedRangeInput-CLkpNnP_.js → CommittedRangeInput-C6In6Q8s.js} +1 -1
- package/client-dist/assets/{CommittedRangeNumberInput-Co1Mkg_Y.js → CommittedRangeNumberInput-DF-kPNGu.js} +1 -1
- package/client-dist/assets/{ConversationPreviewPage-B4Ph-QV7.js → ConversationPreviewPage-CTu-ffV7.js} +1 -1
- package/client-dist/assets/{CopyTextButton-Bpeo8K_-.js → CopyTextButton-oYhSruA8.js} +1 -1
- package/client-dist/assets/{DevelopmentSettings-B3XBUEkp.js → DevelopmentSettings-DGtUr0Qz.js} +1 -1
- package/client-dist/assets/{DevicesSettings-D_iWcxbb.js → DevicesSettings-XMDAT-N4.js} +1 -1
- package/client-dist/assets/{EmulatorPage-B1cu6Lq_.js → EmulatorPage-De0YMKUL.js} +1 -1
- package/client-dist/assets/{EmulatorSettings-nvQEL90Z.js → EmulatorSettings-C5TOwBvn.js} +1 -1
- package/client-dist/assets/{EnvironmentSettings-Ba6izhQj.js → EnvironmentSettings-B1gePTdK.js} +1 -1
- package/client-dist/assets/{FilePage-9Ss6nJ-y.js → FilePage-zx4PfIbF.js} +1 -1
- package/client-dist/assets/FileViewer-D8IcGVo-.js +63 -0
- package/client-dist/assets/{FilterDropdown-D-CDFjqG.js → FilterDropdown-BJ5npFAA.js} +1 -1
- package/client-dist/assets/FloatingActionButton-Dm0404b2.js +1 -0
- package/client-dist/assets/{GitStatusPage-CH31Bai2.js → GitStatusPage-D-4o8YmB.js} +6 -6
- package/client-dist/assets/{GlobalSessionsPage-CgxvBzzy.js → GlobalSessionsPage-DD6UMomT.js} +2 -2
- package/client-dist/assets/{GlossaryContext-PMCo1K6f.js → GlossaryContext-BA5X62Ck.js} +1 -1
- package/client-dist/assets/{HeartbeatTextArea-bCQAiAc-.js → HeartbeatTextArea-ywZAleeh.js} +1 -1
- package/client-dist/assets/{HostIdentityContext-B3FgYv0w.js → HostIdentityContext-_GKYzEQ6.js} +1 -1
- package/client-dist/assets/{HostsPage-BG_bgfeL.js → HostsPage-OGegHtTp.js} +1 -1
- package/client-dist/assets/{InboxContext-BnIIp9cf.js → InboxContext-CZTibzZl.js} +1 -1
- package/client-dist/assets/{InboxPage-D1M26n9s.js → InboxPage-DuvRGWdd.js} +1 -1
- package/client-dist/assets/IssueSettings-BE0SFhgx.js +1 -0
- package/client-dist/assets/IssueSettings-CPOZbMa8.css +1 -0
- package/client-dist/assets/IssuesPage-CA4k5N50.css +1 -0
- package/client-dist/assets/IssuesPage-CWd-GCCG.js +1 -0
- package/client-dist/assets/{LifecycleWebhooksSettings-CaNL4aDT.js → LifecycleWebhooksSettings-bzUj5dsE.js} +1 -1
- package/client-dist/assets/{LocalAccessSettings-7EI7L-wA.js → LocalAccessSettings-DSezlzqb.js} +1 -1
- package/client-dist/assets/LocalMediaModal-DMrKaM1a.js +14 -0
- package/client-dist/assets/LocalSourcePage-Cttx4S9P.js +1 -0
- package/client-dist/assets/{LoginPage-C4023DZw.js → LoginPage-DVf285Ok.js} +1 -1
- package/client-dist/assets/{MarkdownPreview-ClsW_S6S.js → MarkdownPreview-TXbYZwdp.js} +2 -2
- package/client-dist/assets/{MessageAge-B2tHxpYx.js → MessageAge-7FVIZWEv.js} +1 -1
- package/client-dist/assets/MessageDeliverySettings-iykyxRVS.js +4 -0
- package/client-dist/assets/MessageInput-D1epbc4v.js +7 -0
- package/client-dist/assets/{MessageInputToolbar-C79z9qW6.js → MessageInputToolbar-CgXvBkeG.js} +8 -8
- package/client-dist/assets/MessageList-Ce3MvdtI.js +4 -0
- package/client-dist/assets/{MicrophoneIcon-BLs10fC3.js → MicrophoneIcon-Dhu4NCe6.js} +1 -1
- package/client-dist/assets/{Modal-iT2_XPlO.js → Modal-CHNqXAgW.js} +9 -9
- package/client-dist/assets/{ModelSettings-B4fCDCIJ.js → ModelSettings-DBQKdWCg.js} +1 -1
- package/client-dist/assets/{NavigationLayout-BpvrdPoS.js → NavigationLayout-UkQvkodY.js} +1 -1
- package/client-dist/assets/NewSessionForm-Ds5dM9lx.js +9 -0
- package/client-dist/assets/NewSessionPage-BERKMRdN.js +2 -0
- package/client-dist/assets/{NotificationsSettings-I2SS2U9N.js → NotificationsSettings-1RBQorDi.js} +1 -1
- package/client-dist/assets/{PageHeader-Dbb8BZq2.js → PageHeader-DYCnk788.js} +1 -1
- package/client-dist/assets/{PerformanceSettings-Ci8oh2Js.js → PerformanceSettings-CGz5ct-T.js} +1 -1
- package/client-dist/assets/ProjectAppPage-EfNtdwLY.js +1 -0
- package/client-dist/assets/ProjectAppViewer-CRnJGIt-.css +1 -0
- package/client-dist/assets/ProjectAppViewer-slr3FXj4.js +1 -0
- package/client-dist/assets/{ProjectSessionDefaultsModal-D33bQF-Q.js → ProjectSessionDefaultsModal-5yjuvV8S.js} +1 -1
- package/client-dist/assets/{ProjectTemplatesSettings-D8Sr5dDj.js → ProjectTemplatesSettings-DWZfH0JJ.js} +1 -1
- package/client-dist/assets/{ProjectsPage-CIHRcMpx.js → ProjectsPage-BJV93FM-.js} +1 -1
- package/client-dist/assets/{ProviderBadge-DmhZSMRX.js → ProviderBadge-C-UpobLD.js} +1 -1
- package/client-dist/assets/{ProviderChildSessionDetail-D3xbfVZT.js → ProviderChildSessionDetail-CmyTKIwt.js} +3 -3
- package/client-dist/assets/ProviderChildSessionPage-Clp1hlBo.js +1 -0
- package/client-dist/assets/{ProviderSignIn-DRgPyX8J.js → ProviderSignIn-d13WuHAR.js} +1 -1
- package/client-dist/assets/{ProviderSignInPage-ByQPPIRT.js → ProviderSignInPage-CkeyyeWl.js} +1 -1
- package/client-dist/assets/{ProvidersSettings-nHJSxVfC.js → ProvidersSettings-Ddj2J4N2.js} +1 -1
- package/client-dist/assets/{RecapAfterSecondsControl-BsBxbSpd.js → RecapAfterSecondsControl-D_AiWfq1.js} +1 -1
- package/client-dist/assets/{RemoteAccessSettings-Cq_gn76d.js → RemoteAccessSettings-CaE3iqqj.js} +1 -1
- package/client-dist/assets/{RemoteExecutorsSettings-CTRjrID3.js → RemoteExecutorsSettings-snCnHbRp.js} +1 -1
- package/client-dist/assets/{RenderModeContext-CZwSZkSZ.js → RenderModeContext-CuIMXqQV.js} +1 -1
- package/client-dist/assets/{RenderModeGlyph-dL8kAPff.js → RenderModeGlyph-ldDSjj9f.js} +1 -1
- package/client-dist/assets/{RouterPoolSelector-Pmu8xrjx.js → RouterPoolSelector-H3X29mOM.js} +2 -2
- package/client-dist/assets/{SchemaValidationContext-DqOi1YmB.js → SchemaValidationContext-CPr8V317.js} +1 -1
- package/client-dist/assets/{SearchPreview-DIbIaW_4.js → SearchPreview-DvMlCBIp.js} +1 -1
- package/client-dist/assets/{SecureConnection-DwcGBdlV.js → SecureConnection-DeVWJw06.js} +2 -2
- package/client-dist/assets/{SessionHeader.module-Co1boPaC.js → SessionHeader.module-DfkDdP3M.js} +1 -1
- package/client-dist/assets/{SessionMetadataContext-Bfs4TAAj.js → SessionMetadataContext-D0F_4Wp0.js} +1 -1
- package/client-dist/assets/SessionPage-xeog2S54.js +50 -0
- package/client-dist/assets/{SettingsItem-C7eQXUQf.js → SettingsItem-BgyAjvy6.js} +1 -1
- package/client-dist/assets/{SourceControlSettings-D58qSFZm.js → SourceControlSettings-B9T3f2Et.js} +1 -1
- package/client-dist/assets/{SourceFileHeaderActions-DNRytjPK.js → SourceFileHeaderActions-ByzC_I1c.js} +1 -1
- package/client-dist/assets/{SpeechControlMenu-BA2W-shI.js → SpeechControlMenu-Dhkd9fo9.js} +1 -1
- package/client-dist/assets/SpeechSettings-DEZsiCyG.js +2 -0
- package/client-dist/assets/{SpeechSmartTurnControls-DgT6bhA4.js → SpeechSmartTurnControls-BdmFc3C9.js} +1 -1
- package/client-dist/assets/{StorageSettings-DsvbVixL.js → StorageSettings-CiuHgnzi.js} +1 -1
- package/client-dist/assets/{ThinkingControls-Bi0PcWyP.js → ThinkingControls-Bf_4_n66.js} +1 -1
- package/client-dist/assets/ToolbarSettings-DupwvB70.js +1 -0
- package/client-dist/assets/{TrackerStatusBadge-CYRbIvfC.js → TrackerStatusBadge-nbexFcyV.js} +1 -1
- package/client-dist/assets/{UsersSettings-BjSX_kKq.js → UsersSettings-CrGxlDav.js} +1 -1
- package/client-dist/assets/{ViewerModePage-BlsOYFrz.js → ViewerModePage-DCVHfUMc.js} +1 -1
- package/client-dist/assets/ViewerWindowActions-DV5bxAAy.js +1 -0
- package/client-dist/assets/VoiceInputButton-4SbrfhMk.js +1 -0
- package/client-dist/assets/{WorkstreamsPage-B10INHZx.js → WorkstreamsPage-CUsI5c-n.js} +1 -1
- package/client-dist/assets/YaServerProvider-Dt9IBXDZ.js +31 -0
- package/client-dist/assets/{YepAnywhereLogo-CIpZ5dke.js → YepAnywhereLogo-ccRUdgT-.js} +1 -1
- package/client-dist/assets/{abnfDiagram-VCTEODGH-sCU1nPAM.js → abnfDiagram-VCTEODGH-Dysqh90e.js} +1 -1
- package/client-dist/assets/{arc-DjiGPMMi.js → arc-BfmRVkD-.js} +1 -1
- package/client-dist/assets/{architectureDiagram-5GKGNRK7-3RzD-zEy.js → architectureDiagram-5GKGNRK7-Bp1GI0XP.js} +1 -1
- package/client-dist/assets/{attachmentFileNames-clPM_F1w.js → attachmentFileNames-CGZzPAjE.js} +1 -1
- package/client-dist/assets/{blockDiagram-I7D4REHJ-BU6A9-4i.js → blockDiagram-I7D4REHJ-9vaOU_YP.js} +1 -1
- package/client-dist/assets/{browserTab-BXElY_d5.js → browserTab-CLF9iteD.js} +1 -1
- package/client-dist/assets/{c4Diagram-7LVT6UL2-CxusgaWH.js → c4Diagram-7LVT6UL2-Cj9qrKnL.js} +1 -1
- package/client-dist/assets/channel-Bx4xMN3u.js +1 -0
- package/client-dist/assets/{chunk-2Q5K7J3B-CBi0JNQU.js → chunk-2Q5K7J3B-DD_50QMk.js} +1 -1
- package/client-dist/assets/{chunk-5VM5RSS4-CskSgDiX.js → chunk-5VM5RSS4-Ba0GJEZb.js} +1 -1
- package/client-dist/assets/{chunk-F27PBJKO-Dl65caQS.js → chunk-F27PBJKO-D3_CXW_b.js} +1 -1
- package/client-dist/assets/{chunk-IMKFNOWR-BHAs2B4i.js → chunk-IMKFNOWR-Bx7Jus4R.js} +1 -1
- package/client-dist/assets/{chunk-JWPE2WC7-CRWKI8Z7.js → chunk-JWPE2WC7-1B1j7YcM.js} +1 -1
- package/client-dist/assets/{chunk-POPQ4Y6H-CzdOCWYO.js → chunk-POPQ4Y6H-CgMmmF_H.js} +1 -1
- package/client-dist/assets/{chunk-SVP7TREG-DxoiR2Mk.js → chunk-SVP7TREG-DDSE5Wq6.js} +1 -1
- package/client-dist/assets/{chunk-TICWLB2K-cve5023y.js → chunk-TICWLB2K-DUZGu3ce.js} +1 -1
- package/client-dist/assets/{chunk-XXDRQBXY-mSd5ZgMm.js → chunk-XXDRQBXY-oJdOaI50.js} +1 -1
- package/client-dist/assets/classDiagram-ZZMXUADV-CTAikA-f.js +1 -0
- package/client-dist/assets/classDiagram-v2-VYDZK3BY-CTAikA-f.js +1 -0
- package/client-dist/assets/{clientSummaryStore-Cr4yWo-Y.js → clientSummaryStore-Dsgo1zWK.js} +1 -1
- package/client-dist/assets/{compactSettingsControls-BI6RhVII.js → compactSettingsControls-CgeiII5J.js} +1 -1
- package/client-dist/assets/{cose-bilkent-JH36ORCC-CoI7dvL-.js → cose-bilkent-JH36ORCC-CQKgCYKk.js} +1 -1
- package/client-dist/assets/{cynefin-OW5HDTMX-B6We6WUI.js → cynefin-OW5HDTMX-S85H965d.js} +1 -1
- package/client-dist/assets/{cynefinDiagram-5FMLGOSQ-BUzaWybE.js → cynefinDiagram-5FMLGOSQ-B4ri3nX3.js} +1 -1
- package/client-dist/assets/{dagre-GXQ25YYZ-BYhpPlP3.js → dagre-GXQ25YYZ-DoQhim_k.js} +1 -1
- package/client-dist/assets/{diagram-S7CK7UJ4-FkUIxzy0.js → diagram-S7CK7UJ4-DYy2x0Ta.js} +1 -1
- package/client-dist/assets/{diagram-UQ7AKVKN-B0_3U7US.js → diagram-UQ7AKVKN-DxCcDSWg.js} +1 -1
- package/client-dist/assets/{diagram-VSXAHHWV-DNF_DVVi.js → diagram-VSXAHHWV-tDbIkKUf.js} +1 -1
- package/client-dist/assets/{diagram-VX7I27RA-DgeEEgTw.js → diagram-VX7I27RA-Qdg9iySG.js} +1 -1
- package/client-dist/assets/{diagram-Z3DM3KII-S5soWFl_.js → diagram-Z3DM3KII-BTpWBWAH.js} +1 -1
- package/client-dist/assets/{ebnfDiagram-PWID7BFC-kfLCEtAi.js → ebnfDiagram-PWID7BFC-DBHufTpw.js} +1 -1
- package/client-dist/assets/{erDiagram-RLTQ6QDP-xI7CqDO3.js → erDiagram-RLTQ6QDP-DGkKs4b_.js} +1 -1
- package/client-dist/assets/{flowDiagram-HODETNUW-CVSTa2nO.js → flowDiagram-HODETNUW-DVKc1wL6.js} +1 -1
- package/client-dist/assets/{frontendReload-54GeNGj9.js → frontendReload-B4jfUIeG.js} +1 -1
- package/client-dist/assets/{ganttDiagram-EL5Y4UJY-CI03o3Me.js → ganttDiagram-EL5Y4UJY-lIq_NgbX.js} +1 -1
- package/client-dist/assets/{gitGraphDiagram-WWUBYQGX-BlnPaeW9.js → gitGraphDiagram-WWUBYQGX-BjX5H3_l.js} +1 -1
- package/client-dist/assets/index-BSMD-gHP.js +1 -0
- package/client-dist/assets/index-BhTv6hAY.js +64 -0
- package/client-dist/assets/{index-DrKoeozX.js → index-CdtGIhcy.js} +1 -1
- package/client-dist/assets/{index-1dMuvv06.js → index-DjQ2chjT.js} +1 -1
- package/client-dist/assets/{index-DvjdkG8Q.js → index-DnFlh5Zf.js} +2 -2
- package/client-dist/assets/{infoDiagram-27XIBGKW-C7GxDcfT.js → infoDiagram-27XIBGKW-BRxpTbKN.js} +1 -1
- package/client-dist/assets/{ishikawaDiagram-5VMMS53U-DBZVNUMP.js → ishikawaDiagram-5VMMS53U-BXr5zlby.js} +1 -1
- package/client-dist/assets/{journeyDiagram-3NMN7TZE-CT3nDRx4.js → journeyDiagram-3NMN7TZE-BO5vc5JN.js} +1 -1
- package/client-dist/assets/{kanban-definition-UXKFOSKX-Dgns21Ky.js → kanban-definition-UXKFOSKX-FJ2uF-MR.js} +1 -1
- package/client-dist/assets/{layout-CCGb-lVs.js → layout-BQ-_ERR1.js} +1 -1
- package/client-dist/assets/{limitedUserBrowserDefaults-C6cuD-wF.js → limitedUserBrowserDefaults-CwcMxPe5.js} +1 -1
- package/client-dist/assets/{limitedUserDefaultsClient-BPifr9h5.js → limitedUserDefaultsClient-CLg4zzsz.js} +1 -1
- package/client-dist/assets/{linear-BO4yAkdf.js → linear-BwwPzSrY.js} +1 -1
- package/client-dist/assets/{long-context-effort-warning-By1TxT0F.js → long-context-effort-warning-ims8_Hv4.js} +1 -1
- package/client-dist/assets/main-BX4yZXDF.js +43 -0
- package/client-dist/assets/mermaid.core-D26C4xkK.js +312 -0
- package/client-dist/assets/micTitleActivity-yQ5HgRnF.js +1 -0
- package/client-dist/assets/{mindmap-definition-YA3MSWOX-W-bMySj1.js → mindmap-definition-YA3MSWOX-Bv_gNy8_.js} +1 -1
- package/client-dist/assets/{newSessionPrefill-CHZfBHqQ.js → newSessionPrefill-BC5a8IpP.js} +1 -1
- package/client-dist/assets/{pegDiagram-XKGWAZYB-BMSL3Swk.js → pegDiagram-XKGWAZYB-CBB23R00.js} +1 -1
- package/client-dist/assets/{permissionModes-DJvRe3vP.js → permissionModes-C5_i_UDc.js} +1 -1
- package/client-dist/assets/{pieDiagram-E7YTZNPT-fzcyJjCG.js → pieDiagram-E7YTZNPT-C0uC29fl.js} +1 -1
- package/client-dist/assets/{quadrantDiagram-AXDQQJYC-EQecMBLb.js → quadrantDiagram-AXDQQJYC-BYcINwOa.js} +1 -1
- package/client-dist/assets/{railroadDiagram-O6MQD6OU-DvY2buxp.js → railroadDiagram-O6MQD6OU-DwLq6WlM.js} +1 -1
- package/client-dist/assets/{recentProjectPathLinks-Km2YzBV7.js → recentProjectPathLinks-Bp8ZFFVQ.js} +1 -1
- package/client-dist/assets/{registerServiceWorker-DvFS41on.js → registerServiceWorker-BEwfu1re.js} +1 -1
- package/client-dist/assets/{remoteRoutePaths-Crh_32jX.js → remoteRoutePaths-DpabBbC6.js} +1 -1
- package/client-dist/assets/{requirementDiagram-BXWQKSXE-CIdu0GYt.js → requirementDiagram-BXWQKSXE-H7ltzzju.js} +1 -1
- package/client-dist/assets/{sankeyDiagram-P5KCCOFB-BzupSIep.js → sankeyDiagram-P5KCCOFB-DQ_BH-ec.js} +1 -1
- package/client-dist/assets/{sequenceDiagram-WJ2MYXX4-BCz8DLSg.js → sequenceDiagram-WJ2MYXX4-CE5cJN0V.js} +1 -1
- package/client-dist/assets/{sessionNavigationState-pHYi3UxP.js → sessionNavigationState-nTMUDlwU.js} +1 -1
- package/client-dist/assets/sessionVhostApps-DbEDY32Q.js +1 -0
- package/client-dist/assets/{sessionViewerController-BKTu5sj-.js → sessionViewerController-BGKUu-Zg.js} +1 -1
- package/client-dist/assets/{sessionViewerPlacement-D4lCtx-b.js → sessionViewerPlacement-cjpznhMG.js} +1 -1
- package/client-dist/assets/{sizeCapture-INFHLROL-nGK4qjL2.js → sizeCapture-INFHLROL-DTs5ZL4J.js} +1 -1
- package/client-dist/assets/{sourceControlNavigationState-B1jkV2pd.js → sourceControlNavigationState-D8WJCFc_.js} +1 -1
- package/client-dist/assets/{sourceTransportPaths-COX454wy.js → sourceTransportPaths-BTR7eFi5.js} +1 -1
- package/client-dist/assets/{speechDraftTransaction-cFbNnQHh.js → speechDraftTransaction-Bn7ppW5b.js} +1 -1
- package/client-dist/assets/{stateDiagram-D77RDMKH-CFix9P5-.js → stateDiagram-D77RDMKH-CGP-PcgJ.js} +1 -1
- package/client-dist/assets/stateDiagram-v2-MP3YSRHH-BeSd02wx.js +1 -0
- package/client-dist/assets/{swimlanes-42K2YHIH-3cL-IerY.js → swimlanes-42K2YHIH-BUyuyk1Q.js} +1 -1
- package/client-dist/assets/swimlanesDiagram-VR7AAH4N-DJ-GHCq1.js +8 -0
- package/client-dist/assets/{timeline-definition-24CTP7MA-Cc4302bU.js → timeline-definition-24CTP7MA-CbhEbRKF.js} +1 -1
- package/client-dist/assets/{uiTrace-DGW4HhGn.js → uiTrace-CvAgW12D.js} +1 -1
- package/client-dist/assets/{useAcliCommentarySetting-Br7kBvtE.js → useAcliCommentarySetting-B9uDJlBW.js} +1 -1
- package/client-dist/assets/{useActivityBusState-CzYhbKlD.js → useActivityBusState-CJk1MiYW.js} +1 -1
- package/client-dist/assets/{useAttachmentUploadQuality-B_kWKCMo.js → useAttachmentUploadQuality-Bx88B-aj.js} +1 -1
- package/client-dist/assets/{useBackgroundRevalidation-BpXlX3fs.js → useBackgroundRevalidation-SUxysljm.js} +1 -1
- package/client-dist/assets/{useCodexUpdateStatus-w-5NajaG.js → useCodexUpdateStatus-CihSrx5C.js} +1 -1
- package/client-dist/assets/{useComposerPromptRail-DL5r3CAD.js → useComposerPromptRail-DcRpLRmu.js} +1 -1
- package/client-dist/assets/{useConnectedDevices-BJILFKIz.js → useConnectedDevices-Ciuv3J4o.js} +1 -1
- package/client-dist/assets/useDocumentTitle-wGc9OsUg.js +1 -0
- package/client-dist/assets/{useEmulators-cGrsK5mh.js → useEmulators-CQCzysEZ.js} +1 -1
- package/client-dist/assets/{useFileActivity-Y1m-dClR.js → useFileActivity-CpuLfNl9.js} +1 -1
- package/client-dist/assets/{useFloatingActionButtonEnabled-CgWMCFmO.js → useFloatingActionButtonEnabled-BKJ8RfOu.js} +1 -1
- package/client-dist/assets/{useForkSummaryAutoOpen-qfV9Dgsp.js → useForkSummaryAutoOpen-DRGGsQgo.js} +1 -1
- package/client-dist/assets/useGeneratedTitleLength-R5Q60VSi.js +1 -0
- package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-DXTp5fUz.js → useKeepMobileKeyboardOpenAfterDelivery-DXMbsQWe.js} +1 -1
- package/client-dist/assets/{useLiveToolOutputEnabled-rQskgO0g.js → useLiveToolOutputEnabled-Qb_QFuzk.js} +1 -1
- package/client-dist/assets/{useModelSettings-DMjdRGMd.js → useModelSettings-BSbgwkL8.js} +1 -1
- package/client-dist/assets/{useNotifyInApp-BBmQnbh7.js → useNotifyInApp-BucZAqVF.js} +1 -1
- package/client-dist/assets/{useOnboarding-CF1WDG2d.js → useOnboarding-BzoWTXrR.js} +1 -1
- package/client-dist/assets/{usePanelSlideAnimations-C5qJWoVe.js → usePanelSlideAnimations-XdQhGgr-.js} +1 -1
- package/client-dist/assets/{useProjectAppComposing-C8gaOUg9.js → useProjectAppComposing-DBPyVUba.js} +1 -1
- package/client-dist/assets/{useProjectTemplateChoices-C0Uxthrq.js → useProjectTemplateChoices-niJIV5HQ.js} +1 -1
- package/client-dist/assets/{useProviders-B7fACEDA.js → useProviders-B54BXYv3.js} +1 -1
- package/client-dist/assets/{useQuestionAsideSetting-CR1M9_u6.js → useQuestionAsideSetting-CILJe25J.js} +1 -1
- package/client-dist/assets/{useRecentSessions-DBXvckSG.js → useRecentSessions-CQJcnOeU.js} +1 -1
- package/client-dist/assets/{useRelativeNow-B7XFLfKm.js → useRelativeNow-C2ME3OxV.js} +1 -1
- package/client-dist/assets/{useReloadNotifications-D2NJM_v_.js → useReloadNotifications-PKjb8H55.js} +1 -1
- package/client-dist/assets/{useRemoteExecutors-j1cpFGnw.js → useRemoteExecutors-CMd01rZ7.js} +1 -1
- package/client-dist/assets/{useSearchConcurrency-DlrPqVlr.js → useSearchConcurrency-BIVnIche.js} +1 -1
- package/client-dist/assets/useSessionRightPaneSetting-C5YgsyBy.js +1 -0
- package/client-dist/assets/{useSidebarWidth-DnB-wKom.js → useSidebarWidth-op0qbgd4.js} +1 -1
- package/client-dist/assets/{useSourceControlCleanLanding-ByQI1cWZ.js → useSourceControlCleanLanding-BE8h6VMD.js} +1 -1
- package/client-dist/assets/{useStableToolPreviewRendering-DtPpSoyX.js → useStableToolPreviewRendering-Bdiaz4I5.js} +1 -1
- package/client-dist/assets/{useTabTitleActivityPreference-DH0VanNM.js → useTabTitleActivityPreference-ZJ19N5_Q.js} +1 -1
- package/client-dist/assets/{useVhostAccess-D6l6YouM.js → useVhostAccess-CttxSyIC.js} +1 -1
- package/client-dist/assets/{useWorkflowTags-5i3ohGrH.js → useWorkflowTags-CsPhaG2p.js} +1 -1
- package/client-dist/assets/{vennDiagram-4TSXK5OY-BJaUYJ8y.js → vennDiagram-4TSXK5OY-DkXe2h8B.js} +1 -1
- package/client-dist/assets/{wardleyDiagram-VM6X3IG4-DEgI0m1V.js → wardleyDiagram-VM6X3IG4-BnBGhOBQ.js} +1 -1
- package/client-dist/assets/{xychartDiagram-S5SC5T6Z-BuAw5_xn.js → xychartDiagram-S5SC5T6Z-Bxkl9DZJ.js} +1 -1
- package/client-dist/index.html +3 -3
- package/client-dist/sw.js +2 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +10 -2
- package/dist/app.js.map +1 -1
- package/dist/artifacts/ArtifactServer.d.ts.map +1 -1
- package/dist/artifacts/ArtifactServer.js +3 -20
- package/dist/artifacts/ArtifactServer.js.map +1 -1
- package/dist/artifacts/ProjectAppDelivery.d.ts.map +1 -1
- package/dist/artifacts/ProjectAppDelivery.js +31 -1
- package/dist/artifacts/ProjectAppDelivery.js.map +1 -1
- package/dist/artifacts/pdfInFrame.d.ts +17 -0
- package/dist/artifacts/pdfInFrame.d.ts.map +1 -0
- package/dist/artifacts/pdfInFrame.js +30 -0
- package/dist/artifacts/pdfInFrame.js.map +1 -0
- package/dist/projects/ProjectAppStore.d.ts +0 -1
- package/dist/projects/ProjectAppStore.d.ts.map +1 -1
- package/dist/projects/ProjectServiceManager.d.ts +88 -0
- package/dist/projects/ProjectServiceManager.d.ts.map +1 -1
- package/dist/projects/ProjectServiceManager.js +4 -2
- package/dist/projects/ProjectServiceManager.js.map +1 -1
- package/dist/projects/template-runtime.d.ts +5 -0
- package/dist/projects/template-runtime.d.ts.map +1 -1
- package/dist/projects/template-runtime.js +3 -1
- package/dist/projects/template-runtime.js.map +1 -1
- package/dist/routes/issue-content.d.ts +6 -0
- package/dist/routes/issue-content.d.ts.map +1 -0
- package/dist/routes/issue-content.js +25 -0
- package/dist/routes/issue-content.js.map +1 -0
- package/dist/routes/issues.d.ts +2 -1
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +34 -4
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/project-app.d.ts.map +1 -1
- package/dist/routes/project-app.js +27 -2
- package/dist/routes/project-app.js.map +1 -1
- package/dist/routes/project-creation.d.ts +7 -0
- package/dist/routes/project-creation.d.ts.map +1 -1
- package/dist/routes/project-creation.js +12 -0
- package/dist/routes/project-creation.js.map +1 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +33 -11
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +2 -0
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/speech.d.ts.map +1 -1
- package/dist/routes/speech.js +3 -1
- package/dist/routes/speech.js.map +1 -1
- package/dist/routes/version.d.ts.map +1 -1
- package/dist/routes/version.js +1 -0
- package/dist/routes/version.js.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.d.ts +12 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.js +3 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationInputImage.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts +10 -2
- package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpServerStatus.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpServerStatus.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts +7 -2
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts +8 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnSteerParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex.d.ts +10 -0
- package/dist/sdk/providers/codex.d.ts.map +1 -1
- package/dist/sdk/providers/codex.js +33 -3
- package/dist/sdk/providers/codex.js.map +1 -1
- package/dist/services/RendezWatchService.d.ts +3 -0
- package/dist/services/RendezWatchService.d.ts.map +1 -1
- package/dist/services/RendezWatchService.js +6 -0
- package/dist/services/RendezWatchService.js.map +1 -1
- package/dist/services/issues/IssueStore.d.ts +24 -0
- package/dist/services/issues/IssueStore.d.ts.map +1 -1
- package/dist/services/issues/IssueStore.js +67 -11
- package/dist/services/issues/IssueStore.js.map +1 -1
- package/dist/services/issues/confirm.d.ts.map +1 -1
- package/dist/services/issues/confirm.js +37 -3
- package/dist/services/issues/confirm.js.map +1 -1
- package/dist/services/issues/content.d.ts +36 -0
- package/dist/services/issues/content.d.ts.map +1 -0
- package/dist/services/issues/content.js +328 -0
- package/dist/services/issues/content.js.map +1 -0
- package/dist/services/issues/status.d.ts.map +1 -1
- package/dist/services/issues/status.js +12 -4
- package/dist/services/issues/status.js.map +1 -1
- package/dist/services/rendezSessions.d.ts +2 -1
- package/dist/services/rendezSessions.d.ts.map +1 -1
- package/dist/services/rendezSessions.js +17 -3
- package/dist/services/rendezSessions.js.map +1 -1
- package/dist/sessions/codex-reader.d.ts.map +1 -1
- package/dist/sessions/codex-reader.js +9 -2
- package/dist/sessions/codex-reader.js.map +1 -1
- package/dist/sessions/codex-rollout-window.d.ts +2 -0
- package/dist/sessions/codex-rollout-window.d.ts.map +1 -1
- package/dist/sessions/codex-rollout-window.js +1 -0
- package/dist/sessions/codex-rollout-window.js.map +1 -1
- package/dist/storage/discovery-sqlite.d.ts.map +1 -1
- package/dist/storage/discovery-sqlite.js +2 -0
- package/dist/storage/discovery-sqlite.js.map +1 -1
- package/dist/storage/migrations/012-issue-content.d.ts +3 -0
- package/dist/storage/migrations/012-issue-content.d.ts.map +1 -0
- package/dist/storage/migrations/012-issue-content.js +14 -0
- package/dist/storage/migrations/012-issue-content.js.map +1 -0
- package/dist/supervisor/Process.d.ts +10 -1
- package/dist/supervisor/Process.d.ts.map +1 -1
- package/dist/supervisor/Process.js +22 -0
- package/dist/supervisor/Process.js.map +1 -1
- package/package.json +5 -5
- package/client-dist/assets/App-BIHEvA6Q.js +0 -2
- package/client-dist/assets/AppearanceSettings-CDplyLIJ.js +0 -2
- package/client-dist/assets/FileViewer-Crw6E_2M.js +0 -63
- package/client-dist/assets/FloatingActionButton-BMjNa4vb.js +0 -1
- package/client-dist/assets/IssueSettings-BLIuCNxO.css +0 -1
- package/client-dist/assets/IssueSettings-Dr6JKfQf.js +0 -1
- package/client-dist/assets/IssuesPage-DOfq79D-.css +0 -1
- package/client-dist/assets/IssuesPage-QmPw-DCB.js +0 -1
- package/client-dist/assets/LocalMediaModal-5au-Ku3n.js +0 -14
- package/client-dist/assets/LocalSourcePage-YurHSY4M.js +0 -1
- package/client-dist/assets/MessageDeliverySettings-D2fzmys9.js +0 -4
- package/client-dist/assets/MessageInput-BUZmOeKI.js +0 -7
- package/client-dist/assets/MessageList-CJgDrWOy.js +0 -4
- package/client-dist/assets/NewSessionForm-4104gBMd.js +0 -9
- package/client-dist/assets/NewSessionPage-AzsvU8Mk.js +0 -2
- package/client-dist/assets/ProjectAppPage-CoxqMJ-6.js +0 -1
- package/client-dist/assets/ProjectAppViewer-D5Juq0Mx.css +0 -1
- package/client-dist/assets/ProjectAppViewer-D_8Lq6Oy.js +0 -1
- package/client-dist/assets/ProviderChildSessionPage-CrSrF2ST.js +0 -1
- package/client-dist/assets/SessionPage-DjR-n2cx.js +0 -50
- package/client-dist/assets/SpeechSettings-CObFsnUu.js +0 -2
- package/client-dist/assets/ToolbarSettings-CyhCBLrg.js +0 -1
- package/client-dist/assets/ViewerWindowActions-DM1Jwlo9.js +0 -1
- package/client-dist/assets/VoiceInputButton-jq6m-rwS.js +0 -1
- package/client-dist/assets/YaServerProvider-fGtUHCJb.js +0 -1
- package/client-dist/assets/channel-BMLLCpix.js +0 -1
- package/client-dist/assets/classDiagram-ZZMXUADV-CriLRYaG.js +0 -1
- package/client-dist/assets/classDiagram-v2-VYDZK3BY-CriLRYaG.js +0 -1
- package/client-dist/assets/index-C-4wHkcA.js +0 -46
- package/client-dist/assets/index-D73NQkRu.js +0 -1
- package/client-dist/assets/main-BpQ_EIjC.js +0 -43
- package/client-dist/assets/mermaid.core-CnOzO4__.js +0 -312
- package/client-dist/assets/sessionVhostApps-DJY4ZLda.js +0 -1
- package/client-dist/assets/stateDiagram-v2-MP3YSRHH-D-_jRHCc.js +0 -1
- package/client-dist/assets/swimlanesDiagram-VR7AAH4N-CMY1RzMZ.js +0 -8
- package/client-dist/assets/useDocumentTitle-CeauK1Xu.js +0 -1
- package/client-dist/assets/useGeneratedTitleLength-0cRz1f9b.js +0 -1
- package/client-dist/assets/useSessionRightPaneSetting-BOgcH2kB.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var on=Object.defineProperty;var rn=(e,s,n)=>s in e?on(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n;var Et=(e,s,n)=>rn(e,typeof s!="symbol"?s+"":s,n);import{j as t,r as a,b as Ps,a4 as ls,a5 as cn,d as ln}from"./clientSummaryStore-Cr4yWo-Y.js";import{u as Qt,d as Jt,t as Ls,c as de,U as Fs,w as vt,bm as un,L as Ms,e as $t,b as Ot}from"./main-BpQ_EIjC.js";import{P as dn}from"./PageHeader-Dbb8BZq2.js";import{C as Zt,m as us,j as Xt,d as _t,F as ds,G as As,n as Ds,i as hn,o as mn,p as wt,q as $s,t as fn,v as pn,w as gn,x as xn,y as bn,z as Sn,A as vn}from"./FileViewer-Crw6E_2M.js";import{n as Os,u as _n,a as wn}from"./NavigationLayout-BpvrdPoS.js";import{u as It,M as yt,d as yn,e as jn}from"./Modal-iT2_XPlO.js";import{q as hs,u as es,v as Ft,S as Mt,G as ms}from"./GlossaryContext-PMCo1K6f.js";import{u as Cn}from"./useDocumentTitle-CeauK1Xu.js";import{c as Nn}from"./usePanelSlideAnimations-C5qJWoVe.js";import{F as kn,S as Pt,a as ts,b as ss,c as ns,d as Is,s as Rn,e as gt,f as Bs,u as as,R as Us,g as En,h as fs,i as Tn,P as ps,B as Hs}from"./BlameBrowser-BLuAT9qK.js";import{r as Pn,s as gs}from"./useSidebarWidth-DnB-wKom.js";import{u as Ln}from"./useRelativeNow-B7XFLfKm.js";import{u as Fn}from"./useSourceControlCleanLanding-ByQI1cWZ.js";import{MainContent as Mn}from"./index-D73NQkRu.js";import{a as Gs}from"./appHref-ByaEnJGJ.js";import{p as An}from"./sourceControlNavigationState-B1jkV2pd.js";import{S as qs}from"./SourceFileHeaderActions-DNRytjPK.js";import{a as Dn}from"./frontendReload-54GeNGj9.js";import{u as $n,g as On,b as In}from"./useProviders-B7fACEDA.js";import{s as Ee,G as Bn,b5 as Un,z as Hn,b6 as Gn,b7 as qn,y as Kn,b8 as Wn,b9 as zn,ba as Vn,bb as Yn,bc as Qn,bd as Jn,be as Zn,bf as Xn,bg as ea,bh as ta}from"./index-C-4wHkcA.js";import"./react-runtime-D-UPQ57m.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-Co1boPaC.js";import"./HostIdentityContext-B3FgYv0w.js";import"./sourceTransportPaths-COX454wy.js";import"./SessionMetadataContext-Bfs4TAAj.js";import"./LocalMediaModal-5au-Ku3n.js";import"./ViewerWindowActions-DM1Jwlo9.js";import"./sessionVhostApps-DJY4ZLda.js";import"./newSessionPrefill-CHZfBHqQ.js";import"./relay-url-j3kYm5KO.js";import"./sessionViewerController-BKTu5sj-.js";import"./sessionViewerPlacement-D4lCtx-b.js";import"./useSessionRightPaneSetting-BOgcH2kB.js";import"./MarkdownPreview-ClsW_S6S.js";import"./RenderModeGlyph-dL8kAPff.js";import"./katex-DLorvT8M.js";import"./RenderModeContext-CZwSZkSZ.js";import"./uiTrace-DGW4HhGn.js";import"./CopyTextButton-Bpeo8K_-.js";import"./useFileActivity-Y1m-dClR.js";import"./remoteRoutePaths-Crh_32jX.js";import"./ProviderBadge-DmhZSMRX.js";import"./YepAnywhereLogo-CIpZ5dke.js";const sa="_message_1naoy_1",na="_success_1naoy_10",aa="_warning_1naoy_16",oa="_hint_1naoy_22",ia="_details_1naoy_26",ra="_output_1naoy_35",ca="_copy_1naoy_51",ot={message:sa,success:na,warning:aa,hint:oa,details:ia,output:ra,copy:ca};function la({message:e,tone:s,failure:n}){const{t:o}=Qt();return t.jsxs("div",{className:`${ot.message} ${s==="warning"?ot.warning:ot.success}`,role:s==="warning"?"alert":"status",children:[t.jsx("div",{children:e}),(n==null?void 0:n.hint)&&t.jsx("p",{className:ot.hint,children:n.hint}),(n==null?void 0:n.detail)&&t.jsxs("details",{className:ot.details,children:[t.jsx("summary",{children:o("gitStatusErrorDetails")}),t.jsxs("div",{className:ot.output,children:[t.jsx(Zt,{value:n.detail,title:o("gitStatusCopyErrorDetails"),className:ot.copy}),t.jsx("pre",{children:n.detail})]})]},n.detail)]})}const ua="_container_1464z_23",da="_button_1464z_31",ha="_text_1464z_51",ma="_chevron_1464z_66",fa="_dropdown_1464z_77",pa="_options_1464z_91",ga="_option_1464z_91",xa="_selected_1464z_114",ba="_name_1464z_118",Sa="_meta_1464z_126",va="_overlay_1464z_132",_a="_sheet_1464z_142",wa="_header_1464z_162",ya="_title_1464z_167",$e={container:ua,button:da,text:ha,chevron:ma,dropdown:fa,options:pa,option:ga,selected:xa,name:ba,meta:Sa,overlay:va,sheet:_a,header:wa,title:ya},xs=769;function ja({currentProjectId:e,currentProjectName:s,onProjectChange:n}){const{t:o}=Qt(),[i,r]=a.useState(!1),[h,l]=a.useState(()=>window.innerWidth>=xs),u=a.useRef(null),p=a.useRef(null),b=Jt(),v=It(),{projects:j,loading:S}=Os(),g=j.find(y=>y.id===e),N=g?hs(g):s??o("projectSelectorFallback"),x=()=>{var y;(y=u.current)==null||y.blur(),r(!0)},f=y=>{y.id!==e&&(n?n(y):b(`${v}/new-session?projectId=${encodeURIComponent(y.id)}`)),r(!1)},m=a.useCallback(()=>{r(!1)},[]);a.useEffect(()=>{const y=()=>{l(window.innerWidth>=xs)};return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]),a.useEffect(()=>{if(!i)return;const y=B=>{B.key==="Escape"&&(B.preventDefault(),B.stopPropagation(),m())};return document.addEventListener("keydown",y,!0),()=>document.removeEventListener("keydown",y,!0)},[i,m]),a.useEffect(()=>{if(!i||!h)return;const y=B=>{p.current&&!p.current.contains(B.target)&&u.current&&!u.current.contains(B.target)&&m()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i,h,m]),a.useEffect(()=>{if(i&&!h)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[i,h]),a.useEffect(()=>{var y;i&&((y=p.current)==null||y.focus())},[i]);const M=y=>{y.target===y.currentTarget&&(y.preventDefault(),y.stopPropagation(),m())};if(!S&&j.length<=1)return t.jsx("span",{className:"session-title",children:N});const C=t.jsx("div",{className:$e.options,children:j.map(y=>{const B=y.id===e;return t.jsxs("button",{type:"button",className:`${$e.option} ${B?$e.selected:""}`,onClick:()=>f(y),children:[t.jsx("span",{className:$e.name,children:hs(y)}),t.jsx("span",{className:$e.meta,children:o("projectSelectorSessionsCount",{count:y.sessionCount})})]},y.id)})}),w=i&&!h?Ls.createPortal(t.jsx("div",{className:$e.overlay,onClick:M,onMouseDown:y=>y.stopPropagation(),children:t.jsxs("div",{ref:p,className:$e.sheet,role:"dialog",tabIndex:-1,"aria-label":o("projectSelectorSelectProject"),children:[t.jsx("div",{className:$e.header,children:t.jsx("span",{className:$e.title,children:o("projectSelectorSelectProject")})}),C]})}),document.body):null,_=i&&h?t.jsx("div",{ref:p,className:$e.dropdown,role:"dialog",tabIndex:-1,"aria-label":o("projectSelectorSelectProject"),children:C}):null;return t.jsxs("div",{className:`project-selector-container ${$e.container}`,children:[t.jsxs("button",{ref:u,type:"button",className:`project-selector-button ${$e.button}`,onClick:x,title:o("projectSelectorChangeProject"),"aria-haspopup":"listbox","aria-expanded":i,children:[t.jsx("span",{className:`project-selector-text ${$e.text}`,children:N}),t.jsx("svg",{className:$e.chevron,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),_,w]})}function Ca(){return document.visibilityState==="visible"&&document.hasFocus()}function Na(e){return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),window.addEventListener("blur",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e),window.removeEventListener("blur",e)}}function ka(){return a.useSyncExternalStore(Na,Ca,()=>!1)}function Lt(e){return e.replace(/(https?:\/\/)[^\s/"'<>]*@/gi,"$1[redacted]@").replace(/([?&](?:access_token|token|password|secret|api_key)=)[^\s&"'<>]*/gi,"$1[redacted]").replace(/(Authorization:\s*(?:Basic|Bearer)\s+)\S+/gi,"$1[redacted]").trim()}function Ks(e,s){var r;const n=Lt(e??"");let o=null,i=null;if(/permission denied \([^)]*publickey[^)]*\)/i.test(n))o=s("gitStatusErrorSshAuth"),i=s("gitStatusErrorSshAuthHint");else if(/bad (?:owner or permissions|permissions)/i.test(n))o=s("gitStatusErrorSshPermissions"),i=s("gitStatusErrorSshPermissionsHint");else if(/https?:\/\//i.test(n)&&/authentication failed|could not read (?:username|password)|invalid (?:username|password|credentials)|password authentication is not supported/i.test(n))o=s("gitStatusErrorHttpsAuth"),i=s("gitStatusErrorHttpsAuthHint");else if(/authentication failed/i.test(n))o=s("gitStatusErrorAuth"),i=s("gitStatusErrorAuthHint");else if(/timed?\s*out|\btimeout\b|ETIMEDOUT/i.test(n)){const h=(r=/Git operation timed out after (\d+(?:\.\d+)?) seconds\./i.exec(n))==null?void 0:r[1];o=h?s("gitStatusErrorTimeoutSeconds",{seconds:h}):s("gitStatusErrorTimeout"),i=s("gitStatusErrorTimeoutHint")}else/non-fast-forward|\(fetch first\)|(?:can't|cannot|not possible to) fast-forward/i.test(n)&&(o=s("gitStatusErrorNonFastForward"),i=s("gitStatusErrorNonFastForwardHint"));return{reason:o,hint:i,detail:n}}function Ra({projectId:e,status:s,routeRetentionKey:n,supportsRemoteCheck:o,supportsPull:i,supportsPush:r,supportsIntegrationOptions:h,onRefreshStatus:l,t:u}){const[p,b]=a.useState(null),[v,j]=a.useState(!1),[S,g]=a.useState(null),[N,x]=a.useState(null),[f,m]=a.useState(!1),[M,C]=a.useState(null),[w,_]=a.useState(null),[y,B]=a.useState(!1),[X,D]=a.useState(null),[R,z]=a.useState(null),[Z,V]=a.useState(!1),[E,O]=a.useState(null);a.useEffect(()=>{b(null),g(null),j(!1),x(null),C(null),m(!1),_(null),D(null),B(!1),z(null),O(null),V(!1)},[e]);const J=v||f||y,G=Fa(N,w),ne=G?`${G.ahead}:${G.behind}:${G.upstream??""}`:"";a.useEffect(()=>{if(!e||!h||!ne){z(null),O(null),V(!1);return}let A=!1;return V(!0),z(null),O(null),de.getGitIntegrationOptions(e).then(xe=>{A||z(xe)}).catch(xe=>{A||O(xe instanceof Error?xe.message:u("gitStatusAutoOptionsFailed"))}).finally(()=>{A||V(!1)}),()=>{A=!0}},[ne,e,h,u]);const ee=a.useCallback(async()=>{if(!(!e||!o||J)){j(!0),b(null),g(null),x(null),C(null),_(null),D(null),z(null),O(null);try{const A=await de.checkGitRemote(e);b(A),A.status==="checked"&&await l()}catch(A){g(A instanceof Error?Lt(A.message):u("gitStatusRemoteCheckFailed"))}finally{j(!1)}}},[J,l,e,o,u]),te=a.useCallback(async()=>{if(!(!e||!i||J)){m(!0),x(null),C(null),b(null),g(null),_(null),D(null),z(null),O(null);try{const A=await de.pullGit(e);x(A),A.status==="pulled"&&(n&&us(n),await l())}catch(A){C(A instanceof Error?Lt(A.message):u("gitStatusPullFailed"))}finally{m(!1)}}},[J,l,e,n,i,u]),fe=a.useCallback(async()=>{if(!(!e||!r||J)){B(!0),_(null),D(null),b(null),g(null),x(null),C(null),z(null),O(null);try{const A=await de.pushGit(e);_(A),(A.status==="pushed"||A.status==="published"||A.status==="up-to-date")&&(n&&us(n),await l())}catch(A){D(A instanceof Error?Lt(A.message):u("gitStatusPushFailed"))}finally{B(!1)}}},[J,l,e,n,r,u]),K=S??Ta(p,u),ae=S||((p==null?void 0:p.status)??"checked")!=="checked"?"warning":p||s!=null&&s.checkedRemoteAt?"success":null,d=M??Pa(N,u),P=M||N&&N.status!=="pulled"?"warning":N?"success":null,F=X??La(w,u),U=X||w&&!["pushed","published","up-to-date"].includes(w.status)?"warning":w?"success":null,W=K||d||F,ue=K?ae:d?P:F?U:null,ie=(p==null?void 0:p.status)==="failed"?p:(N==null?void 0:N.status)==="failed"?N:(w==null?void 0:w.status)==="failed"||(w==null?void 0:w.status)==="rejected"?w:null,q=ie?Ks(ie.detail,u):null;return{supportsRemoteCheck:o,supportsPull:i,supportsPush:r,supportsIntegrationOptions:h,isRunning:J,isCheckingRemote:v,isPulling:f,isPushing:y,handleCheckRemote:ee,handlePull:te,handlePush:fe,checkedRemoteAt:(w==null?void 0:w.checkedRemoteAt)??(N==null?void 0:N.checkedRemoteAt)??(p==null?void 0:p.checkedRemoteAt)??(s==null?void 0:s.checkedRemoteAt)??null,checkFeedback:K,checkFeedbackTone:ae,pullFeedback:d,pullFeedbackTone:P,pushFeedback:F,pushFeedbackTone:U,actionFeedback:W,actionFeedbackTone:ue,actionFailure:q,divergedActionStatus:G,integrationOptions:R,isLoadingIntegrationOptions:Z,integrationOptionsError:E}}function Ea(e,s,n){if(!e)return n("gitStatusRemoteUnknown");const o=Date.parse(e);if(!Number.isFinite(o))return e;const i=Math.max(0,s-o),r=60*1e3,h=60*r,l=24*h;return i<r?n("gitStatusRemoteJustNow"):i<h?n("gitStatusRemoteMinutesAgo",{count:Math.floor(i/r)}):i<l?n("gitStatusRemoteHoursAgo",{count:Math.floor(i/h)}):new Date(o).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Ta(e,s){switch(e==null?void 0:e.status){case"checked":return s("gitStatusRemoteCheckSuccess");case"busy":return s("gitStatusRemoteCheckBusy");case"not-a-git-repo":return s("gitStatusRemoteCheckNotRepo");case"failed":return At(e.detail,s("gitStatusCheckRemote"),s)??s("gitStatusRemoteCheckFailed");default:return""}}function Pa(e,s){const n=At(e==null?void 0:e.detail,s("gitStatusPull"),s);switch(e==null?void 0:e.status){case"pulled":return Ws(e.commitsAdvanced)?e.commitsAdvanced===0?s("gitStatusPullAlreadyUpToDate"):s(e.commitsAdvanced===1?"gitStatusPullSuccessSingle":"gitStatusPullSuccessMultiple",{count:e.commitsAdvanced}):s("gitStatusPullSuccess");case"busy":return s("gitStatusPullBusy");case"not-a-git-repo":return s("gitStatusPullNotRepo");case"failed":return n||(jt(e.gitStatus)?s("gitStatusPullDiverged",{ahead:e.gitStatus.ahead,behind:e.gitStatus.behind}):s("gitStatusPullFailed"));default:return""}}function La(e,s){switch(e==null?void 0:e.status){case"pushed":return Ws(e.commitsAdvanced)?s(e.commitsAdvanced===1?"gitStatusPushSuccessSingle":"gitStatusPushSuccessMultiple",{count:e.commitsAdvanced}):s("gitStatusPushSuccess");case"published":return s("gitStatusPushPublished");case"up-to-date":return s("gitStatusPushAlreadyUpToDate");case"busy":return s("gitStatusPushBusy");case"no-upstream":return s("gitStatusPushNoUpstream");case"rejected":{const n=At(e.detail,s("gitStatusPush"),s);if(n&&!jt(e.gitStatus))return n}return jt(e.gitStatus)?s("gitStatusPushDiverged",{ahead:e.gitStatus.ahead,behind:e.gitStatus.behind}):s("gitStatusPushRejected");case"not-a-git-repo":return s("gitStatusPushNotRepo");case"failed":return At(e.detail,s("gitStatusPush"),s)??s("gitStatusPushFailed");default:return""}}function At(e,s,n){const{reason:o}=Ks(e,n);return o?n("gitStatusActionFailedWithReason",{action:s,reason:o}):null}function Ws(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function jt(e){return!!(e&&e.ahead>0&&e.behind>0)}function Fa(e,s){return(e==null?void 0:e.status)==="failed"&&jt(e.gitStatus)?e.gitStatus:(s==null?void 0:s.status)==="rejected"&&jt(s.gitStatus)?s.gitStatus:null}function Kt(){try{const e=localStorage.getItem(Fs.commitReadWatermarks);if(!e)return{};const s=JSON.parse(e);if(!s||typeof s!="object"||Array.isArray(s))return{};const n={};for(const[o,i]of Object.entries(s))typeof i=="string"&&(n[o]=i);return n}catch{return{}}}function Ma(e){try{localStorage.setItem(Fs.commitReadWatermarks,JSON.stringify(e))}catch{}}function Aa(e){const[s,n]=a.useState(()=>Kt()[e]??null);a.useEffect(()=>{n(Kt()[e]??null)},[e]);const o=a.useCallback(l=>{n(l);const u=Kt();l?u[e]=l:delete u[e],Ma(u)},[e]),i=a.useCallback(l=>{if(!s)return!1;const u=new Date(s).getTime(),p=new Date(l).getTime();return Number.isNaN(u)||Number.isNaN(p)?!1:p<=u},[s]),r=a.useCallback(l=>{const u=new Date(l).getTime();Number.isNaN(u)||o(new Date(u).toISOString())},[o]),h=a.useCallback(l=>{const u=new Date(l).getTime();Number.isNaN(u)||o(new Date(u-1e3).toISOString())},[o]);return{watermark:s,isRead:i,markReadTo:r,markUnreadSince:h}}function zs({query:e,disabled:s=!1,onQueryChange:n,t:o}){const[i,r]=a.useState(!1),h=a.useRef(null);a.useEffect(()=>{var u;i&&((u=h.current)==null||u.focus())},[i]);const l=()=>{if(i){n(""),r(!1);return}r(!0)};return t.jsxs("span",{className:`changeset-file-filter ${i?"open":""}`,children:[t.jsx("button",{type:"button",className:"source-detail-action source-detail-icon-action changeset-file-filter-toggle",title:o("sourceFilterFiles"),"aria-label":o("sourceFilterFiles"),"aria-expanded":i,disabled:s,onClick:l,children:t.jsx(Da,{})}),i&&t.jsx("input",{ref:h,type:"search",className:"changeset-file-filter-input",value:e,placeholder:o("sourceFilterFiles"),"aria-label":o("sourceFilterFiles"),onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),e?n(""):r(!1))},onChange:u=>n(u.target.value)})]})}function Da(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[t.jsx("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),t.jsx("path",{d:"m15.5 15.5 5 5"})]})}function Ke(e){return e.origPath?`${e.origPath} → ${e.path}`:e.path}function Vs(e,s){const n=a.useMemo(()=>e.map(Ke),[e]),o=a.useMemo(()=>new kn(n),[n]),i=a.useMemo(()=>new Set(o.search(s)),[o,s]);return a.useMemo(()=>e.filter(r=>i.has(Ke(r))),[e,i])}const $a=50,Oa=/^\s*(?:[*\-•]|\d+\.)\s+/u,Ia=/^[ \t]/;function bs(e){return e.trimEnd().length<=$a}function Ba(e,s){return e.trim().length===0||s.trim().length===0||Oa.test(e)||Ia.test(e)||bs(e)&&bs(s)}function Ua(e){const s=e.split(`
|
|
1
|
+
var on=Object.defineProperty;var rn=(e,s,n)=>s in e?on(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n;var Et=(e,s,n)=>rn(e,typeof s!="symbol"?s+"":s,n);import{j as t,r as a,b as Ps,a4 as ls,a5 as cn,d as ln}from"./clientSummaryStore-Dsgo1zWK.js";import{u as Qt,d as Jt,t as Ls,c as de,U as Fs,w as vt,bn as un,L as Ms,e as $t,b as Ot}from"./main-BX4yZXDF.js";import{P as dn}from"./PageHeader-DYCnk788.js";import{C as Zt,m as us,j as Xt,d as _t,F as ds,G as As,n as Ds,i as hn,o as mn,p as wt,q as $s,t as fn,v as pn,w as gn,x as xn,y as bn,z as Sn,A as vn}from"./FileViewer-D8IcGVo-.js";import{n as Os,u as _n,a as wn}from"./NavigationLayout-UkQvkodY.js";import{u as It,M as jt,d as jn,e as yn}from"./Modal-CHNqXAgW.js";import{q as hs,u as es,v as Ft,S as Mt,G as ms}from"./GlossaryContext-BA5X62Ck.js";import{u as Cn}from"./useDocumentTitle-wGc9OsUg.js";import{c as Nn}from"./usePanelSlideAnimations-XdQhGgr-.js";import{F as kn,S as Pt,a as ts,b as ss,c as ns,d as Is,s as Rn,e as gt,f as Bs,u as as,R as Us,g as En,h as fs,i as Tn,P as ps,B as Hs}from"./BlameBrowser-DrfV_lH3.js";import{r as Pn,s as gs}from"./useSidebarWidth-op0qbgd4.js";import{u as Ln}from"./useRelativeNow-C2ME3OxV.js";import{u as Fn}from"./useSourceControlCleanLanding-BE8h6VMD.js";import{MainContent as Mn}from"./index-BSMD-gHP.js";import{a as Gs}from"./appHref-ByaEnJGJ.js";import{p as An}from"./sourceControlNavigationState-D8WJCFc_.js";import{S as qs}from"./SourceFileHeaderActions-ByzC_I1c.js";import{a as Dn}from"./frontendReload-B4jfUIeG.js";import{u as $n,g as On,b as In}from"./useProviders-B54BXYv3.js";import{s as Ee,G as Bn,ba as Un,z as Hn,bb as Gn,bc as qn,y as Kn,bd as Wn,be as zn,bf as Vn,bg as Yn,bh as Qn,bi as Jn,bj as Zn,bk as Xn,bl as ea,bm as ta}from"./index-BhTv6hAY.js";import"./react-runtime-D-UPQ57m.js";import"./text-B4tk85DK.js";import"./SessionHeader.module-DfkDdP3M.js";import"./HostIdentityContext-_GKYzEQ6.js";import"./sourceTransportPaths-BTR7eFi5.js";import"./SessionMetadataContext-D0F_4Wp0.js";import"./LocalMediaModal-DMrKaM1a.js";import"./ViewerWindowActions-DV5bxAAy.js";import"./sessionVhostApps-DbEDY32Q.js";import"./newSessionPrefill-BC5a8IpP.js";import"./relay-url-j3kYm5KO.js";import"./sessionViewerController-BGKUu-Zg.js";import"./sessionViewerPlacement-cjpznhMG.js";import"./useSessionRightPaneSetting-C5YgsyBy.js";import"./MarkdownPreview-TXbYZwdp.js";import"./RenderModeGlyph-ldDSjj9f.js";import"./katex-DLorvT8M.js";import"./RenderModeContext-CuIMXqQV.js";import"./uiTrace-CvAgW12D.js";import"./CopyTextButton-oYhSruA8.js";import"./useFileActivity-CpuLfNl9.js";import"./remoteRoutePaths-DpabBbC6.js";import"./ProviderBadge-C-UpobLD.js";import"./YepAnywhereLogo-ccRUdgT-.js";const sa="_message_1naoy_1",na="_success_1naoy_10",aa="_warning_1naoy_16",oa="_hint_1naoy_22",ia="_details_1naoy_26",ra="_output_1naoy_35",ca="_copy_1naoy_51",ot={message:sa,success:na,warning:aa,hint:oa,details:ia,output:ra,copy:ca};function la({message:e,tone:s,failure:n}){const{t:o}=Qt();return t.jsxs("div",{className:`${ot.message} ${s==="warning"?ot.warning:ot.success}`,role:s==="warning"?"alert":"status",children:[t.jsx("div",{children:e}),(n==null?void 0:n.hint)&&t.jsx("p",{className:ot.hint,children:n.hint}),(n==null?void 0:n.detail)&&t.jsxs("details",{className:ot.details,children:[t.jsx("summary",{children:o("gitStatusErrorDetails")}),t.jsxs("div",{className:ot.output,children:[t.jsx(Zt,{value:n.detail,title:o("gitStatusCopyErrorDetails"),className:ot.copy}),t.jsx("pre",{children:n.detail})]})]},n.detail)]})}const ua="_container_1464z_23",da="_button_1464z_31",ha="_text_1464z_51",ma="_chevron_1464z_66",fa="_dropdown_1464z_77",pa="_options_1464z_91",ga="_option_1464z_91",xa="_selected_1464z_114",ba="_name_1464z_118",Sa="_meta_1464z_126",va="_overlay_1464z_132",_a="_sheet_1464z_142",wa="_header_1464z_162",ja="_title_1464z_167",$e={container:ua,button:da,text:ha,chevron:ma,dropdown:fa,options:pa,option:ga,selected:xa,name:ba,meta:Sa,overlay:va,sheet:_a,header:wa,title:ja},xs=769;function ya({currentProjectId:e,currentProjectName:s,onProjectChange:n}){const{t:o}=Qt(),[i,r]=a.useState(!1),[h,l]=a.useState(()=>window.innerWidth>=xs),u=a.useRef(null),p=a.useRef(null),b=Jt(),v=It(),{projects:y,loading:S}=Os(),g=y.find(j=>j.id===e),N=g?hs(g):s??o("projectSelectorFallback"),x=()=>{var j;(j=u.current)==null||j.blur(),r(!0)},f=j=>{j.id!==e&&(n?n(j):b(`${v}/new-session?projectId=${encodeURIComponent(j.id)}`)),r(!1)},m=a.useCallback(()=>{r(!1)},[]);a.useEffect(()=>{const j=()=>{l(window.innerWidth>=xs)};return window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]),a.useEffect(()=>{if(!i)return;const j=B=>{B.key==="Escape"&&(B.preventDefault(),B.stopPropagation(),m())};return document.addEventListener("keydown",j,!0),()=>document.removeEventListener("keydown",j,!0)},[i,m]),a.useEffect(()=>{if(!i||!h)return;const j=B=>{p.current&&!p.current.contains(B.target)&&u.current&&!u.current.contains(B.target)&&m()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[i,h,m]),a.useEffect(()=>{if(i&&!h)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[i,h]),a.useEffect(()=>{var j;i&&((j=p.current)==null||j.focus())},[i]);const M=j=>{j.target===j.currentTarget&&(j.preventDefault(),j.stopPropagation(),m())};if(!S&&y.length<=1)return t.jsx("span",{className:"session-title",children:N});const C=t.jsx("div",{className:$e.options,children:y.map(j=>{const B=j.id===e;return t.jsxs("button",{type:"button",className:`${$e.option} ${B?$e.selected:""}`,onClick:()=>f(j),children:[t.jsx("span",{className:$e.name,children:hs(j)}),t.jsx("span",{className:$e.meta,children:o("projectSelectorSessionsCount",{count:j.sessionCount})})]},j.id)})}),w=i&&!h?Ls.createPortal(t.jsx("div",{className:$e.overlay,onClick:M,onMouseDown:j=>j.stopPropagation(),children:t.jsxs("div",{ref:p,className:$e.sheet,role:"dialog",tabIndex:-1,"aria-label":o("projectSelectorSelectProject"),children:[t.jsx("div",{className:$e.header,children:t.jsx("span",{className:$e.title,children:o("projectSelectorSelectProject")})}),C]})}),document.body):null,_=i&&h?t.jsx("div",{ref:p,className:$e.dropdown,role:"dialog",tabIndex:-1,"aria-label":o("projectSelectorSelectProject"),children:C}):null;return t.jsxs("div",{className:`project-selector-container ${$e.container}`,children:[t.jsxs("button",{ref:u,type:"button",className:`project-selector-button ${$e.button}`,onClick:x,title:o("projectSelectorChangeProject"),"aria-haspopup":"listbox","aria-expanded":i,children:[t.jsx("span",{className:`project-selector-text ${$e.text}`,children:N}),t.jsx("svg",{className:$e.chevron,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),_,w]})}function Ca(){return document.visibilityState==="visible"&&document.hasFocus()}function Na(e){return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),window.addEventListener("blur",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e),window.removeEventListener("blur",e)}}function ka(){return a.useSyncExternalStore(Na,Ca,()=>!1)}function Lt(e){return e.replace(/(https?:\/\/)[^\s/"'<>]*@/gi,"$1[redacted]@").replace(/([?&](?:access_token|token|password|secret|api_key)=)[^\s&"'<>]*/gi,"$1[redacted]").replace(/(Authorization:\s*(?:Basic|Bearer)\s+)\S+/gi,"$1[redacted]").trim()}function Ks(e,s){var r;const n=Lt(e??"");let o=null,i=null;if(/permission denied \([^)]*publickey[^)]*\)/i.test(n))o=s("gitStatusErrorSshAuth"),i=s("gitStatusErrorSshAuthHint");else if(/bad (?:owner or permissions|permissions)/i.test(n))o=s("gitStatusErrorSshPermissions"),i=s("gitStatusErrorSshPermissionsHint");else if(/https?:\/\//i.test(n)&&/authentication failed|could not read (?:username|password)|invalid (?:username|password|credentials)|password authentication is not supported/i.test(n))o=s("gitStatusErrorHttpsAuth"),i=s("gitStatusErrorHttpsAuthHint");else if(/authentication failed/i.test(n))o=s("gitStatusErrorAuth"),i=s("gitStatusErrorAuthHint");else if(/timed?\s*out|\btimeout\b|ETIMEDOUT/i.test(n)){const h=(r=/Git operation timed out after (\d+(?:\.\d+)?) seconds\./i.exec(n))==null?void 0:r[1];o=h?s("gitStatusErrorTimeoutSeconds",{seconds:h}):s("gitStatusErrorTimeout"),i=s("gitStatusErrorTimeoutHint")}else/non-fast-forward|\(fetch first\)|(?:can't|cannot|not possible to) fast-forward/i.test(n)&&(o=s("gitStatusErrorNonFastForward"),i=s("gitStatusErrorNonFastForwardHint"));return{reason:o,hint:i,detail:n}}function Ra({projectId:e,status:s,routeRetentionKey:n,supportsRemoteCheck:o,supportsPull:i,supportsPush:r,supportsIntegrationOptions:h,onRefreshStatus:l,t:u}){const[p,b]=a.useState(null),[v,y]=a.useState(!1),[S,g]=a.useState(null),[N,x]=a.useState(null),[f,m]=a.useState(!1),[M,C]=a.useState(null),[w,_]=a.useState(null),[j,B]=a.useState(!1),[X,D]=a.useState(null),[R,z]=a.useState(null),[Z,V]=a.useState(!1),[E,O]=a.useState(null);a.useEffect(()=>{b(null),g(null),y(!1),x(null),C(null),m(!1),_(null),D(null),B(!1),z(null),O(null),V(!1)},[e]);const J=v||f||j,G=Fa(N,w),ne=G?`${G.ahead}:${G.behind}:${G.upstream??""}`:"";a.useEffect(()=>{if(!e||!h||!ne){z(null),O(null),V(!1);return}let A=!1;return V(!0),z(null),O(null),de.getGitIntegrationOptions(e).then(xe=>{A||z(xe)}).catch(xe=>{A||O(xe instanceof Error?xe.message:u("gitStatusAutoOptionsFailed"))}).finally(()=>{A||V(!1)}),()=>{A=!0}},[ne,e,h,u]);const ee=a.useCallback(async()=>{if(!(!e||!o||J)){y(!0),b(null),g(null),x(null),C(null),_(null),D(null),z(null),O(null);try{const A=await de.checkGitRemote(e);b(A),A.status==="checked"&&await l()}catch(A){g(A instanceof Error?Lt(A.message):u("gitStatusRemoteCheckFailed"))}finally{y(!1)}}},[J,l,e,o,u]),te=a.useCallback(async()=>{if(!(!e||!i||J)){m(!0),x(null),C(null),b(null),g(null),_(null),D(null),z(null),O(null);try{const A=await de.pullGit(e);x(A),A.status==="pulled"&&(n&&us(n),await l())}catch(A){C(A instanceof Error?Lt(A.message):u("gitStatusPullFailed"))}finally{m(!1)}}},[J,l,e,n,i,u]),fe=a.useCallback(async()=>{if(!(!e||!r||J)){B(!0),_(null),D(null),b(null),g(null),x(null),C(null),z(null),O(null);try{const A=await de.pushGit(e);_(A),(A.status==="pushed"||A.status==="published"||A.status==="up-to-date")&&(n&&us(n),await l())}catch(A){D(A instanceof Error?Lt(A.message):u("gitStatusPushFailed"))}finally{B(!1)}}},[J,l,e,n,r,u]),K=S??Ta(p,u),ae=S||((p==null?void 0:p.status)??"checked")!=="checked"?"warning":p||s!=null&&s.checkedRemoteAt?"success":null,d=M??Pa(N,u),P=M||N&&N.status!=="pulled"?"warning":N?"success":null,F=X??La(w,u),U=X||w&&!["pushed","published","up-to-date"].includes(w.status)?"warning":w?"success":null,W=K||d||F,ue=K?ae:d?P:F?U:null,ie=(p==null?void 0:p.status)==="failed"?p:(N==null?void 0:N.status)==="failed"?N:(w==null?void 0:w.status)==="failed"||(w==null?void 0:w.status)==="rejected"?w:null,q=ie?Ks(ie.detail,u):null;return{supportsRemoteCheck:o,supportsPull:i,supportsPush:r,supportsIntegrationOptions:h,isRunning:J,isCheckingRemote:v,isPulling:f,isPushing:j,handleCheckRemote:ee,handlePull:te,handlePush:fe,checkedRemoteAt:(w==null?void 0:w.checkedRemoteAt)??(N==null?void 0:N.checkedRemoteAt)??(p==null?void 0:p.checkedRemoteAt)??(s==null?void 0:s.checkedRemoteAt)??null,checkFeedback:K,checkFeedbackTone:ae,pullFeedback:d,pullFeedbackTone:P,pushFeedback:F,pushFeedbackTone:U,actionFeedback:W,actionFeedbackTone:ue,actionFailure:q,divergedActionStatus:G,integrationOptions:R,isLoadingIntegrationOptions:Z,integrationOptionsError:E}}function Ea(e,s,n){if(!e)return n("gitStatusRemoteUnknown");const o=Date.parse(e);if(!Number.isFinite(o))return e;const i=Math.max(0,s-o),r=60*1e3,h=60*r,l=24*h;return i<r?n("gitStatusRemoteJustNow"):i<h?n("gitStatusRemoteMinutesAgo",{count:Math.floor(i/r)}):i<l?n("gitStatusRemoteHoursAgo",{count:Math.floor(i/h)}):new Date(o).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Ta(e,s){switch(e==null?void 0:e.status){case"checked":return s("gitStatusRemoteCheckSuccess");case"busy":return s("gitStatusRemoteCheckBusy");case"not-a-git-repo":return s("gitStatusRemoteCheckNotRepo");case"failed":return At(e.detail,s("gitStatusCheckRemote"),s)??s("gitStatusRemoteCheckFailed");default:return""}}function Pa(e,s){const n=At(e==null?void 0:e.detail,s("gitStatusPull"),s);switch(e==null?void 0:e.status){case"pulled":return Ws(e.commitsAdvanced)?e.commitsAdvanced===0?s("gitStatusPullAlreadyUpToDate"):s(e.commitsAdvanced===1?"gitStatusPullSuccessSingle":"gitStatusPullSuccessMultiple",{count:e.commitsAdvanced}):s("gitStatusPullSuccess");case"busy":return s("gitStatusPullBusy");case"not-a-git-repo":return s("gitStatusPullNotRepo");case"failed":return n||(yt(e.gitStatus)?s("gitStatusPullDiverged",{ahead:e.gitStatus.ahead,behind:e.gitStatus.behind}):s("gitStatusPullFailed"));default:return""}}function La(e,s){switch(e==null?void 0:e.status){case"pushed":return Ws(e.commitsAdvanced)?s(e.commitsAdvanced===1?"gitStatusPushSuccessSingle":"gitStatusPushSuccessMultiple",{count:e.commitsAdvanced}):s("gitStatusPushSuccess");case"published":return s("gitStatusPushPublished");case"up-to-date":return s("gitStatusPushAlreadyUpToDate");case"busy":return s("gitStatusPushBusy");case"no-upstream":return s("gitStatusPushNoUpstream");case"rejected":{const n=At(e.detail,s("gitStatusPush"),s);if(n&&!yt(e.gitStatus))return n}return yt(e.gitStatus)?s("gitStatusPushDiverged",{ahead:e.gitStatus.ahead,behind:e.gitStatus.behind}):s("gitStatusPushRejected");case"not-a-git-repo":return s("gitStatusPushNotRepo");case"failed":return At(e.detail,s("gitStatusPush"),s)??s("gitStatusPushFailed");default:return""}}function At(e,s,n){const{reason:o}=Ks(e,n);return o?n("gitStatusActionFailedWithReason",{action:s,reason:o}):null}function Ws(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function yt(e){return!!(e&&e.ahead>0&&e.behind>0)}function Fa(e,s){return(e==null?void 0:e.status)==="failed"&&yt(e.gitStatus)?e.gitStatus:(s==null?void 0:s.status)==="rejected"&&yt(s.gitStatus)?s.gitStatus:null}function Kt(){try{const e=localStorage.getItem(Fs.commitReadWatermarks);if(!e)return{};const s=JSON.parse(e);if(!s||typeof s!="object"||Array.isArray(s))return{};const n={};for(const[o,i]of Object.entries(s))typeof i=="string"&&(n[o]=i);return n}catch{return{}}}function Ma(e){try{localStorage.setItem(Fs.commitReadWatermarks,JSON.stringify(e))}catch{}}function Aa(e){const[s,n]=a.useState(()=>Kt()[e]??null);a.useEffect(()=>{n(Kt()[e]??null)},[e]);const o=a.useCallback(l=>{n(l);const u=Kt();l?u[e]=l:delete u[e],Ma(u)},[e]),i=a.useCallback(l=>{if(!s)return!1;const u=new Date(s).getTime(),p=new Date(l).getTime();return Number.isNaN(u)||Number.isNaN(p)?!1:p<=u},[s]),r=a.useCallback(l=>{const u=new Date(l).getTime();Number.isNaN(u)||o(new Date(u).toISOString())},[o]),h=a.useCallback(l=>{const u=new Date(l).getTime();Number.isNaN(u)||o(new Date(u-1e3).toISOString())},[o]);return{watermark:s,isRead:i,markReadTo:r,markUnreadSince:h}}function zs({query:e,disabled:s=!1,onQueryChange:n,t:o}){const[i,r]=a.useState(!1),h=a.useRef(null);a.useEffect(()=>{var u;i&&((u=h.current)==null||u.focus())},[i]);const l=()=>{if(i){n(""),r(!1);return}r(!0)};return t.jsxs("span",{className:`changeset-file-filter ${i?"open":""}`,children:[t.jsx("button",{type:"button",className:"source-detail-action source-detail-icon-action changeset-file-filter-toggle",title:o("sourceFilterFiles"),"aria-label":o("sourceFilterFiles"),"aria-expanded":i,disabled:s,onClick:l,children:t.jsx(Da,{})}),i&&t.jsx("input",{ref:h,type:"search",className:"changeset-file-filter-input",value:e,placeholder:o("sourceFilterFiles"),"aria-label":o("sourceFilterFiles"),onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),e?n(""):r(!1))},onChange:u=>n(u.target.value)})]})}function Da(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[t.jsx("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),t.jsx("path",{d:"m15.5 15.5 5 5"})]})}function Ke(e){return e.origPath?`${e.origPath} → ${e.path}`:e.path}function Vs(e,s){const n=a.useMemo(()=>e.map(Ke),[e]),o=a.useMemo(()=>new kn(n),[n]),i=a.useMemo(()=>new Set(o.search(s)),[o,s]);return a.useMemo(()=>e.filter(r=>i.has(Ke(r))),[e,i])}const $a=50,Oa=/^\s*(?:[*\-•]|\d+\.)\s+/u,Ia=/^[ \t]/;function bs(e){return e.trimEnd().length<=$a}function Ba(e,s){return e.trim().length===0||s.trim().length===0||Oa.test(e)||Ia.test(e)||bs(e)&&bs(s)}function Ua(e){const s=e.split(`
|
|
2
2
|
`);if(s.length<2)return e;const n=s.shift();if(n===void 0)return e;const o=[];let i=n,r=n;for(const h of s)Ba(h,r)?(o.push(i),i=h):i=`${i.trimEnd()} ${h.trim()}`,r=h;return o.push(i),o.join(`
|
|
3
|
-
`)}const Ha="_link_z1pen_1",Ga={link:Ha};function Ys({onClick:e,t:s}){return t.jsxs("button",{type:"button",className:Ga.link,onClick:e,children:[t.jsx("span",{"aria-hidden":"true",children:"‹"}),t.jsx("span",{children:s("sourceCommitHistory")})]})}const qa="_body_cdtrm_1",Ka="_selected_cdtrm_27",Wa="_mobile_cdtrm_32",za="_selectedPath_cdtrm_38",Va="_selectedPathBox_cdtrm_49",Ya="_desktopColumn_cdtrm_82",ut={body:qa,selected:Ka,mobile:Wa,selectedPath:za,selectedPathBox:Va,desktopColumn:Ya},Qa=new Map;function Ja({columnRef:e,selectedSha:s,selectedCommit:n,detail:o,loading:i,detailError:r,compareToHead:h,supportsInclusiveToHead:l,isWideScreen:u,messageView:p,selectedFiles:b,selectedPath:v,fileFocusRequest:
|
|
3
|
+
`)}const Ha="_link_z1pen_1",Ga={link:Ha};function Ys({onClick:e,t:s}){return t.jsxs("button",{type:"button",className:Ga.link,onClick:e,children:[t.jsx("span",{"aria-hidden":"true",children:"‹"}),t.jsx("span",{children:s("sourceCommitHistory")})]})}const qa="_body_cdtrm_1",Ka="_selected_cdtrm_27",Wa="_mobile_cdtrm_32",za="_selectedPath_cdtrm_38",Va="_selectedPathBox_cdtrm_49",Ya="_desktopColumn_cdtrm_82",ut={body:qa,selected:Ka,mobile:Wa,selectedPath:za,selectedPathBox:Va,desktopColumn:Ya},Qa=new Map;function Ja({columnRef:e,selectedSha:s,selectedCommit:n,detail:o,loading:i,detailError:r,compareToHead:h,supportsInclusiveToHead:l,isWideScreen:u,messageView:p,selectedFiles:b,selectedPath:v,fileFocusRequest:y,fileCommentCount:S,reviewStatesByPath:g=Qa,revisionNavigation:N,onBack:x,onToggleComparison:f,onCompareFileToHead:m,onShowMessage:M,onPageDiff:C,onFocusFile:w,onFilteredSelectionChange:_,onActivateFile:j,onBlameFile:B,onMarkReadTo:X,onMarkUnreadSince:D,t:R}){const[z,Z]=a.useState(""),V=a.useRef(0),E=es(R),O=Vs(b,z),J=y>V.current&&!!z&&!!v&&!O.some(d=>d.path===v),G=J?b:O,ne=J?"":z,ee=a.useMemo(()=>G.map(d=>({id:d.path,path:d.path,displayPath:Ke(d),statuses:[d.status],value:d})),[G]),te=a.useMemo(()=>{const d=b.find(P=>P.path===v||P.origPath===v);return d?Ke(d):null},[b,v]);a.useEffect(()=>{y<=V.current||(V.current=y,J&&Z(""))},[y,J]),a.useEffect(()=>{if(!u||i)return;const d=G.filter(F=>!F.path.endsWith("/")),P=d.find(F=>F.path===v||F.origPath===v)??d[0]??null;((P==null?void 0:P.path)??null)!==v&&_(P)},[G,u,i,_,v]);const fe=d=>[{label:R("sourceCopyPath"),onSelect:()=>{vt(d.path)}},...m?[{label:R("sourceCompareFileTreeToHead"),onSelect:()=>m(d)}]:[],...B?[{label:R("sourceToggleBlame"),onSelect:()=>B(d.path)}]:[]],K=()=>{const d=window.getSelection();d&&!d.isCollapsed||M()},ae=d=>{d.key!=="Enter"&&d.key!==" "||(d.preventDefault(),M())};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:["commit-files-column",u?ut.desktopColumn:""].filter(Boolean).join(" "),ref:e,children:[x&&t.jsx(Ys,{onClick:x,t:R}),t.jsxs("div",{className:"source-detail-banner",children:[N,t.jsxs("span",{className:"source-detail-identity",children:[t.jsx("span",{className:"source-detail-subject",title:(o==null?void 0:o.subject)??(n==null?void 0:n.subject),children:(o==null?void 0:o.subject)??(n==null?void 0:n.subject)??"…"}),t.jsx("span",{className:"source-detail-title",title:n?`${n.hash}
|
|
4
4
|
${os(n.authorDate)}`:s,children:(o==null?void 0:o.shortHash)??(n==null?void 0:n.shortHash)??"…"})]}),l&&t.jsx("button",{type:"button",className:`source-detail-action source-compare-toggle ${h?"active":""}`,title:R("sourceCompareToHeadDescription"),"aria-pressed":h,onClick:f,children:R("sourceCompareToHead")}),t.jsx(Zt,{value:s,title:R("sourceCopyCommitHash"),className:"source-detail-action"}),t.jsxs("button",{type:"button",className:"source-detail-action source-detail-icon-action",title:R("sourceMarkReadToHere"),"aria-label":R("sourceMarkReadToHere"),disabled:!n,onClick:()=>n&&X(n.authorDate),children:[t.jsx(Ss,{}),t.jsx("span",{className:"source-detail-action-text",children:R("sourceMarkReadToHere")})]}),t.jsxs("button",{type:"button",className:"source-detail-action source-detail-icon-action",title:R("sourceMarkUnreadSinceHere"),"aria-label":R("sourceMarkUnreadSinceHere"),disabled:!n,onClick:()=>n&&D(n.authorDate),children:[t.jsx(Ss,{crossed:!0}),t.jsx("span",{className:"source-detail-action-text",children:R("sourceMarkUnreadSinceHere")})]}),t.jsx(zs,{query:z,disabled:b.length===0,onQueryChange:Z,t:R})]}),i?t.jsx("div",{className:"git-diff-loading",children:R("gitStatusLoading")}):r?t.jsx("div",{className:"git-diff-error",children:r}):o?t.jsxs(t.Fragment,{children:[o.body&&t.jsxs("div",{className:[ut.body,u?"":ut.mobile,p?ut.selected:""].filter(Boolean).join(" "),role:"button",tabIndex:0,"aria-pressed":p,title:R("sourceShowFullMessage"),onClick:K,onKeyDown:ae,children:[t.jsx("strong",{children:o.subject}),`
|
|
5
5
|
|
|
6
|
-
`,u?Ua(o.body):R("sourceShowFullMessage")]}),te&&!p&&t.jsx("div",{className:ut.selectedPath,"data-source-selected-path":te,"aria-live":"polite","aria-atomic":"true",children:t.jsx("span",{className:ut.selectedPathBox,children:t.jsx(Za,{path:te})})}),t.jsx(Pt,{className:"commit-file-list",items:ee,scopeKey:`${s}:${h?"to-head":"commit"}`,query:ne,activeItemId:v,focusRequest:
|
|
6
|
+
`,u?Ua(o.body):R("sourceShowFullMessage")]}),te&&!p&&t.jsx("div",{className:ut.selectedPath,"data-source-selected-path":te,"aria-live":"polite","aria-atomic":"true",children:t.jsx("span",{className:ut.selectedPathBox,children:t.jsx(Za,{path:te})})}),t.jsx(Pt,{className:"commit-file-list",items:ee,scopeKey:`${s}:${h?"to-head":"commit"}`,query:ne,activeItemId:v,focusRequest:y,toggleAllOnEnter:!0,onKeyDown:d=>Xt(d,{onPage:C}),renderFile:(d,P,F)=>{const U=d.value,W=S.get(U.path)??0,ue=U.path.endsWith("/"),ie=fe(U);return t.jsxs("li",{className:`commit-file-row ${Ft}`,children:[t.jsxs(ts,{path:d.displayPath,type:"button",className:`commit-file-item ${v===U.path?"selected":""}`,disabled:ue,"data-source-list-item":!0,"data-source-file-item":!0,onFocus:()=>{u&&!ue&&w(U)},...E.targetProps(ie,()=>{ue||j(U)}),children:[t.jsx(ss,{status:U.status,t:R}),t.jsx(ns,{...F,query:ne,fullPath:d.displayPath,children:P}),(U.linesAdded!==null||U.linesDeleted!==null)&&t.jsxs("span",{className:"git-line-counts",children:[U.linesAdded?t.jsxs("span",{className:"git-lines-added",children:["+",U.linesAdded]}):null,U.linesDeleted?t.jsxs("span",{className:"git-lines-deleted",children:["−",U.linesDeleted]}):null]}),W>0&&t.jsx("span",{className:"source-comment-badge",title:R("sourceCommentCount",{count:W}),children:W}),t.jsx(Is,{states:g.get(U.path)??[],t:R})]}),!ue&&t.jsx(Mt,{actions:ie,label:R("sourceMoreActions"),onOpen:E.openFromButton})]},U.path)},t:R}),b.length===0&&t.jsx("div",{className:"git-status-empty",children:R(h?"sourceNoChangesToHead":"sourceNoFiles")}),b.length>0&&G.length===0&&t.jsx("div",{className:"git-status-empty",children:R("sourceNoMatches")})]}):null]}),E.menu]})}function Za({path:e}){const s=e.split("/");return s.map((n,o)=>t.jsxs(a.Fragment,{children:[n,o<s.length-1&&t.jsxs(t.Fragment,{children:["/",t.jsx("wbr",{})]})]},`${o}:${n}`))}function os(e){const s=new Date(e);return Number.isNaN(s.getTime())?"":s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ss({crossed:e=!1}){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12Z"}),t.jsx("circle",{cx:"12",cy:"12",r:"2.5"}),e&&t.jsx("path",{d:"m4 4 16 16"})]})}const Xa="_root_lpelx_1",eo="_trigger_lpelx_8",to="_popover_lpelx_31",so="_popoverTitle_lpelx_47",no="_row_lpelx_53",xt={root:Xa,trigger:eo,popover:to,popoverTitle:so,row:no};function ao({t:e}){const[s,n]=a.useState(!1),[o,i]=a.useState(!1),[r,h]=a.useState(!1),l=a.useRef(null),u=s||o||r;a.useEffect(()=>{if(!u)return;const b=y=>{var S;(S=l.current)!=null&&S.contains(y.target)||(h(!1),n(!1))},v=y=>{y.key==="Escape"&&(h(!1),n(!1),i(!1))};return document.addEventListener("pointerdown",b),window.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",b),window.removeEventListener("keydown",v)}},[u]);const p=[["/",e("sourceShortcutSearch")],["↑ ↓ ← →",e("sourceShortcutNavigate")],["[ ]",e("sourceShortcutFileDiffs")],["PgUp PgDn",e("sourceShortcutScrollDiff")],["Enter",e("sourceShortcutOpen")],["Esc",e("sourceShortcutBack")],["N P",e("sourceShortcutHunks")],["⇧ F10",e("sourceShortcutActions")]];return t.jsxs("span",{ref:l,className:xt.root,onPointerEnter:()=>n(!0),onPointerLeave:()=>n(!1),onFocusCapture:()=>i(!0),onBlurCapture:b=>{b.currentTarget.contains(b.relatedTarget)||i(!1)},children:[t.jsx("button",{type:"button",className:xt.trigger,"aria-label":e("sourceShortcutHelp"),"aria-expanded":u,onClick:b=>{r?(h(!1),n(!1),i(!1),b.currentTarget.blur()):h(!0)},children:"?"}),u&&t.jsxs("span",{className:xt.popover,role:"tooltip",children:[t.jsx("span",{className:xt.popoverTitle,children:e("sourceShortcutHelp")}),p.map(([b,v])=>t.jsxs("span",{className:xt.row,children:[t.jsx("kbd",{children:b}),t.jsx("span",{children:v})]},b))]})]})}class vs{constructor(){Et(this,"order",[]);Et(this,"documents",new Map);Et(this,"queryCache",new Map)}reset(s){this.order=s.map(n=>n.hash),this.documents=new Map(s.map(n=>[n.hash,{commit:n,metadata:[bt("subject",n.subject),bt("author",n.authorName),bt("shortHash",n.shortHash),bt("hash",n.hash),bt("date",n.authorDate)],deltaText:"",deltaLower:""}])),this.queryCache.clear()}update(s){for(const n of s){const o=this.documents.get(n.hash);if(o){o.deltaText=n.deltaText,o.deltaLower=n.deltaText.toLowerCase();for(const[i,r]of this.queryCache)Wt(o,i)?r.add(n.hash):r.delete(n.hash)}}}search(s){const n=s.trim().toLowerCase();if(!n)return[];let o=this.queryCache.get(n);if(!o){const r=this.longestCachedPrefix(n);o=new Set;for(const h of this.order){if(r&&!r.has(h))continue;const l=this.documents.get(h);l&&Wt(l,n)&&o.add(h)}this.queryCache.set(n,o)}const i=[];for(const r of this.order){if(!o.has(r))continue;const h=this.documents.get(r);if(!h)continue;const l=Wt(h,n);l&&i.push({commit:h.commit,match:l})}return i}longestCachedPrefix(s){for(let n=s.length-1;n>0;n--){const o=this.queryCache.get(s.slice(0,n));if(o)return o}return null}}function bt(e,s){return{field:e,text:s,lower:s.toLowerCase()}}function Wt(e,s){for(const h of e.metadata)if(h.lower.includes(s))return{field:h.field,text:h.text};const n=e.deltaLower.indexOf(s);if(n<0)return null;const o=e.deltaText.lastIndexOf(`
|
|
7
7
|
`,n-1)+1,i=e.deltaText.indexOf(`
|
|
8
|
-
`,n+s.length),r=i<0?e.deltaText.length:i;return{field:"change",text:e.deltaText.slice(o,r)}}const _s=20,ws=new Map;function oo(e,s,n){const o=a.useRef(new vs),[i,r]=a.useState(0),[h,l]=a.useState(!1),[u,p]=a.useState(0),[b,v]=a.useState(0),[j,S]=a.useState(null);return a.useEffect(()=>{if(!n)return;let N=!1;return l(!0),p(0),v(0),S(null),(async()=>{try{const x=await de.getGitCommitSearchManifest(e);if(N)return;let f=ws.get(e);if(!f||f.head!==x.head){const m=new vs;m.reset(x.commits),f={head:x.head,index:m,indexedCount:0,totalCount:x.commits.length,complete:x.commits.length===0},ws.set(e,f)}o.current=f.index,p(f.indexedCount),v(f.totalCount),r(m=>m+1);for(let m=f.indexedCount;m<x.commits.length;m+=_s){const M=x.commits.slice(m,m+_s),C=await de.getGitCommitSearchRecords(e,M.map(w=>w.hash));if(N)return;if(C.records.length!==M.length)throw new Error("Commit search index returned an incomplete batch");f.index.update(C.records),f.indexedCount=m+M.length,p(f.indexedCount),r(w=>w+1)}f.complete=!0}catch(x){N||S(x instanceof Error?x.message:"Failed to build commit search index")}finally{N||l(!1)}})(),()=>{N=!0}},[n,e]),{results:a.useMemo(()=>o.current.search(s),[s,i]),indexing:h,indexedCount:u,totalCount:b,error:j}}const ys=50,He="working-tree";function io({projectId:e,status:s,isWideScreen:n,initialSha:o,initialPath:i,supportsInclusiveToHead:r,onProjectionUnavailable:h,onProjectionRequestFailure:l,t:u}){var ze;const[p,b]=a.useState([]),[v,j]=a.useState(!1),[S,g]=a.useState(!0),[N,x]=a.useState(null),[f,m]=a.useState(o??null),[M,C]=a.useState(null),[w,_]=a.useState(!1),[y,B]=a.useState(null),[X,D]=a.useState(i??null),[R,z]=a.useState(!1),[Z,V]=a.useState(null),[E,O]=a.useState(!1),[J,G]=a.useState(null),[ne,ee]=a.useState(null),te=a.useRef(0),[fe,K]=a.useState(!1),[ae,d]=a.useState(""),[P,F]=a.useState(!1),U=ae.trim().length>0,W=oo(e,ae,P);a.useEffect(()=>{!n&&ae.trim().length>0&&m(null)},[n,ae]);const ue=U?W.results.map(L=>L.commit):p,ie=a.useMemo(()=>new Map(W.results.map(L=>[L.commit.hash,L.match])),[W.results]),q=f===He,A=f&&!q?f:null,xe=a.useMemo(()=>!M||M.hash!==A||ue.some(L=>L.hash===M.hash)?ue:[M,...ue],[M,ue,A]),Oe=s!==void 0,Y=a.useMemo(()=>[...Oe?[He]:[],...xe.map(L=>L.hash)],[xe,Oe]);a.useEffect(()=>{o&&m(o)},[o]),a.useEffect(()=>{let L=!1;return g(!0),x(null),b([]),m(o??null),de.getGitCommits(e,{limit:ys}).then(Q=>{L||(b(Q.commits),j(Q.hasMore),g(!1))}).catch(Q=>{L||(x(Q instanceof Error?Q.message:u("gitStatusLoading")),g(!1))}),()=>{L=!0}},[o,e,u]);const re=s!=null&&s.isClean?((ze=xe[0])==null?void 0:ze.hash)??(S?void 0:He):Y[0];a.useEffect(()=>{U||!n&&!(s!=null&&s.isClean)||!re||m(L=>L&&(Y.includes(L)||o!==void 0&&L===o)?L:re)},[re,Y,o,n,U,s==null?void 0:s.isClean]);const oe=a.useCallback(async()=>{try{const L=await de.getGitCommits(e,{limit:ys,skip:p.length});b(Q=>{const Fe=new Set(Q.map(je=>je.hash));return[...Q,...L.commits.filter(je=>!Fe.has(je.hash))]}),j(L.hasMore)}catch(L){x(L instanceof Error?L.message:u("gitStatusLoading"))}},[p.length,e,u]),pe=a.useCallback(L=>{te.current+=1,G(null),ee(null),z(!1),V(null),O(!1),l(L)},[l]),We=a.useCallback(async L=>{if(!A)return;const Q=te.current+1;te.current=Q,z(!1),V(null),D(L.path),K(!1);try{const Fe=await de.getGitComparison(e,A);if(Q!==te.current)return;const je=Fe.files.find(we=>we.path===L.path||we.origPath===L.path);D((je==null?void 0:je.path)??L.path),G(Fe),ee(je??{...L,status:"M",staged:!1,linesAdded:null,linesDeleted:null})}catch(Fe){if(Q!==te.current)return;pe(Fe)}},[pe,e,A]),Te=a.useCallback(()=>{if(te.current+=1,G(null),ee(null),R){z(!1),V(null),O(!1);return}if(!r){h();return}z(!0),O(!0),K(!1)},[R,h,r]);a.useEffect(()=>{if(te.current+=1,G(null),ee(null),!A){C(null),_(!1),B(null),D(null),K(!1);return}let L=!1;return _(!0),B(null),C(null),D(i??null),K(!1),de.getGitCommit(e,A).then(Q=>{L||(C(Q),_(!1))}).catch(Q=>{L||(B(Q instanceof Error?Q.message:u("gitStatusLoading")),_(!1))}),()=>{L=!0}},[i,e,A,u]),a.useEffect(()=>{if(!R||!A||!r){V(null),O(!1),R&&!r&&(z(!1),h());return}let L=!1;return V(null),O(!0),de.getGitInclusiveComparison(e,A).then(Q=>{L||(V(Q),O(!1))}).catch(Q=>{L||pe(Q)}),()=>{L=!0}},[R,pe,h,e,A,r]);const Pe=a.useMemo(()=>Rn(R?(Z==null?void 0:Z.files)??[]:(M==null?void 0:M.files)??[]),[R,Z==null?void 0:Z.files,M==null?void 0:M.files]);a.useEffect(()=>{if(R&&E)return;const L=i?Pe.find(Q=>Q.path===i||Q.origPath===i):void 0;!n&&!L||D(Q=>{var je;const Fe=Q?Pe.find(we=>we.path===Q||we.origPath===Q):void 0;return(L==null?void 0:L.path)??(Fe==null?void 0:Fe.path)??((je=Pe.find(we=>!we.path.endsWith("/")))==null?void 0:je.path)??null})},[R,i,n,E,Pe]),a.useEffect(()=>{ne&&ne.path!==X&&(G(null),ee(null))},[ne,X]);const ke=X?Pe.find(L=>L.path===X)??null:null,he=ne??ke,Ie=A&&J&&ne?{kind:"comparison",baseSha:J.baseSha,headSha:J.headSha}:A&&R&&Z?{kind:"inclusive-comparison",baseSha:Z.baseSha,headSha:Z.headSha}:A?{kind:"commit",sha:A}:void 0,Je=A&&he?J&&ne?`tree:${J.baseSha}:${J.headSha}:${he.path}`:R&&Z?`${Z.baseSha}:${Z.headSha}:${he.path}`:`${A}:${he.path}`:null,me=f?Y.indexOf(f):-1,be=me>0?Y[me-1]:void 0,Le=me>=0&&me<Y.length-1?Y[me+1]:void 0,Ce=A?xe.find(L=>L.hash===A):void 0;return{commits:p,displayedCommits:xe,displayedKeys:Y,hasMore:v,loadingList:S,listError:N,loadMore:oe,searchQuery:ae,setSearchQuery:d,searchIndexRequested:P,setSearchIndexRequested:F,searchActive:U,searchIndex:W,commitSearchMatches:ie,selectedKey:f,setSelectedKey:m,selectedIsWorkingTree:q,selectedSha:A,selectedCommit:Ce,showWorkingTreeRevision:Oe,detail:M,loadingDetail:w,detailError:y,selectedPath:X,setSelectedPath:D,selectedFiles:Pe,selectedFile:he,compareToHead:R,loadingComparison:E,toggleComparison:Te,openDirectComparison:We,handleProjectionRequestFailure:pe,messageView:fe,setMessageView:K,source:Ie,diffFileKey:Je,newerKey:be,olderKey:Le}}const ro="_link_1tjl7_1",co="_dirty_1tjl7_5",lo="_dirtySelected_1tjl7_10",uo="_dirtyLabel_1tjl7_14",ho="_cleanLabel_1tjl7_15",mo="_matchContext_1tjl7_27",it={link:ro,dirty:co,dirtySelected:lo,dirtyLabel:uo,cleanLabel:ho,matchContext:mo};function fo({status:e,isWideScreen:s,searchInputRef:n,searchQuery:o,searchIndexRequested:i,searchIndexing:r,indexedCount:h,totalCount:l,searchError:u,searchActive:p,displayedCommits:b,commitSearchMatches:v,selectedKey:j,selectedIsWorkingTree:S,showWorkingTreeRevision:g,loadingList:N,listError:x,hasMore:f,workingTreeCommentCount:m,commentCountBySha:M,isRead:C,onSearchQueryChange:w,onSearchIndexRequested:_,onOpenRevision:y,onEnterRevision:B,revisionHref:X,onFocusRevision:D,onLoadMore:R,onMarkReadTo:z,onMarkUnreadSince:Z,displayedKeys:V,t:E}){const O=es(E),J=a.useRef(null),G=a.useRef(!0),ne=a.useCallback((d,P)=>{const F=V.indexOf(d),U=F>0?V[F-1]:void 0,W=F>=0&&F<V.length-1?V[F+1]:void 0;return P?[{label:E("sourceCopyCommitHash"),onSelect:()=>{vt(P.hash)}},{label:E("sourceCopyCommitSubject"),onSelect:()=>{vt(P.subject)}},{label:E("sourceMarkReadToHere"),separatorBefore:!0,onSelect:()=>z(P.authorDate)},{label:E("sourceMarkUnreadSinceHere"),onSelect:()=>Z(P.authorDate)},{label:E("sourceNewerCommit"),separatorBefore:!0,disabled:!U,onSelect:()=>U&&y(U)},{label:E("sourceOlderCommit"),disabled:!W,onSelect:()=>W&&y(W)}]:[{label:E("sourceCopyRevisionLabel"),onSelect:()=>{vt(E("sourceWorkingTree"))}},{label:E("sourceNewerCommit"),disabled:!U,onSelect:()=>U&&y(U)},{label:E("sourceOlderCommit"),disabled:!W,onSelect:()=>W&&y(W)}]},[V,z,Z,y,E]),ee=b.length===0&&!g,te=(e==null?void 0:e.isClean)===!0,fe=e?new Set(e.files.map(d=>d.path)).size:0,K=ne(He),ae=O.targetProps(K,()=>y(He));return a.useLayoutEffect(()=>{var P;if(N){G.current=!0;return}if(!s||!G.current||!j)return;const d=(P=J.current)==null?void 0:P.querySelector(".commit-list-item.selected");d&&(G.current=!1,_t(),d.focus({preventScroll:!0}))},[s,N,j]),t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"commit-list-column",children:[t.jsxs("div",{className:"source-search-field",children:[t.jsx("input",{ref:n,type:"search",className:"source-search-input",value:o,placeholder:E("sourceSearchCommits"),"aria-keyshortcuts":"/",onFocus:_,onKeyDown:d=>{d.key==="Escape"&&o&&(d.preventDefault(),w(""))},onChange:d=>{_(),w(d.target.value)}}),t.jsx("kbd",{className:"source-search-shortcut",children:"/"}),t.jsx(ao,{t:E})]}),i&&r&&t.jsx("div",{className:"source-search-index-status",children:l>0?E("sourceIndexingCommits",{indexed:h,total:l}):E("sourcePreparingCommitIndex")}),N&&!p&&ee?t.jsx("div",{className:"git-diff-loading",children:E("gitStatusLoading")}):x&&!p&&ee?t.jsx("div",{className:"git-diff-error",children:x}):p&&r&&ee?t.jsx("div",{className:"git-diff-loading",children:E("sourceSearching")}):p&&u&&ee?t.jsx("div",{className:"git-diff-error",children:u}):ee?t.jsx("div",{className:"git-status-empty",children:E(p?"sourceNoMatches":"sourceNoCommits")}):t.jsxs(t.Fragment,{children:[t.jsxs("ol",{ref:J,className:"commit-list",onKeyDown:Xt,children:[g&&t.jsxs("li",{className:`commit-list-row commit-list-working-tree ${Ft}`,children:[t.jsxs("a",{className:`commit-list-item ${it.link} unread ${te?"":it.dirty} ${S?"selected":""} ${!te&&S?it.dirtySelected:""}`,href:X(He),"data-source-list-item":!0,onFocus:()=>{s&&D(He)},...ae,onKeyDown:d=>{ae.onKeyDown(d),js(d,He,B)},onClick:d=>{Cs(d)||(d.preventDefault(),ae.onClick())},children:[t.jsxs("span",{className:"commit-subject-row",children:[t.jsx("span",{className:"commit-subject",children:E("sourceWorkingTree")}),m>0&&t.jsx("span",{className:"source-comment-badge",title:E("sourceCommentCount",{count:m}),children:m})]}),t.jsx("span",{className:"commit-meta",children:te?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:it.cleanLabel,children:E("gitStatusClean")}),t.jsx("span",{children:E("sourceWorkingTreeCleanDescription")})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:it.dirtyLabel,children:E("sourceUncommitted")}),t.jsx("span",{children:E("sourceChangedFileCount",{count:fe})})]})})]}),t.jsx(Mt,{actions:K,label:E("sourceMoreActions"),onOpen:O.openFromButton})]}),b.map(d=>{const P=M.get(d.hash)??0,F=ne(d.hash,d),U=O.targetProps(F,()=>y(d.hash)),W=v.get(d.hash),ue=go(d.authorDate),ie=po(W,o,ue);return t.jsxs("li",{className:`commit-list-row ${Ft}`,children:[t.jsxs("a",{className:`commit-list-item ${it.link} ${j===d.hash?"selected":""} ${C(d.authorDate)?"read":"unread"}`,href:X(d.hash),"data-source-list-item":!0,onFocus:()=>{s&&D(d.hash)},...U,onKeyDown:q=>{U.onKeyDown(q),js(q,d.hash,B)},onClick:q=>{Cs(q)||(q.preventDefault(),U.onClick())},children:[t.jsxs("span",{className:"commit-subject-row",children:[t.jsx(gt,{className:"commit-subject",text:d.subject,query:(W==null?void 0:W.field)==="subject"?o:void 0,title:d.subject}),P>0&&t.jsx("span",{className:"source-comment-badge",title:E("sourceCommentCount",{count:P}),children:P})]}),t.jsxs("span",{className:"commit-meta",children:[t.jsx(gt,{className:"commit-hash",text:d.shortHash,query:(W==null?void 0:W.field)==="shortHash"?o:void 0}),t.jsx(gt,{className:"commit-author",text:d.authorName,query:(W==null?void 0:W.field)==="author"?o:void 0}),t.jsx(gt,{className:"commit-date",text:ue,query:(W==null?void 0:W.field)==="date"&&Bs(ue,o)?o:void 0})]}),ie&&t.jsx(gt,{className:it.matchContext,text:ie,query:o,title:ie})]}),t.jsx(Mt,{actions:F,label:E("sourceMoreActions"),onOpen:O.openFromButton})]},d.hash)})]}),x&&t.jsx("div",{className:"git-diff-error",children:x}),f&&!p&&t.jsx("button",{type:"button",className:"commit-load-more",onClick:R,children:E("sourceLoadMore")})]})]}),O.menu]})}function js(e,s,n){e.defaultPrevented||e.key!=="Enter"||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),e.repeat||n(s))}function Cs(e){return e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey}function po(e,s,n){return e&&(e.field==="change"||e.field==="hash"||e.field==="date"&&!Bs(n,s))?e.text:null}function go(e){const s=new Date(e);return Number.isNaN(s.getTime())?"":s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const xo="_folderGroup_rkotr_1",bo="_folderHeader_rkotr_6",So="_disclosure_rkotr_12",vo="_folderCount_rkotr_21",_o="_folderChildren_rkotr_34",wo="_scanProgress_rkotr_41",yo="_currentContent_rkotr_50",jo="_currentContentActions_rkotr_61",Ae={folderGroup:xo,folderHeader:bo,disclosure:So,folderCount:vo,folderChildren:_o,scanProgress:wo,currentContent:yo,currentContentActions:jo},Ns={kind:"working-tree-history"},Co=4,No=100,Qs=10,Tt=new Map,ko=[];function Ro(e){return(e==null?void 0:e.title)!==void 0||(e==null?void 0:e.fullTitle)!==void 0||(e==null?void 0:e.customTitle)!==void 0}function Eo(e){var s;return`${e.path}\0${((s=e.lastEditor)==null?void 0:s.sessionId)??""}`}const To=a.memo(function({file:s,displayPath:n=Ke(s),pathProps:o,query:i,selected:r,commentCount:h,reviewStates:l,isWideScreen:u,menuActionsForFile:p,menuOpenOptionsForFile:b,menuTargetProps:v,onOpenMenu:j,onActivateFile:S,t:g}){const N=s.path.endsWith("/"),x=p(s),f=b(s),m=Ke(s);return t.jsxs("li",{className:`commit-file-row ${Ft}`,children:[t.jsxs(ts,{path:m,type:"button",className:`commit-file-item ${r?"selected":""}`,disabled:N,"data-source-list-item":!0,"data-source-file-item":!0,onFocus:()=>{u&&!N&&!r&&S(s,r)},...v(x,()=>{S(s,r)},f),children:[t.jsx(ss,{status:s.status,t:g}),t.jsx(Ao,{state:s.worktreeState,t:g}),t.jsx(ns,{...o,query:i,fullPath:m,children:n}),(s.linesAdded!==null||s.linesDeleted!==null)&&t.jsxs("span",{className:"git-line-counts",children:[s.linesAdded?t.jsxs("span",{className:"git-lines-added",children:["+",s.linesAdded]}):null,s.linesDeleted?t.jsxs("span",{className:"git-lines-deleted",children:["−",s.linesDeleted]}):null]}),h>0&&t.jsx("span",{className:"source-comment-badge",title:g("sourceCommentCount",{count:h}),children:h}),t.jsx(Is,{states:l,t:g})]}),!N&&t.jsx(Mt,{actions:x,label:g("sourceMoreActions"),onOpen:j,openOptions:f})]})});function Js({projectId:e,status:s,isWideScreen:n,supportsUntrackedCache:o=!1,untrackedFiles:i=null,untrackedLoading:r=!1,untrackedError:h=null,inventoryPending:l=!1,inventoryLoading:u=!1,inventoryError:p=null,initialWorkingTreePath:b,embeddedInHistory:v=!1,fileFocusRequest:j=0,onBackToRevisions:S,revisionNavigation:g,onBrowseHistory:N,onBlameFile:x,captureReviewProjections:f=!1,supportsLastEditor:m=!1,ignoreWhitespace:M=!1,onToggleIgnoreWhitespace:C,onProjectionRequestFailure:w,t:_}){const[y,B]=a.useState({}),[X,D]=a.useState({loaded:0,total:0}),[R,z]=a.useState({}),[Z,V]=a.useState(new Set),[E,O]=a.useState(null),[J,G]=a.useState(!1),[ne,ee]=a.useState(!1),te=a.useRef(new Set),fe=a.useRef(0),[K,ae]=a.useState(""),[d,P]=a.useState(0),[F,U]=a.useState(null),[W,ue]=a.useState(!1),[ie,q]=a.useState(null),A=a.useRef(null),xe=a.useRef(new Map),Oe=a.useRef(new Map),Y=a.useRef(null),re=a.useRef(null),oe=a.useRef(0),pe=Jt(),We=a.useRef(pe);a.useEffect(()=>{We.current=pe},[pe]);const Te=a.useCallback(c=>{We.current(c)},[]),Pe=It(),ke=Ps(),he=es(_),Ie=he.refreshOpenActions,{pending:Je,siteStates:me}=as(e,f),be=a.useMemo(()=>s.files.filter(c=>c.status==="?"&&c.path.endsWith("/")).map(c=>c.path).join("\0"),[s.files]);a.useEffect(()=>{B({}),z({}),V(new Set),te.current.clear()},[]),a.useEffect(()=>{let c=!1;if(o){D({loaded:0,total:0});return}const k=be?be.split("\0"):[];if(D({loaded:0,total:k.length}),k.length===0)return;let H=0,le=0;const De={};let ge=null;const Me=()=>{if(ge=null,c)return;const lt={...De};for(const pt of Object.keys(De))delete De[pt];Object.keys(lt).length>0&&B(pt=>({...pt,...lt})),D({loaded:le,total:k.length})},Ge=()=>{ge===null&&(ge=setTimeout(Me,No))},Rt=async()=>{for(;!c;){const lt=k[H++];if(lt===void 0)return;try{const pt=await de.getGitUntrackedFolder(e,lt);if(c)return;De[lt]=pt}catch{}finally{c||(le+=1,Ge())}}},an=Array.from({length:Math.min(Co,k.length)},Rt);return Promise.all(an).then(()=>{c||(ge!==null&&clearTimeout(ge),Me())}),()=>{c=!0,ge!==null&&clearTimeout(ge)}},[e,o,be]);const Le=a.useMemo(()=>new Map(((i==null?void 0:i.folders)??[]).map(({path:c,count:k})=>[c,k])),[i==null?void 0:i.folders]),Ce=a.useCallback(async c=>{if(!te.current.has(c)){te.current.add(c),V(new Set(te.current)),ee(!1);try{const k=await de.listGitUntrackedFiles(e,{path:c});B(H=>({...H,[c]:{path:c,files:k.files,...k.lastEditors?{lastEditors:k.lastEditors}:{},truncated:k.truncated,limit:k.limit}}))}catch{ee(!0)}finally{te.current.delete(c),V(new Set(te.current))}}},[e]);a.useEffect(()=>{if(o)for(const[c,k]of Le)k<=Qs&&R[c]!==!1&&!y[c]&&Ce(c)},[Le,y,Ce,o,R]),a.useEffect(()=>{fe.current+=1;const c=fe.current,k=K.trim();if(!o||k===""){O(null),G(!1);return}G(!0),ee(!1);const H=setTimeout(()=>{de.listGitUntrackedFiles(e,{q:k}).then(le=>{c===fe.current&&O(le)}).catch(()=>{c===fe.current&&(O(null),ee(!0))}).finally(()=>{c===fe.current&&G(!1)})},150);return()=>clearTimeout(H)},[K,e,o]);const ze=a.useRef(null),L=a.useMemo(()=>{var ge;const c=((E==null?void 0:E.files)??[]).map(Me=>{var Ge;return{path:Me,status:"?",staged:!1,linesAdded:null,linesDeleted:null,...(Ge=E==null?void 0:E.lastEditors)!=null&&Ge[Me]?{lastEditor:E.lastEditors[Me]}:{}}}),k=Mo([...Lo(s.files,y),...c]),H=((ge=ze.current)==null?void 0:ge.statusFiles)===s.files?ze.current.byPath:null,le=new Map,De=k.map(Me=>{const Ge=H==null?void 0:H.get(Me.path),Rt=Ge&&Fo(Ge,Me)?Ge:Me;return le.set(Me.path,Rt),Rt});return ze.current={statusFiles:s.files,byPath:le},De},[y,s.files,E]);a.useEffect(()=>{if(!F)return;const c=L.find(k=>k.path===F);c&&(A.current=c)},[L,F]);const Q=a.useMemo(()=>{const c=A.current;return W&&F&&(c==null?void 0:c.path)===F&&!L.some(k=>k.path===F)?[...L,c]:L},[W,L,F]),Fe=a.useMemo(()=>Q.filter(c=>!c.path.endsWith("/")),[Q]),je=Vs(Q,K),we=a.useMemo(()=>new Set(je.map(c=>c.path)),[je]),Se=a.useMemo(()=>Po({statusFiles:s.files,files:Q,folders:y,folderCounts:Le,folderExpansion:R,matchingPaths:we,query:K}),[Le,y,K,Q,we,s.files,R]),ve=a.useMemo(()=>Se.filter(c=>c.kind==="file"&&c.file.worktreeState!=="untracked"),[Se]),Be=a.useMemo(()=>Se.filter(c=>c.kind==="folder"||c.file.worktreeState==="untracked"),[Se]),dt=a.useMemo(()=>ve.flatMap(c=>c.kind==="file"?[{id:c.file.path,path:c.file.path,displayPath:Ke(c.file),statuses:[c.file.status],value:c.file}]:[]),[ve]),ht=a.useMemo(()=>Be.flatMap(c=>c.kind==="file"?[{id:c.file.path,path:c.file.path,displayPath:Ke(c.file),statuses:[c.file.status],value:c.file}]:[]),[Be]),Ve=a.useMemo(()=>Be.filter(c=>c.kind==="folder"),[Be]),mt=a.useMemo(()=>[...ve,...Be].flatMap(c=>c.kind==="file"?[c.file]:c.children.map(k=>k.file)),[ve,Be]),se=Fe.find(c=>c.path===F)??null,Ct=se?xe.current.get(se.path):void 0,Nt=se?Oe.current.get(se.path):void 0,et=b?Fe.find(c=>c.path===b):void 0,tt=b?`${e}\0${b}`:null,Ye=!!tt&&!!et&&ie!==tt;a.useEffect(()=>{var k;if(!Ye||!tt||!et)return;q(tt),U(et.path);const c=(k=Object.entries(y).find(([,H])=>H.files.includes(et.path)))==null?void 0:k[0];c&&z(H=>({...H,[c]:!0}))},[y,et,Ye,tt]),a.useEffect(()=>{var H;if(Ye)return;const c=mt,k=F&&c.some(le=>le.path===F)?F:n?((H=c[0])==null?void 0:H.path)??null:null;k!==F&&U(k)},[n,F,Ye,mt]),a.useLayoutEffect(()=>{var k;if(j<=oe.current)return;const c=(k=re.current)==null?void 0:k.querySelector("[data-source-file-item]");c&&(oe.current=j,_t(),c.focus({preventScroll:!0}))},[j]);const st=a.useMemo(()=>{const c=new Map;for(const k of Je)k.anchor.revision.kind==="uncommitted"&&c.set(k.anchor.path,(c.get(k.anchor.path)??0)+1);return c},[Je]),Bt=a.useMemo(()=>{const c=new Map;for(const k of me){const H=c.get(k.path);H?H.push(k):c.set(k.path,[k])}return c},[me]),Ut=a.useCallback((c,k,H)=>{if(o&&!H){z(le=>({...le,[c]:!0})),Ce(c);return}z(le=>({...le,[c]:!k}))},[Ce,o]),Ze=a.useCallback((c,k)=>{var H;c.path.endsWith("/")||n&&k&&((H=Y.current)!=null&&H.jumpToNextHunk())||U(c.path)},[n]),rt=a.useCallback((c,k)=>{xe.current.set(c,{...xe.current.get(c),...k})},[]),kt=a.useCallback((c,k)=>{Oe.current.set(c,k)},[]),ct=a.useCallback(c=>{const k=ls(ke).sessions.entities.get(c),H=Dn(k);return _("sourceOpenLastEditorSessionNamed",{title:H==="Untitled"?c.slice(0,8):H})},[ke,d,_]),nt=a.useCallback(c=>{const k=m&&c.lastEditor?`${Pe}/projects/${encodeURIComponent(e)}/sessions/${encodeURIComponent(c.lastEditor.sessionId)}`:void 0,H=c.lastEditor?ct(c.lastEditor.sessionId):_("sourceOpenLastEditorSession");return[{label:_("sourceCopyPath"),onSelect:()=>{vt(c.path)}},...k?[{label:H,onSelect:()=>Te(k)}]:[],...x?[{label:_("sourceBlameAtHead"),onSelect:()=>x(c.path)}]:[]]},[Pe,ct,Te,x,e,m,_]),at=a.useCallback(c=>{const k=ls(ke).sessions.entities.get(c);if(Ro(k))return null;const H=`${ke}\0${e}\0${c}`;let le=Tt.get(H);if(!le){const De=Date.now();le=de.getSessionMetadata(e,c).then(ge=>(cn(ke,ge.session,De),!0),()=>!1),Tt.set(H,le),le.finally(()=>{Tt.get(H)===le&&Tt.delete(H)})}return le},[ke,e]),T=a.useCallback(c=>{const k=Eo(c);return{contextKey:k,onOpen:()=>{var De;const H=(De=c.lastEditor)==null?void 0:De.sessionId;if(!m||!H)return;const le=at(H);le&&le.then(ge=>{ge&&(P(Me=>Me+1),Ie(k,nt(c)))})}}},[nt,at,Ie,m]),$=m&&(se!=null&&se.lastEditor)?`${Pe}/projects/${encodeURIComponent(e)}/sessions/${encodeURIComponent(se.lastEditor.sessionId)}`:void 0,Re=se!=null&&se.lastEditor?ct(se.lastEditor.sessionId):void 0,ye=se?t.jsx(qs,{path:se.path,lastEditorSessionHref:$,lastEditorSessionLabel:Re,onBlameFile:x,t:_}):null,Ue=({file:c,displayPath:k},H=k,le)=>t.jsx(To,{file:c,displayPath:H,pathProps:le,query:K,selected:F===c.path,commentCount:st.get(c.path)??0,reviewStates:Bt.get(c.path)??ko,isWideScreen:n,menuActionsForFile:nt,menuOpenOptionsForFile:T,menuTargetProps:he.targetProps,onOpenMenu:he.openFromButton,onActivateFile:Ze,t:_},c.path),Ht=W&&se!==null,ft=`working-tree-browser ${v?"working-tree-browser-history":""}`.trim(),Qe=S??N,rs=Qe?t.jsx(Ys,{onClick:Qe,t:_}):null,Gt=o&&i===null,qt=l||Gt,nn=l&&u||Gt&&r,cs=(l?p:null)??(Gt?h:null);return(s.isClean||L.length===0)&&!Ht&&!qt?t.jsxs("div",{ref:re,className:ft,"data-testid":"working-tree-browser",children:[rs,v?t.jsxs("div",{className:"working-tree-clean-state working-tree-history-clean",children:[t.jsx("span",{className:"working-tree-clean-icon","aria-hidden":"true",children:"✓"}),t.jsx("div",{className:"git-status-empty",children:_("gitStatusWorkingTreeClean")}),t.jsx("p",{children:_("sourceWorkingTreeCleanDescription")})]}):t.jsx("div",{className:"working-tree-clean-landing",children:t.jsxs("div",{className:"working-tree-clean-state",children:[t.jsx("span",{className:"working-tree-clean-icon","aria-hidden":"true",children:"✓"}),t.jsx("div",{className:"git-status-empty",children:_("gitStatusWorkingTreeClean")}),t.jsx("p",{children:_("sourceWorkingTreeCleanDescription")})]})})]}):t.jsxs("div",{ref:re,className:ft,"data-testid":"working-tree-browser",children:[rs,t.jsxs(Us,{layout:"files",enabled:!v,className:"working-tree-browser-columns",t:_,children:[t.jsxs("div",{className:"commit-files-column working-tree-files-column",children:[t.jsxs("div",{className:"source-detail-banner",children:[g,v?t.jsxs("span",{className:"source-detail-identity working-tree-detail-identity",children:[t.jsxs("span",{className:"working-tree-detail-title-row",children:[t.jsx("span",{className:"source-detail-subject",children:_("sourceWorkingTree")}),t.jsx("span",{className:"working-tree-detail-count",title:_("sourceChangedFileCount",{count:Q.length}),children:Q.length})]}),t.jsx("span",{className:"source-detail-title",title:_("sourceWorkingTreeDescription"),children:_("sourceUncommitted")})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"source-detail-title",title:_("sourceWorkingTreeDescription"),children:_("sourceUncommittedChanges")}),t.jsx("span",{className:"source-detail-count",children:_("sourceChangedFileCount",{count:Q.length})})]}),X.total>0&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedFolderScanProgress",{loaded:X.loaded,total:X.total})}),nn&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("gitStatusLoading")}),qt&&cs&&t.jsxs("span",{className:Ae.scanProgress,role:"alert",children:[_("gitStatusErrorPrefix")," ",cs.message]}),o&&(i==null?void 0:i.truncated)&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedCacheBounded",{count:i.total})}),J&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedSearchLoading")}),(E==null?void 0:E.truncated)&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedSearchTruncated",{count:E.files.length})}),ne&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedCacheError")}),t.jsx(zs,{query:K,onQueryChange:ae,t:_})]}),t.jsxs("div",{onKeyDown:Xt,children:[dt.length>0&&t.jsx(Pt,{className:"commit-file-list",items:dt,scopeKey:`${e}:working-tree:tracked`,query:K,renderFile:(c,k,H)=>Ue({file:c.value,displayPath:c.displayPath},k,H),t:_}),Be.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(En,{children:_("sourceUntrackedFiles")}),ht.length>0&&t.jsx(Pt,{className:"commit-file-list",items:ht,scopeKey:`${e}:working-tree:untracked`,query:K,renderFile:(c,k,H)=>Ue({file:c.value,displayPath:c.displayPath},k,H),t:_}),Ve.length>0&&t.jsx("ul",{className:"commit-file-list",children:Ve.map(c=>{var k,H,le,De;return t.jsxs("li",{className:Ae.folderGroup,children:[t.jsx("div",{className:Ae.folderHeader,children:t.jsxs(ts,{path:c.path,type:"button",className:"commit-file-item",disabled:Z.has(c.path)||!o&&!c.info||(o?(Le.get(c.path)??0)===0:!c.info||c.info.files.length===0),"aria-expanded":o||c.info?c.expanded:void 0,"aria-label":_(Z.has(c.path)||!o&&!c.info?"sourceLoadingUntrackedFolder":c.expanded?"sourceCollapseUntrackedFolder":"sourceExpandUntrackedFolder",{path:c.path}),"data-source-list-item":!0,onClick:()=>Ut(c.path,c.expanded,c.info!==void 0),children:[t.jsx("span",{className:Ae.disclosure,"aria-hidden":"true",children:Z.has(c.path)||!o&&!c.info?"…":c.expanded?"−":"+"}),t.jsx(ss,{status:"?",t:_}),t.jsx(ns,{query:K,fullPath:c.path,children:c.path}),(Le.get(c.path)??((k=c.info)==null?void 0:k.files.length))!==void 0&&t.jsxs("span",{className:Ae.folderCount,title:(H=c.info)!=null&&H.truncated?_("sourceUntrackedFolderTruncated",{count:c.info.files.length}):void 0,children:[Le.get(c.path)??((le=c.info)==null?void 0:le.files.length),(De=c.info)!=null&&De.truncated?"+":""]})]})}),c.children.length>0&&t.jsx(Pt,{className:Ae.folderChildren,items:c.children.map(ge=>({id:ge.file.path,path:ge.displayPath,displayPath:ge.displayPath,statuses:[ge.file.status],value:ge.file})),scopeKey:`${e}:working-tree:${c.path}`,query:K,renderFile:(ge,Me,Ge)=>Ue({file:ge.value,displayPath:ge.displayPath},Me,Ge),t:_})]},c.path)})})]})]}),Se.length===0&&!qt&&t.jsx("div",{className:"git-status-empty",children:_("sourceNoMatches")})]}),n&&se&&(se.worktreeState==="untracked"?t.jsxs("section",{className:Ae.currentContent,children:[ye&&t.jsx("div",{className:Ae.currentContentActions,children:ye}),t.jsx(ds,{projectId:e,filePath:se.path})]}):t.jsx(As,{ref:Y,file:se,fileKey:se.path,projectId:e,source:Ns,retainedScrollRatio:Nt,retainedDiffView:Ct,onRetainScrollRatio:kt,onRetainDiffView:rt,headerActions:ye,onCommentEditorOpenChange:ue,captureReviewProjections:f,ignoreWhitespace:M,onToggleIgnoreWhitespace:C,onProjectionRequestFailure:w,t:_}))]}),he.menu,!n&&se&&(se.worktreeState==="untracked"?t.jsxs(yt,{title:se.path,onClose:()=>U(null),closeOnBackGesture:!0,children:[ye&&t.jsx("div",{className:Ae.currentContentActions,children:ye}),t.jsx(ds,{projectId:e,filePath:se.path})]}):t.jsx(Ds,{file:se,fileKey:se.path,projectId:e,source:Ns,retainedScrollRatio:Nt,retainedDiffView:Ct,onRetainScrollRatio:kt,onRetainDiffView:rt,headerActions:ye,onCommentEditorOpenChange:ue,captureReviewProjections:f,ignoreWhitespace:M,onToggleIgnoreWhitespace:C,onProjectionRequestFailure:w,t:_,onClose:()=>U(null)}))]})}function Po({statusFiles:e,files:s,folders:n,folderCounts:o,folderExpansion:i,matchingPaths:r,query:h}){const l=h.trim().toLowerCase(),u=new Map(s.map(v=>[v.path,v])),p=new Set,b=[];for(const v of e){if(v.status==="?"&&v.path.endsWith("/")){const g=n[v.path],N=(g==null?void 0:g.files.flatMap(w=>{p.add(w);const _=u.get(w);return _?[{file:_,displayPath:w.startsWith(v.path)?w.slice(v.path.length):w}]:[]}))??[],x=l?N.filter(({file:w})=>r.has(w.path)):N,f=v.path.toLowerCase().includes(l);if(p.add(v.path),l&&!f&&x.length===0)continue;const m=o.get(v.path)??(g==null?void 0:g.files.length),M=i[v.path]??(m!==void 0?m<=Qs:!1),C=l?x.length>0:M;b.push({kind:"folder",path:v.path,...g?{info:g}:{},expanded:C,children:l?x:C?N:[]});continue}const S=u.get(v.path);!S||p.has(S.path)||(p.add(S.path),!(l&&!r.has(S.path))&&b.push({kind:"file",file:S,displayPath:Ke(S)}))}for(const v of s)p.has(v.path)||v.path.endsWith("/")||l&&!r.has(v.path)||b.push({kind:"file",file:v,displayPath:Ke(v)});return b}function Lo(e,s){return e.flatMap(n=>{const o=s[n.path];return n.status!=="?"||!n.path.endsWith("/")||!o?[n]:o.files.map(i=>{var h;const r=(h=o.lastEditors)==null?void 0:h[i];return{path:i,status:"?",staged:!1,linesAdded:null,linesDeleted:null,...r?{lastEditor:r}:{}}})})}function Fo(e,s){var n,o,i,r;return e.path===s.path&&e.status===s.status&&e.staged===s.staged&&e.worktreeState===s.worktreeState&&e.linesAdded===s.linesAdded&&e.linesDeleted===s.linesDeleted&&e.origPath===s.origPath&&((n=e.lastEditor)==null?void 0:n.sessionId)===((o=s.lastEditor)==null?void 0:o.sessionId)&&((i=e.lastEditor)==null?void 0:i.observedAt)===((r=s.lastEditor)==null?void 0:r.observedAt)}function Mo(e){const s=new Map;for(const n of e){const o=s.get(n.path);o?o.push(n):s.set(n.path,[n])}return Array.from(s.values(),n=>{var j,S;const o=n.find(g=>g.status==="?"),i=n.find(g=>g.staged),r=n.find(g=>!g.staged&&g.status!=="?"),h=n.find(g=>g.status==="R"||g.status==="C"),l=o??h??r??i??n[0],u=o?"untracked":i&&r?"both":i?"staged":"unstaged",p=n.length===1,b=(j=n.find(g=>g.origPath))==null?void 0:j.origPath,v=(S=n.find(g=>g.lastEditor))==null?void 0:S.lastEditor;return{path:l.path,status:l.status,staged:u==="staged",linesAdded:p?l.linesAdded:null,linesDeleted:p?l.linesDeleted:null,...b?{origPath:b}:{},...v?{lastEditor:v}:{},worktreeState:u}})}function Ao({state:e,t:s}){const n=e==="both"?s("sourceWorktreePartialDescription"):e==="staged"?s("sourceWorktreeStaged"):null,o=un(n);return n?t.jsx("span",{className:`worktree-file-state worktree-file-state-${e}`,role:"img","aria-label":n,...o,children:e==="both"?s("sourceWorktreePartial"):"✓"}):null}const zt=()=>{};function Do({projectId:e,status:s,isWideScreen:n,supportsUntrackedCache:o=!1,untrackedFiles:i=null,untrackedLoading:r=!1,untrackedError:h=null,inventoryPending:l=!1,inventoryLoading:u=!1,inventoryError:p=null,initialSha:b,initialPath:v,initialBlame:j=!1,showRevisionPane:S=!0,revisionHref:g=()=>"#",onSelectRevision:N,onBrowseHistory:x,onBlameFile:f,captureReviewProjections:m=!1,supportsProjections:M=!1,supportsInclusiveToHead:C=!1,supportsLastEditor:w=!1,ignoreWhitespace:_=!1,onToggleIgnoreWhitespace:y=zt,onProjectionUnavailable:B=zt,onProjectionRequestFailure:X=zt,t:D}){const R=a.useRef(null),z=a.useRef(null),Z=a.useRef(null),V=a.useRef(null),E=a.useRef(0),O=a.useRef(!1),[J,G]=a.useState(j),[ne,ee]=a.useState(0),[te,fe]=a.useState(0),[K,ae]=a.useState(null);a.useEffect(()=>{j&&G(!0)},[j]),hn(V);const{displayedCommits:d,displayedKeys:P,hasMore:F,loadingList:U,listError:W,loadMore:ue,searchQuery:ie,setSearchQuery:q,searchIndexRequested:A,setSearchIndexRequested:xe,searchActive:Oe,searchIndex:Y,commitSearchMatches:re,selectedKey:oe,setSelectedKey:pe,selectedIsWorkingTree:We,selectedSha:Te,selectedCommit:Pe,showWorkingTreeRevision:ke,detail:he,loadingDetail:Ie,detailError:Je,selectedPath:me,setSelectedPath:be,selectedFiles:Le,selectedFile:Ce,compareToHead:ze,loadingComparison:L,toggleComparison:Q,openDirectComparison:Fe,handleProjectionRequestFailure:je,messageView:we,setMessageView:Se,source:ve,diffFileKey:Be,newerKey:dt,olderKey:ht}=io({projectId:e,status:s,isWideScreen:n,initialSha:b,initialPath:v,supportsInclusiveToHead:C,onProjectionUnavailable:B,onProjectionRequestFailure:X,t:D}),{pending:Ve,siteStates:mt}=as(e,m),se=Aa(e),Ct=a.useMemo(()=>{const T=new Map;for(const $ of Ve)if($.anchor.revision.kind==="sha"){const{sha:Re}=$.anchor.revision;T.set(Re,(T.get(Re)??0)+1)}return T},[Ve]),Nt=a.useMemo(()=>Ve.filter(T=>T.anchor.revision.kind==="uncommitted").length,[Ve]),et=a.useMemo(()=>{const T=new Map;for(const $ of Ve)$.anchor.revision.kind==="sha"&&$.anchor.revision.sha===Te&&T.set($.anchor.path,(T.get($.anchor.path)??0)+1);return T},[Ve,Te]),tt=a.useMemo(()=>{const T=new Map;for(const $ of mt){const Re=T.get($.path);Re?Re.push($):T.set($.path,[$])}return T},[mt]),Ye=a.useCallback((T,$)=>{var Re;if(ae($&&T!==He?T:null),!n){const ye=(Re=z.current)==null?void 0:Re.closest(".page-scroll-container");E.current=(ye==null?void 0:ye.scrollTop)??0}pe(T),N==null||N(T===He?null:T)},[n,N,pe]),st=a.useCallback(T=>Ye(T,!1),[Ye]),Bt=a.useCallback(T=>{Ye(T,!0),T===He&&fe($=>$+1)},[Ye]),Ut=a.useCallback(T=>{ae(null),pe(T)},[pe]),Ze=(ve==null?void 0:ve.kind)==="commit"?ve.sha:(ve==null?void 0:ve.kind)==="comparison"||(ve==null?void 0:ve.kind)==="inclusive-comparison"?ve.headSha:void 0,rt=a.useCallback(()=>{Se(!1),G(T=>!T)},[Se]),kt=a.useCallback(T=>{be(T),Se(!1),G(!0)},[Se,be]),ct=Ce?t.jsx(qs,{path:Ce.path,onBlameFile:Ze?rt:void 0,blameTitle:D("sourceToggleBlame"),t:D}):null,nt=a.useCallback(()=>{O.current=!0,pe(null),be(null),Se(!1)},[Se,pe,be]);$o(!n&&oe!==null,nt);const at=a.useCallback(()=>{var T;if(typeof window<"u"&&((T=window.history.state)!=null&&T.yaCommitDetail)){window.history.back();return}nt()},[nt]);return a.useEffect(()=>{const T=$=>{var Re;if(!($.defaultPrevented||$.altKey||$.ctrlKey||$.metaKey||mn($.target)||document.querySelector('[role="dialog"]'))){if(n&&!$.shiftKey&&Te&&($.key==="["||$.key==="]")){const ye=Le.filter(Qe=>!Qe.path.endsWith("/")),Ue=we?-1:ye.findIndex(Qe=>Qe.path===me||Qe.origPath===me),Ht=Ue<0?0:Ue+($.key==="]"?1:-1),ft=ye[Ht];if(!ft)return;$.preventDefault(),_t(),G(!1),be(ft.path),Se(!1),ee(Qe=>Qe+1);return}if(n&&!$.shiftKey&&!we&&!J&&($.key==="PageDown"||$.key==="PageUp")){const ye=R.current;if(!ye)return;$.preventDefault(),_t(),ye.scrollByPage($.key==="PageDown"?1:-1);return}if($.key==="Escape"){if(!n&&oe){$.preventDefault(),at();return}ie&&($.preventDefault(),q(""),(Re=V.current)==null||Re.focus())}}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[at,n,we,ie,Le,oe,me,Te,Se,be,q,J]),a.useEffect(()=>{if(!K||K!==Te||Ie||!he)return;const T=Le.find($=>!$.path.endsWith("/"));ae(null),T&&(_t(),G(!1),be(T.path),Se(!1),ee($=>$+1))},[he,Ie,K,Le,Te,Se,be]),a.useLayoutEffect(()=>{var $,Re,ye;if(n)return;const T=($=z.current)==null?void 0:$.closest(".page-scroll-container");if(oe){const Ue=Z.current??((Re=z.current)==null?void 0:Re.querySelector(".working-tree-browser-history"));(ye=Ue==null?void 0:Ue.scrollIntoView)==null||ye.call(Ue,{block:"start"});return}O.current&&T&&(O.current=!1,T.scrollTop=E.current)},[n,oe]),t.jsxs("div",{className:"commit-browser",ref:z,children:[t.jsxs(Us,{layout:"history",revisionPaneVisible:S,className:"commit-browser-columns",t:D,children:[S&&(n||!oe)?t.jsx(fo,{status:s,isWideScreen:n,searchInputRef:V,searchQuery:ie,searchIndexRequested:A,searchIndexing:Y.indexing,indexedCount:Y.indexedCount,totalCount:Y.totalCount,searchError:Y.error,searchActive:Oe,displayedCommits:d,commitSearchMatches:re,displayedKeys:P,selectedKey:oe,selectedIsWorkingTree:We,showWorkingTreeRevision:ke,loadingList:U,listError:W,hasMore:F,workingTreeCommentCount:Nt,commentCountBySha:Ct,isRead:se.isRead,onSearchQueryChange:q,onSearchIndexRequested:()=>xe(!0),onOpenRevision:st,onEnterRevision:Bt,revisionHref:T=>g(T===He?null:T),onFocusRevision:Ut,onLoadMore:()=>{ue()},onMarkReadTo:se.markReadTo,onMarkUnreadSince:se.markUnreadSince,t:D}):S?null:t.jsx("div",{className:"commit-list-column","aria-hidden":"true"}),We&&s&&t.jsx(Js,{projectId:e,status:s,isWideScreen:n,supportsUntrackedCache:o,untrackedFiles:i,untrackedLoading:r,untrackedError:h,inventoryPending:l,inventoryLoading:u,inventoryError:p,embeddedInHistory:!0,fileFocusRequest:te,onBackToRevisions:S?n?void 0:at:x,revisionNavigation:t.jsx(ks,{newerKey:dt,olderKey:ht,onSelect:st,t:D}),onBlameFile:f,captureReviewProjections:m,supportsLastEditor:w,ignoreWhitespace:_,onToggleIgnoreWhitespace:y,onProjectionRequestFailure:je,t:D}),Te&&t.jsx(Ja,{columnRef:Z,selectedSha:Te,selectedCommit:Pe,detail:he,loading:Ie||ze&&L,detailError:Je,compareToHead:ze,supportsInclusiveToHead:C,isWideScreen:n,messageView:we,selectedFiles:Le,selectedPath:me,fileFocusRequest:ne,fileCommentCount:et,reviewStatesByPath:tt,revisionNavigation:t.jsx(ks,{newerKey:dt,olderKey:ht,onSelect:st,t:D}),onBack:S?n?void 0:at:x,onToggleComparison:Q,onCompareFileToHead:M?T=>{G(!1),Fe(T)}:void 0,onShowMessage:()=>{G(!1),Se(!0)},onPageDiff:T=>{var $;return($=R.current)==null?void 0:$.scrollByPage(T)},onFocusFile:T=>{be(T.path),Se(!1)},onFilteredSelectionChange:T=>{be((T==null?void 0:T.path)??null),Se(!1)},onActivateFile:T=>{var $;me===T.path&&!we&&(($=R.current)!=null&&$.jumpToNextHunk())||(be(T.path),Se(!1))},onBlameFile:Ze?kt:void 0,onMarkReadTo:se.markReadTo,onMarkUnreadSince:se.markUnreadSince,t:D}),n&&(we&&he?t.jsx(Rs,{detail:he,t:D}):J&&Ce&&Ze?t.jsx(fs,{projectId:e,path:Ce.path,rev:Ze,onOpenCommit:st,onToggleBlame:rt,captureReviewProjections:m,t:D}):Ce&&ve&&Be?t.jsx(As,{ref:R,file:Ce,fileKey:Be,projectId:e,source:ve,captureReviewProjections:m,headerActions:ct,ignoreWhitespace:_,onToggleIgnoreWhitespace:y,onProjectionRequestFailure:je,t:D}):null)]}),!n&&we&&he&&t.jsx(yt,{title:he.shortHash,onClose:()=>Se(!1),closeOnBackGesture:!0,children:t.jsx(Rs,{detail:he,t:D})}),!n&&!we&&Ce&&ve&&Be&&(J&&Ze?t.jsx(yt,{title:Ce.path,onClose:()=>be(null),closeOnBackGesture:!0,children:t.jsx(fs,{projectId:e,path:Ce.path,rev:Ze,onOpenCommit:st,onToggleBlame:rt,captureReviewProjections:m,t:D})}):t.jsx(Ds,{file:Ce,fileKey:Be,projectId:e,source:ve,captureReviewProjections:m,headerActions:ct,ignoreWhitespace:_,onToggleIgnoreWhitespace:y,onProjectionRequestFailure:je,t:D,onClose:()=>be(null)}))]})}function ks({newerKey:e,olderKey:s,onSelect:n,t:o}){return t.jsxs("span",{className:"source-detail-jump",children:[t.jsxs("button",{type:"button",className:"commit-jump-btn",title:o("sourceNewerCommit"),"aria-label":o("sourceNewerCommit"),disabled:!e,onClick:()=>e&&n(e),children:[t.jsx("span",{className:"commit-jump-glyph","aria-hidden":"true",children:"↑"}),t.jsx("span",{className:"commit-jump-touch-label",children:o("sourceNewerCommit")})]}),t.jsxs("button",{type:"button",className:"commit-jump-btn",title:o("sourceOlderCommit"),"aria-label":o("sourceOlderCommit"),disabled:!s,onClick:()=>s&&n(s),children:[t.jsx("span",{className:"commit-jump-glyph","aria-hidden":"true",children:"↓"}),t.jsx("span",{className:"commit-jump-touch-label",children:o("sourceOlderCommit")})]})]})}function $o(e,s){const n=a.useRef(s);n.current=s,a.useEffect(()=>{if(!e||typeof window>"u")return;const o=window.history.state??{};window.history.pushState({...o,yaCommitDetail:!0},"");let i=!1;const r=h=>{const l=h.state;l!=null&&l.yaCommitDetail||(i=!0,n.current())};return window.addEventListener("popstate",r),()=>{var h;window.removeEventListener("popstate",r),!i&&((h=window.history.state)!=null&&h.yaCommitDetail)&&window.history.back()}},[e])}function Rs({detail:e,t:s}){const n=e.body?`${e.subject}
|
|
8
|
+
`,n+s.length),r=i<0?e.deltaText.length:i;return{field:"change",text:e.deltaText.slice(o,r)}}const _s=20,ws=new Map;function oo(e,s,n){const o=a.useRef(new vs),[i,r]=a.useState(0),[h,l]=a.useState(!1),[u,p]=a.useState(0),[b,v]=a.useState(0),[y,S]=a.useState(null);return a.useEffect(()=>{if(!n)return;let N=!1;return l(!0),p(0),v(0),S(null),(async()=>{try{const x=await de.getGitCommitSearchManifest(e);if(N)return;let f=ws.get(e);if(!f||f.head!==x.head){const m=new vs;m.reset(x.commits),f={head:x.head,index:m,indexedCount:0,totalCount:x.commits.length,complete:x.commits.length===0},ws.set(e,f)}o.current=f.index,p(f.indexedCount),v(f.totalCount),r(m=>m+1);for(let m=f.indexedCount;m<x.commits.length;m+=_s){const M=x.commits.slice(m,m+_s),C=await de.getGitCommitSearchRecords(e,M.map(w=>w.hash));if(N)return;if(C.records.length!==M.length)throw new Error("Commit search index returned an incomplete batch");f.index.update(C.records),f.indexedCount=m+M.length,p(f.indexedCount),r(w=>w+1)}f.complete=!0}catch(x){N||S(x instanceof Error?x.message:"Failed to build commit search index")}finally{N||l(!1)}})(),()=>{N=!0}},[n,e]),{results:a.useMemo(()=>o.current.search(s),[s,i]),indexing:h,indexedCount:u,totalCount:b,error:y}}const js=50,He="working-tree";function io({projectId:e,status:s,isWideScreen:n,initialSha:o,initialPath:i,supportsInclusiveToHead:r,onProjectionUnavailable:h,onProjectionRequestFailure:l,t:u}){var ze;const[p,b]=a.useState([]),[v,y]=a.useState(!1),[S,g]=a.useState(!0),[N,x]=a.useState(null),[f,m]=a.useState(o??null),[M,C]=a.useState(null),[w,_]=a.useState(!1),[j,B]=a.useState(null),[X,D]=a.useState(i??null),[R,z]=a.useState(!1),[Z,V]=a.useState(null),[E,O]=a.useState(!1),[J,G]=a.useState(null),[ne,ee]=a.useState(null),te=a.useRef(0),[fe,K]=a.useState(!1),[ae,d]=a.useState(""),[P,F]=a.useState(!1),U=ae.trim().length>0,W=oo(e,ae,P);a.useEffect(()=>{!n&&ae.trim().length>0&&m(null)},[n,ae]);const ue=U?W.results.map(L=>L.commit):p,ie=a.useMemo(()=>new Map(W.results.map(L=>[L.commit.hash,L.match])),[W.results]),q=f===He,A=f&&!q?f:null,xe=a.useMemo(()=>!M||M.hash!==A||ue.some(L=>L.hash===M.hash)?ue:[M,...ue],[M,ue,A]),Oe=s!==void 0,Y=a.useMemo(()=>[...Oe?[He]:[],...xe.map(L=>L.hash)],[xe,Oe]);a.useEffect(()=>{o&&m(o)},[o]),a.useEffect(()=>{let L=!1;return g(!0),x(null),b([]),m(o??null),de.getGitCommits(e,{limit:js}).then(Q=>{L||(b(Q.commits),y(Q.hasMore),g(!1))}).catch(Q=>{L||(x(Q instanceof Error?Q.message:u("gitStatusLoading")),g(!1))}),()=>{L=!0}},[o,e,u]);const re=s!=null&&s.isClean?((ze=xe[0])==null?void 0:ze.hash)??(S?void 0:He):Y[0];a.useEffect(()=>{U||!n&&!(s!=null&&s.isClean)||!re||m(L=>L&&(Y.includes(L)||o!==void 0&&L===o)?L:re)},[re,Y,o,n,U,s==null?void 0:s.isClean]);const oe=a.useCallback(async()=>{try{const L=await de.getGitCommits(e,{limit:js,skip:p.length});b(Q=>{const Fe=new Set(Q.map(ye=>ye.hash));return[...Q,...L.commits.filter(ye=>!Fe.has(ye.hash))]}),y(L.hasMore)}catch(L){x(L instanceof Error?L.message:u("gitStatusLoading"))}},[p.length,e,u]),pe=a.useCallback(L=>{te.current+=1,G(null),ee(null),z(!1),V(null),O(!1),l(L)},[l]),We=a.useCallback(async L=>{if(!A)return;const Q=te.current+1;te.current=Q,z(!1),V(null),D(L.path),K(!1);try{const Fe=await de.getGitComparison(e,A);if(Q!==te.current)return;const ye=Fe.files.find(we=>we.path===L.path||we.origPath===L.path);D((ye==null?void 0:ye.path)??L.path),G(Fe),ee(ye??{...L,status:"M",staged:!1,linesAdded:null,linesDeleted:null})}catch(Fe){if(Q!==te.current)return;pe(Fe)}},[pe,e,A]),Te=a.useCallback(()=>{if(te.current+=1,G(null),ee(null),R){z(!1),V(null),O(!1);return}if(!r){h();return}z(!0),O(!0),K(!1)},[R,h,r]);a.useEffect(()=>{if(te.current+=1,G(null),ee(null),!A){C(null),_(!1),B(null),D(null),K(!1);return}let L=!1;return _(!0),B(null),C(null),D(i??null),K(!1),de.getGitCommit(e,A).then(Q=>{L||(C(Q),_(!1))}).catch(Q=>{L||(B(Q instanceof Error?Q.message:u("gitStatusLoading")),_(!1))}),()=>{L=!0}},[i,e,A,u]),a.useEffect(()=>{if(!R||!A||!r){V(null),O(!1),R&&!r&&(z(!1),h());return}let L=!1;return V(null),O(!0),de.getGitInclusiveComparison(e,A).then(Q=>{L||(V(Q),O(!1))}).catch(Q=>{L||pe(Q)}),()=>{L=!0}},[R,pe,h,e,A,r]);const Pe=a.useMemo(()=>Rn(R?(Z==null?void 0:Z.files)??[]:(M==null?void 0:M.files)??[]),[R,Z==null?void 0:Z.files,M==null?void 0:M.files]);a.useEffect(()=>{if(R&&E)return;const L=i?Pe.find(Q=>Q.path===i||Q.origPath===i):void 0;!n&&!L||D(Q=>{var ye;const Fe=Q?Pe.find(we=>we.path===Q||we.origPath===Q):void 0;return(L==null?void 0:L.path)??(Fe==null?void 0:Fe.path)??((ye=Pe.find(we=>!we.path.endsWith("/")))==null?void 0:ye.path)??null})},[R,i,n,E,Pe]),a.useEffect(()=>{ne&&ne.path!==X&&(G(null),ee(null))},[ne,X]);const ke=X?Pe.find(L=>L.path===X)??null:null,he=ne??ke,Ie=A&&J&&ne?{kind:"comparison",baseSha:J.baseSha,headSha:J.headSha}:A&&R&&Z?{kind:"inclusive-comparison",baseSha:Z.baseSha,headSha:Z.headSha}:A?{kind:"commit",sha:A}:void 0,Je=A&&he?J&&ne?`tree:${J.baseSha}:${J.headSha}:${he.path}`:R&&Z?`${Z.baseSha}:${Z.headSha}:${he.path}`:`${A}:${he.path}`:null,me=f?Y.indexOf(f):-1,be=me>0?Y[me-1]:void 0,Le=me>=0&&me<Y.length-1?Y[me+1]:void 0,Ce=A?xe.find(L=>L.hash===A):void 0;return{commits:p,displayedCommits:xe,displayedKeys:Y,hasMore:v,loadingList:S,listError:N,loadMore:oe,searchQuery:ae,setSearchQuery:d,searchIndexRequested:P,setSearchIndexRequested:F,searchActive:U,searchIndex:W,commitSearchMatches:ie,selectedKey:f,setSelectedKey:m,selectedIsWorkingTree:q,selectedSha:A,selectedCommit:Ce,showWorkingTreeRevision:Oe,detail:M,loadingDetail:w,detailError:j,selectedPath:X,setSelectedPath:D,selectedFiles:Pe,selectedFile:he,compareToHead:R,loadingComparison:E,toggleComparison:Te,openDirectComparison:We,handleProjectionRequestFailure:pe,messageView:fe,setMessageView:K,source:Ie,diffFileKey:Je,newerKey:be,olderKey:Le}}const ro="_link_1tjl7_1",co="_dirty_1tjl7_5",lo="_dirtySelected_1tjl7_10",uo="_dirtyLabel_1tjl7_14",ho="_cleanLabel_1tjl7_15",mo="_matchContext_1tjl7_27",it={link:ro,dirty:co,dirtySelected:lo,dirtyLabel:uo,cleanLabel:ho,matchContext:mo};function fo({status:e,isWideScreen:s,searchInputRef:n,searchQuery:o,searchIndexRequested:i,searchIndexing:r,indexedCount:h,totalCount:l,searchError:u,searchActive:p,displayedCommits:b,commitSearchMatches:v,selectedKey:y,selectedIsWorkingTree:S,showWorkingTreeRevision:g,loadingList:N,listError:x,hasMore:f,workingTreeCommentCount:m,commentCountBySha:M,isRead:C,onSearchQueryChange:w,onSearchIndexRequested:_,onOpenRevision:j,onEnterRevision:B,revisionHref:X,onFocusRevision:D,onLoadMore:R,onMarkReadTo:z,onMarkUnreadSince:Z,displayedKeys:V,t:E}){const O=es(E),J=a.useRef(null),G=a.useRef(!0),ne=a.useCallback((d,P)=>{const F=V.indexOf(d),U=F>0?V[F-1]:void 0,W=F>=0&&F<V.length-1?V[F+1]:void 0;return P?[{label:E("sourceCopyCommitHash"),onSelect:()=>{vt(P.hash)}},{label:E("sourceCopyCommitSubject"),onSelect:()=>{vt(P.subject)}},{label:E("sourceMarkReadToHere"),separatorBefore:!0,onSelect:()=>z(P.authorDate)},{label:E("sourceMarkUnreadSinceHere"),onSelect:()=>Z(P.authorDate)},{label:E("sourceNewerCommit"),separatorBefore:!0,disabled:!U,onSelect:()=>U&&j(U)},{label:E("sourceOlderCommit"),disabled:!W,onSelect:()=>W&&j(W)}]:[{label:E("sourceCopyRevisionLabel"),onSelect:()=>{vt(E("sourceWorkingTree"))}},{label:E("sourceNewerCommit"),disabled:!U,onSelect:()=>U&&j(U)},{label:E("sourceOlderCommit"),disabled:!W,onSelect:()=>W&&j(W)}]},[V,z,Z,j,E]),ee=b.length===0&&!g,te=(e==null?void 0:e.isClean)===!0,fe=e?new Set(e.files.map(d=>d.path)).size:0,K=ne(He),ae=O.targetProps(K,()=>j(He));return a.useLayoutEffect(()=>{var P;if(N){G.current=!0;return}if(!s||!G.current||!y)return;const d=(P=J.current)==null?void 0:P.querySelector(".commit-list-item.selected");d&&(G.current=!1,_t(),d.focus({preventScroll:!0}))},[s,N,y]),t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"commit-list-column",children:[t.jsxs("div",{className:"source-search-field",children:[t.jsx("input",{ref:n,type:"search",className:"source-search-input",value:o,placeholder:E("sourceSearchCommits"),"aria-keyshortcuts":"/",onFocus:_,onKeyDown:d=>{d.key==="Escape"&&o&&(d.preventDefault(),w(""))},onChange:d=>{_(),w(d.target.value)}}),t.jsx("kbd",{className:"source-search-shortcut",children:"/"}),t.jsx(ao,{t:E})]}),i&&r&&t.jsx("div",{className:"source-search-index-status",children:l>0?E("sourceIndexingCommits",{indexed:h,total:l}):E("sourcePreparingCommitIndex")}),N&&!p&&ee?t.jsx("div",{className:"git-diff-loading",children:E("gitStatusLoading")}):x&&!p&&ee?t.jsx("div",{className:"git-diff-error",children:x}):p&&r&&ee?t.jsx("div",{className:"git-diff-loading",children:E("sourceSearching")}):p&&u&&ee?t.jsx("div",{className:"git-diff-error",children:u}):ee?t.jsx("div",{className:"git-status-empty",children:E(p?"sourceNoMatches":"sourceNoCommits")}):t.jsxs(t.Fragment,{children:[t.jsxs("ol",{ref:J,className:"commit-list",onKeyDown:Xt,children:[g&&t.jsxs("li",{className:`commit-list-row commit-list-working-tree ${Ft}`,children:[t.jsxs("a",{className:`commit-list-item ${it.link} unread ${te?"":it.dirty} ${S?"selected":""} ${!te&&S?it.dirtySelected:""}`,href:X(He),"data-source-list-item":!0,onFocus:()=>{s&&D(He)},...ae,onKeyDown:d=>{ae.onKeyDown(d),ys(d,He,B)},onClick:d=>{Cs(d)||(d.preventDefault(),ae.onClick())},children:[t.jsxs("span",{className:"commit-subject-row",children:[t.jsx("span",{className:"commit-subject",children:E("sourceWorkingTree")}),m>0&&t.jsx("span",{className:"source-comment-badge",title:E("sourceCommentCount",{count:m}),children:m})]}),t.jsx("span",{className:"commit-meta",children:te?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:it.cleanLabel,children:E("gitStatusClean")}),t.jsx("span",{children:E("sourceWorkingTreeCleanDescription")})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:it.dirtyLabel,children:E("sourceUncommitted")}),t.jsx("span",{children:E("sourceChangedFileCount",{count:fe})})]})})]}),t.jsx(Mt,{actions:K,label:E("sourceMoreActions"),onOpen:O.openFromButton})]}),b.map(d=>{const P=M.get(d.hash)??0,F=ne(d.hash,d),U=O.targetProps(F,()=>j(d.hash)),W=v.get(d.hash),ue=go(d.authorDate),ie=po(W,o,ue);return t.jsxs("li",{className:`commit-list-row ${Ft}`,children:[t.jsxs("a",{className:`commit-list-item ${it.link} ${y===d.hash?"selected":""} ${C(d.authorDate)?"read":"unread"}`,href:X(d.hash),"data-source-list-item":!0,onFocus:()=>{s&&D(d.hash)},...U,onKeyDown:q=>{U.onKeyDown(q),ys(q,d.hash,B)},onClick:q=>{Cs(q)||(q.preventDefault(),U.onClick())},children:[t.jsxs("span",{className:"commit-subject-row",children:[t.jsx(gt,{className:"commit-subject",text:d.subject,query:(W==null?void 0:W.field)==="subject"?o:void 0,title:d.subject}),P>0&&t.jsx("span",{className:"source-comment-badge",title:E("sourceCommentCount",{count:P}),children:P})]}),t.jsxs("span",{className:"commit-meta",children:[t.jsx(gt,{className:"commit-hash",text:d.shortHash,query:(W==null?void 0:W.field)==="shortHash"?o:void 0}),t.jsx(gt,{className:"commit-author",text:d.authorName,query:(W==null?void 0:W.field)==="author"?o:void 0}),t.jsx(gt,{className:"commit-date",text:ue,query:(W==null?void 0:W.field)==="date"&&Bs(ue,o)?o:void 0})]}),ie&&t.jsx(gt,{className:it.matchContext,text:ie,query:o,title:ie})]}),t.jsx(Mt,{actions:F,label:E("sourceMoreActions"),onOpen:O.openFromButton})]},d.hash)})]}),x&&t.jsx("div",{className:"git-diff-error",children:x}),f&&!p&&t.jsx("button",{type:"button",className:"commit-load-more",onClick:R,children:E("sourceLoadMore")})]})]}),O.menu]})}function ys(e,s,n){e.defaultPrevented||e.key!=="Enter"||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),e.repeat||n(s))}function Cs(e){return e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey}function po(e,s,n){return e&&(e.field==="change"||e.field==="hash"||e.field==="date"&&!Bs(n,s))?e.text:null}function go(e){const s=new Date(e);return Number.isNaN(s.getTime())?"":s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}const xo="_folderGroup_rkotr_1",bo="_folderHeader_rkotr_6",So="_disclosure_rkotr_12",vo="_folderCount_rkotr_21",_o="_folderChildren_rkotr_34",wo="_scanProgress_rkotr_41",jo="_currentContent_rkotr_50",yo="_currentContentActions_rkotr_61",Ae={folderGroup:xo,folderHeader:bo,disclosure:So,folderCount:vo,folderChildren:_o,scanProgress:wo,currentContent:jo,currentContentActions:yo},Ns={kind:"working-tree-history"},Co=4,No=100,Qs=10,Tt=new Map,ko=[];function Ro(e){return(e==null?void 0:e.title)!==void 0||(e==null?void 0:e.fullTitle)!==void 0||(e==null?void 0:e.customTitle)!==void 0}function Eo(e){var s;return`${e.path}\0${((s=e.lastEditor)==null?void 0:s.sessionId)??""}`}const To=a.memo(function({file:s,displayPath:n=Ke(s),pathProps:o,query:i,selected:r,commentCount:h,reviewStates:l,isWideScreen:u,menuActionsForFile:p,menuOpenOptionsForFile:b,menuTargetProps:v,onOpenMenu:y,onActivateFile:S,t:g}){const N=s.path.endsWith("/"),x=p(s),f=b(s),m=Ke(s);return t.jsxs("li",{className:`commit-file-row ${Ft}`,children:[t.jsxs(ts,{path:m,type:"button",className:`commit-file-item ${r?"selected":""}`,disabled:N,"data-source-list-item":!0,"data-source-file-item":!0,onFocus:()=>{u&&!N&&!r&&S(s,r)},...v(x,()=>{S(s,r)},f),children:[t.jsx(ss,{status:s.status,t:g}),t.jsx(Ao,{state:s.worktreeState,t:g}),t.jsx(ns,{...o,query:i,fullPath:m,children:n}),(s.linesAdded!==null||s.linesDeleted!==null)&&t.jsxs("span",{className:"git-line-counts",children:[s.linesAdded?t.jsxs("span",{className:"git-lines-added",children:["+",s.linesAdded]}):null,s.linesDeleted?t.jsxs("span",{className:"git-lines-deleted",children:["−",s.linesDeleted]}):null]}),h>0&&t.jsx("span",{className:"source-comment-badge",title:g("sourceCommentCount",{count:h}),children:h}),t.jsx(Is,{states:l,t:g})]}),!N&&t.jsx(Mt,{actions:x,label:g("sourceMoreActions"),onOpen:y,openOptions:f})]})});function Js({projectId:e,status:s,isWideScreen:n,supportsUntrackedCache:o=!1,untrackedFiles:i=null,untrackedLoading:r=!1,untrackedError:h=null,inventoryPending:l=!1,inventoryLoading:u=!1,inventoryError:p=null,initialWorkingTreePath:b,embeddedInHistory:v=!1,fileFocusRequest:y=0,onBackToRevisions:S,revisionNavigation:g,onBrowseHistory:N,onBlameFile:x,captureReviewProjections:f=!1,supportsLastEditor:m=!1,ignoreWhitespace:M=!1,onToggleIgnoreWhitespace:C,onProjectionRequestFailure:w,t:_}){const[j,B]=a.useState({}),[X,D]=a.useState({loaded:0,total:0}),[R,z]=a.useState({}),[Z,V]=a.useState(new Set),[E,O]=a.useState(null),[J,G]=a.useState(!1),[ne,ee]=a.useState(!1),te=a.useRef(new Set),fe=a.useRef(0),[K,ae]=a.useState(""),[d,P]=a.useState(0),[F,U]=a.useState(null),[W,ue]=a.useState(!1),[ie,q]=a.useState(null),A=a.useRef(null),xe=a.useRef(new Map),Oe=a.useRef(new Map),Y=a.useRef(null),re=a.useRef(null),oe=a.useRef(0),pe=Jt(),We=a.useRef(pe);a.useEffect(()=>{We.current=pe},[pe]);const Te=a.useCallback(c=>{We.current(c)},[]),Pe=It(),ke=Ps(),he=es(_),Ie=he.refreshOpenActions,{pending:Je,siteStates:me}=as(e,f),be=a.useMemo(()=>s.files.filter(c=>c.status==="?"&&c.path.endsWith("/")).map(c=>c.path).join("\0"),[s.files]);a.useEffect(()=>{B({}),z({}),V(new Set),te.current.clear()},[]),a.useEffect(()=>{let c=!1;if(o){D({loaded:0,total:0});return}const k=be?be.split("\0"):[];if(D({loaded:0,total:k.length}),k.length===0)return;let H=0,le=0;const De={};let ge=null;const Me=()=>{if(ge=null,c)return;const lt={...De};for(const pt of Object.keys(De))delete De[pt];Object.keys(lt).length>0&&B(pt=>({...pt,...lt})),D({loaded:le,total:k.length})},Ge=()=>{ge===null&&(ge=setTimeout(Me,No))},Rt=async()=>{for(;!c;){const lt=k[H++];if(lt===void 0)return;try{const pt=await de.getGitUntrackedFolder(e,lt);if(c)return;De[lt]=pt}catch{}finally{c||(le+=1,Ge())}}},an=Array.from({length:Math.min(Co,k.length)},Rt);return Promise.all(an).then(()=>{c||(ge!==null&&clearTimeout(ge),Me())}),()=>{c=!0,ge!==null&&clearTimeout(ge)}},[e,o,be]);const Le=a.useMemo(()=>new Map(((i==null?void 0:i.folders)??[]).map(({path:c,count:k})=>[c,k])),[i==null?void 0:i.folders]),Ce=a.useCallback(async c=>{if(!te.current.has(c)){te.current.add(c),V(new Set(te.current)),ee(!1);try{const k=await de.listGitUntrackedFiles(e,{path:c});B(H=>({...H,[c]:{path:c,files:k.files,...k.lastEditors?{lastEditors:k.lastEditors}:{},truncated:k.truncated,limit:k.limit}}))}catch{ee(!0)}finally{te.current.delete(c),V(new Set(te.current))}}},[e]);a.useEffect(()=>{if(o)for(const[c,k]of Le)k<=Qs&&R[c]!==!1&&!j[c]&&Ce(c)},[Le,j,Ce,o,R]),a.useEffect(()=>{fe.current+=1;const c=fe.current,k=K.trim();if(!o||k===""){O(null),G(!1);return}G(!0),ee(!1);const H=setTimeout(()=>{de.listGitUntrackedFiles(e,{q:k}).then(le=>{c===fe.current&&O(le)}).catch(()=>{c===fe.current&&(O(null),ee(!0))}).finally(()=>{c===fe.current&&G(!1)})},150);return()=>clearTimeout(H)},[K,e,o]);const ze=a.useRef(null),L=a.useMemo(()=>{var ge;const c=((E==null?void 0:E.files)??[]).map(Me=>{var Ge;return{path:Me,status:"?",staged:!1,linesAdded:null,linesDeleted:null,...(Ge=E==null?void 0:E.lastEditors)!=null&&Ge[Me]?{lastEditor:E.lastEditors[Me]}:{}}}),k=Mo([...Lo(s.files,j),...c]),H=((ge=ze.current)==null?void 0:ge.statusFiles)===s.files?ze.current.byPath:null,le=new Map,De=k.map(Me=>{const Ge=H==null?void 0:H.get(Me.path),Rt=Ge&&Fo(Ge,Me)?Ge:Me;return le.set(Me.path,Rt),Rt});return ze.current={statusFiles:s.files,byPath:le},De},[j,s.files,E]);a.useEffect(()=>{if(!F)return;const c=L.find(k=>k.path===F);c&&(A.current=c)},[L,F]);const Q=a.useMemo(()=>{const c=A.current;return W&&F&&(c==null?void 0:c.path)===F&&!L.some(k=>k.path===F)?[...L,c]:L},[W,L,F]),Fe=a.useMemo(()=>Q.filter(c=>!c.path.endsWith("/")),[Q]),ye=Vs(Q,K),we=a.useMemo(()=>new Set(ye.map(c=>c.path)),[ye]),Se=a.useMemo(()=>Po({statusFiles:s.files,files:Q,folders:j,folderCounts:Le,folderExpansion:R,matchingPaths:we,query:K}),[Le,j,K,Q,we,s.files,R]),ve=a.useMemo(()=>Se.filter(c=>c.kind==="file"&&c.file.worktreeState!=="untracked"),[Se]),Be=a.useMemo(()=>Se.filter(c=>c.kind==="folder"||c.file.worktreeState==="untracked"),[Se]),dt=a.useMemo(()=>ve.flatMap(c=>c.kind==="file"?[{id:c.file.path,path:c.file.path,displayPath:Ke(c.file),statuses:[c.file.status],value:c.file}]:[]),[ve]),ht=a.useMemo(()=>Be.flatMap(c=>c.kind==="file"?[{id:c.file.path,path:c.file.path,displayPath:Ke(c.file),statuses:[c.file.status],value:c.file}]:[]),[Be]),Ve=a.useMemo(()=>Be.filter(c=>c.kind==="folder"),[Be]),mt=a.useMemo(()=>[...ve,...Be].flatMap(c=>c.kind==="file"?[c.file]:c.children.map(k=>k.file)),[ve,Be]),se=Fe.find(c=>c.path===F)??null,Ct=se?xe.current.get(se.path):void 0,Nt=se?Oe.current.get(se.path):void 0,et=b?Fe.find(c=>c.path===b):void 0,tt=b?`${e}\0${b}`:null,Ye=!!tt&&!!et&&ie!==tt;a.useEffect(()=>{var k;if(!Ye||!tt||!et)return;q(tt),U(et.path);const c=(k=Object.entries(j).find(([,H])=>H.files.includes(et.path)))==null?void 0:k[0];c&&z(H=>({...H,[c]:!0}))},[j,et,Ye,tt]),a.useEffect(()=>{var H;if(Ye)return;const c=mt,k=F&&c.some(le=>le.path===F)?F:n?((H=c[0])==null?void 0:H.path)??null:null;k!==F&&U(k)},[n,F,Ye,mt]),a.useLayoutEffect(()=>{var k;if(y<=oe.current)return;const c=(k=re.current)==null?void 0:k.querySelector("[data-source-file-item]");c&&(oe.current=y,_t(),c.focus({preventScroll:!0}))},[y]);const st=a.useMemo(()=>{const c=new Map;for(const k of Je)k.anchor.revision.kind==="uncommitted"&&c.set(k.anchor.path,(c.get(k.anchor.path)??0)+1);return c},[Je]),Bt=a.useMemo(()=>{const c=new Map;for(const k of me){const H=c.get(k.path);H?H.push(k):c.set(k.path,[k])}return c},[me]),Ut=a.useCallback((c,k,H)=>{if(o&&!H){z(le=>({...le,[c]:!0})),Ce(c);return}z(le=>({...le,[c]:!k}))},[Ce,o]),Ze=a.useCallback((c,k)=>{var H;c.path.endsWith("/")||n&&k&&((H=Y.current)!=null&&H.jumpToNextHunk())||U(c.path)},[n]),rt=a.useCallback((c,k)=>{xe.current.set(c,{...xe.current.get(c),...k})},[]),kt=a.useCallback((c,k)=>{Oe.current.set(c,k)},[]),ct=a.useCallback(c=>{const k=ls(ke).sessions.entities.get(c),H=Dn(k);return _("sourceOpenLastEditorSessionNamed",{title:H==="Untitled"?c.slice(0,8):H})},[ke,d,_]),nt=a.useCallback(c=>{const k=m&&c.lastEditor?`${Pe}/projects/${encodeURIComponent(e)}/sessions/${encodeURIComponent(c.lastEditor.sessionId)}`:void 0,H=c.lastEditor?ct(c.lastEditor.sessionId):_("sourceOpenLastEditorSession");return[{label:_("sourceCopyPath"),onSelect:()=>{vt(c.path)}},...k?[{label:H,onSelect:()=>Te(k)}]:[],...x?[{label:_("sourceBlameAtHead"),onSelect:()=>x(c.path)}]:[]]},[Pe,ct,Te,x,e,m,_]),at=a.useCallback(c=>{const k=ls(ke).sessions.entities.get(c);if(Ro(k))return null;const H=`${ke}\0${e}\0${c}`;let le=Tt.get(H);if(!le){const De=Date.now();le=de.getSessionMetadata(e,c).then(ge=>(cn(ke,ge.session,De),!0),()=>!1),Tt.set(H,le),le.finally(()=>{Tt.get(H)===le&&Tt.delete(H)})}return le},[ke,e]),T=a.useCallback(c=>{const k=Eo(c);return{contextKey:k,onOpen:()=>{var De;const H=(De=c.lastEditor)==null?void 0:De.sessionId;if(!m||!H)return;const le=at(H);le&&le.then(ge=>{ge&&(P(Me=>Me+1),Ie(k,nt(c)))})}}},[nt,at,Ie,m]),$=m&&(se!=null&&se.lastEditor)?`${Pe}/projects/${encodeURIComponent(e)}/sessions/${encodeURIComponent(se.lastEditor.sessionId)}`:void 0,Re=se!=null&&se.lastEditor?ct(se.lastEditor.sessionId):void 0,je=se?t.jsx(qs,{path:se.path,lastEditorSessionHref:$,lastEditorSessionLabel:Re,onBlameFile:x,t:_}):null,Ue=({file:c,displayPath:k},H=k,le)=>t.jsx(To,{file:c,displayPath:H,pathProps:le,query:K,selected:F===c.path,commentCount:st.get(c.path)??0,reviewStates:Bt.get(c.path)??ko,isWideScreen:n,menuActionsForFile:nt,menuOpenOptionsForFile:T,menuTargetProps:he.targetProps,onOpenMenu:he.openFromButton,onActivateFile:Ze,t:_},c.path),Ht=W&&se!==null,ft=`working-tree-browser ${v?"working-tree-browser-history":""}`.trim(),Qe=S??N,rs=Qe?t.jsx(Ys,{onClick:Qe,t:_}):null,Gt=o&&i===null,qt=l||Gt,nn=l&&u||Gt&&r,cs=(l?p:null)??(Gt?h:null);return(s.isClean||L.length===0)&&!Ht&&!qt?t.jsxs("div",{ref:re,className:ft,"data-testid":"working-tree-browser",children:[rs,v?t.jsxs("div",{className:"working-tree-clean-state working-tree-history-clean",children:[t.jsx("span",{className:"working-tree-clean-icon","aria-hidden":"true",children:"✓"}),t.jsx("div",{className:"git-status-empty",children:_("gitStatusWorkingTreeClean")}),t.jsx("p",{children:_("sourceWorkingTreeCleanDescription")})]}):t.jsx("div",{className:"working-tree-clean-landing",children:t.jsxs("div",{className:"working-tree-clean-state",children:[t.jsx("span",{className:"working-tree-clean-icon","aria-hidden":"true",children:"✓"}),t.jsx("div",{className:"git-status-empty",children:_("gitStatusWorkingTreeClean")}),t.jsx("p",{children:_("sourceWorkingTreeCleanDescription")})]})})]}):t.jsxs("div",{ref:re,className:ft,"data-testid":"working-tree-browser",children:[rs,t.jsxs(Us,{layout:"files",enabled:!v,className:"working-tree-browser-columns",t:_,children:[t.jsxs("div",{className:"commit-files-column working-tree-files-column",children:[t.jsxs("div",{className:"source-detail-banner",children:[g,v?t.jsxs("span",{className:"source-detail-identity working-tree-detail-identity",children:[t.jsxs("span",{className:"working-tree-detail-title-row",children:[t.jsx("span",{className:"source-detail-subject",children:_("sourceWorkingTree")}),t.jsx("span",{className:"working-tree-detail-count",title:_("sourceChangedFileCount",{count:Q.length}),children:Q.length})]}),t.jsx("span",{className:"source-detail-title",title:_("sourceWorkingTreeDescription"),children:_("sourceUncommitted")})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"source-detail-title",title:_("sourceWorkingTreeDescription"),children:_("sourceUncommittedChanges")}),t.jsx("span",{className:"source-detail-count",children:_("sourceChangedFileCount",{count:Q.length})})]}),X.total>0&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedFolderScanProgress",{loaded:X.loaded,total:X.total})}),nn&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("gitStatusLoading")}),qt&&cs&&t.jsxs("span",{className:Ae.scanProgress,role:"alert",children:[_("gitStatusErrorPrefix")," ",cs.message]}),o&&(i==null?void 0:i.truncated)&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedCacheBounded",{count:i.total})}),J&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedSearchLoading")}),(E==null?void 0:E.truncated)&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedSearchTruncated",{count:E.files.length})}),ne&&t.jsx("span",{className:Ae.scanProgress,role:"status",children:_("sourceUntrackedCacheError")}),t.jsx(zs,{query:K,onQueryChange:ae,t:_})]}),t.jsxs("div",{onKeyDown:Xt,children:[dt.length>0&&t.jsx(Pt,{className:"commit-file-list",items:dt,scopeKey:`${e}:working-tree:tracked`,query:K,renderFile:(c,k,H)=>Ue({file:c.value,displayPath:c.displayPath},k,H),t:_}),Be.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(En,{children:_("sourceUntrackedFiles")}),ht.length>0&&t.jsx(Pt,{className:"commit-file-list",items:ht,scopeKey:`${e}:working-tree:untracked`,query:K,renderFile:(c,k,H)=>Ue({file:c.value,displayPath:c.displayPath},k,H),t:_}),Ve.length>0&&t.jsx("ul",{className:"commit-file-list",children:Ve.map(c=>{var k,H,le,De;return t.jsxs("li",{className:Ae.folderGroup,children:[t.jsx("div",{className:Ae.folderHeader,children:t.jsxs(ts,{path:c.path,type:"button",className:"commit-file-item",disabled:Z.has(c.path)||!o&&!c.info||(o?(Le.get(c.path)??0)===0:!c.info||c.info.files.length===0),"aria-expanded":o||c.info?c.expanded:void 0,"aria-label":_(Z.has(c.path)||!o&&!c.info?"sourceLoadingUntrackedFolder":c.expanded?"sourceCollapseUntrackedFolder":"sourceExpandUntrackedFolder",{path:c.path}),"data-source-list-item":!0,onClick:()=>Ut(c.path,c.expanded,c.info!==void 0),children:[t.jsx("span",{className:Ae.disclosure,"aria-hidden":"true",children:Z.has(c.path)||!o&&!c.info?"…":c.expanded?"−":"+"}),t.jsx(ss,{status:"?",t:_}),t.jsx(ns,{query:K,fullPath:c.path,children:c.path}),(Le.get(c.path)??((k=c.info)==null?void 0:k.files.length))!==void 0&&t.jsxs("span",{className:Ae.folderCount,title:(H=c.info)!=null&&H.truncated?_("sourceUntrackedFolderTruncated",{count:c.info.files.length}):void 0,children:[Le.get(c.path)??((le=c.info)==null?void 0:le.files.length),(De=c.info)!=null&&De.truncated?"+":""]})]})}),c.children.length>0&&t.jsx(Pt,{className:Ae.folderChildren,items:c.children.map(ge=>({id:ge.file.path,path:ge.displayPath,displayPath:ge.displayPath,statuses:[ge.file.status],value:ge.file})),scopeKey:`${e}:working-tree:${c.path}`,query:K,renderFile:(ge,Me,Ge)=>Ue({file:ge.value,displayPath:ge.displayPath},Me,Ge),t:_})]},c.path)})})]})]}),Se.length===0&&!qt&&t.jsx("div",{className:"git-status-empty",children:_("sourceNoMatches")})]}),n&&se&&(se.worktreeState==="untracked"?t.jsxs("section",{className:Ae.currentContent,children:[je&&t.jsx("div",{className:Ae.currentContentActions,children:je}),t.jsx(ds,{projectId:e,filePath:se.path})]}):t.jsx(As,{ref:Y,file:se,fileKey:se.path,projectId:e,source:Ns,retainedScrollRatio:Nt,retainedDiffView:Ct,onRetainScrollRatio:kt,onRetainDiffView:rt,headerActions:je,onCommentEditorOpenChange:ue,captureReviewProjections:f,ignoreWhitespace:M,onToggleIgnoreWhitespace:C,onProjectionRequestFailure:w,t:_}))]}),he.menu,!n&&se&&(se.worktreeState==="untracked"?t.jsxs(jt,{title:se.path,onClose:()=>U(null),closeOnBackGesture:!0,children:[je&&t.jsx("div",{className:Ae.currentContentActions,children:je}),t.jsx(ds,{projectId:e,filePath:se.path})]}):t.jsx(Ds,{file:se,fileKey:se.path,projectId:e,source:Ns,retainedScrollRatio:Nt,retainedDiffView:Ct,onRetainScrollRatio:kt,onRetainDiffView:rt,headerActions:je,onCommentEditorOpenChange:ue,captureReviewProjections:f,ignoreWhitespace:M,onToggleIgnoreWhitespace:C,onProjectionRequestFailure:w,t:_,onClose:()=>U(null)}))]})}function Po({statusFiles:e,files:s,folders:n,folderCounts:o,folderExpansion:i,matchingPaths:r,query:h}){const l=h.trim().toLowerCase(),u=new Map(s.map(v=>[v.path,v])),p=new Set,b=[];for(const v of e){if(v.status==="?"&&v.path.endsWith("/")){const g=n[v.path],N=(g==null?void 0:g.files.flatMap(w=>{p.add(w);const _=u.get(w);return _?[{file:_,displayPath:w.startsWith(v.path)?w.slice(v.path.length):w}]:[]}))??[],x=l?N.filter(({file:w})=>r.has(w.path)):N,f=v.path.toLowerCase().includes(l);if(p.add(v.path),l&&!f&&x.length===0)continue;const m=o.get(v.path)??(g==null?void 0:g.files.length),M=i[v.path]??(m!==void 0?m<=Qs:!1),C=l?x.length>0:M;b.push({kind:"folder",path:v.path,...g?{info:g}:{},expanded:C,children:l?x:C?N:[]});continue}const S=u.get(v.path);!S||p.has(S.path)||(p.add(S.path),!(l&&!r.has(S.path))&&b.push({kind:"file",file:S,displayPath:Ke(S)}))}for(const v of s)p.has(v.path)||v.path.endsWith("/")||l&&!r.has(v.path)||b.push({kind:"file",file:v,displayPath:Ke(v)});return b}function Lo(e,s){return e.flatMap(n=>{const o=s[n.path];return n.status!=="?"||!n.path.endsWith("/")||!o?[n]:o.files.map(i=>{var h;const r=(h=o.lastEditors)==null?void 0:h[i];return{path:i,status:"?",staged:!1,linesAdded:null,linesDeleted:null,...r?{lastEditor:r}:{}}})})}function Fo(e,s){var n,o,i,r;return e.path===s.path&&e.status===s.status&&e.staged===s.staged&&e.worktreeState===s.worktreeState&&e.linesAdded===s.linesAdded&&e.linesDeleted===s.linesDeleted&&e.origPath===s.origPath&&((n=e.lastEditor)==null?void 0:n.sessionId)===((o=s.lastEditor)==null?void 0:o.sessionId)&&((i=e.lastEditor)==null?void 0:i.observedAt)===((r=s.lastEditor)==null?void 0:r.observedAt)}function Mo(e){const s=new Map;for(const n of e){const o=s.get(n.path);o?o.push(n):s.set(n.path,[n])}return Array.from(s.values(),n=>{var y,S;const o=n.find(g=>g.status==="?"),i=n.find(g=>g.staged),r=n.find(g=>!g.staged&&g.status!=="?"),h=n.find(g=>g.status==="R"||g.status==="C"),l=o??h??r??i??n[0],u=o?"untracked":i&&r?"both":i?"staged":"unstaged",p=n.length===1,b=(y=n.find(g=>g.origPath))==null?void 0:y.origPath,v=(S=n.find(g=>g.lastEditor))==null?void 0:S.lastEditor;return{path:l.path,status:l.status,staged:u==="staged",linesAdded:p?l.linesAdded:null,linesDeleted:p?l.linesDeleted:null,...b?{origPath:b}:{},...v?{lastEditor:v}:{},worktreeState:u}})}function Ao({state:e,t:s}){const n=e==="both"?s("sourceWorktreePartialDescription"):e==="staged"?s("sourceWorktreeStaged"):null,o=un(n);return n?t.jsx("span",{className:`worktree-file-state worktree-file-state-${e}`,role:"img","aria-label":n,...o,children:e==="both"?s("sourceWorktreePartial"):"✓"}):null}const zt=()=>{};function Do({projectId:e,status:s,isWideScreen:n,supportsUntrackedCache:o=!1,untrackedFiles:i=null,untrackedLoading:r=!1,untrackedError:h=null,inventoryPending:l=!1,inventoryLoading:u=!1,inventoryError:p=null,initialSha:b,initialPath:v,initialBlame:y=!1,showRevisionPane:S=!0,revisionHref:g=()=>"#",onSelectRevision:N,onBrowseHistory:x,onBlameFile:f,captureReviewProjections:m=!1,supportsProjections:M=!1,supportsInclusiveToHead:C=!1,supportsLastEditor:w=!1,ignoreWhitespace:_=!1,onToggleIgnoreWhitespace:j=zt,onProjectionUnavailable:B=zt,onProjectionRequestFailure:X=zt,t:D}){const R=a.useRef(null),z=a.useRef(null),Z=a.useRef(null),V=a.useRef(null),E=a.useRef(0),O=a.useRef(!1),[J,G]=a.useState(y),[ne,ee]=a.useState(0),[te,fe]=a.useState(0),[K,ae]=a.useState(null);a.useEffect(()=>{y&&G(!0)},[y]),hn(V);const{displayedCommits:d,displayedKeys:P,hasMore:F,loadingList:U,listError:W,loadMore:ue,searchQuery:ie,setSearchQuery:q,searchIndexRequested:A,setSearchIndexRequested:xe,searchActive:Oe,searchIndex:Y,commitSearchMatches:re,selectedKey:oe,setSelectedKey:pe,selectedIsWorkingTree:We,selectedSha:Te,selectedCommit:Pe,showWorkingTreeRevision:ke,detail:he,loadingDetail:Ie,detailError:Je,selectedPath:me,setSelectedPath:be,selectedFiles:Le,selectedFile:Ce,compareToHead:ze,loadingComparison:L,toggleComparison:Q,openDirectComparison:Fe,handleProjectionRequestFailure:ye,messageView:we,setMessageView:Se,source:ve,diffFileKey:Be,newerKey:dt,olderKey:ht}=io({projectId:e,status:s,isWideScreen:n,initialSha:b,initialPath:v,supportsInclusiveToHead:C,onProjectionUnavailable:B,onProjectionRequestFailure:X,t:D}),{pending:Ve,siteStates:mt}=as(e,m),se=Aa(e),Ct=a.useMemo(()=>{const T=new Map;for(const $ of Ve)if($.anchor.revision.kind==="sha"){const{sha:Re}=$.anchor.revision;T.set(Re,(T.get(Re)??0)+1)}return T},[Ve]),Nt=a.useMemo(()=>Ve.filter(T=>T.anchor.revision.kind==="uncommitted").length,[Ve]),et=a.useMemo(()=>{const T=new Map;for(const $ of Ve)$.anchor.revision.kind==="sha"&&$.anchor.revision.sha===Te&&T.set($.anchor.path,(T.get($.anchor.path)??0)+1);return T},[Ve,Te]),tt=a.useMemo(()=>{const T=new Map;for(const $ of mt){const Re=T.get($.path);Re?Re.push($):T.set($.path,[$])}return T},[mt]),Ye=a.useCallback((T,$)=>{var Re;if(ae($&&T!==He?T:null),!n){const je=(Re=z.current)==null?void 0:Re.closest(".page-scroll-container");E.current=(je==null?void 0:je.scrollTop)??0}pe(T),N==null||N(T===He?null:T)},[n,N,pe]),st=a.useCallback(T=>Ye(T,!1),[Ye]),Bt=a.useCallback(T=>{Ye(T,!0),T===He&&fe($=>$+1)},[Ye]),Ut=a.useCallback(T=>{ae(null),pe(T)},[pe]),Ze=(ve==null?void 0:ve.kind)==="commit"?ve.sha:(ve==null?void 0:ve.kind)==="comparison"||(ve==null?void 0:ve.kind)==="inclusive-comparison"?ve.headSha:void 0,rt=a.useCallback(()=>{Se(!1),G(T=>!T)},[Se]),kt=a.useCallback(T=>{be(T),Se(!1),G(!0)},[Se,be]),ct=Ce?t.jsx(qs,{path:Ce.path,onBlameFile:Ze?rt:void 0,blameTitle:D("sourceToggleBlame"),t:D}):null,nt=a.useCallback(()=>{O.current=!0,pe(null),be(null),Se(!1)},[Se,pe,be]);$o(!n&&oe!==null,nt);const at=a.useCallback(()=>{var T;if(typeof window<"u"&&((T=window.history.state)!=null&&T.yaCommitDetail)){window.history.back();return}nt()},[nt]);return a.useEffect(()=>{const T=$=>{var Re;if(!($.defaultPrevented||$.altKey||$.ctrlKey||$.metaKey||mn($.target)||document.querySelector('[role="dialog"]'))){if(n&&!$.shiftKey&&Te&&($.key==="["||$.key==="]")){const je=Le.filter(Qe=>!Qe.path.endsWith("/")),Ue=we?-1:je.findIndex(Qe=>Qe.path===me||Qe.origPath===me),Ht=Ue<0?0:Ue+($.key==="]"?1:-1),ft=je[Ht];if(!ft)return;$.preventDefault(),_t(),G(!1),be(ft.path),Se(!1),ee(Qe=>Qe+1);return}if(n&&!$.shiftKey&&!we&&!J&&($.key==="PageDown"||$.key==="PageUp")){const je=R.current;if(!je)return;$.preventDefault(),_t(),je.scrollByPage($.key==="PageDown"?1:-1);return}if($.key==="Escape"){if(!n&&oe){$.preventDefault(),at();return}ie&&($.preventDefault(),q(""),(Re=V.current)==null||Re.focus())}}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[at,n,we,ie,Le,oe,me,Te,Se,be,q,J]),a.useEffect(()=>{if(!K||K!==Te||Ie||!he)return;const T=Le.find($=>!$.path.endsWith("/"));ae(null),T&&(_t(),G(!1),be(T.path),Se(!1),ee($=>$+1))},[he,Ie,K,Le,Te,Se,be]),a.useLayoutEffect(()=>{var $,Re,je;if(n)return;const T=($=z.current)==null?void 0:$.closest(".page-scroll-container");if(oe){const Ue=Z.current??((Re=z.current)==null?void 0:Re.querySelector(".working-tree-browser-history"));(je=Ue==null?void 0:Ue.scrollIntoView)==null||je.call(Ue,{block:"start"});return}O.current&&T&&(O.current=!1,T.scrollTop=E.current)},[n,oe]),t.jsxs("div",{className:"commit-browser",ref:z,children:[t.jsxs(Us,{layout:"history",revisionPaneVisible:S,className:"commit-browser-columns",t:D,children:[S&&(n||!oe)?t.jsx(fo,{status:s,isWideScreen:n,searchInputRef:V,searchQuery:ie,searchIndexRequested:A,searchIndexing:Y.indexing,indexedCount:Y.indexedCount,totalCount:Y.totalCount,searchError:Y.error,searchActive:Oe,displayedCommits:d,commitSearchMatches:re,displayedKeys:P,selectedKey:oe,selectedIsWorkingTree:We,showWorkingTreeRevision:ke,loadingList:U,listError:W,hasMore:F,workingTreeCommentCount:Nt,commentCountBySha:Ct,isRead:se.isRead,onSearchQueryChange:q,onSearchIndexRequested:()=>xe(!0),onOpenRevision:st,onEnterRevision:Bt,revisionHref:T=>g(T===He?null:T),onFocusRevision:Ut,onLoadMore:()=>{ue()},onMarkReadTo:se.markReadTo,onMarkUnreadSince:se.markUnreadSince,t:D}):S?null:t.jsx("div",{className:"commit-list-column","aria-hidden":"true"}),We&&s&&t.jsx(Js,{projectId:e,status:s,isWideScreen:n,supportsUntrackedCache:o,untrackedFiles:i,untrackedLoading:r,untrackedError:h,inventoryPending:l,inventoryLoading:u,inventoryError:p,embeddedInHistory:!0,fileFocusRequest:te,onBackToRevisions:S?n?void 0:at:x,revisionNavigation:t.jsx(ks,{newerKey:dt,olderKey:ht,onSelect:st,t:D}),onBlameFile:f,captureReviewProjections:m,supportsLastEditor:w,ignoreWhitespace:_,onToggleIgnoreWhitespace:j,onProjectionRequestFailure:ye,t:D}),Te&&t.jsx(Ja,{columnRef:Z,selectedSha:Te,selectedCommit:Pe,detail:he,loading:Ie||ze&&L,detailError:Je,compareToHead:ze,supportsInclusiveToHead:C,isWideScreen:n,messageView:we,selectedFiles:Le,selectedPath:me,fileFocusRequest:ne,fileCommentCount:et,reviewStatesByPath:tt,revisionNavigation:t.jsx(ks,{newerKey:dt,olderKey:ht,onSelect:st,t:D}),onBack:S?n?void 0:at:x,onToggleComparison:Q,onCompareFileToHead:M?T=>{G(!1),Fe(T)}:void 0,onShowMessage:()=>{G(!1),Se(!0)},onPageDiff:T=>{var $;return($=R.current)==null?void 0:$.scrollByPage(T)},onFocusFile:T=>{be(T.path),Se(!1)},onFilteredSelectionChange:T=>{be((T==null?void 0:T.path)??null),Se(!1)},onActivateFile:T=>{var $;me===T.path&&!we&&(($=R.current)!=null&&$.jumpToNextHunk())||(be(T.path),Se(!1))},onBlameFile:Ze?kt:void 0,onMarkReadTo:se.markReadTo,onMarkUnreadSince:se.markUnreadSince,t:D}),n&&(we&&he?t.jsx(Rs,{detail:he,t:D}):J&&Ce&&Ze?t.jsx(fs,{projectId:e,path:Ce.path,rev:Ze,onOpenCommit:st,onToggleBlame:rt,captureReviewProjections:m,t:D}):Ce&&ve&&Be?t.jsx(As,{ref:R,file:Ce,fileKey:Be,projectId:e,source:ve,captureReviewProjections:m,headerActions:ct,ignoreWhitespace:_,onToggleIgnoreWhitespace:j,onProjectionRequestFailure:ye,t:D}):null)]}),!n&&we&&he&&t.jsx(jt,{title:he.shortHash,onClose:()=>Se(!1),closeOnBackGesture:!0,children:t.jsx(Rs,{detail:he,t:D})}),!n&&!we&&Ce&&ve&&Be&&(J&&Ze?t.jsx(jt,{title:Ce.path,onClose:()=>be(null),closeOnBackGesture:!0,children:t.jsx(fs,{projectId:e,path:Ce.path,rev:Ze,onOpenCommit:st,onToggleBlame:rt,captureReviewProjections:m,t:D})}):t.jsx(Ds,{file:Ce,fileKey:Be,projectId:e,source:ve,captureReviewProjections:m,headerActions:ct,ignoreWhitespace:_,onToggleIgnoreWhitespace:j,onProjectionRequestFailure:ye,t:D,onClose:()=>be(null)}))]})}function ks({newerKey:e,olderKey:s,onSelect:n,t:o}){return t.jsxs("span",{className:"source-detail-jump",children:[t.jsxs("button",{type:"button",className:"commit-jump-btn",title:o("sourceNewerCommit"),"aria-label":o("sourceNewerCommit"),disabled:!e,onClick:()=>e&&n(e),children:[t.jsx("span",{className:"commit-jump-glyph","aria-hidden":"true",children:"↑"}),t.jsx("span",{className:"commit-jump-touch-label",children:o("sourceNewerCommit")})]}),t.jsxs("button",{type:"button",className:"commit-jump-btn",title:o("sourceOlderCommit"),"aria-label":o("sourceOlderCommit"),disabled:!s,onClick:()=>s&&n(s),children:[t.jsx("span",{className:"commit-jump-glyph","aria-hidden":"true",children:"↓"}),t.jsx("span",{className:"commit-jump-touch-label",children:o("sourceOlderCommit")})]})]})}function $o(e,s){const n=a.useRef(s);n.current=s,a.useEffect(()=>{if(!e||typeof window>"u")return;const o=window.history.state??{};window.history.pushState({...o,yaCommitDetail:!0},"");let i=!1;const r=h=>{const l=h.state;l!=null&&l.yaCommitDetail||(i=!0,n.current())};return window.addEventListener("popstate",r),()=>{var h;window.removeEventListener("popstate",r),!i&&((h=window.history.state)!=null&&h.yaCommitDetail)&&window.history.back()}},[e])}function Rs({detail:e,t:s}){const n=e.body?`${e.subject}
|
|
9
9
|
|
|
10
|
-
${e.body}`:e.subject;return t.jsxs("section",{className:"git-diff-preview-pane",children:[t.jsxs("div",{className:"git-diff-preview-header",children:[t.jsx("h3",{className:"git-diff-preview-title",title:e.hash,children:e.shortHash}),t.jsx("span",{className:"commit-message-time",children:os(e.authorDate)})]}),t.jsx("div",{className:"git-diff-preview-body",children:t.jsxs("div",{className:"commit-message-view",children:[t.jsxs("div",{className:"commit-message-view-meta",children:[e.authorName," · ",s("sourceCommitMessage")]}),t.jsx("pre",{className:"commit-message-full",children:n})]})})]})}const Oo="_sourceHeader_thqil_5",Io="_actionGroup_thqil_21",Bo="_headerControls_thqil_28",Uo="_titleRow_thqil_33",Ho="_headerTabs_thqil_37",Go="_fallbackRow_thqil_45",qo="_compatibilityActions_thqil_54",Ko="_checkRemote_thqil_71",Wo="_actionLabel_thqil_73",qe={sourceHeader:Oo,actionGroup:Io,headerControls:Bo,titleRow:Uo,headerTabs:Ho,fallbackRow:Go,compatibilityActions:qo,checkRemote:Ko,actionLabel:Wo},zo="_bar_16xyw_2",Vo="_warn_16xyw_17",Yo="_inline_16xyw_22",Qo="_copyButton_16xyw_39",Jo="_branch_16xyw_49",Zo="_branchName_16xyw_58",Xo="_branchLink_16xyw_68",ei="_upstream_16xyw_79",ti="_sync_16xyw_80",si="_badge_16xyw_98",ni="_clean_16xyw_110",ai="_dirty_16xyw_115",oi="_badgeAction_16xyw_120",ii="_upstreamButton_16xyw_130",ri="_incomingDialog_16xyw_143",ci="_incomingIntro_16xyw_147",li="_incomingState_16xyw_148",ui="_incomingTruncated_16xyw_149",di="_incomingList_16xyw_154",hi="_incomingCommit_16xyw_162",mi="_incomingCommitHeader_16xyw_171",fi="_incomingSubject_16xyw_183",pi="_incomingMeta_16xyw_188",ce={bar:zo,warn:Vo,inline:Yo,copyButton:Qo,branch:Jo,branchName:Zo,branchLink:Xo,upstream:ei,sync:ti,badge:si,clean:ni,dirty:ai,badgeAction:oi,upstreamButton:ii,incomingDialog:ri,incomingIntro:ci,incomingState:li,incomingTruncated:ui,incomingList:di,incomingCommit:hi,incomingCommitHeader:mi,incomingSubject:fi,incomingMeta:pi};function gi({status:e,projectId:s,supportsIncomingCommits:n=!1,onSelectChanges:o,headCommitHref:i,onOpenHeadCommit:r,className:h,t:l}){var f;const[u,p]=a.useState(!1),b=e.ahead>0||e.behind>0,v=!e.isClean||b,j=(f=e.recentCommits)==null?void 0:f[0],S=e.branch??l("gitStatusDetachedHead"),g=e.branch??(j==null?void 0:j.hash),N=j!==void 0&&i!==void 0&&r!==void 0,x=n&&s!==void 0&&e.upstream!==null;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{"data-testid":"repo-status-bar",className:[ce.bar,ce.inline,v?ce.warn:"",h??""].filter(Boolean).join(" "),children:[t.jsxs("span",{className:ce.branch,children:[t.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),t.jsx("circle",{cx:"18",cy:"6",r:"3"}),t.jsx("circle",{cx:"6",cy:"18",r:"3"}),t.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),N?t.jsx("a",{className:`${ce.branchName} ${ce.branchLink}`,href:i,title:l("sourceOpenHeadCommit",{commit:j.shortHash}),onClick:m=>{m.button!==0||m.metaKey||m.ctrlKey||m.shiftKey||m.altKey||(m.preventDefault(),r())},children:S}):t.jsx("span",{className:ce.branchName,children:S}),g&&t.jsx(Zt,{value:g,title:e.branch?l("sourceCopyBranch"):l("sourceCopyCommitHash"),className:ce.copyButton})]}),e.upstream&&(x?t.jsxs("button",{type:"button",className:`${ce.upstream} ${ce.upstreamButton}`,title:l("sourceOpenIncomingCommits",{upstream:e.upstream}),onClick:()=>p(!0),children:["→ ",e.upstream]}):t.jsxs("span",{className:ce.upstream,title:e.upstream,children:["→ ",e.upstream]})),b&&t.jsxs("span",{className:ce.sync,children:[e.ahead>0&&` ↑${e.ahead}`,e.behind>0&&` ↓${e.behind}`]}),!e.isClean&&o?t.jsx("button",{type:"button",className:`${ce.badge} ${ce.dirty} ${ce.badgeAction}`,title:l("sourceOpenChanges"),onClick:o,children:l("gitStatusDirty")}):t.jsx("span",{className:`${ce.badge} ${e.isClean?ce.clean:ce.dirty}`,children:e.isClean?l("gitStatusClean"):l("gitStatusDirty")})]}),u&&s&&t.jsx(xi,{projectId:s,onClose:()=>p(!1),t:l})]})}function xi({projectId:e,onClose:s,t:n}){const[o,i]=a.useState(null),[r,h]=a.useState(!1);return a.useEffect(()=>{let l=!0;return de.getGitIncomingCommits(e).then(u=>{l&&i(u)}).catch(()=>{l&&h(!0)}),()=>{l=!1}},[e]),t.jsx(yt,{title:n("sourceIncomingCommitsTitle"),onClose:s,children:t.jsxs("div",{className:ce.incomingDialog,children:[t.jsx("p",{className:ce.incomingIntro,children:n("sourceIncomingCommitsDescription")}),r?t.jsx("p",{className:ce.incomingState,role:"alert",children:n("sourceIncomingCommitsError")}):o===null?t.jsx("p",{className:ce.incomingState,children:n("sourceIncomingCommitsLoading")}):o.commits.length===0?t.jsx("p",{className:ce.incomingState,children:n("sourceIncomingCommitsEmpty",{upstream:o.upstream})}):t.jsxs(t.Fragment,{children:[t.jsx("ul",{className:ce.incomingList,children:o.commits.map(l=>t.jsxs("li",{className:ce.incomingCommit,children:[t.jsxs("span",{className:ce.incomingCommitHeader,children:[t.jsx("code",{title:l.hash,children:l.shortHash}),t.jsx("strong",{className:ce.incomingSubject,children:l.subject})]}),t.jsxs("span",{className:ce.incomingMeta,children:[l.authorName," ·"," ",os(l.authorDate)]})]},l.hash))}),o.truncated&&t.jsx("p",{className:ce.incomingTruncated,children:n("sourceIncomingCommitsTruncated",{count:o.limit})})]})]})})}const bi="_panel_ekf2m_2",Si="_empty_ekf2m_9",vi="_hint_ekf2m_14",_i="_list_ekf2m_20",wi="_row_ekf2m_29",yi="_rowHead_ekf2m_36",ji="_location_ekf2m_43",Ci="_revision_ekf2m_59",Ni="_rowActions_ekf2m_66",ki="_edit_ekf2m_72",Ri="_text_ekf2m_94",Ei="_editor_ekf2m_101",Ti="_editorActions_ekf2m_117",Pi="_error_ekf2m_123",Li="_actions_ekf2m_127",Ne={panel:bi,empty:Si,hint:vi,list:_i,row:wi,rowHead:yi,location:ji,revision:Ci,rowActions:Ni,edit:ki,delete:"_delete_ekf2m_73",text:Ri,editor:Ei,editorActions:Ti,error:Pi,actions:Li};function Fi({projectId:e,pending:s,onOpenFile:n,onSubmit:o,t:i}){const[r,h]=a.useState(null),[l,u]=a.useState(null),[p,b]=a.useState(null),[v,j]=a.useState(""),[S,g]=a.useState(null),N=async f=>{if(l!==f){u(f);return}h(f),g(null);try{await de.deleteReviewComment(e,f),wt(e)}catch(m){g(m instanceof Error?m.message:i("sourceReviewDeleteFailed"))}finally{h(null),u(null)}},x=async f=>{const m=v.trim();if(m){h(f),g(null);try{await de.updateReviewComment(e,f,{text:m}),wt(e),b(null),j("")}catch(M){g(M instanceof Error?M.message:i("sourceReviewEditFailed"))}finally{h(null)}}};return s.length===0?t.jsx("section",{className:Ne.panel,children:t.jsxs("div",{className:Ne.empty,children:[t.jsx("div",{children:i("sourceReviewNoPending")}),t.jsx("div",{className:Ne.hint,children:i("sourceReviewCommentsHint")})]})}):t.jsxs("section",{className:Ne.panel,children:[S&&t.jsx("div",{className:Ne.error,children:S}),t.jsx("ul",{className:Ne.list,children:s.map(f=>t.jsxs("li",{className:Ne.row,children:[t.jsxs("div",{className:Ne.rowHead,children:[t.jsx("button",{type:"button",className:Ne.location,title:i("sourceReviewOpenInFiles"),onClick:()=>n(f.anchor.path),children:Mi(f)}),t.jsx("span",{className:Ne.revision,children:Ai(f,i)}),t.jsxs("div",{className:Ne.rowActions,children:[t.jsx("button",{type:"button",className:Ne.edit,disabled:r===f.id,onClick:()=>{b(f.id),j(f.text),u(null)},children:i("sourceReviewEdit")}),t.jsx("button",{type:"button",className:Ne.delete,disabled:r===f.id,onClick:()=>void N(f.id),children:l===f.id?i("sourceReviewDeleteConfirm"):i("sourceReviewDelete")})]})]}),p===f.id?t.jsxs("div",{className:Ne.editor,children:[t.jsx("textarea",{"aria-label":i("sourceReviewEditComment"),value:v,maxLength:2e4,onChange:m=>j(m.target.value)}),t.jsxs("div",{className:Ne.editorActions,children:[t.jsx("button",{type:"button",onClick:()=>{b(null),j("")},children:i("cancel")}),t.jsx("button",{type:"button",disabled:r===f.id||!v.trim(),onClick:()=>void x(f.id),children:i("sourceReviewSaveEdit")})]})]}):t.jsx("div",{className:Ne.text,children:f.text})]},f.id))}),t.jsx("div",{className:Ne.actions,children:t.jsx("button",{type:"button",className:"review-submit-go",onClick:o,children:i("sourceReviewOpenSubmit")})})]})}function Mi(e){const{anchor:s}=e,n=s.side==="old"?s.oldLine:s.newLine,o=s.side==="old"?" (old)":"";return`${s.path}:${n??"?"}${o}`}function Ai(e,s){const{revision:n}=e.anchor;return n.kind==="sha"?n.sha.slice(0,7):s("sourceBlameNotCommitted")}const Di="_panel_fhayd_1",$i="_empty_fhayd_8",Oi="_submissionList_fhayd_13",Ii="_siteList_fhayd_14",Bi="_entryList_fhayd_15",Ui="_submissionButton_fhayd_24",Hi="_active_fhayd_47",Gi="_loadMore_fhayd_52",qi="_unread_fhayd_61",Ki="_mobileSelector_fhayd_69",Wi="_detail_fhayd_73",zi="_detailHeader_fhayd_77",Vi="_siteHeader_fhayd_78",Yi="_entryHead_fhayd_79",Qi="_outcomeHead_fhayd_80",Ji="_siteActions_fhayd_81",Zi="_detailActions_fhayd_93",Xi="_stateGroup_fhayd_94",er="_responseNotice_fhayd_119",tr="_submittedAt_fhayd_130",sr="_awaitingSession_fhayd_131",nr="_captureId_fhayd_133",ar="_sessionLink_fhayd_138",or="_site_fhayd_14",ir="_location_fhayd_156",rr="_state_fhayd_94",cr="_open_fhayd_175",lr="_addressed_fhayd_179",ur="_resolved_fhayd_183",dr="_changed_fhayd_187",hr="_unchanged_fhayd_191",mr="_unavailable_fhayd_192",fr="_entry_fhayd_15",pr="_commentTextRow_fhayd_206",gr="_commentLine_fhayd_214",xr="_text_fhayd_227",br="_source_fhayd_233",Sr="_highlight_fhayd_262",vr="_lineNumber_fhayd_267",_r="_captureMissing_fhayd_276",wr="_error_fhayd_277",yr="_outcome_fhayd_80",jr="_followUp_fhayd_306",I={panel:Di,empty:$i,submissionList:Oi,siteList:Ii,entryList:Bi,submissionButton:Ui,active:Hi,loadMore:Gi,unread:qi,mobileSelector:Ki,detail:Wi,detailHeader:zi,siteHeader:Vi,entryHead:Yi,outcomeHead:Qi,siteActions:Ji,detailActions:Zi,stateGroup:Xi,responseNotice:er,submittedAt:tr,awaitingSession:sr,captureId:nr,sessionLink:ar,site:or,location:ir,state:rr,open:cr,addressed:lr,resolved:ur,changed:dr,unchanged:hr,unavailable:mr,entry:fr,commentTextRow:pr,commentLine:gr,text:xr,source:br,highlight:Sr,lineNumber:vr,captureMissing:_r,error:wr,outcome:yr,followUp:jr};function Cr({projectId:e,initialSubmissionId:s,sessionHref:n,t:o}){const[i,r]=a.useState([]),[h,l]=a.useState(null),[u,p]=a.useState(null),[b,v]=a.useState(null),[j,S]=a.useState(!0),[g,N]=a.useState(null),x=a.useCallback(async C=>{const w=await de.listReviewSubmissions(e,{cursor:C,limit:50});r(_=>C?[..._,...w.submissions]:w.submissions),l(w.nextCursor),C||p(_=>{var y;return s||(w.submissions.some(B=>B.id===_)?_:((y=w.submissions[0])==null?void 0:y.id)??null)})},[s,e]),f=a.useCallback(async C=>{const w=await de.getReviewSubmission(e,C);v(w),r(_=>_.some(y=>y.id===w.submission.id)?_:[w.submission,..._])},[e]);a.useEffect(()=>{if(!b||b.submission.id!==u||b.submission.responseRevision<=b.submission.acknowledgedRevision)return;let C=!1;return de.acknowledgeReviewSubmission(e,b.submission.id).then(({submission:w})=>{C||(r(_=>_.map(y=>y.id===w.id?w:y)),v(_=>(_==null?void 0:_.submission.id)===w.id?{..._,submission:w}:_))}).catch(()=>{}),()=>{C=!0}},[b,e,u]),a.useEffect(()=>{let C=!1;return S(!0),N(null),x().catch(w=>{C||N(w instanceof Error?w.message:o("sourceReviewSubmissionsLoadFailed"))}).finally(()=>{C||S(!1)}),()=>{C=!0}},[x,o]),a.useEffect(()=>{if(!u){v(null);return}let C=!1;return N(null),f(u).catch(w=>{C||N(w instanceof Error?w.message:o("sourceReviewSubmissionLoadFailed"))}),()=>{C=!0}},[f,u,o]);const m=a.useCallback(async()=>{await x(),u&&await f(u)},[f,x,u]);if(j)return t.jsx("section",{className:I.empty,children:o("loading")});if(i.length===0)return t.jsx("section",{className:I.empty,children:o("sourceReviewNoSubmissions")});const M=i.find(C=>C.id===u)??i[0];return t.jsxs("section",{className:I.panel,children:[t.jsxs("ul",{className:I.submissionList,children:[i.map(C=>t.jsx("li",{children:t.jsxs("button",{type:"button",className:`${I.submissionButton} ${C.id===M.id?I.active:""}`.trimEnd(),onClick:()=>p(C.id),children:[t.jsx("span",{children:Es(C,o)}),C.responseRevision>C.acknowledgedRevision&&t.jsx("span",{className:I.unread,role:"img","aria-label":o("sourceReviewUnread")})]})},C.id)),h&&t.jsx("li",{children:t.jsx("button",{type:"button",className:I.loadMore,onClick:()=>void x(h),children:o("sourceReviewLoadOlder")})})]}),t.jsxs("label",{className:I.mobileSelector,children:[t.jsx("span",{children:o("sourceReviewSelectSubmission")}),t.jsx("select",{value:M.id,onChange:C=>p(C.target.value),children:i.map(C=>t.jsx("option",{value:C.id,children:Es(C,o)},C.id))})]}),t.jsxs("article",{className:I.detail,children:[g&&t.jsx("div",{className:I.error,children:g}),(b==null?void 0:b.submission.id)===M.id?t.jsx(Nr,{detail:b,projectId:e,sessionHref:n,refresh:m,t:o}):t.jsx("div",{className:I.empty,children:o("loading")})]})]})}function Nr({detail:e,projectId:s,sessionHref:n,refresh:o,t:i}){const[r,h]=a.useState(!1),[l,u]=a.useState(null),p=a.useMemo(()=>new Map(e.capturedSources.map(S=>[`${S.siteId}\0${S.entryId}`,S])),[e.capturedSources]),b=e.sites.flatMap(S=>S.entries).find(S=>S.submissionId===e.submission.id),v=e.submission.name??$s((b==null?void 0:b.text)??""),j=async()=>{h(!0),u(null);try{const S=await de.refreshReviewSubmissionResponse(s,e.submission.id);u($r(S.responseStatus,i)),wt(s),await o()}catch(S){u(S instanceof Error?S.message:i("sourceReviewResponseRefreshFailed"))}finally{h(!1)}};return t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:I.detailHeader,children:[t.jsxs("div",{children:[t.jsx("h2",{children:v}),t.jsx("div",{className:I.submittedAt,children:Zs(e.submission)})]}),t.jsxs("div",{className:I.detailActions,children:[t.jsx("button",{type:"button",disabled:r,onClick:()=>void j(),children:i(r?"sourceReviewRefreshingResponse":"sourceReviewRefreshResponse")}),e.submission.targetSessionId?t.jsx(Ms,{className:I.sessionLink,to:n(e.submission.targetSessionId),children:i("sourceReviewOpenSession")}):t.jsx("span",{className:I.awaitingSession,children:i("sourceReviewAwaitingSession")})]})]}),l&&t.jsx("div",{className:I.responseNotice,children:l}),t.jsx("ul",{className:I.siteList,children:e.sites.map(S=>t.jsx(kr,{site:S,sourceFor:g=>p.get(`${S.id}\0${g}`)??{siteId:S.id,entryId:g,source:{status:"legacy-missing"},changeStatus:"unavailable"},projectId:s,refresh:o,sessionHref:n,t:i},S.id))})]})}function kr({site:e,sourceFor:s,projectId:n,refresh:o,sessionHref:i,t:r}){const[h,l]=a.useState(""),[u,p]=a.useState(!1),[b,v]=a.useState(null),j=e.entries.at(-1),S=(j==null?void 0:j.submittedAt)===void 0,g=j?s(j.id):null,N=Er(e,(g==null?void 0:g.changeStatus)??"unavailable"),x=async()=>{const m=h.trim();if(m){p(!0),v(null);try{await de.addReviewFollowUp(n,e.id,m),l(""),wt(n),await o()}catch(M){v(M instanceof Error?M.message:r("sourceReviewFollowUpFailed"))}finally{p(!1)}}},f=async()=>{p(!0),v(null);try{await de.resolveReviewSite(n,e.id),await o()}catch(m){v(m instanceof Error?m.message:r("sourceReviewResolveFailed"))}finally{p(!1)}};return t.jsxs("li",{className:I.site,children:[t.jsxs("header",{className:I.siteHeader,children:[t.jsx("span",{className:I.location,children:e.path}),t.jsxs("span",{className:I.stateGroup,children:[t.jsx("span",{className:`${I.state} ${Mr(N)}`,children:Fr(N,r)}),t.jsx("span",{className:`${I.state} ${Dr((g==null?void 0:g.changeStatus)??"unavailable")}`,children:Ar((g==null?void 0:g.changeStatus)??"unavailable",r)})]})]}),t.jsx("ol",{className:I.entryList,children:e.entries.map(m=>{const M=e.outcomes.filter(C=>C.entryId===m.id);return t.jsxs("li",{className:I.entry,children:[t.jsx("div",{className:I.entryHead,children:t.jsx("span",{children:m.submittedAt?r("sourceReviewSubmittedEntry"):r("sourceReviewPendingFollowUp")})}),t.jsxs("div",{className:I.commentTextRow,children:[t.jsx("span",{className:I.commentLine,title:Tr(m.anchor),children:Pr(m.anchor)}),t.jsx("div",{className:I.text,children:m.text})]}),t.jsx(Rr,{source:s(m.id).source,t:r}),M.map(C=>t.jsxs("div",{className:I.outcome,children:[t.jsxs("div",{className:I.outcomeHead,children:[t.jsx("span",{children:Lr(C.disposition,r)}),C.sessionId&&t.jsx(Ms,{to:i(C.sessionId),children:r("sourceReviewOutcomeSession")})]}),t.jsx("div",{children:C.text})]},C.responseHash))]},m.id)})}),b&&t.jsx("div",{className:I.error,children:b}),!S&&t.jsxs("div",{className:I.followUp,children:[t.jsx("textarea",{"aria-label":r("sourceReviewFollowUp"),value:h,maxLength:2e4,placeholder:r("sourceReviewFollowUpPlaceholder"),onChange:m=>l(m.target.value)}),t.jsxs("div",{className:I.siteActions,children:[!e.resolvedAt&&t.jsx("button",{type:"button",disabled:u,onClick:()=>void f(),children:r("sourceReviewResolve")}),t.jsx("button",{type:"button",disabled:u||!h.trim(),onClick:()=>void x(),children:r("sourceReviewAddFollowUp")})]})]})]})}function Rr({source:e,t:s}){return e.status==="legacy-missing"?t.jsx("div",{className:I.captureMissing,children:s("sourceReviewLegacyCaptureMissing")}):e.status==="unavailable"?t.jsx("div",{className:I.captureMissing,children:Or(e.reason,s)}):t.jsxs("div",{className:I.source,children:[t.jsxs("div",{className:I.captureId,children:[s("sourceReviewCapturedSource")," · ",e.captureBlobId.slice(0,12)]}),t.jsx("pre",{children:e.content.split(`
|
|
10
|
+
${e.body}`:e.subject;return t.jsxs("section",{className:"git-diff-preview-pane",children:[t.jsxs("div",{className:"git-diff-preview-header",children:[t.jsx("h3",{className:"git-diff-preview-title",title:e.hash,children:e.shortHash}),t.jsx("span",{className:"commit-message-time",children:os(e.authorDate)})]}),t.jsx("div",{className:"git-diff-preview-body",children:t.jsxs("div",{className:"commit-message-view",children:[t.jsxs("div",{className:"commit-message-view-meta",children:[e.authorName," · ",s("sourceCommitMessage")]}),t.jsx("pre",{className:"commit-message-full",children:n})]})})]})}const Oo="_sourceHeader_thqil_5",Io="_actionGroup_thqil_21",Bo="_headerControls_thqil_28",Uo="_titleRow_thqil_33",Ho="_headerTabs_thqil_37",Go="_fallbackRow_thqil_45",qo="_compatibilityActions_thqil_54",Ko="_checkRemote_thqil_71",Wo="_actionLabel_thqil_73",qe={sourceHeader:Oo,actionGroup:Io,headerControls:Bo,titleRow:Uo,headerTabs:Ho,fallbackRow:Go,compatibilityActions:qo,checkRemote:Ko,actionLabel:Wo},zo="_bar_16xyw_2",Vo="_warn_16xyw_17",Yo="_inline_16xyw_22",Qo="_copyButton_16xyw_39",Jo="_branch_16xyw_49",Zo="_branchName_16xyw_58",Xo="_branchLink_16xyw_68",ei="_upstream_16xyw_79",ti="_sync_16xyw_80",si="_badge_16xyw_98",ni="_clean_16xyw_110",ai="_dirty_16xyw_115",oi="_badgeAction_16xyw_120",ii="_upstreamButton_16xyw_130",ri="_incomingDialog_16xyw_143",ci="_incomingIntro_16xyw_147",li="_incomingState_16xyw_148",ui="_incomingTruncated_16xyw_149",di="_incomingList_16xyw_154",hi="_incomingCommit_16xyw_162",mi="_incomingCommitHeader_16xyw_171",fi="_incomingSubject_16xyw_183",pi="_incomingMeta_16xyw_188",ce={bar:zo,warn:Vo,inline:Yo,copyButton:Qo,branch:Jo,branchName:Zo,branchLink:Xo,upstream:ei,sync:ti,badge:si,clean:ni,dirty:ai,badgeAction:oi,upstreamButton:ii,incomingDialog:ri,incomingIntro:ci,incomingState:li,incomingTruncated:ui,incomingList:di,incomingCommit:hi,incomingCommitHeader:mi,incomingSubject:fi,incomingMeta:pi};function gi({status:e,projectId:s,supportsIncomingCommits:n=!1,onSelectChanges:o,headCommitHref:i,onOpenHeadCommit:r,className:h,t:l}){var f;const[u,p]=a.useState(!1),b=e.ahead>0||e.behind>0,v=!e.isClean||b,y=(f=e.recentCommits)==null?void 0:f[0],S=e.branch??l("gitStatusDetachedHead"),g=e.branch??(y==null?void 0:y.hash),N=y!==void 0&&i!==void 0&&r!==void 0,x=n&&s!==void 0&&e.upstream!==null;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{"data-testid":"repo-status-bar",className:[ce.bar,ce.inline,v?ce.warn:"",h??""].filter(Boolean).join(" "),children:[t.jsxs("span",{className:ce.branch,children:[t.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),t.jsx("circle",{cx:"18",cy:"6",r:"3"}),t.jsx("circle",{cx:"6",cy:"18",r:"3"}),t.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),N?t.jsx("a",{className:`${ce.branchName} ${ce.branchLink}`,href:i,title:l("sourceOpenHeadCommit",{commit:y.shortHash}),onClick:m=>{m.button!==0||m.metaKey||m.ctrlKey||m.shiftKey||m.altKey||(m.preventDefault(),r())},children:S}):t.jsx("span",{className:ce.branchName,children:S}),g&&t.jsx(Zt,{value:g,title:e.branch?l("sourceCopyBranch"):l("sourceCopyCommitHash"),className:ce.copyButton})]}),e.upstream&&(x?t.jsxs("button",{type:"button",className:`${ce.upstream} ${ce.upstreamButton}`,title:l("sourceOpenIncomingCommits",{upstream:e.upstream}),onClick:()=>p(!0),children:["→ ",e.upstream]}):t.jsxs("span",{className:ce.upstream,title:e.upstream,children:["→ ",e.upstream]})),b&&t.jsxs("span",{className:ce.sync,children:[e.ahead>0&&` ↑${e.ahead}`,e.behind>0&&` ↓${e.behind}`]}),!e.isClean&&o?t.jsx("button",{type:"button",className:`${ce.badge} ${ce.dirty} ${ce.badgeAction}`,title:l("sourceOpenChanges"),onClick:o,children:l("gitStatusDirty")}):t.jsx("span",{className:`${ce.badge} ${e.isClean?ce.clean:ce.dirty}`,children:e.isClean?l("gitStatusClean"):l("gitStatusDirty")})]}),u&&s&&t.jsx(xi,{projectId:s,onClose:()=>p(!1),t:l})]})}function xi({projectId:e,onClose:s,t:n}){const[o,i]=a.useState(null),[r,h]=a.useState(!1);return a.useEffect(()=>{let l=!0;return de.getGitIncomingCommits(e).then(u=>{l&&i(u)}).catch(()=>{l&&h(!0)}),()=>{l=!1}},[e]),t.jsx(jt,{title:n("sourceIncomingCommitsTitle"),onClose:s,children:t.jsxs("div",{className:ce.incomingDialog,children:[t.jsx("p",{className:ce.incomingIntro,children:n("sourceIncomingCommitsDescription")}),r?t.jsx("p",{className:ce.incomingState,role:"alert",children:n("sourceIncomingCommitsError")}):o===null?t.jsx("p",{className:ce.incomingState,children:n("sourceIncomingCommitsLoading")}):o.commits.length===0?t.jsx("p",{className:ce.incomingState,children:n("sourceIncomingCommitsEmpty",{upstream:o.upstream})}):t.jsxs(t.Fragment,{children:[t.jsx("ul",{className:ce.incomingList,children:o.commits.map(l=>t.jsxs("li",{className:ce.incomingCommit,children:[t.jsxs("span",{className:ce.incomingCommitHeader,children:[t.jsx("code",{title:l.hash,children:l.shortHash}),t.jsx("strong",{className:ce.incomingSubject,children:l.subject})]}),t.jsxs("span",{className:ce.incomingMeta,children:[l.authorName," ·"," ",os(l.authorDate)]})]},l.hash))}),o.truncated&&t.jsx("p",{className:ce.incomingTruncated,children:n("sourceIncomingCommitsTruncated",{count:o.limit})})]})]})})}const bi="_panel_ekf2m_2",Si="_empty_ekf2m_9",vi="_hint_ekf2m_14",_i="_list_ekf2m_20",wi="_row_ekf2m_29",ji="_rowHead_ekf2m_36",yi="_location_ekf2m_43",Ci="_revision_ekf2m_59",Ni="_rowActions_ekf2m_66",ki="_edit_ekf2m_72",Ri="_text_ekf2m_94",Ei="_editor_ekf2m_101",Ti="_editorActions_ekf2m_117",Pi="_error_ekf2m_123",Li="_actions_ekf2m_127",Ne={panel:bi,empty:Si,hint:vi,list:_i,row:wi,rowHead:ji,location:yi,revision:Ci,rowActions:Ni,edit:ki,delete:"_delete_ekf2m_73",text:Ri,editor:Ei,editorActions:Ti,error:Pi,actions:Li};function Fi({projectId:e,pending:s,onOpenFile:n,onSubmit:o,t:i}){const[r,h]=a.useState(null),[l,u]=a.useState(null),[p,b]=a.useState(null),[v,y]=a.useState(""),[S,g]=a.useState(null),N=async f=>{if(l!==f){u(f);return}h(f),g(null);try{await de.deleteReviewComment(e,f),wt(e)}catch(m){g(m instanceof Error?m.message:i("sourceReviewDeleteFailed"))}finally{h(null),u(null)}},x=async f=>{const m=v.trim();if(m){h(f),g(null);try{await de.updateReviewComment(e,f,{text:m}),wt(e),b(null),y("")}catch(M){g(M instanceof Error?M.message:i("sourceReviewEditFailed"))}finally{h(null)}}};return s.length===0?t.jsx("section",{className:Ne.panel,children:t.jsxs("div",{className:Ne.empty,children:[t.jsx("div",{children:i("sourceReviewNoPending")}),t.jsx("div",{className:Ne.hint,children:i("sourceReviewCommentsHint")})]})}):t.jsxs("section",{className:Ne.panel,children:[S&&t.jsx("div",{className:Ne.error,children:S}),t.jsx("ul",{className:Ne.list,children:s.map(f=>t.jsxs("li",{className:Ne.row,children:[t.jsxs("div",{className:Ne.rowHead,children:[t.jsx("button",{type:"button",className:Ne.location,title:i("sourceReviewOpenInFiles"),onClick:()=>n(f.anchor.path),children:Mi(f)}),t.jsx("span",{className:Ne.revision,children:Ai(f,i)}),t.jsxs("div",{className:Ne.rowActions,children:[t.jsx("button",{type:"button",className:Ne.edit,disabled:r===f.id,onClick:()=>{b(f.id),y(f.text),u(null)},children:i("sourceReviewEdit")}),t.jsx("button",{type:"button",className:Ne.delete,disabled:r===f.id,onClick:()=>void N(f.id),children:l===f.id?i("sourceReviewDeleteConfirm"):i("sourceReviewDelete")})]})]}),p===f.id?t.jsxs("div",{className:Ne.editor,children:[t.jsx("textarea",{"aria-label":i("sourceReviewEditComment"),value:v,maxLength:2e4,onChange:m=>y(m.target.value)}),t.jsxs("div",{className:Ne.editorActions,children:[t.jsx("button",{type:"button",onClick:()=>{b(null),y("")},children:i("cancel")}),t.jsx("button",{type:"button",disabled:r===f.id||!v.trim(),onClick:()=>void x(f.id),children:i("sourceReviewSaveEdit")})]})]}):t.jsx("div",{className:Ne.text,children:f.text})]},f.id))}),t.jsx("div",{className:Ne.actions,children:t.jsx("button",{type:"button",className:"review-submit-go",onClick:o,children:i("sourceReviewOpenSubmit")})})]})}function Mi(e){const{anchor:s}=e,n=s.side==="old"?s.oldLine:s.newLine,o=s.side==="old"?" (old)":"";return`${s.path}:${n??"?"}${o}`}function Ai(e,s){const{revision:n}=e.anchor;return n.kind==="sha"?n.sha.slice(0,7):s("sourceBlameNotCommitted")}const Di="_panel_fhayd_1",$i="_empty_fhayd_8",Oi="_submissionList_fhayd_13",Ii="_siteList_fhayd_14",Bi="_entryList_fhayd_15",Ui="_submissionButton_fhayd_24",Hi="_active_fhayd_47",Gi="_loadMore_fhayd_52",qi="_unread_fhayd_61",Ki="_mobileSelector_fhayd_69",Wi="_detail_fhayd_73",zi="_detailHeader_fhayd_77",Vi="_siteHeader_fhayd_78",Yi="_entryHead_fhayd_79",Qi="_outcomeHead_fhayd_80",Ji="_siteActions_fhayd_81",Zi="_detailActions_fhayd_93",Xi="_stateGroup_fhayd_94",er="_responseNotice_fhayd_119",tr="_submittedAt_fhayd_130",sr="_awaitingSession_fhayd_131",nr="_captureId_fhayd_133",ar="_sessionLink_fhayd_138",or="_site_fhayd_14",ir="_location_fhayd_156",rr="_state_fhayd_94",cr="_open_fhayd_175",lr="_addressed_fhayd_179",ur="_resolved_fhayd_183",dr="_changed_fhayd_187",hr="_unchanged_fhayd_191",mr="_unavailable_fhayd_192",fr="_entry_fhayd_15",pr="_commentTextRow_fhayd_206",gr="_commentLine_fhayd_214",xr="_text_fhayd_227",br="_source_fhayd_233",Sr="_highlight_fhayd_262",vr="_lineNumber_fhayd_267",_r="_captureMissing_fhayd_276",wr="_error_fhayd_277",jr="_outcome_fhayd_80",yr="_followUp_fhayd_306",I={panel:Di,empty:$i,submissionList:Oi,siteList:Ii,entryList:Bi,submissionButton:Ui,active:Hi,loadMore:Gi,unread:qi,mobileSelector:Ki,detail:Wi,detailHeader:zi,siteHeader:Vi,entryHead:Yi,outcomeHead:Qi,siteActions:Ji,detailActions:Zi,stateGroup:Xi,responseNotice:er,submittedAt:tr,awaitingSession:sr,captureId:nr,sessionLink:ar,site:or,location:ir,state:rr,open:cr,addressed:lr,resolved:ur,changed:dr,unchanged:hr,unavailable:mr,entry:fr,commentTextRow:pr,commentLine:gr,text:xr,source:br,highlight:Sr,lineNumber:vr,captureMissing:_r,error:wr,outcome:jr,followUp:yr};function Cr({projectId:e,initialSubmissionId:s,sessionHref:n,t:o}){const[i,r]=a.useState([]),[h,l]=a.useState(null),[u,p]=a.useState(null),[b,v]=a.useState(null),[y,S]=a.useState(!0),[g,N]=a.useState(null),x=a.useCallback(async C=>{const w=await de.listReviewSubmissions(e,{cursor:C,limit:50});r(_=>C?[..._,...w.submissions]:w.submissions),l(w.nextCursor),C||p(_=>{var j;return s||(w.submissions.some(B=>B.id===_)?_:((j=w.submissions[0])==null?void 0:j.id)??null)})},[s,e]),f=a.useCallback(async C=>{const w=await de.getReviewSubmission(e,C);v(w),r(_=>_.some(j=>j.id===w.submission.id)?_:[w.submission,..._])},[e]);a.useEffect(()=>{if(!b||b.submission.id!==u||b.submission.responseRevision<=b.submission.acknowledgedRevision)return;let C=!1;return de.acknowledgeReviewSubmission(e,b.submission.id).then(({submission:w})=>{C||(r(_=>_.map(j=>j.id===w.id?w:j)),v(_=>(_==null?void 0:_.submission.id)===w.id?{..._,submission:w}:_))}).catch(()=>{}),()=>{C=!0}},[b,e,u]),a.useEffect(()=>{let C=!1;return S(!0),N(null),x().catch(w=>{C||N(w instanceof Error?w.message:o("sourceReviewSubmissionsLoadFailed"))}).finally(()=>{C||S(!1)}),()=>{C=!0}},[x,o]),a.useEffect(()=>{if(!u){v(null);return}let C=!1;return N(null),f(u).catch(w=>{C||N(w instanceof Error?w.message:o("sourceReviewSubmissionLoadFailed"))}),()=>{C=!0}},[f,u,o]);const m=a.useCallback(async()=>{await x(),u&&await f(u)},[f,x,u]);if(y)return t.jsx("section",{className:I.empty,children:o("loading")});if(i.length===0)return t.jsx("section",{className:I.empty,children:o("sourceReviewNoSubmissions")});const M=i.find(C=>C.id===u)??i[0];return t.jsxs("section",{className:I.panel,children:[t.jsxs("ul",{className:I.submissionList,children:[i.map(C=>t.jsx("li",{children:t.jsxs("button",{type:"button",className:`${I.submissionButton} ${C.id===M.id?I.active:""}`.trimEnd(),onClick:()=>p(C.id),children:[t.jsx("span",{children:Es(C,o)}),C.responseRevision>C.acknowledgedRevision&&t.jsx("span",{className:I.unread,role:"img","aria-label":o("sourceReviewUnread")})]})},C.id)),h&&t.jsx("li",{children:t.jsx("button",{type:"button",className:I.loadMore,onClick:()=>void x(h),children:o("sourceReviewLoadOlder")})})]}),t.jsxs("label",{className:I.mobileSelector,children:[t.jsx("span",{children:o("sourceReviewSelectSubmission")}),t.jsx("select",{value:M.id,onChange:C=>p(C.target.value),children:i.map(C=>t.jsx("option",{value:C.id,children:Es(C,o)},C.id))})]}),t.jsxs("article",{className:I.detail,children:[g&&t.jsx("div",{className:I.error,children:g}),(b==null?void 0:b.submission.id)===M.id?t.jsx(Nr,{detail:b,projectId:e,sessionHref:n,refresh:m,t:o}):t.jsx("div",{className:I.empty,children:o("loading")})]})]})}function Nr({detail:e,projectId:s,sessionHref:n,refresh:o,t:i}){const[r,h]=a.useState(!1),[l,u]=a.useState(null),p=a.useMemo(()=>new Map(e.capturedSources.map(S=>[`${S.siteId}\0${S.entryId}`,S])),[e.capturedSources]),b=e.sites.flatMap(S=>S.entries).find(S=>S.submissionId===e.submission.id),v=e.submission.name??$s((b==null?void 0:b.text)??""),y=async()=>{h(!0),u(null);try{const S=await de.refreshReviewSubmissionResponse(s,e.submission.id);u($r(S.responseStatus,i)),wt(s),await o()}catch(S){u(S instanceof Error?S.message:i("sourceReviewResponseRefreshFailed"))}finally{h(!1)}};return t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:I.detailHeader,children:[t.jsxs("div",{children:[t.jsx("h2",{children:v}),t.jsx("div",{className:I.submittedAt,children:Zs(e.submission)})]}),t.jsxs("div",{className:I.detailActions,children:[t.jsx("button",{type:"button",disabled:r,onClick:()=>void y(),children:i(r?"sourceReviewRefreshingResponse":"sourceReviewRefreshResponse")}),e.submission.targetSessionId?t.jsx(Ms,{className:I.sessionLink,to:n(e.submission.targetSessionId),children:i("sourceReviewOpenSession")}):t.jsx("span",{className:I.awaitingSession,children:i("sourceReviewAwaitingSession")})]})]}),l&&t.jsx("div",{className:I.responseNotice,children:l}),t.jsx("ul",{className:I.siteList,children:e.sites.map(S=>t.jsx(kr,{site:S,sourceFor:g=>p.get(`${S.id}\0${g}`)??{siteId:S.id,entryId:g,source:{status:"legacy-missing"},changeStatus:"unavailable"},projectId:s,refresh:o,sessionHref:n,t:i},S.id))})]})}function kr({site:e,sourceFor:s,projectId:n,refresh:o,sessionHref:i,t:r}){const[h,l]=a.useState(""),[u,p]=a.useState(!1),[b,v]=a.useState(null),y=e.entries.at(-1),S=(y==null?void 0:y.submittedAt)===void 0,g=y?s(y.id):null,N=Er(e,(g==null?void 0:g.changeStatus)??"unavailable"),x=async()=>{const m=h.trim();if(m){p(!0),v(null);try{await de.addReviewFollowUp(n,e.id,m),l(""),wt(n),await o()}catch(M){v(M instanceof Error?M.message:r("sourceReviewFollowUpFailed"))}finally{p(!1)}}},f=async()=>{p(!0),v(null);try{await de.resolveReviewSite(n,e.id),await o()}catch(m){v(m instanceof Error?m.message:r("sourceReviewResolveFailed"))}finally{p(!1)}};return t.jsxs("li",{className:I.site,children:[t.jsxs("header",{className:I.siteHeader,children:[t.jsx("span",{className:I.location,children:e.path}),t.jsxs("span",{className:I.stateGroup,children:[t.jsx("span",{className:`${I.state} ${Mr(N)}`,children:Fr(N,r)}),t.jsx("span",{className:`${I.state} ${Dr((g==null?void 0:g.changeStatus)??"unavailable")}`,children:Ar((g==null?void 0:g.changeStatus)??"unavailable",r)})]})]}),t.jsx("ol",{className:I.entryList,children:e.entries.map(m=>{const M=e.outcomes.filter(C=>C.entryId===m.id);return t.jsxs("li",{className:I.entry,children:[t.jsx("div",{className:I.entryHead,children:t.jsx("span",{children:m.submittedAt?r("sourceReviewSubmittedEntry"):r("sourceReviewPendingFollowUp")})}),t.jsxs("div",{className:I.commentTextRow,children:[t.jsx("span",{className:I.commentLine,title:Tr(m.anchor),children:Pr(m.anchor)}),t.jsx("div",{className:I.text,children:m.text})]}),t.jsx(Rr,{source:s(m.id).source,t:r}),M.map(C=>t.jsxs("div",{className:I.outcome,children:[t.jsxs("div",{className:I.outcomeHead,children:[t.jsx("span",{children:Lr(C.disposition,r)}),C.sessionId&&t.jsx(Ms,{to:i(C.sessionId),children:r("sourceReviewOutcomeSession")})]}),t.jsx("div",{children:C.text})]},C.responseHash))]},m.id)})}),b&&t.jsx("div",{className:I.error,children:b}),!S&&t.jsxs("div",{className:I.followUp,children:[t.jsx("textarea",{"aria-label":r("sourceReviewFollowUp"),value:h,maxLength:2e4,placeholder:r("sourceReviewFollowUpPlaceholder"),onChange:m=>l(m.target.value)}),t.jsxs("div",{className:I.siteActions,children:[!e.resolvedAt&&t.jsx("button",{type:"button",disabled:u,onClick:()=>void f(),children:r("sourceReviewResolve")}),t.jsx("button",{type:"button",disabled:u||!h.trim(),onClick:()=>void x(),children:r("sourceReviewAddFollowUp")})]})]})]})}function Rr({source:e,t:s}){return e.status==="legacy-missing"?t.jsx("div",{className:I.captureMissing,children:s("sourceReviewLegacyCaptureMissing")}):e.status==="unavailable"?t.jsx("div",{className:I.captureMissing,children:Or(e.reason,s)}):t.jsxs("div",{className:I.source,children:[t.jsxs("div",{className:I.captureId,children:[s("sourceReviewCapturedSource")," · ",e.captureBlobId.slice(0,12)]}),t.jsx("pre",{children:e.content.split(`
|
|
11
11
|
`).map((n,o)=>{const i=e.startLine+o;return t.jsxs("span",{className:i===e.highlightLine?I.highlight:"",children:[t.jsx("span",{className:I.lineNumber,children:i}),t.jsx("span",{children:n||" "}),`
|
|
12
|
-
`]},i)})})]})}function Er(e,s){var o;if(e.resolvedAt)return"resolved";if(((o=e.entries.at(-1))==null?void 0:o.submittedAt)===void 0)return"open";const n=[...e.entries].reverse().find(i=>i.submittedAt);return n&&(e.outcomes.some(i=>i.entryId===n.id)||s==="changed")?"addressed":"open"}function Es(e,s){return e.name??s("sourceReviewSubmission",{date:Zs(e)})}function Zs(e){const s=new Date(e.submittedAt);return Number.isNaN(s.getTime())?e.submittedAt:s.toLocaleString()}function Tr(e){const s=e.side==="old"?e.oldLine:e.newLine,n=e.side==="old"?" (old)":"";return`${e.path}:${s??"?"}${n}`}function Pr(e){const s=e.side==="old"?e.oldLine:e.newLine;return String(s??"?")}function Lr(e,s){return s(e==="wont_fix"?"sourceReviewOutcomeNoChange":e==="question"?"sourceReviewOutcomeQuestion":"sourceReviewOutcomeDone")}function Fr(e,s){return s(e==="addressed"?"sourceReviewStateAddressed":e==="resolved"?"sourceReviewStateResolved":"sourceReviewStateOpen")}function Mr(e){return e==="addressed"?I.addressed:e==="resolved"?I.resolved:I.open}function Ar(e,s){return s(e==="changed"?"sourceReviewSourceChanged":e==="unchanged"?"sourceReviewSourceUnchanged":"sourceReviewSourceUnavailable")}function Dr(e){return e==="changed"?I.changed:e==="unchanged"?I.unchanged:I.unavailable}function $r(e,s){return s(e==="ingested"?"sourceReviewResponseIngested":e==="unchanged"?"sourceReviewResponseUnchanged":e==="invalid"?"sourceReviewResponseInvalid":"sourceReviewResponseMissing")}function Or(e,s){return s(e==="binary"?"sourceReviewCaptureUnavailableBinary":e==="too-large"?"sourceReviewCaptureUnavailableTooLarge":"sourceReviewCaptureUnavailableMissing")}const Ir="_modal_1mt5u_1",Br="_list_1mt5u_8",Ur="_row_1mt5u_19",Hr="_stale_1mt5u_25",Gr="_rowHead_1mt5u_30",qr="_location_1mt5u_36",Kr="_staleLabel_1mt5u_41",Wr="_movedLabel_1mt5u_46",zr="_rowText_1mt5u_51",Vr="_destination_1mt5u_56",Yr="_field_1mt5u_65",Qr="_newSession_1mt5u_85",Jr="_targetError_1mt5u_91",Zr="_error_1mt5u_92",Xr="_actions_1mt5u_100",ec="_name_1mt5u_107",tc="_go_1mt5u_112",_e={modal:Ir,list:Br,row:Ur,stale:Hr,rowHead:Gr,location:qr,staleLabel:Kr,movedLabel:Wr,rowText:zr,destination:Vr,field:Yr,newSession:Qr,targetError:Jr,error:Zr,actions:Xr,name:ec,go:tc};function sc({projectId:e,recentReviewSessionId:s,submissionsEnabled:n=!1,onClose:o,onNavigateSession:i,t:r}){var ae;const[h,l]=a.useState(null),[u,p]=a.useState(new Set),[b,v]=a.useState(s??"new"),j=a.useRef(!1),[S,g]=a.useState(!1),[N,x]=a.useState(null),[f,m]=a.useState(null),[M,C]=a.useState(!1),[w,_]=a.useState(""),y=a.useRef(null);n&&!y.current&&(y.current=ln());const[B,X]=a.useState(null),[D,R]=a.useState(null),{providers:z,loading:Z}=$n(),V=a.useMemo(()=>On(z),[z]),[E,O]=a.useState(""),[J,G]=a.useState(""),ne=V.find(d=>d.name===E),ee=h==null?void 0:h.find(d=>u.has(d.comment.id)),te=$s((ee==null?void 0:ee.comment.text)??"");a.useEffect(()=>{const d=In(z);d&&O(P=>P||d.name)},[z]),a.useEffect(()=>{let d=!1;return fn(e).then(P=>{var F;d||(X(P),j.current||v(s||(((F=P[0])==null?void 0:F.id)??"new")))}).catch(P=>{d||R(P instanceof Error?P.message:r("sourceReviewSessionsUnavailable"))}),()=>{d=!0}},[e,s,r]),a.useEffect(()=>{let d=!1;return de.previewReview(e).then(P=>{d||(l(P.items),p(new Set(P.items.filter(F=>!F.defaultDiscard).map(F=>F.comment.id))))}).catch(P=>{d||x(P instanceof Error?P.message:"Failed to preview")}),()=>{d=!0}},[e]);const fe=a.useCallback(d=>{p(P=>{const F=new Set(P);return F.has(d)?F.delete(d):F.add(d),F})},[]),K=a.useCallback(async()=>{const d=[...u];if(d.length!==0){g(!0),x(null);try{const P=b==="new"?{provider:E||void 0,model:J||void 0}:void 0,F=n&&y.current?await de.submitReview(e,d,b,P,{id:y.current,name:w.trim()||void 0}):await de.submitReview(e,d,b,P);if(wt(e),F.sessionId){i(F.sessionId),o();return}m(r(n?"sourceReviewSubmissionQueued":"sourceReviewSubmitQueued")),C(!0)}catch(P){x(P instanceof Error?P.message:"Failed to submit")}finally{g(!1)}}},[u,b,E,J,e,i,o,r,n,w]);return t.jsx(yt,{title:r("sourceReviewSubmitTitle"),onClose:o,children:t.jsxs("div",{className:_e.modal,children:[N&&t.jsx("div",{className:_e.error,children:N}),f&&t.jsx("div",{role:"status",children:f}),h===null?t.jsx("div",{children:r("loading")}):h.length===0?t.jsx("div",{children:r("sourceReviewNoPending")}):t.jsx("ul",{className:_e.list,children:h.map(d=>t.jsx(nc,{item:d,checked:u.has(d.comment.id),onToggle:()=>fe(d.comment.id),t:r},d.comment.id))}),h&&h.length>0&&t.jsxs("div",{className:_e.destination,children:[t.jsxs("label",{className:_e.field,children:[t.jsx("span",{children:r("sourceReviewTargetLegend")}),t.jsxs("select",{value:b,onChange:d=>{j.current=!0,v(d.target.value)},children:[t.jsx("option",{value:"new",children:r("sourceReviewTargetNew")}),s&&!(B!=null&&B.some(d=>d.id===s))&&t.jsxs("option",{value:s,children:[r("sourceReviewTargetRecent")," ·"," ",s.slice(0,8)]}),B==null?void 0:B.map(d=>t.jsx("option",{value:d.id,children:pn(d,d.id===s?r("sourceReviewRecentSuffix"):void 0)},d.id))]})]}),D&&t.jsxs("div",{className:_e.targetError,children:[r("sourceReviewSessionsUnavailable"),": ",D]}),b==="new"&&t.jsxs("div",{className:_e.newSession,children:[t.jsxs("label",{className:_e.field,children:[t.jsx("span",{children:r("sourceReviewProvider")}),t.jsx("select",{value:E,disabled:Z||V.length===0,onChange:d=>{O(d.target.value),G("")},children:V.map(d=>t.jsx("option",{value:d.name,children:d.displayName},d.name))})]}),t.jsxs("label",{className:_e.field,children:[t.jsx("span",{children:r("sourceReviewModel")}),t.jsxs("select",{value:J,disabled:!ne,onChange:d=>G(d.target.value),children:[t.jsx("option",{value:"",children:r("sourceReviewModelDefault")}),(ae=ne==null?void 0:ne.models)==null?void 0:ae.map(d=>t.jsx("option",{value:d.id,children:d.name},d.id))]})]})]})]}),t.jsxs("div",{className:_e.actions,children:[n&&t.jsxs("label",{className:`${_e.field} ${_e.name}`,children:[t.jsx("span",{children:r("sourceReviewSubmissionName")}),t.jsx("input",{value:w,maxLength:120,placeholder:te,onChange:d=>_(d.target.value)})]}),t.jsx("button",{type:"button",onClick:o,disabled:S,children:r("cancel")}),t.jsx("button",{type:"button",className:_e.go,onClick:K,disabled:S||M||u.size===0,children:r("sourceReviewSubmitReview",{count:u.size})})]})]})})}function nc({item:e,checked:s,onToggle:n,t:o}){const i=e.relocation.status==="gone",r=i?e.relocation.citeSha?`${e.relocation.path} @ ${e.relocation.citeSha.slice(0,8)}`:e.relocation.path:`${e.relocation.path}:${e.relocation.line}`;return t.jsxs("li",{className:`${_e.row} ${i?_e.stale:""}`,children:[t.jsxs("label",{className:_e.rowHead,children:[t.jsx("input",{type:"checkbox",checked:s,onChange:n}),t.jsx("span",{className:_e.location,children:r}),i&&t.jsx("span",{className:_e.staleLabel,children:o("sourceReviewStale")}),!i&&e.relocation.moved&&t.jsx("span",{className:_e.movedLabel,children:o("sourceReviewMoved")})]}),t.jsx("div",{className:_e.rowText,children:e.comment.text})]})}const ac="_tabs_qaerl_2",oc="_tab_qaerl_2",ic="_active_qaerl_30",rc="_count_qaerl_35",cc="_stacked_qaerl_47",St={tabs:ac,tab:oc,active:ic,count:rc,stacked:cc};function lc({tab:e,tabs:s,counts:n,fileTabLabelKey:o,onSelect:i,variant:r="header",t:h}){return t.jsx("div",{className:`${St.tabs} ${r==="stacked"?St.stacked:""}`.trimEnd(),role:"tablist",children:s.map(l=>{const u=n==null?void 0:n[l];return t.jsxs("button",{type:"button",role:"tab","aria-selected":e===l,className:`${St.tab} ${e===l?St.active:""}`.trimEnd(),onClick:()=>i(l),children:[h(l==="files"&&o?o:uc(l)),typeof u=="number"&&u>0&&t.jsx("span",{className:St.count,children:u})]},l)})})}function uc(e){switch(e){case"changes":return"sourceTabChanges";case"files":return"sourceTabFiles";case"comments":return"sourceTabComments";case"reviews":return"sourceTabReviews"}}const dc=300*1e3,Xs=["changes","files","comments"],hc=[...Xs,"reviews"],Dt=["tab","history","rev","commitFile","blame","worktreeFile","bf","submission"];function mc(e,s){if(!e)return null;const n=new Map(e.files.flatMap(i=>i.lastEditor?[[i.path,i.lastEditor]]:[])),o=[];for(const i of s)for(const r of i.worktreeChanges??[]){const h=r.lastEditor??n.get(i.path);o.push({path:i.path,...r,...h?{lastEditor:h}:{}})}return{...e,files:o,isClean:o.length===0}}function is(e=!1){const[s,n]=Ot(),o=$t(),i=s.get("tab"),r=i==="files"?"files":i==="comments"?"comments":i==="reviews"&&e?"reviews":"changes",h=a.useCallback(l=>{n(u=>{const p=new URLSearchParams(u);return l==="changes"?p.delete("tab"):p.set("tab",l),p.delete("history"),p.delete("rev"),l!=="reviews"&&p.delete("submission"),p},{state:o.state})},[o.state,n]);return{tab:r,setTab:h}}function fc(e,s,n){var v,j;const o=It(),i=$t(),[r,h]=Ot(),l=(j=(v=s==null?void 0:s.recentCommits)==null?void 0:v[0])==null?void 0:j.hash,u=n&&l!==void 0&&e!==void 0,p=a.useMemo(()=>{if(!u)return;const S=new URLSearchParams(r);S.set("projectId",e);for(const g of Dt)S.delete(g);return S.set("rev",l),Gs(`${o}/git-status?${S.toString()}`)},[u,o,l,e,r]),b=a.useCallback(()=>{u&&h(S=>{const g=new URLSearchParams(S);for(const N of Dt)g.delete(N);return g.set("rev",l),g},{state:i.state})},[u,l,i.state,h]);return u?{headCommitHref:p,onOpenHeadCommit:b}:{}}function pc({status:e,pendingCount:s,reviewsEnabled:n,supportsWorkingTreeFiles:o,t:i}){const{tab:r,setTab:h}=is(n),l=jc(e);return t.jsx(lc,{tab:r,tabs:n?hc:Xs,variant:"stacked",counts:{changes:l,comments:s},fileTabLabelKey:o?"sourceTabWorkingTree":void 0,onSelect:h,t:i})}function gc({status:e,pendingCount:s,reviewsEnabled:n,supportsWorkingTreeFiles:o,worktreePaused:i,gitActions:r,isWideScreen:h,onToggleWorktreePaused:l,t:u}){const p=a.useRef(null),b=a.useRef(null),[v,j]=a.useState(!1);return a.useLayoutEffect(()=>{if(!h){j(!1);return}const S=p.current,g=b.current,N=S==null?void 0:S.closest(".session-header-inner"),x=N==null?void 0:N.querySelector(".session-header-left"),f=S==null?void 0:S.querySelector("[data-source-action-group]"),m=g==null?void 0:g.querySelector('[role="tablist"]');if(!S||!g||!N||!x||!f||!m)return;const M=()=>{const w=getComputedStyle(N),_=N.clientWidth-Xe(w.paddingLeft)-Xe(w.paddingRight),y=Xe(w.columnGap);if(_<=0){j(!1);return}const B=Vt(x)+Vt(f)+Vt(m)+2*y;j(B<=_+.5)};if(M(),typeof ResizeObserver>"u")return;const C=new ResizeObserver(M);return C.observe(N),C.observe(x),C.observe(f),C.observe(m),()=>C.disconnect()},[h]),t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:p,className:`${qe.headerControls} ${v?qe.titleRow:qe.fallbackRow}`,"data-source-actions-placement":v?"title":"fallback",children:t.jsx(en,{gitActions:r,worktreePaused:i,onToggleWorktreePaused:l,t:u})}),t.jsx("div",{ref:b,className:qe.headerTabs,children:t.jsx(pc,{status:e,pendingCount:s,reviewsEnabled:n,supportsWorkingTreeFiles:o,t:u})})]})}function Vt(e){const s=getComputedStyle(e),n=Array.from(e.children).filter(i=>i instanceof HTMLElement&&getComputedStyle(i).display!=="none");return n.reduce((i,r)=>i+Math.max(r.getBoundingClientRect().width,r.scrollWidth),0)+Math.max(0,n.length-1)*Xe(s.columnGap)+Xe(s.paddingLeft)+Xe(s.paddingRight)+Xe(s.borderLeftWidth)+Xe(s.borderRightWidth)}function Xe(e){const s=Number.parseFloat(e);return Number.isFinite(s)?s:0}function en({gitActions:e,worktreePaused:s,onToggleWorktreePaused:n,t:o}){const i=Ln(),r=o("gitStatusLastCheckedRemote",{time:Ea(e.checkedRemoteAt,i,o)});return t.jsxs("div",{className:qe.actionGroup,"data-source-action-group":!0,children:[e.supportsPull&&t.jsx(Yt,{action:"pull",label:o("gitStatusPull"),runningLabel:o("gitStatusPulling"),running:e.isPulling,feedback:e.pullFeedback,tone:e.pullFeedbackTone,onClick:e.handlePull,disabled:e.isRunning}),e.supportsPush&&t.jsx(Yt,{action:"push",label:o("gitStatusPush"),runningLabel:o("gitStatusPushing"),running:e.isPushing,feedback:e.pushFeedback,tone:e.pushFeedbackTone,onClick:e.handlePush,disabled:e.isRunning}),e.supportsRemoteCheck&&t.jsx(Yt,{action:"check",label:o("gitStatusCheckRemote"),runningLabel:o("gitStatusCheckingRemote"),running:e.isCheckingRemote,feedback:e.checkFeedback,tone:e.checkFeedbackTone,title:e.checkFeedback?`${e.checkFeedback} · ${r}`:r,className:qe.checkRemote,onClick:e.handleCheckRemote,disabled:e.isRunning}),n&&t.jsxs("button",{type:"button",className:"git-status-action-button","aria-pressed":s,title:o(s?"sourceResumeLiveUpdates":"sourcePauseLiveUpdates"),onClick:n,children:[t.jsx("span",{className:"git-status-action-indicator","aria-hidden":"true",children:t.jsx(tn,{action:s?"play":"pause"})}),t.jsx("span",{className:qe.actionLabel,children:o(s?"sourceResumeLiveUpdates":"sourcePauseLiveUpdates")})]})]})}function Yt({action:e,label:s,runningLabel:n,running:o,feedback:i,tone:r,title:h,className:l="",onClick:u,disabled:p}){const b=h??i,[v,j]=a.useState(!1);a.useEffect(()=>{if(!r||!i){j(!1);return}j(!0);const g=setTimeout(()=>j(!1),6e3);return()=>clearTimeout(g)},[r,i]);const S=v&&r!==null&&i!=="";return t.jsxs("button",{type:"button",className:`git-status-action-button ${l} ${S?`git-status-action-${r}`:""} ${o?"git-status-action-running":""}`,title:b,"aria-label":o?`${s}: ${n}`:i?`${s}: ${i}`:s,onClick:u,disabled:p,children:[t.jsx("span",{className:"git-status-action-indicator","aria-hidden":"true",children:o?null:S?r==="success"?"✓":"!":t.jsx(tn,{action:e})}),t.jsx("span",{className:qe.actionLabel,children:s})]})}function tn({action:e}){if(e==="pause")return t.jsxs("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"currentColor",children:[t.jsx("rect",{x:"4",y:"3",width:"2.75",height:"10",rx:"0.6"}),t.jsx("rect",{x:"9.25",y:"3",width:"2.75",height:"10",rx:"0.6"})]});if(e==="play")return t.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M5 3.15 13 8 5 12.85Z"})});if(e==="check")return t.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M13 5V2.5L11.4 4A5.5 5.5 0 1 0 13.1 10"})});const s=e==="pull";return t.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:s?"M8 2v10M4.5 8.5 8 12l3.5-3.5":"M8 14V4M4.5 7.5 8 4l3.5 3.5"})})}function xc(e,s){return{sourceKey:e,routeId:"git-status",projectId:s,queryParams:{projectId:s}}}function bc(e,s){Sn(e,n=>s(n??{}),{ttlMs:dc})}function Sc(e){return vn(e,{touch:!1,recordDiagnostics:!1})}function vc(e){return a.useSyncExternalStore(bn,()=>e?Sc(e):null,()=>null)}function Sl(){const{t:e}=Qt(),s=$t(),[n,o]=Ot(),i=n.get("projectId"),r=Ps(),{openSidebar:h,isWideScreen:l}=_n(),u=a.useRef(null),[p,b]=a.useState(!1),v=ka(),j=p||!v,{projects:S,loading:g,complete:N}=Os(),x=i||Pn(S,void 0,N)||void 0,{project:f}=wn(x),{version:m,loading:M,error:C}=yn(),{settings:w}=jn(),_=Ee(m,Kn)&&((w==null?void 0:w.sourceReviewSubmissionsEnabled)??!1),{setTab:y}=is(_),B=Ee(m,zn),X=Ee(m,Hn),D=Ee(m,Yn),R=Ee(m,Gn),z=Ee(m,Jn),Z=Ee(m,Qn),V=Ee(m,qn),O=Ee(m,Bn)&&Ee(m,Un),J=O&&Ee(m,Vn),G=Ee(m,Wn),ne=Ee(m,Zn),ee=Ee(m,Xn),te=Ee(m,ea),fe=Ee(m,ta),{gitStatus:K,untrackedFiles:ae,untrackedLoading:d,untrackedError:P,loading:F,error:U,refetch:W}=gn(B?x:void 0,{omitUntracked:O,useUntrackedCache:V&&!O}),ue=!!(x&&O&&(K!=null&&K.isGitRepo)),ie=Tn(x??"",{tracked:!0,untracked:!0,ignored:!1},ue,j),q=a.useMemo(()=>O&&ie.generation?mc(K,ie.files):K,[ie.files,ie.generation,K,O]),A=O?null:ae,xe=ue&&ie.generation===null,Oe=F,Y=U,re=as(R?x:void 0),oe=fc(x,q,R),{defaultSession:pe}=a.useMemo(()=>An(s.state),[s.state]),We=(pe==null?void 0:pe.projectId)===x?pe??null:null,[Te,Pe]=a.useState(!1),ke=a.useMemo(()=>x?xc(r,x):null,[x,r]),he=vc(ke),Ie=Ra({projectId:x,status:q,routeRetentionKey:ke,supportsRemoteCheck:ne,supportsPull:ee,supportsPush:te,supportsIntegrationOptions:fe,onRefreshStatus:W,t:e});Cn(f==null?void 0:f.name,X?f==null?void 0:f.codeName:void 0,e("gitStatusTitle")),a.useLayoutEffect(()=>{q==null||q.files.length;const me=he==null?void 0:he.pageScrollTop;typeof me!="number"||!u.current||(u.current.scrollTop=me)},[q==null?void 0:q.files.length,he==null?void 0:he.pageScrollTop]),a.useLayoutEffect(()=>()=>{!ke||!u.current||bc(ke,me=>{var be;return{...me,pageScrollTop:((be=u.current)==null?void 0:be.scrollTop)??0}})},[ke]),a.useEffect(()=>{x&&f&&gs(x)},[x,f]);const Je=me=>{gs(me),o({projectId:me},{replace:!0,state:null})};return!x&&!g&&S.length===0?t.jsx("div",{className:"error",children:e("gitStatusNoProjects")}):t.jsxs(Mn,{isWideScreen:l,innerClassName:`source-control-main-content ${qe.sourceHeader}`,children:[t.jsx(dn,{title:(f==null?void 0:f.name)??e("gitStatusTitle"),titleElement:x?t.jsxs("div",{className:"source-header-identity",children:[t.jsx(ja,{currentProjectId:x,currentProjectName:f==null?void 0:f.name,onProjectChange:me=>Je(me.id)}),(q==null?void 0:q.isGitRepo)&&t.jsx(gi,{status:q,projectId:x,supportsIncomingCommits:G,className:"source-header-repo-status",onSelectChanges:R?()=>y("changes"):void 0,...oe,t:e})]}):void 0,onOpenSidebar:h,isWideScreen:l,actions:R&&x&&(q!=null&&q.isGitRepo)?t.jsx(gc,{status:q,pendingCount:re.pending.length,reviewsEnabled:_,supportsWorkingTreeFiles:V,gitActions:Ie,isWideScreen:l,worktreePaused:p,onToggleWorktreePaused:O?()=>b(me=>!me):void 0,t:e}):void 0}),t.jsx("main",{className:"page-scroll-container",ref:u,children:t.jsx("div",{className:"page-content-inner",children:M||g?t.jsx("div",{className:"loading",children:e("gitStatusLoading")}):C?t.jsxs("div",{className:"error",children:[e("gitStatusErrorPrefix")," ",C.message]}):B?Oe?t.jsx("div",{className:"loading",children:e("gitStatusLoading")}):Y?t.jsxs("div",{className:"error",children:[e("gitStatusErrorPrefix")," ",Y.message]}):q&&!q.isGitRepo&&x&&O?t.jsx(ms,{projectId:x,children:t.jsx(ps.Provider,{value:j,children:t.jsx("div",{className:"git-status",children:t.jsx(Hs,{projectId:x,isWideScreen:l,status:q,supportsWorkingTreeFiles:V,supportsWorktreeSections:!0,supportsCompleteFilesystemScan:J,t:e})})})}):q&&!q.isGitRepo?t.jsx("div",{className:"git-status-empty",children:e("gitStatusNotRepo")}):q&&x&&R?t.jsx(ms,{projectId:x,children:t.jsx(ps.Provider,{value:j,children:t.jsx(xn.Provider,{value:We,children:t.jsx(yc,{status:q,projectId:x,isWideScreen:l,supportsProjections:z,supportsInclusiveToHead:Z,supportsWorkingTreeFiles:V,supportsWorkingTreeSections:O,supportsCompleteFilesystemScan:J,untrackedFiles:A,untrackedLoading:d,untrackedError:P,inventoryPending:xe,inventoryLoading:xe&&ie.loading,inventoryError:xe?ie.error:null,supportsLastEditor:D,gitActions:Ie,reviewComments:re,reviewsEnabled:_,showReviewModal:Te,onOpenReview:()=>Pe(!0),onCloseReview:()=>Pe(!1),t:e},`${r}:${x}`)})})}):q&&x?t.jsx(wc,{gitActions:Ie,t:e},`${r}:${x}:compatibility`):null:t.jsx(_c,{t:e})})})]})}function _c({t:e}){return t.jsxs("div",{className:"git-status-upgrade",children:[t.jsx("h2",{children:e("gitStatusUpgradeRequiredTitle")}),t.jsx("p",{children:e("gitStatusUpgradeRequiredDescription")})]})}function wc({gitActions:e,t:s}){return t.jsxs("div",{className:"git-status git-status-compatibility",children:[t.jsx("div",{className:`source-control-action-row ${qe.compatibilityActions}`,children:t.jsx(en,{gitActions:e,t:s})}),t.jsx(sn,{gitActions:e,t:s}),t.jsxs("section",{className:"git-status-compatibility-notice",children:[t.jsx("h2",{children:s("gitStatusCompatibilityTitle")}),t.jsx("p",{children:s("gitStatusCompatibilityDescription")})]})]})}function yc({status:e,projectId:s,isWideScreen:n,supportsProjections:o,supportsInclusiveToHead:i,supportsWorkingTreeFiles:r,supportsWorkingTreeSections:h,supportsCompleteFilesystemScan:l,untrackedFiles:u,untrackedLoading:p,untrackedError:b,inventoryPending:v,inventoryLoading:j,inventoryError:S,supportsLastEditor:g,gitActions:N,reviewComments:x,reviewsEnabled:f,showReviewModal:m,onOpenReview:M,onCloseReview:C,t:w}){const _=Jt(),y=$t(),B=It(),[X,D]=Ot(),{tab:R}=is(f),z=X.get("bf")??void 0,Z=X.get("rev")??void 0,V=X.get("commitFile")??void 0,E=X.get("blame")==="1",O=X.get("worktreeFile")??void 0,{sourceControlCleanLanding:J}=Fn(),G=R==="changes"&&(X.get("history")==="1"||X.get("tab")==="commits"||Z===void 0&&e.isClean&&O===void 0&&J==="latest-commit"),[ne,ee]=a.useState(!1),[te,fe]=a.useState(!1),[K,ae]=a.useState(null),d=Nn("(max-width: 600px)"),P=o&≠a.useEffect(()=>{o||ee(!1)},[o]);const F=a.useCallback(()=>{ee(!1),ae(null),fe(!0)},[]),U=a.useCallback(Y=>{const re=Y instanceof Error&&Y.message?Y.message:w("gitStatusLoadDiffFailed");ee(!1),fe(!1),ae(w("sourceProjectionRequestError",{error:re}))},[w]),W=a.useCallback(()=>{if(!ne&&!o){ae(null),fe(!0);return}ee(!ne)},[ne,o]),ue=te?t.jsxs("div",{className:"source-projection-notice",role:"status",children:[t.jsx("span",{children:w("sourceProjectionUpgradeNotice")}),t.jsx("button",{type:"button",className:"source-projection-notice-dismiss","aria-label":w("sourceDismissProjectionNotice"),onClick:()=>fe(!1),children:"×"})]}):K?t.jsxs("div",{className:"source-projection-notice",role:"alert",children:[t.jsx("span",{children:K}),t.jsx("button",{type:"button",className:"source-projection-notice-dismiss","aria-label":w("sourceDismissProjectionError"),onClick:()=>ae(null),children:"×"})]}):null,ie=a.useCallback(Y=>{D(re=>{const oe=new URLSearchParams(re);return oe.set("tab","files"),oe.set("bf",Y),oe},{state:y.state})},[y.state,D]),q=a.useCallback(Y=>{D(re=>{const oe=new URLSearchParams(re);return oe.delete("tab"),oe.delete("history"),oe.set("rev",Y),oe},{state:y.state})},[y.state,D]),A=a.useCallback(Y=>{const re=new URLSearchParams(X);re.set("projectId",s);for(const oe of Dt)re.delete(oe);return Y&&re.set("rev",Y),Gs(`${B}/git-status?${re.toString()}`)},[B,s,X]),xe=a.useCallback(Y=>{D(re=>{const oe=new URLSearchParams(re);for(const pe of Dt)oe.delete(pe);return G&&oe.set("history","1"),Y&&oe.set("rev",Y),oe},{state:y.state})},[G,y.state,D]),Oe=a.useCallback(()=>{D(Y=>{const re=new URLSearchParams(Y);return re.delete("tab"),re.set("history","1"),re},{state:y.state})},[y.state,D]);return t.jsxs("div",{className:"git-status",children:[t.jsx(sn,{gitActions:N,t:w}),ue&&(d?Ls.createPortal(ue,document.body):ue),R==="changes"&&!G&&!Z?t.jsx(Js,{projectId:s,status:e,isWideScreen:n,supportsUntrackedCache:r&&!h,untrackedFiles:u,untrackedLoading:p,untrackedError:b,inventoryPending:v,inventoryLoading:j,inventoryError:S,initialWorkingTreePath:O,onBrowseHistory:Oe,onBlameFile:ie,captureReviewProjections:f,supportsLastEditor:g,ignoreWhitespace:P,onToggleIgnoreWhitespace:W,onProjectionRequestFailure:U,t:w}):R==="changes"?t.jsx(Do,{projectId:s,status:e,isWideScreen:n,supportsUntrackedCache:r&&!h,untrackedFiles:u,untrackedLoading:p,untrackedError:b,inventoryPending:v,inventoryLoading:j,inventoryError:S,initialSha:Z,initialPath:V,initialBlame:E,showRevisionPane:G,revisionHref:A,onSelectRevision:xe,onBrowseHistory:Oe,onBlameFile:ie,captureReviewProjections:f,supportsProjections:o,supportsInclusiveToHead:i,supportsLastEditor:g,ignoreWhitespace:P,onToggleIgnoreWhitespace:W,onProjectionUnavailable:F,onProjectionRequestFailure:U,t:w}):R==="comments"?t.jsx(Fi,{projectId:s,pending:x.pending,onOpenFile:ie,onSubmit:M,t:w}):R==="reviews"?t.jsx(Cr,{projectId:s,initialSubmissionId:X.get("submission")??void 0,sessionHref:Y=>`${B}/projects/${s}/sessions/${Y}`,t:w}):R==="files"?t.jsx(Hs,{projectId:s,isWideScreen:n,initialPath:z,status:e,supportsWorkingTreeFiles:r,supportsWorktreeSections:h,supportsCompleteFilesystemScan:l,onOpenCommit:q,captureReviewProjections:f,t:w}):null,m&&t.jsx(sc,{projectId:s,recentReviewSessionId:x.recentReviewSessionId,submissionsEnabled:f,onClose:C,onNavigateSession:Y=>_(`${B}/projects/${s}/sessions/${Y}`),t:w})]})}function jc(e){return new Set(e.files.map(s=>s.path)).size}function sn({gitActions:e,t:s}){const n=e.divergedActionStatus&&e.supportsIntegrationOptions;return!e.actionFeedback&&!n?null:t.jsxs("div",{className:"git-status-action-notices",children:[e.actionFeedback&&e.actionFeedbackTone&&t.jsx(la,{message:e.actionFeedback,tone:e.actionFeedbackTone,failure:e.actionFailure}),n&&t.jsx(Cc,{options:e.integrationOptions,loading:e.isLoadingIntegrationOptions,error:e.integrationOptionsError,t:s})]})}function Cc({options:e,loading:s,error:n,t:o}){return s?t.jsx("div",{className:"git-integration-options",children:t.jsx("span",{children:o("gitStatusAutoOptionsChecking")})}):n?t.jsx("div",{className:"git-integration-options git-integration-options-warning",children:t.jsx("span",{children:n})}):e?e.status==="available"?t.jsxs("div",{className:"git-integration-options",children:[t.jsx("span",{className:"git-integration-options-label",children:o("gitStatusAutoOptionsLabel")}),t.jsx("span",{className:"git-integration-option-pill","aria-disabled":"true",title:o("gitStatusAutoActionNotEnabled"),children:o("gitStatusAutoRebase")}),t.jsx("span",{className:"git-integration-option-pill","aria-disabled":"true",title:o("gitStatusAutoActionNotEnabled"),children:o("gitStatusAutoMerge")}),t.jsx(Ts,{t:o})]}):t.jsxs("div",{className:"git-integration-options git-integration-options-warning",children:[t.jsx("span",{children:o("gitStatusAutoOptionsUnavailable",{reason:kc(e.reasons,o)})}),t.jsx(Ts,{t:o})]}):null}function Ts({t:e}){return t.jsxs("details",{className:"git-integration-help",children:[t.jsx("summary",{"aria-label":e("gitStatusAutoHelpLabel"),title:e("gitStatusAutoHelpLabel"),children:"?"}),t.jsx("div",{className:"git-integration-help-popover",children:e("gitStatusAutoHelp")})]})}const Nc=["operation-running","sequencer-in-progress","dirty-worktree","missing-upstream","detached-head","not-diverged","not-a-git-repo","status-unavailable"];function kc(e,s){switch(Nc.find(o=>e.includes(o))??"status-unavailable"){case"operation-running":return s("gitStatusAutoReasonOperationRunning");case"sequencer-in-progress":return s("gitStatusAutoReasonSequencer");case"dirty-worktree":return s("gitStatusAutoReasonDirty");case"missing-upstream":return s("gitStatusAutoReasonMissingUpstream");case"detached-head":return s("gitStatusAutoReasonDetached");case"not-diverged":return s("gitStatusAutoReasonNotDiverged");case"not-a-git-repo":return s("gitStatusAutoReasonNotRepo");case"status-unavailable":return s("gitStatusAutoReasonStatusUnavailable");default:return s("gitStatusAutoReasonStatusUnavailable")}}export{Sl as GitStatusPage};
|
|
12
|
+
`]},i)})})]})}function Er(e,s){var o;if(e.resolvedAt)return"resolved";if(((o=e.entries.at(-1))==null?void 0:o.submittedAt)===void 0)return"open";const n=[...e.entries].reverse().find(i=>i.submittedAt);return n&&(e.outcomes.some(i=>i.entryId===n.id)||s==="changed")?"addressed":"open"}function Es(e,s){return e.name??s("sourceReviewSubmission",{date:Zs(e)})}function Zs(e){const s=new Date(e.submittedAt);return Number.isNaN(s.getTime())?e.submittedAt:s.toLocaleString()}function Tr(e){const s=e.side==="old"?e.oldLine:e.newLine,n=e.side==="old"?" (old)":"";return`${e.path}:${s??"?"}${n}`}function Pr(e){const s=e.side==="old"?e.oldLine:e.newLine;return String(s??"?")}function Lr(e,s){return s(e==="wont_fix"?"sourceReviewOutcomeNoChange":e==="question"?"sourceReviewOutcomeQuestion":"sourceReviewOutcomeDone")}function Fr(e,s){return s(e==="addressed"?"sourceReviewStateAddressed":e==="resolved"?"sourceReviewStateResolved":"sourceReviewStateOpen")}function Mr(e){return e==="addressed"?I.addressed:e==="resolved"?I.resolved:I.open}function Ar(e,s){return s(e==="changed"?"sourceReviewSourceChanged":e==="unchanged"?"sourceReviewSourceUnchanged":"sourceReviewSourceUnavailable")}function Dr(e){return e==="changed"?I.changed:e==="unchanged"?I.unchanged:I.unavailable}function $r(e,s){return s(e==="ingested"?"sourceReviewResponseIngested":e==="unchanged"?"sourceReviewResponseUnchanged":e==="invalid"?"sourceReviewResponseInvalid":"sourceReviewResponseMissing")}function Or(e,s){return s(e==="binary"?"sourceReviewCaptureUnavailableBinary":e==="too-large"?"sourceReviewCaptureUnavailableTooLarge":"sourceReviewCaptureUnavailableMissing")}const Ir="_modal_1mt5u_1",Br="_list_1mt5u_8",Ur="_row_1mt5u_19",Hr="_stale_1mt5u_25",Gr="_rowHead_1mt5u_30",qr="_location_1mt5u_36",Kr="_staleLabel_1mt5u_41",Wr="_movedLabel_1mt5u_46",zr="_rowText_1mt5u_51",Vr="_destination_1mt5u_56",Yr="_field_1mt5u_65",Qr="_newSession_1mt5u_85",Jr="_targetError_1mt5u_91",Zr="_error_1mt5u_92",Xr="_actions_1mt5u_100",ec="_name_1mt5u_107",tc="_go_1mt5u_112",_e={modal:Ir,list:Br,row:Ur,stale:Hr,rowHead:Gr,location:qr,staleLabel:Kr,movedLabel:Wr,rowText:zr,destination:Vr,field:Yr,newSession:Qr,targetError:Jr,error:Zr,actions:Xr,name:ec,go:tc};function sc({projectId:e,recentReviewSessionId:s,submissionsEnabled:n=!1,onClose:o,onNavigateSession:i,t:r}){var ae;const[h,l]=a.useState(null),[u,p]=a.useState(new Set),[b,v]=a.useState(s??"new"),y=a.useRef(!1),[S,g]=a.useState(!1),[N,x]=a.useState(null),[f,m]=a.useState(null),[M,C]=a.useState(!1),[w,_]=a.useState(""),j=a.useRef(null);n&&!j.current&&(j.current=ln());const[B,X]=a.useState(null),[D,R]=a.useState(null),{providers:z,loading:Z}=$n(),V=a.useMemo(()=>On(z),[z]),[E,O]=a.useState(""),[J,G]=a.useState(""),ne=V.find(d=>d.name===E),ee=h==null?void 0:h.find(d=>u.has(d.comment.id)),te=$s((ee==null?void 0:ee.comment.text)??"");a.useEffect(()=>{const d=In(z);d&&O(P=>P||d.name)},[z]),a.useEffect(()=>{let d=!1;return fn(e).then(P=>{var F;d||(X(P),y.current||v(s||(((F=P[0])==null?void 0:F.id)??"new")))}).catch(P=>{d||R(P instanceof Error?P.message:r("sourceReviewSessionsUnavailable"))}),()=>{d=!0}},[e,s,r]),a.useEffect(()=>{let d=!1;return de.previewReview(e).then(P=>{d||(l(P.items),p(new Set(P.items.filter(F=>!F.defaultDiscard).map(F=>F.comment.id))))}).catch(P=>{d||x(P instanceof Error?P.message:"Failed to preview")}),()=>{d=!0}},[e]);const fe=a.useCallback(d=>{p(P=>{const F=new Set(P);return F.has(d)?F.delete(d):F.add(d),F})},[]),K=a.useCallback(async()=>{const d=[...u];if(d.length!==0){g(!0),x(null);try{const P=b==="new"?{provider:E||void 0,model:J||void 0}:void 0,F=n&&j.current?await de.submitReview(e,d,b,P,{id:j.current,name:w.trim()||void 0}):await de.submitReview(e,d,b,P);if(wt(e),F.sessionId){i(F.sessionId),o();return}m(r(n?"sourceReviewSubmissionQueued":"sourceReviewSubmitQueued")),C(!0)}catch(P){x(P instanceof Error?P.message:"Failed to submit")}finally{g(!1)}}},[u,b,E,J,e,i,o,r,n,w]);return t.jsx(jt,{title:r("sourceReviewSubmitTitle"),onClose:o,children:t.jsxs("div",{className:_e.modal,children:[N&&t.jsx("div",{className:_e.error,children:N}),f&&t.jsx("div",{role:"status",children:f}),h===null?t.jsx("div",{children:r("loading")}):h.length===0?t.jsx("div",{children:r("sourceReviewNoPending")}):t.jsx("ul",{className:_e.list,children:h.map(d=>t.jsx(nc,{item:d,checked:u.has(d.comment.id),onToggle:()=>fe(d.comment.id),t:r},d.comment.id))}),h&&h.length>0&&t.jsxs("div",{className:_e.destination,children:[t.jsxs("label",{className:_e.field,children:[t.jsx("span",{children:r("sourceReviewTargetLegend")}),t.jsxs("select",{value:b,onChange:d=>{y.current=!0,v(d.target.value)},children:[t.jsx("option",{value:"new",children:r("sourceReviewTargetNew")}),s&&!(B!=null&&B.some(d=>d.id===s))&&t.jsxs("option",{value:s,children:[r("sourceReviewTargetRecent")," ·"," ",s.slice(0,8)]}),B==null?void 0:B.map(d=>t.jsx("option",{value:d.id,children:pn(d,d.id===s?r("sourceReviewRecentSuffix"):void 0)},d.id))]})]}),D&&t.jsxs("div",{className:_e.targetError,children:[r("sourceReviewSessionsUnavailable"),": ",D]}),b==="new"&&t.jsxs("div",{className:_e.newSession,children:[t.jsxs("label",{className:_e.field,children:[t.jsx("span",{children:r("sourceReviewProvider")}),t.jsx("select",{value:E,disabled:Z||V.length===0,onChange:d=>{O(d.target.value),G("")},children:V.map(d=>t.jsx("option",{value:d.name,children:d.displayName},d.name))})]}),t.jsxs("label",{className:_e.field,children:[t.jsx("span",{children:r("sourceReviewModel")}),t.jsxs("select",{value:J,disabled:!ne,onChange:d=>G(d.target.value),children:[t.jsx("option",{value:"",children:r("sourceReviewModelDefault")}),(ae=ne==null?void 0:ne.models)==null?void 0:ae.map(d=>t.jsx("option",{value:d.id,children:d.name},d.id))]})]})]})]}),t.jsxs("div",{className:_e.actions,children:[n&&t.jsxs("label",{className:`${_e.field} ${_e.name}`,children:[t.jsx("span",{children:r("sourceReviewSubmissionName")}),t.jsx("input",{value:w,maxLength:120,placeholder:te,onChange:d=>_(d.target.value)})]}),t.jsx("button",{type:"button",onClick:o,disabled:S,children:r("cancel")}),t.jsx("button",{type:"button",className:_e.go,onClick:K,disabled:S||M||u.size===0,children:r("sourceReviewSubmitReview",{count:u.size})})]})]})})}function nc({item:e,checked:s,onToggle:n,t:o}){const i=e.relocation.status==="gone",r=i?e.relocation.citeSha?`${e.relocation.path} @ ${e.relocation.citeSha.slice(0,8)}`:e.relocation.path:`${e.relocation.path}:${e.relocation.line}`;return t.jsxs("li",{className:`${_e.row} ${i?_e.stale:""}`,children:[t.jsxs("label",{className:_e.rowHead,children:[t.jsx("input",{type:"checkbox",checked:s,onChange:n}),t.jsx("span",{className:_e.location,children:r}),i&&t.jsx("span",{className:_e.staleLabel,children:o("sourceReviewStale")}),!i&&e.relocation.moved&&t.jsx("span",{className:_e.movedLabel,children:o("sourceReviewMoved")})]}),t.jsx("div",{className:_e.rowText,children:e.comment.text})]})}const ac="_tabs_qaerl_2",oc="_tab_qaerl_2",ic="_active_qaerl_30",rc="_count_qaerl_35",cc="_stacked_qaerl_47",St={tabs:ac,tab:oc,active:ic,count:rc,stacked:cc};function lc({tab:e,tabs:s,counts:n,fileTabLabelKey:o,onSelect:i,variant:r="header",t:h}){return t.jsx("div",{className:`${St.tabs} ${r==="stacked"?St.stacked:""}`.trimEnd(),role:"tablist",children:s.map(l=>{const u=n==null?void 0:n[l];return t.jsxs("button",{type:"button",role:"tab","aria-selected":e===l,className:`${St.tab} ${e===l?St.active:""}`.trimEnd(),onClick:()=>i(l),children:[h(l==="files"&&o?o:uc(l)),typeof u=="number"&&u>0&&t.jsx("span",{className:St.count,children:u})]},l)})})}function uc(e){switch(e){case"changes":return"sourceTabChanges";case"files":return"sourceTabFiles";case"comments":return"sourceTabComments";case"reviews":return"sourceTabReviews"}}const dc=300*1e3,Xs=["changes","files","comments"],hc=[...Xs,"reviews"],Dt=["tab","history","rev","commitFile","blame","worktreeFile","bf","submission"];function mc(e,s){if(!e)return null;const n=new Map(e.files.flatMap(i=>i.lastEditor?[[i.path,i.lastEditor]]:[])),o=[];for(const i of s)for(const r of i.worktreeChanges??[]){const h=r.lastEditor??n.get(i.path);o.push({path:i.path,...r,...h?{lastEditor:h}:{}})}return{...e,files:o,isClean:o.length===0}}function is(e=!1){const[s,n]=Ot(),o=$t(),i=s.get("tab"),r=i==="files"?"files":i==="comments"?"comments":i==="reviews"&&e?"reviews":"changes",h=a.useCallback(l=>{n(u=>{const p=new URLSearchParams(u);return l==="changes"?p.delete("tab"):p.set("tab",l),p.delete("history"),p.delete("rev"),l!=="reviews"&&p.delete("submission"),p},{state:o.state})},[o.state,n]);return{tab:r,setTab:h}}function fc(e,s,n){var v,y;const o=It(),i=$t(),[r,h]=Ot(),l=(y=(v=s==null?void 0:s.recentCommits)==null?void 0:v[0])==null?void 0:y.hash,u=n&&l!==void 0&&e!==void 0,p=a.useMemo(()=>{if(!u)return;const S=new URLSearchParams(r);S.set("projectId",e);for(const g of Dt)S.delete(g);return S.set("rev",l),Gs(`${o}/git-status?${S.toString()}`)},[u,o,l,e,r]),b=a.useCallback(()=>{u&&h(S=>{const g=new URLSearchParams(S);for(const N of Dt)g.delete(N);return g.set("rev",l),g},{state:i.state})},[u,l,i.state,h]);return u?{headCommitHref:p,onOpenHeadCommit:b}:{}}function pc({status:e,pendingCount:s,reviewsEnabled:n,supportsWorkingTreeFiles:o,t:i}){const{tab:r,setTab:h}=is(n),l=yc(e);return t.jsx(lc,{tab:r,tabs:n?hc:Xs,variant:"stacked",counts:{changes:l,comments:s},fileTabLabelKey:o?"sourceTabWorkingTree":void 0,onSelect:h,t:i})}function gc({status:e,pendingCount:s,reviewsEnabled:n,supportsWorkingTreeFiles:o,worktreePaused:i,gitActions:r,isWideScreen:h,onToggleWorktreePaused:l,t:u}){const p=a.useRef(null),b=a.useRef(null),[v,y]=a.useState(!1);return a.useLayoutEffect(()=>{if(!h){y(!1);return}const S=p.current,g=b.current,N=S==null?void 0:S.closest(".session-header-inner"),x=N==null?void 0:N.querySelector(".session-header-left"),f=S==null?void 0:S.querySelector("[data-source-action-group]"),m=g==null?void 0:g.querySelector('[role="tablist"]');if(!S||!g||!N||!x||!f||!m)return;const M=()=>{const w=getComputedStyle(N),_=N.clientWidth-Xe(w.paddingLeft)-Xe(w.paddingRight),j=Xe(w.columnGap);if(_<=0){y(!1);return}const B=Vt(x)+Vt(f)+Vt(m)+2*j;y(B<=_+.5)};if(M(),typeof ResizeObserver>"u")return;const C=new ResizeObserver(M);return C.observe(N),C.observe(x),C.observe(f),C.observe(m),()=>C.disconnect()},[h]),t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:p,className:`${qe.headerControls} ${v?qe.titleRow:qe.fallbackRow}`,"data-source-actions-placement":v?"title":"fallback",children:t.jsx(en,{gitActions:r,worktreePaused:i,onToggleWorktreePaused:l,t:u})}),t.jsx("div",{ref:b,className:qe.headerTabs,children:t.jsx(pc,{status:e,pendingCount:s,reviewsEnabled:n,supportsWorkingTreeFiles:o,t:u})})]})}function Vt(e){const s=getComputedStyle(e),n=Array.from(e.children).filter(i=>i instanceof HTMLElement&&getComputedStyle(i).display!=="none");return n.reduce((i,r)=>i+Math.max(r.getBoundingClientRect().width,r.scrollWidth),0)+Math.max(0,n.length-1)*Xe(s.columnGap)+Xe(s.paddingLeft)+Xe(s.paddingRight)+Xe(s.borderLeftWidth)+Xe(s.borderRightWidth)}function Xe(e){const s=Number.parseFloat(e);return Number.isFinite(s)?s:0}function en({gitActions:e,worktreePaused:s,onToggleWorktreePaused:n,t:o}){const i=Ln(),r=o("gitStatusLastCheckedRemote",{time:Ea(e.checkedRemoteAt,i,o)});return t.jsxs("div",{className:qe.actionGroup,"data-source-action-group":!0,children:[e.supportsPull&&t.jsx(Yt,{action:"pull",label:o("gitStatusPull"),runningLabel:o("gitStatusPulling"),running:e.isPulling,feedback:e.pullFeedback,tone:e.pullFeedbackTone,onClick:e.handlePull,disabled:e.isRunning}),e.supportsPush&&t.jsx(Yt,{action:"push",label:o("gitStatusPush"),runningLabel:o("gitStatusPushing"),running:e.isPushing,feedback:e.pushFeedback,tone:e.pushFeedbackTone,onClick:e.handlePush,disabled:e.isRunning}),e.supportsRemoteCheck&&t.jsx(Yt,{action:"check",label:o("gitStatusCheckRemote"),runningLabel:o("gitStatusCheckingRemote"),running:e.isCheckingRemote,feedback:e.checkFeedback,tone:e.checkFeedbackTone,title:e.checkFeedback?`${e.checkFeedback} · ${r}`:r,className:qe.checkRemote,onClick:e.handleCheckRemote,disabled:e.isRunning}),n&&t.jsxs("button",{type:"button",className:"git-status-action-button","aria-pressed":s,title:o(s?"sourceResumeLiveUpdates":"sourcePauseLiveUpdates"),onClick:n,children:[t.jsx("span",{className:"git-status-action-indicator","aria-hidden":"true",children:t.jsx(tn,{action:s?"play":"pause"})}),t.jsx("span",{className:qe.actionLabel,children:o(s?"sourceResumeLiveUpdates":"sourcePauseLiveUpdates")})]})]})}function Yt({action:e,label:s,runningLabel:n,running:o,feedback:i,tone:r,title:h,className:l="",onClick:u,disabled:p}){const b=h??i,[v,y]=a.useState(!1);a.useEffect(()=>{if(!r||!i){y(!1);return}y(!0);const g=setTimeout(()=>y(!1),6e3);return()=>clearTimeout(g)},[r,i]);const S=v&&r!==null&&i!=="";return t.jsxs("button",{type:"button",className:`git-status-action-button ${l} ${S?`git-status-action-${r}`:""} ${o?"git-status-action-running":""}`,title:b,"aria-label":o?`${s}: ${n}`:i?`${s}: ${i}`:s,onClick:u,disabled:p,children:[t.jsx("span",{className:"git-status-action-indicator","aria-hidden":"true",children:o?null:S?r==="success"?"✓":"!":t.jsx(tn,{action:e})}),t.jsx("span",{className:qe.actionLabel,children:s})]})}function tn({action:e}){if(e==="pause")return t.jsxs("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"currentColor",children:[t.jsx("rect",{x:"4",y:"3",width:"2.75",height:"10",rx:"0.6"}),t.jsx("rect",{x:"9.25",y:"3",width:"2.75",height:"10",rx:"0.6"})]});if(e==="play")return t.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"currentColor",children:t.jsx("path",{d:"M5 3.15 13 8 5 12.85Z"})});if(e==="check")return t.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M13 5V2.5L11.4 4A5.5 5.5 0 1 0 13.1 10"})});const s=e==="pull";return t.jsx("svg",{className:"git-status-action-glyph","aria-hidden":"true",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:s?"M8 2v10M4.5 8.5 8 12l3.5-3.5":"M8 14V4M4.5 7.5 8 4l3.5 3.5"})})}function xc(e,s){return{sourceKey:e,routeId:"git-status",projectId:s,queryParams:{projectId:s}}}function bc(e,s){Sn(e,n=>s(n??{}),{ttlMs:dc})}function Sc(e){return vn(e,{touch:!1,recordDiagnostics:!1})}function vc(e){return a.useSyncExternalStore(bn,()=>e?Sc(e):null,()=>null)}function Sl(){const{t:e}=Qt(),s=$t(),[n,o]=Ot(),i=n.get("projectId"),r=Ps(),{openSidebar:h,isWideScreen:l}=_n(),u=a.useRef(null),[p,b]=a.useState(!1),v=ka(),y=p||!v,{projects:S,loading:g,complete:N}=Os(),x=i||Pn(S,void 0,N)||void 0,{project:f}=wn(x),{version:m,loading:M,error:C}=jn(),{settings:w}=yn(),_=Ee(m,Kn)&&((w==null?void 0:w.sourceReviewSubmissionsEnabled)??!1),{setTab:j}=is(_),B=Ee(m,zn),X=Ee(m,Hn),D=Ee(m,Yn),R=Ee(m,Gn),z=Ee(m,Jn),Z=Ee(m,Qn),V=Ee(m,qn),O=Ee(m,Bn)&&Ee(m,Un),J=O&&Ee(m,Vn),G=Ee(m,Wn),ne=Ee(m,Zn),ee=Ee(m,Xn),te=Ee(m,ea),fe=Ee(m,ta),{gitStatus:K,untrackedFiles:ae,untrackedLoading:d,untrackedError:P,loading:F,error:U,refetch:W}=gn(B?x:void 0,{omitUntracked:O,useUntrackedCache:V&&!O}),ue=!!(x&&O&&(K!=null&&K.isGitRepo)),ie=Tn(x??"",{tracked:!0,untracked:!0,ignored:!1},ue,y),q=a.useMemo(()=>O&&ie.generation?mc(K,ie.files):K,[ie.files,ie.generation,K,O]),A=O?null:ae,xe=ue&&ie.generation===null,Oe=F,Y=U,re=as(R?x:void 0),oe=fc(x,q,R),{defaultSession:pe}=a.useMemo(()=>An(s.state),[s.state]),We=(pe==null?void 0:pe.projectId)===x?pe??null:null,[Te,Pe]=a.useState(!1),ke=a.useMemo(()=>x?xc(r,x):null,[x,r]),he=vc(ke),Ie=Ra({projectId:x,status:q,routeRetentionKey:ke,supportsRemoteCheck:ne,supportsPull:ee,supportsPush:te,supportsIntegrationOptions:fe,onRefreshStatus:W,t:e});Cn(f==null?void 0:f.name,X?f==null?void 0:f.codeName:void 0,e("gitStatusTitle")),a.useLayoutEffect(()=>{q==null||q.files.length;const me=he==null?void 0:he.pageScrollTop;typeof me!="number"||!u.current||(u.current.scrollTop=me)},[q==null?void 0:q.files.length,he==null?void 0:he.pageScrollTop]),a.useLayoutEffect(()=>()=>{!ke||!u.current||bc(ke,me=>{var be;return{...me,pageScrollTop:((be=u.current)==null?void 0:be.scrollTop)??0}})},[ke]),a.useEffect(()=>{x&&f&&gs(x)},[x,f]);const Je=me=>{gs(me),o({projectId:me},{replace:!0,state:null})};return!x&&!g&&S.length===0?t.jsx("div",{className:"error",children:e("gitStatusNoProjects")}):t.jsxs(Mn,{isWideScreen:l,innerClassName:`source-control-main-content ${qe.sourceHeader}`,children:[t.jsx(dn,{title:(f==null?void 0:f.name)??e("gitStatusTitle"),titleElement:x?t.jsxs("div",{className:"source-header-identity",children:[t.jsx(ya,{currentProjectId:x,currentProjectName:f==null?void 0:f.name,onProjectChange:me=>Je(me.id)}),(q==null?void 0:q.isGitRepo)&&t.jsx(gi,{status:q,projectId:x,supportsIncomingCommits:G,className:"source-header-repo-status",onSelectChanges:R?()=>j("changes"):void 0,...oe,t:e})]}):void 0,onOpenSidebar:h,isWideScreen:l,actions:R&&x&&(q!=null&&q.isGitRepo)?t.jsx(gc,{status:q,pendingCount:re.pending.length,reviewsEnabled:_,supportsWorkingTreeFiles:V,gitActions:Ie,isWideScreen:l,worktreePaused:p,onToggleWorktreePaused:O?()=>b(me=>!me):void 0,t:e}):void 0}),t.jsx("main",{className:"page-scroll-container",ref:u,children:t.jsx("div",{className:"page-content-inner",children:M||g?t.jsx("div",{className:"loading",children:e("gitStatusLoading")}):C?t.jsxs("div",{className:"error",children:[e("gitStatusErrorPrefix")," ",C.message]}):B?Oe?t.jsx("div",{className:"loading",children:e("gitStatusLoading")}):Y?t.jsxs("div",{className:"error",children:[e("gitStatusErrorPrefix")," ",Y.message]}):q&&!q.isGitRepo&&x&&O?t.jsx(ms,{projectId:x,children:t.jsx(ps.Provider,{value:y,children:t.jsx("div",{className:"git-status",children:t.jsx(Hs,{projectId:x,isWideScreen:l,status:q,supportsWorkingTreeFiles:V,supportsWorktreeSections:!0,supportsCompleteFilesystemScan:J,t:e})})})}):q&&!q.isGitRepo?t.jsx("div",{className:"git-status-empty",children:e("gitStatusNotRepo")}):q&&x&&R?t.jsx(ms,{projectId:x,children:t.jsx(ps.Provider,{value:y,children:t.jsx(xn.Provider,{value:We,children:t.jsx(jc,{status:q,projectId:x,isWideScreen:l,supportsProjections:z,supportsInclusiveToHead:Z,supportsWorkingTreeFiles:V,supportsWorkingTreeSections:O,supportsCompleteFilesystemScan:J,untrackedFiles:A,untrackedLoading:d,untrackedError:P,inventoryPending:xe,inventoryLoading:xe&&ie.loading,inventoryError:xe?ie.error:null,supportsLastEditor:D,gitActions:Ie,reviewComments:re,reviewsEnabled:_,showReviewModal:Te,onOpenReview:()=>Pe(!0),onCloseReview:()=>Pe(!1),t:e},`${r}:${x}`)})})}):q&&x?t.jsx(wc,{gitActions:Ie,t:e},`${r}:${x}:compatibility`):null:t.jsx(_c,{t:e})})})]})}function _c({t:e}){return t.jsxs("div",{className:"git-status-upgrade",children:[t.jsx("h2",{children:e("gitStatusUpgradeRequiredTitle")}),t.jsx("p",{children:e("gitStatusUpgradeRequiredDescription")})]})}function wc({gitActions:e,t:s}){return t.jsxs("div",{className:"git-status git-status-compatibility",children:[t.jsx("div",{className:`source-control-action-row ${qe.compatibilityActions}`,children:t.jsx(en,{gitActions:e,t:s})}),t.jsx(sn,{gitActions:e,t:s}),t.jsxs("section",{className:"git-status-compatibility-notice",children:[t.jsx("h2",{children:s("gitStatusCompatibilityTitle")}),t.jsx("p",{children:s("gitStatusCompatibilityDescription")})]})]})}function jc({status:e,projectId:s,isWideScreen:n,supportsProjections:o,supportsInclusiveToHead:i,supportsWorkingTreeFiles:r,supportsWorkingTreeSections:h,supportsCompleteFilesystemScan:l,untrackedFiles:u,untrackedLoading:p,untrackedError:b,inventoryPending:v,inventoryLoading:y,inventoryError:S,supportsLastEditor:g,gitActions:N,reviewComments:x,reviewsEnabled:f,showReviewModal:m,onOpenReview:M,onCloseReview:C,t:w}){const _=Jt(),j=$t(),B=It(),[X,D]=Ot(),{tab:R}=is(f),z=X.get("bf")??void 0,Z=X.get("rev")??void 0,V=X.get("commitFile")??void 0,E=X.get("blame")==="1",O=X.get("worktreeFile")??void 0,{sourceControlCleanLanding:J}=Fn(),G=R==="changes"&&(X.get("history")==="1"||X.get("tab")==="commits"||Z===void 0&&e.isClean&&O===void 0&&J==="latest-commit"),[ne,ee]=a.useState(!1),[te,fe]=a.useState(!1),[K,ae]=a.useState(null),d=Nn("(max-width: 600px)"),P=o&≠a.useEffect(()=>{o||ee(!1)},[o]);const F=a.useCallback(()=>{ee(!1),ae(null),fe(!0)},[]),U=a.useCallback(Y=>{const re=Y instanceof Error&&Y.message?Y.message:w("gitStatusLoadDiffFailed");ee(!1),fe(!1),ae(w("sourceProjectionRequestError",{error:re}))},[w]),W=a.useCallback(()=>{if(!ne&&!o){ae(null),fe(!0);return}ee(!ne)},[ne,o]),ue=te?t.jsxs("div",{className:"source-projection-notice",role:"status",children:[t.jsx("span",{children:w("sourceProjectionUpgradeNotice")}),t.jsx("button",{type:"button",className:"source-projection-notice-dismiss","aria-label":w("sourceDismissProjectionNotice"),onClick:()=>fe(!1),children:"×"})]}):K?t.jsxs("div",{className:"source-projection-notice",role:"alert",children:[t.jsx("span",{children:K}),t.jsx("button",{type:"button",className:"source-projection-notice-dismiss","aria-label":w("sourceDismissProjectionError"),onClick:()=>ae(null),children:"×"})]}):null,ie=a.useCallback(Y=>{D(re=>{const oe=new URLSearchParams(re);return oe.set("tab","files"),oe.set("bf",Y),oe},{state:j.state})},[j.state,D]),q=a.useCallback(Y=>{D(re=>{const oe=new URLSearchParams(re);return oe.delete("tab"),oe.delete("history"),oe.set("rev",Y),oe},{state:j.state})},[j.state,D]),A=a.useCallback(Y=>{const re=new URLSearchParams(X);re.set("projectId",s);for(const oe of Dt)re.delete(oe);return Y&&re.set("rev",Y),Gs(`${B}/git-status?${re.toString()}`)},[B,s,X]),xe=a.useCallback(Y=>{D(re=>{const oe=new URLSearchParams(re);for(const pe of Dt)oe.delete(pe);return G&&oe.set("history","1"),Y&&oe.set("rev",Y),oe},{state:j.state})},[G,j.state,D]),Oe=a.useCallback(()=>{D(Y=>{const re=new URLSearchParams(Y);return re.delete("tab"),re.set("history","1"),re},{state:j.state})},[j.state,D]);return t.jsxs("div",{className:"git-status",children:[t.jsx(sn,{gitActions:N,t:w}),ue&&(d?Ls.createPortal(ue,document.body):ue),R==="changes"&&!G&&!Z?t.jsx(Js,{projectId:s,status:e,isWideScreen:n,supportsUntrackedCache:r&&!h,untrackedFiles:u,untrackedLoading:p,untrackedError:b,inventoryPending:v,inventoryLoading:y,inventoryError:S,initialWorkingTreePath:O,onBrowseHistory:Oe,onBlameFile:ie,captureReviewProjections:f,supportsLastEditor:g,ignoreWhitespace:P,onToggleIgnoreWhitespace:W,onProjectionRequestFailure:U,t:w}):R==="changes"?t.jsx(Do,{projectId:s,status:e,isWideScreen:n,supportsUntrackedCache:r&&!h,untrackedFiles:u,untrackedLoading:p,untrackedError:b,inventoryPending:v,inventoryLoading:y,inventoryError:S,initialSha:Z,initialPath:V,initialBlame:E,showRevisionPane:G,revisionHref:A,onSelectRevision:xe,onBrowseHistory:Oe,onBlameFile:ie,captureReviewProjections:f,supportsProjections:o,supportsInclusiveToHead:i,supportsLastEditor:g,ignoreWhitespace:P,onToggleIgnoreWhitespace:W,onProjectionUnavailable:F,onProjectionRequestFailure:U,t:w}):R==="comments"?t.jsx(Fi,{projectId:s,pending:x.pending,onOpenFile:ie,onSubmit:M,t:w}):R==="reviews"?t.jsx(Cr,{projectId:s,initialSubmissionId:X.get("submission")??void 0,sessionHref:Y=>`${B}/projects/${s}/sessions/${Y}`,t:w}):R==="files"?t.jsx(Hs,{projectId:s,isWideScreen:n,initialPath:z,status:e,supportsWorkingTreeFiles:r,supportsWorktreeSections:h,supportsCompleteFilesystemScan:l,onOpenCommit:q,captureReviewProjections:f,t:w}):null,m&&t.jsx(sc,{projectId:s,recentReviewSessionId:x.recentReviewSessionId,submissionsEnabled:f,onClose:C,onNavigateSession:Y=>_(`${B}/projects/${s}/sessions/${Y}`),t:w})]})}function yc(e){return new Set(e.files.map(s=>s.path)).size}function sn({gitActions:e,t:s}){const n=e.divergedActionStatus&&e.supportsIntegrationOptions;return!e.actionFeedback&&!n?null:t.jsxs("div",{className:"git-status-action-notices",children:[e.actionFeedback&&e.actionFeedbackTone&&t.jsx(la,{message:e.actionFeedback,tone:e.actionFeedbackTone,failure:e.actionFailure}),n&&t.jsx(Cc,{options:e.integrationOptions,loading:e.isLoadingIntegrationOptions,error:e.integrationOptionsError,t:s})]})}function Cc({options:e,loading:s,error:n,t:o}){return s?t.jsx("div",{className:"git-integration-options",children:t.jsx("span",{children:o("gitStatusAutoOptionsChecking")})}):n?t.jsx("div",{className:"git-integration-options git-integration-options-warning",children:t.jsx("span",{children:n})}):e?e.status==="available"?t.jsxs("div",{className:"git-integration-options",children:[t.jsx("span",{className:"git-integration-options-label",children:o("gitStatusAutoOptionsLabel")}),t.jsx("span",{className:"git-integration-option-pill","aria-disabled":"true",title:o("gitStatusAutoActionNotEnabled"),children:o("gitStatusAutoRebase")}),t.jsx("span",{className:"git-integration-option-pill","aria-disabled":"true",title:o("gitStatusAutoActionNotEnabled"),children:o("gitStatusAutoMerge")}),t.jsx(Ts,{t:o})]}):t.jsxs("div",{className:"git-integration-options git-integration-options-warning",children:[t.jsx("span",{children:o("gitStatusAutoOptionsUnavailable",{reason:kc(e.reasons,o)})}),t.jsx(Ts,{t:o})]}):null}function Ts({t:e}){return t.jsxs("details",{className:"git-integration-help",children:[t.jsx("summary",{"aria-label":e("gitStatusAutoHelpLabel"),title:e("gitStatusAutoHelpLabel"),children:"?"}),t.jsx("div",{className:"git-integration-help-popover",children:e("gitStatusAutoHelp")})]})}const Nc=["operation-running","sequencer-in-progress","dirty-worktree","missing-upstream","detached-head","not-diverged","not-a-git-repo","status-unavailable"];function kc(e,s){switch(Nc.find(o=>e.includes(o))??"status-unavailable"){case"operation-running":return s("gitStatusAutoReasonOperationRunning");case"sequencer-in-progress":return s("gitStatusAutoReasonSequencer");case"dirty-worktree":return s("gitStatusAutoReasonDirty");case"missing-upstream":return s("gitStatusAutoReasonMissingUpstream");case"detached-head":return s("gitStatusAutoReasonDetached");case"not-diverged":return s("gitStatusAutoReasonNotDiverged");case"not-a-git-repo":return s("gitStatusAutoReasonNotRepo");case"status-unavailable":return s("gitStatusAutoReasonStatusUnavailable");default:return s("gitStatusAutoReasonStatusUnavailable")}}export{Sl as GitStatusPage};
|