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.
Files changed (361) hide show
  1. package/bundled/@yep-anywhere/shared/dist/__tests__/model-prices.test.js +12 -0
  2. package/bundled/@yep-anywhere/shared/dist/__tests__/model-prices.test.js.map +1 -1
  3. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +2 -2
  4. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -1
  5. package/bundled/@yep-anywhere/shared/dist/app-types.js +5 -5
  6. package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -1
  7. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.d.ts +21 -0
  8. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.d.ts.map +1 -1
  9. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.js +22 -1
  10. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.js.map +1 -1
  11. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts +2 -2
  12. package/bundled/@yep-anywhere/shared/dist/find/documentFind.d.ts +41 -0
  13. package/bundled/@yep-anywhere/shared/dist/find/documentFind.d.ts.map +1 -0
  14. package/bundled/@yep-anywhere/shared/dist/find/documentFind.js +280 -0
  15. package/bundled/@yep-anywhere/shared/dist/find/documentFind.js.map +1 -0
  16. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.d.ts +2 -0
  17. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.d.ts.map +1 -0
  18. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.d.ts +2 -0
  19. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.d.ts.map +1 -0
  20. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.js +5 -0
  21. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.js.map +1 -0
  22. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.js +59 -0
  23. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.js.map +1 -0
  24. package/bundled/@yep-anywhere/shared/dist/find/protocol.d.ts +46 -0
  25. package/bundled/@yep-anywhere/shared/dist/find/protocol.d.ts.map +1 -0
  26. package/bundled/@yep-anywhere/shared/dist/find/protocol.js +45 -0
  27. package/bundled/@yep-anywhere/shared/dist/find/protocol.js.map +1 -0
  28. package/bundled/@yep-anywhere/shared/dist/index.d.ts +4 -2
  29. package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
  30. package/bundled/@yep-anywhere/shared/dist/index.js +3 -1
  31. package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
  32. package/bundled/@yep-anywhere/shared/dist/model-prices.d.ts.map +1 -1
  33. package/bundled/@yep-anywhere/shared/dist/model-prices.js +9 -2
  34. package/bundled/@yep-anywhere/shared/dist/model-prices.js.map +1 -1
  35. package/bundled/@yep-anywhere/shared/dist/pdfjs.d.ts +7 -0
  36. package/bundled/@yep-anywhere/shared/dist/pdfjs.d.ts.map +1 -0
  37. package/bundled/@yep-anywhere/shared/dist/pdfjs.js +7 -0
  38. package/bundled/@yep-anywhere/shared/dist/pdfjs.js.map +1 -0
  39. package/bundled/@yep-anywhere/shared/dist/skill-invocations.d.ts.map +1 -1
  40. package/bundled/@yep-anywhere/shared/dist/skill-invocations.js +7 -10
  41. package/bundled/@yep-anywhere/shared/dist/skill-invocations.js.map +1 -1
  42. package/bundled/@yep-anywhere/shared/package.json +1 -1
  43. package/client-dist/assets/{AboutSettings-CHsaLshd.js → AboutSettings-CCzudbSj.js} +1 -1
  44. package/client-dist/assets/{ActivityPage-CBVcBckm.js → ActivityPage-Bn0LbMgE.js} +1 -1
  45. package/client-dist/assets/{AgentContextSettings-DLLaiwUX.js → AgentContextSettings-DI8jQVIx.js} +1 -1
  46. package/client-dist/assets/{AgentsPage-C3_U9MGs.js → AgentsPage-Ci_iJt8T.js} +1 -1
  47. package/client-dist/assets/App-rFnK5pnF.js +2 -0
  48. package/client-dist/assets/AppearanceSettings-DTYVt0W5.js +2 -0
  49. package/client-dist/assets/{AppsSettings-B1BIWKaz.js → AppsSettings-hbh_sguk.js} +1 -1
  50. package/client-dist/assets/{AttachmentChip-CQTl9l1O.js → AttachmentChip-BFve3lTD.js} +1 -1
  51. package/client-dist/assets/{AuthContext-BQK10GgC.js → AuthContext-DmXjW0be.js} +1 -1
  52. package/client-dist/assets/{BangCommandDisplayObject-BDGW0BZN.js → BangCommandDisplayObject-BH2KRGnc.js} +1 -1
  53. package/client-dist/assets/{BangCommandsPage-C1-n2iHi.js → BangCommandsPage-MfkuL8yS.js} +1 -1
  54. package/client-dist/assets/{BrowserDebugToolbarButton-CRE47FFy.js → BrowserDebugToolbarButton-BPghQu17.js} +1 -1
  55. package/client-dist/assets/{CacheMissBillingSettings-BspB12sl.js → CacheMissBillingSettings-rUgC-_DD.js} +1 -1
  56. package/client-dist/assets/{CodexUpdatePrompt-BXTqvclk.js → CodexUpdatePrompt-mT9K-f1e.js} +1 -1
  57. package/client-dist/assets/{CommittedRangeInput-bK7EXtAc.js → CommittedRangeInput-BwuV6Q6c.js} +1 -1
  58. package/client-dist/assets/{CommittedRangeNumberInput-bGOjN2Xv.js → CommittedRangeNumberInput-C5YSVltB.js} +1 -1
  59. package/client-dist/assets/{ComputerControlSettings-BLA4wsEA.js → ComputerControlSettings-MWIdP7SS.js} +1 -1
  60. package/client-dist/assets/{ConversationPreviewPage-rxHQQOck.js → ConversationPreviewPage-B47r7mUF.js} +2 -2
  61. package/client-dist/assets/{DevelopmentSettings-CFo3ctnP.js → DevelopmentSettings-BEAy_xq-.js} +1 -1
  62. package/client-dist/assets/{DevicesSettings-DPdJOmEQ.js → DevicesSettings-DKQOZkRN.js} +1 -1
  63. package/client-dist/assets/{EmulatorPage-RPHDvihL.js → EmulatorPage-DlsPq3nR.js} +1 -1
  64. package/client-dist/assets/{EmulatorSettings-8dHy0xqk.js → EmulatorSettings-C6Ye1k_Y.js} +1 -1
  65. package/client-dist/assets/{EnvironmentSettings-DaFyodJV.js → EnvironmentSettings-ou8UNqTa.js} +1 -1
  66. package/client-dist/assets/{FilePage-BwbKyIGF.js → FilePage-Cw2PaO5H.js} +1 -1
  67. package/client-dist/assets/{FilterDropdown-BiB5gAUh.js → FilterDropdown-CACc6ysA.js} +1 -1
  68. package/client-dist/assets/{FloatingActionButton-DEiaqWhv.js → FloatingActionButton-Bl1Eumxh.js} +1 -1
  69. package/client-dist/assets/{GitStatusPage-CSXr__tv.js → GitStatusPage-CLTkgnDI.js} +1 -1
  70. package/client-dist/assets/{GlobalSessionsPage-C-CbcZjC.js → GlobalSessionsPage-Bvzs4zmW.js} +1 -1
  71. package/client-dist/assets/{HeartbeatTextArea-DWZZh0eE.js → HeartbeatTextArea-CtP5kx9R.js} +1 -1
  72. package/client-dist/assets/{HostIdentityContext-DbEx7dor.js → HostIdentityContext-DA7dMF-y.js} +1 -1
  73. package/client-dist/assets/{HostsPage-BRlkrB-8.js → HostsPage-CBOYGC2-.js} +1 -1
  74. package/client-dist/assets/{InboxContext-DtjKccKZ.js → InboxContext-8PXoTbK1.js} +1 -1
  75. package/client-dist/assets/{InboxPage-DFaLlFm5.js → InboxPage-DWl7uzdw.js} +1 -1
  76. package/client-dist/assets/{IssueSettings-CHjLBTZK.js → IssueSettings-BVljRpuD.js} +1 -1
  77. package/client-dist/assets/{IssuesPage-CfYD-jwK.js → IssuesPage-BFxgsMkf.js} +1 -1
  78. package/client-dist/assets/{LifecycleWebhooksSettings-Ir3_1MvY.js → LifecycleWebhooksSettings-Qw_dN3F3.js} +1 -1
  79. package/client-dist/assets/{LocalAccessSettings-BVh3wBDY.js → LocalAccessSettings-SWirs75o.js} +1 -1
  80. package/client-dist/assets/LocalMediaModal-B3KXtyEB.css +1 -0
  81. package/client-dist/assets/LocalMediaModal-B9eHVx6y.js +14 -0
  82. package/client-dist/assets/{LoginPage-irZxKYu1.js → LoginPage-CYWqVJ95.js} +1 -1
  83. package/client-dist/assets/{MessageAge-CKdiBg7K.js → MessageAge-CaPpa1nH.js} +1 -1
  84. package/client-dist/assets/{MessageDeliverySettings-BJ6Hgu1F.js → MessageDeliverySettings-BUSuGKlc.js} +1 -1
  85. package/client-dist/assets/MessageInput-a13ZPAHv.js +3 -0
  86. package/client-dist/assets/{MessageInputToolbar-CvUMMGJv.js → MessageInputToolbar-CQGTnVea.js} +3 -3
  87. package/client-dist/assets/MessageList-C7kAuWKg.js +4 -0
  88. package/client-dist/assets/{Modal-DOzUIhWU.js → Modal-ClSjJagX.js} +2 -2
  89. package/client-dist/assets/{ModelSettings-SWaaTKgm.js → ModelSettings-Dnd4yzmI.js} +1 -1
  90. package/client-dist/assets/{NavigationLayout-D8BMwd7T.js → NavigationLayout-BTFsWVtE.js} +2 -2
  91. package/client-dist/assets/{NewSessionPage-BBFzYBNs.js → NewSessionPage-BfiAS-Mo.js} +1 -1
  92. package/client-dist/assets/{NotificationsSettings-0iotA0wy.js → NotificationsSettings-B1ugQIp-.js} +1 -1
  93. package/client-dist/assets/{PageHeader-Ca3PbaMb.js → PageHeader-BjwH2pWD.js} +1 -1
  94. package/client-dist/assets/{PerformanceSettings-BgDJMjlN.js → PerformanceSettings-jJYF9SPY.js} +1 -1
  95. package/client-dist/assets/{ProjectSessionDefaultsModal-LEaPwpSM.js → ProjectSessionDefaultsModal-G_0uxJEv.js} +1 -1
  96. package/client-dist/assets/{ProjectTemplatesSettings-fPlh8ZpJ.js → ProjectTemplatesSettings-BQTCV3-3.js} +1 -1
  97. package/client-dist/assets/{ProjectsPage-CiQ3rBB_.js → ProjectsPage-suTd8s9l.js} +1 -1
  98. package/client-dist/assets/ProviderBadge-P0VTI71n.js +1 -0
  99. package/client-dist/assets/{ProviderChildSessionDetail-CSAbaZtr.js → ProviderChildSessionDetail-D0472EW8.js} +13 -13
  100. package/client-dist/assets/ProviderChildSessionPage-9__sgY14.js +1 -0
  101. package/client-dist/assets/{ProvidersSettings-B327MdUT.js → ProvidersSettings-Bwzy73Rk.js} +1 -1
  102. package/client-dist/assets/{RecapAfterSecondsControl-DWG9fB4u.js → RecapAfterSecondsControl-CxuXyFSr.js} +1 -1
  103. package/client-dist/assets/{RelayProtocol-DOWXVB0k.js → RelayProtocol-BpdH0COG.js} +1 -1
  104. package/client-dist/assets/{RemoteAccessSettings-CBSIP-qP.js → RemoteAccessSettings-Dn7KB5nK.js} +1 -1
  105. package/client-dist/assets/{RemoteExecutorsSettings-DDAqEB42.js → RemoteExecutorsSettings-Cjl4Y2rB.js} +1 -1
  106. package/client-dist/assets/{SchemaValidationContext-DLNGXai_.js → SchemaValidationContext-57RCj4c4.js} +1 -1
  107. package/client-dist/assets/{SearchPreview-BCP67hKg.js → SearchPreview-OzVFWPJZ.js} +1 -1
  108. package/client-dist/assets/{SessionHeader.module-CHO2T3eQ.js → SessionHeader.module-BpaFAQ-S.js} +1 -1
  109. package/client-dist/assets/SessionPage-BYthaEfZ.js +50 -0
  110. package/client-dist/assets/SessionPage-CXXEAwu2.css +1 -0
  111. package/client-dist/assets/{SettingsItem-BWF_CyTI.js → SettingsItem-C9Vh5p7F.js} +1 -1
  112. package/client-dist/assets/{SettingsSection-DbOwfvBD.js → SettingsSection-BaPzETK6.js} +1 -1
  113. package/client-dist/assets/{SourceControlSettings-BopLkzc6.js → SourceControlSettings-DnqLg0db.js} +1 -1
  114. package/client-dist/assets/{SourceFileHeaderActions-HoUciheJ.js → SourceFileHeaderActions-PjhUGnn6.js} +1 -1
  115. package/client-dist/assets/SpeechControlMenu-BYVdEa3C.js +2 -0
  116. package/client-dist/assets/{SpeechSettings-B4mB2LIj.js → SpeechSettings-B6LkqfSK.js} +1 -1
  117. package/client-dist/assets/{SpeechSmartTurnControls-tb5zP_85.js → SpeechSmartTurnControls-LPq9wBaM.js} +1 -1
  118. package/client-dist/assets/{StorageSettings-B5A0CtTo.js → StorageSettings-DtsJnYaz.js} +1 -1
  119. package/client-dist/assets/{ThinkingControls-BEweLRqu.js → ThinkingControls-DXbxdJRi.js} +1 -1
  120. package/client-dist/assets/{ToolbarSettings-CJbxOope.js → ToolbarSettings-Nb2BKpnk.js} +1 -1
  121. package/client-dist/assets/{UsersSettings-NWqRSGov.js → UsersSettings-BdvqmyqK.js} +1 -1
  122. package/client-dist/assets/ViewerModePage-DzRIpuYF.js +1 -0
  123. package/client-dist/assets/{VoiceInputButton-0BzvkjjK.js → VoiceInputButton-CCgovfyf.js} +1 -1
  124. package/client-dist/assets/{WorkstreamsPage-oM6jTLsK.js → WorkstreamsPage-dlEUllSL.js} +1 -1
  125. package/client-dist/assets/{YaServerProvider-BNTM9_P9.js → YaServerProvider-CN3tC5UL.js} +1 -1
  126. package/client-dist/assets/{YepAnywhereLogo-C4H1sg3q.js → YepAnywhereLogo-5zFKWjQq.js} +1 -1
  127. package/client-dist/assets/{abnfDiagram-VCTEODGH-DIBSwOuB.js → abnfDiagram-VCTEODGH-BWHUBcV3.js} +1 -1
  128. package/client-dist/assets/{arc-Blz12Cef.js → arc-DKsIJWGD.js} +1 -1
  129. package/client-dist/assets/{architectureDiagram-5GKGNRK7-CtTnQhBI.js → architectureDiagram-5GKGNRK7-BuLImqW3.js} +1 -1
  130. package/client-dist/assets/{attachmentFileNames-DwaA5IPB.js → attachmentFileNames-CBV_5g65.js} +1 -1
  131. package/client-dist/assets/{blockDiagram-I7D4REHJ-BanTkGM6.js → blockDiagram-I7D4REHJ-CJ4Gh6sL.js} +1 -1
  132. package/client-dist/assets/{c4Diagram-7LVT6UL2-C4p1KgTp.js → c4Diagram-7LVT6UL2-WR43XvCI.js} +1 -1
  133. package/client-dist/assets/channel-PV8AAsuo.js +1 -0
  134. package/client-dist/assets/{chunk-2Q5K7J3B-CJSvy8go.js → chunk-2Q5K7J3B-CiP4m_EA.js} +1 -1
  135. package/client-dist/assets/{chunk-5VM5RSS4-BVg02Giz.js → chunk-5VM5RSS4-BUAhj1h9.js} +1 -1
  136. package/client-dist/assets/{chunk-F27PBJKO-f_VOUJ8l.js → chunk-F27PBJKO-BUZNwiGx.js} +1 -1
  137. package/client-dist/assets/{chunk-IMKFNOWR-P5H0uE4d.js → chunk-IMKFNOWR-CX1a0BCE.js} +1 -1
  138. package/client-dist/assets/{chunk-JWPE2WC7-BpEGNu2X.js → chunk-JWPE2WC7-C6tL-mLF.js} +1 -1
  139. package/client-dist/assets/{chunk-POPQ4Y6H-oZudgMt7.js → chunk-POPQ4Y6H-BzijGGWv.js} +1 -1
  140. package/client-dist/assets/{chunk-SVP7TREG-dMWNgoWs.js → chunk-SVP7TREG-CsZImJKI.js} +1 -1
  141. package/client-dist/assets/{chunk-TICWLB2K-D8VqJUFw.js → chunk-TICWLB2K-TwCtuDc1.js} +1 -1
  142. package/client-dist/assets/{chunk-XXDRQBXY-ZwkKkcDz.js → chunk-XXDRQBXY-C-2EoNns.js} +1 -1
  143. package/client-dist/assets/classDiagram-ZZMXUADV-DvtSxfma.js +1 -0
  144. package/client-dist/assets/classDiagram-v2-VYDZK3BY-DvtSxfma.js +1 -0
  145. package/client-dist/assets/{client-D_ikArFV.js → client-Ci_HPGfl.js} +1 -1
  146. package/client-dist/assets/{compactSettingsControls-CzgNQCH3.js → compactSettingsControls-C9mLZh5H.js} +1 -1
  147. package/client-dist/assets/{cose-bilkent-JH36ORCC-DrtmDj3A.js → cose-bilkent-JH36ORCC-CmbEx2jT.js} +1 -1
  148. package/client-dist/assets/{cynefin-OW5HDTMX-CYhxgFq5.js → cynefin-OW5HDTMX-BSQHHXFU.js} +1 -1
  149. package/client-dist/assets/{cynefinDiagram-5FMLGOSQ-BXvBp5eq.js → cynefinDiagram-5FMLGOSQ-C-62JZJD.js} +1 -1
  150. package/client-dist/assets/{dagre-GXQ25YYZ-CdvzhCPS.js → dagre-GXQ25YYZ-BBERQe_A.js} +1 -1
  151. package/client-dist/assets/{diagram-S7CK7UJ4-DSGzzHN1.js → diagram-S7CK7UJ4-muw11lmG.js} +1 -1
  152. package/client-dist/assets/{diagram-UQ7AKVKN-Bk4fbl1S.js → diagram-UQ7AKVKN-DpePWzAe.js} +1 -1
  153. package/client-dist/assets/{diagram-VSXAHHWV-BAOCj4oX.js → diagram-VSXAHHWV-DHX6AHUY.js} +1 -1
  154. package/client-dist/assets/{diagram-VX7I27RA-KHmeuEjq.js → diagram-VX7I27RA-DYmR6NH_.js} +1 -1
  155. package/client-dist/assets/{diagram-Z3DM3KII-D6GpIAdx.js → diagram-Z3DM3KII-BC1SenHB.js} +1 -1
  156. package/client-dist/assets/{ebnfDiagram-PWID7BFC-Bm_JuhNL.js → ebnfDiagram-PWID7BFC-EVpri6Ma.js} +1 -1
  157. package/client-dist/assets/{erDiagram-RLTQ6QDP-u5Ryj9Z_.js → erDiagram-RLTQ6QDP-DthztUaa.js} +1 -1
  158. package/client-dist/assets/{flowDiagram-HODETNUW-C9A7e1yC.js → flowDiagram-HODETNUW-DEpC5nMx.js} +1 -1
  159. package/client-dist/assets/{frontendReload-DN8qVYjF.js → frontendReload-CBdyvvdy.js} +1 -1
  160. package/client-dist/assets/{ganttDiagram-EL5Y4UJY-BEIN_FhZ.js → ganttDiagram-EL5Y4UJY-Csqji8t1.js} +1 -1
  161. package/client-dist/assets/{gitGraphDiagram-WWUBYQGX-Cu5ow6Ls.js → gitGraphDiagram-WWUBYQGX-DVX1SDIE.js} +1 -1
  162. package/client-dist/assets/{hostStorage-C37tOOJa.js → hostStorage-D1KAm3U1.js} +1 -1
  163. package/client-dist/assets/{index-_2WVhpKj.js → index-BESqiBDI.js} +1 -1
  164. package/client-dist/assets/index-BkOdUxq4.js +2 -0
  165. package/client-dist/assets/index-CPb-36gi.css +1 -0
  166. package/client-dist/assets/{index-YAR5D3xY.js → index-CoR-vzsb.js} +1 -1
  167. package/client-dist/assets/index-Cv3tQXyE.js +1 -0
  168. package/client-dist/assets/{index-LT-lzpNS.js → index-DSFMItgO.js} +1 -1
  169. package/client-dist/assets/index-umZg0LZ6.js +81 -0
  170. package/client-dist/assets/{infoDiagram-27XIBGKW-ILfv0Qu_.js → infoDiagram-27XIBGKW-CHm3qsd2.js} +1 -1
  171. package/client-dist/assets/{ishikawaDiagram-5VMMS53U-D1P8nenz.js → ishikawaDiagram-5VMMS53U-tBRZwz-_.js} +1 -1
  172. package/client-dist/assets/{journeyDiagram-3NMN7TZE-CXP61NqX.js → journeyDiagram-3NMN7TZE-EJic7nqD.js} +1 -1
  173. package/client-dist/assets/{kanban-definition-UXKFOSKX-2x79Nimu.js → kanban-definition-UXKFOSKX-DtzL6eeO.js} +1 -1
  174. package/client-dist/assets/{layout-D7AfOq-G.js → layout-gb-Axsoq.js} +1 -1
  175. package/client-dist/assets/{linear-B_4Bripc.js → linear-CAe4xGbR.js} +1 -1
  176. package/client-dist/assets/{mermaid.core-y_avJe8E.js → mermaid.core-BCu1nv8H.js} +5 -5
  177. package/client-dist/assets/{mindmap-definition-YA3MSWOX-DwMJuV6d.js → mindmap-definition-YA3MSWOX-C7-KSPtJ.js} +1 -1
  178. package/client-dist/assets/{pegDiagram-XKGWAZYB-43LaxzRF.js → pegDiagram-XKGWAZYB-iWVH9rbY.js} +1 -1
  179. package/client-dist/assets/{pieDiagram-E7YTZNPT-DAOi_afd.js → pieDiagram-E7YTZNPT-VKD6PLHa.js} +1 -1
  180. package/client-dist/assets/{providerChildSessions-BpJF5D9s.css → providerChildSessions-Cd7oK6KQ.css} +1 -1
  181. package/client-dist/assets/providerChildSessions-DbLFSybt.js +77 -0
  182. package/client-dist/assets/{quadrantDiagram-AXDQQJYC-BRPBWWpv.js → quadrantDiagram-AXDQQJYC-AXFugcFl.js} +1 -1
  183. package/client-dist/assets/{railroadDiagram-O6MQD6OU-xAuDG62P.js → railroadDiagram-O6MQD6OU-D6oZy6Al.js} +1 -1
  184. package/client-dist/assets/{recentProjectPathLinks-B6pQxzWg.js → recentProjectPathLinks-D0Dx6YXT.js} +1 -1
  185. package/client-dist/assets/{registerServiceWorker-fKJh5dWO.js → registerServiceWorker-B8K2KVOY.js} +1 -1
  186. package/client-dist/assets/{relayEndpoints-DRyKx83V.js → relayEndpoints-BTq9xppf.js} +1 -1
  187. package/client-dist/assets/{remoteRoutePaths-BxKY1U2z.js → remoteRoutePaths-D8htA0xa.js} +1 -1
  188. package/client-dist/assets/{requirementDiagram-BXWQKSXE-BJvybhuU.js → requirementDiagram-BXWQKSXE-Eqtb74It.js} +1 -1
  189. package/client-dist/assets/{sankeyDiagram-P5KCCOFB-aAAflmwo.js → sankeyDiagram-P5KCCOFB-CxvDiZ1R.js} +1 -1
  190. package/client-dist/assets/{sequenceDiagram-WJ2MYXX4-CP3BPtU-.js → sequenceDiagram-WJ2MYXX4-BbpkgW2L.js} +1 -1
  191. package/client-dist/assets/{sessionNavigationState-MSOOrZi4.js → sessionNavigationState-BXejf2ZW.js} +1 -1
  192. package/client-dist/assets/sessionRouteLayer-D9T2QT8G.js +1 -0
  193. package/client-dist/assets/{sizeCapture-INFHLROL-BwAQ5zb3.js → sizeCapture-INFHLROL-DcuwWD5r.js} +1 -1
  194. package/client-dist/assets/{sourceControlNavigationState-t_nQLZvO.js → sourceControlNavigationState-BJbTzWTE.js} +1 -1
  195. package/client-dist/assets/{speechDraftTransaction-8sgF4uer.js → speechDraftTransaction-WhqFE1h9.js} +1 -1
  196. package/client-dist/assets/{stateDiagram-D77RDMKH-B8llvNN3.js → stateDiagram-D77RDMKH-Cidpq73w.js} +1 -1
  197. package/client-dist/assets/stateDiagram-v2-MP3YSRHH-DFqKXxjz.js +1 -0
  198. package/client-dist/assets/{swimlanes-42K2YHIH-qqdgDD32.js → swimlanes-42K2YHIH-Ba8C7MwG.js} +1 -1
  199. package/client-dist/assets/swimlanesDiagram-VR7AAH4N-3pW2TcAt.js +8 -0
  200. package/client-dist/assets/{timeline-definition-24CTP7MA-EBxDGVBl.js → timeline-definition-24CTP7MA-CKefGvUK.js} +1 -1
  201. package/client-dist/assets/{useAcliCommentarySetting-JMx-BSAu.js → useAcliCommentarySetting-CBKAl7qr.js} +2 -2
  202. package/client-dist/assets/{useActivityBusState-CnG-LXsr.js → useActivityBusState-C0dor9p7.js} +1 -1
  203. package/client-dist/assets/{useBackgroundRevalidation-7vLWDD_M.js → useBackgroundRevalidation-C79HAUP3.js} +1 -1
  204. package/client-dist/assets/{useCodexUpdateStatus-CAR1HkyO.js → useCodexUpdateStatus-CEZO_f2Y.js} +1 -1
  205. package/client-dist/assets/{useConnectedDevices-DxgKt21O.js → useConnectedDevices-Ds-DuUDc.js} +1 -1
  206. package/client-dist/assets/{useDocumentTitle-bldu9XOq.js → useDocumentTitle-Xz5t-nlB.js} +1 -1
  207. package/client-dist/assets/{useEmulators-BPiSdRjQ.js → useEmulators-qS_cCZ3I.js} +1 -1
  208. package/client-dist/assets/{useFileActivity-D0JXhEz7.js → useFileActivity-BoW4X3DY.js} +1 -1
  209. package/client-dist/assets/{useFloatingActionButtonEnabled-Dp_hZuYb.js → useFloatingActionButtonEnabled-2_hw7nSa.js} +1 -1
  210. package/client-dist/assets/{useForkSummaryAutoOpen-Cty_gTm1.js → useForkSummaryAutoOpen-CS33Irpf.js} +1 -1
  211. package/client-dist/assets/{useGeneratedTitleLength-BpbPYGRf.js → useGeneratedTitleLength-D856ktVg.js} +1 -1
  212. package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-BWCiVVkU.js → useKeepMobileKeyboardOpenAfterDelivery-Ba77SbWF.js} +1 -1
  213. package/client-dist/assets/{useModelSettings-CeABGid0.js → useModelSettings-BdlYk1DT.js} +1 -1
  214. package/client-dist/assets/{useNotifyInApp-CuUBcZeR.js → useNotifyInApp-DcWe3dh4.js} +1 -1
  215. package/client-dist/assets/{useOnboarding-BDCBf2Fp.js → useOnboarding-CoE3WF8a.js} +1 -1
  216. package/client-dist/assets/{useProviders-45TZLkhy.js → useProviders-CeN1PclA.js} +1 -1
  217. package/client-dist/assets/{useQuestionAsideSetting-B0bjoe-z.js → useQuestionAsideSetting-CPFw1u0y.js} +1 -1
  218. package/client-dist/assets/{useRecentSessions-COrEGQJH.js → useRecentSessions-ieTzzJu4.js} +1 -1
  219. package/client-dist/assets/{useRelativeNow-XM1dKxcx.js → useRelativeNow-Ca6QGcPa.js} +1 -1
  220. package/client-dist/assets/{useReloadNotifications-JBj22syT.js → useReloadNotifications-Dm1jmdIb.js} +1 -1
  221. package/client-dist/assets/{useRemoteExecutors-Bzvi8gRe.js → useRemoteExecutors-zBAQnQXH.js} +1 -1
  222. package/client-dist/assets/{useSidebarWidth-CITe0sSV.js → useSidebarWidth-CBCcbSLg.js} +1 -1
  223. package/client-dist/assets/{useSourceControlCleanLanding-B-8NTKPa.js → useSourceControlCleanLanding-VDlft5tr.js} +1 -1
  224. package/client-dist/assets/{useStableToolPreviewRendering-CeH1PY9S.js → useStableToolPreviewRendering-hbVp38Jd.js} +1 -1
  225. package/client-dist/assets/{useStreamingEnabled-C535nHwb.js → useStreamingEnabled-hU1g8i7_.js} +1 -1
  226. package/client-dist/assets/{useTabTitleActivityPreference-NekVdSEZ.js → useTabTitleActivityPreference-DhREY7m2.js} +1 -1
  227. package/client-dist/assets/{useVhostAccess-CHT40zJ3.js → useVhostAccess-DUtn_sH1.js} +1 -1
  228. package/client-dist/assets/{useWorkflowTags-Bl7Czynw.js → useWorkflowTags-DxbEBqtf.js} +1 -1
  229. package/client-dist/assets/{vennDiagram-4TSXK5OY-BRLuM0pk.js → vennDiagram-4TSXK5OY-CSGBq-Ur.js} +1 -1
  230. package/client-dist/assets/{wardleyDiagram-VM6X3IG4-D5cPV-h-.js → wardleyDiagram-VM6X3IG4-DIMvcaMb.js} +1 -1
  231. package/client-dist/assets/{xychartDiagram-S5SC5T6Z-M2QslymW.js → xychartDiagram-S5SC5T6Z-TYXSqT3w.js} +1 -1
  232. package/client-dist/index.html +3 -3
  233. package/dist/app.d.ts.map +1 -1
  234. package/dist/app.js +19 -10
  235. package/dist/app.js.map +1 -1
  236. package/dist/artifacts/ArtifactServer.d.ts +0 -1
  237. package/dist/artifacts/ArtifactServer.d.ts.map +1 -1
  238. package/dist/artifacts/ArtifactServer.js +41 -9
  239. package/dist/artifacts/ArtifactServer.js.map +1 -1
  240. package/dist/auth/limitedUserPolicy.d.ts +9 -5
  241. package/dist/auth/limitedUserPolicy.d.ts.map +1 -1
  242. package/dist/auth/limitedUserPolicy.js +64 -35
  243. package/dist/auth/limitedUserPolicy.js.map +1 -1
  244. package/dist/auth/principal.d.ts +6 -0
  245. package/dist/auth/principal.d.ts.map +1 -1
  246. package/dist/auth/principal.js +6 -0
  247. package/dist/auth/principal.js.map +1 -1
  248. package/dist/frontend/static.d.ts.map +1 -1
  249. package/dist/frontend/static.js +2 -1
  250. package/dist/frontend/static.js.map +1 -1
  251. package/dist/middleware/authenticated-transport.d.ts +13 -0
  252. package/dist/middleware/authenticated-transport.d.ts.map +1 -1
  253. package/dist/middleware/authenticated-transport.js +12 -0
  254. package/dist/middleware/authenticated-transport.js.map +1 -1
  255. package/dist/middleware/limited-users.d.ts +9 -5
  256. package/dist/middleware/limited-users.d.ts.map +1 -1
  257. package/dist/middleware/limited-users.js +37 -23
  258. package/dist/middleware/limited-users.js.map +1 -1
  259. package/dist/routes/file-edit.d.ts +4 -1
  260. package/dist/routes/file-edit.d.ts.map +1 -1
  261. package/dist/routes/file-edit.js +22 -6
  262. package/dist/routes/file-edit.js.map +1 -1
  263. package/dist/routes/files.d.ts.map +1 -1
  264. package/dist/routes/files.js +19 -5
  265. package/dist/routes/files.js.map +1 -1
  266. package/dist/routes/pdfjs.d.ts +9 -0
  267. package/dist/routes/pdfjs.d.ts.map +1 -0
  268. package/dist/routes/pdfjs.js +34 -0
  269. package/dist/routes/pdfjs.js.map +1 -0
  270. package/dist/routes/recents.d.ts +4 -1
  271. package/dist/routes/recents.d.ts.map +1 -1
  272. package/dist/routes/recents.js +7 -0
  273. package/dist/routes/recents.js.map +1 -1
  274. package/dist/routes/settings.d.ts +7 -2
  275. package/dist/routes/settings.d.ts.map +1 -1
  276. package/dist/routes/settings.js +43 -1
  277. package/dist/routes/settings.js.map +1 -1
  278. package/dist/routes/ws-relay-handlers.d.ts +12 -0
  279. package/dist/routes/ws-relay-handlers.d.ts.map +1 -1
  280. package/dist/routes/ws-relay-handlers.js +25 -4
  281. package/dist/routes/ws-relay-handlers.js.map +1 -1
  282. package/dist/routes/ws-relay.d.ts.map +1 -1
  283. package/dist/routes/ws-relay.js +8 -0
  284. package/dist/routes/ws-relay.js.map +1 -1
  285. package/dist/sdk/providers/codex-model-catalog.d.ts.map +1 -1
  286. package/dist/sdk/providers/codex-model-catalog.js +5 -3
  287. package/dist/sdk/providers/codex-model-catalog.js.map +1 -1
  288. package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts +4 -1
  289. package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts.map +1 -1
  290. package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts +4 -1
  291. package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts.map +1 -1
  292. package/dist/sdk/providers/codex-protocol/generated/Personality.d.ts +3 -0
  293. package/dist/sdk/providers/codex-protocol/generated/Personality.d.ts.map +1 -1
  294. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.d.ts +2 -0
  295. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.d.ts.map +1 -0
  296. package/dist/sdk/providers/codex-protocol/generated/v2/{ThreadRollbackParams.js → McpAppDisplayMode.js} +1 -1
  297. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.js.map +1 -0
  298. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.d.ts +9 -0
  299. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.d.ts.map +1 -0
  300. package/dist/sdk/providers/codex-protocol/generated/v2/{ThreadRollbackResponse.js → McpAppUi.js} +1 -1
  301. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.js.map +1 -0
  302. package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts +1 -1
  303. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts +4 -0
  304. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts.map +1 -1
  305. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts +6 -1
  306. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts.map +1 -1
  307. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts +4 -0
  308. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts.map +1 -1
  309. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts +9 -0
  310. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts.map +1 -1
  311. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts +9 -0
  312. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts.map +1 -1
  313. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts +4 -0
  314. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts.map +1 -1
  315. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +7 -1
  316. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
  317. package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts +3 -0
  318. package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts.map +1 -1
  319. package/dist/sdk/providers/codex-protocol/index.d.ts +0 -2
  320. package/dist/sdk/providers/codex-protocol/index.d.ts.map +1 -1
  321. package/dist/sdk/providers/codex.d.ts +7 -2
  322. package/dist/sdk/providers/codex.d.ts.map +1 -1
  323. package/dist/sdk/providers/codex.js +21 -20
  324. package/dist/sdk/providers/codex.js.map +1 -1
  325. package/dist/services/ArtifactRebuildService.d.ts +11 -14
  326. package/dist/services/ArtifactRebuildService.d.ts.map +1 -1
  327. package/dist/services/ArtifactRebuildService.js +15 -7
  328. package/dist/services/ArtifactRebuildService.js.map +1 -1
  329. package/dist/services/PdfjsAssetCache.d.ts +20 -0
  330. package/dist/services/PdfjsAssetCache.d.ts.map +1 -0
  331. package/dist/services/PdfjsAssetCache.js +131 -0
  332. package/dist/services/PdfjsAssetCache.js.map +1 -0
  333. package/package.json +3 -3
  334. package/client-dist/assets/App-DYWU2-wq.js +0 -2
  335. package/client-dist/assets/AppearanceSettings-Ci0wlAx3.js +0 -2
  336. package/client-dist/assets/LocalMediaModal-DOcizK52.css +0 -1
  337. package/client-dist/assets/LocalMediaModal-DyDpC0dk.js +0 -12
  338. package/client-dist/assets/MessageInput-leX__dbU.js +0 -3
  339. package/client-dist/assets/MessageList-DDA4Q_Gj.js +0 -4
  340. package/client-dist/assets/ProviderBadge-BKZVllDn.js +0 -1
  341. package/client-dist/assets/ProviderChildSessionPage-vpu5u3YA.js +0 -1
  342. package/client-dist/assets/SessionPage-BJ5qaa-G.js +0 -50
  343. package/client-dist/assets/SessionPage-BiV0X3n1.css +0 -1
  344. package/client-dist/assets/SpeechControlMenu-DEDIWl9h.js +0 -2
  345. package/client-dist/assets/ViewerModePage-Dyq_I7ws.js +0 -1
  346. package/client-dist/assets/channel-DwT-nHaK.js +0 -1
  347. package/client-dist/assets/classDiagram-ZZMXUADV-DdlhZ-2W.js +0 -1
  348. package/client-dist/assets/classDiagram-v2-VYDZK3BY-DdlhZ-2W.js +0 -1
  349. package/client-dist/assets/index-BY-TgOY-.js +0 -81
  350. package/client-dist/assets/index-BgkZrNQv.js +0 -1
  351. package/client-dist/assets/index-BrCZcBcO.js +0 -2
  352. package/client-dist/assets/index-wA2zlxt-.css +0 -1
  353. package/client-dist/assets/providerChildSessions-DVWCZpC4.js +0 -78
  354. package/client-dist/assets/stateDiagram-v2-MP3YSRHH-CD7vRqY6.js +0 -1
  355. package/client-dist/assets/swimlanesDiagram-VR7AAH4N-NBdWyLIY.js +0 -8
  356. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts +0 -14
  357. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts.map +0 -1
  358. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.js.map +0 -1
  359. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts +0 -12
  360. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts.map +0 -1
  361. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ import{aG as ls,u as yi,r as s,j as i}from"./index-umZg0LZ6.js";import{c as Jr,N as vi}from"./MessageInputToolbar-CQGTnVea.js";import{f as bi,g as xi}from"./types-BHkriVjU.js";import{u as Ti,g as nn,d as ki,e as wi,f as Ci,h as Si,i as Di,r as vt,p as bt,j as xt,k as ji,D as De,l as Tt}from"./SpeechControlMenu-BYVdEa3C.js";import{u as Ki,h as Xr,f as Zr,c as Ii}from"./speechDraftTransaction-WhqFE1h9.js";import{u as Ei}from"./useKeepMobileKeyboardOpenAfterDelivery-Ba77SbWF.js";import{u as Ri,g as qr,a as Ni,b as Pi,t as Li,d as rn,l as $i,c as An,e as Wi,m as _i,f as Bi,r as es}from"./YaServerProvider-CN3tC5UL.js";import{b as Qi,g as ts,r as Ai,c as Fi,s as zi,d as ns,e as Oi,i as Ui,F as Hi,P as Vi,f as Mi,h as Gi}from"./useRecentSessions-ieTzzJu4.js";import{e as Yi}from"./Modal-ClSjJagX.js";import{f as Ji}from"./attachmentFileNames-CBV_5g65.js";import{m as Xi}from"./providerChildSessions-DbLFSybt.js";import{g as os,r as rs,Q as Zi,l as ss,a as is,f as qi}from"./SessionPage-BYthaEfZ.js";import{h as Qe}from"./deviceDetection-BVPclkty.js";import{s as ec,q as tc}from"./NavigationLayout-BTFsWVtE.js";import{h as je}from"./ProjectSessionDefaultsModal-G_0uxJEv.js";import{A as nc,c as sn}from"./AttachmentChip-BFve3lTD.js";import{V as Fn}from"./VoiceInputButton-CCgovfyf.js";import"./react-runtime-D-UPQ57m.js";import"./index-CoR-vzsb.js";import"./remoteRoutePaths-D8htA0xa.js";import"./RelayProtocol-BpdH0COG.js";import"./client-Ci_HPGfl.js";import"./useModelSettings-BdlYk1DT.js";import"./ProviderBadge-P0VTI71n.js";import"./browserDebugPerformance-ZT9tAT-A.js";import"./frontendReload-CBdyvvdy.js";import"./useProviders-CeN1PclA.js";import"./useRelativeNow-Ca6QGcPa.js";import"./LocalMediaModal-B9eHVx6y.js";import"./newSessionPrefill-DKcy0abh.js";import"./relay-url-j3kYm5KO.js";import"./appHref-ByaEnJGJ.js";import"./ThinkingControls-DXbxdJRi.js";import"./CommittedRangeInput-BwuV6Q6c.js";import"./MessageAge-CaPpa1nH.js";import"./SpeechSmartTurnControls-LPq9wBaM.js";import"./recentProjectPathLinks-D0Dx6YXT.js";import"./useSidebarWidth-CBCcbSLg.js";import"./useRemoteExecutors-zBAQnQXH.js";import"./newSessionDefaults-C6a9Cpc6.js";import"./RecapAfterSecondsControl-CxuXyFSr.js";import"./sessionNavigationState-BXejf2ZW.js";import"./FilterDropdown-CACc6ysA.js";import"./katex-Dv2p4YRM.js";import"./SessionHeader.module-BpaFAQ-S.js";import"./HostIdentityContext-DA7dMF-y.js";import"./ProviderChildSessionDetail-D0472EW8.js";import"./useAcliCommentarySetting-CBKAl7qr.js";import"./postCompactReplay-D6HuoQK2.js";import"./BangCommandDisplayObject-BH2KRGnc.js";import"./useStableToolPreviewRendering-hbVp38Jd.js";import"./SchemaValidationContext-57RCj4c4.js";import"./SourceFileHeaderActions-PjhUGnn6.js";import"./useVhostAccess-DUtn_sH1.js";import"./useActivityBusState-C0dor9p7.js";import"./useForkSummaryAutoOpen-CS33Irpf.js";import"./useQuestionAsideSetting-CPFw1u0y.js";import"./HeartbeatTextArea-CtP5kx9R.js";import"./useDocumentTitle-Xz5t-nlB.js";import"./useGeneratedTitleLength-D856ktVg.js";import"./long-context-effort-warning-C6XHizE1.js";import"./useStreamingEnabled-hU1g8i7_.js";import"./speech-vocabulary-CxfxZ-1r.js";import"./useFileActivity-BoW4X3DY.js";import"./index-Cv3tQXyE.js";import"./sourceControlNavigationState-BJbTzWTE.js";import"./YepAnywhereLogo-5zFKWjQq.js";const rc=2,sc=1440*60;function ic(_){if(!(typeof _!="number"||!Number.isFinite(_)))return Math.min(sc,Math.max(0,Math.round(_)))}function cc(){return ls()}function lc(){return`speech-target-${ls()}`}const oc="_keyboardSpeechSlot_5ljwf_1",ac="_clearComposer_5ljwf_5",uc="_collapsedWithLeadingMicrophone_5ljwf_28",pc="_collapsedWithLeadingMicrophoneOnly_5ljwf_34",fc="_collapsedActionsWithMicrophone_5ljwf_40",hc="_fullPane_5ljwf_54",dc="_fullPaneToggle_5ljwf_59",gc="_keyboardSpeechSlotWithWaveform_5ljwf_108",mc="_keyboardPrimaryWithWaveform_5ljwf_114",le={keyboardSpeechSlot:oc,clearComposer:ac,collapsedWithLeadingMicrophone:uc,collapsedWithLeadingMicrophoneOnly:pc,collapsedActionsWithMicrophone:fc,fullPane:hc,fullPaneToggle:dc,keyboardSpeechSlotWithWaveform:gc,keyboardPrimaryWithWaveform:mc};function zn(){var h;const _=(h=window.visualViewport)==null?void 0:h.height;return typeof _=="number"?Math.min(window.innerHeight,_):window.innerHeight}function cs(_){const h=os(_);return h?`${h.kind} ${h.token}\0${_.slice(2)}`:null}function Rl({onSend:_,questionAside:h,onQueue:ye,onProjectQueue:ve,onProjectQueueNewSession:Ke,disabled:m,placeholder:as,mode:us="default",onModeChange:ps,modeChangesApplyNextTurn:fs,modeChangePending:hs,isRunning:On,isThinking:Un,onStop:cn,onDone:kt,doneTitle:ds,draftKey:wt,draftIndex:gs,collapsed:oe,onFullPaneControlsReady:be,onDraftControlsReady:Ct,onDraftTextChange:St,contextUsage:ms,lastActivityAt:ys,positionTimestampMs:vs,positionTimestampStore:bs,sessionLiveness:xs,providerRuntimeStatus:Ts,projectId:Ae,completionRenderItems:ks,speechVocabulary:ae,sessionId:Dt,attachments:b=[],onAttach:Fe,onRemoveAttachment:ze,uploadProgress:A=[],supportsPermissionMode:ws=!0,supportsThinkingToggle:Cs=!0,supportsSteering:ln=!1,supportsSteerNow:on=!1,primaryActionKind:Ss,slashCommands:G=[],onCustomCommand:jt,onBtwShortcut:Kt,btwActive:Hn=!1,btwHasAsides:Ds=!1,btwToolbarMode:js,thinkingProvider:Ks,thinkingModel:Is,liveThinkingSelection:Es,contextRequestedModel:Rs,heartbeatEnabled:Ns=!1,patientQueuePatienceSeconds:Ps,onToggleHeartbeat:Ls,onConfigureHeartbeat:$s,correctionActive:an=!1,onCancelCorrection:Ie,onRecallLastSubmission:It,onCancelLatestDeferred:un,promptSuggestion:ue,onDismissPromptSuggestion:xe,forkSummaryMode:o,onForkSummaryShortcut:pn,bangSupport:S,turnRecall:F}){var Fr,zr,Or,Ur,Hr,Vr;const{t:u}=yi(),{visibility:Y}=Ti(),{keepMobileKeyboardOpenAfterDelivery:Vn}=Ei(),[a,N,p]=Ki(wt,{sessionDraft:gs}),d=s.useRef(null),[fn,Mn]=s.useState(!1),Gn=s.useRef(null),$=s.useRef(null),Ee=s.useRef(null),Oe=s.useRef(null),Re=s.useRef(null),Ue=s.useRef([]),D=s.useRef(null),j=s.useRef(null),W=s.useRef(new Map),J=s.useRef(null),X=s.useRef(null),hn=s.useRef(null),dn=s.useRef(null),Et=s.useRef(!1),Rt=s.useRef(null),gn=s.useRef(!1),Ne=s.useRef(null),[He,Yn]=s.useState(!1),[Te,mn]=s.useState(!1),[q,E]=s.useState(""),se=s.useRef(q);se.current=q;const[Ve,Nt]=s.useState(null),pe=s.useRef(null),z=s.useRef(null),fe=s.useRef(!1),Pt=s.useRef(!1),yn=s.useRef(!1),Jn=s.useRef(()=>{}),{asrAttributionMs:Xn,speechMessagePrefix:U}=Ri(),{active:Ws,noteSpeech:Lt,isRecent:ee,consume:te}=Qi(Xn),[_s,Bs]=s.useState(!1),[,Me]=s.useState(0),[$t,Ge]=s.useState(null),[Wt,_t]=s.useState(0),[Ye,Je]=s.useState(a.length),[Xe,Ze]=s.useState([]),[Zn,qe]=s.useState([]),[vn,et]=s.useState(0),[Qs,Bt]=s.useState(null),Pe=s.useRef(-1),Qt=s.useRef(null),[ne,ie]=s.useState(null),[qn,er]=s.useState(!1),[As,Fs]=s.useState(0),[zs,tr]=s.useState(!1),[bn,At]=s.useState(!1),x=He||oe,tt=b.length>0||A.length>0,Ft=!je(a,b.length+A.length),xn=!!(h!=null&&h.canAsk)&&!Hn&&!o&&!an&&!tt&&!m,nr=xn&&a.endsWith("?")&&!a.trimStart().startsWith("/")&&!a.trimStart().startsWith("!!"),nt=!!(h!=null&&h.onSave)&&a.length===0&&!tt&&!fn&&Ve===null&&!q,P=nn(a,Ye),he=s.useMemo(()=>ki(a,G,Ye),[Ye,G,a]),zt=he[0],Tn=P?`${P.start}:${P.end}:${P.sigil}:${P.query}`:zt?`${zt.start}:${zt.end}:argument:${zt.query}`:null,B=s.useMemo(()=>{var n,c;if(!P||he.length>0)return[];const e=G.filter(r=>wi(r,P)),t=new Map;for(const r of e){const l=r.name.trim().toLowerCase(),g=t.get(l);(!g||P.leading&&P.sigil==="/"&&((n=g.invocation)==null?void 0:n.kind)==="skill"&&((c=r.invocation)==null?void 0:c.kind)!=="skill")&&t.set(l,r)}return e.filter(r=>t.get(r.name.trim().toLowerCase())===r)},[P,G,he.length]),rr=P!==null&&G.some(e=>Ci(e).includes(P.query)),Ot=B.length+he.length,sr=!x&&!m&&(P!==null||he.length>0)&&!tt&&(!rr||B.length>1||he.length>0)&&$t!==Tn&&Ot>0,ir=s.useMemo(()=>Array.from(new Set(Si(a,G).filter(e=>{var t;return((t=e.command.invocation)==null?void 0:t.inventoryState)==="current"}).map(e=>e.canonicalToken))),[G,a]),cr=s.useMemo(()=>G.some(e=>{var t;return((t=e.invocation)==null?void 0:t.kind)==="skill"&&e.invocation.inventoryState==="current"})?Array.from(new Set(Di(a,G).filter(e=>B.length===0||P===null||e.start!==P.start).map(e=>e.token))):[],[P,B.length,G,a]),k=S&&!x?os(a):null,lr=k?cs(a):null,Os=!!S&&!x&&a.startsWith("!!"),kn=!!S&&!x&&a.startsWith(" !!"),rt=[...Zn.map(e=>({source:"history",value:e})),...Xe.map(e=>({source:"candidate",value:e}))],Us=Xe.length>0&&!(Xe.length===1&&k!==null&&(Xe[0]===k.token||Xe[0]===`${k.token}/`)),wn=!x&&!m&&k!==null&&k.token.length>0&&Qs!==lr&&(Zn.length>0||Us),st=o?!o.submitting&&b.length===0&&A.length===0:nt||!!(je(a,b.length)||Ve!==null||q),it=D.current,Ut=qr(a,q,it),ct=it?Ni(a,Ut,it.end,it.replaceEnd??it.end):Pi(a,Ut,a.length),or=s.useRef(S==null?void 0:S.fetchCompletions);or.current=S==null?void 0:S.fetchCompletions;const Cn=(k==null?void 0:k.kind)??null,Sn=(k==null?void 0:k.token)??null,Dn=k?a.slice(2):null;s.useEffect(()=>{const e=or.current;if(!e||!Cn||!Sn||Dn===null){Ze([]),qe([]);return}let t=!1;const n=setTimeout(()=>{e(Sn,Cn,Dn).then(c=>{t||(Ze(c.completions),qe(c.history),et(0))},()=>{t||(Ze([]),qe([]))})},150);return()=>{t=!0,clearTimeout(n)}},[Cn,Sn,Dn]),s.useEffect(()=>{Qt.current!==a&&(Pe.current=-1,Qt.current=null)},[a]);const Hs=`${Tn}\0${Ot}`;s.useEffect(()=>{_t(0)},[Hs]);const ar=Ss??(ln&&ye?"steer":ye?"queue":"send"),de=ln&&!!ye&&ar==="steer",{version:R}=Yi(),jn=((Fr=R==null?void 0:R.clientDefaults)==null?void 0:Fr.busyComposerDefaultAction)??"steer",Ht=((zr=R==null?void 0:R.clientDefaults)==null?void 0:zr.collapsedComposerButton)??"primary",lt=`${wt}:enter-action-kind`,[Vs,Kn]=s.useState(()=>{try{const e=localStorage.getItem(lt);return e==="queue"||e==="steer"?e:null}catch{return null}}),Ms=((Or=R==null?void 0:R.clientDefaults)==null?void 0:Or.steerNowDefault)??bi,ur=((Ur=R==null?void 0:R.clientDefaults)==null?void 0:Ur.patientQueueDefault)??!1,Gs=((Hr=R==null?void 0:R.clientDefaults)==null?void 0:Hr.projectQueueCtrlEnterEnabled)??xi,In=ec(R),pr=Gs&&In&&Y.projectQueue&&!!ve&&!o,[Ys,Js]=s.useState(null),Vt=Ys??Ms,T=de?Vs??jn:ar,fr=ic(Ps)??rc,Le=nt?u("questionAsideSave"):nr?u("questionAsideTitle"):void 0,Xs=Le??(o?o.submitLabel:u(T==="steer"?"toolbarSteerTooltip":T==="queue"?"toolbarQueueLabel":"toolbarSend")),En=Le??(o?o.submitLabel:u(T==="steer"?"toolbarShortcutSteerCurrentTurn":T==="queue"?"toolbarQueueLabel":"toolbarSend")),hr=de&&!o&&!Le?u(T==="queue"?"toolbarQueueShortLabel":"toolbarSteerShortLabel"):En,Zs=o?o.icon:T==="steer"?"↗":T==="queue"?"→":"↑",dr=!!(Ae&&Dt&&Fe);s.useEffect(()=>{try{const e=localStorage.getItem(lt);Kn(e==="queue"||e==="steer"?e:null)}catch{Kn(null)}},[lt]);const qs=s.useCallback(()=>{Kn(e=>{const n=(e??jn)==="steer"?"queue":"steer";try{localStorage.setItem(lt,n)}catch{}return n})},[jn,lt]),L=s.useCallback(e=>{if(!e.trim()){Ee.current=null,Oe.current=null;return}const t=new Date().toISOString();Ee.current||(Ee.current=t),Oe.current=t},[]),K=s.useCallback(()=>{Ee.current=null,Oe.current=null,Re.current=null,Ue.current=[]},[]),gr=s.useCallback(()=>(Re.current||(Re.current=cc()),Re.current),[]),Mt=s.useCallback(()=>{const e=p.getDraft();return{projectId:Ae,sessionId:Dt,draftKey:wt,sessionTerms:ae==null?void 0:ae.terms(),clientTurnId:gr(),speechTargetId:j.current??void 0,textBeforeCursor:Li(e,D.current,d.current)}},[p,wt,gr,Ae,Dt,ae]),ke=s.useCallback((e,t)=>{const n=new Date().toISOString(),c=(t==null?void 0:t.typingStartedAt)??Ee.current??n,r=(t==null?void 0:t.lastEditedAt)??Oe.current??c,l=(t==null?void 0:t.speechTurnId)??Re.current,g=(t==null?void 0:t.speechTranscriptionIds)??Ue.current,f=l||g.length>0?{clientTurnId:l??void 0,transcriptionIds:g.length>0?[...g]:void 0}:void 0;return{deliveryIntent:e,...e==="patient"?{patienceSeconds:fr}:{},...e==="steer"&&on&&Vt?{steerNow:!0}:{},composition:{typingStartedAt:c,typingEndedAt:n,lastEditedAt:r,submittedAt:n},...f?{speech:f}:{}}},[fr,Vt,on]),ce=s.useCallback((e,t,n)=>{const c=(n==null?void 0:n.insertedText)??(n?ts(e,t,n.start,n.end):"");dn.current=Xi(e,t,n?{...n,insertedText:c}:void 0)},[]),Rn=s.useCallback((e,t,n)=>{const c=d.current;if(!c)return null;const r=p.getDraft(),l=Math.max(0,Math.min(e,r.length)),g=Math.max(l,Math.min(t,r.length)),f=`${r.slice(0,l)}${n}${r.slice(g)}`;if(f===r)return f;ce(r,f,{start:l,end:g,insertedText:n,inputType:n?"insertText":"deleteContent"}),Ai(c,l,g,n),c.value!==f&&(c.value=f);const y=X.current;if(y&&(clearTimeout(y.timer),X.current=null),W.current.size>0){const C=new Map;for(const[w,Be]of W.current)C.set(w,rn($i(Be,l,g,n.length)));W.current=C,D.current=j.current!==null?C.get(j.current)??null:null}j.current!==null&&Xr(r,f)&&(Et.current=!0),L(f),N(f),Je(f.length);const I=nn(f,f.length);return(I?`${I.start}:${I.end}:${I.sigil}:${I.query}`:null)!==$t&&Ge(null),f},[p,$t,L,ce,N]),ei=e=>{const t=e.target.files;t!=null&&t.length&&Fe&&(Fe(Array.from(t)),e.target.value="")},mr=s.useMemo(()=>({...p,focus:e=>{var t;return(t=d.current)==null?void 0:t.focus(e)},isFocused:()=>d.current!==null&&document.activeElement===d.current,setSelectionRange:(e,t)=>{var n;return(n=d.current)==null?void 0:n.setSelectionRange(e,t)},replaceDraftRangeUndoably:Rn}),[p,Rn]),$e=Fi({projectId:Ae,text:a,textarea:d,setText:N,replace:Rn,items:ks,disabled:m||x||!!q});s.useEffect(()=>{Ct==null||Ct(mr)},[mr,Ct]),s.useEffect(()=>{const e=dn.current??{mayAffectQuoteAnchors:!0};dn.current=null,St==null||St(a,e)},[St,a]),s.useLayoutEffect(()=>{const e=Rt.current,t=d.current;!e||!t||a!==e.value||t.value!==e.value||(Rt.current=null,e.restore(t))},[a]);const ot=s.useCallback(()=>{if(!x)return;const e=d.current;if(!e)return;(window.requestAnimationFrame??(n=>window.setTimeout(n,0)))(()=>{d.current===e&&zi(e)})},[x]);s.useLayoutEffect(()=>{var n;const e=d.current;if(!e)return;if(ns(e,x,Te),x){ot();return}const t=()=>{ns(e,!1,Te)};return window.addEventListener("resize",t),(n=window.visualViewport)==null||n.addEventListener("resize",t),()=>{var c;window.removeEventListener("resize",t),(c=window.visualViewport)==null||c.removeEventListener("resize",t)}},[x,Te,ot,a]),s.useEffect(()=>{oe&&mn(!1)},[oe]);const yr=s.useCallback(()=>mn(!1),[]),vr=s.useMemo(()=>({restore:yr}),[yr]);s.useEffect(()=>(be==null||be(vr),()=>be==null?void 0:be(null)),[vr,be]);const br=s.useCallback(()=>{var e;oe||(Yn(!1),mn(t=>!t),(e=d.current)==null||e.focus())},[oe]);s.useEffect(()=>{var t;if(!qn||typeof window.matchMedia!="function"||!Qe()){Ne.current=null,tr(!1),At(!1);return}Ne.current===null&&(Ne.current=zn());const e=()=>{const n=zn(),c=Ne.current,r=c===null?n:Math.max(c,n);Ne.current=r;const l=n<r*tc;tr(l),l||At(!1)};return e(),window.addEventListener("resize",e),(t=window.visualViewport)==null||t.addEventListener("resize",e),()=>{var n;window.removeEventListener("resize",e),(n=window.visualViewport)==null||n.removeEventListener("resize",e)}},[qn]),s.useEffect(()=>{st||At(!1)},[st]);const H=s.useCallback(e=>{if(yn.current)return!1;const t=$.current;if(z.current)return t!=null&&t.isListening&&t.stopAndFinalize(),!0;if(!((t==null?void 0:t.isListening)===!0||pe.current!==null||X.current!==null))return z.current=null,fe.current=!1,!1;const c=p.getDraft();return z.current={intent:e,visibleTextSnapshot:An(c,se.current,D.current),draft:c,composition:{typingStartedAt:Ee.current,lastEditedAt:Oe.current,speechTurnId:Re.current,speechTranscriptionIds:[...Ue.current]},speechInsertionRangeRef:{current:D.current},activeSpeechTargetIdRef:{current:j.current},speechInsertionRangesRef:{current:new Map(W.current)},pendingTextareaSelectionRef:{current:null},pendingSpeechRetargetRef:{current:J.current}},fe.current=!1,D.current=null,j.current=null,W.current=new Map,J.current=null,p.clearInput(),K(),se.current="",E(""),t!=null&&t.isListening&&t.stopAndFinalize(),!0},[p,K]),ge=s.useCallback((e,t=!0,n=!1,c=!1)=>{var f,y;if(!o||m||b.length>0||A.length>0)return!1;const r=typeof e=="string"?e:void 0;if(r===void 0&&H({kind:"fork-summary",focusAfterSubmit:t,speechTriggered:n}))return!0;const l=(r??p.getDraft()).trim(),g=vt({configuredPrefix:U,speechTriggered:n,recentSpeech:ee()});return c||(p.clearInput(),K(),E("")),o.onSubmit(l&&bt(l,g)),te(),t?(f=d.current)==null||f.focus():(y=d.current)==null||y.blur(),!0},[b.length,te,p,H,m,o,ee,K,U,A.length]),at=s.useCallback((e,t=!0,n=!1)=>{var g,f;if(!(o!=null&&o.onSubmitWithoutSummary)||m||b.length>0||A.length>0)return!1;const c=typeof e=="string"?e:void 0;if(c===void 0&&H({kind:"fork-without-summary",focusAfterSubmit:t}))return!0;const r=c??p.getDraft(),l=vt({configuredPrefix:U,speechTriggered:!1,recentSpeech:ee()});return n||(p.clearInput(),K(),E("")),o.onSubmitWithoutSummary(l?bt(r,l):r),te(),t?(g=d.current)==null||g.focus():(f=d.current)==null||f.blur(),!0},[b.length,te,p,H,m,o,ee,K,U,A.length]),We=s.useCallback((e,t=!1,n=!0)=>{var c,r;return!kt||m||e.trim()!=="/done"||b.length>0||A.length>0?!1:(t||(p.clearInput(),K(),E("")),kt(),n?(c=d.current)==null||c.focus():(r=d.current)==null||r.blur(),!0)},[b.length,p,m,kt,K,A.length]),ut=s.useCallback(e=>{var t;return m||fn?!1:e===""&&nt?((t=h==null?void 0:h.onSave)==null||t.call(h),!0):xn&&e.endsWith("?")&&!e.trimStart().startsWith("/")&&!e.trimStart().startsWith("!!")&&(h!=null&&h.onAsk(e))?(p.clearInput(),K(),E(""),!0):!1},[m,fn,nt,xn,h,p,K]),Z=s.useCallback(async(e,t,n=!0,c=!1,r,l=!1)=>{var C,w,Be,Mr,Gr;const g=typeof e=="string"?e:void 0;if(g===void 0&&H({kind:"submit",actionOverride:t,focusAfterSubmit:n}))return;const f=g??p.getDraft();if(!t&&!l&&ut(f))return;let y=f.trimEnd();const I=vt({configuredPrefix:U,speechTriggered:c,recentSpeech:ee()});if(o||We(y,l,n))return;if(S){const Se=rs(y);if(Se.kind==="empty"&&!je(y,b.length))return;if(Se.kind==="bang"&&!m){try{await S.onRun(Se.command),l||(p.clearDraft(),K(),E(""))}catch{}n?(C=d.current)==null||C.focus():(w=d.current)==null||w.blur();return}Se.kind==="escaped"&&(y=Se.text)}if(je(y,b.length)&&!m){const Se=bt(y,I),Yr=t??T,mi=ke(Yr==="steer"?"steer":Yr==="queue"?"deferred":"direct",r);l||(p.clearInput(),K(),E("")),(Be=h==null?void 0:h.onDismiss)==null||Be.call(h),_(Se,mi),te(),n?(Mr=d.current)==null||Mr.focus():(Gr=d.current)==null||Gr.blur()}},[m,p,_,h,ut,b.length,T,ke,K,o,We,S,te,H,ee,U]),me=s.useCallback((e,t,n=!1,c=!0)=>{var I,v,C;const r=typeof e=="string"?e:void 0,l=ye??(T==="queue"?_:void 0);if(r===void 0&&H({kind:"queue",focusAfterSubmit:c}))return;const g=r??p.getDraft();if(!n&&ut(g))return;const f=g.trimEnd();if(We(f,n,c))return;if(je(f,b.length)&&!m&&l){const w=ke(ur?"patient":"deferred",t);n||(p.clearInput(),K(),E(""));const Be=vt({configuredPrefix:U,speechTriggered:!1,recentSpeech:ee()});(I=h==null?void 0:h.onDismiss)==null||I.call(h),l(bt(f,Be),w),te(),c?(v=d.current)==null||v.focus():(C=d.current)==null||C.blur()}},[m,p,ye,h,ut,_,T,We,ur,b.length,ke,te,H,ee,K,U]),_e=s.useCallback((e,t,n,c=!1,r=!0)=>{var f,y,I;if(!e)return;const l=(t??p.getDraft()).trimEnd();if(We(l,c,r))return;if(je(l,b.length)&&!m){const v=ke("deferred",n),C=vt({configuredPrefix:U,speechTriggered:!1,recentSpeech:ee()});c||(p.clearInput(),K(),E("")),(f=h==null?void 0:h.onDismiss)==null||f.call(h),e(bt(l,C),v),te(),r?(y=d.current)==null||y.focus():(I=d.current)==null||I.blur()}},[b.length,ke,p,te,m,We,ee,K,U,h]),Nn=s.useCallback((e=!0)=>{H({kind:"project-queue",newSession:!1,focusAfterSubmit:e})||_e(ve,void 0,void 0,!1,e)},[H,ve,_e]),xr=s.useCallback((e=!0)=>{H({kind:"project-queue",newSession:!0,focusAfterSubmit:e})||_e(Ke,void 0,void 0,!1,e)},[H,Ke,_e]),re=s.useCallback(()=>{const e=z.current;if(!e)return!1;z.current=null,fe.current=!1;const t=e.draft,n=p.getDraft();return t&&p.setDraft(n?`${t}
2
+
3
+ ${n}`:t),!0},[p]),ti=s.useCallback(()=>{if(pe.current!==null||X.current!==null||!fe.current)return;const e=z.current;if(!e)return;const t=e.intent.kind==="fork-summary"||e.intent.kind==="fork-without-summary",n=()=>{z.current=null,fe.current=!1};t||n(),yn.current=!0;try{if(e.intent.kind==="queue"){me(e.visibleTextSnapshot,e.composition,!0,e.intent.focusAfterSubmit);return}if(e.intent.kind==="project-queue"){_e(e.intent.newSession?Ke:ve,e.visibleTextSnapshot,e.composition,!0,e.intent.focusAfterSubmit);return}if(e.intent.kind==="fork-summary"){ge(e.visibleTextSnapshot,e.intent.focusAfterSubmit,e.intent.speechTriggered,!0)?n():re();return}if(e.intent.kind==="fork-without-summary"){at(e.visibleTextSnapshot,e.intent.focusAfterSubmit,!0)?n():re();return}Z(e.visibleTextSnapshot,e.intent.actionOverride,e.intent.focusAfterSubmit,!1,e.composition,!0)}catch(c){throw t&&re(),c}finally{yn.current=!1}},[ge,at,me,Z,ve,Ke,re,_e]);Jn.current=ti;const Gt=s.useCallback(()=>{Jn.current()},[]),Tr=s.useCallback(()=>{var n,c;if(m||!Kt)return;const e=((n=$.current)==null?void 0:n.stopAndFinalize())??"",t=An(p.getDraft(),e,D.current).trim();Kt(t)&&t&&(p.clearInput(),K(),E("")),(c=d.current)==null||c.focus()},[p,m,Kt,K]),kr=o?ge:T==="queue"?me:Z,V=s.useCallback(e=>{var c;if(!Qe()){e(!0);return}if(gn.current)return;gn.current=!0;const t=Vn;(c=d.current)==null||c.blur(),Fs(r=>r+1);const n=()=>{if(gn.current=!1,!t)return;const r=d.current;r&&!r.disabled&&r.focus()};try{e(!1)}finally{typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(n):window.setTimeout(n,0)}},[Vn]),Yt=s.useCallback(()=>{V(e=>{o?ge(void 0,e):T==="queue"?me(void 0,void 0,!1,e):Z(void 0,void 0,e)})},[T,o,ge,me,Z,V]),Pn=s.useCallback(()=>{V(e=>{me(void 0,void 0,!1,e)})},[me,V]),Ln=s.useCallback(()=>{V(e=>{Z(void 0,"steer",e)})},[Z,V]),wr=s.useCallback(()=>{V(Nn)},[Nn,V]),Cr=s.useCallback(()=>{V(xr)},[xr,V]),Sr=s.useCallback(()=>{V(e=>{at(void 0,e)})},[at,V]),ni=An(p.getDraft(),q,D.current),ri=!!S&&rs(ni).kind==="bang",M=U&&Xn>0&&(Ws||(Ve!==null||z.current!==null)&&(Pt.current||q.trim().length>0))?U:null,pt=ri?null:M,ft=(e,t=M)=>t?u("speechPrefixDeliveryLabel",{action:e,prefix:t}):e,ht=(e,t=M)=>t?u("speechPrefixDeliveryTooltip",{tooltip:e,prefix:t}):e,Dr=(o==null?void 0:o.noSummarySubmitLabel)??u("forkSummaryNoSummarySubmit"),O=o!=null&&o.onSubmitWithoutSummary?{kind:"send",label:Dr,displayLabel:Dr,icon:o.noSummaryIcon??"↱",onClick:Sr}:de?T==="queue"?{kind:"steer",label:u("toolbarShortcutSteerCurrentTurn"),displayLabel:u("toolbarSteerShortLabel"),icon:"↗",onClick:Ln}:{kind:"queue",label:u("toolbarQueueLabel"),displayLabel:u("toolbarQueueShortLabel"),icon:"→",onClick:Pn}:null,si=!o&&In&&Y.projectQueue&&!!ve,ii=!o&&In&&Y.projectQueueNewSessionShortcut&&!!Ke,ci=!o&&ln&&!!O,we=Ht==="alternate"&&de?T==="queue"?"steer":"queue":T,li=o||we===T?Yt:we==="queue"?Pn:we==="steer"?Ln:Yt,jr=o?Xs:u(we==="steer"?"toolbarSteerTooltip":we==="queue"?"toolbarQueueLabel":"toolbarSend"),oi=o?o.icon:we==="steer"?"↗":we==="queue"?"→":"↑",$n=Oi(a),Wn=$n>1,Kr=(((Vr=R==null?void 0:R.voiceBackends)==null?void 0:Vr.length)??0)>0,dt=x&&!o&&Ht==="microphone",_n=x&&!o&&Ht!=="microphone"&&Kr,Ir=x&&(o||Ht!=="microphone"||!Kr),Er=s.useCallback((e=!1)=>{var n;if(m||!e&&a.trim()||b.length>0||A.length>0)return!1;const t=(It==null?void 0:It())??!1;return t&&(E(""),(n=d.current)==null||n.focus()),t},[b.length,m,It,a,A.length]),gt=s.useCallback((e,t)=>{var I;const n=t??xt(e),c=nn(a,Ye),r=c!==null&&a.slice(c.end).trim()!=="";if(t===void 0&&((I=e.invocation)==null?void 0:I.kind)==="emulated"&&!r&&(jt!=null&&jt(e.name)))return;let l,g,f,y;if(c){const v=t!==void 0||/\s/.test(a[c.end]??"")?"":" ",C=`${n}${v}`;l=c.start,g=c.end,f=a.slice(0,c.start)+C+a.slice(c.end),y=c.start+C.length}else{const v=a.trimEnd(),w=`${v?" ":""}${n} `;l=v.length,g=a.length,f=`${v}${w}`,y=f.length}ce(a,f,{start:l,end:g,inputType:"insertText"}),L(f),N(f),Je(y),Ge(null),requestAnimationFrame(()=>{var v,C;(v=d.current)==null||v.focus(),(C=d.current)==null||C.setSelectionRange(y,y)})},[Ye,a,N,jt,L,ce]),Rr=s.useCallback(e=>{const n=`${e.start>0&&!/\s/.test(a[e.start-1]??"")?" ":""}${e.completion.value.trim()} `,c=a.slice(0,e.start)+n+a.slice(e.end),r=e.start+n.length;ce(a,c,{start:e.start,end:e.end,inputType:"insertText"}),L(c),N(c),Je(r),Ge(null),requestAnimationFrame(()=>{var l,g;(l=d.current)==null||l.focus(),(g=d.current)==null||g.setSelectionRange(r,r)})},[L,ce,N,a]),Bn=e=>{if(!k)return;if(e.source==="history"){const n=`!!${e.value}`;L(n),N(n),Bt(cs(n));return}const t=is(a,k,e.value);L(t),N(t)},Nr=()=>{if(!k||!S)return!1;if(wn){const e=rt[vn];return e&&Bn(e),!0}return S.fetchCompletions(k.token,k.kind,a.slice(2)).then(e=>{if(p.getDraft()!==a)return;if(e.history.length>0){Ze(e.completions),qe(e.history),et(0),Bt(null);return}const t=e.completions,n=t.length===1?t[0]:void 0;if(n){const r=is(a,k,n);L(r),N(r);return}const c=ss(t);if(c.length>k.token.length){const r=a.slice(0,k.replaceStart)+c;L(r),N(r)}Ze(t),qe([]),et(0),Bt(null)}).catch(()=>{}),!0},Pr=()=>{if(tt||!F||F.entries.length===0)return!1;const e=qi(F.entries,a);return e.length===0?!1:(ie({matches:e,index:0,originalDraft:a}),!0)},Lr=()=>{ne&&(N(ne.originalDraft),ie(null))},$r=e=>{var t;L(e.text),N(e.text),ie(null),(t=d.current)==null||t.focus()},ai=e=>{var t;(t=F==null?void 0:F.onGoToTurn)==null||t.call(F,e.id),ie(null)},Wr=()=>{var e,t;if(!m){(e=$.current)==null||e.stopAndFinalize(),d.current&&Mi(d.current),E(""),ce(a,"",{start:0,end:a.length,insertedText:"",inputType:"deleteContent"}),N(""),K(),p.flushDraft();for(const n of b)ze==null||ze(n.id);Ie==null||Ie(),(t=d.current)==null||t.focus()}},ui=e=>{var t,n,c;if(e.key==="Enter"&&e.repeat&&(h!=null&&h.onSave)){e.preventDefault();return}if(!$e.onKeyDown(e)){if(e.key==="Enter"&&!e.nativeEvent.isComposing&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&nt){e.preventDefault(),ut(p.getDraft());return}if(Gi(e)){e.preventDefault(),e.stopPropagation(),br();return}if(Te&&e.key==="Enter"){if(e.nativeEvent.isComposing)return;e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),o?ge():Z(void 0,"send"));return}if(e.key==="ArrowUp"&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&S&&S.history.length>0&&(Ft||a.startsWith("!!"))){e.preventDefault();const r=Math.min(Pe.current+1,S.history.length-1);Pe.current=r;const l=`!!${S.history[r]}`;Qt.current=l,L(l),N(l);return}if(e.key==="ArrowDown"&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&S&&Pe.current>=0&&a.startsWith("!!")){e.preventDefault();const r=Pe.current-1;Pe.current=r;const l=r<0?"":`!!${S.history[r]}`;Qt.current=l,L(l),N(l);return}if(ne){if((e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.metaKey&&!e.altKey){e.preventDefault();const r=e.key==="ArrowDown"?1:-1;ie(l=>l&&{...l,index:(l.index+r+l.matches.length)%l.matches.length});return}if(e.key==="Enter"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault();const r=ne.matches[ne.index];r?$r(r):ie(null);return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault(),Lr();return}ie(null)}if(e.key==="ArrowUp"&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!ne&&Pr()){e.preventDefault();return}if(e.key==="Tab"&&!e.shiftKey&&Nr()){e.preventDefault();return}if(wn&&k){if(e.key==="Escape"){e.preventDefault(),Bt(lr);return}if((e.key==="ArrowDown"||e.key==="ArrowUp")&&!e.ctrlKey){e.preventDefault(),et(r=>{const l=e.key==="ArrowDown"?1:-1;return(r+l+rt.length)%rt.length});return}if(e.key==="Enter"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault();const r=rt[vn];r&&Bn(r);return}}if(sr){if(e.key===" "&&e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&B[0]){e.preventDefault(),gt(B[0]);return}if(e.key==="Tab"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&B.length>1&&B.some(r=>{var l;return((l=r.invocation)==null?void 0:l.kind)==="skill"})){e.preventDefault();const r=ss(B.map(xt));r&&P&&r.length>P.query.length+1&&gt(B[0],r);return}if(e.key==="Escape"){e.preventDefault(),Ge(Tn);return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),_t(r=>{const l=e.key==="ArrowDown"?1:-1;return(r+l+Ot)%Ot});return}if(e.key==="Tab"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey||e.key==="Enter"&&!rr&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault();const r=B[Wt];if(r)gt(r);else{const l=he[Wt-B.length];l&&Rr(l)}return}}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(Ve==="transcribing"||Ve==="finalizing")){e.preventDefault(),e.stopPropagation(),hi();return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&((t=$.current)!=null&&t.isListening)){e.preventDefault(),e.stopPropagation(),$.current.toggle();return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&an&&Ie){e.preventDefault(),e.stopPropagation(),Ie();return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&(h!=null&&h.onDismiss)){e.preventDefault(),e.stopPropagation(),h.onDismiss();return}if(e.key==="Escape"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&On&&Un&&cn){e.preventDefault(),e.stopPropagation(),cn();return}if(e.key==="ArrowUp"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){Er()&&e.preventDefault();return}if(e.key.toLowerCase()==="p"&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault(),Er(!0);return}if(e.key.toLowerCase()==="k"&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&un!=null&&un()){e.preventDefault();return}if(e.key.toLowerCase()==="b"&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault(),Tr();return}if(e.key==="Enter"&&e.ctrlKey&&e.altKey&&!e.metaKey&&!e.shiftKey&&pn){e.preventDefault();const r=((n=$.current)==null?void 0:n.stopAndFinalize())??"";let l=p.getDraft().trimEnd();r&&(l=l?`${l} ${r}`:r),pn(l.trim())!==!1&&l.trim()&&(p.clearInput(),K(),E(""));return}if(e.key.toLowerCase()==="g"&&e.ctrlKey&&!e.shiftKey&&!e.altKey){e.preventDefault(),Wr();return}if(e.key==="Tab"&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&ue&&Ft){e.preventDefault(),ce(a,ue,{start:0,end:a.length,insertedText:ue,inputType:"insertText"}),L(ue),N(ue),xe==null||xe();return}if(e.key==="Enter"){if(e.nativeEvent.isComposing)return;if(o!=null&&o.onSubmitWithoutSummary&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault(),at();return}if(pr&&e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey){e.preventDefault(),Nn();return}if((ye||T==="queue")&&e.ctrlKey&&!e.shiftKey){e.preventDefault(),de&&T==="queue"?Z(void 0,"steer"):me();return}const r=Qe();if((c=$.current)!=null&&c.isListening){e.preventDefault(),kr();return}if(r)return;{if(e.ctrlKey||e.shiftKey)return;e.preventDefault(),kr()}}}},pi=e=>{var c;if(!dr||!Fe)return;const t=(c=e.clipboardData)==null?void 0:c.items;if(!t)return;const n=[];for(const r of t)if(r.kind==="file"){const l=r.getAsFile();l&&n.push(l)}n.length>0&&(e.preventDefault(),Fe(n))},Jt=s.useCallback(()=>{Pt.current=!1;const e=d.current,t=p.getDraft(),n=Math.max(0,Math.min((e==null?void 0:e.selectionStart)??t.length,t.length)),c=Math.max(n,Math.min((e==null?void 0:e.selectionEnd)??n,t.length)),r=lc(),l=Bi(n,c);j.current=r,D.current=l,W.current.set(r,l),Rt.current=null,J.current=null,Et.current=!1,e&&(Zr(e),e.setSelectionRange(n,c)),se.current="",E("")},[p]),Q=s.useCallback(()=>{const e=X.current;e!==null&&(clearTimeout(e.timer),X.current=null)},[]);s.useEffect(()=>Q,[Q]);const mt=s.useCallback((e=!1,t)=>{var I;const n=d.current,c=D.current;if(!n||!c)return;const r=n.selectionStart,l=n.selectionEnd,g=v=>r===l?pe.current==="listening"?es(v,r,l):rn(v):v.replaceSelectedAtMs===void 0&&v.end===r&&v.replaceEnd===l?v:es(v,r,l);r===l&&Q();const f=se.current.trim().length>0;if(e&&(f||J.current!==null)){J.current={draft:t??p.getDraft(),start:r,end:l};return}const y=g(c);pe.current==="listening"&&y!==c&&((I=$.current)==null||I.beginInsertionBoundary()),D.current=y,j.current&&W.current.set(j.current,y),Me(v=>v+1)},[Q,p]),yt=s.useCallback(()=>{var e;mt(!0),Je(((e=d.current)==null?void 0:e.selectionStart)??a.length),ot()},[mt,ot,a.length]),fi=s.useCallback(()=>{window.setTimeout(yt,0)},[yt]),Qn=s.useCallback(()=>{if(Q(),!D.current)return;const e=rn(D.current);D.current=e,j.current&&W.current.set(j.current,e),Me(t=>t+1)},[Q]),_r=s.useCallback(e=>{var t;if(o){if(!ge(e,!Qe(),!0))return!1}else{if(!je(e,b.length)||m)return!1;Z(e,void 0,!Qe(),!0)}return(t=$.current)==null||t.continueAfterSpeechSend(),!0},[b.length,m,o,ge,Z]),Ce=s.useCallback((e,t)=>{e.trim()&&(t==null?void 0:t.smartTurnCommand)!=="cancel"&&(Pt.current=!0,Lt()),fe.current=!0;const n=z.current,c=t==null?void 0:t.speechTargetId,r=n!==null&&(c?n.speechInsertionRangesRef.current.has(c):n.activeSpeechTargetIdRef.current!==null),l=r?n.speechInsertionRangeRef:D,g=r?n.activeSpeechTargetIdRef:j,f=r?n.speechInsertionRangesRef:W,y=r?n.pendingTextareaSelectionRef:Rt,I=r?n.pendingSpeechRetargetRef:J,v=Ii({textareaRef:r?{current:null}:d,getDraft:r?()=>n.draft:p.getDraft,setDraft:r?w=>{n.draft=w}:p.setDraft,setInterimTranscript:w=>{r||(se.current=w,E(w))},speechInsertionRangeRef:l,activeSpeechTargetIdRef:g,speechInsertionRangesRef:f,pendingTextareaSelectionRef:y,pendingSpeechRetargetRef:I,onInsertionBoundary:r?()=>{}:()=>{var w;return(w=$.current)==null?void 0:w.beginInsertionBoundary()},onSpeechTargetChanged:r?()=>{}:()=>Me(w=>w+1),onEdit:r?void 0:L,onTranscriptionId:w=>{r?n.composition.speechTranscriptionIds=[...n.composition.speechTranscriptionIds,w]:Ue.current=[...Ue.current,w]},onSmartTurnSend:r?void 0:_r,composerEditedDuringSpeech:r?void 0:()=>Et.current},e,t);Gt();const C=t==null?void 0:t.speechTargetId;return C&&C!==g.current&&f.current.delete(C)&&Me(w=>w+1),v},[p,_r,Gt,L,Lt]),Xt=s.useCallback((e,t)=>{ae==null||ae.heard(e);const n=z.current,r=(t!=null&&t.speechTargetId?(n==null?void 0:n.speechInsertionRangesRef.current.get(t.speechTargetId))??null:(n==null?void 0:n.speechInsertionRangeRef.current)??null)??(t!=null&&t.speechTargetId?W.current.get(t.speechTargetId)??null:D.current),l=t!=null&&t.smartTurnCommand||J.current?0:Wi(r);if(l>0){Q();const g=setTimeout(()=>{const f=X.current;!f||f.timer!==g||(X.current=null,Ce(f.transcript,f.metadata))},l);X.current={timer:g,transcript:e,metadata:t};return}return Q(),Ce(e,t)},[Q,Ce,ae]),Br=s.useCallback(()=>{const e=X.current;e!==null&&(clearTimeout(e.timer),X.current=null,Ce(e.transcript,e.metadata))},[Ce]),Zt=s.useCallback(()=>{const e=qr(p.getDraft(),se.current,D.current);return Br(),e&&Ce(e),J.current=null,se.current="",E(""),Zr(d.current),!!e},[Ce,p,Br]),qt=s.useCallback(e=>{se.current=e,E(e)},[]),en=s.useCallback((e,t)=>{if(t==="failed"?re():t==="completed"&&(z.current&&Pt.current&&Lt(),fe.current=!0),pe.current=e,e==="listening"&&mt(),e===null){const n=j.current;n&&W.current.delete(n),D.current=null,j.current=null,J.current=null}Nt(e),e===null&&Gt()},[mt,Gt,Lt,re]),tn=s.useCallback(e=>{var l;const t=e.speechTargetId;if(!t||e.status==="completed")return;((l=z.current)==null?void 0:l.speechInsertionRangesRef.current.has(t))===!0&&(re(),Nt(null),pe.current=null,E(""));const c=W.current.delete(t);t===j.current&&(Q(),D.current=null,j.current=null,J.current=null,Nt(null),pe.current=null,E(""),z.current=null,fe.current=!1),c&&Me(g=>g+1)},[Q,re]),hi=s.useCallback(()=>{var t;(t=$.current)==null||t.cancelProcessing(),re(),Q();const e=j.current;e&&W.current.delete(e),D.current=null,j.current=null,J.current=null,Nt(null),pe.current=null,E("")},[Q,re]),di=s.useCallback(e=>{if(!Ui(e))return;e.preventDefault(),e.stopPropagation();const t=$.current;t!=null&&t.isAvailable&&t.toggle()},[]),Qr={sessionId:Dt,mode:us,onModeChange:ps,modeChangesApplyNextTurn:fs,modeChangePending:hs,supportsPermissionMode:ws,supportsThinkingToggle:Cs,canAttach:dr,attachmentCount:b.length,onAttachClick:()=>{var e;return(e=Gn.current)==null?void 0:e.click()},voiceButtonRef:$,onVoiceTranscript:Xt,onInterimTranscript:qt,onListeningStart:Jt,onListeningStop:Zt,onPendingSpeechChange:en,onTranscriptionSettled:tn,voiceDisabled:m,getTranscriptionContext:Mt,slashCommands:G,onSelectSlashCommand:gt,onBtwClick:Kt?Tr:void 0,btwActive:Hn,btwHasAsides:Ds,btwToolbarMode:js,thinkingProvider:Ks,thinkingModel:Is,liveThinkingSelection:Es,contextRequestedModel:Rs,heartbeatEnabled:Ns,onToggleHeartbeat:Ls,onConfigureHeartbeat:$s,contextUsage:ms,lastActivityAt:ys,positionTimestampMs:vs,positionTimestampStore:bs,sessionLiveness:xs,providerRuntimeStatus:Ts,showSteerNowMode:on&&de,steerNowEnabled:Vt,onToggleSteerNow:()=>Js(!Vt),enterActionKind:T==="steer"||T==="queue"?T:void 0,canSwapEnterAction:de,onSwapEnterAction:qs,isRunning:On,isThinking:Un,onStop:cn,onDone:kt,doneTitle:ds,onSend:Yt,onQueue:ye?Pn:void 0,onProjectQueue:ve&&!o?wr:void 0,onProjectQueueNewSession:Ke&&!o?Cr:void 0,onSteer:de?Ln:void 0,primaryActionKind:T,sendOverride:Le?{label:Le,tooltip:Le,icon:"↑"}:o?{label:o.submitLabel,tooltip:o.tooltip,icon:o.icon}:void 0,sendAlternate:o!=null&&o.onSubmitWithoutSummary?{label:o.noSummarySubmitLabel??u("forkSummaryNoSummarySubmit"),tooltip:o.noSummaryTooltip??u("forkSummaryNoSummaryTooltip"),icon:o.noSummaryIcon??"↱",onClick:Sr}:void 0,canForkAfterSummary:!!pn,canSend:st,speechMessagePrefix:M,primarySpeechMessagePrefix:pt,disabled:m},Ar=zs&&st,gi=i.jsxs("div",{className:`message-input-wrapper${Te?` ${le.fullPane}`:""}`,"data-composer-full-pane":Te?"true":void 0,onKeyDownCapture:di,children:[!Ft&&i.jsx("button",{type:"button",className:le.clearComposer,onPointerDown:e=>e.preventDefault(),onClick:Wr,disabled:m,"aria-label":u("toolbarShortcutClearComposer"),title:u("toolbarShortcutClearComposer"),children:i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",children:i.jsx("path",{d:"m6 6 12 12M18 6 6 18"})})}),!oe&&i.jsx("button",{type:"button",className:"message-input-toggle",onClick:()=>Yn(!He),"aria-label":u(He?"messageInputExpand":"messageInputCollapse"),"aria-expanded":!He,children:i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:He?"chevron-up":"chevron-down","aria-hidden":"true",children:i.jsx("polyline",{points:"6 9 12 15 18 9"})})}),!oe&&i.jsx(Hi,{expanded:Te,onToggle:br,className:le.fullPaneToggle}),i.jsxs("div",{className:`message-input ${x?"message-input-collapsed":""} ${x&&(Wn||_n)?"has-collapsed-side-actions":""}${dt?` ${le.collapsedWithLeadingMicrophone}`:""}${dt&&!Ir?` ${le.collapsedWithLeadingMicrophoneOnly}`:""}`,"data-composer-shell":"true","data-collapsed-leading-microphone":dt||void 0,children:[i.jsxs("div",{className:`speech-draft-field ${Ut?"has-interim":""}`,children:[i.jsxs("div",{className:"speech-draft-inline",children:[Ut&&i.jsxs("div",{className:"speech-draft-mirror","aria-hidden":"true",children:[i.jsx("span",{children:ct.before}),ct.separatorBefore,i.jsx("span",{className:"speech-interim-inline",children:ct.transcript}),i.jsx("span",{className:"speech-interim-caret"}),ct.separatorAfter,i.jsx("span",{children:ct.after})]}),i.jsx("textarea",{ref:d,"data-composer-input":!0,onCompositionStart:()=>Mn(!0),onCompositionEnd:()=>Mn(!1),value:a,onBeforeInput:e=>{const t=e.nativeEvent;hn.current={start:e.currentTarget.selectionStart,end:e.currentTarget.selectionEnd,inputType:t.inputType}},onChange:e=>{const t=$e.normalizeInput(e.target.value),n=hn.current;if(hn.current=null,ce(a,t,n?{...n,insertedText:ts(a,t,n.start,n.end)}:void 0),Q(),W.current.size>0){const g=new Map;for(const[f,y]of W.current)g.set(f,rn(_i(a,t,y)));W.current=g,D.current=j.current!==null?g.get(j.current)??null:null}j.current!==null&&Xr(a,t)&&(Et.current=!0),mt(!0,t),L(t),N(t);const c=e.target.selectionStart;Je(c);const r=nn(t,c);(r?`${r.start}:${r.end}:${r.sigil}:${r.query}`:null)!==$t&&Ge(null)},onBlur:()=>{$e.onBlur(),Lr(),p.flushDraft(),er(!1)},onFocus:()=>{$e.onFocus(),Ne.current=zn(),er(!0),ot()},onKeyDown:ui,onSelect:()=>{yt(),$e.onSelect()},onPointerUp:yt,onClick:fi,onKeyUp:yt,onCut:Qn,onCopy:Qn,onPaste:e=>{Qn(),pi(e)},enterKeyHint:"enter",placeholder:oe?u("messageInputContinueAbove"):o?o.placeholder:as,disabled:m,rows:x?1:3},As)]}),q&&i.jsx("div",{className:"speech-interim-status",role:"status","aria-live":"polite","aria-label":"Tentative speech transcript",children:q})]}),i.jsx(Vi,{completion:$e}),(Os||kn)&&i.jsx("div",{className:`bang-composer-chip${kn?" bang-composer-chip-escaped":""}`,role:"status",children:u(kn?"bangComposerEscapedChip":"bangComposerChip")}),ir.length>0&&i.jsxs("div",{className:"skill-invocation-status",role:"status",children:[i.jsx("span",{children:u("skillInvocationRecognized")}),i.jsx("code",{children:ir.join(", ")})]}),cr.length>0&&i.jsxs("div",{className:"skill-invocation-status skill-invocation-status--warning",role:"status",children:[i.jsx("span",{children:u("skillInvocationUnrecognized")}),i.jsx("code",{children:cr.join(", ")}),i.jsx("span",{children:u("skillInvocationStillSent")})]}),wn&&i.jsx("div",{className:"slash-command-menu composer-slash-command-menu bang-completion-menu",role:"menu",children:rt.map((e,t)=>i.jsx("button",{type:"button",className:`slash-command-item${e.source==="history"?" bang-history-item":""}${t===vn?" active":""}`,onMouseEnter:()=>et(t),onMouseDown:n=>n.preventDefault(),onClick:()=>{var n;Bn(e),(n=d.current)==null||n.focus()},role:"menuitem",children:i.jsx("span",{children:e.value})},`${e.source}:${e.value}`))}),sr&&i.jsxs("div",{className:"slash-command-menu composer-slash-command-menu",role:"menu",children:[B.map((e,t)=>{var c;const n=ji(e);return i.jsx("button",{type:"button",className:`slash-command-item${t===Wt?" active":""}`,onMouseEnter:()=>_t(t),onMouseDown:r=>r.preventDefault(),onClick:()=>gt(e),role:"menuitem","aria-label":n.label,children:i.jsxs("span",{className:"slash-command-copy",children:[i.jsxs("span",{children:[n.shortcut&&i.jsx("strong",{className:"slash-command-shortcut",children:n.shortcut}),n.rest]}),(e.description||e.argumentHint)&&i.jsx("span",{className:"slash-command-detail",children:[e.description,e.argumentHint].filter(Boolean).join(" · ")})]})},`${xt(e)}:${((c=e.invocation)==null?void 0:c.kind)??"legacy"}`)}),he.map((e,t)=>{const n=B.length+t,c=e.completion.value.trim(),r=`${xt(e.command)} ${c}`;return i.jsx("button",{type:"button",className:`slash-command-item${n===Wt?" active":""}`,onMouseEnter:()=>_t(n),onMouseDown:l=>l.preventDefault(),onClick:()=>Rr(e),role:"menuitem","aria-label":r,children:i.jsxs("span",{className:"slash-command-copy",children:[i.jsx("span",{children:r}),e.completion.description&&i.jsx("span",{className:"slash-command-detail",children:e.completion.description})]})},`${xt(e.command)}:${c}`)})]}),ne&&i.jsx("div",{className:"slash-command-menu composer-slash-command-menu composer-recall-menu",role:"menu","aria-label":u("composerRecallMenuLabel"),children:ne.matches.map((e,t)=>i.jsxs("div",{className:"composer-recall-row",children:[i.jsx("button",{type:"button",className:`slash-command-item composer-recall-preview${t===ne.index?" active":""}`,onMouseEnter:()=>ie(n=>n&&{...n,index:t}),onMouseDown:n=>n.preventDefault(),onClick:()=>$r(e),role:"menuitem",children:i.jsx("span",{children:e.preview})}),(F==null?void 0:F.onGoToTurn)&&i.jsx("button",{type:"button",className:"composer-recall-goto",onMouseEnter:()=>ie(n=>n&&{...n,index:t}),onMouseDown:n=>n.preventDefault(),onClick:()=>ai(e),"aria-label":u("composerRecallGoToTurn"),title:u("composerRecallGoToTurn"),children:i.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:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"5"}),i.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),i.jsx("line",{x1:"2",y1:"12",x2:"5",y2:"12"}),i.jsx("line",{x1:"19",y1:"12",x2:"22",y2:"12"})]})})]},`${t}-${e.id}`))}),x&&(Wn||_n)&&i.jsxs("div",{className:"message-input-collapsed-side-actions",children:[Wn&&i.jsx("span",{className:"message-input-collapsed-line-count",title:u("messageInputCollapsedLineCount",{count:String($n)}),children:u("messageInputCollapsedLineCount",{count:String($n)})}),_n&&i.jsx(Fn,{ref:$,onTranscript:Xt,onInterimTranscript:qt,onListeningStart:Jt,onListeningStop:Zt,onPendingSpeechChange:en,onTranscriptionSettled:tn,disabled:m,getTranscriptionContext:Mt,className:"message-input-collapsed-mic"})]}),x&&i.jsxs("div",{className:`message-input-collapsed-actions${dt?` ${le.collapsedActionsWithMicrophone}`:""}`,children:[dt&&i.jsx(Fn,{ref:$,onTranscript:Xt,onInterimTranscript:qt,onListeningStart:Jt,onListeningStop:Zt,onPendingSpeechChange:en,onTranscriptionSettled:tn,disabled:m,getTranscriptionContext:Mt,className:"message-input-collapsed-mic"}),Ir&&i.jsx("button",{type:"button",onClick:li,disabled:m||!st,className:"send-button message-input-collapsed-send","aria-label":jr,title:jr,children:i.jsx(De,{className:"send-icon",children:oi})})]}),!x&&an&&i.jsxs("div",{className:"correction-draft",children:[i.jsx("span",{className:"correction-draft-label",children:u("sessionCorrectionActive")}),i.jsx("button",{type:"button",className:"correction-draft-cancel",onClick:Ie,"aria-label":u("sessionCorrectionCancel"),title:u("sessionCorrectionCancel"),children:"×"})]}),!x&&o&&i.jsxs("div",{className:"fork-summary-draft",children:[i.jsxs("div",{className:"fork-summary-draft-copy",children:[i.jsx("span",{className:"fork-summary-draft-label",children:o.title}),i.jsx("span",{className:"fork-summary-draft-description",children:o.description})]}),i.jsx("button",{type:"button",className:"fork-summary-draft-cancel",onClick:o.onCancel,"aria-label":u("forkSummaryCancel"),title:u("forkSummaryCancel"),children:"×"})]}),!x&&(b.length>0||A.length>0)&&i.jsxs("div",{className:"attachment-list",children:[b.map(e=>i.jsx(nc,{attachmentId:e.id,originalName:e.originalName,path:e.path,mimeType:e.mimeType,sizeLabel:Ji(e.size),imageWidth:e.width,imageHeight:e.height,previewUrl:e.previewUrl,projectId:Ae,onRemove:ze?()=>ze(e.id):void 0},e.id)),A.map(e=>i.jsxs("div",{className:`${sn.chip} ${sn.uploading}`,children:[i.jsx("span",{className:sn.name,children:e.fileName}),i.jsxs("span",{className:sn.progress,children:[e.percent,"%"]})]},e.fileId))]}),i.jsx("input",{ref:Gn,type:"file",multiple:!0,style:{display:"none"},onChange:ei}),!x&&Ft&&ue&&i.jsxs("div",{className:"prompt-suggestion",children:[i.jsx("button",{type:"button",className:"prompt-suggestion-text",onClick:()=>{var t;const e=ke("direct");xe==null||xe(),_(ue,e),(t=d.current)==null||t.focus()},title:"Send this suggestion",children:ue}),i.jsx("button",{type:"button",className:"prompt-suggestion-dismiss",onClick:xe,"aria-label":"Dismiss suggestion",title:"Dismiss",children:"×"})]}),!x&&Ar&&i.jsxs("div",{className:"message-input-keyboard-compact",children:[bn&&i.jsx("div",{id:"message-input-keyboard-more-controls",className:"message-input-keyboard-more-panel",role:"toolbar","aria-label":u("toolbarOverflowMenu"),onPointerDown:e=>e.preventDefault(),children:i.jsx(Jr,{...Qr,onProjectQueue:void 0,onProjectQueueNewSession:void 0,hidePrimaryDeliveryActions:!0,hideVoiceInput:!0})}),i.jsxs("div",{className:`message-input-keyboard-actions${o!=null&&o.onSubmitWithoutSummary?" has-alternate":""}`,children:[i.jsx("button",{type:"button",className:`message-input-keyboard-more${bn?" is-open":""}`,onPointerDown:e=>e.preventDefault(),onClick:()=>At(e=>!e),"aria-label":u("toolbarOverflowMenu"),"aria-expanded":bn,"aria-controls":"message-input-keyboard-more-controls",title:u("toolbarOverflowMenu"),children:i.jsx("span",{"aria-hidden":"true",children:"..."})}),Y.microphone&&i.jsx("div",{className:`message-input-keyboard-secondary-slot ${le.keyboardSpeechSlot}${Y.waveform?` ${le.keyboardSpeechSlotWithWaveform}`:""}`,"data-waveform-reserved":Y.waveform||void 0,"data-waveform-active":_s||void 0,onPointerDown:e=>e.preventDefault(),children:i.jsx(Fn,{ref:$,onTranscript:Xt,onInterimTranscript:qt,onListeningStart:Jt,onListeningStop:Zt,onPendingSpeechChange:en,onTranscriptionSettled:tn,disabled:m,getTranscriptionContext:Mt,showWaveform:Y.waveform,inlineWaveform:Y.waveform,onWaveformActiveChange:Y.waveform?Bs:void 0,className:"message-input-keyboard-action message-input-keyboard-secondary"})}),si&&i.jsx("div",{className:"message-input-keyboard-secondary-slot message-input-keyboard-project-queue-slot",children:i.jsxs("button",{type:"button",className:"message-input-keyboard-action message-input-keyboard-secondary project-queue-mode",onPointerDown:e=>e.preventDefault(),onClick:wr,disabled:m,"aria-label":ft(u("toolbarProjectQueueLabel")),title:ht(u(pr?"toolbarProjectQueueTooltipWithShortcut":"toolbarProjectQueueTooltip")),children:[i.jsx(De,{children:"⇥"}),M&&i.jsx(Tt,{prefix:M})]})}),ii&&i.jsx("div",{className:"message-input-keyboard-secondary-slot message-input-keyboard-project-queue-new-session-slot",children:i.jsxs("button",{type:"button",className:"message-input-keyboard-action message-input-keyboard-secondary project-queue-mode project-queue-new-session-button",onPointerDown:e=>e.preventDefault(),onClick:Cr,disabled:m,"aria-label":ft(u("toolbarProjectQueueNewSessionLabel")),title:ht(u("toolbarProjectQueueNewSessionTooltip")),children:[i.jsx(De,{children:"⇥"}),i.jsx(vi,{}),M&&i.jsx(Tt,{prefix:M})]})}),ci&&i.jsx("div",{className:"message-input-keyboard-secondary-slot message-input-keyboard-session-alternate-slot",children:i.jsxs("button",{type:"button",className:`message-input-keyboard-action message-input-keyboard-secondary ${O.kind}-mode`,onPointerDown:e=>e.preventDefault(),onClick:O.onClick,disabled:m,"aria-label":ft(O.label),title:ht(O.label),children:[i.jsx(De,{children:O.icon}),M&&i.jsx(Tt,{prefix:M})]})}),(o==null?void 0:o.onSubmitWithoutSummary)&&O&&i.jsxs("button",{type:"button",className:`message-input-keyboard-action message-input-keyboard-alternate ${O.kind}-mode`,onPointerDown:e=>e.preventDefault(),onClick:O.onClick,disabled:m,"aria-label":ft(O.label),title:ht(O.label),children:[i.jsx("span",{children:O.displayLabel}),i.jsx(De,{children:O.icon}),M&&i.jsx(Tt,{prefix:M})]}),k!==null&&i.jsxs("button",{type:"button",className:"message-input-keyboard-action message-input-keyboard-secondary bang-tab-mode",onPointerDown:e=>e.preventDefault(),onClick:()=>Nr(),disabled:m,"aria-label":u("bangTabCompleteLabel"),title:u("bangTabCompleteLabel"),children:[i.jsx("span",{children:"Tab"}),i.jsx(De,{children:"⇥"})]}),Y.composerRecall&&F&&F.entries.length>0&&!tt&&!ne&&k===null&&i.jsx("button",{type:"button",className:"message-input-keyboard-action message-input-keyboard-secondary composer-recall-open",onPointerDown:e=>e.preventDefault(),onClick:()=>Pr(),disabled:m,"aria-label":u("composerRecallOpenButton"),title:u("composerRecallOpenButton"),children:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M3 3v5h5"}),i.jsx("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 8"}),i.jsx("path",{d:"M12 7v5l3 3"})]})}),i.jsxs("button",{type:"button",className:`message-input-keyboard-action message-input-keyboard-primary ${T}-mode${Y.waveform?` ${le.keyboardPrimaryWithWaveform}`:""}`,onPointerDown:e=>e.preventDefault(),onClick:Yt,disabled:m,"aria-label":ft(En,pt),title:ht(En,pt),children:[hr&&i.jsx("span",{className:"message-input-keyboard-primary-label",children:hr}),i.jsx(De,{className:"message-input-keyboard-primary-icon",children:Zs}),pt&&i.jsx(Tt,{prefix:pt})]})]})]}),!x&&!Ar&&i.jsx(Jr,{...Qr})]})]});return i.jsxs(i.Fragment,{children:[nr&&i.jsx(Zi,{mobile:Qe()}),gi]})}export{Rl as MessageInput};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BrowserDebugToolbarButton-CRE47FFy.js","assets/index-BY-TgOY-.js","assets/react-runtime-D-UPQ57m.js","assets/index-wA2zlxt-.css","assets/providerChildSessions-DVWCZpC4.js","assets/client-D_ikArFV.js","assets/RelayProtocol-DOWXVB0k.js","assets/Modal-DOzUIhWU.js","assets/remoteRoutePaths-BxKY1U2z.js","assets/LocalMediaModal-DyDpC0dk.js","assets/newSessionPrefill-DKcy0abh.js","assets/appHref-ByaEnJGJ.js","assets/LocalMediaModal-DOcizK52.css","assets/katex-Dv2p4YRM.js","assets/index-YAR5D3xY.js","assets/index-EC-u4IZ7.css","assets/relay-url-j3kYm5KO.js","assets/ProviderBadge-BKZVllDn.js","assets/providerChildSessions-BpJF5D9s.css"])))=>i.map(i=>d[i]);
2
- var pr=Object.defineProperty;var mr=(e,s,n)=>s in e?pr(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n;var W=(e,s,n)=>mr(e,typeof s!="symbol"?s+"":s,n);import{j as t,aG as Cs,r as u,h as fr,U as br,u as et,ax as Ss,aK as gr,s as Ws,aI as wr,bs as xr,aY as vr,aZ as Sr,bt as Tr,bu as kr,bv as jr,bb as yr}from"./index-BY-TgOY-.js";import{g as Er}from"./types-BHkriVjU.js";import{q as Ar,t as Mr,R as qs,A as Vs}from"./providerChildSessions-DVWCZpC4.js";import{b as Lr}from"./index-YAR5D3xY.js";import{j as Nr,k as Pr,u as Rr,m as _r,n as Hs,D as Ye,l as Xe,o as Dr}from"./SpeechControlMenu-DEDIWl9h.js";import{u as Br,a as Or,r as Ir,i as $r,A as Ur,b as Fr,f as Cr,D as Wr}from"./useModelSettings-CeABGid0.js";import{o as qr,n as Vr,M as Hr}from"./YaServerProvider-BNTM9_P9.js";import{C as Ht,N as ps,U as Gr,V as Je,f as Kt,W as Kr,d as Qr}from"./client-D_ikArFV.js";import{g as zr,i as Yr}from"./browserDebugPerformance-ZT9tAT-A.js";import{b as Xr,F as Jr,a as Zr}from"./frontendReload-DN8qVYjF.js";import{u as bn}from"./useProviders-45TZLkhy.js";import{u as eo}from"./useRelativeNow-XM1dKxcx.js";import{e as to}from"./Modal-DOzUIhWU.js";import{m as so,n as no,o as ro}from"./LocalMediaModal-DyDpC0dk.js";import{n as oo,g as io,r as ao,a as co,b as lo,d as gn}from"./ProviderBadge-BKZVllDn.js";import{b as uo,a as wn,u as ho,g as xn,c as po,T as mo}from"./ThinkingControls-BEweLRqu.js";import{k as Gs,s as fo}from"./NavigationLayout-D8BMwd7T.js";import{C as bo}from"./CommittedRangeInput-bK7EXtAc.js";import{M as Ks}from"./MessageAge-CKdiBg7K.js";import{V as go,S as wo}from"./VoiceInputButton-0BzvkjjK.js";const Qs=2e5,bt=258e3,xo=272e3,vo=272e3,ws=1e6,Gt={fable:ws,opus:2e5,sonnet:2e5,haiku:2e5,gemini:1e6,"gpt-5":bt,codex:bt,"gpt-4":128e3,"gpt-4o":128e3,"gpt-4-turbo":128e3};function So(e,s){if(!e)return s==="codex"?bt:Qs;const n=e.toLowerCase();if(n.includes("[1m]")||/(?:^|[./])claude-(?:opus|sonnet)-5(?:-\d+)?$/.test(n))return ws;if(n.includes("gpt-5.6"))return xo;if(n.includes("gpt-6-astra"))return vo;if(n.includes("gpt-5")||n.includes("codex"))return bt;for(const[i,l]of Object.entries(Gt))if(n.startsWith(i))return l;const r=n.match(/claude-(?:(\w+)-\d|(\d+-\d+-)?(\w+))/);if(r){const i=r[1]||r[3];if(i&&Gt[i])return Gt[i]}return n.includes("gemini")?Gt.gemini:s==="codex"?bt:Qs}function zs(){return t.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M4 5.5h10a3 3 0 0 1 3 3v3a3 3 0 0 1-3 3H9l-4 3v-3.2a3 3 0 0 1-1-2.3V8.5a3 3 0 0 1 3-3"}),t.jsx("path",{d:"M17 9.5h.5a2.5 2.5 0 0 1 2.5 2.5v3a2.5 2.5 0 0 1-1 2l.2 2.5-3.2-2h-3.5a2.5 2.5 0 0 1-2.4-1.8"}),t.jsx("path",{d:"M8 9.5h5M8 12h3.5"})]})}const To="__YA_BROWSER_DEBUG_EVAL__",ko=5e4;let jo=0;function yo(e,s,n){const r=`globalThis[${JSON.stringify(e)}]`,i=n==="expression"?`await (
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BrowserDebugToolbarButton-BPghQu17.js","assets/index-umZg0LZ6.js","assets/react-runtime-D-UPQ57m.js","assets/index-CPb-36gi.css","assets/providerChildSessions-DbLFSybt.js","assets/client-Ci_HPGfl.js","assets/RelayProtocol-BpdH0COG.js","assets/Modal-ClSjJagX.js","assets/remoteRoutePaths-D8htA0xa.js","assets/LocalMediaModal-B9eHVx6y.js","assets/newSessionPrefill-DKcy0abh.js","assets/relay-url-j3kYm5KO.js","assets/appHref-ByaEnJGJ.js","assets/LocalMediaModal-B3KXtyEB.css","assets/katex-Dv2p4YRM.js","assets/index-CoR-vzsb.js","assets/index-EC-u4IZ7.css","assets/ProviderBadge-P0VTI71n.js","assets/providerChildSessions-Cd7oK6KQ.css"])))=>i.map(i=>d[i]);
2
+ var pr=Object.defineProperty;var mr=(e,s,n)=>s in e?pr(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n;var W=(e,s,n)=>mr(e,typeof s!="symbol"?s+"":s,n);import{j as t,aG as Cs,r as u,h as fr,U as br,u as et,ax as Ss,aK as gr,s as Ws,aI as wr,bs as xr,aY as vr,aZ as Sr,bt as Tr,bu as kr,bv as jr,bb as yr}from"./index-umZg0LZ6.js";import{g as Er}from"./types-BHkriVjU.js";import{t as Ar,v as Mr,R as qs,A as Vs}from"./providerChildSessions-DbLFSybt.js";import{b as Lr}from"./index-CoR-vzsb.js";import{j as Nr,k as Pr,u as Rr,m as _r,n as Hs,D as Ye,l as Xe,o as Dr}from"./SpeechControlMenu-BYVdEa3C.js";import{u as Br,a as Or,r as Ir,i as $r,A as Ur,b as Fr,f as Cr,D as Wr}from"./useModelSettings-BdlYk1DT.js";import{o as qr,n as Vr,M as Hr}from"./YaServerProvider-CN3tC5UL.js";import{C as Ht,N as ps,U as Gr,V as Je,f as Kt,W as Kr,d as Qr}from"./client-Ci_HPGfl.js";import{g as zr,i as Yr}from"./browserDebugPerformance-ZT9tAT-A.js";import{b as Xr,F as Jr,a as Zr}from"./frontendReload-CBdyvvdy.js";import{u as bn}from"./useProviders-CeN1PclA.js";import{u as eo}from"./useRelativeNow-Ca6QGcPa.js";import{e as to}from"./Modal-ClSjJagX.js";import{m as so,n as no,o as ro}from"./LocalMediaModal-B9eHVx6y.js";import{n as oo,g as io,r as ao,a as co,b as lo,d as gn}from"./ProviderBadge-P0VTI71n.js";import{b as uo,a as wn,u as ho,g as xn,c as po,T as mo}from"./ThinkingControls-DXbxdJRi.js";import{k as Gs,s as fo}from"./NavigationLayout-BTFsWVtE.js";import{C as bo}from"./CommittedRangeInput-BwuV6Q6c.js";import{M as Ks}from"./MessageAge-CaPpa1nH.js";import{V as go,S as wo}from"./VoiceInputButton-CCgovfyf.js";const Qs=2e5,bt=258e3,xo=272e3,vo=272e3,ws=1e6,Gt={fable:ws,opus:2e5,sonnet:2e5,haiku:2e5,gemini:1e6,"gpt-5":bt,codex:bt,"gpt-4":128e3,"gpt-4o":128e3,"gpt-4-turbo":128e3};function So(e,s){if(!e)return s==="codex"?bt:Qs;const n=e.toLowerCase();if(n.includes("[1m]")||/(?:^|[./])claude-(?:opus|sonnet)-5(?:-\d+)?$/.test(n))return ws;if(n.includes("gpt-5.6"))return xo;if(n.includes("gpt-6-"))return vo;if(n.includes("gpt-5")||n.includes("codex"))return bt;for(const[i,l]of Object.entries(Gt))if(n.startsWith(i))return l;const r=n.match(/claude-(?:(\w+)-\d|(\d+-\d+-)?(\w+))/);if(r){const i=r[1]||r[3];if(i&&Gt[i])return Gt[i]}return n.includes("gemini")?Gt.gemini:s==="codex"?bt:Qs}function zs(){return t.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M4 5.5h10a3 3 0 0 1 3 3v3a3 3 0 0 1-3 3H9l-4 3v-3.2a3 3 0 0 1-1-2.3V8.5a3 3 0 0 1 3-3"}),t.jsx("path",{d:"M17 9.5h.5a2.5 2.5 0 0 1 2.5 2.5v3a2.5 2.5 0 0 1-1 2l.2 2.5-3.2-2h-3.5a2.5 2.5 0 0 1-2.4-1.8"}),t.jsx("path",{d:"M8 9.5h5M8 12h3.5"})]})}const To="__YA_BROWSER_DEBUG_EVAL__",ko=5e4;let jo=0;function yo(e,s,n){const r=`globalThis[${JSON.stringify(e)}]`,i=n==="expression"?`await (
3
3
  ${s}
4
4
  )`:`await (async () => {
5
5
  ${s}
@@ -51,7 +51,7 @@ The snapshot aggregates recent and lease-total main-thread delays, page size, st
51
51
  <ya-cli> browser-debug eval '<grant-url>' 'document.title'
52
52
 
53
53
  Diagnose this particular tab and explain any code you evaluate when it could alter user-visible state.`}class Vo{constructor(s={}){W(this,"persistedLease",Sn());W(this,"snapshot",this.persistedLease?{phase:"active",connected:!1,sessionId:this.persistedLease.sessionId,expiresAtMs:Date.parse(this.persistedLease.expiresAt),error:null}:{phase:"inactive",connected:!1,sessionId:null,expiresAtMs:null,error:null});W(this,"listeners",new Set);W(this,"lease",null);W(this,"sourceFetch",null);W(this,"events",[]);W(this,"stopped",!0);W(this,"pollGeneration",0);W(this,"pollAbortController",null);W(this,"enableAttempt",0);W(this,"cleanupInstrumentation",null);W(this,"expiryTimer",null);W(this,"pageOwnership",new Mo(Ro));W(this,"pageHideHandler",()=>{this.suspendLocalLease()});W(this,"pageShowHandler",()=>{setTimeout(()=>void this.reconcilePersistedLease(),0)});W(this,"subscribe",s=>(this.listeners.add(s),()=>this.listeners.delete(s)));W(this,"getSnapshot",()=>this.snapshot);W(this,"getPerformanceSummary",()=>zr());var n;if(this.persistedLease){if(!(((n=s.canRestorePersistedLease)==null?void 0:n.call(s))??Co(this.persistedLease))){this.finishPersistedLease(this.persistedLease);return}this.schedulePersistedExpiry(this.persistedLease)}}async reconcilePersistedLease(){var i;if(this.lease||!this.persistedLease)return;const s=this.persistedLease,n=Date.parse(s.expiresAt);if(n<=Date.now()){this.finishPersistedLease(s);return}if(!await this.pageOwnership.acquire(s.leaseId,{handoffWaitMs:Uo})||((i=this.persistedLease)==null?void 0:i.leaseId)!==s.leaseId){this.pageOwnership.release(),this.finishPersistedLease(s);return}try{const l=Ht().getOrCreateSourceRuntime(ps(s.sourceKey)),o=l.transport.fetch.bind(l.transport);this.lease={leaseId:s.leaseId,controllerToken:s.controllerToken,grantUrl:"",sessionId:s.sessionId,tabId:s.tabId,expiresAt:s.expiresAt},this.sourceFetch=o,this.stopped=!1,this.cleanupInstrumentation=this.installInstrumentation(),window.addEventListener("pagehide",this.pageHideHandler),window.addEventListener("pageshow",this.pageShowHandler),this.expiryTimer&&clearTimeout(this.expiryTimer),this.expiryTimer=setTimeout(()=>{this.disable({notifyServer:!0})},Math.max(0,n-Date.now())),this.setSnapshot({phase:"active",connected:!1,sessionId:s.sessionId,expiresAtMs:n,error:null});const c=++this.pollGeneration;this.pollLoop(c)}catch(l){this.showPersistedWarning(s,l instanceof Error?l.message:String(l))}}reactivate(){var s;if(this.lease&&this.persistedLease){(s=this.pollAbortController)==null||s.abort(),this.pollAbortController=null,this.stopped=!1,this.setSnapshot({...this.snapshot,connected:!1,error:null});const n=++this.pollGeneration;return this.pollLoop(n),Promise.resolve()}return this.reconcilePersistedLease()}prepareFrontendReload(s,n){const r=this.persistedLease;if(!r)throw new Error("The browser debugging lease is no longer active");const i={version:1,leaseId:r.leaseId,reloadToken:n};try{sessionStorage.setItem(xs,JSON.stringify(i))}catch{throw new Error("Browser session storage is unavailable")}return Xr(s,n)}async enable(s){if(this.lease)return Zs(this.lease);if(this.persistedLease)throw new Error("A previous browser debugging lease must be revoked before enabling another");const n=++this.enableAttempt;this.setSnapshot({phase:"enabling",connected:!1,sessionId:s,expiresAtMs:null,error:null});const r=Ht().getCurrentSourceRuntime(),i=r.transport,l=i.fetch.bind(i);try{const o=await l("/browser-debug/leases",{method:"POST",body:JSON.stringify({sessionId:s,tabId:qo()})});if(this.enableAttempt!==n)throw await l(`/browser-debug/leases/${o.lease.leaseId}`,{method:"DELETE",headers:{"X-YA-Browser-Debug-Controller":o.lease.controllerToken}}).catch(()=>{}),new Error("Browser debugging enable was cancelled");const c=Date.parse(o.lease.expiresAt);if(!Number.isFinite(c))throw new Error("Server returned an invalid diagnostic lease expiry");const h={version:1,leaseId:o.lease.leaseId,controllerToken:o.lease.controllerToken,sessionId:o.lease.sessionId,tabId:o.lease.tabId,expiresAt:o.lease.expiresAt,sourceKey:r.sourceKey};if(!await this.pageOwnership.acquire(h.leaseId))throw await l(`/browser-debug/leases/${o.lease.leaseId}`,{method:"DELETE",headers:{"X-YA-Browser-Debug-Controller":o.lease.controllerToken}}).catch(()=>{}),new Error("Exclusive browser-tab ownership is unavailable; the diagnostic lease was not enabled");if(!Wo(h))throw await l(`/browser-debug/leases/${o.lease.leaseId}`,{method:"DELETE",headers:{"X-YA-Browser-Debug-Controller":o.lease.controllerToken}}).catch(()=>{}),new Error("Browser session storage is unavailable; the diagnostic lease was not enabled");this.persistedLease=h,this.lease=o.lease,this.sourceFetch=l,this.stopped=!1,this.cleanupInstrumentation=this.installInstrumentation(),window.addEventListener("pagehide",this.pageHideHandler),window.addEventListener("pageshow",this.pageShowHandler),this.expiryTimer=setTimeout(()=>{this.disable({notifyServer:!0})},Math.max(0,c-Date.now())),this.setSnapshot({phase:"active",connected:!0,sessionId:s,expiresAtMs:c,error:null});const g=++this.pollGeneration;return this.pollLoop(g),Zs(o.lease)}catch(o){if(this.enableAttempt!==n)throw o;await this.disable({notifyServer:!1});const c=o instanceof Error?o.message:String(o);throw this.setSnapshot({phase:"inactive",connected:!1,sessionId:null,expiresAtMs:null,error:c}),o}}async disable(s={}){var o,c;const n=this.lease,r=this.persistedLease;let i=this.sourceFetch;if(!n&&r&&!i)try{const h=Ht().getOrCreateSourceRuntime(ps(r.sourceKey));i=h.transport.fetch.bind(h.transport)}catch{i=null}if(this.enableAttempt+=1,this.stopped=!0,this.pollGeneration+=1,(o=this.pollAbortController)==null||o.abort(),this.pollAbortController=null,this.pageOwnership.release(),this.lease=null,this.sourceFetch=null,(c=this.cleanupInstrumentation)==null||c.call(this),this.cleanupInstrumentation=null,window.removeEventListener("pagehide",this.pageHideHandler),window.removeEventListener("pageshow",this.pageShowHandler),this.expiryTimer&&clearTimeout(this.expiryTimer),this.expiryTimer=null,this.events=[],n!==null&&!s.keepalive&&s.unconfirmedError===void 0){this.finishPersistedLease(r),s.notifyServer!==!1&&r&&i&&this.revokePersistedLease(r,i);return}if(s.notifyServer===!1&&r&&s.unconfirmedError!==void 0&&!Js(s.unconfirmedError)){this.showPersistedWarning(r,s.unconfirmedError instanceof Error?s.unconfirmedError.message:String(s.unconfirmedError));return}if(s.notifyServer===!1||!r){this.finishPersistedLease(r);return}if(!i){this.showPersistedWarning(r,"The prior browser debugging lease could not yet be revoked");return}await this.revokePersistedLease(r,i,{keepalive:s.keepalive})}setSnapshot(s){this.snapshot=s;for(const n of this.listeners)n()}suspendLocalLease(){var n,r;const s=this.persistedLease;s&&(this.enableAttempt+=1,this.stopped=!0,this.pollGeneration+=1,(n=this.pollAbortController)==null||n.abort(),this.pollAbortController=null,this.pageOwnership.release(),this.lease=null,this.sourceFetch=null,(r=this.cleanupInstrumentation)==null||r.call(this),this.cleanupInstrumentation=null,this.expiryTimer&&clearTimeout(this.expiryTimer),this.expiryTimer=null,this.events=[],this.showPersistedWarning(s,null))}async revokePersistedLease(s,n,r={}){let i=n;if(!i)try{const l=Ht().getOrCreateSourceRuntime(ps(s.sourceKey));i=l.transport.fetch.bind(l.transport)}catch{i=void 0}if(!i){this.showPersistedWarning(s,"The prior browser debugging lease could not yet be revoked");return}try{await i(`/browser-debug/leases/${s.leaseId}`,{method:"DELETE",keepalive:r.keepalive,headers:{"X-YA-Browser-Debug-Controller":s.controllerToken}}),this.finishPersistedLease(s)}catch(l){if(Js(l)){this.finishPersistedLease(s);return}this.showPersistedWarning(s,l instanceof Error?l.message:String(l))}}showPersistedWarning(s,n){var i;if(((i=this.persistedLease)==null?void 0:i.leaseId)!==s.leaseId)return;const r=Date.parse(s.expiresAt);if(r<=Date.now()){this.finishPersistedLease(s);return}this.schedulePersistedExpiry(s),this.setSnapshot({phase:"active",connected:!1,sessionId:s.sessionId,expiresAtMs:r,error:n})}schedulePersistedExpiry(s){this.expiryTimer&&clearTimeout(this.expiryTimer),this.expiryTimer=setTimeout(()=>this.finishPersistedLease(s),Math.max(0,Date.parse(s.expiresAt)-Date.now()))}finishPersistedLease(s){var n;s&&((n=this.persistedLease)==null?void 0:n.leaseId)!==s.leaseId||(s?Xs(s.leaseId):Xs(),this.pageOwnership.release(),this.persistedLease=null,this.expiryTimer&&clearTimeout(this.expiryTimer),this.expiryTimer=null,this.setSnapshot({phase:"inactive",connected:!1,sessionId:null,expiresAtMs:null,error:null}))}headers(s){return{"X-YA-Browser-Debug-Controller":s.controllerToken}}async pollLoop(s){var n;for(;!this.stopped&&s===this.pollGeneration;){const r=this.lease,i=this.sourceFetch;if(!r||!i)return;const l=new AbortController;this.pollAbortController=l;const o=setTimeout(()=>{var c;!this.stopped&&s===this.pollGeneration&&((c=this.lease)==null?void 0:c.leaseId)===r.leaseId&&!this.snapshot.connected&&this.setSnapshot({...this.snapshot,connected:!0,error:null})},Io);try{const c=await i(`/browser-debug/leases/${r.leaseId}/poll`,{method:"POST",headers:this.headers(r),signal:l.signal});if(this.stopped||s!==this.pollGeneration||((n=this.lease)==null?void 0:n.leaseId)!==r.leaseId)return;(!this.snapshot.connected||this.snapshot.error)&&this.setSnapshot({...this.snapshot,connected:!0,error:null}),c.command&&await this.execute(c.command,r,i)}catch(c){if(Tn(c)===409&&!this.stopped&&s===this.pollGeneration){this.setSnapshot({...this.snapshot,connected:!1,error:c instanceof Error?c.message:String(c)}),await new Promise(h=>setTimeout(h,$o));continue}!this.stopped&&s===this.pollGeneration&&await this.disable({notifyServer:!1,unconfirmedError:c});return}finally{clearTimeout(o),this.pollAbortController===l&&(this.pollAbortController=null)}}}async execute(s,n,r){let i;try{const l=await Eo(s.code);i={ok:!0,value:Ze(l)}}catch(l){const o=Ze(l);i={ok:!1,error:typeof o=="string"?o:JSON.stringify(o)}}await r(`/browser-debug/leases/${n.leaseId}/results`,{method:"POST",headers:this.headers(n),body:JSON.stringify({commandId:s.commandId,result:i})})}enqueue(s,n){this.stopped||(this.events.length>=ms&&this.events.shift(),this.events.push({timestamp:Date.now(),kind:s.slice(0,Oo),...n===void 0?{}:{data:Ze(n)}}))}async flushEvents(){if(this.events.length===0)return;const s=this.lease,n=this.sourceFetch;if(!s||!n)return;const r=[];let i=16;for(;r.length<100&&this.events.length>0;){const l=this.events[0];if(!l)break;const o=JSON.stringify(l).length*3+1;if(r.length>0&&i+o>fs)break;this.events.shift(),r.push(o<=fs?l:{...l,data:"[event exceeded upload size limit]"}),i+=Math.min(o,fs)}try{await n(`/browser-debug/leases/${s.leaseId}/events`,{method:"POST",headers:this.headers(s),body:JSON.stringify({events:r})})}catch{this.events.unshift(...r),this.events.length>ms&&(this.events.length=ms)}}installInstrumentation(){var c;const s=["debug","error","info","log","warn"],n=new Map;for(const h of s){const g=console[h].bind(console);n.set(h,g),console[h]=(...f)=>{g(...f),this.enqueue(`console.${h}`,f)}}const r=h=>{this.enqueue("window.error",{message:h.message,filename:h.filename,line:h.lineno,column:h.colno,error:h.error})},i=h=>{this.enqueue("unhandledrejection",h.reason)};window.addEventListener("error",r),window.addEventListener("unhandledrejection",i);const l=Yr(((c=this.lease)==null?void 0:c.sessionId)??"unknown",(h,g)=>this.enqueue(h,g)),o=setInterval(()=>void this.flushEvents(),_o);return this.enqueue("lease.enabled",{url:location.href,userAgent:navigator.userAgent}),()=>{for(const[h,g]of n)console[h]=g;window.removeEventListener("error",r),window.removeEventListener("unhandledrejection",i),l(),clearInterval(o)}}}const Me=new Vo;function Ho(){const[,e]=u.useReducer(c=>c+1,0),s=u.useSyncExternalStore(Me.subscribe,Me.getSnapshot),n=u.useCallback(c=>Me.enable(c),[]),r=u.useCallback(()=>Me.disable(),[]),i=u.useCallback(()=>Me.reactivate(),[]),l=u.useCallback((c,h)=>Me.prepareFrontendReload(c,h),[]);u.useEffect(()=>{Me.reconcilePersistedLease()},[]),u.useEffect(()=>{if(s.phase!=="active")return;const c=window.setInterval(e,1e3);return()=>window.clearInterval(c)},[s.phase]);const o=s.phase==="active"?Me.getPerformanceSummary():null;return{...s,performanceSummary:o,enable:n,disable:r,reactivate:i,prepareFrontendReload:l}}const en=["none","early","medium","late"],tn=["transcriptSearch","shortcutsHelp","syntheticDone","nudge","renderMode","conversationView","sessionStatus","attachments","modeSelector","slashMenu","thinkingToggle","contextUsage","btw","steerNow","projectQueueNewSessionShortcut","projectQueue","browserDebug","microphone","waveform","composerRecall"];function kn(e){const s=getComputedStyle(e);return Number.parseFloat(s.columnGap||s.gap)||0}function Qt(e){if(e.dataset.composerElastic==="true")return 0;const s=getComputedStyle(e);return s.display==="none"||s.position==="absolute"?0:e.getBoundingClientRect().width}function sn(e){const s=Array.from(e.children).filter(r=>r instanceof HTMLElement).map(Qt).filter(r=>r>0);if(s.length===0)return 0;const n=kn(e);return s.reduce((r,i)=>r+i,0)+n*(s.length-1)}function Go(e){return[`modeSelector:${e.modeSelector}`,`attachments:${e.attachments}`,`slashMenu:${e.slashMenu}`,`thinkingToggle:${e.thinkingToggle}`,`renderMode:${e.renderMode}`,`conversationView:${e.conversationView}`,`browserDebug:${e.browserDebug}`,`nudge:${e.nudge}`,`syntheticDone:${e.syntheticDone}`,`sessionStatus:${e.sessionStatus}`,`shortcutsHelp:${e.shortcutsHelp}`,`transcriptSearch:${e.transcriptSearch}`,`contextUsage:${e.contextUsage}`,`btw:${e.btw}`,`steerNow:${e.steerNow}`,`projectQueue:${e.projectQueue}`,`projectQueueNewSessionShortcut:${e.projectQueueNewSessionShortcut}`,`microphone:${e.microphone}`,`waveform:${e.waveform}`,`send:${e.send}`,`queue:${e.queue}`,`alternate:${e.alternate}`,`stop:${e.stop}`,`pending:${e.pending}`].join("|")}function Ko({layoutKey:e,hasControls:s,refs:n}){const[r,i]=u.useState(()=>new Set),[l,o]=u.useState(()=>typeof ResizeObserver>"u"?"late":"none"),c=u.useRef(null),h=u.useRef(0),g=u.useRef(e),f=u.useCallback(p=>{c.current=p,n!=null&&n.toolbar&&(n.toolbar.current=p)},[n==null?void 0:n.toolbar]);return u.useLayoutEffect(()=>{var L,q;if(g.current!==e){g.current=e;const R=typeof ResizeObserver>"u"?"late":"none";if(l!==R||r.size){i(new Set),o(R);return}}const p=c.current;if(!p||!s){l!=="none"&&o("none");return}let S=null;const m=()=>{var ge,k,N;S=null;const R=((ge=n==null?void 0:n.left)==null?void 0:ge.current)??p.querySelector(".message-input-left"),w=((k=n==null?void 0:n.actions)==null?void 0:k.current)??p.querySelector(".message-input-actions");if(!(R instanceof HTMLElement)||!(w instanceof HTMLElement))return;const B=R.getBoundingClientRect(),v=w.getBoundingClientRect();if(B.width===0&&v.width===0){o("late");return}const a=sn(R),H=sn(w),_=((N=n==null?void 0:n.status)==null?void 0:N.current)??p.querySelector(":scope > .composer-status-ages"),G=_ instanceof HTMLElement?Qt(_):0,I=p.querySelector(".composer-bottom-overflow"),J=I instanceof HTMLElement?Qt(I):0,te=p.querySelector('[data-file-viewer-controller-slot="true"]'),se=te instanceof HTMLElement&&Number.parseFloat(getComputedStyle(te).minWidth)||0,me=[a,G,se,J,H].filter(E=>E>0).length,P=a+G+se+J+H+kn(p)*Math.max(0,me-1),fe=p.getBoundingClientRect().width;if(P<=fe+.5)return;const K=Array.from(p.querySelectorAll(".composer-bottom-overflow-inline")).map(E=>{const y=E.matches("[data-session-toolbar-control]")?E:E.querySelector("[data-session-toolbar-control]"),we=y==null?void 0:y.dataset.sessionToolbarControl,xe=en.findIndex(Te=>E.classList.contains(`composer-bottom-overflow-${Te}`));return{element:E,key:we,priority:xe}}).filter(E=>!!E.key&&E.priority>0&&!r.has(E.key)&&Qt(E.element)>0).sort((E,y)=>E.priority-y.priority||tn.indexOf(E.key)-tn.indexOf(y.key))[0];K&&(i(new Set([...r,K.key])),o(en[K.priority]??"late"))},M=()=>{S!==null&&cancelAnimationFrame(S),S=requestAnimationFrame(m)},d=R=>{const w=R.find(B=>B.target===p);if(w){const B=w.contentRect.width;B>h.current+1&&(i(new Set),o("none")),h.current=B}M()};m();let T=null;return typeof ResizeObserver<"u"&&(T=new ResizeObserver(d),T.observe(p),(L=n==null?void 0:n.left)!=null&&L.current&&T.observe(n.left.current),(q=n==null?void 0:n.actions)!=null&&q.current&&T.observe(n.actions.current)),()=>{T==null||T.disconnect(),S!==null&&cancelAnimationFrame(S)}},[l,r,e,s,n==null?void 0:n.actions,n==null?void 0:n.left,n==null?void 0:n.status]),{tier:l,hiddenControls:r,setToolbarRef:f}}const Ts=70,bs=0,Qo=100,nn=5;function jn(e){const s=Number.isFinite(e)?e:Ts,n=bs+Math.round((s-bs)/nn)*nn;return Math.min(Qo,Math.max(bs,n))}const gt=fr(br.waveformButtonBackgroundOpacityPercent,Ts,e=>{const s=Number(e);return Number.isFinite(s)?jn(s):void 0});gt.read;const zo=e=>{gt.set(jn(e))};function Yo(){return{waveformButtonBackgroundOpacityPercent:u.useSyncExternalStore(gt.subscribe,gt.read,gt.read),setWaveformButtonBackgroundOpacityPercent:zo}}function Xo(e,s){switch(e.reason){case"rate_limit":return s("providerRuntimeReasonRateLimit");case"overloaded":return s("providerRuntimeReasonOverloaded");case"server_error":return s("providerRuntimeReasonServerError");case"network":return s("providerRuntimeReasonNetwork");case"unknown":return s("providerRuntimeReasonUnknown")}}function Jo(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}function Zo(e,s){if(!e)return null;const n=Gr(e.provider).displayName,r=Xo(e,s),i=e.kind==="terminal"?s("toolbarProviderRuntimeStopped",{provider:n}):e.reason==="rate_limit"?s("toolbarProviderRuntimeRateLimited",{provider:n}):s("toolbarProviderRuntimeRetrying",{provider:n}),l=e.kind==="retrying"?Je(e.retryAt):null,o=e.kind==="terminal"?s("toolbarProviderRuntimeStoppedReason",{label:i,reason:r}):l!==null?s("toolbarProviderRuntimeRetryAt",{label:i,time:Jo(l)}):i,c=[o,e.kind==="terminal"?e.scope==="provider_process"?s("providerRuntimeProcessTerminalTitle"):s("providerRuntimeTerminalTitle"):s("providerRuntimeRetryingTitle"),s("providerRuntimeReasonTitle",{reason:r}),e.message??null,e.details??null,e.kind==="retrying"&&e.httpStatus!==void 0?s("providerRuntimeHttpStatusTitle",{status:e.httpStatus}):null,e.kind==="retrying"&&e.lastSeenAt?s("providerRuntimeLastSeenTitle",{time:e.lastSeenAt}):null,e.kind==="terminal"?s("providerRuntimeOccurredTitle",{time:e.occurredAt}):null,e.source?s("providerRuntimeSourceTitle",{source:e.source}):null].filter(Boolean).join(`
54
- `);return{label:i,summary:o,retryAtMs:l,tone:e.kind==="terminal"?"danger":"warn",title:c}}const vs="yepanywhere:session-isearch-guide",ei="yepanywhere:session-isearch-open";function ti(){window.dispatchEvent(new Event(ei))}function Ca(e){window.dispatchEvent(new CustomEvent(vs,{detail:e}))}const si="_overflowHidden_18ibd_1",ni="_overflowVisible_18ibd_5",ri="_overflow_18ibd_1",oi="_fileViewerControllerActive_18ibd_19",ii="_fileViewerOpen_18ibd_27",ai="_waveformRegion_18ibd_52",ci="_thinkingControl_18ibd_61",li="_thinkingMenu_18ibd_67",ui="_thinkingMenuHint_18ibd_84",di="_browserDebugButton_18ibd_89",hi="_doneButton_18ibd_123",pi="_transcriptSearchButton_18ibd_124",mi="_browserDebugButtonActive_18ibd_162",fi="_browserDebugCountdown_18ibd_177",bi="_browserDebugWarning_18ibd_189",gi="_browserDebugPerformance_18ibd_201",wi="_waveformBackdropActive_18ibd_214",xi="_waveformPreviewRegion_18ibd_218",vi="_hidePopover_18ibd_355",Si="_hidePopoverTooltip_18ibd_370",Ti="_hidePopoverAction_18ibd_383",U={overflowHidden:si,overflowVisible:ni,overflow:ri,fileViewerControllerActive:oi,fileViewerOpen:ii,waveformRegion:ai,thinkingControl:ci,thinkingMenu:li,thinkingMenuHint:ui,browserDebugButton:di,doneButton:hi,transcriptSearchButton:pi,browserDebugButtonActive:mi,browserDebugCountdown:fi,browserDebugWarning:bi,browserDebugPerformance:gi,waveformBackdropActive:wi,waveformPreviewRegion:xi,hidePopover:vi,hidePopoverTooltip:Si,hidePopoverAction:Ti},ki="_mark_13whk_1",ji={mark:ki};function yi(){return t.jsx("span",{className:ji.mark,"aria-hidden":"true",children:"+"})}const Ei="_tokenUsage_4fq43_4",Ai="_rows_4fq43_12",Mi="_row_4fq43_12",Li="_hint_4fq43_38",Oe={tokenUsage:Ei,rows:Ai,row:Mi,hint:Li};function Ni(e){return e?e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`:"—"}function Pi(e,s,n){return e.scope.type==="models"?e.scope.label??e.scope.modelIds.join(", "):e.scope.category==="oauthApps"?n:s}function yn(e){return!!e&&(e.cacheReadTokens!==void 0||e.cacheCreationTokens!==void 0||e.outputTokens!==void 0)}function Ri({usage:e}){const{locale:s,t:n}=et(),r=i=>new Intl.NumberFormat(s,{maximumFractionDigits:0}).format(i);return t.jsxs("div",{className:Oe.tokenUsage,children:[t.jsx("div",{className:"context-threshold-popover-title",children:n("contextTokenUsageTitle")}),t.jsxs("dl",{className:Oe.rows,children:[t.jsxs("div",{className:Oe.row,children:[t.jsx("dt",{children:n("contextTokenUsageContext")}),t.jsx("dd",{children:r(e.inputTokens)})]}),e.cacheReadTokens!==void 0&&t.jsxs("div",{className:Oe.row,children:[t.jsx("dt",{children:n("contextTokenUsageCacheRead")}),t.jsx("dd",{children:r(e.cacheReadTokens)})]}),e.cacheCreationTokens!==void 0&&t.jsxs("div",{className:Oe.row,children:[t.jsx("dt",{children:n("contextTokenUsageCacheWrite")}),t.jsx("dd",{children:r(e.cacheCreationTokens)})]}),e.outputTokens!==void 0&&t.jsxs("div",{className:Oe.row,children:[t.jsx("dt",{children:n("contextTokenUsageOutput")}),t.jsx("dd",{children:r(e.outputTokens)})]})]}),t.jsx("div",{className:Oe.hint,children:n("contextTokenUsageHint")})]})}function _i({usage:e,contextUsage:s,modelId:n,refreshing:r,onRefresh:i,onEditCompactThreshold:l}){const{locale:o,t:c}=et(),h=e?uo(e,n).sort((p,S)=>S.usedPercent-p.usedPercent):[],g=e?wn(e,n):null,f=yn(s);return t.jsxs("div",{className:"context-subscription-popover",role:"dialog","aria-label":c(e?"subscriptionUsageTitle":"contextTokenUsageTitle"),"aria-busy":r,children:[e&&t.jsxs("div",{className:"subscription-usage-header",children:[t.jsxs("div",{children:[t.jsx("div",{className:"context-threshold-popover-title",children:c("subscriptionUsageTitle")}),g&&t.jsx("div",{className:"subscription-usage-summary",children:c("subscriptionUsageCompact",{percent:Math.round(g.usedPercent)})})]}),t.jsx("button",{type:"button",className:"subscription-usage-refresh",onClick:i,disabled:r,"aria-label":c("subscriptionUsageRefresh"),title:c("subscriptionUsageRefresh"),children:"↻"})]}),t.jsx("div",{className:"subscription-usage-windows",children:h.map(p=>t.jsxs("div",{className:"subscription-usage-window",children:[t.jsxs("div",{className:"subscription-usage-window-heading",children:[t.jsxs("span",{children:[Pi(p,c("subscriptionUsageAllModels"),c("subscriptionUsageClaudeApps"))," · ",c("subscriptionUsageWindow",{duration:Ni(p.windowDurationMinutes)})]}),t.jsx("strong",{children:c("subscriptionUsagePercent",{percent:Math.round(p.usedPercent)})})]}),t.jsx("div",{className:"subscription-usage-meter","aria-hidden":"true",children:t.jsx("span",{style:{width:`${p.usedPercent}%`}})}),p.resetsAt&&t.jsx("div",{className:"subscription-usage-reset",children:c("subscriptionUsageResets",{time:new Intl.DateTimeFormat(o,{dateStyle:"short",timeStyle:"short"}).format(new Date(p.resetsAt))})})]},p.id))}),f&&s&&t.jsx(Ri,{usage:s}),l&&t.jsx("button",{type:"button",className:"subscription-usage-compact-action",onClick:l,children:c("subscriptionUsageEditCompact")})]})}const Di=450,rn=8,on="--context-popover-shift";function Bi(e,s,n){if(s&&s>0)return s;if(e){const r=So(e);if(r>0)return r}return n&&n>0?n:void 0}function Oi({usage:e,model:s,provider:n,contextWindow:r,size:i=16}){var P,fe,be,K,ge;const{t:l}=et(),{settings:o,updateSetting:c}=Zr(),{providers:h}=bn(),{usage:g,loading:f,refresh:p}=ho(n),[S,m]=u.useState(null),M=u.useRef(null),d=u.useRef(null),T=u.useRef(!1),L=!!e&&!!s&&s!=="default",q=wn(g,s),R=q!==null,w=yn(e),B=R||w,v=((P=h.find(k=>k.name===n))==null?void 0:P.supportsNativeCompactThreshold)===!0,a=((fe=o==null?void 0:o.clientDefaults)==null?void 0:fe.forceYaOrchestratedCompaction)===!0,H=(s?(K=(be=o==null?void 0:o.clientDefaults)==null?void 0:be.compactAtContextPercent)==null?void 0:K[s]:void 0)??0,[_,G]=u.useState(H);u.useEffect(()=>{G(H)},[H]);const I=u.useCallback(k=>{var E;if(!s)return;const N={...(E=o==null?void 0:o.clientDefaults)==null?void 0:E.compactAtContextPercent};k>0&&k<100?N[s]=Math.round(k):delete N[s],c("clientDefaults",{compactAtContextPercent:N}).catch(()=>{})},[s,(ge=o==null?void 0:o.clientDefaults)==null?void 0:ge.compactAtContextPercent,c]),J=()=>{d.current&&(clearTimeout(d.current),d.current=null)};if(u.useEffect(()=>{if(!S)return;const k=E=>{M.current&&!M.current.contains(E.target)&&m(null)},N=E=>{E.key==="Escape"&&m(null)};return document.addEventListener("mousedown",k),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",N)}},[S]),u.useEffect(()=>{var xe;if(!S)return;const k=(xe=M.current)==null?void 0:xe.querySelector('[role="dialog"]');if(!k)return;k.style.setProperty(on,"0px");const N=k.getBoundingClientRect(),E=N.right-(window.innerWidth-rn),y=rn-N.left,we=E>0?-E:y>0?y:0;we!==0&&k.style.setProperty(on,`${Math.round(we)}px`)},[S]),!e)return null;const te=Bi(s,r,e.contextWindow),se=te&&_>0?`${Math.round(te*_/100/1024)}K`:null;if(!L&&!B)return t.jsx(Gs,{usage:e,size:i});const me=R&&q?l("subscriptionUsageContextAria",{contextPercent:Math.round(e.percentage),usagePercent:Math.round(q.usedPercent)}):w?l("contextTokenUsageAria",{contextPercent:Math.round(e.percentage)}):l("compactThresholdQuickTitle");return t.jsxs("div",{ref:M,className:"context-threshold-quickedit",children:[t.jsx("span",{className:"context-threshold-quickedit-trigger",role:"button",tabIndex:0,"aria-haspopup":"dialog","aria-expanded":S!==null,"aria-label":me,onClick:()=>{if(T.current){T.current=!1;return}B&&m(k=>k==="usage"?null:"usage")},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),B?m(N=>N==="usage"?null:"usage"):L&&m(N=>N==="threshold"?null:"threshold"))},onContextMenu:k=>{L&&(k.preventDefault(),m(N=>N==="threshold"?null:"threshold"))},onTouchStart:()=>{L&&(J(),d.current=setTimeout(()=>{d.current=null,T.current=!0,m("threshold")},Di))},onTouchEnd:J,onTouchMove:J,children:t.jsx(Gs,{usage:e,size:i})}),S==="usage"&&(g||w)&&t.jsx(_i,{usage:g??void 0,contextUsage:e,modelId:s,refreshing:f,onRefresh:()=>void p(),onEditCompactThreshold:L?()=>m("threshold"):void 0}),S==="threshold"&&t.jsxs("div",{className:"context-threshold-popover",role:"dialog",children:[t.jsx("div",{className:"context-threshold-popover-title",children:l("compactThresholdQuickTitle")}),t.jsx(bo,{min:0,max:99,step:1,value:_,"aria-label":l("compactThresholdQuickTitle"),onDraftChange:G,onCommit:I}),t.jsx("div",{className:"context-threshold-popover-hint",children:_>0?l("compactThresholdQuickOn",{percent:String(_),tokens:se??"—"}):l("compactThresholdQuickOff")}),v&&t.jsxs("label",{className:"context-threshold-popover-force",children:[t.jsx("input",{type:"checkbox",checked:a,onChange:k=>{c("clientDefaults",{forceYaOrchestratedCompaction:k.currentTarget.checked}).catch(()=>{})}}),t.jsx("span",{children:l("compactThresholdQuickForceYa")})]})]})]})}function an({mode:e,onModeChange:s,modes:n,disabled:r,changesApplyNextTurn:i=!1,modeChangePending:l=!1}){const{t:o}=et(),[c,h]=u.useState(!1),g=u.useRef(null),f=u.useRef(null),p=()=>{var v;r||((v=g.current)==null||v.blur(),h(!0))},S=(v,a)=>{a==null||a.preventDefault(),a==null||a.stopPropagation(),s(v),h(!1)},m=u.useCallback(()=>{h(!1)},[]);u.useEffect(()=>{if(!c)return;const v=a=>{a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),m())};return document.addEventListener("keydown",v,!0),()=>document.removeEventListener("keydown",v,!0)},[c,m]),u.useEffect(()=>{if(!c)return;const v=a=>{f.current&&!f.current.contains(a.target)&&g.current&&!g.current.contains(a.target)&&m()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c,m]),u.useEffect(()=>{var v;c&&((v=f.current)==null||v.focus())},[c]);const M={default:o("modeDefaultLabel"),acceptEdits:o("modeAcceptEditsLabel"),plan:o("modePlanLabel"),bypassPermissions:o("modeBypassPermissionsLabel"),auto:o("modeAutoLabel")},d=n??xn({currentMode:e}),T=M[e],L=`mode-${e}`,q=i||l,R=q?`${o("modeClickToSelect")} - ${o("modeNextTurnHint")}`:o("modeClickToSelect"),w=t.jsxs(t.Fragment,{children:[q&&t.jsx("div",{className:"mode-selector-timing-note",role:"status",children:o("modeNextTurnHint")}),d.map(v=>t.jsxs("button",{type:"button",className:`mode-selector-option ${e===v?"selected":""}`,onClick:a=>S(v,a),"aria-pressed":e===v,children:[t.jsx("span",{className:`mode-dot mode-${v}`}),t.jsx("span",{className:"mode-selector-label",children:M[v]}),e===v&&t.jsx("span",{className:"mode-selector-check","aria-hidden":"true",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"20 6 9 17 4 12"})})})]},v))]}),B=c?t.jsx("div",{ref:f,className:"mode-selector-dropdown",role:"dialog",tabIndex:-1,"aria-label":o("modeSelectLabel"),children:t.jsx("div",{className:"mode-selector-options",children:w})}):null;return t.jsxs("div",{className:"mode-selector-container",children:[t.jsxs("button",{ref:g,type:"button",className:"mode-button",onClick:p,disabled:r,title:R,"aria-haspopup":"listbox","aria-expanded":c,children:[t.jsx("span",{className:`mode-dot ${L}`}),t.jsxs("span",{className:"mode-button-label",children:[T,l?` ${o("modePendingSuffix")}`:null]})]}),B]})}function cn({commands:e,onSelectCommand:s,disabled:n}){const{t:r}=et(),[i,l]=u.useState(!1),[o,c]=u.useState(null),h=u.useMemo(()=>{var M,d;const m=new Map;for(const T of e){const L=T.name.trim().toLowerCase(),q=m.get(L);(!q||((M=q.invocation)==null?void 0:M.kind)==="skill"&&((d=T.invocation)==null?void 0:d.kind)!=="skill")&&m.set(L,T)}return e.filter(T=>m.get(T.name.trim().toLowerCase())===T)},[e]),g=u.useRef(null),f=u.useRef(null);u.useEffect(()=>{if(!i)return;const m=M=>{f.current&&!f.current.contains(M.target)&&g.current&&!g.current.contains(M.target)&&l(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i]),u.useEffect(()=>{if(!i)return;const m=M=>{var d;M.key==="Escape"&&(l(!1),(d=g.current)==null||d.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[i]),u.useEffect(()=>{if(!i)return;const m=()=>l(!1);return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[i]);const p=u.useCallback(()=>{if(!i&&g.current){const m=g.current.getBoundingClientRect();c({bottom:window.innerHeight-m.top+4,left:m.left})}l(m=>!m)},[i]),S=u.useCallback(m=>{s(m),l(!1)},[s]);return e.length===0?null:t.jsxs("div",{className:"slash-command-container",children:[t.jsx("button",{ref:g,type:"button",className:`slash-command-button ${i?"active":""}`,onClick:p,disabled:n,title:r("slashCommandsLabel"),"aria-label":r("slashCommandsShow"),"aria-expanded":i,"aria-haspopup":"menu",children:t.jsx("span",{className:"slash-icon",children:"/$"})}),i&&o&&Ss.createPortal(t.jsx("div",{ref:f,className:"slash-command-menu",style:{position:"fixed",bottom:o.bottom,left:o.left},role:"menu","aria-label":r("slashCommandsLabel"),children:h.map(m=>{var M;return t.jsx(Ii,{command:m,onSelect:S},`${Nr(m)}:${((M=m.invocation)==null?void 0:M.kind)??"legacy"}`)})}),document.body)]})}function Ii({command:e,onSelect:s}){const n=Pr(e);return t.jsx("button",{type:"button",className:"slash-command-item",onClick:()=>s(e),role:"menuitem","aria-label":n.label,children:t.jsxs("span",{className:"slash-command-copy",children:[t.jsxs("span",{children:[n.shortcut&&t.jsx("strong",{className:"slash-command-shortcut",children:n.shortcut}),n.rest]}),(e.description||e.argumentHint)&&t.jsx("span",{className:"slash-command-detail",children:[e.description,e.argumentHint].filter(Boolean).join(" · ")})]})})}const $i="_slot_17wqx_1",Ui="_controller_17wqx_11",Fi="_waveformActive_17wqx_32",Ci="_toggle_17wqx_47",Wi="_close_17wqx_48",qi="_location_17wqx_92",Vi="_path_17wqx_101",Hi="_briefPath_17wqx_115",Gi="_line_17wqx_123",Ki="_parked_17wqx_128",Qi="_kill_17wqx_169",pe={slot:$i,controller:Ui,waveformActive:Fi,toggle:Ci,close:Wi,location:qi,path:Vi,briefPath:Hi,line:Gi,parked:Ki,kill:Qi};function zi(e){const s=u.useRef(null),n=u.useRef(null);return u.useLayoutEffect(()=>{var g,f;const r=s.current,i=n.current;if(!r||!i||typeof window>"u")return;i.dataset.fileViewerState=e?"parked":"open";let l=0;const o=()=>{l=0;const p=r.getBoundingClientRect();i.style.left=`${p.left}px`,i.style.top=`${p.top}px`,i.style.width=`${p.width}px`,i.style.height=`${p.height}px`},c=()=>{window.cancelAnimationFrame(l),l=window.requestAnimationFrame(o)},h=typeof ResizeObserver>"u"?null:new ResizeObserver(c);return h==null||h.observe(r),window.addEventListener("resize",c),(g=window.visualViewport)==null||g.addEventListener("resize",c),(f=window.visualViewport)==null||f.addEventListener("scroll",c),o(),()=>{var p,S;window.cancelAnimationFrame(l),h==null||h.disconnect(),window.removeEventListener("resize",c),(p=window.visualViewport)==null||p.removeEventListener("resize",c),(S=window.visualViewport)==null||S.removeEventListener("scroll",c)}},[e]),{slotRef:s,floatingRef:n}}function Yi(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M3 3.5h10v9H3z"}),t.jsx("path",{d:"M5.5 6.5L8 4l2.5 2.5M8 4v5"})]})}function Xi(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:t.jsx("path",{d:"M3 11.5h10"})})}function Ji(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:t.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function Zi({controller:e,t:s,waveformButtonBackgroundOpacityPercent:n}){const{slotRef:r,floatingRef:i}=zi(e.minimized),l=e.label,o=e.closeAction,c=o?s(o.label,{name:l}):"",h=e.kind==="file"?e.filePath:l,g=e.kind==="file"?`…/${e.briefLabel??e.filePath}`:e.briefLabel??l,f=e.minimized?s(e.kind==="file"?"fileViewerRestore":"sessionViewerRestore",{name:l}):s(e.kind==="file"?"fileViewerMinimizeNamed":"sessionViewerMinimizeNamed",{name:l}),p=t.jsxs("div",{ref:i,className:`${pe.controller} ${e.minimized?pe.parked:""}${n===void 0?"":` ${pe.waveformActive}`}`,style:n===void 0?void 0:{"--waveform-control-surface-opacity":`${n}%`},role:"group","aria-label":s(e.kind==="file"?"fileViewerController":"sessionViewerController",{name:l}),children:[t.jsxs("button",{type:"button",className:pe.toggle,onClick:e.minimized?e.restore:e.minimize,onContextMenu:e.kind==="file"?S=>{S.preventDefault(),gr(e.filePath)}:void 0,title:f,"aria-label":f,children:[e.minimized?t.jsx(Yi,{}):t.jsx(Xi,{}),t.jsxs("span",{className:pe.location,"aria-hidden":"true",children:[t.jsx("span",{className:pe.path,children:t.jsx("bdi",{children:h})}),t.jsx("span",{className:pe.briefPath,children:t.jsx("bdi",{children:g})}),e.kind==="file"&&e.lineSuffix&&t.jsx("span",{className:pe.line,children:e.lineSuffix})]})]}),o&&t.jsx("button",{type:"button",className:`${pe.close} ${o.destructive?pe.kill:""}`,disabled:o.busy,onClick:o.run,title:c,"aria-label":c,children:t.jsx(Ji,{})})]});return t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:r,className:pe.slot,"data-file-viewer-controller-slot":"true","aria-hidden":"true"}),typeof document>"u"?null:Ss.createPortal(p,document.body)]})}const ea=u.lazy(()=>yr(()=>import("./BrowserDebugToolbarButton-CRE47FFy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])).then(e=>({default:e.BrowserDebugToolbarButton}))),ta=()=>()=>{},ln=()=>null;function un(e){switch(e){case"first":return"composer-bottom-overflow-early";case"mid":return"composer-bottom-overflow-medium";case"last":return"composer-bottom-overflow-late";default:return""}}function sa(e){return e==="links"?["Ctrl","Alt","K"]:e==="full"?["Ctrl","Alt","S"]:e==="all"?["Ctrl","S"]:["Ctrl","R"]}function na(e,s){return[...e==="user"?[]:[{scope:"user",keys:["Ctrl","R"],label:s("toolbarShortcutUserTurns")}],...e==="all"?[]:[{scope:"all",keys:["Ctrl","S"],label:s("toolbarShortcutAllTurns")}],...e==="full"?[]:[{scope:"full",keys:["Ctrl","Alt","S"],label:s("toolbarShortcutFullSession")}],...e==="links"?[]:[{scope:"links",keys:["Ctrl","Alt","K"],label:s("toolbarShortcutLinks")}]]}function ra(e,s){const n=Je(e.checkedAt),r=Je(e.lastStateChangeAt),i=Je(e.lastVerifiedProgressAt??e.lastProviderMessageAt),l=Je(e.lastVerifiedIdleAt),o=[`status: ${e.derivedStatus}`,`work: ${e.activeWorkKind}`,e.lastRawProviderEventAt?`raw provider: ${e.lastRawProviderEventSource??"unknown"} at ${e.lastRawProviderEventAt}`:null,`evidence: ${e.evidence.join(", ")}`].filter(Boolean).join(`
54
+ `);return{label:i,summary:o,retryAtMs:l,tone:e.kind==="terminal"?"danger":"warn",title:c}}const vs="yepanywhere:session-isearch-guide",ei="yepanywhere:session-isearch-open";function ti(){window.dispatchEvent(new Event(ei))}function Ca(e){window.dispatchEvent(new CustomEvent(vs,{detail:e}))}const si="_overflowHidden_18ibd_1",ni="_overflowVisible_18ibd_5",ri="_overflow_18ibd_1",oi="_fileViewerControllerActive_18ibd_19",ii="_fileViewerOpen_18ibd_27",ai="_waveformRegion_18ibd_52",ci="_thinkingControl_18ibd_61",li="_thinkingMenu_18ibd_67",ui="_thinkingMenuHint_18ibd_84",di="_browserDebugButton_18ibd_89",hi="_doneButton_18ibd_123",pi="_transcriptSearchButton_18ibd_124",mi="_browserDebugButtonActive_18ibd_162",fi="_browserDebugCountdown_18ibd_177",bi="_browserDebugWarning_18ibd_189",gi="_browserDebugPerformance_18ibd_201",wi="_waveformBackdropActive_18ibd_214",xi="_waveformPreviewRegion_18ibd_218",vi="_hidePopover_18ibd_355",Si="_hidePopoverTooltip_18ibd_370",Ti="_hidePopoverAction_18ibd_383",U={overflowHidden:si,overflowVisible:ni,overflow:ri,fileViewerControllerActive:oi,fileViewerOpen:ii,waveformRegion:ai,thinkingControl:ci,thinkingMenu:li,thinkingMenuHint:ui,browserDebugButton:di,doneButton:hi,transcriptSearchButton:pi,browserDebugButtonActive:mi,browserDebugCountdown:fi,browserDebugWarning:bi,browserDebugPerformance:gi,waveformBackdropActive:wi,waveformPreviewRegion:xi,hidePopover:vi,hidePopoverTooltip:Si,hidePopoverAction:Ti},ki="_mark_13whk_1",ji={mark:ki};function yi(){return t.jsx("span",{className:ji.mark,"aria-hidden":"true",children:"+"})}const Ei="_tokenUsage_4fq43_4",Ai="_rows_4fq43_12",Mi="_row_4fq43_12",Li="_hint_4fq43_38",Oe={tokenUsage:Ei,rows:Ai,row:Mi,hint:Li};function Ni(e){return e?e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`:"—"}function Pi(e,s,n){return e.scope.type==="models"?e.scope.label??e.scope.modelIds.join(", "):e.scope.category==="oauthApps"?n:s}function yn(e){return!!e&&(e.cacheReadTokens!==void 0||e.cacheCreationTokens!==void 0||e.outputTokens!==void 0)}function Ri({usage:e}){const{locale:s,t:n}=et(),r=i=>new Intl.NumberFormat(s,{maximumFractionDigits:0}).format(i);return t.jsxs("div",{className:Oe.tokenUsage,children:[t.jsx("div",{className:"context-threshold-popover-title",children:n("contextTokenUsageTitle")}),t.jsxs("dl",{className:Oe.rows,children:[t.jsxs("div",{className:Oe.row,children:[t.jsx("dt",{children:n("contextTokenUsageContext")}),t.jsx("dd",{children:r(e.inputTokens)})]}),e.cacheReadTokens!==void 0&&t.jsxs("div",{className:Oe.row,children:[t.jsx("dt",{children:n("contextTokenUsageCacheRead")}),t.jsx("dd",{children:r(e.cacheReadTokens)})]}),e.cacheCreationTokens!==void 0&&t.jsxs("div",{className:Oe.row,children:[t.jsx("dt",{children:n("contextTokenUsageCacheWrite")}),t.jsx("dd",{children:r(e.cacheCreationTokens)})]}),e.outputTokens!==void 0&&t.jsxs("div",{className:Oe.row,children:[t.jsx("dt",{children:n("contextTokenUsageOutput")}),t.jsx("dd",{children:r(e.outputTokens)})]})]}),t.jsx("div",{className:Oe.hint,children:n("contextTokenUsageHint")})]})}function _i({usage:e,contextUsage:s,modelId:n,refreshing:r,onRefresh:i,onEditCompactThreshold:l}){const{locale:o,t:c}=et(),h=e?uo(e,n).sort((p,S)=>S.usedPercent-p.usedPercent):[],g=e?wn(e,n):null,f=yn(s);return t.jsxs("div",{className:"context-subscription-popover",role:"dialog","aria-label":c(e?"subscriptionUsageTitle":"contextTokenUsageTitle"),"aria-busy":r,children:[e&&t.jsxs("div",{className:"subscription-usage-header",children:[t.jsxs("div",{children:[t.jsx("div",{className:"context-threshold-popover-title",children:c("subscriptionUsageTitle")}),g&&t.jsx("div",{className:"subscription-usage-summary",children:c("subscriptionUsageCompact",{percent:Math.round(g.usedPercent)})})]}),t.jsx("button",{type:"button",className:"subscription-usage-refresh",onClick:i,disabled:r,"aria-label":c("subscriptionUsageRefresh"),title:c("subscriptionUsageRefresh"),children:"↻"})]}),t.jsx("div",{className:"subscription-usage-windows",children:h.map(p=>t.jsxs("div",{className:"subscription-usage-window",children:[t.jsxs("div",{className:"subscription-usage-window-heading",children:[t.jsxs("span",{children:[Pi(p,c("subscriptionUsageAllModels"),c("subscriptionUsageClaudeApps"))," · ",c("subscriptionUsageWindow",{duration:Ni(p.windowDurationMinutes)})]}),t.jsx("strong",{children:c("subscriptionUsagePercent",{percent:Math.round(p.usedPercent)})})]}),t.jsx("div",{className:"subscription-usage-meter","aria-hidden":"true",children:t.jsx("span",{style:{width:`${p.usedPercent}%`}})}),p.resetsAt&&t.jsx("div",{className:"subscription-usage-reset",children:c("subscriptionUsageResets",{time:new Intl.DateTimeFormat(o,{dateStyle:"short",timeStyle:"short"}).format(new Date(p.resetsAt))})})]},p.id))}),f&&s&&t.jsx(Ri,{usage:s}),l&&t.jsx("button",{type:"button",className:"subscription-usage-compact-action",onClick:l,children:c("subscriptionUsageEditCompact")})]})}const Di=450,rn=8,on="--context-popover-shift";function Bi(e,s,n){if(s&&s>0)return s;if(e){const r=So(e);if(r>0)return r}return n&&n>0?n:void 0}function Oi({usage:e,model:s,provider:n,contextWindow:r,size:i=16}){var P,fe,be,K,ge;const{t:l}=et(),{settings:o,updateSetting:c}=Zr(),{providers:h}=bn(),{usage:g,loading:f,refresh:p}=ho(n),[S,m]=u.useState(null),M=u.useRef(null),d=u.useRef(null),T=u.useRef(!1),L=!!e&&!!s&&s!=="default",q=wn(g,s),R=q!==null,w=yn(e),B=R||w,v=((P=h.find(k=>k.name===n))==null?void 0:P.supportsNativeCompactThreshold)===!0,a=((fe=o==null?void 0:o.clientDefaults)==null?void 0:fe.forceYaOrchestratedCompaction)===!0,H=(s?(K=(be=o==null?void 0:o.clientDefaults)==null?void 0:be.compactAtContextPercent)==null?void 0:K[s]:void 0)??0,[_,G]=u.useState(H);u.useEffect(()=>{G(H)},[H]);const I=u.useCallback(k=>{var E;if(!s)return;const N={...(E=o==null?void 0:o.clientDefaults)==null?void 0:E.compactAtContextPercent};k>0&&k<100?N[s]=Math.round(k):delete N[s],c("clientDefaults",{compactAtContextPercent:N}).catch(()=>{})},[s,(ge=o==null?void 0:o.clientDefaults)==null?void 0:ge.compactAtContextPercent,c]),J=()=>{d.current&&(clearTimeout(d.current),d.current=null)};if(u.useEffect(()=>{if(!S)return;const k=E=>{M.current&&!M.current.contains(E.target)&&m(null)},N=E=>{E.key==="Escape"&&m(null)};return document.addEventListener("mousedown",k),document.addEventListener("keydown",N),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",N)}},[S]),u.useEffect(()=>{var xe;if(!S)return;const k=(xe=M.current)==null?void 0:xe.querySelector('[role="dialog"]');if(!k)return;k.style.setProperty(on,"0px");const N=k.getBoundingClientRect(),E=N.right-(window.innerWidth-rn),y=rn-N.left,we=E>0?-E:y>0?y:0;we!==0&&k.style.setProperty(on,`${Math.round(we)}px`)},[S]),!e)return null;const te=Bi(s,r,e.contextWindow),se=te&&_>0?`${Math.round(te*_/100/1024)}K`:null;if(!L&&!B)return t.jsx(Gs,{usage:e,size:i});const me=R&&q?l("subscriptionUsageContextAria",{contextPercent:Math.round(e.percentage),usagePercent:Math.round(q.usedPercent)}):w?l("contextTokenUsageAria",{contextPercent:Math.round(e.percentage)}):l("compactThresholdQuickTitle");return t.jsxs("div",{ref:M,className:"context-threshold-quickedit",children:[t.jsx("span",{className:"context-threshold-quickedit-trigger",role:"button",tabIndex:0,"aria-haspopup":"dialog","aria-expanded":S!==null,"aria-label":me,onClick:()=>{if(T.current){T.current=!1;return}B&&m(k=>k==="usage"?null:"usage")},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),B?m(N=>N==="usage"?null:"usage"):L&&m(N=>N==="threshold"?null:"threshold"))},onContextMenu:k=>{L&&(k.preventDefault(),m(N=>N==="threshold"?null:"threshold"))},onTouchStart:()=>{L&&(J(),d.current=setTimeout(()=>{d.current=null,T.current=!0,m("threshold")},Di))},onTouchEnd:J,onTouchMove:J,children:t.jsx(Gs,{usage:e,size:i})}),S==="usage"&&(g||w)&&t.jsx(_i,{usage:g??void 0,contextUsage:e,modelId:s,refreshing:f,onRefresh:()=>void p(),onEditCompactThreshold:L?()=>m("threshold"):void 0}),S==="threshold"&&t.jsxs("div",{className:"context-threshold-popover",role:"dialog",children:[t.jsx("div",{className:"context-threshold-popover-title",children:l("compactThresholdQuickTitle")}),t.jsx(bo,{min:0,max:99,step:1,value:_,"aria-label":l("compactThresholdQuickTitle"),onDraftChange:G,onCommit:I}),t.jsx("div",{className:"context-threshold-popover-hint",children:_>0?l("compactThresholdQuickOn",{percent:String(_),tokens:se??"—"}):l("compactThresholdQuickOff")}),v&&t.jsxs("label",{className:"context-threshold-popover-force",children:[t.jsx("input",{type:"checkbox",checked:a,onChange:k=>{c("clientDefaults",{forceYaOrchestratedCompaction:k.currentTarget.checked}).catch(()=>{})}}),t.jsx("span",{children:l("compactThresholdQuickForceYa")})]})]})]})}function an({mode:e,onModeChange:s,modes:n,disabled:r,changesApplyNextTurn:i=!1,modeChangePending:l=!1}){const{t:o}=et(),[c,h]=u.useState(!1),g=u.useRef(null),f=u.useRef(null),p=()=>{var v;r||((v=g.current)==null||v.blur(),h(!0))},S=(v,a)=>{a==null||a.preventDefault(),a==null||a.stopPropagation(),s(v),h(!1)},m=u.useCallback(()=>{h(!1)},[]);u.useEffect(()=>{if(!c)return;const v=a=>{a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),m())};return document.addEventListener("keydown",v,!0),()=>document.removeEventListener("keydown",v,!0)},[c,m]),u.useEffect(()=>{if(!c)return;const v=a=>{f.current&&!f.current.contains(a.target)&&g.current&&!g.current.contains(a.target)&&m()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[c,m]),u.useEffect(()=>{var v;c&&((v=f.current)==null||v.focus())},[c]);const M={default:o("modeDefaultLabel"),acceptEdits:o("modeAcceptEditsLabel"),plan:o("modePlanLabel"),bypassPermissions:o("modeBypassPermissionsLabel"),auto:o("modeAutoLabel")},d=n??xn({currentMode:e}),T=M[e],L=`mode-${e}`,q=i||l,R=q?`${o("modeClickToSelect")} - ${o("modeNextTurnHint")}`:o("modeClickToSelect"),w=t.jsxs(t.Fragment,{children:[q&&t.jsx("div",{className:"mode-selector-timing-note",role:"status",children:o("modeNextTurnHint")}),d.map(v=>t.jsxs("button",{type:"button",className:`mode-selector-option ${e===v?"selected":""}`,onClick:a=>S(v,a),"aria-pressed":e===v,children:[t.jsx("span",{className:`mode-dot mode-${v}`}),t.jsx("span",{className:"mode-selector-label",children:M[v]}),e===v&&t.jsx("span",{className:"mode-selector-check","aria-hidden":"true",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"20 6 9 17 4 12"})})})]},v))]}),B=c?t.jsx("div",{ref:f,className:"mode-selector-dropdown",role:"dialog",tabIndex:-1,"aria-label":o("modeSelectLabel"),children:t.jsx("div",{className:"mode-selector-options",children:w})}):null;return t.jsxs("div",{className:"mode-selector-container",children:[t.jsxs("button",{ref:g,type:"button",className:"mode-button",onClick:p,disabled:r,title:R,"aria-haspopup":"listbox","aria-expanded":c,children:[t.jsx("span",{className:`mode-dot ${L}`}),t.jsxs("span",{className:"mode-button-label",children:[T,l?` ${o("modePendingSuffix")}`:null]})]}),B]})}function cn({commands:e,onSelectCommand:s,disabled:n}){const{t:r}=et(),[i,l]=u.useState(!1),[o,c]=u.useState(null),h=u.useMemo(()=>{var M,d;const m=new Map;for(const T of e){const L=T.name.trim().toLowerCase(),q=m.get(L);(!q||((M=q.invocation)==null?void 0:M.kind)==="skill"&&((d=T.invocation)==null?void 0:d.kind)!=="skill")&&m.set(L,T)}return e.filter(T=>m.get(T.name.trim().toLowerCase())===T)},[e]),g=u.useRef(null),f=u.useRef(null);u.useEffect(()=>{if(!i)return;const m=M=>{f.current&&!f.current.contains(M.target)&&g.current&&!g.current.contains(M.target)&&l(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i]),u.useEffect(()=>{if(!i)return;const m=M=>{var d;M.key==="Escape"&&(l(!1),(d=g.current)==null||d.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[i]),u.useEffect(()=>{if(!i)return;const m=()=>l(!1);return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[i]);const p=u.useCallback(()=>{if(!i&&g.current){const m=g.current.getBoundingClientRect();c({bottom:window.innerHeight-m.top+4,left:m.left})}l(m=>!m)},[i]),S=u.useCallback(m=>{s(m),l(!1)},[s]);return e.length===0?null:t.jsxs("div",{className:"slash-command-container",children:[t.jsx("button",{ref:g,type:"button",className:`slash-command-button ${i?"active":""}`,onClick:p,disabled:n,title:r("slashCommandsLabel"),"aria-label":r("slashCommandsShow"),"aria-expanded":i,"aria-haspopup":"menu",children:t.jsx("span",{className:"slash-icon",children:"/$"})}),i&&o&&Ss.createPortal(t.jsx("div",{ref:f,className:"slash-command-menu",style:{position:"fixed",bottom:o.bottom,left:o.left},role:"menu","aria-label":r("slashCommandsLabel"),children:h.map(m=>{var M;return t.jsx(Ii,{command:m,onSelect:S},`${Nr(m)}:${((M=m.invocation)==null?void 0:M.kind)??"legacy"}`)})}),document.body)]})}function Ii({command:e,onSelect:s}){const n=Pr(e);return t.jsx("button",{type:"button",className:"slash-command-item",onClick:()=>s(e),role:"menuitem","aria-label":n.label,children:t.jsxs("span",{className:"slash-command-copy",children:[t.jsxs("span",{children:[n.shortcut&&t.jsx("strong",{className:"slash-command-shortcut",children:n.shortcut}),n.rest]}),(e.description||e.argumentHint)&&t.jsx("span",{className:"slash-command-detail",children:[e.description,e.argumentHint].filter(Boolean).join(" · ")})]})})}const $i="_slot_17wqx_1",Ui="_controller_17wqx_11",Fi="_waveformActive_17wqx_32",Ci="_toggle_17wqx_47",Wi="_close_17wqx_48",qi="_location_17wqx_92",Vi="_path_17wqx_101",Hi="_briefPath_17wqx_115",Gi="_line_17wqx_123",Ki="_parked_17wqx_128",Qi="_kill_17wqx_169",pe={slot:$i,controller:Ui,waveformActive:Fi,toggle:Ci,close:Wi,location:qi,path:Vi,briefPath:Hi,line:Gi,parked:Ki,kill:Qi};function zi(e){const s=u.useRef(null),n=u.useRef(null);return u.useLayoutEffect(()=>{var g,f;const r=s.current,i=n.current;if(!r||!i||typeof window>"u")return;i.dataset.fileViewerState=e?"parked":"open";let l=0;const o=()=>{l=0;const p=r.getBoundingClientRect();i.style.left=`${p.left}px`,i.style.top=`${p.top}px`,i.style.width=`${p.width}px`,i.style.height=`${p.height}px`},c=()=>{window.cancelAnimationFrame(l),l=window.requestAnimationFrame(o)},h=typeof ResizeObserver>"u"?null:new ResizeObserver(c);return h==null||h.observe(r),window.addEventListener("resize",c),(g=window.visualViewport)==null||g.addEventListener("resize",c),(f=window.visualViewport)==null||f.addEventListener("scroll",c),o(),()=>{var p,S;window.cancelAnimationFrame(l),h==null||h.disconnect(),window.removeEventListener("resize",c),(p=window.visualViewport)==null||p.removeEventListener("resize",c),(S=window.visualViewport)==null||S.removeEventListener("scroll",c)}},[e]),{slotRef:s,floatingRef:n}}function Yi(){return t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"M3 3.5h10v9H3z"}),t.jsx("path",{d:"M5.5 6.5L8 4l2.5 2.5M8 4v5"})]})}function Xi(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:t.jsx("path",{d:"M3 11.5h10"})})}function Ji(){return t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:t.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function Zi({controller:e,t:s,waveformButtonBackgroundOpacityPercent:n}){const{slotRef:r,floatingRef:i}=zi(e.minimized),l=e.label,o=e.closeAction,c=o?s(o.label,{name:l}):"",h=e.kind==="file"?e.filePath:l,g=e.kind==="file"?`…/${e.briefLabel??e.filePath}`:e.briefLabel??l,f=e.minimized?s(e.kind==="file"?"fileViewerRestore":"sessionViewerRestore",{name:l}):s(e.kind==="file"?"fileViewerMinimizeNamed":"sessionViewerMinimizeNamed",{name:l}),p=t.jsxs("div",{ref:i,className:`${pe.controller} ${e.minimized?pe.parked:""}${n===void 0?"":` ${pe.waveformActive}`}`,style:n===void 0?void 0:{"--waveform-control-surface-opacity":`${n}%`},role:"group","aria-label":s(e.kind==="file"?"fileViewerController":"sessionViewerController",{name:l}),children:[t.jsxs("button",{type:"button",className:pe.toggle,onClick:e.minimized?e.restore:e.minimize,onContextMenu:e.kind==="file"?S=>{S.preventDefault(),gr(e.filePath)}:void 0,title:f,"aria-label":f,children:[e.minimized?t.jsx(Yi,{}):t.jsx(Xi,{}),t.jsxs("span",{className:pe.location,"aria-hidden":"true",children:[t.jsx("span",{className:pe.path,children:t.jsx("bdi",{children:h})}),t.jsx("span",{className:pe.briefPath,children:t.jsx("bdi",{children:g})}),e.kind==="file"&&e.lineSuffix&&t.jsx("span",{className:pe.line,children:e.lineSuffix})]})]}),o&&t.jsx("button",{type:"button",className:`${pe.close} ${o.destructive?pe.kill:""}`,disabled:o.busy,onClick:o.run,title:c,"aria-label":c,children:t.jsx(Ji,{})})]});return t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:r,className:pe.slot,"data-file-viewer-controller-slot":"true","aria-hidden":"true"}),typeof document>"u"?null:Ss.createPortal(p,document.body)]})}const ea=u.lazy(()=>yr(()=>import("./BrowserDebugToolbarButton-BPghQu17.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])).then(e=>({default:e.BrowserDebugToolbarButton}))),ta=()=>()=>{},ln=()=>null;function un(e){switch(e){case"first":return"composer-bottom-overflow-early";case"mid":return"composer-bottom-overflow-medium";case"last":return"composer-bottom-overflow-late";default:return""}}function sa(e){return e==="links"?["Ctrl","Alt","K"]:e==="full"?["Ctrl","Alt","S"]:e==="all"?["Ctrl","S"]:["Ctrl","R"]}function na(e,s){return[...e==="user"?[]:[{scope:"user",keys:["Ctrl","R"],label:s("toolbarShortcutUserTurns")}],...e==="all"?[]:[{scope:"all",keys:["Ctrl","S"],label:s("toolbarShortcutAllTurns")}],...e==="full"?[]:[{scope:"full",keys:["Ctrl","Alt","S"],label:s("toolbarShortcutFullSession")}],...e==="links"?[]:[{scope:"links",keys:["Ctrl","Alt","K"],label:s("toolbarShortcutLinks")}]]}function ra(e,s){const n=Je(e.checkedAt),r=Je(e.lastStateChangeAt),i=Je(e.lastVerifiedProgressAt??e.lastProviderMessageAt),l=Je(e.lastVerifiedIdleAt),o=[`status: ${e.derivedStatus}`,`work: ${e.activeWorkKind}`,e.lastRawProviderEventAt?`raw provider: ${e.lastRawProviderEventSource??"unknown"} at ${e.lastRawProviderEventAt}`:null,`evidence: ${e.evidence.join(", ")}`].filter(Boolean).join(`
55
55
  `);switch(e.derivedStatus){case"verified-progressing":return{prefix:s("toolbarLivenessVerifiedProgress"),timestampMs:i??n,tone:"ok",title:o};case"recently-active-unverified":return{prefix:s("toolbarLivenessUnverifiedTurn"),timestampMs:r??n,tone:"warn",title:o};case"long-silent-unverified":return{prefix:s("toolbarLivenessLongSilent"),timestampMs:i??r??n,tone:"danger",title:o};case"verified-waiting-provider":return{prefix:s("toolbarLivenessWaitingOnProvider"),timestampMs:i??r??n,tone:"warn",title:o};case"verified-idle":return{prefix:s("toolbarLivenessVerifiedIdle"),timestampMs:l??r??n,tone:"muted",title:o};case"needs-attention":return{prefix:e.activeWorkKind==="waiting-input"?s("toolbarLivenessNeedsInput"):s("toolbarLivenessNeedsAttention"),timestampMs:r??n,tone:"danger",title:o}}const c=e.derivedStatus;return{prefix:s("toolbarLivenessUnknownState"),timestampMs:n,tone:"warn",title:`${o}
56
56
  unknown status: ${String(c)}`}}function En(e,s,n){const r=Kt(s,n);return r==="now"?e("toolbarRelativeAgeNow"):e("toolbarRelativeAgePast",{age:r})}function oa(e,s,n){return s.timestampMs===null?s.prefix:e("toolbarLivenessSummary",{state:s.prefix,age:En(e,s.timestampMs,n)})}function ia(e,s){switch(e){case"child-session":return s("toolbarBtwChildSessionTitle");case"focused-footer":return s("toolbarBtwFocusedFooterTitle");case"focused-pane":return s("toolbarBtwFocusedPaneTitle");case"focus-existing":return s("toolbarBtwFocusExistingTitle");case"start":return s("toolbarBtwStartTitle")}}function aa(e){return e==="child-session"||e==="focused-footer"||e==="focused-pane"}const ca=1800*1e3,la="(max-width: 600px)",ua=72;function dn(){return typeof window>"u"||typeof window.matchMedia!="function"?null:window.matchMedia(la)}function hn(){return t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"9"}),t.jsx("path",{d:"m8 12 2.5 2.5L16 9"})]})}function da(){return t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("path",{d:"m8 2 1.9 1.9"}),t.jsx("path",{d:"M14.1 3.9 16 2"}),t.jsx("path",{d:"M9 7.1V6a3 3 0 0 1 6 0v1.1"}),t.jsx("rect",{width:"12",height:"13",x:"6",y:"7",rx:"5"}),t.jsx("path",{d:"M3 13h3M18 13h3M4 7.5l2.4 1.2M17.6 8.7 20 7.5M4 18.5l2.4-1.2M17.6 17.3l2.4 1.2M12 12v8"})]})}function ha({active:e,remainingFraction:s,performanceLabel:n}){return e?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:U.browserDebugCountdown,style:{"--browser-debug-remaining":s},"aria-hidden":"true",children:t.jsx("span",{className:U.browserDebugWarning,children:"!"})}),n?t.jsx("span",{className:U.browserDebugPerformance,"aria-hidden":"true",children:n}):null]}):t.jsx(da,{})}function pn({t:e,control:s,className:n,menuItem:r=!1,dataAttributes:i}){const l=t.jsx(ha,{active:s.active,remainingFraction:s.remainingFraction,performanceLabel:s.performanceLabel}),o=r?{role:"menuitemcheckbox","aria-checked":s.active}:{"aria-pressed":s.active},c=t.jsx("button",{type:"button",className:n,...i,onClick:s.onToggle,title:s.title,"aria-label":s.title,...o,disabled:s.enabling,children:l});return t.jsx(u.Suspense,{fallback:c,children:t.jsx(ea,{t:e,active:s.active,connected:s.connected,disabled:s.enabling,className:n,title:s.title,menuItem:r,onToggle:s.onToggle,onReactivate:s.onReactivate,onReload:s.onReload,dataAttributes:i,children:l})})}const pa=1500,ft=8,mn=6;function ma(e,s){var r,i,l,o,c,h,g,f;let n=e;for(;n&&s.contains(n);){const p=(r=n.getAttribute("data-tooltip"))==null?void 0:r.trim();if(p)return p;const S=(i=n.getAttribute("title"))==null?void 0:i.trim();if(S)return S;if(n===s)break;n=n.parentElement}for(const p of s.querySelectorAll("[data-tooltip], [title]")){const S=(l=p.getAttribute("data-tooltip"))==null?void 0:l.trim();if(S)return S;const m=(o=p.getAttribute("title"))==null?void 0:o.trim();if(m)return m}return((c=s.getAttribute("aria-label"))==null?void 0:c.trim())||((g=(h=s.querySelector("[aria-label]"))==null?void 0:h.getAttribute("aria-label"))==null?void 0:g.trim())||((f=s.textContent)==null?void 0:f.trim())||""}function fa({state:e,t:s,onClose:n,onHide:r}){const i=u.useRef(null),l=u.useRef(null),[o,c]=u.useState(null);return u.useEffect(()=>jr(),[]),u.useLayoutEffect(()=>{var d;const h=i.current;if(!h||!e.target.isConnected){n();return}const g=e.target.getBoundingClientRect(),f=h.getBoundingClientRect(),p=Math.max(ft,window.innerWidth-ft-f.width),S=g.left+g.width/2-f.width/2,m=g.top-mn-f.height,M=g.bottom+mn;c({left:Math.min(p,Math.max(ft,S)),top:m>=ft?m:Math.min(M,window.innerHeight-ft-f.height)}),e.touch||(d=l.current)==null||d.focus({preventScroll:!0})},[n,e]),u.useEffect(()=>{const h=f=>{var p;f.target instanceof Node&&((p=i.current)!=null&&p.contains(f.target))||n()},g=f=>{f.key==="Escape"&&(f.preventDefault(),n(),e.target.focus({preventScroll:!0}))};return document.addEventListener("pointerdown",h,!0),document.addEventListener("keydown",g,!0),window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),()=>{document.removeEventListener("pointerdown",h,!0),document.removeEventListener("keydown",g,!0),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}},[n,e.target]),Ss.createPortal(t.jsxs("div",{ref:i,className:U.hidePopover,role:"dialog","aria-label":s("toolbarHideControlMenuAria"),style:o?{left:o.left,top:o.top}:{visibility:"hidden"},children:[t.jsx("span",{className:U.hidePopoverTooltip,children:e.tooltip}),t.jsx("button",{ref:l,type:"button",className:U.hidePopoverAction,onClick:()=>{n(),r(e.key)},children:s("appearanceToolbarHide")})]}),document.body)}function ba(e,s){var n;return s.mode==="off"?e("modelSettingsThinkingOffLabel"):s.mode==="auto"?e("modelSettingsThinkingAutoLabel"):s.level==="xhigh"?e("effortLevelExtraHighShortLabel"):((n=s.effortOptions.find(r=>r.value===s.level))==null?void 0:n.label)??gn(s.level,void 0,e)}function ga(e,s){var r;const n=s.mode==="off"?e("newSessionThinkingOff"):s.mode==="auto"?e("newSessionThinkingAuto"):e("newSessionThinkingOn",{level:((r=s.effortOptions.find(i=>i.value===s.level))==null?void 0:r.label)??gn(s.level,void 0,e)});return e("toolbarThinkingTitle",{current:n})}const gs=12;function fn({control:e,t:s}){const[n,r]=u.useState(!1),i=u.useRef(null),l=u.useRef(null),o=u.useRef(null),c=u.useRef(!1),h=ga(s,e),g=u.useCallback(()=>r(!1),[]);u.useEffect(()=>{if(!n)return;const d=L=>{L.key==="Escape"&&(L.preventDefault(),g())},T=L=>{var q;(q=i.current)!=null&&q.contains(L.target)||g()};return document.addEventListener("keydown",d,!0),document.addEventListener("mousedown",T),()=>{document.removeEventListener("keydown",d,!0),document.removeEventListener("mousedown",T)}},[g,n]),u.useLayoutEffect(()=>{var B,v;const d=i.current,T=l.current;if(!n||!d||!T||typeof window>"u")return;let L=0;const q=()=>{L=0,T.style.setProperty("--thinking-menu-inline-shift","0px");const a=window.visualViewport,H=(a==null?void 0:a.offsetLeft)??0,_=(a==null?void 0:a.width)??window.innerWidth;T.style.setProperty("--thinking-menu-max-inline-size",`${Math.max(0,_-gs*2)}px`);const G=T.getBoundingClientRect(),I=H+gs,J=H+_-gs-G.width,te=J<I?I:Math.min(Math.max(G.left,I),J);T.style.setProperty("--thinking-menu-inline-shift",`${te-G.left}px`)},R=()=>{window.cancelAnimationFrame(L),L=window.requestAnimationFrame(q)},w=typeof ResizeObserver>"u"?null:new ResizeObserver(R);return w==null||w.observe(d),w==null||w.observe(T),window.addEventListener("resize",R),(B=window.visualViewport)==null||B.addEventListener("resize",R),(v=window.visualViewport)==null||v.addEventListener("scroll",R),q(),()=>{var a,H;window.cancelAnimationFrame(L),w==null||w.disconnect(),window.removeEventListener("resize",R),(a=window.visualViewport)==null||a.removeEventListener("resize",R),(H=window.visualViewport)==null||H.removeEventListener("scroll",R)}},[n]);const f=u.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),p=u.useCallback(()=>{e.onToggleEnabled(),r(!1)},[e]),S=u.useCallback(d=>{d.preventDefault(),p()},[p]),m=u.useCallback(()=>{f(),c.current=!1,o.current=setTimeout(()=>{c.current=!0,o.current=null,p()},450)},[f,p]),M=u.useCallback(d=>{c.current&&d.preventDefault(),f()},[f]);return t.jsxs("div",{className:U.thinkingControl,ref:i,children:[t.jsxs("button",{type:"button",className:`thinking-toggle-button ${e.mode!=="off"?`active ${e.mode}`:""}`,"data-thinking-mode":e.mode,onClick:d=>{if(c.current){c.current=!1;return}d.currentTarget.blur(),r(T=>!T)},onContextMenu:S,onTouchStart:m,onTouchEnd:M,onTouchCancel:f,onTouchMove:f,title:h,"aria-label":h,"aria-haspopup":"menu","aria-expanded":n,children:[t.jsx(po,{mode:e.mode}),t.jsx("span",{className:"thinking-toggle-label",children:ba(s,e)})]}),n&&t.jsxs("div",{className:U.thinkingMenu,"data-testid":"thinking-toolbar-menu",ref:l,role:"menu",children:[t.jsx(mo,{mode:e.mode,modeOptions:e.modeOptions,onSetMode:e.onSetMode,level:e.level,effortOptions:e.effortOptions,onSetEffort:e.onSetEffort,onSetEffortMode:e.onSetEffortMode,showThinking:e.showThinking,onSetShowThinking:e.onSetShowThinking,provider:e.provider,t:s,onSelect:g,optionRole:"menuitemradio"}),t.jsx("div",{className:U.thinkingMenuHint,children:s("toolbarThinkingAppliesNextTurn")})]})]})}function wa({t:e,refs:s,visibility:n,onHideControl:r,priority:i,isCompactStatusMode:l=!1,modeControl:o,attachmentControl:c,slashControl:h,thinkingControl:g,renderModeControl:f,conversationViewControl:p,browserDebugControl:S,nudgeControl:m,doneControl:M,speechControl:d,speechWaveformActive:T=!1,speechWaveformPreview:L=!1,waveformButtonBackgroundOpacityPercent:q=Ts,fileViewerController:R=null,statusControl:w,pendingApproval:B,shortcutsControl:v,actionsControl:a,hidePrimaryDeliveryActions:H=!1}){var Nt,it,Pt,at,z,Rt,ct,_t,Dt,qe,Bt,oe,le,Ot,lt;const _=Mr(),G=((_==null?void 0:_.questions.length)??0)>0&&(_==null?void 0:_.reminderTurns)!==0,I=Tr(),[J,te]=u.useState(null),se=u.useRef(0),me=u.useCallback(()=>te(null),[]),P=(b,j=!1)=>({"data-session-toolbar-control":b,"data-session-toolbar-special-context":j?"true":void 0}),fe=Math.min(100,Math.max(0,q)),be=T,K=be?{"--waveform-control-surface-opacity":`${fe}%`}:void 0,ge=i??Dr,k=b=>{const j=ge[b];return R&&j==="pin"&&b!=="microphone"?"last":j},N=(b,...j)=>[...j,"composer-bottom-overflow-inline",un(k(b)),At.has(b)?U.overflowHidden:""].filter(Boolean).join(" "),E=(b,...j)=>{const $=un(k(b));return[...j,$||"composer-bottom-overflow-pinned",At.has(b)?U.overflowVisible:U.overflowHidden].filter(Boolean).join(" ")},y=b=>k(b)!=="pin",we=v.open,xe=v.canSwapEnterAction&&v.onSwapEnterAction?{onSwapEnterAction:v.onSwapEnterAction}:null,Te=l||!n.sessionStatus,wt=!Te&&((w==null?void 0:w.showLivenessChip)??!1),ae=(w==null?void 0:w.livenessDisplay)??null,ne=(w==null?void 0:w.providerRuntimeDisplay)??null,tt=((w==null?void 0:w.showPositionTimestamp)??!1)||Te&&((w==null?void 0:w.hasPositionAge)??!1),xt=((w==null?void 0:w.showLastActivityChip)??!1)||Te&&((w==null?void 0:w.hasLastActivityAge)??!1),$e=!!ne,Le=$e||wt||tt||xt,Ue=l||Te&&Le,Ne=!!(!H&&((Nt=a.send)!=null&&Nt.onSend)),Fe=!!a.stop,Ce=!!(n.projectQueue&&((it=a.projectQueue)!=null&&it.onProjectQueue)&&a.send),ce=!!(n.projectQueueNewSessionShortcut&&((Pt=a.projectQueue)!=null&&Pt.onProjectQueueNewSession)&&a.send),vt=Ce||ce,st=(d==null?void 0:d.selectedMethod)??null,V=(at=a.send)==null?void 0:at.queue,Pe=!!(n.steerNow&&((z=a.send)!=null&&z.showSteerNowMode)&&a.send.onToggleSteerNow),St=vt||Ne||Pe,Tt=(b,j)=>!Le||!w?null:t.jsxs("div",{ref:j,className:b,...P("sessionStatus"),children:[wt&&ae&&t.jsx("div",{className:`composer-status-chip composer-liveness-status is-${ae.tone}`,role:"status","aria-label":e("toolbarLivenessAria",{summary:w.livenessSummary??""}),title:ae.title,children:ae.timestampMs!==null?t.jsx("time",{className:"composer-liveness-time",dateTime:new Date(ae.timestampMs).toISOString(),title:`${Qr(ae.timestampMs)}
57
57
  ${ae.title}`,children:En(e,ae.timestampMs,w.nowMs)}):t.jsx("span",{className:"composer-liveness-time",children:ae.prefix})}),$e&&ne&&t.jsx("div",{className:`composer-status-chip composer-provider-runtime-status is-${ne.tone}`,role:"status","aria-label":e("toolbarProviderRuntimeAria",{summary:ne.summary}),title:ne.title,children:ne.retryAtMs!==null?t.jsx("time",{className:"composer-provider-runtime-time",dateTime:new Date(ne.retryAtMs).toISOString(),children:ne.summary}):t.jsx("span",{className:"composer-provider-runtime-time",children:ne.summary})}),tt&&t.jsx("div",{className:"composer-status-chip composer-position-age composer-activity-age--compact",role:"status","aria-label":e("toolbarPositionAgeAria"),children:t.jsx(Ks,{timestampMs:w.positionTimestampMs,nowMs:w.nowMs,className:"composer-position-age-time",formatLabel:$=>{const D=$==="now"?e("toolbarRelativeAgeNow"):e("toolbarRelativeAgePast",{age:$});return e("toolbarPositionAge",{age:D})}})}),xt&&t.jsx("div",{className:`composer-status-chip composer-activity-age${w.showLastActivityPrefix?"":" composer-activity-age--compact"}`,role:"status","aria-label":e("toolbarLastActivityAria"),children:t.jsx(Ks,{timestampMs:w.lastActivityMs,nowMs:w.nowMs,className:"composer-activity-age-time",formatLabel:$=>{const D=$==="now"?e("toolbarRelativeAgeNow"):$;return w.showLastActivityPrefix?e("toolbarLastActivityAge",{age:D}):w.lastActivityIsPast?e("toolbarRelativeAgePast",{age:D}):D}})})]}),kt=b=>!n.contextUsage||!a.contextUsage?null:t.jsx("span",{className:b,...P("contextUsage",!0),children:t.jsx(Oi,{usage:a.contextUsage,model:a.contextModel,provider:a.contextProvider,contextWindow:a.contextWindow,size:16})}),jt=(b,j=!1)=>!n.btw||!a.btw?null:t.jsx("button",{type:"button",className:b,...P("btw"),onClick:a.btw.onClick,disabled:a.disabled||a.voiceDisabled,"aria-label":a.btw.title,"aria-pressed":a.btw.pressed,title:a.btw.title,role:j?"menuitem":void 0,children:"/btw"}),yt=(b,j=!1)=>n.transcriptSearch?t.jsx("button",{type:"button",className:b,...P("transcriptSearch"),onClick:()=>{rt(!1),ti()},"aria-label":e("toolbarTranscriptSearch"),"aria-pressed":j?void 0:v.isearchScope!==null,title:e("toolbarTranscriptSearch"),role:j?"menuitem":void 0,children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[t.jsx("circle",{cx:"11",cy:"11",r:"7"}),t.jsx("path",{d:"M20 20l-4-4"})]})}):null,A=b=>!Pe||!a.send?null:t.jsxs("label",{className:b,title:e("toolbarSteerNowTooltip"),...P("steerNow"),children:[t.jsx("input",{type:"checkbox",checked:!!a.send.steerNowEnabled,onChange:a.send.onToggleSteerNow,disabled:a.disabled,"aria-label":e("toolbarSteerNowLabel")}),t.jsx("span",{children:e("toolbarSteerNowShortLabel")})]}),Q=(b=!1)=>{if(!vt||!a.projectQueue||!a.send)return null;const j=a.projectQueue,$=a.disabled||!j.canSend,D=a.send.speechMessagePrefix,ee=ue=>D?e("speechPrefixDeliveryLabel",{action:ue,prefix:D}):ue,Ve=ue=>D&&ue?e("speechPrefixDeliveryTooltip",{tooltip:ue,prefix:D}):ue,ye=(ue,...It)=>(b?E:N)(ue,"send-button","project-queue-button",...It);return t.jsxs(t.Fragment,{children:[Ce&&(!b||y("projectQueue"))&&t.jsxs("button",{type:"button",...P("projectQueue"),onClick:j.onProjectQueue,disabled:$,className:ye("projectQueue"),"aria-label":ee(e("toolbarProjectQueueLabel")),title:Ve(j.tooltip),role:b?"menuitem":void 0,children:[t.jsx(Ye,{className:"send-icon",children:"⇥"}),D&&t.jsx(Xe,{prefix:D})]}),ce&&(!b||y("projectQueueNewSessionShortcut"))&&t.jsxs("button",{type:"button",...P("projectQueueNewSessionShortcut"),onClick:j.onProjectQueueNewSession,disabled:$,className:ye("projectQueueNewSessionShortcut","project-queue-new-session-button"),"aria-label":ee(e("toolbarProjectQueueNewSessionLabel")),title:Ve(j.newSessionTooltip),role:b?"menuitem":void 0,children:[t.jsx(Ye,{className:"send-icon",children:"⇥"}),t.jsx(yi,{}),D&&t.jsx(Xe,{prefix:D})]})]})},ke=!!(G||n.modeSelector&&o&&y("modeSelector")||n.attachments&&y("attachments")||n.slashMenu&&h&&y("slashMenu")||n.thinkingToggle&&g&&y("thinkingToggle")||n.renderMode&&f&&y("renderMode")||n.conversationView&&p&&y("conversationView")||n.browserDebug&&S&&y("browserDebug")||n.nudge&&m&&y("nudge")||n.syntheticDone&&M&&y("syntheticDone")||n.sessionStatus&&Le&&w&&y("sessionStatus")||n.shortcutsHelp&&y("shortcutsHelp")||n.transcriptSearch&&y("transcriptSearch")||n.contextUsage&&a.contextUsage&&y("contextUsage")||n.btw&&a.btw&&y("btw")||Pe&&y("steerNow")||Ce&&a.send&&y("projectQueue")||ce&&a.send&&y("projectQueueNewSessionShortcut")),zt=`${Go({modeSelector:n.modeSelector&&o?k("modeSelector"):"off",attachments:n.attachments?k("attachments"):"off",slashMenu:n.slashMenu&&h?k("slashMenu"):"off",thinkingToggle:n.thinkingToggle&&g?k("thinkingToggle"):"off",renderMode:n.renderMode&&f?k("renderMode"):"off",conversationView:n.conversationView&&p?k("conversationView"):"off",browserDebug:n.browserDebug&&S?k("browserDebug"):"off",nudge:n.nudge&&m?k("nudge"):"off",syntheticDone:n.syntheticDone&&M?k("syntheticDone"):"off",sessionStatus:n.sessionStatus&&Le&&w?k("sessionStatus"):"off",shortcutsHelp:n.shortcutsHelp?k("shortcutsHelp"):"off",transcriptSearch:n.transcriptSearch?k("transcriptSearch"):"off",contextUsage:n.contextUsage&&a.contextUsage?k("contextUsage"):"off",btw:n.btw&&a.btw?k("btw"):"off",steerNow:Pe?k("steerNow"):"off",projectQueue:Ce&&a.send?k("projectQueue"):"off",projectQueueNewSessionShortcut:ce&&a.send?k("projectQueueNewSessionShortcut"):"off",microphone:n.microphone&&st&&(d!=null&&d.voiceButton)?d.voiceButton.kind:"off",waveform:T,send:Ne?(Rt=a.send)==null?void 0:Rt.primaryActionKind:"off",queue:!H&&(V!=null&&V.hasDualActions)?[(ct=a.send)==null?void 0:ct.primaryActionKind,!!V.onQueue,!!V.onSteer].join(":"):"off",alternate:!H&&!!((_t=a.send)!=null&&_t.alternate),stop:Fe,pending:(B==null?void 0:B.type)??"off"})}|fileViewer:${R?"on":"off"}|questions:${G}`,[nt,rt]=u.useState(!1),Et=u.useRef(!1);u.useEffect(()=>{Et.current&&!(_!=null&&_.menuOpen)&&rt(!1),Et.current=(_==null?void 0:_.menuOpen)===!0},[_==null?void 0:_.menuOpen]);const{tier:ot,hiddenControls:At,setToolbarRef:Yt}=Ko({layoutKey:zt,hasControls:ke,refs:s}),Xt=ke&&(ot!=="none"||G),je=u.useRef(null),We=()=>{v.setOpen(!0),v.setSettingsOpen(!0)},re=()=>{je.current&&(clearTimeout(je.current),je.current=null)},Mt=()=>{re(),je.current=setTimeout(()=>{je.current=null,We()},520)},Lt=R&&!ro(R)&&!R.minimized,O=b=>{if(!Lt||!(b.target instanceof Element))return;const j=b.target.closest("button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), [role='button']:not([aria-disabled='true'])");!j||!b.currentTarget.contains(j)||R.minimize()},F=()=>{se.current=Date.now()},Jt=b=>{if(!r||!(b.target instanceof Element))return;const j=b.target.closest("[data-session-toolbar-control]");if(!j||!b.currentTarget.contains(j))return;const $=b.target.closest('[role="dialog"], [role="menu"]');if($&&j.contains($))return;const D=Date.now()-se.current<=pa,ee=j.dataset.sessionToolbarSpecialContext==="true";if(!D&&ee)return;ee||(b.preventDefault(),b.stopPropagation());const Ve=j.dataset.sessionToolbarControl,ye=b.target.closest("button, input, label, [role='button']")??j;te({key:Ve,target:ye,tooltip:ma(b.target,j),touch:D})};return t.jsxs("div",{ref:Yt,className:`message-input-toolbar${Ue?" status-floats":""} overflow-tier-${ot}${R?` ${U.fileViewerControllerActive}`:""}${Lt?` ${U.fileViewerOpen}`:""}${be?` ${U.waveformBackdropActive}`:""}`,"data-waveform-button-background-opacity":be?fe:void 0,style:K,onClickCapture:O,onContextMenuCapture:Jt,onTouchStartCapture:F,children:[t.jsxs("div",{className:`${U.waveformRegion}${L?` ${U.waveformPreviewRegion}`:""}`,children:[t.jsxs("div",{ref:s==null?void 0:s.left,className:"message-input-left",children:[n.modeSelector&&o&&t.jsx("span",{className:N("modeSelector"),...P("modeSelector"),children:t.jsx(an,{mode:o.mode,onModeChange:o.onModeChange,modes:o.modes,changesApplyNextTurn:o.changesApplyNextTurn,modeChangePending:o.modeChangePending})}),n.attachments&&t.jsxs("button",{type:"button",...P("attachments"),className:N("attachments","attach-button"),onClick:c.onAttachClick,disabled:!c.canAttach,title:c.canAttach?e("toolbarAttachFiles"):e("toolbarAttachDisabled"),children:[t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:t.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"})}),c.attachmentCount>0&&t.jsx("span",{className:"attach-count",children:c.attachmentCount})]}),n.slashMenu&&h&&t.jsx("span",{className:N("slashMenu"),...P("slashMenu"),children:t.jsx(cn,{commands:h.commands,onSelectCommand:h.onSelectCommand,disabled:h.disabled})}),n.thinkingToggle&&g&&t.jsx("span",{className:N("thinkingToggle"),...P("thinkingToggle",!0),children:t.jsx(fn,{control:g,t:e})}),n.renderMode&&f&&t.jsx("button",{type:"button",...P("renderMode"),className:N("renderMode","render-mode-toolbar-button",f.state==="rendered"?"is-rendered":f.state==="mixed"?"is-mixed":""),onClick:f.onToggle,title:f.title,"aria-label":f.title,"aria-pressed":f.state==="mixed"?"mixed":f.state==="rendered",children:t.jsx(qs,{})}),n.conversationView&&p&&t.jsx("button",{type:"button",...P("conversationView"),className:N("conversationView","conversation-view-toolbar-button",p.enabled?"active":""),onClick:p.onToggle,title:p.title,"aria-label":p.title,"aria-pressed":p.enabled,children:t.jsx(zs,{})}),n.browserDebug&&S&&t.jsx(pn,{t:e,control:S,dataAttributes:P("browserDebug",!0),className:[N("browserDebug"),U.browserDebugButton,S.active?U.browserDebugButtonActive:""].filter(Boolean).join(" ")}),n.nudge&&m&&t.jsx("button",{type:"button",...P("nudge",!0),className:N("nudge","heartbeat-toolbar-button",m.enabled?"active":""),onClick:m.onClick,onContextMenu:m.onContextMenu,onTouchStart:m.onTouchStart,onTouchEnd:m.onTouchEnd,onTouchCancel:m.onClearTouch,onTouchMove:m.onClearTouch,title:m.title,"aria-label":m.title,"aria-pressed":m.enabled,children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"miter","aria-hidden":"true",children:[t.jsx("path",{className:"heartbeat-baseline",d:"M0.75 15H7"}),t.jsx("path",{className:"heartbeat-excursion",d:"M7 15l2-5 2 9 4-16 3 12"}),t.jsx("path",{className:"heartbeat-baseline",d:"M18 15h5.25"})]})}),n.syntheticDone&&M&&t.jsx("button",{type:"button",...P("syntheticDone"),className:`${N("syntheticDone")} ${U.doneButton}`,onClick:M.onDone,title:M.title,"aria-label":M.title,"data-testid":"synthetic-done-toolbar-button",children:t.jsx(hn,{})}),n.microphone&&((Dt=d==null?void 0:d.voiceButton)==null?void 0:Dt.kind)==="preview"&&t.jsx(Hs,{rootDataAttributes:P("microphone",!0),showMethodSelector:d.showMethodSelector,methodOptions:d.methodOptions,selectedMethod:st,onMethodChange:d.onMethodChange,smartTurnSettings:d.smartTurnSettings,onSmartTurnSettingsChange:d.onSmartTurnSettingsChange,smartTurnDisabled:d.smartTurnDisabled,trigger:t.jsx("button",{type:"button",className:"voice-input-button",disabled:d.voiceButton.disabled,title:e("voiceInputStart"),"aria-label":e("voiceInputStartLabel"),children:t.jsx(Hr,{})})}),n.microphone&&((qe=d==null?void 0:d.voiceButton)==null?void 0:qe.kind)==="live"&&d.voiceButton.ref&&t.jsx(Hs,{rootDataAttributes:P("microphone",!0),showMethodSelector:d.showMethodSelector,methodOptions:d.methodOptions,selectedMethod:st,onMethodChange:d.onMethodChange,smartTurnSettings:d.smartTurnSettings,onSmartTurnSettingsChange:d.onSmartTurnSettingsChange,smartTurnDisabled:d.smartTurnDisabled,onBeforeOpen:()=>{var b,j,$,D,ee;((b=d.voiceButton)==null?void 0:b.kind)==="live"&&(($=(j=d.voiceButton).onListeningStop)==null||$.call(j),(ee=(D=d.voiceButton.ref)==null?void 0:D.current)==null||ee.stopAndFinalize(),d.voiceButton.onInterimTranscript(""))},onBeforeCaptureChange:()=>{var b,j,$,D,ee;((b=d.voiceButton)==null?void 0:b.kind)==="live"&&(($=(j=d.voiceButton).onListeningStop)==null||$.call(j),(ee=(D=d.voiceButton.ref)==null?void 0:D.current)==null||ee.stopAndFinalize(),d.voiceButton.onInterimTranscript(""))},onPointerNearTrigger:()=>{var b,j,$,D;return((b=d.voiceButton)==null?void 0:b.kind)==="live"?(D=($=(j=d.voiceButton.ref)==null?void 0:j.current)==null?void 0:$.prewarm)==null?void 0:D.call($):void 0},trigger:t.jsx(go,{ref:d.voiceButton.ref,onTranscript:d.voiceButton.onTranscript,onInterimTranscript:d.voiceButton.onInterimTranscript,onListeningStart:d.voiceButton.onListeningStart,onListeningStop:d.voiceButton.onListeningStop,onPendingSpeechChange:d.voiceButton.onPendingSpeechChange,onTranscriptionSettled:d.voiceButton.onTranscriptionSettled,disabled:d.voiceButton.disabled,speechMethod:d.voiceButton.speechMethod,getTranscriptionContext:d.voiceButton.getTranscriptionContext,smartTurn:d.voiceButton.smartTurn,showWaveform:d.voiceButton.showWaveform})})]}),R&&t.jsx(Zi,{controller:R,t:e,waveformButtonBackgroundOpacityPercent:be?fe:void 0}),T&&t.jsx(wo,{preview:L})]}),Tt(n.sessionStatus?N("sessionStatus","composer-status-ages"):"composer-status-ages",s==null?void 0:s.status),Xt&&t.jsxs("div",{className:`${U.overflow} composer-bottom-overflow ${nt?"is-open":""}`,children:[t.jsx("button",{type:"button",className:"composer-bottom-overflow-button","aria-label":e("toolbarOverflowMenu"),"aria-expanded":nt,onClick:()=>rt(b=>!b),children:"..."}),nt&&t.jsxs("div",{className:"composer-bottom-overflow-menu",role:"menu",children:[t.jsxs("div",{className:"composer-bottom-overflow-menu-group composer-bottom-overflow-menu-left",children:[n.modeSelector&&o&&y("modeSelector")&&t.jsx("span",{className:E("modeSelector"),...P("modeSelector"),children:t.jsx(an,{mode:o.mode,onModeChange:o.onModeChange,modes:o.modes,changesApplyNextTurn:o.changesApplyNextTurn,modeChangePending:o.modeChangePending})}),n.attachments&&y("attachments")&&t.jsxs("button",{type:"button",...P("attachments"),className:E("attachments","attach-button"),onClick:c.onAttachClick,disabled:!c.canAttach,title:c.canAttach?e("toolbarAttachFiles"):e("toolbarAttachDisabled"),role:"menuitem",children:[t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:t.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"})}),c.attachmentCount>0&&t.jsx("span",{className:"attach-count",children:c.attachmentCount})]}),n.sessionStatus&&y("sessionStatus")&&Tt(E("sessionStatus","composer-status-ages","composer-status-ages--menu"))]}),t.jsxs("div",{className:"composer-bottom-overflow-menu-group composer-bottom-overflow-menu-right",children:[n.slashMenu&&h&&y("slashMenu")&&t.jsx("span",{className:E("slashMenu"),...P("slashMenu"),children:t.jsx(cn,{commands:h.commands,onSelectCommand:h.onSelectCommand,disabled:h.disabled})}),n.thinkingToggle&&g&&y("thinkingToggle")&&t.jsx("span",{className:E("thinkingToggle"),...P("thinkingToggle",!0),children:t.jsx(fn,{control:g,t:e})}),n.renderMode&&f&&y("renderMode")&&t.jsx("button",{type:"button",...P("renderMode"),className:E("renderMode","render-mode-toolbar-button",f.state==="rendered"?"is-rendered":f.state==="mixed"?"is-mixed":""),onClick:f.onToggle,title:f.title,"aria-label":f.title,role:"menuitemcheckbox","aria-checked":f.state==="mixed"?"mixed":f.state==="rendered",children:t.jsx(qs,{})}),n.conversationView&&p&&y("conversationView")&&t.jsx("button",{type:"button",...P("conversationView"),className:E("conversationView","conversation-view-toolbar-button",p.enabled?"active":""),onClick:p.onToggle,title:p.title,"aria-label":p.title,role:"menuitemcheckbox","aria-checked":p.enabled,children:t.jsx(zs,{})}),n.browserDebug&&S&&y("browserDebug")&&t.jsx(pn,{t:e,control:S,menuItem:!0,dataAttributes:P("browserDebug",!0),className:[E("browserDebug"),U.browserDebugButton,S.active?U.browserDebugButtonActive:""].filter(Boolean).join(" ")}),n.nudge&&m&&y("nudge")&&t.jsx("button",{type:"button",...P("nudge",!0),className:E("nudge","heartbeat-toolbar-button",m.enabled?"active":""),onClick:m.onClick,onContextMenu:m.onContextMenu,onTouchStart:m.onTouchStart,onTouchEnd:m.onTouchEnd,onTouchCancel:m.onClearTouch,onTouchMove:m.onClearTouch,title:m.title,"aria-label":m.title,role:"menuitemcheckbox","aria-checked":m.enabled,children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"miter","aria-hidden":"true",children:[t.jsx("path",{className:"heartbeat-baseline",d:"M0.75 15H7"}),t.jsx("path",{className:"heartbeat-excursion",d:"M7 15l2-5 2 9 4-16 3 12"}),t.jsx("path",{className:"heartbeat-baseline",d:"M18 15h5.25"})]})}),n.syntheticDone&&M&&y("syntheticDone")&&t.jsx("button",{type:"button",...P("syntheticDone"),className:`${E("syntheticDone")} ${U.doneButton}`,onClick:M.onDone,title:M.title,"aria-label":M.title,role:"menuitem","data-testid":"synthetic-done-overflow-button",children:t.jsx(hn,{})}),y("transcriptSearch")&&yt(`${E("transcriptSearch")} ${U.transcriptSearchButton}`,!0),n.shortcutsHelp&&y("shortcutsHelp")&&t.jsx("button",{type:"button",...P("shortcutsHelp",!0),className:E("shortcutsHelp","session-shortcuts-help-button"),"aria-label":e("toolbarKeyboardShortcutsAria"),"aria-expanded":we,onClick:()=>v.setOpen(b=>!b),onContextMenu:b=>{b.preventDefault(),We()},onTouchStart:Mt,onTouchEnd:re,onTouchCancel:re,onTouchMove:re,role:"menuitem",children:"?"}),y("contextUsage")&&kt(E("contextUsage","context-toolbar-control")),y("btw")&&jt(E("btw","btw-toolbar-button",(Bt=a.btw)!=null&&Bt.pressed?"active":"",((oe=a.btw)==null?void 0:oe.mode)==="focus-existing"?"has-asides":""),!0),y("steerNow")&&A(E("steerNow","steer-now-toggle")),Q(!0)]}),t.jsx(Vs,{overflow:!0})]})]}),t.jsxs("div",{ref:s==null?void 0:s.actions,className:"message-input-actions",children:[t.jsx(Vs,{compact:ot}),B&&t.jsxs("button",{type:"button",className:`pending-approval-indicator ${B.type}`,onClick:B.onExpand,title:B.type==="tool-approval"?e("toolbarPendingApprovalExpand"):e("toolbarPendingQuestionExpand"),children:[t.jsx("span",{className:"pending-approval-dot"}),t.jsx("span",{className:"pending-approval-text",children:B.type==="tool-approval"?e("toolbarApproval"):e("toolbarQuestion")})]}),yt(`${N("transcriptSearch")} ${U.transcriptSearchButton}`),n.shortcutsHelp&&t.jsxs("div",{className:N("shortcutsHelp","session-shortcuts-help"),onMouseLeave:()=>{v.setOpen(!1),v.setSettingsOpen(!1)},children:[t.jsx("button",{type:"button",className:"session-shortcuts-help-button",...P("shortcutsHelp",!0),"aria-label":e("toolbarKeyboardShortcutsAria"),"aria-expanded":we,onClick:()=>v.setOpen(b=>!b),onContextMenu:b=>{b.preventDefault(),We()},onFocus:()=>v.setOpen(!0),onBlur:b=>{var j;(j=b.currentTarget.parentElement)!=null&&j.contains(b.relatedTarget)||v.setOpen(!1)},onMouseEnter:()=>v.setOpen(!0),onTouchStart:Mt,onTouchEnd:re,onTouchCancel:re,onTouchMove:re,children:"?"}),we&&t.jsx("div",{className:`session-shortcuts-popover ${v.isearchScope!==null?"is-isearch-guide":""}`,role:"dialog","aria-label":e("toolbarKeyboardShortcutsAria"),children:v.isearchScope!==null?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[sa(v.isearchScope).map(b=>t.jsx("kbd",{children:b},b)),v.isearchScope==="user"&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:e("commonOr")}),t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"Alt"}),t.jsx("kbd",{children:"R"})]})]}),t.jsx("span",{children:e("toolbarShortcutPreviousMatch")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsx("span",{className:"session-shortcuts-keys",children:t.jsx("kbd",{children:"Enter"})}),t.jsx("span",{children:e("toolbarShortcutJump")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"↑"}),t.jsx("kbd",{children:"↓"})]}),t.jsx("span",{children:e("toolbarShortcutPreviousNextMatch")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsx("span",{className:"session-shortcuts-keys",children:e("toolbarShortcutClick")}),t.jsx("span",{children:e("toolbarShortcutPreviewRailJumps")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsx("span",{className:"session-shortcuts-keys",children:t.jsx("kbd",{children:"Esc"})}),t.jsx("span",{children:e("toolbarShortcutCancelRestoreFocus")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"End"})]}),t.jsx("span",{children:e("toolbarShortcutScrollToCurrent")})]}),na(v.isearchScope,e).map(b=>t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[b.keys.map(j=>t.jsx("kbd",{children:j},j)),b.scope==="user"&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:e("commonOr")}),t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"Alt"}),t.jsx("kbd",{children:"R"})]})]}),t.jsx("span",{children:b.label})]},b.label))]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"R"}),t.jsx("span",{children:e("commonOr")}),t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"Alt"}),t.jsx("kbd",{children:"R"})]}),t.jsx("span",{children:e("toolbarShortcutUserTurnReverseSearch")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"S"})]}),t.jsx("span",{children:e("toolbarShortcutAllTurnReverseSearch")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"Alt"}),t.jsx("kbd",{children:"S"})]}),t.jsx("span",{children:e("toolbarShortcutFullSessionReverseSearch")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"Alt"}),t.jsx("kbd",{children:"K"})]}),t.jsx("span",{children:e("toolbarShortcutLinkReverseSearch")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsx("span",{className:"session-shortcuts-keys",children:t.jsx("kbd",{children:"Enter"})}),t.jsx("span",{children:v.hasDualActions?e("toolbarShortcutSteerCurrentTurn"):e("toolbarShortcutSend")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Shift"}),t.jsx("kbd",{children:"Enter"})]}),t.jsx("span",{children:e("toolbarShortcutNewLine")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"Enter"})]}),t.jsx("span",{children:v.queueShortcutLabel})]}),v.canForkAfterSummary&&t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"Alt"}),t.jsx("kbd",{children:"Enter"})]}),t.jsx("span",{children:e("toolbarShortcutForkAfterSummary")})]}),xe&&t.jsxs("div",{className:"session-shortcuts-row session-shortcuts-row-muted",children:[t.jsx("span",{className:"session-shortcuts-keys",children:e("toolbarShortcutRightClickLongPress")}),t.jsx("span",{children:e("toolbarShortcutChangeKeys")})]}),v.settingsOpen&&xe&&t.jsxs("div",{className:"session-shortcuts-settings",children:[t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsx("span",{className:"session-shortcuts-keys",children:t.jsx("kbd",{children:"Enter"})}),t.jsx("span",{children:v.enterActionKind==="queue"?e("toolbarShortcutQueueCurrentTurn"):e("toolbarShortcutSteerCurrentTurn")})]}),t.jsx("button",{type:"button",className:"session-shortcuts-action",onClick:xe.onSwapEnterAction,children:e("toolbarShortcutSwapEnterCtrlEnter")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"B"})]}),t.jsx("span",{children:e("toolbarShortcutStartBtwAside")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsx("span",{className:"session-shortcuts-keys",children:t.jsx("kbd",{children:"Esc"})}),t.jsx("span",{children:e("toolbarShortcutStopAgentCancelOverlay")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"P"})]}),t.jsx("span",{children:e("toolbarShortcutRecallLastSentText")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"K"})]}),t.jsx("span",{children:e("toolbarShortcutCancelLatestQueuedMessage")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"O"})]}),t.jsx("span",{children:e("toolbarShortcutToggleThinkingTranscript")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"End"})]}),t.jsx("span",{children:e("toolbarShortcutScrollToCurrent")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"G"})]}),t.jsx("span",{children:e("toolbarShortcutClearComposer")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"U"})]}),t.jsx("span",{children:e("toolbarShortcutFullPaneComposer")})]}),t.jsxs("div",{className:"session-shortcuts-row",children:[t.jsxs("span",{className:"session-shortcuts-keys",children:[t.jsx("kbd",{children:"Ctrl"}),t.jsx("kbd",{children:"Shift"}),t.jsx("kbd",{children:"M"})]}),t.jsx("span",{children:e("toolbarShortcutRenderedSourceMode")})]})]})})]}),kt(N("contextUsage","context-toolbar-control")),jt(N("btw","btw-toolbar-button",(le=a.btw)!=null&&le.pressed?"active":"",((Ot=a.btw)==null?void 0:Ot.mode)==="focus-existing"?"has-asides":"")),Fe&&a.stop&&t.jsx("button",{type:"button",onClick:a.stop.onStop,className:"stop-button","aria-label":e("toolbarStop"),title:a.stop.title,children:t.jsx("span",{className:"stop-icon"})}),St&&a.send?t.jsxs(t.Fragment,{children:[A(N("steerNow","steer-now-toggle")),!H&&(V==null?void 0:V.hasDualActions)&&a.send.primaryActionKind!=="queue"&&V.onQueue&&t.jsxs("button",{type:"button",onClick:V.onQueue,disabled:a.disabled||!a.send.canSend,className:"send-button queue-button","aria-label":a.send.speechMessagePrefix?e("speechPrefixDeliveryLabel",{action:e("toolbarQueueLabel"),prefix:a.send.speechMessagePrefix}):e("toolbarQueueLabel"),title:a.send.speechMessagePrefix?e("speechPrefixDeliveryTooltip",{tooltip:V.queueTooltip,prefix:a.send.speechMessagePrefix}):V.queueTooltip,children:[t.jsx(Ye,{className:"send-icon queue-icon",children:"→"}),a.send.speechMessagePrefix&&t.jsx(Xe,{prefix:a.send.speechMessagePrefix})]}),!H&&(V==null?void 0:V.hasDualActions)&&a.send.primaryActionKind==="queue"&&V.onSteer&&t.jsxs("button",{type:"button",onClick:V.onSteer,disabled:a.disabled||!a.send.canSend,className:"send-button steer-button","aria-label":a.send.speechMessagePrefix?e("speechPrefixDeliveryLabel",{action:e("toolbarSteerTooltip"),prefix:a.send.speechMessagePrefix}):e("toolbarSteerTooltip"),title:a.send.speechMessagePrefix?e("speechPrefixDeliveryTooltip",{tooltip:e("toolbarSteerTooltip"),prefix:a.send.speechMessagePrefix}):e("toolbarSteerTooltip"),children:[t.jsx(Ye,{className:"send-icon",children:"↗"}),a.send.speechMessagePrefix&&t.jsx(Xe,{prefix:a.send.speechMessagePrefix})]}),!H&&a.send.alternate&&t.jsxs("button",{type:"button",onClick:a.send.alternate.onClick,disabled:a.disabled||!a.send.canSend,className:"send-button fork-summary-no-summary-button","aria-label":a.send.speechMessagePrefix?e("speechPrefixDeliveryLabel",{action:a.send.alternate.label,prefix:a.send.speechMessagePrefix}):a.send.alternate.label,title:a.send.speechMessagePrefix?e("speechPrefixDeliveryTooltip",{tooltip:a.send.alternate.tooltip,prefix:a.send.speechMessagePrefix}):a.send.alternate.tooltip,children:[t.jsx(Ye,{className:"send-icon",children:a.send.alternate.icon}),a.send.speechMessagePrefix&&t.jsx(Xe,{prefix:a.send.speechMessagePrefix})]}),Q(),Ne&&t.jsxs("button",{type:"button",onClick:(lt=a.send)==null?void 0:lt.onSend,disabled:a.disabled||!a.send.canSend,className:`send-button send-button-with-help ${a.send.primaryActionKind==="queue"?"queue-mode":""}`,"aria-label":a.send.primarySpeechMessagePrefix?e("speechPrefixDeliveryLabel",{action:a.send.primaryActionLabel,prefix:a.send.primarySpeechMessagePrefix}):a.send.primaryActionLabel,...kr(a.send.primarySpeechMessagePrefix?e("speechPrefixDeliveryTooltip",{tooltip:a.send.tooltip,prefix:a.send.primarySpeechMessagePrefix}):a.send.tooltip,I),children:[t.jsx(Ye,{className:"send-icon",children:a.send.icon}),a.send.primarySpeechMessagePrefix&&t.jsx(Xe,{prefix:a.send.primarySpeechMessagePrefix})]})]}):null]}),J&&r&&t.jsx(fa,{state:J,t:e,onClose:me,onHide:r})]})}function Wa({sessionId:e,mode:s="default",onModeChange:n,modeChangesApplyNextTurn:r,modeChangePending:i,supportsPermissionMode:l=!0,supportsThinkingToggle:o=!0,canAttach:c,attachmentCount:h=0,onAttachClick:g,voiceButtonRef:f,onVoiceTranscript:p,onInterimTranscript:S,onListeningStart:m,onListeningStop:M,onPendingSpeechChange:d,onTranscriptionSettled:T,voiceDisabled:L,getTranscriptionContext:q,slashCommands:R=[],onSelectSlashCommand:w,onBtwClick:B,btwActive:v=!1,btwHasAsides:a=!1,btwToolbarMode:H,thinkingProvider:_,thinkingModel:G,liveThinkingSelection:I,contextRequestedModel:J,heartbeatEnabled:te=!1,onToggleHeartbeat:se,onConfigureHeartbeat:me,contextUsage:P,lastActivityAt:fe,positionTimestampMs:be,positionTimestampStore:K,sessionLiveness:ge,providerRuntimeStatus:k,showSteerNowMode:N=!1,steerNowEnabled:E=!1,onToggleSteerNow:y,enterActionKind:we,canSwapEnterAction:xe=!1,onSwapEnterAction:Te,isRunning:wt,isThinking:ae,onStop:ne,onDone:tt,doneTitle:xt,onSend:$e,onQueue:Le,onProjectQueue:Ue,onProjectQueueNewSession:Ne,onSteer:Fe,primaryActionKind:Ce,sendOverride:ce,sendAlternate:vt,canForkAfterSummary:st,canSend:V,speechMessagePrefix:Pe,primarySpeechMessagePrefix:St,disabled:Tt,hidePrimaryDeliveryActions:kt=!1,hideVoiceInput:jt=!1,pendingApproval:yt}){var Us,Fs;const{t:A}=et(),Q=(Us=Lr())==null?void 0:Us.showToast,ke=so(),zt=(ke==null?void 0:ke.sessionId)===(e??"")&&no(ke)?ke:null,{thinkingMode:nt,thinkingLevel:rt,setThinkingMode:Et,setEffortLevel:ot,showThinking:At="default",setShowThinking:Yt,voiceInputEnabled:Xt=!0,speechMethod:je="browser-native",hasStoredSpeechMethod:We=!1,setSpeechMethod:re,speechSmartTurnSettings:Mt,setSpeechSmartTurnSettings:Lt}=Br(),{version:O}=to(),F=Ho(),{relayTransport:Jt,relayedServerSpeechAvailable:Nt}=qr(),it=fo(O),Pt=Ws(O,wr),{providers:at}=bn(),{visibility:z,priority:Rt,setControlPresence:ct}=Rr(),_t=u.useCallback(x=>ct(x,"hidden"),[ct]),{waveformButtonBackgroundOpacityPercent:Dt}=Yo(),{conversationViewEnabled:qe,setConversationViewEnabled:Bt}=_r(),oe=Ar(),le=eo(),[Ot,lt]=u.useState(!1),[b,j]=u.useState(!1),[$,D]=u.useState(null),[ee,Ve]=u.useState(!1),ye=u.useRef("auto"),ue=u.useRef(null),It=u.useRef(null),$t=u.useRef(null),ks=u.useRef(null),js=(I==null?void 0:I.mode)??nt,ys=(I==null?void 0:I.level)??rt,ut=(I==null?void 0:I.onSetMode)??Et,Zt=(I==null?void 0:I.onSetEffort)??ot,[es,ts]=u.useState(()=>{var x;return typeof window>"u"?!1:((x=dn())==null?void 0:x.matches)??!1}),Re=u.useMemo(()=>oo(_),[_]),de=u.useMemo(()=>at.find(x=>x.name===Re)??null,[Re,at]),ve=u.useMemo(()=>{var x;return((x=de==null?void 0:de.models)==null?void 0:x.find(C=>C.id===G))??null},[G,de]),dt=u.useMemo(()=>io({provider:de??Re,model:ve??G,translate:A}),[G,ve,de,Re,A]),An=u.useMemo(()=>ao(ys,dt),[ys,dt]),_e=u.useMemo(()=>co({provider:de??Re,model:ve??G,effortOptions:dt}),[dt,G,ve,de,Re]),He=u.useMemo(()=>lo(js,_e),[js,_e]),Mn=u.useMemo(()=>xn({model:ve,currentMode:s}),[s,ve]),Ln=_e.some(x=>x!=="off"),Ee=Je(fe),ht=Kr(Ee,le),Es=Ee===null?null:le-Ee,Nn=es||!z.sessionStatus,As=ht&&!Nn&&Es!==null&&Es>=ca,Pn=ht&&!As&&Ee!==null&&Kt(Ee,le)!=="now",Rn=u.useSyncExternalStore((K==null?void 0:K.subscribe)??ta,(K==null?void 0:K.getSnapshot)??ln,(K==null?void 0:K.getSnapshot)??ln),Ge=K?Rn:be,ss=Ge==null?null:Kt(Ge,le),_n=Ee===null?null:Kt(Ee,le),Ms=Ge!=null&&ss!==null&&ss!=="now"&&ss!==_n,ns=z.sessionStatus&&Ms,Y=ge?ra(ge,A):null,Ls=Zo(k??null,A),rs=z.sessionStatus&&!Ls&&!!Y&&!(ht&&(es||Y.tone==="ok"||Y.tone==="muted")),Dn=Y?oa(A,Y,le):null,pt=u.useRef(null),Ke=u.useRef(!1),Bn=(oe==null?void 0:oe.state)==="rendered"?A("toolbarRenderModeRendered"):(oe==null?void 0:oe.state)==="source"?A("toolbarRenderModeSource"):A("toolbarRenderModeMixed"),On=A(qe?"toolbarConversationViewDisable":"toolbarConversationViewEnable"),Se=F.phase==="active",In=u.useMemo(()=>Se&&!z.browserDebug?{...z,browserDebug:!0}:z,[Se,z]),$n=F.expiresAtMs?Math.max(0,Math.min(1,(F.expiresAtMs-Date.now())/No)):0,Un=Se&&F.performanceSummary?A("toolbarBrowserDebugPerformanceCompact",{delay:Math.round(F.performanceSummary.recentMaxDelayMs),tasks:F.performanceSummary.recentLongTaskCount}):null,Fn=Se?[A("toolbarBrowserDebugDisable",{expiry:new Date(F.expiresAtMs??Date.now()).toLocaleTimeString()}),F.performanceSummary?A("toolbarBrowserDebugPerformanceTitle",{seconds:Math.max(1,Math.round(F.performanceSummary.recentWindowMs/1e3)),delay:Math.round(F.performanceSummary.recentMaxDelayMs),tasks:F.performanceSummary.recentLongTaskCount,frameGaps:F.performanceSummary.recentFrameGapCount,keystrokes:F.performanceSummary.recentDelayedKeystrokeCount}):null].filter(Boolean).join(`