yepanywhere 0.9.1 → 0.9.2
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/__tests__/model-prices.test.js +12 -0
- package/bundled/@yep-anywhere/shared/dist/__tests__/model-prices.test.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +2 -2
- package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/app-types.js +5 -5
- package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/artifact-viewer.d.ts +21 -0
- package/bundled/@yep-anywhere/shared/dist/artifact-viewer.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/artifact-viewer.js +22 -1
- package/bundled/@yep-anywhere/shared/dist/artifact-viewer.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts +2 -2
- package/bundled/@yep-anywhere/shared/dist/find/documentFind.d.ts +41 -0
- package/bundled/@yep-anywhere/shared/dist/find/documentFind.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/find/documentFind.js +280 -0
- package/bundled/@yep-anywhere/shared/dist/find/documentFind.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.d.ts +2 -0
- package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.d.ts +2 -0
- package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.js +5 -0
- package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.js +59 -0
- package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/find/protocol.d.ts +46 -0
- package/bundled/@yep-anywhere/shared/dist/find/protocol.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/find/protocol.js +45 -0
- package/bundled/@yep-anywhere/shared/dist/find/protocol.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/index.d.ts +4 -2
- package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/index.js +3 -1
- package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/model-prices.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/model-prices.js +9 -2
- package/bundled/@yep-anywhere/shared/dist/model-prices.js.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/pdfjs.d.ts +7 -0
- package/bundled/@yep-anywhere/shared/dist/pdfjs.d.ts.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/pdfjs.js +7 -0
- package/bundled/@yep-anywhere/shared/dist/pdfjs.js.map +1 -0
- package/bundled/@yep-anywhere/shared/dist/skill-invocations.d.ts.map +1 -1
- package/bundled/@yep-anywhere/shared/dist/skill-invocations.js +7 -10
- package/bundled/@yep-anywhere/shared/dist/skill-invocations.js.map +1 -1
- package/bundled/@yep-anywhere/shared/package.json +1 -1
- package/client-dist/assets/{AboutSettings-CHsaLshd.js → AboutSettings-CCzudbSj.js} +1 -1
- package/client-dist/assets/{ActivityPage-CBVcBckm.js → ActivityPage-Bn0LbMgE.js} +1 -1
- package/client-dist/assets/{AgentContextSettings-DLLaiwUX.js → AgentContextSettings-DI8jQVIx.js} +1 -1
- package/client-dist/assets/{AgentsPage-C3_U9MGs.js → AgentsPage-Ci_iJt8T.js} +1 -1
- package/client-dist/assets/App-rFnK5pnF.js +2 -0
- package/client-dist/assets/AppearanceSettings-DTYVt0W5.js +2 -0
- package/client-dist/assets/{AppsSettings-B1BIWKaz.js → AppsSettings-hbh_sguk.js} +1 -1
- package/client-dist/assets/{AttachmentChip-CQTl9l1O.js → AttachmentChip-BFve3lTD.js} +1 -1
- package/client-dist/assets/{AuthContext-BQK10GgC.js → AuthContext-DmXjW0be.js} +1 -1
- package/client-dist/assets/{BangCommandDisplayObject-BDGW0BZN.js → BangCommandDisplayObject-BH2KRGnc.js} +1 -1
- package/client-dist/assets/{BangCommandsPage-C1-n2iHi.js → BangCommandsPage-MfkuL8yS.js} +1 -1
- package/client-dist/assets/{BrowserDebugToolbarButton-CRE47FFy.js → BrowserDebugToolbarButton-BPghQu17.js} +1 -1
- package/client-dist/assets/{CacheMissBillingSettings-BspB12sl.js → CacheMissBillingSettings-rUgC-_DD.js} +1 -1
- package/client-dist/assets/{CodexUpdatePrompt-BXTqvclk.js → CodexUpdatePrompt-mT9K-f1e.js} +1 -1
- package/client-dist/assets/{CommittedRangeInput-bK7EXtAc.js → CommittedRangeInput-BwuV6Q6c.js} +1 -1
- package/client-dist/assets/{CommittedRangeNumberInput-bGOjN2Xv.js → CommittedRangeNumberInput-C5YSVltB.js} +1 -1
- package/client-dist/assets/{ComputerControlSettings-BLA4wsEA.js → ComputerControlSettings-MWIdP7SS.js} +1 -1
- package/client-dist/assets/{ConversationPreviewPage-rxHQQOck.js → ConversationPreviewPage-B47r7mUF.js} +2 -2
- package/client-dist/assets/{DevelopmentSettings-CFo3ctnP.js → DevelopmentSettings-BEAy_xq-.js} +1 -1
- package/client-dist/assets/{DevicesSettings-DPdJOmEQ.js → DevicesSettings-DKQOZkRN.js} +1 -1
- package/client-dist/assets/{EmulatorPage-RPHDvihL.js → EmulatorPage-DlsPq3nR.js} +1 -1
- package/client-dist/assets/{EmulatorSettings-8dHy0xqk.js → EmulatorSettings-C6Ye1k_Y.js} +1 -1
- package/client-dist/assets/{EnvironmentSettings-DaFyodJV.js → EnvironmentSettings-ou8UNqTa.js} +1 -1
- package/client-dist/assets/{FilePage-BwbKyIGF.js → FilePage-Cw2PaO5H.js} +1 -1
- package/client-dist/assets/{FilterDropdown-BiB5gAUh.js → FilterDropdown-CACc6ysA.js} +1 -1
- package/client-dist/assets/{FloatingActionButton-DEiaqWhv.js → FloatingActionButton-Bl1Eumxh.js} +1 -1
- package/client-dist/assets/{GitStatusPage-CSXr__tv.js → GitStatusPage-CLTkgnDI.js} +1 -1
- package/client-dist/assets/{GlobalSessionsPage-C-CbcZjC.js → GlobalSessionsPage-Bvzs4zmW.js} +1 -1
- package/client-dist/assets/{HeartbeatTextArea-DWZZh0eE.js → HeartbeatTextArea-CtP5kx9R.js} +1 -1
- package/client-dist/assets/{HostIdentityContext-DbEx7dor.js → HostIdentityContext-DA7dMF-y.js} +1 -1
- package/client-dist/assets/{HostsPage-BRlkrB-8.js → HostsPage-CBOYGC2-.js} +1 -1
- package/client-dist/assets/{InboxContext-DtjKccKZ.js → InboxContext-8PXoTbK1.js} +1 -1
- package/client-dist/assets/{InboxPage-DFaLlFm5.js → InboxPage-DWl7uzdw.js} +1 -1
- package/client-dist/assets/{IssueSettings-CHjLBTZK.js → IssueSettings-BVljRpuD.js} +1 -1
- package/client-dist/assets/{IssuesPage-CfYD-jwK.js → IssuesPage-BFxgsMkf.js} +1 -1
- package/client-dist/assets/{LifecycleWebhooksSettings-Ir3_1MvY.js → LifecycleWebhooksSettings-Qw_dN3F3.js} +1 -1
- package/client-dist/assets/{LocalAccessSettings-BVh3wBDY.js → LocalAccessSettings-SWirs75o.js} +1 -1
- package/client-dist/assets/LocalMediaModal-B3KXtyEB.css +1 -0
- package/client-dist/assets/LocalMediaModal-B9eHVx6y.js +14 -0
- package/client-dist/assets/{LoginPage-irZxKYu1.js → LoginPage-CYWqVJ95.js} +1 -1
- package/client-dist/assets/{MessageAge-CKdiBg7K.js → MessageAge-CaPpa1nH.js} +1 -1
- package/client-dist/assets/{MessageDeliverySettings-BJ6Hgu1F.js → MessageDeliverySettings-BUSuGKlc.js} +1 -1
- package/client-dist/assets/MessageInput-a13ZPAHv.js +3 -0
- package/client-dist/assets/{MessageInputToolbar-CvUMMGJv.js → MessageInputToolbar-CQGTnVea.js} +3 -3
- package/client-dist/assets/MessageList-C7kAuWKg.js +4 -0
- package/client-dist/assets/{Modal-DOzUIhWU.js → Modal-ClSjJagX.js} +2 -2
- package/client-dist/assets/{ModelSettings-SWaaTKgm.js → ModelSettings-Dnd4yzmI.js} +1 -1
- package/client-dist/assets/{NavigationLayout-D8BMwd7T.js → NavigationLayout-BTFsWVtE.js} +2 -2
- package/client-dist/assets/{NewSessionPage-BBFzYBNs.js → NewSessionPage-BfiAS-Mo.js} +1 -1
- package/client-dist/assets/{NotificationsSettings-0iotA0wy.js → NotificationsSettings-B1ugQIp-.js} +1 -1
- package/client-dist/assets/{PageHeader-Ca3PbaMb.js → PageHeader-BjwH2pWD.js} +1 -1
- package/client-dist/assets/{PerformanceSettings-BgDJMjlN.js → PerformanceSettings-jJYF9SPY.js} +1 -1
- package/client-dist/assets/{ProjectSessionDefaultsModal-LEaPwpSM.js → ProjectSessionDefaultsModal-G_0uxJEv.js} +1 -1
- package/client-dist/assets/{ProjectTemplatesSettings-fPlh8ZpJ.js → ProjectTemplatesSettings-BQTCV3-3.js} +1 -1
- package/client-dist/assets/{ProjectsPage-CiQ3rBB_.js → ProjectsPage-suTd8s9l.js} +1 -1
- package/client-dist/assets/ProviderBadge-P0VTI71n.js +1 -0
- package/client-dist/assets/{ProviderChildSessionDetail-CSAbaZtr.js → ProviderChildSessionDetail-D0472EW8.js} +13 -13
- package/client-dist/assets/ProviderChildSessionPage-9__sgY14.js +1 -0
- package/client-dist/assets/{ProvidersSettings-B327MdUT.js → ProvidersSettings-Bwzy73Rk.js} +1 -1
- package/client-dist/assets/{RecapAfterSecondsControl-DWG9fB4u.js → RecapAfterSecondsControl-CxuXyFSr.js} +1 -1
- package/client-dist/assets/{RelayProtocol-DOWXVB0k.js → RelayProtocol-BpdH0COG.js} +1 -1
- package/client-dist/assets/{RemoteAccessSettings-CBSIP-qP.js → RemoteAccessSettings-Dn7KB5nK.js} +1 -1
- package/client-dist/assets/{RemoteExecutorsSettings-DDAqEB42.js → RemoteExecutorsSettings-Cjl4Y2rB.js} +1 -1
- package/client-dist/assets/{SchemaValidationContext-DLNGXai_.js → SchemaValidationContext-57RCj4c4.js} +1 -1
- package/client-dist/assets/{SearchPreview-BCP67hKg.js → SearchPreview-OzVFWPJZ.js} +1 -1
- package/client-dist/assets/{SessionHeader.module-CHO2T3eQ.js → SessionHeader.module-BpaFAQ-S.js} +1 -1
- package/client-dist/assets/SessionPage-BYthaEfZ.js +50 -0
- package/client-dist/assets/SessionPage-CXXEAwu2.css +1 -0
- package/client-dist/assets/{SettingsItem-BWF_CyTI.js → SettingsItem-C9Vh5p7F.js} +1 -1
- package/client-dist/assets/{SettingsSection-DbOwfvBD.js → SettingsSection-BaPzETK6.js} +1 -1
- package/client-dist/assets/{SourceControlSettings-BopLkzc6.js → SourceControlSettings-DnqLg0db.js} +1 -1
- package/client-dist/assets/{SourceFileHeaderActions-HoUciheJ.js → SourceFileHeaderActions-PjhUGnn6.js} +1 -1
- package/client-dist/assets/SpeechControlMenu-BYVdEa3C.js +2 -0
- package/client-dist/assets/{SpeechSettings-B4mB2LIj.js → SpeechSettings-B6LkqfSK.js} +1 -1
- package/client-dist/assets/{SpeechSmartTurnControls-tb5zP_85.js → SpeechSmartTurnControls-LPq9wBaM.js} +1 -1
- package/client-dist/assets/{StorageSettings-B5A0CtTo.js → StorageSettings-DtsJnYaz.js} +1 -1
- package/client-dist/assets/{ThinkingControls-BEweLRqu.js → ThinkingControls-DXbxdJRi.js} +1 -1
- package/client-dist/assets/{ToolbarSettings-CJbxOope.js → ToolbarSettings-Nb2BKpnk.js} +1 -1
- package/client-dist/assets/{UsersSettings-NWqRSGov.js → UsersSettings-BdvqmyqK.js} +1 -1
- package/client-dist/assets/ViewerModePage-DzRIpuYF.js +1 -0
- package/client-dist/assets/{VoiceInputButton-0BzvkjjK.js → VoiceInputButton-CCgovfyf.js} +1 -1
- package/client-dist/assets/{WorkstreamsPage-oM6jTLsK.js → WorkstreamsPage-dlEUllSL.js} +1 -1
- package/client-dist/assets/{YaServerProvider-BNTM9_P9.js → YaServerProvider-CN3tC5UL.js} +1 -1
- package/client-dist/assets/{YepAnywhereLogo-C4H1sg3q.js → YepAnywhereLogo-5zFKWjQq.js} +1 -1
- package/client-dist/assets/{abnfDiagram-VCTEODGH-DIBSwOuB.js → abnfDiagram-VCTEODGH-BWHUBcV3.js} +1 -1
- package/client-dist/assets/{arc-Blz12Cef.js → arc-DKsIJWGD.js} +1 -1
- package/client-dist/assets/{architectureDiagram-5GKGNRK7-CtTnQhBI.js → architectureDiagram-5GKGNRK7-BuLImqW3.js} +1 -1
- package/client-dist/assets/{attachmentFileNames-DwaA5IPB.js → attachmentFileNames-CBV_5g65.js} +1 -1
- package/client-dist/assets/{blockDiagram-I7D4REHJ-BanTkGM6.js → blockDiagram-I7D4REHJ-CJ4Gh6sL.js} +1 -1
- package/client-dist/assets/{c4Diagram-7LVT6UL2-C4p1KgTp.js → c4Diagram-7LVT6UL2-WR43XvCI.js} +1 -1
- package/client-dist/assets/channel-PV8AAsuo.js +1 -0
- package/client-dist/assets/{chunk-2Q5K7J3B-CJSvy8go.js → chunk-2Q5K7J3B-CiP4m_EA.js} +1 -1
- package/client-dist/assets/{chunk-5VM5RSS4-BVg02Giz.js → chunk-5VM5RSS4-BUAhj1h9.js} +1 -1
- package/client-dist/assets/{chunk-F27PBJKO-f_VOUJ8l.js → chunk-F27PBJKO-BUZNwiGx.js} +1 -1
- package/client-dist/assets/{chunk-IMKFNOWR-P5H0uE4d.js → chunk-IMKFNOWR-CX1a0BCE.js} +1 -1
- package/client-dist/assets/{chunk-JWPE2WC7-BpEGNu2X.js → chunk-JWPE2WC7-C6tL-mLF.js} +1 -1
- package/client-dist/assets/{chunk-POPQ4Y6H-oZudgMt7.js → chunk-POPQ4Y6H-BzijGGWv.js} +1 -1
- package/client-dist/assets/{chunk-SVP7TREG-dMWNgoWs.js → chunk-SVP7TREG-CsZImJKI.js} +1 -1
- package/client-dist/assets/{chunk-TICWLB2K-D8VqJUFw.js → chunk-TICWLB2K-TwCtuDc1.js} +1 -1
- package/client-dist/assets/{chunk-XXDRQBXY-ZwkKkcDz.js → chunk-XXDRQBXY-C-2EoNns.js} +1 -1
- package/client-dist/assets/classDiagram-ZZMXUADV-DvtSxfma.js +1 -0
- package/client-dist/assets/classDiagram-v2-VYDZK3BY-DvtSxfma.js +1 -0
- package/client-dist/assets/{client-D_ikArFV.js → client-Ci_HPGfl.js} +1 -1
- package/client-dist/assets/{compactSettingsControls-CzgNQCH3.js → compactSettingsControls-C9mLZh5H.js} +1 -1
- package/client-dist/assets/{cose-bilkent-JH36ORCC-DrtmDj3A.js → cose-bilkent-JH36ORCC-CmbEx2jT.js} +1 -1
- package/client-dist/assets/{cynefin-OW5HDTMX-CYhxgFq5.js → cynefin-OW5HDTMX-BSQHHXFU.js} +1 -1
- package/client-dist/assets/{cynefinDiagram-5FMLGOSQ-BXvBp5eq.js → cynefinDiagram-5FMLGOSQ-C-62JZJD.js} +1 -1
- package/client-dist/assets/{dagre-GXQ25YYZ-CdvzhCPS.js → dagre-GXQ25YYZ-BBERQe_A.js} +1 -1
- package/client-dist/assets/{diagram-S7CK7UJ4-DSGzzHN1.js → diagram-S7CK7UJ4-muw11lmG.js} +1 -1
- package/client-dist/assets/{diagram-UQ7AKVKN-Bk4fbl1S.js → diagram-UQ7AKVKN-DpePWzAe.js} +1 -1
- package/client-dist/assets/{diagram-VSXAHHWV-BAOCj4oX.js → diagram-VSXAHHWV-DHX6AHUY.js} +1 -1
- package/client-dist/assets/{diagram-VX7I27RA-KHmeuEjq.js → diagram-VX7I27RA-DYmR6NH_.js} +1 -1
- package/client-dist/assets/{diagram-Z3DM3KII-D6GpIAdx.js → diagram-Z3DM3KII-BC1SenHB.js} +1 -1
- package/client-dist/assets/{ebnfDiagram-PWID7BFC-Bm_JuhNL.js → ebnfDiagram-PWID7BFC-EVpri6Ma.js} +1 -1
- package/client-dist/assets/{erDiagram-RLTQ6QDP-u5Ryj9Z_.js → erDiagram-RLTQ6QDP-DthztUaa.js} +1 -1
- package/client-dist/assets/{flowDiagram-HODETNUW-C9A7e1yC.js → flowDiagram-HODETNUW-DEpC5nMx.js} +1 -1
- package/client-dist/assets/{frontendReload-DN8qVYjF.js → frontendReload-CBdyvvdy.js} +1 -1
- package/client-dist/assets/{ganttDiagram-EL5Y4UJY-BEIN_FhZ.js → ganttDiagram-EL5Y4UJY-Csqji8t1.js} +1 -1
- package/client-dist/assets/{gitGraphDiagram-WWUBYQGX-Cu5ow6Ls.js → gitGraphDiagram-WWUBYQGX-DVX1SDIE.js} +1 -1
- package/client-dist/assets/{hostStorage-C37tOOJa.js → hostStorage-D1KAm3U1.js} +1 -1
- package/client-dist/assets/{index-_2WVhpKj.js → index-BESqiBDI.js} +1 -1
- package/client-dist/assets/index-BkOdUxq4.js +2 -0
- package/client-dist/assets/index-CPb-36gi.css +1 -0
- package/client-dist/assets/{index-YAR5D3xY.js → index-CoR-vzsb.js} +1 -1
- package/client-dist/assets/index-Cv3tQXyE.js +1 -0
- package/client-dist/assets/{index-LT-lzpNS.js → index-DSFMItgO.js} +1 -1
- package/client-dist/assets/index-umZg0LZ6.js +81 -0
- package/client-dist/assets/{infoDiagram-27XIBGKW-ILfv0Qu_.js → infoDiagram-27XIBGKW-CHm3qsd2.js} +1 -1
- package/client-dist/assets/{ishikawaDiagram-5VMMS53U-D1P8nenz.js → ishikawaDiagram-5VMMS53U-tBRZwz-_.js} +1 -1
- package/client-dist/assets/{journeyDiagram-3NMN7TZE-CXP61NqX.js → journeyDiagram-3NMN7TZE-EJic7nqD.js} +1 -1
- package/client-dist/assets/{kanban-definition-UXKFOSKX-2x79Nimu.js → kanban-definition-UXKFOSKX-DtzL6eeO.js} +1 -1
- package/client-dist/assets/{layout-D7AfOq-G.js → layout-gb-Axsoq.js} +1 -1
- package/client-dist/assets/{linear-B_4Bripc.js → linear-CAe4xGbR.js} +1 -1
- package/client-dist/assets/{mermaid.core-y_avJe8E.js → mermaid.core-BCu1nv8H.js} +5 -5
- package/client-dist/assets/{mindmap-definition-YA3MSWOX-DwMJuV6d.js → mindmap-definition-YA3MSWOX-C7-KSPtJ.js} +1 -1
- package/client-dist/assets/{pegDiagram-XKGWAZYB-43LaxzRF.js → pegDiagram-XKGWAZYB-iWVH9rbY.js} +1 -1
- package/client-dist/assets/{pieDiagram-E7YTZNPT-DAOi_afd.js → pieDiagram-E7YTZNPT-VKD6PLHa.js} +1 -1
- package/client-dist/assets/{providerChildSessions-BpJF5D9s.css → providerChildSessions-Cd7oK6KQ.css} +1 -1
- package/client-dist/assets/providerChildSessions-DbLFSybt.js +77 -0
- package/client-dist/assets/{quadrantDiagram-AXDQQJYC-BRPBWWpv.js → quadrantDiagram-AXDQQJYC-AXFugcFl.js} +1 -1
- package/client-dist/assets/{railroadDiagram-O6MQD6OU-xAuDG62P.js → railroadDiagram-O6MQD6OU-D6oZy6Al.js} +1 -1
- package/client-dist/assets/{recentProjectPathLinks-B6pQxzWg.js → recentProjectPathLinks-D0Dx6YXT.js} +1 -1
- package/client-dist/assets/{registerServiceWorker-fKJh5dWO.js → registerServiceWorker-B8K2KVOY.js} +1 -1
- package/client-dist/assets/{relayEndpoints-DRyKx83V.js → relayEndpoints-BTq9xppf.js} +1 -1
- package/client-dist/assets/{remoteRoutePaths-BxKY1U2z.js → remoteRoutePaths-D8htA0xa.js} +1 -1
- package/client-dist/assets/{requirementDiagram-BXWQKSXE-BJvybhuU.js → requirementDiagram-BXWQKSXE-Eqtb74It.js} +1 -1
- package/client-dist/assets/{sankeyDiagram-P5KCCOFB-aAAflmwo.js → sankeyDiagram-P5KCCOFB-CxvDiZ1R.js} +1 -1
- package/client-dist/assets/{sequenceDiagram-WJ2MYXX4-CP3BPtU-.js → sequenceDiagram-WJ2MYXX4-BbpkgW2L.js} +1 -1
- package/client-dist/assets/{sessionNavigationState-MSOOrZi4.js → sessionNavigationState-BXejf2ZW.js} +1 -1
- package/client-dist/assets/sessionRouteLayer-D9T2QT8G.js +1 -0
- package/client-dist/assets/{sizeCapture-INFHLROL-BwAQ5zb3.js → sizeCapture-INFHLROL-DcuwWD5r.js} +1 -1
- package/client-dist/assets/{sourceControlNavigationState-t_nQLZvO.js → sourceControlNavigationState-BJbTzWTE.js} +1 -1
- package/client-dist/assets/{speechDraftTransaction-8sgF4uer.js → speechDraftTransaction-WhqFE1h9.js} +1 -1
- package/client-dist/assets/{stateDiagram-D77RDMKH-B8llvNN3.js → stateDiagram-D77RDMKH-Cidpq73w.js} +1 -1
- package/client-dist/assets/stateDiagram-v2-MP3YSRHH-DFqKXxjz.js +1 -0
- package/client-dist/assets/{swimlanes-42K2YHIH-qqdgDD32.js → swimlanes-42K2YHIH-Ba8C7MwG.js} +1 -1
- package/client-dist/assets/swimlanesDiagram-VR7AAH4N-3pW2TcAt.js +8 -0
- package/client-dist/assets/{timeline-definition-24CTP7MA-EBxDGVBl.js → timeline-definition-24CTP7MA-CKefGvUK.js} +1 -1
- package/client-dist/assets/{useAcliCommentarySetting-JMx-BSAu.js → useAcliCommentarySetting-CBKAl7qr.js} +2 -2
- package/client-dist/assets/{useActivityBusState-CnG-LXsr.js → useActivityBusState-C0dor9p7.js} +1 -1
- package/client-dist/assets/{useBackgroundRevalidation-7vLWDD_M.js → useBackgroundRevalidation-C79HAUP3.js} +1 -1
- package/client-dist/assets/{useCodexUpdateStatus-CAR1HkyO.js → useCodexUpdateStatus-CEZO_f2Y.js} +1 -1
- package/client-dist/assets/{useConnectedDevices-DxgKt21O.js → useConnectedDevices-Ds-DuUDc.js} +1 -1
- package/client-dist/assets/{useDocumentTitle-bldu9XOq.js → useDocumentTitle-Xz5t-nlB.js} +1 -1
- package/client-dist/assets/{useEmulators-BPiSdRjQ.js → useEmulators-qS_cCZ3I.js} +1 -1
- package/client-dist/assets/{useFileActivity-D0JXhEz7.js → useFileActivity-BoW4X3DY.js} +1 -1
- package/client-dist/assets/{useFloatingActionButtonEnabled-Dp_hZuYb.js → useFloatingActionButtonEnabled-2_hw7nSa.js} +1 -1
- package/client-dist/assets/{useForkSummaryAutoOpen-Cty_gTm1.js → useForkSummaryAutoOpen-CS33Irpf.js} +1 -1
- package/client-dist/assets/{useGeneratedTitleLength-BpbPYGRf.js → useGeneratedTitleLength-D856ktVg.js} +1 -1
- package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-BWCiVVkU.js → useKeepMobileKeyboardOpenAfterDelivery-Ba77SbWF.js} +1 -1
- package/client-dist/assets/{useModelSettings-CeABGid0.js → useModelSettings-BdlYk1DT.js} +1 -1
- package/client-dist/assets/{useNotifyInApp-CuUBcZeR.js → useNotifyInApp-DcWe3dh4.js} +1 -1
- package/client-dist/assets/{useOnboarding-BDCBf2Fp.js → useOnboarding-CoE3WF8a.js} +1 -1
- package/client-dist/assets/{useProviders-45TZLkhy.js → useProviders-CeN1PclA.js} +1 -1
- package/client-dist/assets/{useQuestionAsideSetting-B0bjoe-z.js → useQuestionAsideSetting-CPFw1u0y.js} +1 -1
- package/client-dist/assets/{useRecentSessions-COrEGQJH.js → useRecentSessions-ieTzzJu4.js} +1 -1
- package/client-dist/assets/{useRelativeNow-XM1dKxcx.js → useRelativeNow-Ca6QGcPa.js} +1 -1
- package/client-dist/assets/{useReloadNotifications-JBj22syT.js → useReloadNotifications-Dm1jmdIb.js} +1 -1
- package/client-dist/assets/{useRemoteExecutors-Bzvi8gRe.js → useRemoteExecutors-zBAQnQXH.js} +1 -1
- package/client-dist/assets/{useSidebarWidth-CITe0sSV.js → useSidebarWidth-CBCcbSLg.js} +1 -1
- package/client-dist/assets/{useSourceControlCleanLanding-B-8NTKPa.js → useSourceControlCleanLanding-VDlft5tr.js} +1 -1
- package/client-dist/assets/{useStableToolPreviewRendering-CeH1PY9S.js → useStableToolPreviewRendering-hbVp38Jd.js} +1 -1
- package/client-dist/assets/{useStreamingEnabled-C535nHwb.js → useStreamingEnabled-hU1g8i7_.js} +1 -1
- package/client-dist/assets/{useTabTitleActivityPreference-NekVdSEZ.js → useTabTitleActivityPreference-DhREY7m2.js} +1 -1
- package/client-dist/assets/{useVhostAccess-CHT40zJ3.js → useVhostAccess-DUtn_sH1.js} +1 -1
- package/client-dist/assets/{useWorkflowTags-Bl7Czynw.js → useWorkflowTags-DxbEBqtf.js} +1 -1
- package/client-dist/assets/{vennDiagram-4TSXK5OY-BRLuM0pk.js → vennDiagram-4TSXK5OY-CSGBq-Ur.js} +1 -1
- package/client-dist/assets/{wardleyDiagram-VM6X3IG4-D5cPV-h-.js → wardleyDiagram-VM6X3IG4-DIMvcaMb.js} +1 -1
- package/client-dist/assets/{xychartDiagram-S5SC5T6Z-M2QslymW.js → xychartDiagram-S5SC5T6Z-TYXSqT3w.js} +1 -1
- package/client-dist/index.html +3 -3
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +19 -10
- package/dist/app.js.map +1 -1
- package/dist/artifacts/ArtifactServer.d.ts +0 -1
- package/dist/artifacts/ArtifactServer.d.ts.map +1 -1
- package/dist/artifacts/ArtifactServer.js +41 -9
- package/dist/artifacts/ArtifactServer.js.map +1 -1
- package/dist/auth/limitedUserPolicy.d.ts +9 -5
- package/dist/auth/limitedUserPolicy.d.ts.map +1 -1
- package/dist/auth/limitedUserPolicy.js +64 -35
- package/dist/auth/limitedUserPolicy.js.map +1 -1
- package/dist/auth/principal.d.ts +6 -0
- package/dist/auth/principal.d.ts.map +1 -1
- package/dist/auth/principal.js +6 -0
- package/dist/auth/principal.js.map +1 -1
- package/dist/frontend/static.d.ts.map +1 -1
- package/dist/frontend/static.js +2 -1
- package/dist/frontend/static.js.map +1 -1
- package/dist/middleware/authenticated-transport.d.ts +13 -0
- package/dist/middleware/authenticated-transport.d.ts.map +1 -1
- package/dist/middleware/authenticated-transport.js +12 -0
- package/dist/middleware/authenticated-transport.js.map +1 -1
- package/dist/middleware/limited-users.d.ts +9 -5
- package/dist/middleware/limited-users.d.ts.map +1 -1
- package/dist/middleware/limited-users.js +37 -23
- package/dist/middleware/limited-users.js.map +1 -1
- package/dist/routes/file-edit.d.ts +4 -1
- package/dist/routes/file-edit.d.ts.map +1 -1
- package/dist/routes/file-edit.js +22 -6
- package/dist/routes/file-edit.js.map +1 -1
- package/dist/routes/files.d.ts.map +1 -1
- package/dist/routes/files.js +19 -5
- package/dist/routes/files.js.map +1 -1
- package/dist/routes/pdfjs.d.ts +9 -0
- package/dist/routes/pdfjs.d.ts.map +1 -0
- package/dist/routes/pdfjs.js +34 -0
- package/dist/routes/pdfjs.js.map +1 -0
- package/dist/routes/recents.d.ts +4 -1
- package/dist/routes/recents.d.ts.map +1 -1
- package/dist/routes/recents.js +7 -0
- package/dist/routes/recents.js.map +1 -1
- package/dist/routes/settings.d.ts +7 -2
- package/dist/routes/settings.d.ts.map +1 -1
- package/dist/routes/settings.js +43 -1
- package/dist/routes/settings.js.map +1 -1
- package/dist/routes/ws-relay-handlers.d.ts +12 -0
- package/dist/routes/ws-relay-handlers.d.ts.map +1 -1
- package/dist/routes/ws-relay-handlers.js +25 -4
- package/dist/routes/ws-relay-handlers.js.map +1 -1
- package/dist/routes/ws-relay.d.ts.map +1 -1
- package/dist/routes/ws-relay.js +8 -0
- package/dist/routes/ws-relay.js.map +1 -1
- package/dist/sdk/providers/codex-model-catalog.d.ts.map +1 -1
- package/dist/sdk/providers/codex-model-catalog.js +5 -3
- package/dist/sdk/providers/codex-model-catalog.js.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts +4 -1
- package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts +4 -1
- package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/Personality.d.ts +3 -0
- package/dist/sdk/providers/codex-protocol/generated/Personality.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.d.ts +2 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/{ThreadRollbackParams.js → McpAppDisplayMode.js} +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.d.ts +9 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.d.ts.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/{ThreadRollbackResponse.js → McpAppUi.js} +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.js.map +1 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts +6 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts +9 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts +9 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts +4 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +7 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts +3 -0
- package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts.map +1 -1
- package/dist/sdk/providers/codex-protocol/index.d.ts +0 -2
- package/dist/sdk/providers/codex-protocol/index.d.ts.map +1 -1
- package/dist/sdk/providers/codex.d.ts +7 -2
- package/dist/sdk/providers/codex.d.ts.map +1 -1
- package/dist/sdk/providers/codex.js +21 -20
- package/dist/sdk/providers/codex.js.map +1 -1
- package/dist/services/ArtifactRebuildService.d.ts +11 -14
- package/dist/services/ArtifactRebuildService.d.ts.map +1 -1
- package/dist/services/ArtifactRebuildService.js +15 -7
- package/dist/services/ArtifactRebuildService.js.map +1 -1
- package/dist/services/PdfjsAssetCache.d.ts +20 -0
- package/dist/services/PdfjsAssetCache.d.ts.map +1 -0
- package/dist/services/PdfjsAssetCache.js +131 -0
- package/dist/services/PdfjsAssetCache.js.map +1 -0
- package/package.json +3 -3
- package/client-dist/assets/App-DYWU2-wq.js +0 -2
- package/client-dist/assets/AppearanceSettings-Ci0wlAx3.js +0 -2
- package/client-dist/assets/LocalMediaModal-DOcizK52.css +0 -1
- package/client-dist/assets/LocalMediaModal-DyDpC0dk.js +0 -12
- package/client-dist/assets/MessageInput-leX__dbU.js +0 -3
- package/client-dist/assets/MessageList-DDA4Q_Gj.js +0 -4
- package/client-dist/assets/ProviderBadge-BKZVllDn.js +0 -1
- package/client-dist/assets/ProviderChildSessionPage-vpu5u3YA.js +0 -1
- package/client-dist/assets/SessionPage-BJ5qaa-G.js +0 -50
- package/client-dist/assets/SessionPage-BiV0X3n1.css +0 -1
- package/client-dist/assets/SpeechControlMenu-DEDIWl9h.js +0 -2
- package/client-dist/assets/ViewerModePage-Dyq_I7ws.js +0 -1
- package/client-dist/assets/channel-DwT-nHaK.js +0 -1
- package/client-dist/assets/classDiagram-ZZMXUADV-DdlhZ-2W.js +0 -1
- package/client-dist/assets/classDiagram-v2-VYDZK3BY-DdlhZ-2W.js +0 -1
- package/client-dist/assets/index-BY-TgOY-.js +0 -81
- package/client-dist/assets/index-BgkZrNQv.js +0 -1
- package/client-dist/assets/index-BrCZcBcO.js +0 -2
- package/client-dist/assets/index-wA2zlxt-.css +0 -1
- package/client-dist/assets/providerChildSessions-DVWCZpC4.js +0 -78
- package/client-dist/assets/stateDiagram-v2-MP3YSRHH-CD7vRqY6.js +0 -1
- package/client-dist/assets/swimlanesDiagram-VR7AAH4N-NBdWyLIY.js +0 -8
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts +0 -14
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts.map +0 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.js.map +0 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts +0 -12
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts.map +0 -1
- package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.js.map +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var Lc=Object.defineProperty;var Hc=(e,t,s)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var kt=(e,t,s)=>Hc(e,typeof t!="symbol"?t+"":t,s);import{u as Kt,j as a,r as n,ax as sr,U as or}from"./index-BY-TgOY-.js";import{v as Bc,T as Oc,t as Dc,w as qc,x as Fc}from"./providerChildSessions-DVWCZpC4.js";import{g as Yr,c as $c,i as Wc,a as zr,b as Kc,d as ki,L as Vc,u as Gc,T as Uc,e as Ii,f as Qc,t as _r,h as Yc,S as Pr,w as ni,r as si,j as zc,k as ri,l as Xc,m as Jc,s as Zc,n as ea,o as ta,R as na,p as sa,q as Xr,v as ra,A as oa,x as ia}from"./ProviderChildSessionDetail-CSAbaZtr.js";import{B as ca}from"./useModelSettings-CeABGid0.js";import{e as aa,d as la}from"./ProviderBadge-BKZVllDn.js";import{q as oi,s as ii,t as ua,v as da}from"./SpeechControlMenu-DEDIWl9h.js";import{g as fa,a as ha,u as ma}from"./useWorkflowTags-Bl7Czynw.js";import{b as pa,c as Mi,d as Ai,e as _i,h as Pi,i as ji,j as Ni,s as ga,k as xa,m as wa,n as Ta,o as va,p as ba,q as ya,t as Ea,u as Ra,v as Sa,w as Ca,x as ka,y as Ia,z as Ma,A as Aa,B as _a,C as Pa,D as ja}from"./SessionPage-BJ5qaa-G.js";import{d as Na,K as Vs,L as La,N as Ha}from"./NavigationLayout-D8BMwd7T.js";import{d as ci,S as ai}from"./MessageInputToolbar-CvUMMGJv.js";import{V as ls,W as Ba,X as Lt,Y as Li,H as On,Z as Oa,f as Da}from"./client-D_ikArFV.js";import{u as Hi}from"./useRelativeNow-XM1dKxcx.js";import{a as qa,L as jr}from"./useAcliCommentarySetting-JMx-BSAu.js";import{a as Dn,r as os}from"./browserDebugPerformance-ZT9tAT-A.js";import{f as Nr}from"./attachmentFileNames-DwaA5IPB.js";import{g as Fa,b as $a,p as Wa,q as Ka,e as Bi,r as Lr,v as Va,w as Ga,x as Gs}from"./LocalMediaModal-DyDpC0dk.js";import{A as Hr}from"./AttachmentChip-CQTl9l1O.js";import{M as Zs}from"./MessageAge-CKdiBg7K.js";import{b as Oi}from"./Modal-DOzUIhWU.js";import{s as fe,n as Di,g as Ua,r as Jr}from"./SearchPreview-BCP67hKg.js";import{C as Gr}from"./index-YAR5D3xY.js";import"./react-runtime-D-UPQ57m.js";import"./katex-Dv2p4YRM.js";import"./appHref-ByaEnJGJ.js";import"./remoteRoutePaths-BxKY1U2z.js";import"./RelayProtocol-DOWXVB0k.js";import"./relay-url-j3kYm5KO.js";import"./postCompactReplay-D6HuoQK2.js";import"./recentProjectPathLinks-B6pQxzWg.js";import"./BangCommandDisplayObject-BDGW0BZN.js";import"./useStableToolPreviewRendering-CeH1PY9S.js";import"./SchemaValidationContext-DLNGXai_.js";import"./SourceFileHeaderActions-HoUciheJ.js";import"./SpeechSmartTurnControls-tb5zP_85.js";import"./YaServerProvider-BNTM9_P9.js";import"./CommittedRangeInput-bK7EXtAc.js";import"./types-BHkriVjU.js";import"./SessionHeader.module-CHO2T3eQ.js";import"./HostIdentityContext-DbEx7dor.js";import"./frontendReload-DN8qVYjF.js";import"./useVhostAccess-CHT40zJ3.js";import"./useActivityBusState-CnG-LXsr.js";import"./useForkSummaryAutoOpen-Cty_gTm1.js";import"./useQuestionAsideSetting-B0bjoe-z.js";import"./ThinkingControls-BEweLRqu.js";import"./useRecentSessions-COrEGQJH.js";import"./speechDraftTransaction-8sgF4uer.js";import"./deviceDetection-BVPclkty.js";import"./useSidebarWidth-CITe0sSV.js";import"./useProviders-45TZLkhy.js";import"./useRemoteExecutors-Bzvi8gRe.js";import"./newSessionDefaults-C6a9Cpc6.js";import"./RecapAfterSecondsControl-DWG9fB4u.js";import"./newSessionPrefill-DKcy0abh.js";import"./sessionNavigationState-MSOOrZi4.js";import"./FilterDropdown-BiB5gAUh.js";import"./VoiceInputButton-0BzvkjjK.js";import"./ProjectSessionDefaultsModal-LEaPwpSM.js";import"./HeartbeatTextArea-DWZZh0eE.js";import"./useDocumentTitle-bldu9XOq.js";import"./useGeneratedTitleLength-BpbPYGRf.js";import"./long-context-effort-warning-C6XHizE1.js";import"./useStreamingEnabled-C535nHwb.js";import"./speech-vocabulary-CxfxZ-1r.js";import"./useFileActivity-D0JXhEz7.js";import"./index-BgkZrNQv.js";import"./sourceControlNavigationState-t_nQLZvO.js";import"./YepAnywhereLogo-C4H1sg3q.js";const Qa="_badge_1802l_1",Ya={badge:Qa};function za({modifier:e,context:t}){const{t:s}=Kt();if(!e||!t)return null;let o;try{o=aa(e,t.normal,t.model)}catch{return null}const i=t.normal==="auto"?t.model.defaultReasoningEffort??t.model.defaultEffortLevel:t.normal.replace(/^on:/,""),c=i==="ultra"?"max":i,l=o.replace(/^on:/,"");if(l===c)return null;const d=l==="off"?s("turnEffortOff"):la(l,t.provider,s);return a.jsx("span",{className:Ya.badge,title:`/${e}`,"data-turn-effort":l,children:d})}function qi(e){var t;return((t=e.metadata)==null?void 0:t.deliveryIntent)==="patient"}function Xa(e){return e.status==="paused-after-restart"}function Fi(e){return e.kind==="ya-command"&&!!e.yaCommand}function Ja(e,t){if(e.kind!==t.kind){const l={pending:0,deferred:1,"project-queue":2};return l[e.kind]-l[t.kind]}if(e.kind==="deferred"&&t.kind==="deferred")return e.deferredIndex-t.deferredIndex;if(e.kind==="project-queue"&&t.kind==="project-queue")return e.message.projectPosition-t.message.projectPosition;const s=e.kind==="pending"?e.message.clientOrder:void 0,o=t.kind==="pending"?t.message.clientOrder:void 0;if(typeof s=="number"&&Number.isFinite(s)&&typeof o=="number"&&Number.isFinite(o)&&s!==o)return s-o;const i=ls(e.message.timestamp),c=ls(t.message.timestamp);return i!==null&&c!==null&&i!==c?i-c:e.sourceIndex-t.sourceIndex}function Za({deferredMessages:e=[],pendingMessages:t=[],projectQueueMessages:s=[]}){let o=0;const i=[];for(const c of t)i.push({kind:"pending",key:c.tempId,message:c,sourceIndex:o++});e.forEach((c,l)=>{i.push({kind:"deferred",key:c.tempId??`deferred-${l}`,message:c,deferredIndex:l,sourceIndex:o++})});for(const c of s)i.push({kind:"project-queue",key:`project-queue-${c.id}`,message:c,sourceIndex:o++});return i.sort(Ja)}function el(e){const t=new Map;let s=0,o=0;for(const i of e)i.kind==="deferred"&&(Fi(i.message)||(qi(i.message)?(t.set(i.key,{patientIndex:o}),o+=1):(t.set(i.key,{regularIndex:s}),s+=1)));return t}function tl(e){return e.status==="dispatching"?"dispatching":e.status==="failed"?"failed":"queued"}function nl(e){var t;return!!(e.attachmentCount&&!((t=e.attachments)!=null&&t.length))}function sl({deferredMessages:e,latestVisibleTimestampMs:t,nowMs:s,pendingMessages:o,projectQueueMessages:i,staleThresholdMs:c}){const l=Za({deferredMessages:e,pendingMessages:o,projectQueueMessages:i}),d=el(l);return l.map(h=>{const g=ls(h.message.timestamp),x={hasMessageAge:g!==null,key:h.key,showAgeByDefault:g!==null&&t===g&&Ba(g,s,c),sourceIndex:h.sourceIndex,timestampMs:g};if(h.kind==="pending")return{...x,kind:"pending",message:h.message};if(h.kind==="project-queue")return{...x,allowsCancel:h.message.status!=="dispatching",kind:"project-queue",message:h.message,projectQueueStatusKind:tl(h.message),showAttachmentCountBadge:nl(h.message)};const v=Xa(h.message),b=Fi(h.message),C=v&&h.message.id?h.message.id:null;return{...x,allowsDeferredCancel:!b&&!!h.message.tempId,allowsRecoveredDelete:C!==null,allowsRecoveredResume:C!==null,deferredIndex:h.deferredIndex,isPatient:qi(h.message),isRecovered:v,isYaCommand:b,kind:"deferred",lanePosition:d.get(h.key),message:h.message,recoveredQueueId:C,showAttachmentCountBadge:!!h.message.attachmentCount}})}function rl(e){let t=null;for(const s of e){const o=ls(s.timestamp);o!==null&&(t=t===null?o:Math.min(t,o))}return t}function li(e){return rl(e.sourceMessages)??Lt(e.sourceMessages)}function ol(e,t,s,o){if(e.type!=="thinking")return;const i=li(e);if(i===null)return;let c=e.status==="streaming"?o:null;for(let d=s+1;d<t.length;d+=1){const h=t[d];if(!h)continue;const g=li(h);if(g!==null&&g>=i){c=g;break}}if(c===null){const d=Lt(e.sourceMessages);c=d!==null&&d>i?d:null}if(c===null)return;const l=c-i;return l>=100&&l<1440*60*1e3?l:void 0}function il(e){let t=0;for(const s of e)s.type==="thinking"&&(t+=1);return t}function cl(e){for(let t=e.length-1;t>=0;t-=1){const s=e[t];if((s==null?void 0:s.type)==="thinking")return s.id}return null}function al(e){const t=new Map;for(const s of e)s.type==="thinking"&&t.set(s.id,s.thinking.length);return t}function ui(e){const t=new Set;for(const s of e)s.type==="thinking"&&t.add(s.id);return t}function ll({isThinkingItemExpanded:e,nextTextLengths:t,previousTextLengths:s,thinkingItemsVisible:o}){if(s===null||!o)return!1;for(const[i,c]of t){if(!e(i))continue;const l=s.get(i)??0;if(c>l)return!0}return!1}function ul({currentThinkingIds:e,previouslyObservedThinkingIds:t,previousExpandedIds:s,seedHistoricalThinking:o}){const i=new Set;let c=!1;for(const l of s)e.has(l)?i.add(l):c=!0;if(o)for(const l of e)i.has(l)||(i.add(l),c=!0);else if(t!==null)for(const l of e)!t.has(l)&&!i.has(l)&&(i.add(l),c=!0);return c?i:s}function dl({asides:e=[],turnGroups:t}){const s=[];return t.forEach((o,i)=>{const c=o.items[0];s.push({kind:"turn",key:c?`turn-${c.id}`:`turn-${i}`,timestampMs:Yr(o.items),ordinal:i,group:o})}),e.forEach((o,i)=>{s.push({kind:"btw",key:`btw-${o.id}`,timestampMs:ls(o.historyAt??o.updatedAt),ordinal:t.length+i,aside:o})}),s.sort((o,i)=>o.timestampMs!==null&&i.timestampMs!==null?o.timestampMs-i.timestampMs||o.ordinal-i.ordinal:o.timestampMs!==null?-1:i.timestampMs!==null?1:o.ordinal-i.ordinal)}function $i(e){return e.kind==="turn"?Math.max(1,e.group.items.length):1}function fl(e,t){if(e.length===0)return 0;let s=0,o=0;for(let i=e.length-1;i>=0&&o<t;i-=1){const c=e[i];if(!c)break;s+=1,o+=$i(c)}return Math.max(1,s)}function hl(e,t,s){let o=Math.min(e.length,Math.max(0,t)),i=0;for(let c=e.length-o-1;c>=0&&i<s;c-=1){const l=e[c];if(!l)break;o+=1,i+=$i(l)}return Math.min(e.length,Math.max(1,o))}function ml({entries:e,entryCount:t,initialEntryCount:s,revealActive:o}){if(!o||e.length===0)return{entries:e,effectiveEntryCount:e.length,percent:100};const i=Math.min(e.length,t??s);return{entries:e.slice(-i),effectiveEntryCount:i,percent:Math.max(1,Math.min(100,Math.round(i/e.length*100)))}}function Wi(e,t,s){return Lt(e.sourceMessages)===t?s:void 0}function pl({items:e,latestVisibleTimestampMs:t,nowMs:s}){return pa(e).map(o=>{if(o.kind==="explored"){const c=Yr(o.items);return{kind:"explored",id:o.id,items:o.items,projection:o.projection,segmentTimestampMs:c,staleNowMs:c===t?s:void 0}}const i=e.indexOf(o.item);return{kind:"item",item:o.item,itemIndex:i,allowsPromptActions:o.item.type==="user_prompt"&&!o.item.isSubagent,allowsTextQuote:o.item.type==="text",allowsThinkingToggle:o.item.type==="thinking",staleNowMs:Wi(o.item,t,s),thinkingDurationMs:i>=0?ol(o.item,e,i,s):void 0}})}function gl({entries:e,latestCorrectablePromptId:t,latestVisibleTimestampMs:s,nowMs:o}){return e.map(i=>{if(i.kind==="btw")return{kind:"btw",key:i.key,aside:i.aside};const{group:c}=i,l=c.items[0];return l?c.isStandalone?{kind:"standalone",key:l.id,group:c,item:l}:c.isUserPrompt?{kind:"user",key:l.id,group:c,item:l,allowsPromptActions:!l.isSubagent,isLatestCorrectable:t===l.id,staleNowMs:Wi(l,s,o)}:{kind:"assistant",key:i.key,group:c,rows:pl({items:c.items,latestVisibleTimestampMs:s,nowMs:o})}:{kind:"empty",key:i.key,group:c}})}function xl(e,t){return e.kind!==t.kind?!1:e.kind==="explored"?t.kind==="explored"&&e.id===t.id&&e.segmentTimestampMs===t.segmentTimestampMs&&e.staleNowMs===t.staleNowMs:t.kind==="item"&&e.item===t.item&&e.itemIndex===t.itemIndex&&e.allowsPromptActions===t.allowsPromptActions&&e.allowsTextQuote===t.allowsTextQuote&&e.allowsThinkingToggle===t.allowsThinkingToggle&&e.staleNowMs===t.staleNowMs&&e.thinkingDurationMs===t.thinkingDurationMs}function wl(e,t){if(e.kind!==t.kind)return!1;switch(e.kind){case"btw":return t.kind==="btw"&&e.aside===t.aside;case"empty":return t.kind==="empty"&&e.group===t.group;case"standalone":return t.kind==="standalone"&&e.group===t.group&&e.item===t.item;case"user":return t.kind==="user"&&e.group===t.group&&e.item===t.item&&e.allowsPromptActions===t.allowsPromptActions&&e.isLatestCorrectable===t.isLatestCorrectable&&e.staleNowMs===t.staleNowMs;case"assistant":return t.kind==="assistant"&&e.group===t.group&&e.rows.length===t.rows.length&&e.rows.every((s,o)=>{const i=t.rows[o];return i?xl(s,i):!1})}}function Tl(e,t){if(e.length===0||t.length===0)return[...t];const s=new Map;for(const o of e){const i=s.get(o.key);i?i.push(o):s.set(o.key,[o])}return t.map(o=>{const i=s.get(o.key);if(!i)return o;const c=i.findIndex(d=>wl(d,o));if(c===-1)return o;const[l]=i.splice(c,1);return l??o})}const vl=200;function Br(e){var t,s,o;if(e.type==="thinking")return!0;if(e.type==="task_notification"){const i=(t=e.status)==null?void 0:t.toLowerCase();return i!=="failed"&&i!=="error"}return e.type==="system"?e.subtype==="subagent_activity":e.type!=="tool_call"?!1:Kc(e.toolName)!=="UpdatePlan"&&(((o=(s=e.toolResult)==null?void 0:s.media)==null?void 0:o.length)??0)===0&&e.status!=="error"&&e.status!=="incomplete"}function bl(e){var i;let t=-1;for(let c=e.length-1;c>=0;c-=1)if(((i=e[c])==null?void 0:i.type)==="thinking"){t=c;break}const s=e[t];if((s==null?void 0:s.type)!=="thinking")return[];const o=[{id:s.id,kind:s.status==="streaming"?"current":"latest",slot:"latest",thinking:s.thinking,status:s.status,endedAtMs:Lt(s.sourceMessages)}];if(s.status!=="streaming")return o;for(let c=t-1;c>=0;c-=1){const l=e[c];if(!((l==null?void 0:l.type)!=="thinking"||l.status!=="complete")){o.push({id:l.id,kind:"previous",slot:"previous",thinking:l.thinking,status:l.status,endedAtMs:Lt(l.sourceMessages)});break}}return o}function yl(e){const t=zr(e);let s=-1;const o=t.map((c,l)=>{const d=c.items.find(Br);return d?(s=l,`conversation-activity-${d.id}`):null}),i=bl(e);return t.flatMap((c,l)=>{var g;if(c.isUserPrompt||c.isStandalone)return c.items;const d=c.items.filter(Br);if(d.length===0)return c.items;const h={type:"conversation_activity",id:o[l]??`conversation-activity-${((g=d[0])==null?void 0:g.id)??l}`,activityCount:d.reduce((x,v)=>{var b;return x+(v.type==="tool_call"?Math.max(1,((b=v.displayActions)==null?void 0:b.length)??0):1)},0),active:!1,expanded:!1,thinkingPreviews:l===s&&i.length>0?i:void 0,startedAtMs:null,endedAtMs:null,sourceMessages:d.flatMap(x=>x.sourceMessages)};return[...c.items.filter(x=>!Br(x)),h]})}function El({caseSensitive:e,conversationViewEnabled:t,messages:s,provider:o,query:i,recentProjectPathLinksEnabled:c=!1,scope:l,thinkingItemsVisible:d,transcriptDisplayObjects:h=[]}){const g=$c(s,void 0,c),x=o==="claude-gateway"?g.filter(N=>N.type!=="thinking"||N.thinking!=="Thinking..."):g,v=Wc(x,h),b=d?v:v.filter(N=>N.type!=="thinking"),C=t?yl(b):b,M=l==="full"||l==="links"?zr(C):[],F=Mi({allAnchors:ji(C),fullAnchors:l==="full"?Pi(M):[],linkAnchors:l==="links"?_i(M):[],scope:l,userAnchors:Ai(C)}),A=Ni({anchors:F,caseSensitive:e,query:i,searchReady:!0}),I=Math.max(0,A.matches.length-vl);return{matches:A.matches.slice(I).map(N=>({id:N.id,preview:A.previewsById.get(N.id)??N.preview,...N.targetId?{targetId:N.targetId}:{},...N.timestampMs!==void 0?{timestampMs:N.timestampMs}:{}})),matchesTruncated:I>0}}const Rl="_panel_19os0_1",Sl="_main_19os0_37",Cl="_queryRow_19os0_44",kl="_label_19os0_48",Il="_helpToggle_19os0_75",Ml="_close_19os0_79",Al="_input_19os0_101",_l="_caseToggle_19os0_117",Pl="_active_19os0_139",jl="_count_19os0_145",Nl="_help_19os0_75",Ll="_olderControls_19os0_157",Hl="_olderButton_19os0_164",Bl="_olderStatus_19os0_190",Ol="_olderPreviewLabel_19os0_191",Dl="_olderPreview_19os0_191",ql="_olderPreviewText_19os0_219",Fl="_coverage_19os0_236",$l="_navigation_19os0_243",Wl="_previous_19os0_251",Kl="_next_19os0_252",Vl="_go_19os0_253",Gl="_boundary_19os0_278",Ul="_helpShown_19os0_342",Ie={panel:Rl,main:Sl,queryRow:Cl,label:kl,helpToggle:Il,close:Ml,input:Al,caseToggle:_l,active:Pl,count:jl,help:Nl,olderControls:Ll,olderButton:Hl,olderStatus:Bl,olderPreviewLabel:Ol,olderPreview:Dl,olderPreviewText:ql,coverage:Fl,navigation:$l,previous:Wl,next:Kl,go:Vl,boundary:Gl,helpShown:Ul},Ql=150,Yl=42,Or=512,zl=["user","all","full","links"];function Us(e,t,s){return{cursor:t,error:!1,hasOlder:s&&t!==null,key:e,limitReached:!1,loading:!1,matches:[],pagesScanned:0,checkedMessageCount:0,totalMessageCount:0}}function Xl({containerRef:e,conversationViewEnabled:t,displayRenderItems:s,hasOlderMessages:o=!1,loadedMessageCount:i,totalMessageCount:c=0,historySearchCursor:l=null,historySearchContextKey:d="",hydratedHistoryCursor:h=null,inert:g,onHydrateHistorySearchPage:x,onReadOlderSearchPage:v,provider:b,recentProjectPathLinksEnabled:C,thinkingItemsVisible:M,turnGroups:F}){var Gt;const{t:A}=Kt(),[I,N]=n.useState(null),[ne,L]=n.useState(0),[$,j]=n.useState(!1),G=n.useRef(null),B=n.useRef(!1),Me=n.useRef(""),ve=n.useRef(null),ye=n.useRef(null),Ye=n.useRef(null),pe=n.useRef(null),Ze=n.useRef(null),q=n.useRef(null),se=n.useRef(""),de=n.useRef(null),Te=n.useRef(0),qe=n.useRef(""),tt=n.useRef(null),At=n.useRef(0),Le=n.useRef(new Map),z=n.useRef(null),Re=n.useRef(null),be=n.useRef(null),[_,y]=n.useState({active:!1,scope:"user",query:"",caseSensitive:!1,selectedId:null,originalScrollTop:null}),[H,Z]=n.useState(()=>Us("",null,!1)),ae=n.useRef(H),[ee,He]=n.useState(null),{reverseSearchMaxPagesPerAttempt:Ae}=Na(),Se=n.useCallback(()=>{Te.current+=1,He(null)},[]),Fe=n.useCallback(()=>{var T;(T=ve.current)==null||T.cancel(),ve.current=null},[]),Ve=n.useCallback(()=>{Fe(),ve.current=ga({hasFocus:()=>G.current!==null&&document.activeElement===G.current,shows:()=>{var T;return((T=G.current)==null?void 0:T.value)??""},expects:()=>Me.current,applyKey:T=>{N(null),pe.current=null,y(E=>E.active?{...E,query:"backspace"in T?E.query.slice(0,-1):E.query+T.insert,selectedId:null}:E)},repairCaret:()=>{const T=G.current;if(!T)return;const E=T.value.length;T.setSelectionRange(E,E)}})},[Fe]),st=n.useCallback(T=>{if(G.current=T,!T||!B.current)return;B.current=!1,T.addEventListener("focus",()=>{var P;return(P=ve.current)==null?void 0:P.retireWhenReady()}),T.focus({preventScroll:!0});const E=T.value.length;T.setSelectionRange(E,E)},[]),en=n.useMemo(()=>xa(s),[s]),_t=n.useCallback(()=>wa(s),[s]);Me.current=_.query;const le=Ta({active:_.active,query:_.query}),he=le?JSON.stringify([_.scope,_.query,_.caseSensitive,M,t,C,d,b]):"";se.current=he;const U=H.key===he?H:Us(he,l,o);ae.current=U;const pt=n.useCallback(()=>{var E;(E=tt.current)==null||E.terminate(),tt.current=null;const T=new Error("History search cancelled");for(const P of Le.current.values())P.reject(T);Le.current.clear()},[]),hn=n.useCallback(T=>{if(typeof Worker>"u")return new Promise(k=>{setTimeout(()=>k(El(T)),0)});let E=tt.current;E||(E=new Worker(new URL("/assets/sessionHistorySearch.worker-DCkPlfGO.js",import.meta.url),{type:"module"}),E.addEventListener("message",k=>{const oe=Le.current.get(k.data.requestId);oe&&(Le.current.delete(k.data.requestId),oe.resolve(k.data))}),E.addEventListener("error",()=>{var oe;const k=new Error("History search worker failed");for(const J of Le.current.values())J.reject(k);Le.current.clear(),(oe=tt.current)==null||oe.terminate(),tt.current=null}),tt.current=E);const P=At.current+1;return At.current=P,new Promise((k,oe)=>{Le.current.set(P,{reject:oe,resolve:k}),E.postMessage({requestId:P,...T})})},[]);n.useEffect(()=>{Se(),le&&(qe.current!==he&&(qe.current=he,pt()),Z(T=>{if(T.key!==he)return Us(he,l,o);if(T.pagesScanned===0&&!T.loading&&T.matches.length===0){const E=o&&l!==null;if(T.cursor!==l||T.hasOlder!==E)return{...T,cursor:l,hasOlder:E}}return T}))},[Se,pt,o,l,he,le]),n.useEffect(()=>{_.active&&!g||(Se(),qe.current="",pt())},[Se,pt,g,_.active]),n.useEffect(()=>()=>{pt()},[pt]);const we=le&&_.scope==="user",te=n.useMemo(()=>we?Ai(s):[],[we,s]),vt=le&&_.scope==="all",Ht=n.useMemo(()=>vt?ji(s):[],[vt,s]),at=le&&_.scope==="full",tn=n.useMemo(()=>at?Pi(F):[],[at,F]),Be=le&&_.scope==="links",mn=n.useMemo(()=>Be?_i(F):[],[Be,F]),et=Mi({allAnchors:Ht,fullAnchors:tn,linkAnchors:mn,scope:_.scope,userAnchors:te});let bt=[];if(U.matches.length>0){const T=new Set(et.map(E=>E.id));bt=U.matches.filter(E=>!T.has(E.id))}const Q=bt.length>0?[...bt,...et]:et,Vt=n.useCallback(async(T=1,E=!1)=>{var oe,J,Ee,Oe;let P=ae.current;const k=he;if(!(!le||!P.cursor||!P.hasOlder||P.loading||P.limitReached||de.current===k||!v)){qe.current=k,de.current=k,P={...P,checkedMessageCount:P.pagesScanned===0?i:P.checkedMessageCount,error:!1,key:k,loading:!0},ae.current=P,Z(P);try{let Dt=null;for(let Ge=0;Ge<T;Ge+=1){const Ut=P.cursor;if(!Ut||!P.hasOlder||P.limitReached)break;const We=await v(Ut);if(se.current!==k)return;const sn=new Set(We.messages.flatMap(je=>[je.uuid,je.id].filter(rn=>typeof rn=="string"&&rn.length>0))),Rn=((oe=We.session.transcriptDisplayObjects)==null?void 0:oe.filter(je=>{var rn;return je.placementAfterMessageId===""?((rn=We.pagination)==null?void 0:rn.hasOlderMessages)===!1:sn.has(je.placementAfterMessageId)}))??[],Sn=await hn({caseSensitive:_.caseSensitive,conversationViewEnabled:t,messages:We.messages,provider:b,query:_.query,recentProjectPathLinksEnabled:C,scope:_.scope,thinkingItemsVisible:M,transcriptDisplayObjects:Rn});if(se.current!==k)return;const Kn=(J=We.pagination)!=null&&J.hasOlderMessages?We.pagination.truncatedBeforeMessageId??null:null,Vn=Sn.matches.map(je=>({...je,pageCursor:Ut})),hs=new Set(P.matches.map(je=>je.id)),Qt=Vn.filter(je=>!hs.has(je.id)),Cn=new Map;for(const je of[...Vn,...P.matches])Cn.has(je.id)||Cn.set(je.id,je);const gn=[...Cn.values()],ms=Sn.matchesTruncated||gn.length>=Or;if(P={...P,cursor:Kn,error:!1,hasOlder:Kn!==null,limitReached:ms,matches:gn.length>Or?gn.slice(-Or):gn,pagesScanned:P.pagesScanned+1,checkedMessageCount:P.checkedMessageCount+We.messages.length,totalMessageCount:((Ee=We.pagination)==null?void 0:Ee.totalMessageCount)??P.totalMessageCount},ae.current=P,Z(P),E&&Qt.length>0){Dt=((Oe=Qt[Qt.length-1])==null?void 0:Oe.id)??null;break}}if(se.current!==k)return;P={...P,loading:!1},ae.current=P,Z(P),Dt&&P.matches.some(Ge=>Ge.id===Dt)&&y(Ge=>Ge.active?{...Ge,selectedId:Dt}:Ge)}catch{if(se.current!==k)return;P={...P,error:!0,loading:!1},ae.current=P,Z(P)}finally{de.current===k&&(de.current=null)}}},[t,he,i,v,b,C,hn,le,M,_.caseSensitive,_.query,_.scope]),yt=n.useMemo(()=>Ni({anchors:Q,caseSensitive:_.caseSensitive,query:_.query,searchReady:le}),[Q,le,_.caseSensitive,_.query]),ge=yt.matches,m=yt.matchIds,S=yt.matchTargetIds,K=yt.previewsById,ue=n.useMemo(()=>va({anchors:Q,previewsById:K,searchReady:le,selectedId:_.selectedId}),[Q,le,_.selectedId,K]),D=ue.selectedAnchor;n.useEffect(()=>{var T;le&&!U.hasOlder&&!U.limitReached&&(D==null?void 0:D.id)===((T=ge[0])==null?void 0:T.id)&&(D!=null&&D.id)&&(N("start"),L(E=>E+1))},[le,U.hasOlder,U.limitReached,D==null?void 0:D.id,(Gt=ge[0])==null?void 0:Gt.id]),q.current=(D==null?void 0:D.id)??null;const me=ue.selectedTargetId;Ze.current=me;const ze=ue.selectedPreview,rt=D?et.some(T=>T.id===D.id):!1,lt=D&&!rt?U.matches.find(T=>T.id===D.id)??null:null,ot=n.useMemo(()=>ba({matches:ge,scope:_.scope,searchReady:le,selectedId:_.selectedId}),[le,_.scope,_.selectedId,ge]),Et=n.useCallback(()=>le?ge:_.active?[]:_t(),[_t,le,_.active,ge]),Bt=n.useMemo(()=>ya({caseSensitive:_.caseSensitive,matchIds:m,preview:ze,previewsById:K,query:_.query,searchReady:le,selectedAnchorId:D==null?void 0:D.id}),[le,D==null?void 0:D.id,_.caseSensitive,_.query,K,m,ze]),_e=n.useMemo(()=>Ea({matchIds:m,matchTargetIds:S,scope:_.scope,searchReady:le,turnGroups:F}),[le,F,_.scope,m,S]);n.useEffect(()=>{ci({active:_.active,scope:_.scope})},[_.active,_.scope]),n.useEffect(()=>()=>{ci({active:!1,scope:"user"})},[]);const re=n.useCallback(T=>{pe.current=null,Se();const E=q.current?ge.findIndex(k=>k.id===q.current):-1;if(T==="previous"&&(ge.length===0||E===0)&&ae.current.hasOlder){N(null),Vt(Ae,!0);return}(T==="previous"?E===0:E===ge.length-1)?(N(T),L(k=>k+1)):N(null),y(k=>{var Ge;if(!k.active||ge.length===0)return k;const oe=k.selectedId?ge.findIndex(Ut=>Ut.id===k.selectedId):-1,J=T==="previous"?-1:1,Ee=T==="previous"?ge.length-1:0,Oe=oe>=0?(oe+J+ge.length)%ge.length:Ee,Dt=((Ge=ge[Oe])==null?void 0:Ge.id)??null;return{...k,selectedId:Dt}})},[Se,Ae,Vt,ge]),$e=n.useCallback(()=>{z.current!==null&&(clearTimeout(z.current),z.current=null),Re.current!==null&&(clearInterval(Re.current),Re.current=null),be.current=null},[]),ut=n.useRef(re);ut.current=re,n.useEffect(()=>()=>{$e(),Fe()},[Fe,$e]);const nn=n.useCallback(T=>{be.current===T&&(z.current!==null||Re.current!==null)||($e(),be.current=T,z.current=setTimeout(()=>{z.current=null,ut.current(T),Re.current=setInterval(()=>{ut.current(T)},Yl)},Ql))},[$e]),Ce=n.useCallback((T,E)=>{(!E||be.current!==T)&&(re(T),nn(T))},[re,nn]),vn=n.useCallback((T,E)=>{Se(),pe.current=E??T,y(P=>P.active?{...P,selectedId:T}:P),requestAnimationFrame(()=>{var P;(P=G.current)==null||P.focus({preventScroll:!0})})},[Se]),ir=n.useCallback(T=>{const E=Q.find(Oe=>Oe.id===T);if(!E)return null;const P=E.targetId??E.id,k=U.matches.find(Oe=>Oe.id===T),oe=et.some(Oe=>Oe.id===T);if(!k||oe||k.pageCursor===h)return P;if(!v||!x)return null;const J=he,Ee=Te.current;return He(T),v(k.pageCursor).then(Oe=>se.current!==J||Te.current!==Ee?null:(x(k.pageCursor,Oe),P)).catch(()=>(se.current===J&&Te.current===Ee&&Z(Oe=>Oe.key===J?{...Oe,error:!0}:Oe),null)).finally(()=>{se.current===J&&Te.current===Ee&&He(null)})},[Q,U.matches,he,h,et,x,v]),us=n.useCallback(T=>{B.current=!1,Fe(),N(null);const E=pe.current;pe.current=null;const P=T&&!E,k=P?Ye.current:null,oe=P?ye.current:null;Ye.current=null,ye.current=null,Se(),pt(),Z(Us("",null,!1)),(P||oe)&&requestAnimationFrame(()=>{var Ee;const J=(Ee=e.current)==null?void 0:Ee.parentElement;J&&k!==null&&(J.scrollTop=k),oe!=null&&oe.isConnected&&oe.focus({preventScroll:!0})}),y(J=>({active:!1,scope:J.scope,query:"",caseSensitive:!1,selectedId:null,originalScrollTop:null}))},[Se,e,pt,Fe]),pn=n.useCallback(T=>{var oe,J;if(!(T==="user"?en||o:s.length>0||o))return;if(_.active){N(null),y(Ee=>({...Ee,scope:T})),(oe=G.current)==null||oe.focus({preventScroll:!0});return}const P=document.activeElement;ye.current=P instanceof HTMLElement&&P!==document.body?P:null;const k=(J=e.current)==null?void 0:J.parentElement;Ye.current=(k==null?void 0:k.scrollTop)??null,pe.current=null,y({active:!0,scope:T,query:"",caseSensitive:!1,selectedId:null,originalScrollTop:Ye.current}),B.current=!0,Ve()},[e,s.length,o,en,Ve,_.active]),Ot=n.useCallback(T=>{N(null),pe.current=null,y(E=>({...E,query:T,selectedId:null}))},[]),X=n.useCallback(()=>{N(null),pe.current=null,y(T=>T.active?{...T,caseSensitive:!T.caseSensitive,selectedId:null}:T)},[]),ds=n.useCallback(()=>Ze.current,[]),bn=n.useCallback(()=>q.current,[]);n.useLayoutEffect(()=>{if(!_.active){$e();return}y(T=>{var P;if(!T.active)return T;let E=null;return le&&ge.length>0&&(E=T.selectedId&&m.has(T.selectedId)?T.selectedId:((P=ge[ge.length-1])==null?void 0:P.id)??null),T.selectedId===E?T:{...T,selectedId:E}})},[le,$e,_.active,ge,m]),n.useLayoutEffect(()=>{if(!_.active||!pe.current)return;new Set(ge.map(E=>E.targetId??E.id)).has(pe.current)||(pe.current=null)},[_.active,ge]),n.useEffect(()=>{g&&$e()},[g,$e]);const yn=_.active&&typeof document<"u"?document.querySelector(".session-input-inner"):null,En=Math.max(c,U.totalMessageCount),Wn=!U.hasOlder&&!U.limitReached?100:En>0?Math.min(99,Math.floor(100*Math.max(i,U.checkedMessageCount)/En)):null,fs=T=>{const E=k=>{D&&me&&T(D.id,me,k)},P=_.active?a.jsxs("div",{className:Ie.panel,role:"search",children:[a.jsxs("div",{className:Ie.main,children:[a.jsxs("div",{className:Ie.queryRow,children:[a.jsx("select",{className:Ie.label,value:_.scope,"aria-label":A("sessionSearchScopePicker"),onChange:k=>pn(k.target.value),children:zl.map(k=>a.jsx("option",{value:k,children:Ra(k)},k))}),a.jsx("input",{ref:st,className:Ie.input,value:_.query,onChange:k=>Ot(k.target.value),placeholder:"reverse search","aria-label":ot.scopeAriaLabel})]}),a.jsx("button",{type:"button",className:[Ie.caseToggle,_.caseSensitive?Ie.active:""].filter(Boolean).join(" "),"aria-label":"Case-sensitive search","aria-pressed":_.caseSensitive,title:_.caseSensitive?"Case-sensitive search on":"Case-sensitive search off",onMouseDown:k=>k.preventDefault(),onClick:X,children:"Aa"}),a.jsx("span",{className:Ie.coverage,role:"status",title:A("sessionSearchCoverage"),"aria-label":A("sessionSearchCoverage"),children:Wn===null?"—":`${Wn}%`}),a.jsxs("div",{className:Ie.navigation,children:[a.jsx("button",{type:"button",className:Ie.previous,"aria-label":A("sessionSearchPrevious"),disabled:!le||U.loading||ge.length===0&&!U.hasOlder,onMouseDown:k=>k.preventDefault(),onClick:()=>re("previous"),children:"↑"}),a.jsx("button",{type:"button",className:Ie.next,"aria-label":A("sessionSearchNext"),disabled:ge.length===0||U.loading,onMouseDown:k=>k.preventDefault(),onClick:()=>re("next"),children:"↓"}),a.jsx("button",{type:"button",className:Ie.go,"aria-label":A("sessionSearchGoLabel"),disabled:!D||ee!==null,onMouseDown:k=>k.preventDefault(),onClick:()=>E(!0),children:A("sessionSearchGo")})]}),a.jsx("span",{className:Ie.count,children:ot.countLabel}),a.jsx("button",{type:"button",className:Ie.close,"aria-label":A("sessionSearchCloseHere"),title:A("sessionSearchCloseHere"),onMouseDown:k=>k.preventDefault(),onClick:()=>D&&me?E(!0):us(!1),children:"×"})]}),I&&a.jsx("div",{className:Ie.boundary,role:"status",children:A(I==="start"?"sessionSearchStartReached":I==="previous"?"sessionSearchStartWrap":"sessionSearchEndWrap")},ne),lt&&a.jsxs("button",{type:"button",className:Ie.olderPreview,onMouseDown:k=>k.preventDefault(),onClick:()=>E(!1),children:[a.jsx("span",{className:Ie.olderPreviewLabel,children:ee===lt.id?A("sessionSearchLoadingResult"):A("sessionSearchOlderResult")}),a.jsx("span",{className:Ie.olderPreviewText,children:lt.preview})]}),le&&v&&a.jsxs("div",{className:Ie.olderControls,children:[U.hasOlder&&!U.limitReached&&a.jsx("button",{type:"button",className:Ie.olderButton,disabled:U.loading,onMouseDown:k=>k.preventDefault(),onClick:()=>void Vt(),children:U.loading?A("sessionSearchSearchingOlder"):U.pagesScanned>0?A("sessionSearchMoreOlder"):A("sessionSearchOlder")}),(U.error||U.pagesScanned>0)&&a.jsx("span",{className:Ie.olderStatus,children:U.error?A("sessionSearchOlderError"):U.limitReached?A("sessionSearchOlderLimit"):!U.hasOlder&&I!=="start"?A("sessionSearchStartReached"):U.hasOlder?A("sessionSearchOlderPages",{count:U.pagesScanned}):null})]}),a.jsx("button",{type:"button",className:Ie.helpToggle,"aria-label":A("sessionSearchShowKeys"),"aria-expanded":$,onMouseDown:k=>k.preventDefault(),onClick:()=>j(k=>!k),children:"?"}),a.jsxs("div",{className:[Ie.help,$?Ie.helpShown:""].filter(Boolean).join(" "),children:[a.jsx("span",{children:A("sessionSearchHelpNavigate",{shortcutKeys:ot.shortcutKeys})}),a.jsx("span",{children:A("sessionSearchHelpClose")})]})]}):null;return yn&&P?sr.createPortal(P,yn):P};return{active:_.active,scope:_.scope,visibleTurnGroups:_e,cancelSearchTargetPreparation:Se,getNavigatorAnchors:Et,searchState:Bt,renderSearchPanel:fs,closeSearch:us,getSelectedSearchAnchorId:bn,getSelectedSearchTargetId:ds,handleSearchArrowKey:Ce,moveSearchSelection:re,openSearch:pn,prepareSearchTarget:ir,selectSearchMatch:vn,stopSearchArrowRepeat:$e}}const Jl="_target_m3px0_1",Zl="_landed_m3px0_8",Qs={target:Jl,landed:Zl};function eu(e,t,s){const o=[],i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(d){var h;return(h=d.parentElement)!=null&&h.closest("button, script, style, [aria-hidden=true]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(let d=i.nextNode();d;d=i.nextNode())o.push(d);const c=o.map(d=>d.data).join("");if(!t)return null;const l=t.split(/\s+/).map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("\\s+");for(const d of c.matchAll(new RegExp(l,s?"gu":"giu"))){const h=d.index,g=d[0].length,x=document.createRange();let v=0,b=!1;for(const C of o){const M=v+C.length;if(!b&&h<M&&(x.setStart(C,h-v),b=!0),b&&h+g<=M){x.setEnd(C,h+g-v);break}v=M}if(typeof x.getClientRects=="function"&&[...x.getClientRects()].some(C=>C.width>0&&C.height>0))return x}return null}function tu(e){const t=n.useRef(null),s=n.useRef(null),o=n.useRef(!1),i=n.useRef(0),c=n.useCallback(()=>{var x;i.current+=1,o.current=!1,(x=t.current)==null||x.call(t),t.current=null},[]),l=n.useCallback(()=>{const x=t.current,v=s.current;if(!x||!v)return;v.classList.add(Qs.landed);const b=["pointerdown","keydown","wheel","touchstart"],C=()=>c();for(const M of b)window.addEventListener(M,C,{capture:!0,passive:!0});t.current=()=>{for(const M of b)window.removeEventListener(M,C,{capture:!0});x()}},[c]);n.useEffect(()=>(e&&c(),c),[e,c]);const d=n.useCallback((x,v,b,C)=>{var N;(N=t.current)==null||N.call(t),x.classList.add(Qs.target),s.current=x,x.dataset.searchMatch="true";const M=typeof Highlight<"u"&&typeof CSS<"u"&&"highlights"in CSS,F=ne=>{const L=eu(x,b.trim(),C);if(M&&(CSS.highlights.delete("session-isearch"),L&&CSS.highlights.set("session-isearch",new Highlight(L))),ne&&L){const $=L.getBoundingClientRect(),j=v.getBoundingClientRect();v.scrollTop+=$.top+$.height/2-j.top-v.clientHeight/2}};F(!0);let A=null;const I=new MutationObserver(()=>{A===null&&(A=requestAnimationFrame(()=>{A=null,F(!1)}))});I.observe(x,{childList:!0,characterData:!0,subtree:!0}),t.current=()=>{I.disconnect(),A!==null&&cancelAnimationFrame(A),x.classList.remove(Qs.target,Qs.landed),s.current===x&&(s.current=null),delete x.dataset.searchMatch,M&&CSS.highlights.delete("session-isearch")},o.current&&l()},[l]),h=n.useCallback(()=>{const x=i.current;return(v,b,C,M)=>{i.current===x&&d(v,b,C,M)}},[d]),g=n.useCallback(()=>{o.current=!0,l()},[l]);return{beginSearchMatchReveal:h,clearSearchMatchHighlight:c,releaseSearchMatchHighlightOnInput:g}}function nu(e,t){var o;const s=(o=t.parentElement)==null?void 0:o.closest("[data-render-id]");return!s||!e.contains(s)}function Ki(e){const t=new Map,s=new Map;if(!e)return t;for(const o of e.querySelectorAll("[data-render-id]")){const i=o.dataset.renderId;if(i){if(nu(e,o)){t.has(i)||t.set(i,o);continue}s.has(i)||s.set(i,o)}}for(const[o,i]of s)t.has(o)||t.set(o,i);return t}function It(e,t){return Ki(e).get(t)??null}function er(e){const t=e==null?void 0:e.dataset.renderId;return t&&t.length>0?t:void 0}function Vi(e){const t=new Map;for(const s of e)t.set(s.id,s);return t}function Gi(e){return e?Lt(e.sourceMessages):null}function Ur(e,t,s){const o=e.getBoundingClientRect(),i=t.getBoundingClientRect();e.scrollTop=Math.max(0,e.scrollTop+i.top-o.top-s)}function tr(e,t,s=[]){const o=t.getBoundingClientRect(),i=Array.from(e.querySelectorAll("[data-render-id]")),c=Vi(s);for(let l=0;l<i.length;l+=1){const d=i[l];if(!d)continue;const h=er(d);if(!h)continue;const g=d.getBoundingClientRect();if(g.bottom>o.top&&g.top<o.bottom){const x=er(i[l-1]),v=er(i[l+1]),b=Gi(c.get(h));return{id:h,topOffset:g.top-o.top,...x?{previousId:x}:{},...v?{nextId:v}:{},...b!==null?{timestampMs:b}:{}}}}return null}function su(e,t,s){if(t===void 0)return null;const o=Vi(s);let i=null;for(const c of e.querySelectorAll("[data-render-id]")){const l=er(c),d=Gi(l?o.get(l):void 0);if(d===null)continue;const h=Math.abs(d-t);(!i||h<i.distanceMs)&&(i={row:c,distanceMs:h})}return(i==null?void 0:i.row)??null}function ru(e,t,s){for(const o of[t.previousId,t.nextId]){if(!o)continue;const i=It(e,o);if(i)return i}return su(e,t.timestampMs,s)}const ou=200,Dr=1.25,Ys=48,iu=96,cu=48;function au(e){return Math.max(cu,Math.max(1,e)*iu)}function qn(e,t){var c;if(e.length===0)return 0;const s=Math.max(0,t);let o=0,i=e.length;for(;o<i;){const l=Math.floor((o+i)/2);(((c=e[l])==null?void 0:c.endPx)??0)<=s?o=l+1:i=l}return Math.min(o,e.length-1)}function qr(e,t,s){if(e.end-e.start<=Ys)return e;const o=Math.floor(Ys/2),i=Math.max(0,Math.min(s-o,t-Ys));return{start:i,end:Math.min(t,i+Ys)}}function lu(e,t,s,o,i){const c=e.rows.length;if(!e.active||c===0)return{start:0,end:c};const l=Math.max(1,t.clientHeight||600);if(i!==null){const b=e.rows[i];if(b){const C=l*Dr,M=qn(e.rows,b.offsetPx-C),F=Math.min(c,qn(e.rows,b.endPx+C)+1);return qr({start:M,end:F},c,i)}}if(o||!t.ready){const b=Math.max(0,e.totalHeightPx-l),C=qn(e.rows,b-l*Dr);return qr({start:C,end:c},c,Math.max(0,c-1))}const d=Math.max(0,t.scrollTop-s),h=l*Dr,g=qn(e.rows,d-h),x=Math.min(c,qn(e.rows,d+l+h)+1),v=qn(e.rows,d+l/2);return qr({start:g,end:x},c,v)}function uu({containerRef:e,followTail:t,getRowTargetIds:s,getRowWeight:o,pinnedRenderId:i=null,retainedRenderIds:c=[],rows:l}){var be,_;const d=n.useRef(new Map),h=n.useRef(new Map),g=n.useRef(new Map),x=n.useRef(null),v=n.useRef(null),b=n.useRef(!1),C=n.useRef(null),M=n.useRef(null),[F,A]=n.useState(0),[I,N]=n.useState(null),[ne,L]=n.useState({clientHeight:600,listStartPx:0,ready:!1,scrollTop:0}),$=n.useMemo(()=>{const y=new Map,H=[];let Z=0,ae=0;return l.forEach((ee,He)=>{const Ae=Math.max(0,o(ee)),Fe=d.current.get(ee.key)??au(Ae),Ve=s(ee);for(const st of Ve)y.has(st)||y.set(st,He);ae+=Ae,H.push({endPx:Z+Fe,offsetPx:Z,row:ee}),Z+=Fe}),{active:ae>=ou,rows:H,targetIndexes:y,totalHeightPx:Z,totalWeight:ae}},[s,o,F,l]),j=n.useCallback(()=>{const y=e.current,H=y==null?void 0:y.parentElement,Z=x.current;if(!H||!Z)return 0;const ae=H.getBoundingClientRect(),ee=Z.getBoundingClientRect();return H.scrollTop+ee.top-ae.top},[e]),G=I??i,B=G?$.targetIndexes.get(G)??null:null,Me=lu($,ne,ne.listStartPx,t,B),ve=new Set;for(let y=Me.start;y<Me.end;y+=1)ve.add(y);if($.active)for(const y of c){const H=$.targetIndexes.get(y);H!==void 0&&ve.add(H)}const ye=[...ve].sort((y,H)=>y-H).map(y=>$.rows[y]).filter(y=>y!==void 0),Ye=ye.map(y=>y.row),pe=((be=ye[0])==null?void 0:be.offsetPx)??0,Ze=new Map;for(let y=1;y<ye.length;y+=1){const H=ye[y-1],Z=ye[y];if(!H||!Z)continue;const ae=Z.offsetPx-H.endPx;ae>0&&Ze.set(Z.row.key,ae)}const q=$.totalHeightPx-(((_=ye[ye.length-1])==null?void 0:_.endPx)??0),se=n.useCallback(()=>{const y=e.current,H=y==null?void 0:y.parentElement;!y||!H||(v.current=tr(y,H))},[e]),de=n.useCallback(()=>{if(!$.active)return;let y=!1;for(const[H,Z]of h.current){const ae=g.current.get(H);if(!ae)continue;const ee=Math.max(0,ae.getBoundingClientRect().top-Z.getBoundingClientRect().top);if(ee<1)continue;const He=d.current.get(H);He!==void 0&&Math.abs(He-ee)<.5||(d.current.set(H,ee),y=!0)}y&&(se(),A(H=>H+1))},[se,$.active]),Te=n.useCallback(()=>{M.current===null&&(M.current=requestAnimationFrame(()=>{M.current=null,de()}))},[de]),qe=n.useCallback(y=>{x.current=y},[]),tt=n.useCallback((y,H)=>{H?(h.current.set(y,H),Te()):h.current.delete(y)},[Te]),At=n.useCallback((y,H)=>{H?(g.current.set(y,H),Te()):g.current.delete(y)},[Te]),Le=n.useCallback(y=>{const H=$.targetIndexes.get(y),Z=H===void 0?void 0:$.rows[H];return Z?j()+Z.offsetPx:null},[j,$.rows,$.targetIndexes]),z=n.useCallback(y=>Ze.get(y)??0,[Ze]),Re=n.useCallback(y=>$.targetIndexes.has(y)?(v.current=null,b.current=!0,N(y),!0):!1,[$.targetIndexes]);return n.useLayoutEffect(()=>{const y=v.current;if(v.current=null,!y)return;const H=e.current,Z=H==null?void 0:H.parentElement,ae=It(H,y.id);Z&&ae&&Ur(Z,ae,y.topOffset)}),n.useEffect(()=>{if(!I||B===null||B<Me.start||B>=Me.end)return;const y=requestAnimationFrame(()=>{b.current=!1,N(null)});return()=>cancelAnimationFrame(y)},[I,Me.end,Me.start,B]),n.useEffect(()=>{const y=e.current,H=y==null?void 0:y.parentElement;if(!y||!H)return;const Z=()=>{L(He=>{const Ae={clientHeight:H.clientHeight,listStartPx:j(),ready:!0,scrollTop:H.scrollTop};return He.ready&&He.clientHeight===Ae.clientHeight&&Math.abs(He.listStartPx-Ae.listStartPx)<.5&&Math.abs(He.scrollTop-Ae.scrollTop)<.5?He:Ae})},ae=()=>{C.current===null&&($.active&&!b.current&&se(),C.current=requestAnimationFrame(()=>{C.current=null,Z()}))},ee=typeof ResizeObserver>"u"?null:new ResizeObserver(Te);return ee==null||ee.observe(y),ee==null||ee.observe(H),H.addEventListener("scroll",ae,{passive:!0}),window.addEventListener("resize",ae),Z(),Te(),()=>{ee==null||ee.disconnect(),H.removeEventListener("scroll",ae),window.removeEventListener("resize",ae),C.current!==null&&(cancelAnimationFrame(C.current),C.current=null),M.current!==null&&(cancelAnimationFrame(M.current),M.current=null)}},[se,e,j,$.active,Te]),n.useEffect(()=>{const y=new Set(l.map(H=>H.key));for(const H of d.current.keys())y.has(H)||d.current.delete(H)},[l]),{active:$.active,afterHeightPx:q,beforeHeightPx:pe,getRenderIdTop:Le,getRowSpacerBefore:z,registerListStart:qe,registerRowEnd:At,registerRowStart:tt,revealRenderId:Re,rows:Ye,totalWeight:$.totalWeight}}function du(e,t){const s=[];let o=null,i=null;const c=l=>{if(!o||!i||l)return;const d=Lt(i.sourceMessages);s.push({id:o.id,...d!==null?{timestampMs:d}:{},endRenderItemId:i.id})};for(const l of e){if(l.isUserPrompt){c(!1),o=l.items.find(d=>d.type==="user_prompt")??null,i=null;continue}!l.isStandalone&&o&&(i=ki(l.items)??l.items[l.items.length-1]??i)}return c(t),s}function fu(e,t,s,o){const i=e.getBoundingClientRect();let c=null;for(const l of du(t,o)){const d=s.get(l.endRenderItemId);if(!d)continue;const h=d.getBoundingClientRect();h.bottom>=i.top&&h.bottom<=i.bottom&&(c=l)}return c?{id:c.id,...c.timestampMs!==void 0?{timestampMs:c.timestampMs}:{}}:null}function Ui(e){const t=[];let s=null;for(const o of e){if(o.isUserPrompt){s&&t.push(s);const i=o.items.find(l=>l.type==="user_prompt")??null;if(!i){s=null;continue}const c=Lt(i.sourceMessages);s={id:i.id,...c!==null?{timestampMs:c}:{},items:[i]};continue}!o.isStandalone&&s&&s.items.push(...o.items)}return s&&t.push(s),t}function hu(e,t,s,o){var M,F;const i=e.getBoundingClientRect();let c=null;for(const A of Ui(t))for(let I=0;I<A.items.length;I+=1){const N=A.items[I];if(!N)continue;const ne=s.get(N.id);if(!ne)continue;const L=ne.getBoundingClientRect();L.bottom>i.top&&L.top<i.bottom&&(c={turn:A,item:N,activityIndex:I,rowTop:L.top})}if(!c)return null;const{activityIndex:l,item:d,rowTop:h,turn:g}=c,x=o.findIndex(A=>A.id===d.id),v=x>0?(M=o[x-1])==null?void 0:M.id:void 0,b=x>=0?(F=o[x+1])==null?void 0:F.id:void 0,C=Lt(d.sourceMessages);return{seenTurn:{id:g.id,...g.timestampMs!==void 0?{timestampMs:g.timestampMs}:{},activityIndex:l},anchor:{id:d.id,topOffset:h-i.top,...v?{previousId:v}:{},...b?{nextId:b}:{},...C!==null?{timestampMs:C}:{}}}}function mu({scrollContainer:e,groups:t,rowsById:s,allItems:o,turnActive:i}){const c=hu(e,t,s,o),l=fu(e,t,s,i);return{...l?{completedTurn:l}:{},...c}}function pu(e){const t=Ui(e),s=t[t.length-1],o=s==null?void 0:s.items[s.items.length-1];return s?`${s.id}:${s.items.length}:${o==null?void 0:o.id}`:null}const gu="_strip_4uhl2_2",xu="_row_4uhl2_9",wu="_item_4uhl2_16",Tu="_thumbnail_4uhl2_25",vu="_placeholder_4uhl2_51",bu="_caption_4uhl2_61",$n={strip:gu,row:xu,item:wu,thumbnail:Tu,placeholder:vu,caption:bu};function nr(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function yu(e,t){for(const i of["file_path","path","filePath"]){const c=nr(e)?e[i]:void 0;if(typeof c=="string"&&c.trim())return c.trim()}const s=nr(t)?t.file:void 0,o=nr(s)?s.filePath:void 0;return typeof o=="string"&&o.trim()?o.trim():null}function Eu(e){var o;const t=[],s=new Set;for(const i of e){const c=(o=i.item.toolResult)==null?void 0:o.structured;if(!(nr(c)&&c.type==="image"))continue;const d=yu(i.item.toolInput,c);!d||s.has(d)||(s.add(d),t.push({id:i.item.id,name:Fa(d),path:d}))}return t}function Ru({image:e,onOpen:t}){const s=Oi().transport,o=n.useCallback(()=>Ka(e.path,void 0,"inline",s),[e.path,s]);return a.jsxs("div",{className:$n.item,children:[a.jsx(Vc,{alt:e.name,ariaLabel:e.name,buttonClassName:$n.thumbnail,fileName:e.name,filePath:e.path,loadBlob:o,onOpen:t,placeholderClassName:$n.placeholder,title:e.name}),a.jsx("span",{className:$n.caption,children:e.name})]})}function Su({images:e}){const{t}=Kt(),{inlineMediaExpandedByDefault:s}=$a(),[o,i]=n.useState(null),c=o??s,[l,d]=n.useState(null),h=l===null?null:e[l],g=t(e.length===1?"exploredImagesOne":"exploredImagesMany",{count:e.length});return a.jsxs("div",{className:$n.strip,"data-explored-images":e.length,children:[a.jsxs("div",{className:"local-media-link-group",children:[a.jsx("button",{type:"button",className:"local-media-inline-toggle","aria-expanded":c,"aria-label":c?t("explorationCollapse"):g,onClick:()=>i(!c),children:c?"-":"+"}),a.jsx("span",{className:"local-media-type",children:g})]}),c&&a.jsx("div",{className:$n.row,children:e.map((x,v)=>a.jsx(Ru,{image:x,onOpen:()=>d(v)},`${x.id}:${x.path}`))}),h?a.jsx(Wa,{path:h.path,mediaType:"image",imageNavigation:e.length>1&&l!==null?{count:e.length,current:l+1,onNext:()=>d(x=>x===null?null:(x+1)%e.length),onPrevious:()=>d(x=>x===null?null:(x-1+e.length)%e.length)}:void 0,onClose:()=>d(null)}):null]})}function Cu(e){switch(e){case"pending":return".";case"error":return"!";case"aborted":return"x";case"incomplete":return"?";case"complete":return""}}function ku(e,t,s){var g,x,v;const o=Ii(e.toolName),i=((g=e.toolResult)==null?void 0:g.structured)??((x=e.toolResult)==null?void 0:x.content),c=e.status==="complete",l=Qc(e),d={isStreaming:e.status==="pending",theme:"dark",toolUseId:e.id,provider:t,projectPath:s},h=_r.prepare(e.toolName,{input:e.toolInput,result:i,status:e.status,isError:(v=e.toolResult)==null?void 0:v.isError}).kind;if((o==="read"||o==="search")&&c&&h==="rich"&&_r.hasInteractiveSummary(e.toolName)){const b=_r.renderInteractiveSummary(e.toolName,e.toolInput,i,l,d);if(b)return b}return c&&(o==="search"||o==="list")?Yc(e.toolName,e.toolInput,e.toolResult,e.status,{projectPath:s}):Ia(e,s)}function Iu(e){return e.entries.length===1?e.item.id:void 0}function Mu(e){return e.entries.length>1||Ii(e.item.toolName)===null}const Au=n.memo(function({id:t,projection:s,sessionProvider:o,staleNowMs:i}){const[c,l]=Gc(s.disclosureOwnerId,"explored-group",!0),[d,h]=n.useState(()=>new Set),g=n.useId(),{t:x}=Kt(),v=Bi(),b=(v==null?void 0:v.projectPath)??null,C=n.useRef(Date.now()),M=s.parents.map(q=>q.item),F=Yr(M),A=F!==null,I=A&&i!==void 0,N=I?i??Date.now():C.current,ne=I&&N!==null&&F!==null&&N-F>=Li,L=s.parents.some(q=>q.item.status==="pending"),$=x(L?"explorationTitlePending":"explorationTitleComplete"),j=s.entries.length,G=x(j===1?"explorationItemCountOne":"explorationItemCountMany",{count:j}),B=x(c?"explorationCollapse":"explorationExpand"),Me=s.parents.filter(Mu),ve=Eu(s.parents),ye=`${g}-body`,pe={"--explored-group-intrinsic-height":`${Sa({detailRowCount:Me.length,entryCount:j,expanded:c})}px`},Ze=q=>{h(se=>{const de=new Set(se);return de.has(q)?de.delete(q):de.add(q),de})};return a.jsxs("div",{className:["message-render-row","explored-message-row",A?"has-message-age":"",ne?"is-message-age-visible":""].filter(Boolean).join(" "),"data-render-type":"explored","data-render-id":t,style:pe,children:[a.jsx("div",{className:"message-render-content",children:a.jsxs("div",{className:"explored-group timeline-item",children:[a.jsx("button",{type:"button",className:"timeline-dot-btn",onClick:()=>l(q=>!q),"aria-label":B,"aria-controls":ye,"aria-expanded":c,title:B}),a.jsxs("button",{type:"button",className:"explored-group-header",onClick:()=>l(q=>!q),"aria-controls":ye,"aria-expanded":c,children:[a.jsx("span",{className:"explored-group-title",children:$}),a.jsx("span",{className:"explored-group-count",children:G}),a.jsx("span",{className:"expand-chevron","aria-hidden":"true",children:c?"▾":"▸"})]}),c&&a.jsxs("div",{className:"explored-group-body",id:ye,role:"list",children:[s.parents.flatMap(q=>q.entries.map(se=>a.jsxs("div",{className:`explored-entry status-${q.item.status}`,"data-render-id":Iu(q),"data-exploration-entry-id":se.id,"data-exploration-kind":se.kind,"data-exploration-parent-id":se.parentId,"data-render-type":q.item.type,role:"listitem",children:[a.jsx("span",{className:"explored-entry-status","aria-hidden":"true",children:Cu(q.item.status)}),a.jsx("span",{className:"explored-entry-tool",children:Ca(q,se)}),a.jsx("div",{className:"explored-entry-summary",children:ka(q,se)?ku(q.item,o,b):_u(se,b,x)})]},se.id))),Me.map((q,se)=>{const de=d.has(q.item.id),Te=x(de?"explorationHideCommandDetails":"explorationShowCommandDetails"),qe=`${g}-raw-${se}`;return a.jsxs("div",{className:"explored-parent-details",children:[a.jsxs("button",{type:"button",className:"explored-parent-details-toggle",onClick:()=>Ze(q.item.id),"aria-controls":qe,"aria-expanded":de,children:[a.jsx("span",{className:"expand-chevron","aria-hidden":"true",children:de?"▾":"▸"}),Te]}),de&&a.jsx("div",{className:"explored-parent-raw",id:qe,children:a.jsx(Uc,{id:q.item.id,toolName:q.item.toolName,toolInput:q.item.toolInput,toolResult:q.item.toolResult,status:q.item.status,sessionProvider:o})})]},`details-${q.item.id}`)})]}),c&&ve.length>0&&a.jsx(Su,{images:ve})]})}),a.jsx(Zs,{timestampMs:F,nowMs:N??Date.now()})]})});function _u(e,t,s){if(e.kind==="read"){const i=e.absolutePath??e.path??e.name??"",c=e.path??i,l=c?Lr(c,t):e.name??"file",d=e.startLine!==void 0&&e.endLine!==void 0?s("explorationLineRange",{start:e.startLine,end:e.endLine}):e.startLine!==void 0?s("explorationLine",{line:e.startLine}):"";return a.jsxs("span",{className:"explored-entry-semantic-summary",title:[l,d].filter(Boolean).join(" · "),children:[a.jsx("span",{className:"explored-entry-path",children:a.jsx(Pr,{displayPath:l,filePath:i,lineEnd:e.endLine,lineNumber:e.startLine,showLineSuffix:!1})}),d&&a.jsx("span",{className:"explored-entry-range",children:a.jsx(Pr,{displayPath:d,filePath:i,lineEnd:e.endLine,lineNumber:e.startLine,showCopyButton:!1,showLineSuffix:!1,viewMode:"range"})})]})}if(e.kind==="search"){const i=e.path?Lr(e.path,t):"";return a.jsxs("span",{className:"explored-entry-semantic-summary",title:[e.query,i].filter(Boolean).join(" · "),children:[a.jsx("span",{className:"explored-entry-query",children:e.query}),i&&a.jsx("span",{className:"explored-entry-scope",children:a.jsx(Pr,{displayPath:i,filePath:e.path??i,showCopyButton:!1,showLineSuffix:!1})})]})}const o=e.path?Lr(e.path,t):".";return a.jsx("span",{className:"explored-entry-semantic-summary",title:o,children:a.jsx("span",{className:"explored-entry-path",children:o})})}const Pu=["Thinking...","Processing...","Cooking...","Analyzing...","Working on it...","Pondering...","Computing...","Crafting...","Mulling it over...","On it...","Crunching...","Brewing...","Conjuring...","Synthesizing...","Deliberating...","Ruminating...","Contemplating...","Percolating...","Cogitating...","Noodling..."],ju=2e3,Nu=25,di={phraseIndex:0,displayedText:"",isTyping:!0};function Lu(e){const t=[...e];for(let s=t.length-1;s>0;s--){const o=Math.floor(Math.random()*(s+1)),i=t[s];t[s]=t[o],t[o]=i}return t}function Hu({muted:e}){return a.jsxs("svg",{className:"processing-thinking-toggle-icon",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M20 11.5c0 4-3.8 7.25-8.5 7.25-1.1 0-2.2-.18-3.15-.52L4 20l1.2-3.25C3.85 15.42 3 13.58 3 11.5 3 7.5 6.8 4.25 11.5 4.25S20 7.5 20 11.5Z"}),a.jsx("path",{d:"M8.5 11.5h.01"}),a.jsx("path",{d:"M11.5 11.5h.01"}),a.jsx("path",{d:"M14.5 11.5h.01"}),e&&a.jsx("path",{className:"processing-thinking-toggle-slash",d:"M4 20 20 4"})]})}const Bu=n.memo(function({isProcessing:t,thinkingItemsVisible:s=!0,hasThinkingItems:o=!1,onToggleThinkingItemsVisible:i,thinkingLatestOnly:c=!1,onToggleThinkingLatestOnly:l}){const{t:d}=Kt(),[h,g]=n.useState(di),[x,v]=n.useState(!1),[b,C]=n.useState(!1),M=n.useRef(null),F=n.useRef(null),A=n.useRef([]),{phraseIndex:I,displayedText:N,isTyping:ne}=h,L=!!(i&&(t||o)),$=t||L,j=n.useCallback(()=>{A.current=[],F.current!==null&&(window.cancelAnimationFrame(F.current),F.current=null)},[]),G=n.useCallback(z=>{A.current.push(z),F.current===null&&(F.current=window.requestAnimationFrame(()=>{F.current=null;const Re=A.current;A.current=[],g(be=>Re.reduce((_,y)=>y(_),be))}))},[]),B=n.useRef(null),Me=n.useRef(!1),ve=n.useCallback(()=>{B.current&&(clearTimeout(B.current),B.current=null)},[]),ye=n.useCallback(z=>{l&&(z.preventDefault(),l())},[l]),Ye=n.useCallback(()=>{l&&(ve(),Me.current=!1,B.current=setTimeout(()=>{Me.current=!0,B.current=null,l()},450))},[ve,l]),pe=n.useCallback(z=>{Me.current&&z.preventDefault(),ve()},[ve]),Ze=n.useCallback(()=>{if(Me.current){Me.current=!1;return}i==null||i()},[i]),q=n.useCallback(()=>{v(z=>!z)},[]),se=n.useCallback(z=>{z.key!=="Enter"&&z.key!==" "||(z.preventDefault(),q())},[q]),de=n.useMemo(()=>t?fa()?Lu(Pu):["Thinking..."]:["Thinking..."],[t]);n.useEffect(()=>{if(!$){C(!1);return}const z=M.current;if(!z){C(!1);return}return Bc(z,C)},[$]);const Te=t&&b&&!x;if(n.useEffect(()=>{Te||j()},[j,Te]),n.useEffect(()=>j,[j]),n.useEffect(()=>{if(!t){g(di),v(!1);return}if(!Te)return;const z=I,Re=setTimeout(()=>{G(be=>be.phraseIndex===z?{phraseIndex:(z+1)%de.length,displayedText:"",isTyping:!0}:be)},ju);return()=>clearTimeout(Re)},[t,I,de.length,G,Te]),n.useEffect(()=>{if(!Te||!ne)return;const z=de[I]??"";if(N.length>=z.length)return;const Re=setTimeout(()=>{G(be=>{if(be.phraseIndex!==I)return be;const _=z.slice(0,be.displayedText.length+1);return{...be,displayedText:_,isTyping:_.length<z.length}})},Nu);return()=>clearTimeout(Re)},[ne,I,N,de,G,Te]),!$)return null;const qe=d(s?"processingThinkingTranscriptHide":o?"processingThinkingTranscriptShowHidden":"processingThinkingTranscriptShowWhenAvailable"),tt=l?d(s?c?"processingThinkingRightClickExpandAll":"processingThinkingRightClickLatestOnly":"processingThinkingRightClickShowExpandAll"):null,At=tt?`${qe}
|
|
2
|
-
${tt}`:qe,Le=d(x?"processingAnimationResume":"processingAnimationPause");return a.jsxs("div",{ref:M,className:`processing-indicator ${t?"":"processing-indicator--control-only"} ${!s&&o?"processing-indicator--thinking-hidden":""}`,children:[L&&a.jsx("button",{type:"button",className:`processing-thinking-toggle ${s?"is-visible":"is-muted"} ${c?"is-latest-only":""}`.trim(),onClick:Ze,onContextMenu:ye,onTouchStart:Ye,onTouchEnd:pe,onTouchCancel:ve,onTouchMove:ve,"aria-pressed":s,"aria-label":qe,title:At,children:a.jsx(Hu,{muted:!s})}),t&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"processing-dot-container",children:a.jsx(Oc,{animationVisibilityManaged:!0})}),a.jsx("span",{className:"processing-text",role:"button",tabIndex:0,"aria-pressed":x,"aria-label":Le,title:Le,onClick:q,onKeyDown:se,children:N})]})]})}),Ou=300*1e3;class Du{constructor(t,s,o){kt(this,"snapshot",{});kt(this,"cache",new Map);kt(this,"listeners",new Set);kt(this,"queue",new Set);kt(this,"current",null);kt(this,"abort",null);kt(this,"generation",0);kt(this,"getSnapshot",()=>this.snapshot);kt(this,"subscribe",t=>(this.listeners.add(t),()=>this.listeners.delete(t)));kt(this,"request",t=>{for(const s of t){if(!ni(s)||s===this.current)continue;const o=this.getCached(s),i=o?Date.now()-o.checkedAt:1/0;o&&i>=0&&i<Ou?this.publish(s,o.content):this.queue.add(s)}this.current||this.drain()});kt(this,"dispose",()=>{var t;this.generation++,(t=this.abort)==null||t.abort(),this.abort=null,this.current=null,this.queue.clear()});this.readFile=t,this.storageKey=s,this.storage=o}getCached(t){var o;const s=this.cache.get(t);if(s)return s;try{const i=(o=this.storage)==null?void 0:o.getItem(`${this.storageKey}:${t}`);if(!i)return;const c=JSON.parse(i);if(c&&typeof c.content=="string"&&Number.isFinite(c.checkedAt)&&(c.etag===void 0||typeof c.etag=="string")&&si(c.content,t))return this.cache.set(t,c),c}catch{}}publish(t,s){if(this.snapshot[t]!==s){this.snapshot={...this.snapshot,[t]:s};for(const o of this.listeners)o()}}async drain(){var s,o;const t=this.generation;for(const i of this.queue){this.queue.delete(i),this.current=i;const c=`${this.storageKey}:${i}`,l=this.getCached(i);let d={content:null,checkedAt:Date.now()};this.abort=new AbortController;try{const h=await this.readFile(ni(i).path,{signal:this.abort.signal,cache:"no-store",headers:l!=null&&l.etag?{"If-None-Match":l.etag}:{}});if(h.status===304&&(l!=null&&l.content))d={...l,checkedAt:Date.now()};else if(h.status===200){const g=await h.text();g.length<=1024*1024&&si(g,i)&&(d={content:g,checkedAt:Date.now(),etag:h.headers.get("ETag")??void 0})}}catch{}if(t!==this.generation)return;d.checkedAt=Date.now(),this.cache.set(i,d);try{d.content!==null?(s=this.storage)==null||s.setItem(c,JSON.stringify(d)):(o=this.storage)==null||o.removeItem(c)}catch{}this.publish(i,d.content)}t===this.generation&&(this.current=null,this.abort=null)}}const qu={},fi=()=>qu,Fu=()=>()=>{};function $u(e){const t=Bi(),s=Oi(),o=t==null?void 0:t.projectId,i=t==null?void 0:t.sessionId,c=n.useMemo(()=>{if(!e||!o||!i)return null;let g=null;try{g=window.sessionStorage}catch{}return new Du((x,v)=>s.transport.fetchResponse(`/projects/${o}/files/raw?${new URLSearchParams({path:x})}`,v),`ya:workflow-schema-files:v1:${JSON.stringify([s.sourceKey,o,i])}`,g)},[e,o,i,s]);n.useEffect(()=>()=>c==null?void 0:c.dispose(),[c]);const l=n.useRef(new Set);n.useEffect(()=>{if(!c)return;const g=()=>{document.visibilityState==="visible"&&s.transport.status.getSnapshot().state==="ready"&&c.request(l.current)};document.addEventListener("visibilitychange",g);const x=s.transport.status.subscribe(g);return()=>{document.removeEventListener("visibilitychange",g),x()}},[c,s]);const d=n.useSyncExternalStore((c==null?void 0:c.subscribe)??Fu,(c==null?void 0:c.getSnapshot)??fi,fi),h=n.useCallback(g=>{var v;if(!c)return;const x=new Set;for(const b of g)for(const C of((v=b.workflow)==null?void 0:v.markers)??[])C.schemaRef&&x.add(C.schemaRef);l.current=x,document.visibilityState==="visible"&&c.request(x)},[c]);return{files:d,resolve:h}}const Wu={down:fe.motionDown,up:fe.motionUp},Qi=2,hi=8,Ku=6,mi=18,Vu=3,Fr=1,Tt=5,Gu=.5,Uu=32,Qr=62,Yi=15,Qu=1,zi=Yi+Qu,pi=64,Yu=64,zu=48,Xu=760,Ju=1;function Fn(e){return(e==null?void 0:e.parentElement)??null}function Zu(e,t){const s=e.length;if(s===0)return e.slice();const o=[];for(let l=0;l<s;l++){let d=(e[l]??0)-l*t,h=1,g=o[o.length-1];for(;g&&g.sum/g.count>d/h;)o.pop(),d+=g.sum,h+=g.count,g=o[o.length-1];o.push({sum:d,count:h})}const i=Array.from({length:s},()=>0);let c=0;for(const l of o){const d=l.sum/l.count;for(let h=0;h<l.count;h++)i[c]=d+c*t,c++}return i}function Mt(e,t,s){return Math.max(t,Math.min(s,e))}function gi(e){const t=Di(e);return t.length<=zu&&!t.includes(`
|
|
3
|
-
`)}function ed(e){return/(^|\s)(cat|find|git|grep|pnpm|rg|sed|tsx?|vitest)\b/.test(e)||/[/\\][\w.-]+/.test(e)||/[`{}[\]()<>=|;]/.test(e)}function td(e){const t=Di(e),[s="",...o]=t.split(`
|
|
4
|
-
`),i=s.indexOf(":"),c=i>0&&i<=80?s.slice(0,i).split(/\s+\/\s+|\s+›\s+/).map(g=>g.trim()).filter(Boolean):[],d=[c.length>0?s.slice(i+1).trimStart():s,...o].map(g=>g.trim()).filter(Boolean),h=(d.length>0?d:[t]).slice(0,6).map(g=>({text:g,mono:ed(g)}));return{tags:c,lines:h}}function nd(e,t,s){return a.jsx("span",{className:[fe.facsimileLine,e.mono?fe.mono:""].filter(Boolean).join(" "),children:Jr(e.text,s.query,s.caseSensitive)},`${t}:${e.text}`)}function sd(e,t){const s=td(e.text);return a.jsxs("span",{className:fe.facsimile,children:[a.jsx("span",{className:fe.facsimileRail,"aria-hidden":!0}),a.jsxs("span",{className:fe.facsimileContent,children:[s.tags.length>0&&a.jsx("span",{className:fe.facsimileTags,children:s.tags.map(o=>a.jsx("span",{className:fe.facsimileTag,children:Jr(o,t.query,t.caseSensitive)},o))}),a.jsx("span",{className:fe.facsimileLines,children:s.lines.map((o,i)=>nd(o,i,t))})]})]})}function rd(e,t){if(!t)return e.text;if(!e.expanded){const s=Ua(e.text,t.query,t.caseSensitive);return Jr(s,t.query,t.caseSensitive)}return sd(e,t)}const od=2;function Xi(e,t){var c,l;if(e.length===0)return"";const s=t-od;let o=0,i=e.length;for(;o<i;){const d=o+i>>1;(((c=e[d])==null?void 0:c.scrollTopPx)??0)>=s?i=d:o=d+1}return((l=e[o]??e[e.length-1])==null?void 0:l.id)??""}function xi(){return typeof window.requestAnimationFrame=="function"?{request:window.requestAnimationFrame.bind(window),cancel:window.cancelAnimationFrame.bind(window)}:{request:e=>window.setTimeout(()=>e(performance.now()),16),cancel:window.clearTimeout.bind(window)}}function Ji(e){const t=e.markers.map(s=>`${s.id}:${s.targetId??s.id}:${Math.round(s.topPct*100)}:${s.timestampMs??""}`).join("|");return[Math.round(e.top),Math.round(e.right),Math.round(e.height),Math.round(e.thumbTopPct*100),Math.round(e.thumbHeightPct*100),e.activeId,Math.round(e.previewMaxWidthPx),t].join(":")}function wi(e,t,s=Qi,o){if(e.length<s||!t)return null;const i=Fn(t);if(!i)return null;const c=i.getBoundingClientRect();if(c.width<=0||c.height<=0)return null;const l=Math.max(i.scrollHeight,1),d=Math.max(i.clientHeight,1),h=[],g=Ki(t);for(const I of e){const N=I.targetId??I.id,ne=g.get(N),L=ne?null:o==null?void 0:o(N);if(!ne&&L==null)continue;const $=ne==null?void 0:ne.getBoundingClientRect(),j=$?i.scrollTop+$.top-c.top:L??0,G=Mt(j/l,0,1);h.push({...I,scrollTopPx:j,topPct:G,renderTopPct:G,hitPx:mi})}if(h.length<s)return null;const x=c.top+hi,v=Math.max(c.height-hi*2,1),b=h.map(I=>I.topPct*v),C=Zu(b,Vu);for(let I=0;I<h.length;I++){const N=h[I];if(!N)continue;const ne=C[I]??N.topPct*v;N.renderTopPct=Mt(ne/v,0,1);const L=I>0?ne-(C[I-1]??ne):Number.POSITIVE_INFINITY,$=I<h.length-1?(C[I+1]??ne)-ne:Number.POSITIVE_INFINITY;N.hitPx=Mt(Math.min(L,$),Ku,mi)}const M=window.innerWidth-c.right+(i.offsetWidth-i.clientWidth),F=Mt(window.innerWidth-M-42,160,620),A={top:x,right:M,height:v,thumbTopPct:Mt(i.scrollTop/l,0,1),thumbHeightPct:Mt(d/l,.04,1),activeId:Xi(h,i.scrollTop),markers:h,previewMaxWidthPx:F};return{...A,signature:Ji(A)}}function id(e,t){const s=Math.max(t.scrollHeight,1),o=Math.max(t.clientHeight,1),i={...e,thumbTopPct:Mt(t.scrollTop/s,0,1),thumbHeightPct:Mt(o/s,.04,1),activeId:Xi(e.markers,t.scrollTop)};return{...i,signature:Ji(i)}}function cd(e,t,s){if(e.length<=1)return e.map(b=>Ti(b,t));const o=s?zi:Qr,i=Tt,c=Math.max(i,t-Tt),l=Math.max(1,c-i),d=Math.min(o,l/(e.length-1)),h=e.map(b=>({...b}));for(let b=1;b<h.length;b+=1){const C=h[b],M=h[b-1];!C||!M||(C.topPx=Math.max(C.topPx,M.topPx+d))}const g=h[h.length-1],x=g?g.topPx-c:0;if(x>0)for(const b of h)b.topPx-=x;const v=h[0];v&&(v.topPx=Math.max(v.topPx,i));for(let b=1;b<h.length;b+=1){const C=h[b],M=h[b-1];!C||!M||(C.topPx=Math.max(C.topPx,M.topPx+d))}return h.map(b=>Ti({...b,topPx:Mt(b.topPx,i,c)},t))}function Zi(e,t,s=Gu){if(e<=Tt+s)return{topPx:Fr,verticalAnchor:"start"};const o=Math.max(Tt,t-Tt);return e>=o-s?{topPx:Math.max(Fr,t-Fr),verticalAnchor:"end"}:{topPx:e,verticalAnchor:"center"}}function Ti(e,t){return e.active?{...e,...Zi(e.topPx,t)}:{...e,verticalAnchor:"center"}}function ad(e){return e==="start"?"0":e==="end"?"-100%":"-50%"}function ld(e,t,s){if(e.length<=1)return e;const o=Math.max(1,Math.min(Yu,Math.floor(Math.max(1,s-Tt*2)/zi)+1));if(e.length<=o)return e;const i=t?e.findIndex(h=>h.id===t):-1,c=i>=0?i:e.length-1,l=Math.floor((o-1)/2),d=Mt(c-l,0,e.length-o);return e.slice(d,d+o)}const ud=n.memo(function({anchors:t=[],getAnchors:s,messageListRef:o,motionCue:i,onNavigateStart:c,onSearchMatchSelect:l,onTrimAnchor:d,canTrimAnchor:h,onForkBeforeAnchor:g,canForkBeforeAnchor:x,onForkAfterAnchor:v,canForkAfterAnchor:b,forkAfterDisabled:C=!1,onCopyAnchor:M,canCopyAnchor:F,onHandoffFromAnchor:A,onPreviewTimestampChange:I,getRenderIdTop:N,revealRenderId:ne,searchState:L}){var ge;const{t:$}=Kt(),[j,G]=n.useState(null),[B,Me]=n.useState(null),ve=n.useRef(null),ye=n.useRef(!1),Ye=n.useRef(!1),[pe,Ze]=n.useState(null),[q,se]=n.useState(null),de=n.useRef(null),[Te,qe]=n.useState(!1),[tt,At]=n.useState(null),Le=n.useRef(t),z=n.useRef(null),Re=n.useRef(null),be=n.useRef("scroll"),_=n.useRef(0),y=n.useRef(null),H=n.useRef([]),Z=i??tt,ae=L?1:Qi,ee=Te||!!L||!!Z||B!==null,He=n.useCallback(()=>s?s():t,[t,s]),Ae=n.useCallback(()=>{if(!ee){Le.current=[],G(null);return}const m=He();Le.current=m;const S=wi(m,o.current,ae,N);G(K=>(K==null?void 0:K.signature)===(S==null?void 0:S.signature)?K:S)},[N,o,ae,He,ee]),Se=n.useCallback(()=>{if(!ee){G(null);return}const m=Fn(o.current);if(!m){G(null);return}G(S=>{if(!S)return wi(Le.current,o.current,ae,N);const K=id(S,m);return S.signature===K.signature?S:K})},[N,o,ae,ee]),Fe=n.useCallback((m="scroll")=>{if(m==="full"&&(be.current="full"),z.current!==null)return;const S=xi();z.current=S.request(()=>{z.current=null;const K=be.current;be.current="scroll",K==="full"?Ae():Se()})},[Ae,Se]);n.useEffect(()=>{ee?Fe("full"):(Le.current=[],G(null))},[Fe,ee]),n.useEffect(()=>{const m=o.current,S=Fn(m);if(!m||!S){G(null);return}const K=D=>{if(L||Ye.current)return;const me=S.getBoundingClientRect(),ze=D.clientY>=me.top&&D.clientY<=me.bottom,rt=D.clientX>=me.right-pi&&D.clientX<=me.right+pi,lt=ze&&rt;qe(ot=>ot===lt?ot:lt)},ue=()=>{Ye.current||L||qe(!1)};return S.addEventListener("pointermove",K,{passive:!0}),S.addEventListener("pointerleave",ue),()=>{S.removeEventListener("pointermove",K),S.removeEventListener("pointerleave",ue)}},[o,L]),n.useEffect(()=>{var me;if(!ee){G(null);return}const m=o.current,S=Fn(m);if(!m||!S){G(null);return}const K=()=>Fe("scroll"),ue=()=>Fe("full");S.addEventListener("scroll",K,{passive:!0}),window.addEventListener("resize",ue),(me=window.visualViewport)==null||me.addEventListener("resize",ue);const D=new ResizeObserver(ue);return D.observe(m),D.observe(S),Fe("full"),()=>{var ze;S.removeEventListener("scroll",K),window.removeEventListener("resize",ue),(ze=window.visualViewport)==null||ze.removeEventListener("resize",ue),D.disconnect(),z.current!==null&&(xi().cancel(z.current),z.current=null),be.current="scroll"}},[o,Fe,ee]),n.useEffect(()=>()=>{y.current!==null&&clearTimeout(y.current),Re.current!==null&&cancelAnimationFrame(Re.current)},[]);const Ve=n.useCallback(m=>{y.current!==null&&clearTimeout(y.current),_.current+=1,At({direction:m,token:_.current}),y.current=setTimeout(()=>{At(null),y.current=null},Xu)},[]),st=n.useCallback((m,S=m)=>{const K=o.current,ue=Fn(K),D=It(K,S),me=D?null:N==null?void 0:N(S);if(!ue||!D&&me==null)return;c==null||c();const ze=ue.getBoundingClientRect(),rt=D==null?void 0:D.getBoundingClientRect(),lt=Math.max(0,rt?ue.scrollTop+rt.top-ze.top-12:(me??0)-12),ot=lt<ue.scrollTop?"up":"down";Ve(ot),D||ne==null||ne(S),ue.scrollTo({top:lt,behavior:"auto"}),Re.current!==null&&cancelAnimationFrame(Re.current),Re.current=requestAnimationFrame(()=>{Re.current=null;const Et=o.current,Bt=Fn(Et),_e=It(Et,S);if(Bt&&_e){const re=Bt.getBoundingClientRect(),$e=_e.getBoundingClientRect();Bt.scrollTop=Math.max(0,Bt.scrollTop+$e.top-re.top-12)}Fe("full")})},[N,o,c,ne,Fe,Ve]),en=n.useCallback((m,S=m)=>{if(L&&l){l(m,S);return}st(m,S)},[st,l,L]),_t=!!(g||v||M||d||A),le=n.useCallback((m,S,K,ue)=>{Ye.current=!0,Ze(null),se(null),qe(!0),Me({id:m,targetId:S,x:K,y:ue})},[]),he=n.useCallback(()=>{Ye.current=!1,Me(null)},[]),U=n.useCallback(()=>{ve.current&&(clearTimeout(ve.current),ve.current=null)},[]),pt=n.useCallback((m,S,K)=>{_t&&(m.preventDefault(),le(S,K,m.clientX,m.clientY))},[_t,le]),hn=n.useCallback((m,S,K)=>{if(!_t)return;const ue=m.touches[0];if(!ue)return;const{clientX:D,clientY:me}=ue;U(),ve.current=setTimeout(()=>{ye.current=!0,window.setTimeout(()=>{ye.current=!1},800),le(S,K,D,me)},450)},[_t,U,le]);n.useEffect(()=>{if(!B)return;const m=S=>{S.key==="Escape"&&he()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[B,he]),n.useEffect(()=>()=>U(),[U]);const we=n.useCallback(()=>ye.current?(ye.current=!1,!0):!1,[]),te=n.useCallback(m=>{L&&m.preventDefault()},[L]),vt=n.useCallback((m,S=!0)=>{if(Ye.current)return;Ze(ue=>ue===m?ue:m),S&&se(ue=>{const D=H.current,me=D.indexOf(m),ze=me===0||me===D.length-1;return me===-1||ze?m:ue});const K=j==null?void 0:j.markers.find(ue=>ue.id===m);I==null||I((K==null?void 0:K.timestampMs)??null)},[j==null?void 0:j.markers,I]),Ht=n.useCallback((m,S)=>{if(L&&S){const K=de.current;if(K&&K.id!==m&&Math.abs(S.clientY-K.clientY)<=Ju)return;(!K||K.id!==m)&&(de.current={id:m,clientY:S.clientY})}vt(m)},[vt,L]),at=n.useCallback(()=>{de.current=null,Ze(null),se(null),I==null||I(null)},[I]);n.useLayoutEffect(()=>{const m=new Set((j==null?void 0:j.markers.map(S=>S.id))??[]);U(),pe&&!m.has(pe)?at():q&&!m.has(q)&&se(null),de.current&&!m.has(de.current.id)&&(de.current=null),B&&!m.has(B.id)&&he(),H.current=H.current.filter(S=>m.has(S))},[U,at,he,j,B,pe,q]);const tn=(L==null?void 0:L.activeId)??null;n.useEffect(()=>{at()},[at,tn]),n.useEffect(()=>{j||I==null||I(null)},[j,I]),n.useEffect(()=>()=>{I==null||I(null)},[I]);const Be=n.useMemo(()=>{if(!j)return[];const m=L==null?void 0:L.matchIds;if(!!m&&m.size>0){const me=j.markers.filter(_e=>m.has(_e.id)),ze=q&&m.has(q)?q:L.activeId,rt=ld(me,ze,j.height),lt=pe&&m.has(pe)?pe:null,ot=rt.map(_e=>Mt(_e.renderTopPct*j.height,Tt,Math.max(Tt,j.height-Tt))),Et=rt.length>1&&(rt.length*Qr>j.height||ot.some((_e,re)=>re>0&&_e-(ot[re-1]??_e)<Qr)),Bt=rt.map((_e,re)=>{const $e=ot[re]??Tt,ut=L.previewsById.get(_e.id)??(_e.id===L.activeId?L.preview:null)??_e.preview,nn=_e.id===lt;return{id:_e.id,targetId:_e.targetId??_e.id,topPx:$e,text:ut,compact:Et,short:!Et&&gi(ut),active:_e.id===L.activeId,expanded:nn,verticalAnchor:"center",pinned:nn&&_e.id===pe}});return cd(Bt,j.height,Et)}const K=pe?j.markers.find(me=>me.id===pe):null;if(!K)return[];const ue=Mt(K.renderTopPct*j.height,Tt,Math.max(Tt,j.height-Tt)),D=Zi(ue,j.height,Uu);return[{id:K.id,targetId:K.targetId??K.id,topPx:D.topPx,text:K.preview,compact:!1,short:gi(K.preview),active:!1,expanded:!1,verticalAnchor:D.verticalAnchor,pinned:!1}]},[j,pe,q,L]);if(n.useEffect(()=>{H.current=Be.map(m=>m.id)},[Be]),!j)return null;const mn=(L==null?void 0:L.activeId)??j.activeId,et=L==null?void 0:L.matchIds,bt=!!et&&et.size>0,Q=!!et&&et.size===1,Vt=bt?j.markers.filter(m=>et.has(m.id)):j.markers,yt=(ge=Vt[Vt.length-1])==null?void 0:ge.id;return a.jsxs("nav",{className:fe.root,"aria-label":"Turn navigation","data-turn-rail":"",style:{top:`${j.top}px`,right:`${j.right}px`,height:`${j.height}px`,"--user-turn-nav-preview-max-width":`${j.previewMaxWidthPx}px`,"--user-turn-nav-search-preview-collapsed-height":`${Yi}px`},onMouseLeave:at,children:[a.jsxs("div",{className:fe.track,children:[a.jsx("div",{className:fe.thumb,style:{top:`${j.thumbTopPct*100}%`,height:`${j.thumbHeightPct*100}%`}}),Z&&a.jsx("span",{className:[fe.motionCue,Wu[Z.direction]].filter(Boolean).join(" "),style:{top:`${j.thumbTopPct*100}%`}},Z.token),Vt.map(m=>a.jsxs("span",{children:[a.jsx("button",{type:"button",className:[fe.marker,m.id===mn?fe.active:"",m.id===yt?fe.latest:"",bt&&et.has(m.id)?fe.searchMatch:"",bt&&!et.has(m.id)?fe.searchNonmatch:""].filter(Boolean).join(" "),style:{top:`${m.renderTopPct*100}%`,height:`${m.hitPx}px`,marginTop:`${-m.hitPx/2}px`},"aria-label":`${$("turnNotchJumpToTurn")}: ${m.preview}`,title:m.preview,onClick:()=>{we()||en(m.id,m.targetId)},onContextMenu:S=>pt(S,m.id,m.targetId??m.id),onTouchStart:S=>hn(S,m.id,m.targetId??m.id),onTouchEnd:U,onTouchMove:U,onFocus:()=>vt(m.id),onBlur:at,onMouseDown:te,onPointerEnter:S=>Ht(m.id,S),onPointerMove:S=>Ht(m.id,S),onPointerDown:S=>Ht(m.id,S),children:a.jsx("span",{className:fe.markerLine})}),d&&((h==null?void 0:h(m.id))??!0)&&a.jsx("button",{type:"button",className:fe.trimMarker,style:{top:`${m.renderTopPct*100}%`,height:`${m.hitPx}px`,marginTop:`${-m.hitPx/2}px`},"aria-label":`${$("turnNotchShowFromTurn")}: ${m.preview}`,onClick:()=>{we()||d(m.id)},onContextMenu:S=>pt(S,m.id,m.targetId??m.id),onTouchStart:S=>hn(S,m.id,m.targetId??m.id),onTouchEnd:U,onTouchMove:U,onFocus:()=>vt(m.id),onBlur:at,onPointerEnter:S=>Ht(m.id,S),onPointerMove:S=>Ht(m.id,S),onPointerDown:S=>Ht(m.id,S),children:a.jsx("span",{className:fe.trimDot})})]},m.id)),Be.map(m=>a.jsx("button",{type:"button",className:[fe.preview,bt?fe.searchPreview:"",Q?fe.singleSearchMatch:"",m.compact?fe.compact:"",m.short?fe.short:"",m.active?fe.searchActive:"",m.expanded?fe.expanded:"",m.pinned?fe.pinnedExpanded:""].filter(Boolean).join(" "),style:{top:`${m.topPx}px`,"--user-turn-nav-preview-translate-y":ad(m.verticalAnchor)},"aria-label":m.text,title:m.text,onClick:()=>en(m.id,m.targetId),onContextMenu:S=>{!bt||!l||(S.preventDefault(),S.stopPropagation(),l(m.id,m.targetId,!0))},onMouseDown:te,onFocus:()=>vt(m.id,!1),onBlur:at,onPointerEnter:()=>vt(m.id,!1),onPointerMove:()=>vt(m.id,!1),children:bt?rd(m,L):m.text},Q&&L?`${m.id}:${L.query}`:m.id))]}),B&&sr.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:fe.contextOverlay,"aria-label":$("turnNotchDismissMenu"),onClick:he,onContextMenu:m=>{m.preventDefault(),he()}}),a.jsxs("div",{className:fe.contextMenu,role:"menu",style:{top:Math.min(B.y,window.innerHeight-220),right:Math.max(8,window.innerWidth-B.x)},children:[a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{en(B.id,B.targetId),he()},children:$("turnNotchJump")}),g&&((x==null?void 0:x(B.id))??!0)&&a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{g(B.id),he()},children:$("turnNotchForkBefore")}),v&&((b==null?void 0:b(B.id))??!0)&&a.jsx("button",{type:"button",role:"menuitem",disabled:C,title:C?$("forkTurnAfterDisabled"):void 0,onClick:()=>{v(B.id),he()},children:$("turnNotchForkAfter")}),M&&((F==null?void 0:F(B.id))??!0)&&a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{M(B.id),he()},children:$("turnNotchCopy")}),d&&((h==null?void 0:h(B.id))??!0)&&a.jsx("button",{type:"button",role:"menuitem",onClick:()=>{d(B.id),he()},children:$("turnNotchShowFrom")}),A&&a.jsx("button",{type:"button",role:"menuitem",onMouseDown:m=>{m.button===1&&m.preventDefault()},onClick:()=>{A(B.id,{newTab:!1}),he()},onAuxClick:m=>{m.button===1&&(m.preventDefault(),A(B.id,{newTab:!0}),he())},children:$("turnNotchHandoffFrom")})]})]}),document.body)]})}),dd="_queuedBubble_1co4s_1",fd="_projectQueueBubble_1co4s_11",hd="_clearloopBadge_1co4s_16",zs={queuedBubble:dd,projectQueueBubble:fd,clearloopBadge:hd},md=[],pd=120,gd=90,xd=12,wd=32,Td=1500,vd=180,bd=8,$r=new Set,Wr={display:"block",height:0,overflow:"hidden",pointerEvents:"none"};function ec(e){if(e.kind!=="assistant"||!("rows"in e))return e.kind==="empty"?0:1;const t=e.rows;return Array.isArray(t)?Math.max(1,t.length):1}function yd(e){if(e.kind==="btw")return[`btw-${e.aside.id}`];if(e.kind==="empty")return[];if(e.kind==="standalone"||e.kind==="user")return[e.item.id];const t=new Set(e.group.items.map(s=>s.id));for(const s of e.rows)s.kind==="explored"?t.add(s.id):t.add(s.item.id);return[...t]}function vi(e,t){let s=Math.min(e.length,Math.max(0,t)),o=0;for(;s>0&&o<bd;){s-=1;const i=e[s];i&&(o+=ec(i))}return s}function Ed(e,t){var o,i;const s=t.length-e.length;if(s<=0)return 0;for(let c=0;c<e.length;c+=1)if(((o=e[c])==null?void 0:o.key)!==((i=t[c+s])==null?void 0:i.key))return 0;return s}function Rd(e,t){var l;const s=n.useRef({rows:e,start:0}),[o,i]=n.useState(0);let c=s.current;if(c.rows!==e){const d=(l=c.rows[c.start])==null?void 0:l.key,h=c.start>0&&d?e.findIndex(x=>x.key===d):-1,g=t?Ed(c.rows,e):0;h>=0?(c.rows=e,c.start=h):(c={rows:e,start:g>0?vi(e,g):0},s.current=c)}return n.useLayoutEffect(()=>{if(c.start<=0)return;const d=c,h=requestAnimationFrame(()=>{if(s.current!==d)return;const g=vi(d.rows,d.start);g!==d.start&&(s.current={...d,start:g},i(x=>x+1))});return()=>cancelAnimationFrame(h)},[c]),{active:c.start>0,revision:o,rows:c.rows.slice(c.start)}}function Sd(e,t){if(e.size!==t.size)return t;for(const s of t)if(!e.has(s))return t;return e}function cs(e,t,s,o={}){return!e.ctrlKey||e.metaKey||e.shiftKey||!o.allowAlt&&e.altKey||e.getModifierState("AltGraph")?!1:e.key.toLocaleLowerCase()===t||e.code===s}function Cd(e){return cs(e,"s","KeyS",{allowAlt:!0})&&e.altKey?"full":cs(e,"s","KeyS")?"all":cs(e,"r","KeyR",{allowAlt:!0})?"user":cs(e,"k","KeyK",{allowAlt:!0})&&e.altKey?"links":null}function kd(e,t,s){const o=e.getBoundingClientRect();let i=null;for(let c=0;c<t.length;c+=1){const l=t[c];if(!l||!ia(l,t[c+1]))continue;const d=ki(l.items);if(!d)continue;const h=s.get(d.id);if(!h)continue;const g=h.getBoundingClientRect();g.bottom>=o.top&&g.bottom<=o.bottom&&(i=Lt(d.sourceMessages))}return i}function Id(e,t,s){const o=e.getBoundingClientRect(),i=o.top+o.height/2,c=new Map;for(const d of t){const h=Lt(d.sourceMessages);h!==null&&c.set(d.id,h)}let l=null;for(const d of s){const h=d.dataset.renderId;if(!h)continue;const g=c.get(h);if(g===void 0)continue;const x=d.getBoundingClientRect();if(!(x.bottom>=o.top&&x.top<=o.bottom))continue;const b=x.top<=i&&x.bottom>=i?0:Math.min(Math.abs(x.top-i),Math.abs(x.bottom-i));(!l||b<=l.distance)&&(l={distance:b,timestampMs:g})}return(l==null?void 0:l.timestampMs)??null}function Md(e,t,s,o){const i=Array.from(e.querySelectorAll("[data-render-id]")),c=new Map;for(const l of i){const d=l.dataset.renderId;d&&!c.has(d)&&c.set(d,l)}return kd(t,s,c)??Id(t,o,i)}const Ad=760,_d=120,Pd=520,jd=.45,bi=[50,120,240,480,960,1600,2400],yi=[80,240,640],Nd=6,Ld=12,Xs=1,Ei=new Set,Hd="button, input, textarea, select, a[href], [contenteditable='true']",Bd="input, textarea, select, [contenteditable='true']";function Wt(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function Kr(e){const t=Math.min(Pd,Math.max(_d,e.clientHeight*jd));return e.scrollHeight-e.scrollTop-e.clientHeight<t}const as=4,Od=200;function Js(e,t){const s=t.lastElementChild;return s?s.getBoundingClientRect().bottom<=e.getBoundingClientRect().bottom+as:e.scrollHeight-e.scrollTop-e.clientHeight<=as}function Dd(e,t){return e instanceof Node&&t.contains(e)}function is(e){return e instanceof Element&&e.closest(Hd)!==null}function qd(e){return e instanceof Element&&e.closest(Bd)!==null}function Fd(e,t,s,o,i){const c=s.getBoundingClientRect(),l=s.scrollTop,d=l+s.clientHeight,h=l+Ld;let g=null;for(const x of e){const v=x.targetId??x.id,b=It(t,v),C=b==null?void 0:b.getBoundingClientRect(),M=C?s.scrollTop+C.top-c.top:i==null?void 0:i(v);if(M==null)continue;const F=C?M+C.height:M+1;M>=l-Xs&&F<=d+Xs||(o==="previous"&&M<h-Xs&&(!g||M>g.top)&&(g={id:v,top:M}),o==="next"&&M>h+Xs&&(!g||M<g.top)&&(g={id:v,top:M}))}return(g==null?void 0:g.id)??null}function $d(e){const t=!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!qd(e.target);if(t&&(e.key==="Home"||e.code==="Home"))return"previous";if(t&&(e.key==="End"||e.code==="End"))return"next";if(e.altKey&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.getModifierState("AltGraph")){if(e.key==="ArrowUp"||e.code==="ArrowUp")return"previous";if(e.key==="ArrowDown"||e.code==="ArrowDown")return"next"}return null}function Wd(){var e;try{return((e=globalThis.localStorage)==null?void 0:e.getItem(or.sessionThinkingVisible))!=="false"}catch{return!0}}function Vr(e){var t;try{(t=globalThis.localStorage)==null||t.setItem(or.sessionThinkingVisible,e?"true":"false")}catch{}}function Kd(){var e;try{return((e=globalThis.localStorage)==null?void 0:e.getItem(or.sessionThinkingLatestOnly))==="true"}catch{return!1}}function Ri(e){var t;try{(t=globalThis.localStorage)==null||t.setItem(or.sessionThinkingLatestOnly,e?"true":"false")}catch{}}function Vd(e){return e==="pi"}function Gd(e,t){const s=Da(e,t);return s==="now"?"now":`${s} ago`}function Ud({isPatient:e,lanePosition:t,timestampMs:s,nowMs:o}){if(e){const c=s!==null?Gd(s,o):null,d=[(t==null?void 0:t.patientIndex)===void 0?"":t.patientIndex===0?"waiting":`#${t.patientIndex+1}`,c].filter(Boolean).join(", ");return d?`Patient (${d})`:"Patient queued"}const i=(t==null?void 0:t.regularIndex)??0;return i===0?"Queued (next regular)":`Queued regular (#${i+1})`}function tc({size:e=14}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]})}function Qd({size:e=14}){return a.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 20h9"}),a.jsx("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function rr({size:e=14}){return a.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m8 5 11 7-11 7V5Z"})})}function Yd({aside:e,onFocus:t,onDone:s,onStop:o,onToggleExpanded:i,onTransferTurn:c}){var h;const{t:l}=Kt(),d=!!(e.request||e.followUps.length>0||e.responses.length>0||(((h=e.turns)==null?void 0:h.length)??0)>0);return a.jsxs("div",{className:`btw-aside-card btw-aside-card-history is-${e.status} ${e.isFocused?"is-focused":""}`,"data-render-id":`btw-${e.id}`,children:[a.jsxs("button",{type:"button",className:"btw-aside-main",onClick:()=>t==null?void 0:t(e.id),children:[a.jsxs("span",{className:"btw-aside-meta",children:["/btw ",e.status]}),a.jsx("span",{className:"btw-aside-request",children:e.request||"New aside"}),e.followUps.length>0&&a.jsxs("span",{className:"btw-aside-followups",children:["+",e.followUps.length," follow-up",e.followUps.length===1?"":"s"]}),e.preview&&a.jsx("span",{className:"btw-aside-preview",children:e.preview}),e.error&&a.jsx("span",{className:"btw-aside-error",children:e.error})]}),e.expanded&&d&&a.jsx(ja,{aside:e,autoScrollLatest:!0,onTransferToComposer:c}),a.jsxs("div",{className:"btw-aside-actions",children:[d&&a.jsx("button",{type:"button",className:"btw-aside-action",onClick:()=>i==null?void 0:i(e.id),children:e.expanded?"Less":"Show"}),e.isFocused?a.jsx("button",{type:"button",className:"btw-aside-action",onClick:s,title:l("btwAsideReturnComposerTitle"),children:"Done"}):a.jsx("button",{type:"button",className:"btw-aside-action",onClick:()=>t==null?void 0:t(e.id),children:"Focus"}),e.canStop&&a.jsx("button",{type:"button",className:"btw-aside-action btw-aside-action-stop",onClick:()=>o==null?void 0:o(e.id),title:e.isFocused?"Stop this /btw aside and return to the main session":"Stop this /btw aside",children:"Stop"})]})]})}function zd({progress:e}){var c;const{t}=Kt(),s=Hi(1e3),o=e.quietSince?Date.parse(e.quietSince):Number.NaN;if((c=e.projectBlockers)!=null&&c.length)return a.jsx(a.Fragment,{children:t("clearloopWaitingForProject",{blockers:e.projectBlockers.join(", ")})});if(Number.isNaN(o)||e.windowSeconds===void 0)return a.jsx(a.Fragment,{children:t("clearloopWorking")});const i=Math.max(0,Math.ceil((o+e.windowSeconds*1e3-s)/1e3));return a.jsx(a.Fragment,{children:t("clearloopCountdown",{seconds:String(i)})})}const Xd=()=>()=>{},Si=()=>!0;function Ci({variant:e,text:t,composerEditAvailabilityStore:s,itemCanEdit:o=!0,disabled:i=!1,onResume:c,onEdit:l,onSteer:d,steerLabel:h,onCancel:g,cancelLabel:x}){const{t:v}=Kt(),b=n.useSyncExternalStore((s==null?void 0:s.subscribe)??Xd,(s==null?void 0:s.getSnapshot)??Si,Si),C=o&&b,M=e==="project",F=v(M?"projectQueueInlineEdit":"sessionQueuedEdit"),A=x??v(M?"projectQueueInlineCancel":"sessionQueuedCancel");return a.jsxs("div",{className:"deferred-message-actions","data-queue-actions":e,children:[a.jsx(Gr,{text:t,label:v(M?"projectQueueInlineCopy":"sessionQueuedCopy"),className:"deferred-message-action deferred-message-action-copy",showTextLabel:!0,onClick:I=>I.stopPropagation()}),c?a.jsxs("button",{type:"button",className:"deferred-message-action deferred-message-action-resume",disabled:i,onClick:c,"aria-label":v("projectQueueResume"),children:[a.jsx(rr,{}),a.jsx("span",{children:v("projectQueueResume")})]}):null,C&&l?a.jsxs("button",{type:"button",className:"deferred-message-action deferred-message-action-edit",disabled:i,onClick:l,"aria-label":F,title:F,children:[a.jsx(Qd,{}),a.jsx("span",{children:v("projectQueueEdit")})]}):null,d?a.jsxs("button",{type:"button",className:"deferred-message-action deferred-message-action-steer",disabled:i,onClick:d,"aria-label":h??v("sessionSteerQueuedMessageNow"),title:h??v("sessionSteerQueuedMessageNow"),children:[a.jsx(rr,{}),a.jsx("span",{children:v("sessionSteerNow")})]}):null,g?a.jsxs("button",{type:"button",className:`deferred-message-action deferred-message-action-cancel ${M?"project-queue-inline-message-cancel":""}`,disabled:i,onClick:g,"aria-label":A,title:A,children:[a.jsx(tc,{}),a.jsx("span",{children:v("projectQueueCancel")})]}):null]})}const Jd=n.memo(function({row:t,isStreaming:s,sessionProvider:o,latestCorrectablePromptId:i,latestCorrectablePromptContent:c,onCorrectLatestUserMessage:l,onCancelUnconfirmedUserMessage:d,onTrimBeforeUserMessage:h,onForkBeforeUserMessage:g,onForkAfterUserMessage:x,onForkAfterSummaryUserMessage:v,canForkBeforePrompt:b,forkAfterUserMessageDisabled:C,forkUnavailableMessage:M,noopToggleThinkingExpanded:F,promptActionsDisabled:A}){const{item:I}=t;return a.jsx(Xr,{item:I,isStreaming:s,thinkingExpanded:!1,toggleThinkingExpanded:F,sessionProvider:o,onCorrectUserPrompt:t.isLatestCorrectable&&i&&c!==void 0?()=>l==null?void 0:l(i,c):void 0,onCancelUnconfirmedUserPrompt:d,onTrimBeforeUserPrompt:h&&t.allowsPromptActions&&!A?()=>h(I.id):void 0,onForkBeforeUserPrompt:g&&t.allowsPromptActions&&!A&&b(I.id)?()=>g(I.id):void 0,onForkAfterUserPrompt:x&&t.allowsPromptActions&&!A?()=>x(I.id):void 0,onForkAfterSummaryUserPrompt:v&&t.allowsPromptActions&&!A?()=>v(I.id):void 0,forkAfterUserPromptDisabled:C,forkUnavailableMessage:t.allowsPromptActions&&!A?M:void 0,staleNowMs:t.staleNowMs})}),Zd=n.memo(function({row:t,isStreaming:s,sessionProvider:o,getThinkingItemExpanded:i,toggleThinkingItemExpanded:c,noopToggleThinkingExpanded:l,onTrimBeforeUserMessage:d,onForkBeforeUserMessage:h,onForkAfterUserMessage:g,onForkAfterSummaryUserMessage:x,canForkBeforePrompt:v,forkAfterUserMessageDisabled:b,forkUnavailableMessage:C,handleQuoteTextBlock:M,alwaysShowQuoteCircles:F,paragraphQuoteCirclesEnabled:A,onToggleConversationActivity:I,widerConversationActivityPreviews:N,collapsedConversationThinkingPreviewSlots:ne,onToggleConversationThinkingPreview:L,onDismissConversationThinkingPreview:$,promptActionDisabledIds:j}){return a.jsx(oa,{items:t.group.items,children:t.rows.map(G=>{if(G.kind==="explored")return a.jsx(Au,{id:G.id,projection:G.projection,sessionProvider:o,staleNowMs:G.staleNowMs},G.id);const{item:B}=G;return a.jsx(Xr,{item:B,isStreaming:s,thinkingExpanded:i(B),toggleThinkingExpanded:G.allowsThinkingToggle?()=>c(B):l,sessionProvider:o,onTrimBeforeUserPrompt:d&&G.allowsPromptActions&&!j.has(B.id)?()=>d(B.id):void 0,onForkBeforeUserPrompt:h&&G.allowsPromptActions&&!j.has(B.id)&&v(B.id)?()=>h(B.id):void 0,onForkAfterUserPrompt:g&&G.allowsPromptActions&&!j.has(B.id)?()=>g(B.id):void 0,onForkAfterSummaryUserPrompt:x&&G.allowsPromptActions&&!j.has(B.id)?()=>x(B.id):void 0,forkAfterUserPromptDisabled:b,forkUnavailableMessage:G.allowsPromptActions&&!j.has(B.id)?C:void 0,onQuoteTextBlock:G.allowsTextQuote?M:void 0,alwaysShowQuoteCircle:F,paragraphQuoteCirclesEnabled:A,staleNowMs:G.staleNowMs,thinkingDurationMs:G.thinkingDurationMs,onToggleConversationActivity:I,widerConversationActivityPreviews:N,collapsedConversationThinkingPreviewSlots:ne,onToggleConversationThinkingPreview:L,onDismissConversationThinkingPreview:$},B.id)})})}),xh=n.memo(function({messages:t,transcriptDisplayObjects:s=md,provider:o,isStreaming:i=!1,isProcessing:c=!1,isCompacting:l=!1,scrollTrigger:d=0,scrollToTurnRequest:h=null,pendingMessages:g=[],deferredMessages:x=[],queuedEffortContext:v,projectQueueMessages:b=[],projectQueueDispatchPaused:C=!1,projectQueueDispatchMutating:M=!1,btwAsides:F=[],onFocusBtwAside:A,onDoneBtwAside:I,onStopBtwAside:N,onToggleBtwAsideExpanded:ne,onTransferBtwAsideTurn:L,onQuoteSelection:$,onStartNewSessionFromSelection:j,composerDraftSignal:G,composerEditAvailabilityStore:B,quoteClearSignal:Me=0,onCancelDeferred:ve,onCancelClearloop:ye,onEditDeferred:Ye,onCancelUnconfirmedUserMessage:pe,onSteerDeferred:Ze,onResumeRecoveredDeferred:q,onSteerRecoveredDeferred:se,onDeleteRecoveredDeferred:de,onCancelProjectQueueMessage:Te,onEditProjectQueueMessage:qe,onSteerProjectQueueMessage:tt,onResumeProjectQueueDispatch:At,onCorrectLatestUserMessage:Le,onTrimBeforeUserMessage:z,onForkBeforeUserMessage:Re,onForkAfterUserMessage:be,onForkAfterSummaryUserMessage:_,forkAfterUserMessageDisabled:y=!1,forkUnavailableMessage:H,onCopyUserMessage:Z,onHandoffFromUserMessage:ae,markdownAugments:ee,activeToolApproval:He,hasOlderMessages:Ae=!1,olderMessagesCursor:Se=null,totalMessageCount:Fe,activeWindowTrimRevision:Ve=0,loadingOlder:st=!1,olderLoadContinuationRequired:en=!1,onLoadOlderMessages:_t,onReadOlderSearchPage:le,clientTailActive:he=!1,progressiveRenderEnabled:U=!1,progressiveRenderStatusVisible:pt=!0,progressiveRenderKey:hn,progressiveRenderPauseSignal:we,conversationViewStateKey:te,conversationViewEnabledOverride:vt,showFollowButton:Ht=!0,followButtonPortalTarget:at,onFollowCurrent:tn,initialScrollSnapshot:Be=null,onScrollSnapshotChange:mn,onFollowingBottomChange:et,scrollBehaviorMode:bt=Ha,inert:Q=!1,transcriptPositionStore:Vt,onTranscriptPositionTimestampChange:yt,getForkSummaryTargetHref:ge,onCancelForkSummary:m,onToggleForkSummaryAutoOpen:S,onFollowForkSummary:K,bangCommandHandlers:ue}){var Yo,zo,Xo,Jo,Zo;const D=Va();Ga();const{recentProjectPathLinksEnabled:me}=qa(),{workflowTagsEnabled:ze}=ha(),{files:rt,resolve:lt}=$u(ze&&!Q),ot=Dn()?Wt():null,Et=t[0]?On(t[0]):null,[Bt,_e]=n.useState(oi),re=vt??Bt,$e=JSON.stringify([te,re]),[ut,nn]=n.useState(null),Ce=(ut==null?void 0:ut.stateKey)===$e?ut:null,vn=n.useCallback(()=>{nn(null)},[]),ir=n.useCallback((r,u)=>{var p;const f=new Set(u.messages.flatMap(R=>[R.uuid,R.id].filter(O=>typeof O=="string"&&O.length>0))),w=((p=u.session.transcriptDisplayObjects)==null?void 0:p.filter(R=>{var O;return R.placementAfterMessageId===""?((O=u.pagination)==null?void 0:O.hasOlderMessages)===!1:f.has(R.placementAfterMessageId)}))??[];nn({cursor:r,messages:u.messages,stateKey:$e,transcriptDisplayObjects:w})},[$e]);n.useLayoutEffect(()=>{(Q||ut&&ut.stateKey!==$e)&&vn()},[vn,$e,Q,ut]);const us=n.useMemo(()=>({activeWindowTrimRevision:Ve,firstMessageId:Et,messages:t,olderMessagesCursor:Se}),[Ve,Et,t,Se]),pn=n.useDeferredValue(us),Ot=pn.activeWindowTrimRevision===Ve&&pn.firstMessageId===Et&&pn.olderMessagesCursor===Se?pn.messages:t,X=n.useRef(null),ds=n.useRef(null),bn=n.useRef(null),yn=n.useRef(!1),En=n.useRef(()=>{}),Wn=n.useRef(!1),fs=n.useRef(Ce);fs.current=Ce;const Gt=n.useRef(null),T=n.useRef(null),E=n.useRef(!0),P=n.useRef(Q),k=n.useRef(!0),oe=n.useRef(null),J=n.useRef(!1),Ee=n.useRef(0),Oe=n.useRef(0),Dt=n.useRef(null),Ge=n.useRef(null),Ut=n.useRef([]),We=n.useRef(null),sn=n.useRef(null),Rn=n.useRef(null),Sn=n.useRef([]),Kn=n.useRef(null),Vn=n.useRef(null),hs=n.useRef(null),Qt=n.useRef(!1),Cn=n.useRef(!1),gn=n.useRef(c||i);gn.current=c||i;const ms=n.useRef(0),je=n.useRef(null),rn=n.useRef(!1),on=n.useRef(null),xn=n.useRef(null),cr=n.useRef(!1),Zr=n.useRef(!1),eo=n.useRef(Ve),ps=n.useRef(et);ps.current=et;const[Pt,ar]=n.useState(()=>{const r=ca();return r==="on"?!0:r==="off"?!1:Wd()}),[to,nc]=n.useState(0),lr=n.useRef(re),[kn,sc]=n.useState(ii),[In,ur]=n.useState({stateKey:te,bounded:!1,additionalTurns:0}),[no,rc]=n.useState(()=>new Set),[gs,xs]=n.useState(()=>({stateKey:te,collapsedSlots:new Set,dismissedSlots:new Set})),[so,ro]=n.useState({}),[Mn,oo]=n.useState(Kd),[io,co]=n.useState(()=>new Set),[oc,ao]=n.useState(null),ws=n.useMemo(Ma,[]),Yt=Vt??ws,lo=n.useRef(null),dr=n.useRef(null),Gn=n.useRef(null),gt=n.useCallback(()=>{Yt.publish(lo.current??dr.current??Gn.current)},[Yt]),[wn,jt]=n.useState(!0);n.useEffect(()=>()=>{Yt===ws?ws.dispose():Yt.publish(null)},[Yt,ws]),n.useEffect(()=>{if(!yt)return;yt(Yt.getSnapshot());const r=Yt.subscribe(()=>{yt(Yt.getSnapshot())});return()=>{r(),yt(null)}},[Yt,yt]);const[fr,An]=n.useState(!1),Ts=n.useMemo(()=>zc(),[te]),uo=n.useRef(null),fo=n.useRef(Ve),{t:ie}=Kt(),{widerConversationActivityPreviews:ic}=ma(),qt=Hi(),ho=!lr.current&&re,mo=In.stateKey===te&&In.bounded||ho,po=In.stateKey===te?In.additionalTurns:0,cc=gs.stateKey===te?gs.collapsedSlots:$r,go=gs.stateKey===te?gs.dismissedSlots:$r,it=n.useCallback(r=>{var u;(u=ps.current)==null||u.call(ps,r)},[]);n.useLayoutEffect(()=>{const r=lr.current;lr.current=re,!(In.stateKey===te&&r===re)&&ur({stateKey:te,bounded:!r&&re,additionalTurns:0})},[te,In.stateKey,re]);const De=n.useCallback((r,u="auto")=>{J.current=!0,We.current!==null&&(clearTimeout(We.current),We.current=null);const f=Math.max(0,r.scrollHeight-r.clientHeight);u==="auto"?r.scrollTop=f:r.scrollTo({top:f,behavior:u}),Ee.current=r.scrollHeight,Oe.current=f,jt(!0),it(!0),Gn.current=null,gt(),An(!1);const w=()=>{J.current=!1,We.current=null,Kr(r)&&(E.current=!0,jt(!0))};u==="smooth"?We.current=setTimeout(w,520):requestAnimationFrame(w),Ge.current!==null&&clearTimeout(Ge.current),Ge.current=setTimeout(()=>{if(Ge.current=null,E.current){J.current=!0;const p=Math.max(0,r.scrollHeight-r.clientHeight);u==="auto"?r.scrollTop=p:r.scrollTo({top:p,behavior:u}),Ee.current=r.scrollHeight,jt(!0),We.current===null&&requestAnimationFrame(()=>{J.current=!1})}},50)},[gt,it]),cn=n.useCallback(()=>{for(const r of Ut.current)clearTimeout(r);Ut.current=[]},[]),vs=n.useCallback(()=>{Ge.current!==null&&(clearTimeout(Ge.current),Ge.current=null)},[]),Ue=n.useCallback(r=>{oe.current=null,E.current=!1,Qt.current=!1,J.current=!1,We.current!==null&&(clearTimeout(We.current),We.current=null),vs(),cn(),r&&(Ee.current=r.scrollHeight),jt(!1),it(!1)},[vs,cn,it]),Ft=n.useCallback((r=bi,u={})=>{var w;oe.current=null,E.current=!0,u.allowThinkingDeltas&&(Qt.current=!0);const f=(w=X.current)==null?void 0:w.parentElement;f&&De(f),cn(),Ut.current=r.map(p=>setTimeout(()=>{var O;if(!E.current)return;const R=(O=X.current)==null?void 0:O.parentElement;R&&De(R)},p))},[cn,De]);n.useLayoutEffect(()=>{const r=c||i,u=Cn.current;Cn.current=r,u&&!r&&E.current&&Ft()},[c,i,Ft]);const ke=n.useMemo(()=>{const r=Wt();Vs("message_list_preprocess_start",{messages:Ot.length+((Ce==null?void 0:Ce.messages.length)??0),markdownAugments:Object.keys(ee??{}).length,hasActiveToolApproval:!!He});const u=ri({messages:Ot,provider:o,markdownAugments:ee,activeToolApproval:He,transcriptDisplayObjects:s,recoverUnanchoredBangCommands:!0,previousRenderItems:Sn.current,recentProjectPathLinksEnabled:me,workflowTagsEnabled:ze,workflowSchemaFiles:rt});let f=u;if(Ce){const p=new Set(Ot.map(V=>On(V))),R=Ce.messages.filter(V=>!p.has(On(V))),O=ri({messages:R,provider:o,transcriptDisplayObjects:Ce.transcriptDisplayObjects,previousRenderItems:Sn.current,recentProjectPathLinksEnabled:me,workflowTagsEnabled:ze,workflowSchemaFiles:rt});if(O.length>0){const V=Ce.cursor===Se?[]:[{type:"system",id:`history-search-gap:${Ce.cursor}`,subtype:"history_search_gap",content:ie("sessionSearchHistoryGap"),sourceMessages:[]}];f=[...O,...V,...u]}}const w=Wt()-r;return Vs("message_list_preprocess_end",{messages:Ot.length,renderItems:f.length,durationMs:w}),Dn()&&os("message-list.preprocess",{durationMs:w,count:1}),f},[Ot,Ce,Se,o,ee,He,s,me,ze,rt,ie]);n.useEffect(()=>{lt(ke)},[ke,lt]),n.useEffect(()=>{Sn.current=ke},[ke]);const hr=n.useMemo(()=>{if(!Ce)return Ei;const r=new Set(Ot.map(f=>On(f))),u=new Set;for(const f of Ce.messages){const w=On(f);w&&!r.has(w)&&u.add(w)}return u},[Ce,Ot]),_n=n.useMemo(()=>hr.size===0?Ei:new Set(ke.flatMap(r=>r.sourceMessages.some(u=>hr.has(On(u)))?[r.id]:[])),[hr,ke]);n.useEffect(()=>{const r=uo.current,u=fo.current!==Ve;uo.current=ke.length,fo.current=Ve,!(Ts.size===0||!u&&r!==null&&ke.length>=r)&&Ts.pruneOwners(new Set(ke.map(f=>f.id)))},[Ve,Ts,ke]);const ac=n.useMemo(()=>il(ke),[ke])>0,xo=n.useCallback(r=>io.has(r),[io]),wo=n.useMemo(()=>cl(ke),[ke]),Pn=n.useCallback(r=>{const u=so[r];return u!==void 0?u:Mn?r===wo:xo(r)},[xo,wo,so,Mn]),Un=Xc(),{expandedRewoundGroups:To}=Un,Qn=n.useMemo(()=>Jc(ke,{thinkingItemsVisible:Pt,expandedRewoundGroups:To}),[To,ke,Pt]),Xe=n.useMemo(()=>re&&mo&&!Ce?Aa(Qn,kn+po):{hiddenTurnCount:0,items:Qn,visibleTurnCount:0},[po,kn,re,mo,Qn,Ce]),vo=n.useRef([]),Qe=n.useMemo(()=>{if(!re)return Qn;const r=Wt(),u=_a(Xe.items,{active:c||i,dismissedThinkingPreviewSlots:go,expandedActivityIds:no,nowMs:qt});return Dn()&&os("message-list.conversation-projection",{durationMs:Wt()-r,category:c||i?"active":"idle"}),Zc(vo.current,u)},[Xe.items,go,re,no,Qn,c,i,qt]);n.useEffect(()=>{vo.current=re?Qe:[]},[Qe,re]);const bo=n.useRef($r),bs=n.useMemo(()=>{const r=new Set;for(const u of Qe)if(u.type==="conversation_activity")for(const f of u.thinkingPreviews??[])r.add(f.slot);return Sd(bo.current,r)},[Qe]);n.useEffect(()=>{bo.current=bs},[bs]),n.useLayoutEffect(()=>{var w;const r=Kn.current,u=al(ke),f=ll({isThinkingItemExpanded:Pn,nextTextLengths:u,previousTextLengths:r,thinkingItemsVisible:Pt});Kn.current=u,f&&!Qt.current&&Ue((w=X.current)==null?void 0:w.parentElement)},[ke,Pn,Ue,Pt]),n.useLayoutEffect(()=>{const r=Vn.current,u=ui(ke);Vn.current=u;const f=u.size>0&&Vd(o)&&hs.current!==o;f&&(hs.current=o??null),co(w=>ul({currentThinkingIds:u,previouslyObservedThinkingIds:r,previousExpandedIds:w,seedHistoricalThinking:f}))},[o,ke]);const yo=n.useRef([]),an=n.useMemo(()=>{const r=Wt(),u=ea(yo.current,zr(Qe)),f=Wt()-r;return Vs("message_list_group_end",{renderItems:Qe.length,turnGroups:u.length,durationMs:f}),Dn()&&os("message-list.group",{durationMs:f}),u},[Qe]);n.useEffect(()=>{yo.current=an},[an]),n.useLayoutEffect(()=>{Vs("message_list_commit_effect",{messages:Ot.length,renderItems:Qe.length,turnGroups:an.length}),Dn()&&os("message-list.commit",{durationMs:ot===null?0:Wt()-ot,category:re?"conversation-view":"full-transcript"})});const{active:xt,scope:ys,visibleTurnGroups:Eo,cancelSearchTargetPreparation:Ro,getNavigatorAnchors:mr,searchState:ln,renderSearchPanel:lc,closeSearch:Yn,getSelectedSearchAnchorId:pr,getSelectedSearchTargetId:gr,handleSearchArrowKey:So,moveSearchSelection:Co,openSearch:Es,prepareSearchTarget:Rs,selectSearchMatch:ko,stopSearchArrowRepeat:jn}=Xl({containerRef:X,conversationViewEnabled:re,displayRenderItems:Qe,hasOlderMessages:Ae,historySearchCursor:Se,loadedMessageCount:t.length,totalMessageCount:Fe,historySearchContextKey:$e,hydratedHistoryCursor:(Ce==null?void 0:Ce.cursor)??null,inert:Q,onHydrateHistorySearchPage:ir,onReadOlderSearchPage:le,provider:o,recentProjectPathLinksEnabled:me,thinkingItemsVisible:Pt,turnGroups:an});Wn.current=xt;const zn=n.useRef(Qe);zn.current=Qe;const ct=Dc(),Ss=ct==null?void 0:ct.observe;n.useLayoutEffect(()=>{Q||Ss==null||Ss(Qe)},[Qe,Q,Ss]);const xr=n.useRef(an);xr.current=an;const Nn=n.useCallback(r=>{const u=X.current,f=u==null?void 0:u.parentElement;if(!u||!f)return!1;let w=!1;const p=r.anchor;if(p){const R=It(u,p.id),O=R?null:ru(u,p,zn.current),V=R??O;V&&(Ur(f,V,p.topOffset),w=!0)}if(!w){const R=Math.max(0,f.scrollHeight-f.clientHeight);f.scrollTop=Math.min(r.scrollTop,R)}return Ee.current=f.scrollHeight,!0},[]),Io=n.useMemo(()=>pu(an),[an]),Cs=n.useCallback(()=>{const r=X.current,u=r==null?void 0:r.parentElement;if(!r||!u)return;if(Js(u,r)){Gn.current=null,gt();return}const f=Dn()?Wt():null,w=Md(r,u,xr.current,zn.current);f!==null&&os("message-list.scroll-position",{durationMs:Wt()-f,category:"settled"}),Gn.current=w,gt()},[gt]),ks=n.useCallback((r,u)=>{const f=Js(r,u),w=tr(u,r,zn.current)??void 0,p=new Map;for(const V of u.querySelectorAll("[data-render-id]")){const ce=V.dataset.renderId;ce&&!p.has(ce)&&p.set(ce,V)}const R=mu({scrollContainer:r,groups:xr.current,rowsById:p,allItems:zn.current,turnActive:gn.current}),O=R.anchor??w;return{atBottom:f,scrollTop:r.scrollTop,scrollHeight:r.scrollHeight,clientHeight:r.clientHeight,...O?{anchor:O}:{},...R.completedTurn?{completedTurn:R.completedTurn}:{},...R.seenTurn?{seenTurn:R.seenTurn}:{},following:E.current,updatedAtMs:Date.now()}},[]);n.useEffect(()=>{wn&&(Gn.current=null,gt())},[wn,gt]);const Mo=n.useMemo(()=>{const r=new Map;for(const u of Qe){const f=Oa(u.sourceMessages);f!==null&&r.set(u.id,f)}return r},[Qe]),uc=n.useCallback(r=>{var w,p,R,O;if(r.pointerType&&r.pointerType!=="mouse")return;let u=((p=(w=r.target)==null?void 0:w.closest)==null?void 0:p.call(w,"[data-render-id]"))??null,f=null;for(;u;){const V=u.dataset.renderId,ce=V?Mo.get(V):void 0;if(ce!==void 0){f=ce;break}u=((O=(R=u.parentElement)==null?void 0:R.closest)==null?void 0:O.call(R,"[data-render-id]"))??null}dr.current=f,gt()},[gt,Mo]),dc=n.useCallback(()=>{dr.current=null,gt()},[gt]),fc=n.useCallback(r=>{lo.current=r,gt()},[gt]),{anchoredRenderIds:Ao,alwaysShowQuoteCircles:hc,paragraphQuoteCirclesEnabled:mc,handleQuoteTextBlock:_o,mobileSelectionActions:pc,floatingSelectionActions:gc,selectionContextMenu:xc}=qc({containerRef:X,inert:Q,onQuoteSelection:$,onStartNewSessionFromSelection:j,composerDraftSignal:G,quoteClearSignal:Me,isInteractiveTarget:is}),Is=n.useMemo(()=>ta({asides:F,deferredMessages:x,displayRenderItems:Qe,pendingMessages:g,projectQueueMessages:b}),[Qe,g,x,b,F]),wc=n.useMemo(()=>sl({deferredMessages:x,latestVisibleTimestampMs:Is,nowMs:qt,pendingMessages:g,projectQueueMessages:b,staleThresholdMs:Li}),[g,x,b,Is,qt]),Rt=n.useMemo(()=>Le?Pa(ke):null,[ke,Le]),dt=n.useMemo(()=>dl({asides:F,turnGroups:Eo}),[F,Eo]),un=U&&!xt&&dt.length>0,Pe=hn??"default",$t=n.useMemo(()=>un?fl(dt,pd):dt.length,[un,dt]),[wr,Ln]=n.useState(null),[Ms,Xn]=n.useState(null),[Tc,As]=n.useState(!1),[Tr,_s]=n.useState(null),vr=n.useRef(null),Jn=Q||(we==null?void 0:we.current)===!0||Gs(D),Ps=Jn&&(we==null?void 0:we.supportsCompaction)===!0,zt=Tr===Pe;n.useLayoutEffect(()=>(we&&(we.supportsCompaction=U&&wn),()=>{we&&(we.supportsCompaction=!1)}),[wn,U,we]),n.useLayoutEffect(()=>{!un||!Ps||(Tr!==Pe&&_s(Pe),vr.current=null,Ms!==Pe&&Xn(Pe),wr!==$t&&Ln($t))},[wr,$t,un,Ps,Pe,Ms,Tr]);const Po=Ms===Pe?Ps?$t:wr:null,vc=Ms===Pe?Tc:!1,bc=un&&Rn.current===Pe,Nt=un&&!bc&&!vc,Xt=Nt||zt,jo=Xt||Ps,{effectiveEntryCount:js,entries:No,percent:br}=n.useMemo(()=>ml({entries:dt,entryCount:Po,initialEntryCount:$t,revealActive:jo}),[Po,$t,jo,dt]),Lo=n.useRef([]),Hn=n.useMemo(()=>{const r=gl({entries:No,latestCorrectablePromptId:(Rt==null?void 0:Rt.id)??null,latestVisibleTimestampMs:Is,nowMs:qt});return Tl(Lo.current,r)},[No,Rt==null?void 0:Rt.id,Is,qt]);n.useEffect(()=>{Lo.current=Hn},[Hn]);const Bn=Rd(Hn,T.current!==null),Zn=La({mode:bt,snapshot:Be,topTolerancePx:as}),yc=((zo=(Yo=T.current)==null?void 0:Yo.anchor)==null?void 0:zo.id)??((Jo=(Xo=oe.current)==null?void 0:Xo.anchor)==null?void 0:Jo.id)??(k.current&&Zn==="restore-position"?((Zo=Be==null?void 0:Be.anchor)==null?void 0:Zo.id)??null:null),Ne=uu({containerRef:X,followTail:wn||E.current,getRowTargetIds:yd,getRowWeight:ec,pinnedRenderId:yc,retainedRenderIds:n.useMemo(()=>[...Ao,...(ct==null?void 0:ct.retainedRenderIds)??[]],[Ao,ct==null?void 0:ct.retainedRenderIds]),rows:Bn.rows}),Ho=n.useMemo(()=>{for(const r of Hn){if(r.kind==="user"&&r.allowsPromptActions)return r.item.id;if(r.kind!=="assistant")continue;const u=r.rows.find(f=>f.kind==="item"&&f.allowsPromptActions);if((u==null?void 0:u.kind)==="item")return u.item.id}return null},[Hn]),yr=n.useCallback(r=>!_n.has(r)&&(r!==Ho||Ae||he||Xe.hiddenTurnCount>0),[he,Xe.hiddenTurnCount,Ho,Ae,_n]),Er=n.useCallback(r=>!_n.has(r),[_n]);n.useEffect(()=>{if(!un){if(xt)return;sn.current=null,_s(null),Xn(null),Ln(null),As(!0);return}if(!zt&&Rn.current===Pe){sn.current=null,Xn(Pe),Ln(dt.length),As(!0);return}sn.current!==Pe&&(sn.current=Pe,Xn(Pe),Ln($t),As(!1))},[$t,un,Pe,zt,xt,dt.length]),n.useEffect(()=>{if(Jn||!Xt||js>=dt.length)return;const r=zt&&vr.current!==Pe?Td:wd,u=setTimeout(()=>{we!=null&&we.current||Gs(D)||(zt&&(vr.current=Pe),n.startTransition(()=>{Ln(f=>we!=null&&we.current||Gs(D)?f:hl(dt,f??$t,zt?xd:gd))}))},r);return()=>clearTimeout(u)},[js,$t,Xt,Jn,we,Pe,zt,D,dt]),n.useEffect(()=>{if(Jn||!Xt||js<dt.length)return;const r=setTimeout(()=>{we!=null&&we.current||Gs(D)||(zt?_s(null):(Rn.current=Pe,sn.current=null),Xn(Pe),Ln(dt.length),As(!0))},vd);return()=>clearTimeout(r)},[js,Xt,Pe,Jn,we,zt,D,dt.length]),n.useLayoutEffect(()=>{var f;const r=rn.current;if(rn.current=Xt,!r||Xt||!E.current)return;const u=(f=X.current)==null?void 0:f.parentElement;u&&De(u)},[Xt,De]);const Ns=Xt;cr.current=Ns;const ft=n.useCallback(()=>{if(cr.current||!mn)return;const r=X.current,u=r==null?void 0:r.parentElement;!r||!u||mn(ks(u,r))},[ks,mn]);n.useEffect(()=>{if(Q||!Io||!E.current||cr.current)return;const r=requestAnimationFrame(ft);return()=>cancelAnimationFrame(r)},[Q,Io,ft]);const es=n.useRef(null),Ls=n.useCallback(()=>{es.current!==null&&(clearTimeout(es.current),es.current=null)},[]),Bo=n.useCallback(()=>{Cs(),ft()},[ft,Cs]),Tn=n.useCallback(()=>{Ls(),es.current=setTimeout(()=>{es.current=null,Bo()},Od)},[Ls,Bo]);n.useEffect(()=>{if(!Q)return()=>{Ls(),ft()}},[Q,Ls,ft]),n.useEffect(()=>{const r=Zr.current;Zr.current=Ns,!(Q||Ns||!r)&&ft()},[Q,ft,Ns]),n.useLayoutEffect(()=>{var f;const r=eo.current;if(eo.current=Ve,Ve<=r)return;const u=(f=X.current)==null?void 0:f.parentElement;u&&E.current&&De(u),ft()},[Ve,ft,De]);const Ec=n.useCallback(r=>r.type==="thinking"&&Pn(r.id),[Pn]),Rc=n.useCallback(r=>{if(r.type!=="thinking")return;const u=!Pn(r.id);ro(f=>({...f,[r.id]:u}))},[Pn]),Rr=n.useCallback(()=>{},[]),Sr=n.useRef(null);n.useLayoutEffect(()=>{const r=Sr.current;Sr.current=null,r==null||r()});const Ke=n.useCallback((r,u,f=!1)=>{const w=X.current,p=w==null?void 0:w.parentElement;if(!w||!p){r();return}const R=!f&&Kr(p),O=p.scrollTop,V=p.scrollHeight,ce=!R&&u?It(w,u):null,W=R?null:ce&&u?{id:u,topOffset:ce.getBoundingClientRect().top-p.getBoundingClientRect().top}:tr(w,p),xe=()=>{const Je=X.current,nt=(Je==null?void 0:Je.parentElement)??p;if(J.current=!0,R){De(nt);return}let fn=!1;if(W&&Je){const St=It(Je,W.id);if(St){const Ct=nt.getBoundingClientRect(),ht=St.getBoundingClientRect();nt.scrollTop=Math.max(0,nt.scrollTop+ht.top-Ct.top-W.topOffset),fn=!0}}if(!fn){const St=nt.scrollHeight-V;nt.scrollTop=Math.max(0,O+St)}Ee.current=nt.scrollHeight,requestAnimationFrame(()=>{J.current=!1})};f?Sr.current=xe:requestAnimationFrame(()=>requestAnimationFrame(xe)),r()},[De]);n.useEffect(()=>ua(()=>{Ke(()=>{_e(oi())})}),[Ke]),n.useEffect(()=>da(()=>{Ke(()=>{sc(ii()),ur(r=>({stateKey:te,bounded:r.stateKey===te?r.bounded:!1,additionalTurns:0}))})}),[te,Ke]);const Oo=n.useCallback(r=>{var u;Ue((u=X.current)==null?void 0:u.parentElement),Ke(()=>Un.toggleRewoundGroup(r),`rewound-group-${r}`,!0)},[Ke,Un.toggleRewoundGroup,Ue]),Sc=n.useMemo(()=>({...Un,toggleRewoundGroup:Oo}),[Un,Oo]),Hs=n.useCallback((r,u)=>{const f=r.target,w=f.closest(".message-render-row");if(!w||f!==w)return!1;const p=X.current,R=p==null?void 0:p.parentElement;if(!p||!R)return!1;const O=w.dataset.rewoundGroup??"",V=Array.from(p.querySelectorAll(".message-render-row")).filter(W=>(W.dataset.rewoundGroup??"")===O),ce=V[V.indexOf(w)+u];return ce?(Ue(R),J.current=!0,R.scrollTop+=ce.getBoundingClientRect().top-(r.clientY-12),requestAnimationFrame(()=>{J.current=!1}),!0):!1},[Ue]),Cc=n.useCallback(r=>{Hs(r,1)&&r.preventDefault()},[Hs]),kc=n.useCallback(r=>{Hs(r,-1)&&r.preventDefault()},[Hs]),Ic=n.useCallback(r=>{var u;Ue((u=X.current)==null?void 0:u.parentElement),Ke(()=>{rc(f=>{const w=new Set(f);return w.has(r)?w.delete(r):w.add(r),w})},r,!0)},[Ke,Ue]),Cr=n.useCallback(()=>{Ke(()=>{const r=!Pt;r&&xs({stateKey:te,collapsedSlots:new Set,dismissedSlots:new Set}),ar(r),Vr(r)})},[te,Ke,Pt]),Mc=n.useCallback(r=>{Ke(()=>{xs(u=>{const f=new Set(u.stateKey===te?u.collapsedSlots:[]);return f.has(r)?f.delete(r):f.add(r),{stateKey:te,collapsedSlots:f,dismissedSlots:u.stateKey===te?u.dismissedSlots:new Set}})})},[te,Ke]),Ac=n.useCallback(r=>{Ke(()=>{xs(f=>{const w=new Set(f.stateKey===te?f.dismissedSlots:[]);return w.add(r),{stateKey:te,collapsedSlots:f.stateKey===te?f.collapsedSlots:new Set,dismissedSlots:w}}),Array.from(bs).some(f=>f!==r)||(ar(!1),Vr(!1))})},[te,Ke,bs]),Do=n.useCallback(()=>{co(ui(ke)),ro(r=>Object.values(r).includes(!1)?Object.fromEntries(Object.entries(r).filter(([,u])=>u)):r)},[ke]),_c=n.useCallback(()=>{Ke(()=>{if(!Pt||Mn){Pt||(ar(!0),Vr(!0),xs({stateKey:te,collapsedSlots:new Set,dismissedSlots:new Set})),Mn&&(oo(!1),Ri(!1)),Do();return}oo(!0),Ri(!0)})},[Do,te,Ke,Pt,Mn]),kr=n.useCallback(r=>{je.current!==null&&clearTimeout(je.current),ms.current+=1,ao({direction:r,token:ms.current}),je.current=setTimeout(()=>{ao(null),je.current=null},Ad)},[]),dn=n.useCallback((r,u,f="start",w=!1,p,R)=>{const O=X.current,V=O==null?void 0:O.parentElement;if(!V){R==null||R(!1);return}oe.current=null,E.current=!1,jt(!1);const ce=St=>{var ei,ti;const Ct=X.current,ht=Ct==null?void 0:Ct.parentElement,Y=p?Ct==null?void 0:Ct.querySelector(`[data-async-question-reply="${CSS.escape(p)}"]`):It(Ct,r);if(!ht||!(Y!=null&&Y.isConnected))return!1;const mt=ht.getBoundingClientRect(),wt=Y.getBoundingClientRect();if(wt.width===0&&wt.height===0)return!1;const Nc=f==="center"?Math.max(0,(ht.clientHeight-wt.height)/2):12,Ks=Math.max(0,ht.scrollTop+wt.top-mt.top-Nc);return Math.abs(Ks-ht.scrollTop)<1?(p&&((ei=Y.querySelector("textarea"))==null||ei.focus({preventScroll:!0})),!0):(St&&kr(Ks<ht.scrollTop?"up":"down"),typeof ht.scrollTo=="function"?ht.scrollTo({top:Ks,behavior:u}):ht.scrollTop=Ks,p&&((ti=Y.querySelector("textarea"))==null||ti.focus({preventScroll:!0})),!0)};if(ce(w)){R==null||R(!0);return}const W=Ne.getRenderIdTop(r);if(W===null||!Ne.revealRenderId(r)){R==null||R(!1);return}const xe=f==="center"?V.clientHeight/2:12,Je=Math.max(0,W-xe);w&&kr(Je<V.scrollTop?"up":"down"),typeof V.scrollTo=="function"?V.scrollTo({top:Je,behavior:u}):V.scrollTop=Je,xn.current!==null&&cancelAnimationFrame(xn.current);let nt=2;const fn=()=>{xn.current=requestAnimationFrame(()=>{xn.current=null;const St=ce(!1);!St&&nt>0?(nt-=1,fn()):R==null||R(St)})};fn()},[kr,Ne.getRenderIdTop,Ne.revealRenderId]),Jt=ct==null?void 0:ct.navigation,Zt=n.useRef(null),Bs=ct==null?void 0:ct.navigationTarget;n.useLayoutEffect(()=>{if(!Jt||Q)return;const r={capture:()=>{const u=X.current,f=u==null?void 0:u.parentElement;return u&&f?ks(f,u):null},jump:(u,f)=>{var w;Ue((w=X.current)==null?void 0:w.parentElement),Zt.current!==null&&cancelAnimationFrame(Zt.current),Zt.current=requestAnimationFrame(()=>{Zt.current=null,dn(u,"auto","center",!0,f)})},restore:u=>{var f;if(Zt.current!==null&&cancelAnimationFrame(Zt.current),Zt.current=null,u.following){Ft(void 0,{allowThinkingDeltas:!0});return}Ue((f=X.current)==null?void 0:f.parentElement),oe.current=u,u.anchor&&Ne.revealRenderId(u.anchor.id),Nn(u)}};return Jt.current=r,()=>{Jt.current===r&&(Jt.current=null)}},[Jt,Q,ks,Ue,dn,Ft,Nn,Ne.revealRenderId]),n.useLayoutEffect(()=>{var r;!Q&&!Nt&&Bs&&((r=Jt==null?void 0:Jt.current)==null||r.jump(Bs.renderId,Bs.questionId))},[Q,Nt,Jt,Bs]),n.useEffect(()=>()=>{Zt.current!==null&&cancelAnimationFrame(Zt.current),xn.current!==null&&(cancelAnimationFrame(xn.current),xn.current=null)},[]);const ts=n.useCallback(()=>{E.current=!1,jt(!1),it(!1),Tn()},[it,Tn]),{beginSearchMatchReveal:qo,clearSearchMatchHighlight:Os,releaseSearchMatchHighlightOnInput:Fo}=tu(Q),ns=n.useCallback((r,u)=>{const f=(ln==null?void 0:ln.query)??"",w=(ln==null?void 0:ln.caseSensitive)??!1,p=qo();dn(r,"auto","center",u,void 0,R=>{var ce;const O=It(X.current,r),V=(ce=X.current)==null?void 0:ce.parentElement;R&&O&&V&&p(O,V,f,w)})},[qo,dn,ln]),Ds=n.useCallback((r,u=!0)=>{ts(),ns(r,!0),u&&(on.current!==null&&cancelAnimationFrame(on.current),on.current=requestAnimationFrame(()=>{on.current=requestAnimationFrame(()=>{on.current=null,ns(r,!1)})}))},[ts,ns]);n.useEffect(()=>()=>{on.current!==null&&(cancelAnimationFrame(on.current),on.current=null)},[]);const $o=n.useCallback(()=>{Rn.current=Pe,sn.current=null,_s(null)},[Pe]),ss=n.useCallback(r=>{$o(),Ds(r,!1),Ke(()=>{Yn(!1),Fo(),requestAnimationFrame(()=>{ns(r,!1)})},r,!0)},[Yn,$o,Ds,Ke,Fo,ns]),Ir=n.useCallback(r=>{Os(),ts(),Es(r)},[ts,Os,Es]),qs=n.useCallback((r,u,f=!1)=>{ko(r,u);const w=Rs(r),p=f?ss:Ds;w instanceof Promise?w.then(R=>{R&&requestAnimationFrame(()=>p(R))}):w&&p(w)},[ss,Ds,Rs,ko]),Fs=n.useCallback(()=>{Os(),An(!1),Ro(),vn(),Ft(bi,{allowThinkingDeltas:!0})},[Ro,Os,vn,Ft]),Wo=n.useCallback((r,u=!0)=>{const f=X.current,w=f==null?void 0:f.parentElement;if(!f||!w)return;const p=Fd(mr(),f,w,r,Ne.getRenderIdTop);if(!p){r==="previous"&&u&&En.current();return}it(!1),dn(p,"auto","start",!0),Tn()},[mr,it,Tn,dn,Ne.getRenderIdTop]);n.useEffect(()=>{if(Q){jn();return}const r=p=>{if(p.defaultPrevented||p.isComposing)return;if(p.ctrlKey&&!p.metaKey&&!p.altKey&&!p.shiftKey&&(p.key==="End"||p.code==="End"||p.key==="."||p.code==="Period")){p.preventDefault(),p.stopPropagation(),Fs();return}const R=xt?null:$d(p);if(R){p.preventDefault(),p.stopPropagation(),Wo(R,!p.repeat);return}if(cs(p,"o","KeyO")){p.preventDefault(),p.stopPropagation(),Cr();return}const O=Cd(p);if(O){p.preventDefault(),p.stopPropagation(),xt&&ys===O?Co("previous"):Ir(O);return}if(xt){if(p.key==="ArrowUp"||p.key==="ArrowDown"){p.preventDefault(),p.stopPropagation();const V=p.key==="ArrowUp"?"previous":"next";So(V,p.repeat);return}if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),jn(),Yn(!0);return}if(p.key==="Enter"){p.preventDefault(),p.stopPropagation();const V=pr(),ce=gr();if(jn(),V&&ce){const W=Rs(V);W instanceof Promise?W.then(xe=>{xe&&requestAnimationFrame(()=>ss(xe))}):W&&ss(W)}else Yn(!1)}}},u=p=>{(p.key==="ArrowUp"||p.key==="ArrowDown")&&jn()},f=p=>{var W,xe;if(!xt||p.button!==0||p.defaultPrevented)return;const R=p.target,O=R==null?void 0:R.closest('[data-search-match="true"]');if(!O||!((W=X.current)!=null&&W.contains(O))||R!=null&&R.closest("a, button, input, select, textarea, summary")||!((xe=window.getSelection())!=null&&xe.isCollapsed))return;const V=pr(),ce=gr();!V||!ce||(p.preventDefault(),jn(),qs(V,ce,!0))},w=()=>{if(xt){Es(ys);return}sr.flushSync(()=>Ir(ys))};return window.addEventListener("click",f),window.addEventListener(ai,w),window.addEventListener("keydown",r,!0),window.addEventListener("keyup",u,!0),()=>{window.removeEventListener("click",f),window.removeEventListener(ai,w),window.removeEventListener("keydown",r,!0),window.removeEventListener("keyup",u,!0)}},[qs,Yn,ss,pr,gr,So,Co,Wo,Es,Rs,Fs,xt,ys,Ir,jn,Cr,Q]);const $s=n.useCallback(()=>{if(Wn.current||fs.current)return;const r=re&&Xe.hiddenTurnCount>0,u=!!_t&&Ae&&!st&&(!r||Xe.hiddenTurnCount<kn);if(!(!r&&!u)){if(u){const f=X.current,w=f==null?void 0:f.parentElement;T.current=f&&w?{wasAtBottom:Kr(w),scrollTop:w.scrollTop,scrollHeight:w.scrollHeight,anchor:tr(f,w)}:null}Ke(()=>{if(r&&ur(f=>({stateKey:te,bounded:!0,additionalTurns:(f.stateKey===te?f.additionalTurns:0)+kn})),u)try{const f=_t();if(f){const w=()=>{nc(p=>p+1)};f.then(w,w)}else T.current=null}catch(f){throw T.current=null,f}})}},[kn,te,Xe.hiddenTurnCount,re,Ae,st,_t,Ke]);En.current=()=>{T.current||$s()};const Ws=n.useCallback(r=>{const u=X.current,f=u==null?void 0:u.parentElement;if(!(!u||!f)){if(J.current=!0,r.wasAtBottom)De(f);else{const w=r.anchor?It(u,r.anchor.id):null;w&&r.anchor?Ur(f,w,r.anchor.topOffset):f.scrollTop=Math.max(0,r.scrollTop+f.scrollHeight-r.scrollHeight)}Ee.current=f.scrollHeight,requestAnimationFrame(()=>{J.current=!1})}},[De]);n.useLayoutEffect(()=>{const r=T.current;!r||!Bn.active||Ws(r)},[Bn.active,Bn.revision,Ws]),n.useLayoutEffect(()=>{if(to===0||Bn.active)return;const r=T.current;T.current=null,r&&Ws(r)},[Bn.active,to,Ws]);const rs=n.useMemo(()=>{const r=[];return re&&Xe.hiddenTurnCount>0&&r.push(`conversation:${te??"default"}:${Xe.hiddenTurnCount}`),Ae&&r.push(`page:${Se??"unkeyed"}`),r.length>0?r.join("|"):null},[te,Xe.hiddenTurnCount,re,Ae,Se]);n.useEffect(()=>{var p;if(Q||st||xt||Ce||!rs)return;const r=ds.current,u=(p=X.current)==null?void 0:p.parentElement,f=window.IntersectionObserver;if(!r||!u||!f)return;const w=new f(R=>{const O=R.find(V=>V.target===r);if(O&&!T.current){if(!O.isIntersecting){yn.current=!1,bn.current===rs&&(bn.current=null);return}yn.current||bn.current!==rs&&(bn.current=rs,yn.current=!0,$s())}},{root:u});return w.observe(r),()=>w.disconnect()},[rs,$s,Ce,Q,st,xt]);const Mr=n.useCallback(()=>{if(J.current)return;oe.current=null;const r=X.current,u=r==null?void 0:r.parentElement;if(!r||!u)return;const f=Js(u,r);if(E.current){!f&&u.scrollTop<Oe.current-as?Ue(u):f?(Oe.current=u.scrollTop,Qt.current=!0,An(!1),jt(!0),it(!0)):De(u),Tn();return}E.current=f,Qt.current=f,f?(Oe.current=u.scrollTop,An(!1)):cn(),jt(f),it(f),Tn()},[cn,it,Tn,De,Ue]);n.useEffect(()=>{var u;if(Q)return;const r=(u=X.current)==null?void 0:u.parentElement;if(r)return r.addEventListener("scroll",Mr),()=>{r.removeEventListener("scroll",Mr)}},[Mr,Q]),n.useEffect(()=>{if(Q)return;const r=X.current,u=r==null?void 0:r.parentElement;if(!r||!u)return;const f=W=>{W.deltaY<0&&!is(W.target)&&Ue(u)},w=W=>{var xe;Dt.current=((xe=W.touches[0])==null?void 0:xe.clientY)??null},p=W=>{var nt;const xe=Dt.current,Je=(nt=W.touches[0])==null?void 0:nt.clientY;xe!==null&&Je!==void 0&&Je-xe>Nd&&!is(W.target)&&Ue(u)},R=()=>{Dt.current=null},O=W=>{if(W.button!==0||is(W.target))return;const xe=u.offsetWidth-u.clientWidth;if(xe<=0)return;const Je=u.getBoundingClientRect();W.clientX>=Je.right-xe&&(Ue(u),u.focus({preventScroll:!0}))},V=()=>{E.current&&ra(r)&&Ue(u)},ce=W=>{if(W.defaultPrevented||W.metaKey||W.ctrlKey||W.altKey||is(W.target))return;const xe=W.target;(xe===document.body||xe===document||Dd(xe,u))&&((W.key==="ArrowUp"||W.key==="PageUp"||W.key==="Home"||W.key===" "&&W.shiftKey)&&Ue(u),!W.repeat&&(W.key==="PageUp"||W.code==="PageUp")&&Gt.current===null&&(Gt.current=requestAnimationFrame(()=>{Gt.current=null,u.scrollTop<=1&&En.current()})))};return u.addEventListener("wheel",f,{passive:!0}),u.addEventListener("touchstart",w,{passive:!0}),u.addEventListener("touchmove",p,{passive:!0}),u.addEventListener("touchend",R,{passive:!0}),u.addEventListener("touchcancel",R,{passive:!0}),u.addEventListener("pointerdown",O),document.addEventListener("selectionchange",V),document.addEventListener("keydown",ce,!0),()=>{u.removeEventListener("wheel",f),u.removeEventListener("touchstart",w),u.removeEventListener("touchmove",p),u.removeEventListener("touchend",R),u.removeEventListener("touchcancel",R),u.removeEventListener("pointerdown",O),document.removeEventListener("selectionchange",V),document.removeEventListener("keydown",ce,!0),Gt.current!==null&&(cancelAnimationFrame(Gt.current),Gt.current=null)}},[Q,Ue]),n.useEffect(()=>{var p;const r=(p=X.current)==null?void 0:p.parentElement;if(!r)return;const u=r;Ee.current=u.scrollHeight;let f=u.clientHeight;const w=new ResizeObserver(()=>{const R=u.scrollHeight,O=R!==Ee.current,V=u.clientHeight,ce=V!==f;f=V;const W=O||ce,xe=oe.current;if(W&&xe){J.current=!0,Nn(xe),requestAnimationFrame(()=>{J.current=!1});return}W&&E.current?De(u):Ee.current=R});return w.observe(u),X.current&&w.observe(X.current),()=>{w.disconnect(),vs(),We.current!==null&&clearTimeout(We.current),cn(),je.current!==null&&clearTimeout(je.current)}},[vs,cn,Nn,De]),n.useEffect(()=>{let r=0,u=0,f=!0;const w=()=>{var R;const p=(R=X.current)==null?void 0:R.parentElement;!p||J.current||(f=E.current,u=f?0:Math.max(0,p.scrollHeight-p.scrollTop-p.clientHeight),r!==0&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{var ce;const O=(ce=X.current)==null?void 0:ce.parentElement;if(!O)return;if(f){De(O);return}const V=Math.max(0,O.scrollHeight-O.clientHeight-u);J.current=!0,O.scrollTop=V,Ee.current=O.scrollHeight,E.current=!1,jt(!1),it(!1),requestAnimationFrame(()=>{J.current=!1})}))};return window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w),r!==0&&cancelAnimationFrame(r)}},[it,De]),n.useLayoutEffect(()=>{d>0&&Ft(yi,{allowThinkingDeltas:!0})},[Ft,d]);const Ko=n.useRef(null);n.useEffect(()=>{const r=h;if(!(r!=null&&r.id)||Q||Nt||Ko.current===r.token)return;const u=requestAnimationFrame(()=>{Ko.current=r.token,dn(r.id,"auto","center",!0,void 0,r.onResolved)});return()=>cancelAnimationFrame(u)},[h,dn,Q,Nt]),n.useLayoutEffect(()=>{const r=P.current;P.current=Q,r&&!Q&&E.current&&Ft(yi)},[Ft,Q]);const Vo=Hn.length,Go=Zn==="restore-position"&&(Be==null?void 0:Be.anchor)!==void 0&&Nt;n.useEffect(()=>{if(!k.current||!Be||Vo===0||Zn==="skip")return;const r=X.current,u=r==null?void 0:r.parentElement;if(!(!r||!u)){if(J.current=!0,Zn==="follow-bottom")oe.current=null,De(u),E.current=!0,jt(!0),An(!1);else{const f=Be.anchor;if(f&&Nt&&!It(r,f.id)){J.current=!1;return}oe.current=Be,Nn(Be),E.current=!1,jt(!1),it(!1),An(Be.atBottom&&u.scrollHeight>Be.scrollHeight+as&&!Js(u,r))}Ee.current=u.scrollHeight,k.current=!1,requestAnimationFrame(()=>{J.current=!1,Cs(),ft()})}},[Be,Zn,Vo,ft,Nt,Nn,De,Cs,it]),n.useEffect(()=>{var r;if(k.current&&Qe.length>0){if(Go)return;const u=(r=X.current)==null?void 0:r.parentElement;u&&De(u),k.current=!1}},[Qe.length,De,Go]);const Pc=n.useCallback(()=>{oe.current=null,Fs(),ft(),tn==null||tn()},[tn,ft,Fs]),Uo=!wn&&typeof document<"u"?at===void 0?document.querySelector(".session-input-inner"):at:null,jc=ie(fr?"sessionNewOutputBelow":"sessionFollow"),Qo=ie(fr?"sessionNewOutputBelowTitle":"sessionFollowLatestOutput"),Ar=Ht&&!wn?a.jsxs("button",{type:"button",className:`message-follow-toggle${fr?" is-new-output":""}`,onClick:Pc,"aria-label":Qo,title:Qo,children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 5v14"}),a.jsx("path",{d:"m19 12-7 7-7-7"})]}),a.jsx("span",{children:jc})]}):null;return n.createElement(na,{registry:Ts},a.jsx(sa,{value:Sc,children:a.jsxs(Fc,{onQuoteTextBlock:_o,children:[a.jsx(ud,{getAnchors:mr,messageListRef:X,motionCue:oc,onNavigateStart:ts,onSearchMatchSelect:qs,onTrimAnchor:z,canTrimAnchor:Er,onForkBeforeAnchor:Re,onForkAfterAnchor:be,canForkAfterAnchor:Er,canForkBeforeAnchor:yr,forkAfterDisabled:y,onCopyAnchor:Z,canCopyAnchor:Er,onHandoffFromAnchor:ae,onPreviewTimestampChange:fc,getRenderIdTop:Ne.getRenderIdTop,revealRenderId:Ne.revealRenderId,searchState:ln}),lc(qs),Uo&&Ar?sr.createPortal(Ar,Uo):Ar,pc,xc,a.jsxs("div",{className:["message-list",Nt?"message-list-progressive-hydrating":""].filter(Boolean).join(" "),ref:X,"aria-busy":Nt?!0:void 0,"data-transcript-render-weight":Ne.totalWeight,onPointerOver:uc,onPointerLeave:dc,onClick:Cc,onContextMenu:kc,children:[gc,Nt&&a.jsxs("div",{className:"session-render-progress loading",role:"status",children:[a.jsx("div",{children:ie("sessionLoading")}),pt&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"loading-detail session-render-progress-label",children:ie("sessionProgressiveRenderingStatus",{percent:br})}),a.jsx("div",{className:"session-render-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":br,"aria-label":ie("sessionProgressiveRenderingAriaLabel"),children:a.jsx("div",{className:"session-render-progress-fill",style:{width:`${br}%`}})})]})]}),!xt&&!Ce&&(Ae||he||Xe.hiddenTurnCount>0)&&a.jsxs("div",{className:"load-older-messages",ref:ds,children:[re&&Xe.hiddenTurnCount>0?a.jsx("span",{className:"load-older-status",children:ie("sessionConversationLatestTurns",{count:Xe.visibleTurnCount})}):he?a.jsx("span",{className:"load-older-status",children:ie("sessionRecentTranscriptLoaded")}):null,en&&!st?a.jsx("span",{className:"load-older-status",role:"status",children:ie("sessionOlderLoadContinuationRequired")}):null,(Ae||Xe.hiddenTurnCount>0)&&a.jsx("button",{type:"button",className:"load-older-button",onClick:$s,disabled:st&&Xe.hiddenTurnCount===0,children:st&&Xe.hiddenTurnCount===0?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"spinning",children:"↻"})," ",ie("sessionLoadingOlderMessages")]}):Xe.hiddenTurnCount>0?ie("sessionConversationLoadEarlierTurns",{count:Math.min(kn,Xe.hiddenTurnCount)}):ie("sessionLoadOlderMessages")})]}),Ne.active&&a.jsx("span",{ref:Ne.registerListStart,"aria-hidden":"true","data-transcript-render-boundary":"start",style:Wr}),Ne.beforeHeightPx>0&&a.jsx("div",{"aria-hidden":"true","data-transcript-render-spacer":"before",style:{height:Ne.beforeHeightPx}}),Ne.rows.map(r=>{const u=(()=>{if(r.kind==="btw")return a.jsx(Yd,{aside:r.aside,onFocus:A,onDone:I,onStop:N,onToggleExpanded:ne,onTransferTurn:L},r.key);if(r.kind==="empty")return null;if(r.kind==="standalone"){const{item:w}=r;return a.jsx(Xr,{item:w,isStreaming:i,thinkingExpanded:!1,toggleThinkingExpanded:Rr,sessionProvider:o,getForkSummaryTargetHref:ge,onCancelForkSummary:m,onToggleForkSummaryAutoOpen:S,onFollowForkSummary:K,bangCommandHandlers:ue},r.key)}return r.kind==="user"?a.jsx(Jd,{row:r,isStreaming:i,sessionProvider:o,latestCorrectablePromptId:Rt==null?void 0:Rt.id,latestCorrectablePromptContent:Rt==null?void 0:Rt.content,onCorrectLatestUserMessage:Le,onCancelUnconfirmedUserMessage:pe,onTrimBeforeUserMessage:z,onForkBeforeUserMessage:Re,onForkAfterUserMessage:be,onForkAfterSummaryUserMessage:_,canForkBeforePrompt:yr,forkAfterUserMessageDisabled:y,forkUnavailableMessage:H,noopToggleThinkingExpanded:Rr,promptActionsDisabled:_n.has(r.item.id)},r.key):a.jsx(Zd,{row:r,isStreaming:i,sessionProvider:o,getThinkingItemExpanded:Ec,toggleThinkingItemExpanded:Rc,noopToggleThinkingExpanded:Rr,onTrimBeforeUserMessage:z,onForkBeforeUserMessage:Re,onForkAfterUserMessage:be,onForkAfterSummaryUserMessage:_,canForkBeforePrompt:yr,forkAfterUserMessageDisabled:y,forkUnavailableMessage:H,handleQuoteTextBlock:_o,alwaysShowQuoteCircles:hc,paragraphQuoteCirclesEnabled:mc,onToggleConversationActivity:Ic,widerConversationActivityPreviews:ic,collapsedConversationThinkingPreviewSlots:cc,onToggleConversationThinkingPreview:Mc,onDismissConversationThinkingPreview:Ac,promptActionDisabledIds:_n},r.key)})();if(!Ne.active)return u;const f=Ne.getRowSpacerBefore(r.key);return a.jsxs(n.Fragment,{children:[f>0&&a.jsx("div",{"aria-hidden":"true","data-transcript-render-spacer":"between",style:{height:f}}),a.jsx("span",{ref:w=>Ne.registerRowStart(r.key,w),"aria-hidden":"true","data-transcript-render-boundary":"row-start",style:Wr}),u,a.jsx("span",{ref:w=>Ne.registerRowEnd(r.key,w),"aria-hidden":"true","data-transcript-render-boundary":"row-end",style:Wr})]},r.key)}),Ne.afterHeightPx>0&&a.jsx("div",{"aria-hidden":"true","data-transcript-render-spacer":"after",style:{height:Ne.afterHeightPx}}),wc.map(r=>{var xe,Je,nt,fn,St,Ct,ht;const{hasMessageAge:u,showAgeByDefault:f,timestampMs:w}=r;if(r.kind==="pending"){const Y=r.message;return a.jsxs("div",{className:`pending-message message-render-row ${u?"has-message-age":""} ${f?"is-message-age-visible":""}`,children:[a.jsxs("div",{className:"message-render-content",children:[a.jsx("div",{className:"message-user-prompt pending-message-bubble",children:a.jsx(jr,{text:Y.content})}),(xe=Y.attachments)!=null&&xe.length?a.jsx("div",{className:"attachment-list pending-message-attachments",children:Y.attachments.map(mt=>a.jsx(Hr,{attachmentId:mt.id,originalName:mt.originalName,path:mt.path,mimeType:mt.mimeType,sizeLabel:Nr(mt.size),imageWidth:mt.width,imageHeight:mt.height},mt.id))}):null,a.jsxs("div",{className:"pending-message-footer",children:[a.jsx("div",{className:"pending-message-status",children:Y.status||"Sending..."}),a.jsx("div",{className:"deferred-message-actions",children:a.jsx(Gr,{text:Y.content,label:"Copy message text",className:"deferred-message-action deferred-message-action-copy",showTextLabel:!0,onClick:mt=>mt.stopPropagation()})})]})]}),a.jsx(Zs,{timestampMs:w,nowMs:qt})]},r.key)}if(r.kind==="project-queue"){const Y=r.message,mt=r.projectQueueStatusKind==="dispatching"?ie("projectQueueInlineStatusDispatching",{position:Y.projectPosition}):r.projectQueueStatusKind==="failed"?ie("projectQueueInlineStatusFailed",{position:Y.projectPosition}):ie("projectQueueInlineStatusQueued",{position:Y.projectPosition});return a.jsxs("div",{className:`deferred-message project-queue-inline-message message-render-row ${u?"has-message-age":""} ${f?"is-message-age-visible":""}`,children:[a.jsxs("div",{className:"message-render-content",children:[a.jsx("div",{className:`message-user-prompt ${zs.queuedBubble} ${zs.projectQueueBubble}`,children:a.jsx(jr,{text:Y.content})}),(Je=Y.attachments)!=null&&Je.length?a.jsx("div",{className:"attachment-list deferred-message-attachments-list",children:Y.attachments.map(wt=>a.jsx(Hr,{attachmentId:wt.id,originalName:wt.originalName,path:wt.path,mimeType:wt.mimeType,sizeLabel:Nr(wt.size),imageWidth:wt.width,imageHeight:wt.height},wt.id))}):null,a.jsxs("div",{className:"deferred-message-footer",children:[a.jsx("span",{className:"deferred-message-status project-queue-inline-message-status",children:mt}),r.showAttachmentCountBadge?a.jsxs("span",{className:"deferred-message-attachments",title:`${Y.attachmentCount} attachment${Y.attachmentCount===1?"":"s"} queued`,role:"img","aria-label":`${Y.attachmentCount} attachment${Y.attachmentCount===1?"":"s"} queued`,children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),a.jsx("span",{children:Y.attachmentCount})]}):null,Y.lastError&&a.jsx("span",{className:"project-queue-inline-message-error",children:Y.lastError}),a.jsx(Ci,{variant:"project",text:Y.content,composerEditAvailabilityStore:B,itemCanEdit:Y.canEdit!==!1,disabled:Y.isMutating||M,onResume:C?At:void 0,onEdit:r.allowsCancel&&qe?()=>qe(Y.id):void 0,onSteer:r.projectQueueStatusKind==="queued"&&tt?()=>tt(Y.id):void 0,steerLabel:ie("projectQueueInlineSteer"),onCancel:r.allowsCancel&&Te?()=>Te(Y.id):void 0})]})]}),a.jsx(Zs,{timestampMs:w,nowMs:qt})]},r.key)}const p=r.message,R=r.recoveredQueueId,O=p.yaCommand==="clearloop",V=r.isRecovered?ie("sessionRecoveredQueuedPaused"):O?p.clearloop&&a.jsx(zd,{progress:p.clearloop}):r.isYaCommand?ie("sessionQueuedYaCommandAfterTurn"):Ud({isPatient:r.isPatient,lanePosition:r.lanePosition,timestampMs:w,nowMs:qt}),ce=((nt=r.lanePosition)==null?void 0:nt.patientIndex)??0,W=ce>0?ie("sessionSteerQueuedMessageThrough",{count:String(ce),suffix:ce===1?"":"s"}):ie("sessionSteerQueuedMessageNow");return a.jsxs("div",{className:`deferred-message message-render-row ${u?"has-message-age":""} ${f?"is-message-age-visible":""}`,children:[a.jsxs("div",{className:"message-render-content",children:[a.jsxs("div",{className:`message-user-prompt ${zs.queuedBubble}`,title:O?p.content:void 0,children:[O&&p.clearloop?a.jsxs("span",{className:zs.clearloopBadge,role:"img","aria-label":ie("clearloopProgress",{completed:String(p.clearloop.completed),total:String(p.clearloop.total)}),title:ie("clearloopIterationBadgeTitle",{completed:String(p.clearloop.completed),total:String(p.clearloop.total)}),children:[p.clearloop.completed,"/",p.clearloop.total]}):null,a.jsx(jr,{text:p.content})]}),(fn=p.attachments)!=null&&fn.length?a.jsx("div",{className:"attachment-list deferred-message-attachments-list",children:p.attachments.map(Y=>a.jsx(Hr,{attachmentId:Y.id,originalName:Y.originalName,path:Y.path,mimeType:Y.mimeType,sizeLabel:Nr(Y.size),imageWidth:Y.width,imageHeight:Y.height},Y.id))}):null,a.jsxs("div",{className:"deferred-message-footer",children:[a.jsx("span",{className:"deferred-message-status",title:r.isRecovered?ie("sessionRecoveredQueuedPausedTitle"):r.isPatient?"Patient queue waits for verified quiet. Regular queued messages may pass it.":void 0,children:V}),a.jsx(za,{modifier:(St=p.metadata)==null?void 0:St.turnEffort,context:v}),r.showAttachmentCountBadge?a.jsxs("span",{className:"deferred-message-attachments",title:`${p.attachmentCount} attachment${p.attachmentCount===1?"":"s"} queued`,role:"img","aria-label":`${p.attachmentCount} attachment${p.attachmentCount===1?"":"s"} queued`,children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),a.jsx("span",{children:p.attachmentCount})]}):null,r.isRecovered?a.jsxs("div",{className:"deferred-message-actions",children:[a.jsx(Gr,{text:p.content,label:ie("sessionQueuedCopy"),className:"deferred-message-action deferred-message-action-copy",showTextLabel:!0,onClick:Y=>Y.stopPropagation()}),R&&se&&!((Ct=p.metadata)!=null&&Ct.turnEffort)?a.jsxs("button",{type:"button",className:"deferred-message-action deferred-message-action-steer",onClick:()=>se(R),"aria-label":W,title:W,children:[a.jsx(rr,{}),a.jsx("span",{children:ie("sessionSteerNow")})]}):null,r.allowsRecoveredResume&&R&&q?a.jsxs("button",{type:"button",className:"deferred-message-action deferred-message-action-resume",onClick:()=>q(R),"aria-label":ie("sessionRecoveredQueuedResume"),title:ie("sessionRecoveredQueuedResume"),children:[a.jsx(rr,{}),a.jsx("span",{children:ie("sessionRecoveredQueuedResumeShort")})]}):null,r.allowsRecoveredDelete&&R&&de?a.jsxs("button",{type:"button",className:"deferred-message-action deferred-message-action-cancel",onClick:()=>de(R),"aria-label":ie("sessionRecoveredQueuedDelete"),title:ie("sessionRecoveredQueuedDelete"),children:[a.jsx(tc,{}),a.jsx("span",{children:ie("sessionRecoveredQueuedDeleteShort")})]}):null]}):a.jsx(Ci,{variant:"session",text:p.content,composerEditAvailabilityStore:B,onEdit:!r.isYaCommand&&p.tempId&&Ye?()=>Ye(p.tempId):void 0,onSteer:r.isPatient&&p.tempId&&Ze&&!((ht=p.metadata)!=null&&ht.turnEffort)?()=>Ze(p.tempId):void 0,steerLabel:W,onCancel:r.allowsDeferredCancel&&ve?()=>ve(p.tempId):O&&ye?ye:void 0,cancelLabel:O?ie("clearloopCancel"):void 0})]})]}),a.jsx(Zs,{timestampMs:w,nowMs:qt})]},r.key)}),l&&a.jsxs("div",{className:"system-message system-message-compacting",children:[a.jsx("span",{className:"system-message-icon spinning",children:"⟳"}),a.jsx("span",{className:"system-message-text",children:"Compacting context..."})]}),a.jsx(Bu,{isProcessing:c,thinkingItemsVisible:Pt,hasThinkingItems:ac,onToggleThinkingItemsVisible:Cr,thinkingLatestOnly:Mn,onToggleThinkingLatestOnly:_c})]})]})}))});export{xh as MessageList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as I,j as u}from"./index-BY-TgOY-.js";const g=["low","medium","high","xhigh","max"];function ve(e){return e==="fast"||e==="slow"||e==="fastest"||e==="slowest"}function C(e){var n;if((e==null?void 0:e.supportsEffort)===!1)return[];const t=((n=e==null?void 0:e.supportedReasoningEfforts)==null?void 0:n.map(({reasoningEffort:r})=>r==="ultra"?"max":r))??(e==null?void 0:e.supportedEffortLevels)??[];return g.filter(r=>t.includes(r))}function K(e,t){var r;if(e!=="max")return e;const n=((r=t==null?void 0:t.supportedReasoningEfforts)==null?void 0:r.map(({reasoningEffort:o})=>o))??(t==null?void 0:t.supportedEffortLevels);if(!(n!=null&&n.length))return e;for(const o of["ultra","max","xhigh","high","medium","low"])if(n.includes(o))return o;throw new Error("The selected model has no supported maximum effort")}function me(e,t,n){if(e==="fastest")return"off";const r=C(n);if(!r.length)throw new Error("The selected model does not advertise effort levels");if(e==="slowest")return`on:${r[r.length-1]}`;if(t==="off")return e==="fast"?"off":`on:${r[0]}`;const o=t==="auto"?n.defaultReasoningEffort??n.defaultEffortLevel:t.replace(/^on:/,""),l=r.indexOf(o==="ultra"?"max":o);if(l<0)throw new Error("Select an explicit supported effort before using /fast or /slow");const i=Math.max(0,Math.min(r.length-1,l+(e==="slow"?1:-1)));return`on:${r[i]}`}function ye(e){return typeof e=="string"&&g.includes(e)}function z(e,t){if(e.levels.includes(t))return t;const n=g.indexOf(t);let r;for(const o of e.levels)g.indexOf(o)<=n&&(r=o);return r??e.levels[0]}const V=["low","medium","high","max"],B=["low","medium","high","xhigh"],W=new Set(g),U={effortLevelLowLabel:"Low",effortLevelMediumLabel:"Medium",effortLevelHighLabel:"High",effortLevelExtraLabel:"Extra",effortLevelExtraHighLabel:"Extra High",effortLevelMaxLabel:"Max",effortLevelLowDescription:"Fastest responses",effortLevelMediumDescription:"Moderate reasoning",effortLevelHighDescription:"Deep reasoning",effortLevelExtraDescription:"For your hardest tasks",effortLevelExtraHighDescription:"Extra-high reasoning",effortLevelMaxDescription:"Maximum effort"},O=e=>U[e];function X(e){return typeof e=="string"&&W.has(e)}function m(e){if(e)return typeof e=="string"?e:e.name}function R(e,t){var n;if(t){if(typeof t!="string")return t;if(!(!e||typeof e=="string"))return(n=e.models)==null?void 0:n.find(r=>r.id===t)}}function Y(e){const t=C(e);return t.length>0?t:null}function q(e){switch(e){case"claude":case"claude-ollama":return g;case"claude-gateway":return[];case"codex":return B;case"pi":return g;default:return V}}function D(e,t,n=O){const r=m(t);switch(e){case"low":return n("effortLevelLowLabel");case"medium":return n("effortLevelMediumLabel");case"high":return n("effortLevelHighLabel");case"xhigh":return n(r==="claude"||r==="claude-gateway"||r==="claude-ollama"?"effortLevelExtraLabel":"effortLevelExtraHighLabel");case"max":return n("effortLevelMaxLabel")}}function J(e,t,n=O){const r=m(t);switch(e){case"low":return n("effortLevelLowDescription");case"medium":return n("effortLevelMediumDescription");case"high":return n("effortLevelHighDescription");case"xhigh":return n(r==="claude"||r==="claude-gateway"||r==="claude-ollama"?"effortLevelExtraDescription":"effortLevelExtraHighDescription");case"max":return n("effortLevelMaxDescription")}}function Q(e,t){var n,r;return(r=(n=e==null?void 0:e.supportedReasoningEfforts)==null?void 0:n.find(o=>o.reasoningEffort===K(t,e)))==null?void 0:r.description}function Z(e){const t=R(e.provider,e.model);return(Y(t)??q(m(e.provider))).map(r=>({value:r,label:D(r,e.provider,e.translate),description:Q(t,r)??J(r,e.provider,e.translate)}))}Z({});function M(e){var t;return((t=e.at(-1))==null?void 0:t.value)??"high"}function Le(e,t){return t.length===0?M(t):z({levels:t.map(n=>n.value)},e)??M(t)}function be(e){var o;const t=R(e.provider,e.model);if(m(e.provider)==="claude-gateway"&&t===void 0)return["off"];if((t==null?void 0:t.supportsAdaptiveThinking)===!1)return["off"];const n=["off","auto"];return(t==null?void 0:t.supportsEffort)!==!1&&(((o=e.effortOptions)==null?void 0:o.length)??1)>0&&n.push("on"),n}function Ee(e,t){return t.includes(e)?e:t.includes("auto")?"auto":"off"}function T(e,t){return e==="ultra"&&m(t)==="codex"?"max":X(e)?e:"high"}function ee(e,t){return T(e,t)}function te(e,t){return!e||e.type==="disabled"?"off":t?"on":"auto"}function re(e,t,n){const r=te(e,t);return ne(r,ee(t,n))}function ne(e,t){return e==="off"?"off":e==="auto"?"auto":t}const oe="◌",ie={claude:"Cl","claude-gateway":"Cl↗","claude-ollama":"Cl↓",codex:"Cd","codex-oss":"Cd↓",gemini:"✦","gemini-acp":"✦",grok:"Gk",opencode:"OC",pi:"pi"},S=[{patterns:["gpt-6-astra"],glyph:"As",fixedSuffix:""},{patterns:["gpt-daybreak-blue-latest"],glyph:"Db",fixedSuffix:"",accent:"daybreak"},{patterns:["gpt-5.6-sol"],glyph:"☀",fixedSuffix:""},{patterns:["gpt-5.6-terra"],glyph:"♁",fixedSuffix:""},{patterns:["gpt-5.6-luna"],glyph:"☾",fixedSuffix:""},{patterns:["gpt-5.4-codex-spark","gpt-5.4-spark","gpt-5.3-codex-spark","gpt-5.3-spark"],glyph:"⚡",fixedSuffix:""},{patterns:["gpt-5.5"],glyph:"◆"},{patterns:["gpt-5.4-mini"],glyph:"◇"},{patterns:["gpt-5.4-nano"],glyph:"◇"},{patterns:["gpt-5.4"],glyph:"◇"},{patterns:["gpt-5.3"],glyph:"◆"},{patterns:["gpt-5"],glyph:"◆"},{patterns:["gpt-4"],glyph:"⧉"}],F={claude:[{patterns:["opus[1m]","opus-1m"],glyph:"◐",fixedSuffix:"1m",match:"exact"},{patterns:["opusplan"],glyph:"◐",fixedSuffix:"Plan",match:"exact"},{patterns:["opus"],glyph:"◐",fixedSuffix:"",match:"exact"},{patterns:["fable"],glyph:"Fb",fixedSuffix:"",match:"exact"},{patterns:["sonnet[1m]","sonnet-1m"],glyph:"♪",fixedSuffix:"1m"},{patterns:["fable"],glyph:"Fb"},{patterns:["opus"],glyph:"◐"},{patterns:["sonnet"],glyph:"♪"},{patterns:["haiku"],glyph:"✎"}],codex:S,"codex-oss":S,gemini:[{patterns:["2.5-pro"],glyph:"✹"},{patterns:["2.5-flash"],glyph:"⚡"},{patterns:["1.5-pro"],glyph:"✹"},{patterns:["gemini"],glyph:"◗"}],grok:[{patterns:["grok-build"],glyph:"",fixedSuffix:""},{patterns:["grok-"],glyph:""}],opencode:[{patterns:["gpt-5"],glyph:"◆"},{patterns:["gpt-4"],glyph:"⧉"},{patterns:["qwen"],glyph:"◌"},{patterns:["llama"],glyph:"◥"},{patterns:["mistral"],glyph:"◰"}]},ae=[{patterns:["thinking"],glyph:"∴"}];function se(e){return(e==null?void 0:e.trim().toLowerCase())??"unknown"}function P(e){let t=e.trim().toLowerCase();return t=t.replace(/^openai\//u,""),t=t.replace(/^opencode\//u,""),t=t.replace(/^gemini-/u,""),t}function G(e,t){return["codex","codex-oss"].includes(t)?e.replace(/-codex(?=-|$)/gu,""):e}function le(e){var r;const t=e.replace(/^[-._\s]+/u,"");if(!t)return"";const n=t.match(/^(\d+(?:-\d+)+(?:\.\d+)?)(\[1m\])?$/u);return n?`${(r=n[1])==null?void 0:r.replace(/-/gu,".")}${n[2]?" 1m":""}`:t}function A(e,t){const n=e.replace(/-(?:gateway|ollama|oss|acp)$/u,""),r=F[e]??F[n]??[],o=l=>{for(const i of l){const c=[...i.patterns].sort((a,p)=>p.length-a.length);for(const a of c){const p=i.match==="exact"?t===a?0:-1:t.indexOf(a);if(p===-1)continue;const f=le(t.slice(p+a.length));if(i.fixedSuffix!==void 0)return{glyph:i.glyph,suffix:i.fixedSuffix,accent:i.accent};if(a.startsWith("gpt-")){const d=a.slice(4);return{glyph:i.glyph,suffix:f?`${d}-${f}`:d,accent:i.accent}}return f?{glyph:i.glyph,suffix:f,accent:i.accent}:{glyph:i.glyph,suffix:"",accent:i.accent}}}return null};return o(r)??o(ae)}const fe={"github-copilot":"copilot","github-models":"copilot",huggingface:"HF"};function ce(e){const t=e.trim().toLowerCase(),n=fe[t];if(n)return n;const r=t.replace(/^github-/u,"");return r.length>12?r.slice(0,12):r}function k(e){const t=e.toLowerCase();return/(?:claude|opus|sonnet|haiku|fable)/u.test(t)?"claude":/(?:gpt|codex|davinci|\bo[1-9])/u.test(t)?"codex":/gemini/u.test(t)?"gemini":/grok/u.test(t)?"grok":/(?:qwen|llama|mistral|deepseek|gemma|phi)/u.test(t)?"opencode":null}function $(e){return e.glyph?e.suffix?`${e.glyph} ${e.suffix}`:e.glyph:e.suffix}function ue(e,t){const n=P(t),r=G(n,e),o=A(e,r);return o?{label:$(o),accent:o.accent}:{label:r}}function pe(e,t){const n=t==null?void 0:t.trim();if(!n)return null;const r=se(e),o=ie[r]??oe,l=P(n),i=l.indexOf("/");if(i>0){const p=l.slice(0,i),f=l.slice(i+1),d=ce(p),h=f.lastIndexOf("/");if(h>=0){const x=f.slice(h+1),L=k(x)??r;return{providerGlyph:o,subProvider:d,modelLabel:x,modelFamilyKey:L}}const v=k(f)??r,s=ue(v,f);return{providerGlyph:o,subProvider:d,modelLabel:s.label,modelAccent:s.accent,modelFamilyKey:v}}const c=G(l,r),a=A(r,c);return a?{providerGlyph:o,modelLabel:$(a),modelAccent:a.accent,modelFamilyKey:r}:{providerGlyph:o,modelLabel:c,modelFamilyKey:r}}const w={claude:"var(--provider-claude)","claude-gateway":"var(--provider-claude)","claude-ollama":"var(--provider-claude)",codex:"var(--provider-codex)","codex-oss":"var(--provider-codex)",gemini:"var(--provider-gemini)","gemini-acp":"var(--provider-gemini)",grok:"var(--provider-grok)",opencode:"var(--provider-opencode)",pi:"var(--provider-pi)"},de={claude:"Claude","claude-gateway":"Gateway","claude-ollama":"Ollama",codex:"Codex","codex-oss":"CodexOSS",gemini:"Gemini","gemini-acp":"Gemini ACP",grok:"Grok",opencode:"OpenCode",pi:"pi"},ge={daybreak:"var(--provider-gemini)"};function we({provider:e,compact:t=!1,model:n,thinking:r,effort:o,isThinking:l=!1,className:i=""}){const{t:c}=I(),a=w[e],p=de[e],f=e==="codex"&&typeof n=="string"&&n.toLowerCase().startsWith("gpt-"),d=f?re(r,o,e):null,h=(()=>{if(!f||!r&&!o)return null;if(!r||r.type==="disabled")return c("modelSettingsThinkingOffLabel");if(!o)return c("modelSettingsThinkingAutoLabel");const E=T(o,e),N=D(E,e,c);return E==="medium"?c("effortLevelMediumShortLabel"):E==="xhigh"?c("effortLevelExtraHighShortLabel"):N})(),v=!n||n==="default"?void 0:n,s=pe(e,v),x=s==null?void 0:s.modelFamilyKey,L=x&&x in w?w[x]:void 0,b=(s!=null&&s.modelAccent?ge[s.modelAccent]:void 0)??L,_=b&&b!==a?{color:b}:void 0,y=v??p;if(t)return u.jsx("span",{className:`provider-badge-stripe ${i}`,style:{backgroundColor:a},title:y,role:"img","aria-label":y});const H=l?"provider-badge-dot-inline thinking":"provider-badge-dot-inline",j=l?{backgroundColor:"var(--thinking-color)"}:{backgroundColor:a};return u.jsxs("span",{className:`provider-badge ${i}`,style:{borderColor:a,color:a},title:y,role:"img","aria-label":y,children:[u.jsx("span",{className:H,style:j}),u.jsx("span",{className:"provider-badge-label",children:s?u.jsxs(u.Fragment,{children:[s.providerGlyph,s.subProvider?` ${s.subProvider}`:"",s.modelLabel?u.jsx("span",{className:"provider-badge-model",style:_,children:` ${s.modelLabel}`}):null]}):p}),h&&d&&u.jsxs("span",{className:"provider-badge-effort",title:`Effort: ${h}`,children:[u.jsx("span",{className:`provider-badge-effort-dot tone-${d}`,"aria-hidden":"true"}),u.jsx("span",{className:"provider-badge-effort-label",children:h})]})]})}export{g as E,we as P,be as a,Ee as b,ye as c,D as d,me as e,ve as f,Z as g,ee as h,X as i,te as j,re as k,ne as l,se as n,Le as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as p,a as m,j as t,L as c}from"./index-BY-TgOY-.js";import{P as d}from"./ProviderChildSessionDetail-CSAbaZtr.js";import{u as l}from"./Modal-DOzUIhWU.js";import"./react-runtime-D-UPQ57m.js";import"./client-D_ikArFV.js";import"./RelayProtocol-DOWXVB0k.js";import"./LocalMediaModal-DyDpC0dk.js";import"./newSessionPrefill-DKcy0abh.js";import"./appHref-ByaEnJGJ.js";import"./useAcliCommentarySetting-JMx-BSAu.js";import"./providerChildSessions-DVWCZpC4.js";import"./katex-Dv2p4YRM.js";import"./remoteRoutePaths-BxKY1U2z.js";import"./index-YAR5D3xY.js";import"./relay-url-j3kYm5KO.js";import"./ProviderBadge-BKZVllDn.js";import"./postCompactReplay-D6HuoQK2.js";import"./recentProjectPathLinks-B6pQxzWg.js";import"./MessageAge-CKdiBg7K.js";import"./BangCommandDisplayObject-BDGW0BZN.js";import"./AttachmentChip-CQTl9l1O.js";import"./browserDebugPerformance-ZT9tAT-A.js";import"./useStableToolPreviewRendering-CeH1PY9S.js";import"./SchemaValidationContext-DLNGXai_.js";import"./SourceFileHeaderActions-HoUciheJ.js";const u="_page_qv4ce_1",h="_parentLink_qv4ce_8",v="_main_qv4ce_21",_="_status_qv4ce_27",s={page:u,parentLink:h,main:v,status:_};function G(){const{t:o}=p(),a=l(),{projectId:i,sessionId:r,agentId:e}=m();if(!i||!r||!e)return t.jsx("div",{className:s.page,children:t.jsx("p",{className:s.status,children:o("providerChildPageInvalidUrl")})});const n=`${a}/projects/${i}/sessions/${r}`;return t.jsx("div",{className:s.page,children:t.jsx("main",{className:s.main,children:t.jsx(d,{projectId:i,sessionId:r,agentId:e,headingLevel:1,actions:t.jsx(c,{className:s.parentLink,to:n,children:o("providerChildPageBack")})},e)})})}export{G as ProviderChildSessionPage};
|