@opengeni/react 6.40.0 → 6.41.1-canary.45704649926001

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 (1197) hide show
  1. package/dist/app/app-state.js +34 -34
  2. package/dist/app/components/Composer.js +45 -45
  3. package/dist/app/components/add-card-dialog.js +3 -3
  4. package/dist/app/components/add-card.js +2 -2
  5. package/dist/app/components/agent/agent-capability-picker.js +10 -10
  6. package/dist/app/components/agents/agent-can-use.js +51 -50
  7. package/dist/app/components/agents/agent-cost.js +2 -2
  8. package/dist/app/components/agents/agent-form-page.js +153 -152
  9. package/dist/app/components/agents/agent-form-page.js.map +1 -1
  10. package/dist/app/components/agents/agent-page.js +134 -133
  11. package/dist/app/components/agents/agent-setup-sections.js +81 -80
  12. package/dist/app/components/agents/agent-skills.js +15 -15
  13. package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
  14. package/dist/app/components/agents/agent-trigger-dialog.js +35 -35
  15. package/dist/app/components/agents/agent-trigger-picker.js +8 -8
  16. package/dist/app/components/agents/agent-trigger-repositories.js +16 -16
  17. package/dist/app/components/agents/agents-page.js +99 -98
  18. package/dist/app/components/agents/agents-page.js.map +1 -1
  19. package/dist/app/components/agents/composer-agent-chip.js +60 -59
  20. package/dist/app/components/agents/session-agent-chip.js +55 -54
  21. package/dist/app/components/artifacts/app-package.js +13 -13
  22. package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
  23. package/dist/app/components/artifacts/artifact-library.js +30 -30
  24. package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
  25. package/dist/app/components/artifacts/artifact-viewer.js +64 -63
  26. package/dist/app/components/artifacts/artifact-viewer.js.map +1 -1
  27. package/dist/app/components/artifacts/chat-interactive-block.js +30 -28
  28. package/dist/app/components/artifacts/chat-interactive-block.js.map +1 -1
  29. package/dist/app/components/artifacts/copy-artifact-link.js +3 -3
  30. package/dist/app/components/artifacts/file-reach-dialog.js +13 -13
  31. package/dist/app/components/artifacts/inline-chat-image.js +52 -51
  32. package/dist/app/components/artifacts/ready-made-apps.js +13 -13
  33. package/dist/app/components/artifacts/retained-file-preview.js +57 -56
  34. package/dist/app/components/artifacts/retained-text-preview.js +7 -7
  35. package/dist/app/components/artifacts/site-actions.js +11 -11
  36. package/dist/app/components/artifacts/site-audience.js +8 -8
  37. package/dist/app/components/artifacts/site-conversations.js +34 -34
  38. package/dist/app/components/artifacts/site-data.js +30 -30
  39. package/dist/app/components/artifacts/site-public-link.js +1 -1
  40. package/dist/app/components/artifacts/site-publishing-page.js +72 -72
  41. package/dist/app/components/artifacts/site-publishing.js +55 -55
  42. package/dist/app/components/artifacts/site-settings.js +71 -71
  43. package/dist/app/components/artifacts/site-version-menu.js +9 -9
  44. package/dist/app/components/billing-class-mark.js +7 -7
  45. package/dist/app/components/capabilities/capability-detail-sheet.js +18 -18
  46. package/dist/app/components/capabilities/capability-logo-source.js +31 -30
  47. package/dist/app/components/capabilities/capability-logo.js +1 -1
  48. package/dist/app/components/capabilities/connection-account-picker.js +2 -2
  49. package/dist/app/components/capabilities/connection-ownership-selector.js +4 -4
  50. package/dist/app/components/capabilities/connector-tool-permissions.js +7 -7
  51. package/dist/app/components/capabilities/detail-dialog.js +3 -3
  52. package/dist/app/components/capabilities/native-connect-setup.js +36 -35
  53. package/dist/app/components/capabilities/own-logins-shared-heads-up.js +7 -7
  54. package/dist/app/components/capabilities/perform-capability-action.js +3 -3
  55. package/dist/app/components/capabilities/prepared-mcp-setup-card.js +35 -34
  56. package/dist/app/components/capabilities/session-capability-card.js +142 -141
  57. package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
  58. package/dist/app/components/capabilities/session-chrome-card.js +49 -49
  59. package/dist/app/components/capabilities/session-connect-inputs-card.js +38 -37
  60. package/dist/app/components/capabilities/session-custom-mcp-card.js +43 -42
  61. package/dist/app/components/capabilities/session-github-card.js +49 -48
  62. package/dist/app/components/capabilities/session-machine-card.js +50 -50
  63. package/dist/app/components/capabilities/session-personal-github-card.js +35 -34
  64. package/dist/app/components/capabilities/session-plugin-card.js +23 -22
  65. package/dist/app/components/capabilities/use-capabilities-catalog.js +4 -4
  66. package/dist/app/components/capabilities/use-connection-accounts.js +3 -3
  67. package/dist/app/components/command-menu/chat-status.js +25 -25
  68. package/dist/app/components/command-menu/chat-switcher.js +90 -89
  69. package/dist/app/components/command-menu/chat-switcher.js.map +1 -1
  70. package/dist/app/components/command-menu/command-menu.js +118 -117
  71. package/dist/app/components/command-menu/command-menu.js.map +1 -1
  72. package/dist/app/components/command-menu/shortcut-sheet.js +26 -26
  73. package/dist/app/components/composer-capabilities-menu-body.js +7 -7
  74. package/dist/app/components/composer-mobile-plus-panel.js +32 -32
  75. package/dist/app/components/composer-mobile-plus.js +5 -5
  76. package/dist/app/components/credit-amount-picker.js +2 -2
  77. package/dist/app/components/credit-required-gate.js +6 -6
  78. package/dist/app/components/credit-required-prompt.js +27 -27
  79. package/dist/app/components/credits/checkout-credits-celebration.js +4 -4
  80. package/dist/app/components/credits/checkout-return.js +4 -4
  81. package/dist/app/components/credits/coupon-redeem.js +1 -1
  82. package/dist/app/components/credits/credit-refusal-notice.js +8 -8
  83. package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
  84. package/dist/app/components/cross-slot-deep-link-recovery.js +2 -2
  85. package/dist/app/components/desktop/app-shots.js +10 -10
  86. package/dist/app/components/desktop/app-update.js +3 -3
  87. package/dist/app/components/desktop/computer-use.js +4 -4
  88. package/dist/app/components/desktop/this-computer.js +8 -8
  89. package/dist/app/components/feedback.js +11 -11
  90. package/dist/app/components/follow-up-repository-menu-body.js +12 -12
  91. package/dist/app/components/follow-up-repository-picker.js +1 -1
  92. package/dist/app/components/github-app-connect-launcher.js +2 -2
  93. package/dist/app/components/in-app-help-link.js +3 -3
  94. package/dist/app/components/knowledge/agent-learning-settings.js +5 -5
  95. package/dist/app/components/machines/connect-machine-dialog.js +25 -25
  96. package/dist/app/components/manual-repository-editor.js +1 -1
  97. package/dist/app/components/markdown.js +18 -17
  98. package/dist/app/components/model-identity.js +3 -3
  99. package/dist/app/components/models/models-ui.js +17 -17
  100. package/dist/app/components/models/provider-mark.js +3 -3
  101. package/dist/app/components/models/subscription-usage.js +5 -5
  102. package/dist/app/components/my-things.js +19 -19
  103. package/dist/app/components/own-where-it-works.js +12 -12
  104. package/dist/app/components/personal-resource-attachment-surface.js +4 -4
  105. package/dist/app/components/pickers.js +12 -12
  106. package/dist/app/components/rail/channel-create-dialog.js +6 -6
  107. package/dist/app/components/rail/project-glyph.js +54 -53
  108. package/dist/app/components/rail/project-profile.js +76 -75
  109. package/dist/app/components/rail/rail-context.js +2 -2
  110. package/dist/app/components/rail/rail-sections.js +155 -154
  111. package/dist/app/components/rail/session-header.js +125 -124
  112. package/dist/app/components/rail/session-list.js +153 -152
  113. package/dist/app/components/rail/session-row-content.js +6 -6
  114. package/dist/app/components/rail/session-row-hover-details.js +36 -36
  115. package/dist/app/components/rail/session-shell.js +194 -193
  116. package/dist/app/components/rail/site-session-group-heading.js +37 -37
  117. package/dist/app/components/repository-picker.js +12 -12
  118. package/dist/app/components/secrets/session-secrets-panel.js +3 -3
  119. package/dist/app/components/session/agent-configuration-panel.js +53 -53
  120. package/dist/app/components/session/artifact-session-page.js +8 -8
  121. package/dist/app/components/session/banners.js +22 -21
  122. package/dist/app/components/session/chat-avatar.js +54 -53
  123. package/dist/app/components/session/console-new-conversation.js +105 -104
  124. package/dist/app/components/session/descendant-requests.js +101 -100
  125. package/dist/app/components/session/descendant-requests.js.map +1 -1
  126. package/dist/app/components/session/editable-artifacts-workspace.js +62 -60
  127. package/dist/app/components/session/editable-artifacts-workspace.js.map +1 -1
  128. package/dist/app/components/session/failed-session-banner.js +28 -28
  129. package/dist/app/components/session/failure-recovery-boundary.js +3 -3
  130. package/dist/app/components/session/human-input-delegation-record.js +3 -3
  131. package/dist/app/components/session/human-input.js +88 -87
  132. package/dist/app/components/session/inspector.js +136 -135
  133. package/dist/app/components/session/inspector.js.map +1 -1
  134. package/dist/app/components/session/linked-panel.js +3 -3
  135. package/dist/app/components/session/message-actions.js +11 -11
  136. package/dist/app/components/session/model-recovery-notice.js +4 -4
  137. package/dist/app/components/session/new-session-settings-menu.js +32 -32
  138. package/dist/app/components/session/new-session-setup-strip.js +58 -57
  139. package/dist/app/components/session/own-account-wait-notice.js +8 -8
  140. package/dist/app/components/session/pinned-account-wait-notice.js +8 -8
  141. package/dist/app/components/session/pull-request-panel.js +26 -25
  142. package/dist/app/components/session/sandbox-recovery-actions.js +5 -5
  143. package/dist/app/components/session/sandbox-switcher.js +22 -22
  144. package/dist/app/components/session/sandbox-workspace.js +118 -117
  145. package/dist/app/components/session/search-markdown-highlight.js +19 -18
  146. package/dist/app/components/session/search-results-view.js +20 -19
  147. package/dist/app/components/session/session-admin-access.js +12 -12
  148. package/dist/app/components/session/session-admission-notice.js +11 -11
  149. package/dist/app/components/session/session-avatar-picker.js +61 -60
  150. package/dist/app/components/session/session-avatar.js +56 -55
  151. package/dist/app/components/session/session-machine-access-notice.js +11 -11
  152. package/dist/app/components/session/session-profile-dialog.js +72 -71
  153. package/dist/app/components/session/session-profile-editor.js +73 -72
  154. package/dist/app/components/session/session-retention.js +8 -8
  155. package/dist/app/components/session/session-search-dialog.js +26 -25
  156. package/dist/app/components/session/session-search-dialog.js.map +1 -1
  157. package/dist/app/components/session/session-skill-reviews.js +5 -5
  158. package/dist/app/components/session/session-tenancy-control.js +25 -25
  159. package/dist/app/components/session/session-unattended-setting.js +4 -4
  160. package/dist/app/components/session/session-usage-limit-section.js +13 -13
  161. package/dist/app/components/session/share-chat-dialog.js +12 -12
  162. package/dist/app/components/session/subagents.js +22 -22
  163. package/dist/app/components/session/subscription-account-indicator.js +25 -25
  164. package/dist/app/components/session/subscription-account-menu.js +7 -7
  165. package/dist/app/components/session-connectors-menu-body.js +11 -11
  166. package/dist/app/components/settings/row-select.js +6 -6
  167. package/dist/app/components/transcription-settings.js +10 -10
  168. package/dist/app/components/ui/destructive-confirm.js +11 -11
  169. package/dist/app/components/usage/usage-entry.js +8 -8
  170. package/dist/app/components/window-bar.js +25 -25
  171. package/dist/app/components/workspace-composer-plus.js +46 -45
  172. package/dist/app/components/workspace-reach.d.ts +2 -0
  173. package/dist/app/components/workspace-reach.js +6 -6
  174. package/dist/app/embed/session-app.js +406 -405
  175. package/dist/app/lib/actions/actions-provider.js +18 -18
  176. package/dist/app/lib/agent-capabilities.js +4 -4
  177. package/dist/app/lib/app-connect-card.js +16 -16
  178. package/dist/app/lib/app-shared-key-dialog.js +9 -9
  179. package/dist/app/lib/app-surfaces.js +1 -1
  180. package/dist/app/lib/app-sync-opt-in.js +7 -7
  181. package/dist/app/lib/codex-usage-query.js +3 -3
  182. package/dist/app/lib/composer-agent.js +2 -2
  183. package/dist/app/lib/composer-connectors.js +35 -34
  184. package/dist/app/lib/composer-send-blocking.js +2 -2
  185. package/dist/app/lib/console-site.js +9 -9
  186. package/dist/app/lib/console-text.js +2 -2
  187. package/dist/app/lib/events.js +32 -31
  188. package/dist/app/lib/failed-session-copy.js +5 -5
  189. package/dist/app/lib/feedback-capture.js +2 -2
  190. package/dist/app/lib/model-access-onboarding.js +4 -4
  191. package/dist/app/lib/move-chat-to-machine.js +5 -5
  192. package/dist/app/lib/personal-resource-attachments.js +1 -1
  193. package/dist/app/lib/session-branch-cache.js +18 -18
  194. package/dist/app/lib/session-create.js +5 -5
  195. package/dist/app/lib/session-group-pagination.js +18 -18
  196. package/dist/app/lib/session-hover-facts.js +25 -25
  197. package/dist/app/lib/session-list-dirty-scopes.js +19 -19
  198. package/dist/app/lib/session-model.js +2 -2
  199. package/dist/app/lib/session-rail.js +15 -15
  200. package/dist/app/lib/session-rename.js +3 -3
  201. package/dist/app/lib/sessions-group.js +23 -23
  202. package/dist/app/lib/site-tool-consent-dialog.js +24 -24
  203. package/dist/app/lib/site-tool-consent.js +1 -1
  204. package/dist/app/lib/turn-failure-analytics.js +6 -6
  205. package/dist/app/lib/use-artifact-catalog.js +2 -2
  206. package/dist/app/lib/use-duplicate-site.js +4 -4
  207. package/dist/app/lib/use-follow-up-repositories.js +9 -9
  208. package/dist/app/lib/use-personal-resource-attachment.js +2 -2
  209. package/dist/app/lib/use-workspace-integrations.js +2 -2
  210. package/dist/app/lib/use-workspace-machines.js +10 -10
  211. package/dist/app/lib/use-workspace-model-catalog.js +6 -6
  212. package/dist/app/lib/use-workspace-rigs.js +6 -6
  213. package/dist/app/lib/workspace-navigation-preference.js +5 -5
  214. package/dist/app/lib/workspace-scope-context.js +4 -4
  215. package/dist/app/routes/app-page-view.js +52 -50
  216. package/dist/app/routes/app-page-view.js.map +1 -1
  217. package/dist/app/routes/app-page.js +2 -2
  218. package/dist/app/routes/artifacts.js +170 -168
  219. package/dist/app/routes/artifacts.js.map +1 -1
  220. package/dist/app/routes/retained-artifact.js +110 -109
  221. package/dist/app/routes/retained-artifact.js.map +1 -1
  222. package/dist/app/routes/session-unavailable.js +6 -6
  223. package/dist/app/routes/session.js +249 -248
  224. package/dist/app/routes/sessions-index-hydration.js +6 -6
  225. package/dist/app/routes/sessions-index.js +204 -203
  226. package/dist/app/routes/site-view.js +210 -209
  227. package/dist/app/routes/site-view.js.map +1 -1
  228. package/dist/artifacts-document.js +4 -4
  229. package/dist/artifacts-presentation.js +9 -9
  230. package/dist/artifacts-spreadsheet.js +4 -4
  231. package/dist/artifacts.js +53 -51
  232. package/dist/automation-model.js +6 -6
  233. package/dist/automations.js +64 -64
  234. package/dist/browser-viewer-TRPZI6NT.js +23 -0
  235. package/dist/chat-interactive-block-Y4BS4JCM.js +24 -0
  236. package/dist/chunk-22E2YJHT.js +469 -0
  237. package/dist/chunk-2T6TN2YL.js +538 -0
  238. package/dist/chunk-2WNN26NW.js +175 -0
  239. package/dist/chunk-3432A6XB.js +88 -0
  240. package/dist/chunk-35U7NSOR.js +366 -0
  241. package/dist/chunk-3EPR76WS.js +773 -0
  242. package/dist/chunk-3FXXEU5D.js +144 -0
  243. package/dist/chunk-3MXOPOEU.js +650 -0
  244. package/dist/chunk-3PKDU4JI.js +340 -0
  245. package/dist/chunk-3PMO2BIV.js +12 -0
  246. package/dist/chunk-3XWHJNFY.js +48 -0
  247. package/dist/chunk-45WD2PKE.js +401 -0
  248. package/dist/chunk-4H2OWNRA.js +598 -0
  249. package/dist/chunk-4HVGOTMU.js +263 -0
  250. package/dist/chunk-4JER2ZMV.js +818 -0
  251. package/dist/chunk-4LVZ2VOQ.js +214 -0
  252. package/dist/chunk-4OGDD2EM.js +2434 -0
  253. package/dist/chunk-4PQC6WMF.js +54 -0
  254. package/dist/chunk-4UVSWAT3.js +794 -0
  255. package/dist/chunk-53A47RBX.js +214 -0
  256. package/dist/chunk-552KKENW.js +114 -0
  257. package/dist/chunk-55F7L6M3.js +177 -0
  258. package/dist/chunk-5AHIKB3O.js +449 -0
  259. package/dist/chunk-5KQD6MLJ.js +3996 -0
  260. package/dist/chunk-5KQD6MLJ.js.map +1 -0
  261. package/dist/chunk-5N4L5WTE.js +199 -0
  262. package/dist/chunk-5OUJCVZI.js +79 -0
  263. package/dist/chunk-5OYXQ7MH.js +65 -0
  264. package/dist/chunk-5RGF74K5.js +371 -0
  265. package/dist/chunk-5RGF74K5.js.map +1 -0
  266. package/dist/chunk-5TAVVMFX.js +225 -0
  267. package/dist/chunk-5Y3LYRNH.js +269 -0
  268. package/dist/chunk-5ZJKKE4T.js +386 -0
  269. package/dist/chunk-62DPSQRZ.js +57 -0
  270. package/dist/chunk-64KMWTJ6.js +608 -0
  271. package/dist/chunk-6F34IWSA.js +47 -0
  272. package/dist/chunk-6F34IWSA.js.map +1 -0
  273. package/dist/chunk-6MZBNUS7.js +73 -0
  274. package/dist/chunk-6YCE4ZC4.js +250 -0
  275. package/dist/chunk-6YROWWMX.js +175 -0
  276. package/dist/chunk-73RZ72VU.js +1236 -0
  277. package/dist/chunk-74KV436L.js +84 -0
  278. package/dist/chunk-7HKGLPV5.js +83 -0
  279. package/dist/chunk-7JSWODT6.js +466 -0
  280. package/dist/chunk-7K3PKWER.js +428 -0
  281. package/dist/chunk-7MPWC42V.js +1356 -0
  282. package/dist/chunk-7REO6FRN.js +141 -0
  283. package/dist/chunk-7V3OL7JC.js +850 -0
  284. package/dist/chunk-7V3OL7JC.js.map +1 -0
  285. package/dist/chunk-7YMWRNRQ.js +145 -0
  286. package/dist/chunk-A6H3KJ7G.js +131 -0
  287. package/dist/chunk-AGQIE6YU.js +1769 -0
  288. package/dist/chunk-AHQM4I5V.js +373 -0
  289. package/dist/chunk-AMTRO7XF.js +172 -0
  290. package/dist/chunk-AO4LTCG7.js +91 -0
  291. package/dist/chunk-APJ22OZV.js +2580 -0
  292. package/dist/chunk-APWL37KW.js +407 -0
  293. package/dist/chunk-AQEJOBQ2.js +15 -0
  294. package/dist/chunk-ARKNT6BX.js +234 -0
  295. package/dist/chunk-B2IHDMAR.js +211 -0
  296. package/dist/chunk-BCKIV26W.js +112 -0
  297. package/dist/chunk-BE26JUSD.js +259 -0
  298. package/dist/chunk-BOVCD6KD.js +171 -0
  299. package/dist/chunk-BQWV66A6.js +129 -0
  300. package/dist/chunk-BSQJXGGP.js +441 -0
  301. package/dist/chunk-BZY3MEVZ.js +3183 -0
  302. package/dist/chunk-C3D3OOEY.js +335 -0
  303. package/dist/chunk-CDHYO3DP.js +82 -0
  304. package/dist/chunk-CDV5JGVI.js +79 -0
  305. package/dist/chunk-CNW45M7G.js +207 -0
  306. package/dist/chunk-CUVQ37HB.js +150 -0
  307. package/dist/chunk-D32T3IIC.js +532 -0
  308. package/dist/chunk-D32VVOBJ.js +738 -0
  309. package/dist/chunk-D32VVOBJ.js.map +1 -0
  310. package/dist/chunk-D65BSM64.js +371 -0
  311. package/dist/chunk-D7435DWV.js +570 -0
  312. package/dist/chunk-DFH3M7B3.js +72 -0
  313. package/dist/chunk-DGWBQ76M.js +162 -0
  314. package/dist/chunk-DHJDTGSJ.js +372 -0
  315. package/dist/chunk-DKEFTNCD.js +400 -0
  316. package/dist/chunk-DNAF6MT4.js +107 -0
  317. package/dist/chunk-DSJ7K5IF.js +380 -0
  318. package/dist/chunk-DSJ7K5IF.js.map +1 -0
  319. package/dist/chunk-E35XY7DS.js +27 -0
  320. package/dist/chunk-E5T5WIIP.js +396 -0
  321. package/dist/chunk-EL6ECD34.js +166 -0
  322. package/dist/chunk-ELR6ITRC.js +467 -0
  323. package/dist/chunk-EPE3V2VE.js +851 -0
  324. package/dist/chunk-EYGQHHVW.js +584 -0
  325. package/dist/chunk-EYQEJHYP.js +307 -0
  326. package/dist/chunk-EZTH2XMH.js +276 -0
  327. package/dist/chunk-F3QVHVFS.js +287 -0
  328. package/dist/chunk-F5VWPREQ.js +1187 -0
  329. package/dist/chunk-FM7AQUBL.js +113 -0
  330. package/dist/chunk-FP6BUXJM.js +100 -0
  331. package/dist/chunk-FVU52L3I.js +249 -0
  332. package/dist/chunk-FZKNXNNO.js +218 -0
  333. package/dist/chunk-G3IXJWRY.js +236 -0
  334. package/dist/chunk-G6EI2O3N.js +333 -0
  335. package/dist/chunk-G7KHMA3E.js +256 -0
  336. package/dist/chunk-G7KHMA3E.js.map +1 -0
  337. package/dist/chunk-GB5T6YMZ.js +401 -0
  338. package/dist/chunk-GBLD6FOG.js +157 -0
  339. package/dist/chunk-GJBFFXCY.js +137 -0
  340. package/dist/chunk-GJDP2K2S.js +66 -0
  341. package/dist/chunk-GP26XTDX.js +187 -0
  342. package/dist/chunk-GTE6WP4N.js +606 -0
  343. package/dist/chunk-GWG3OAV7.js +108 -0
  344. package/dist/chunk-GXMHTMM6.js +931 -0
  345. package/dist/chunk-GYRN5O2E.js +107 -0
  346. package/dist/chunk-GZX7W2WW.js +65 -0
  347. package/dist/chunk-H3QI2G2B.js +403 -0
  348. package/dist/chunk-H7D4DVWY.js +849 -0
  349. package/dist/chunk-HCDGBBBJ.js +191 -0
  350. package/dist/chunk-HDSH6MIJ.js +3851 -0
  351. package/dist/chunk-HOEUPZ6O.js +89 -0
  352. package/dist/chunk-HPQRWTQB.js +772 -0
  353. package/dist/chunk-HUKGLWAY.js +174 -0
  354. package/dist/chunk-HUTQJY3F.js +23 -0
  355. package/dist/chunk-HWOYJOKK.js +266 -0
  356. package/dist/chunk-HZR3WGUP.js +96 -0
  357. package/dist/chunk-I7YUDPDR.js +138 -0
  358. package/dist/chunk-IDII52M4.js +27 -0
  359. package/dist/chunk-IDPWEUM7.js +103 -0
  360. package/dist/chunk-IEWQFGEC.js +192 -0
  361. package/dist/chunk-IKWGPFT5.js +300 -0
  362. package/dist/chunk-IKWGPFT5.js.map +1 -0
  363. package/dist/chunk-IMTACEXF.js +351 -0
  364. package/dist/chunk-IVWT6M6N.js +114 -0
  365. package/dist/chunk-JE2YXAVR.js +485 -0
  366. package/dist/chunk-JE2YXAVR.js.map +1 -0
  367. package/dist/chunk-JEUPIHIP.js +111 -0
  368. package/dist/chunk-JF4WX3GQ.js +168 -0
  369. package/dist/chunk-JJPYXUKC.js +2591 -0
  370. package/dist/chunk-JNHWTYDD.js +43 -0
  371. package/dist/chunk-JP7AOJWD.js +46 -0
  372. package/dist/chunk-JTWT2WQA.js +297 -0
  373. package/dist/chunk-JW3WIHWO.js +117 -0
  374. package/dist/chunk-JW7RJMEZ.js +134 -0
  375. package/dist/chunk-K76PXR3O.js +2317 -0
  376. package/dist/chunk-KCNIQN6V.js +107 -0
  377. package/dist/chunk-KH6KHYST.js +231 -0
  378. package/dist/chunk-KK4SEN7N.js +247 -0
  379. package/dist/chunk-KOKRGAAI.js +383 -0
  380. package/dist/chunk-KQFNTGAF.js +187 -0
  381. package/dist/chunk-KRLNC6TH.js +50 -0
  382. package/dist/chunk-KYDLVMKA.js +99 -0
  383. package/dist/chunk-KZQDP2JM.js +155 -0
  384. package/dist/chunk-L2EZ2HOX.js +132 -0
  385. package/dist/chunk-L2UAFR2D.js +33 -0
  386. package/dist/chunk-L4R7ORMD.js +4596 -0
  387. package/dist/chunk-LCLWN64E.js +227 -0
  388. package/dist/chunk-LFQI2C46.js +175 -0
  389. package/dist/chunk-LLYX4F5A.js +1628 -0
  390. package/dist/chunk-LQX5QCDS.js +215 -0
  391. package/dist/chunk-LRMHASG2.js +196 -0
  392. package/dist/chunk-LVUSG56I.js +5930 -0
  393. package/dist/chunk-LVUSG56I.js.map +1 -0
  394. package/dist/chunk-M5FX5KH5.js +629 -0
  395. package/dist/chunk-MLOTUQJJ.js +201 -0
  396. package/dist/chunk-MPUKGKXZ.js +209 -0
  397. package/dist/chunk-MS6LW4VU.js +283 -0
  398. package/dist/chunk-MWN7LDYV.js +4601 -0
  399. package/dist/chunk-MWN7LDYV.js.map +1 -0
  400. package/dist/chunk-MXPW4F74.js +278 -0
  401. package/dist/chunk-MZ7GJX5S.js +158 -0
  402. package/dist/chunk-N5OUIUYD.js +1260 -0
  403. package/dist/chunk-N6FNORC7.js +412 -0
  404. package/dist/chunk-NALVKY4U.js +113 -0
  405. package/dist/chunk-NJ77ZL5T.js +5222 -0
  406. package/dist/chunk-NM2DNJDJ.js +270 -0
  407. package/dist/chunk-NNKRRF7E.js +110 -0
  408. package/dist/chunk-NP5UFWU4.js +318 -0
  409. package/dist/chunk-NV3AEIFO.js +118 -0
  410. package/dist/chunk-O6JDF7KH.js +828 -0
  411. package/dist/chunk-OERZH3J4.js +251 -0
  412. package/dist/chunk-OKHWTWWU.js +1152 -0
  413. package/dist/chunk-OLAIUVGT.js +274 -0
  414. package/dist/chunk-OO36IUMS.js +270 -0
  415. package/dist/chunk-OVDK7K2Z.js +57 -0
  416. package/dist/chunk-OX5ZCHZQ.js +63 -0
  417. package/dist/chunk-P6LLCGPO.js +515 -0
  418. package/dist/chunk-PA2CUHTD.js +505 -0
  419. package/dist/chunk-PB4CQIRA.js +4979 -0
  420. package/dist/chunk-PBV2P632.js +566 -0
  421. package/dist/chunk-PCSRHFRF.js +75 -0
  422. package/dist/chunk-PEPWW5BC.js +436 -0
  423. package/dist/chunk-PMBZMVKE.js +33 -0
  424. package/dist/chunk-PP32RE26.js +34 -0
  425. package/dist/chunk-PTXAPI3Q.js +73 -0
  426. package/dist/chunk-PULNNF7G.js +56 -0
  427. package/dist/chunk-Q6KNROUT.js +158 -0
  428. package/dist/chunk-QEGP3HSW.js +184 -0
  429. package/dist/chunk-QEGP3HSW.js.map +1 -0
  430. package/dist/chunk-QGJIFIKN.js +1032 -0
  431. package/dist/chunk-QKKKORGL.js +41 -0
  432. package/dist/chunk-QKUMMG6P.js +85 -0
  433. package/dist/chunk-QNOWKKZ4.js +40 -0
  434. package/dist/chunk-QSWD3AHE.js +84 -0
  435. package/dist/chunk-QZ4U2VL5.js +391 -0
  436. package/dist/chunk-QZJNCLHV.js +271 -0
  437. package/dist/chunk-R6CFPY3F.js +278 -0
  438. package/dist/chunk-R6QRUYUH.js +406 -0
  439. package/dist/chunk-RE3GAQI5.js +2984 -0
  440. package/dist/chunk-RFHUVPFA.js +1184 -0
  441. package/dist/chunk-RH45HT5T.js +3690 -0
  442. package/dist/chunk-RJNQTZ5O.js +439 -0
  443. package/dist/chunk-RN24AP7Q.js +247 -0
  444. package/dist/chunk-RN24AP7Q.js.map +1 -0
  445. package/dist/chunk-S2BJTAAB.js +37 -0
  446. package/dist/chunk-S56PWXIX.js +138 -0
  447. package/dist/chunk-S6BDABIC.js +1390 -0
  448. package/dist/chunk-S6BDABIC.js.map +1 -0
  449. package/dist/chunk-S6FFDIHD.js +640 -0
  450. package/dist/chunk-S6MAMIK2.js +56 -0
  451. package/dist/chunk-SERTO6H6.js +311 -0
  452. package/dist/chunk-STOOH7EI.js +200 -0
  453. package/dist/chunk-SWSTEUXX.js +121 -0
  454. package/dist/chunk-SWZN7NNZ.js +1029 -0
  455. package/dist/chunk-SYDF57KS.js +178 -0
  456. package/dist/chunk-T275CUVD.js +29 -0
  457. package/dist/chunk-T4OT7QWP.js +378 -0
  458. package/dist/chunk-TCSRY2NP.js +2582 -0
  459. package/dist/chunk-TCX5OA2X.js +1177 -0
  460. package/dist/chunk-TDW5CSO5.js +3158 -0
  461. package/dist/chunk-TGG3ODCS.js +99 -0
  462. package/dist/chunk-TILSTYUC.js +505 -0
  463. package/dist/chunk-TJ5DYWXU.js +1333 -0
  464. package/dist/chunk-TNRI4ZE6.js +391 -0
  465. package/dist/chunk-TPIFVUMF.js +188 -0
  466. package/dist/chunk-TSW6OF22.js +162 -0
  467. package/dist/chunk-TTSTBHGR.js +1095 -0
  468. package/dist/chunk-U3JYAWMR.js +170 -0
  469. package/dist/chunk-U7ODSHA5.js +124 -0
  470. package/dist/chunk-UEGEPRNP.js +48 -0
  471. package/dist/chunk-UGIA2YEJ.js +83 -0
  472. package/dist/chunk-UHLKKDNF.js +432 -0
  473. package/dist/chunk-ULVXKIPX.js +26 -0
  474. package/dist/chunk-UN37ZY6R.js +10074 -0
  475. package/dist/chunk-UN37ZY6R.js.map +1 -0
  476. package/dist/chunk-USUDKZ5G.js +98 -0
  477. package/dist/chunk-UVO6I2F6.js +85 -0
  478. package/dist/chunk-V6NVG4K2.js +357 -0
  479. package/dist/chunk-VCMQFD3G.js +1185 -0
  480. package/dist/chunk-VKPBDNIO.js +246 -0
  481. package/dist/chunk-VLDKWGHD.js +61 -0
  482. package/dist/chunk-VM2NA2EL.js +905 -0
  483. package/dist/chunk-VMZTCVEL.js +114 -0
  484. package/dist/chunk-VQH5AXZY.js +269 -0
  485. package/dist/chunk-VTBTW6N4.js +114 -0
  486. package/dist/chunk-VV7PLDX4.js +230 -0
  487. package/dist/chunk-VYGGLH5H.js +50 -0
  488. package/dist/chunk-VYQHHTQ4.js +133 -0
  489. package/dist/chunk-VYSGRD2W.js +292 -0
  490. package/dist/chunk-W4W63LTP.js +1309 -0
  491. package/dist/chunk-WFC2JA6D.js +2335 -0
  492. package/dist/chunk-WFC2JA6D.js.map +1 -0
  493. package/dist/chunk-WHTRR66J.js +197 -0
  494. package/dist/chunk-WICIQFHJ.js +42 -0
  495. package/dist/chunk-WJYYMCCC.js +283 -0
  496. package/dist/chunk-WSJOWQJE.js +399 -0
  497. package/dist/chunk-WY333GHH.js +108 -0
  498. package/dist/chunk-WY333GHH.js.map +1 -0
  499. package/dist/chunk-WYDUXZ2R.js +353 -0
  500. package/dist/chunk-X62CN4YR.js +3321 -0
  501. package/dist/chunk-XFQHKMO6.js +1024 -0
  502. package/dist/chunk-XGJ7XZHS.js +527 -0
  503. package/dist/chunk-XJFJNOEV.js +723 -0
  504. package/dist/chunk-XKJLHMXZ.js +234 -0
  505. package/dist/chunk-XLFPJVQS.js +103 -0
  506. package/dist/chunk-XM4ZLZFW.js +129 -0
  507. package/dist/chunk-Y2GAWEJD.js +1021 -0
  508. package/dist/chunk-Y3A74SVK.js +296 -0
  509. package/dist/chunk-YANEVGI3.js +92 -0
  510. package/dist/chunk-YHHSO5QR.js +128 -0
  511. package/dist/chunk-YOSOCHCB.js +52 -0
  512. package/dist/chunk-YP4SNX4P.js +220 -0
  513. package/dist/chunk-YQH6AMIH.js +176 -0
  514. package/dist/chunk-YRWL2IAE.js +165 -0
  515. package/dist/chunk-YTWRQ3WK.js +251 -0
  516. package/dist/chunk-YV5GGSLK.js +20 -0
  517. package/dist/chunk-YXUDK37V.js +126 -0
  518. package/dist/chunk-YYM5TSCR.js +75 -0
  519. package/dist/chunk-ZG2CKFQF.js +202 -0
  520. package/dist/chunk-ZGJXO2HH.js +93 -0
  521. package/dist/chunk-ZGV76PZ4.js +3070 -0
  522. package/dist/chunk-ZOBUR2VC.js +229 -0
  523. package/dist/components/artifacts/artifact-chrome.d.ts +4 -0
  524. package/dist/components/artifacts/artifact-sandbox.d.ts +13 -0
  525. package/dist/components/artifacts/inline-html-document.d.ts +10 -1
  526. package/dist/components/artifacts/published-html-artifact-frame.d.ts +17 -0
  527. package/dist/components/preview-loading.d.ts +3 -1
  528. package/dist/composer.js +37 -37
  529. package/dist/computer-viewer-S6AL3XDT.js +21 -0
  530. package/dist/connect.js +38 -37
  531. package/dist/connection-step-up-XGPZKQEL.js +149 -0
  532. package/dist/connection-step-up-XGPZKQEL.js.map +1 -0
  533. package/dist/desktop-dictation.js +23 -23
  534. package/dist/desktop.js +2 -2
  535. package/dist/editor.js +2 -2
  536. package/dist/embedded-new-voice-T3BXRYJX.js +25 -0
  537. package/dist/embedded-voice-ZJXMF3RP.js +25 -0
  538. package/dist/fleet-decision-row-AUCMLBCV.js +361 -0
  539. package/dist/in-chat-connect-model.js +5 -5
  540. package/dist/index.js +296 -295
  541. package/dist/interaction.js +9 -9
  542. package/dist/latest-question-D5BKKEP6.js +1 -1
  543. package/dist/machine-request-model.js +1 -1
  544. package/dist/machines.js +8 -8
  545. package/dist/meetings/meeting-detail-page.d.ts +14 -0
  546. package/dist/meetings/meeting-notes.d.ts +6 -2
  547. package/dist/meetings/meeting-transcript.d.ts +3 -1
  548. package/dist/meetings-recorder.js +1 -1
  549. package/dist/meetings.js +367 -260
  550. package/dist/meetings.js.map +1 -1
  551. package/dist/messages/en.d.ts +6 -2
  552. package/dist/messages.js +1 -1
  553. package/dist/model-policy-picker-menu-TO57YUQ6.js +23 -0
  554. package/dist/native-previews.js +1 -1
  555. package/dist/payment-page-card-DFGDAMTG.js +227 -0
  556. package/dist/platform-activity-row-ZMBEJGXN.js +156 -0
  557. package/dist/queue-surface-implementation-KDK5CYH6.js +933 -0
  558. package/dist/realtime.js +17 -17
  559. package/dist/recorder-host-3HLYRL4H.js +80 -0
  560. package/dist/recordings.js +3 -3
  561. package/dist/sandbox-files-UOZ4OJZU.js +29 -0
  562. package/dist/session-app.js +406 -405
  563. package/dist/session-connect-cards-VZIYLH45.js +28 -0
  564. package/dist/session-list-model.js +2 -2
  565. package/dist/session-realtime-2ZGJWVZP.js +30 -0
  566. package/dist/session-realtime.js +2 -2
  567. package/dist/session-ui.js +98 -97
  568. package/dist/session.js +40 -40
  569. package/dist/sites.js +3 -3
  570. package/dist/skills.js +32 -32
  571. package/dist/terminal.js +2 -2
  572. package/dist/testing/meetings-fixture.d.ts +8 -0
  573. package/dist/testing/meetings-fixture.js +22 -1
  574. package/dist/testing/meetings-fixture.js.map +1 -1
  575. package/dist/this-computer.js +3 -3
  576. package/dist/timeline-annotation-markers-KBTFWLME.js +157 -0
  577. package/dist/timeline-annotation-selection-VI4YSDR5.js +208 -0
  578. package/dist/timeline-annotations-dialog-4PLWNLRB.js +283 -0
  579. package/dist/timeline-model.js +37 -37
  580. package/dist/ui/access-list.js +24 -24
  581. package/dist/ui/cadence-picker.js +7 -7
  582. package/dist/ui/capability-page.js +10 -10
  583. package/dist/ui/choice-cards.js +3 -3
  584. package/dist/ui/confirm-dialog.js +4 -4
  585. package/dist/ui/copy-field.js +3 -3
  586. package/dist/ui/detail-page.js +6 -6
  587. package/dist/ui/detail-sheet.js +6 -6
  588. package/dist/ui/dialog.js +2 -2
  589. package/dist/ui/diff-view.js +3 -3
  590. package/dist/ui/disclosure.js +7 -7
  591. package/dist/ui/email-chips-input.js +3 -3
  592. package/dist/ui/field.js +2 -2
  593. package/dist/ui/flush-form-page.js +8 -8
  594. package/dist/ui/form-dialog.js +7 -7
  595. package/dist/ui/list-row.js +7 -7
  596. package/dist/ui/load-failure.js +3 -3
  597. package/dist/ui/relative-time.js +3 -3
  598. package/dist/ui/revision-history.js +16 -16
  599. package/dist/ui/role-select.js +13 -13
  600. package/dist/ui/select-menu.js +5 -5
  601. package/dist/ui/settings-nav.js +6 -6
  602. package/dist/ui/sheet.js +2 -2
  603. package/dist/ui/usage-meter.js +4 -4
  604. package/dist/usage.js +3 -3
  605. package/dist/workbench.js +11 -11
  606. package/package.json +6 -5
  607. package/src/app/components/session/sandbox-recovery-actions.test.tsx +26 -0
  608. package/src/app/components/session/sandbox-recovery-actions.tsx +2 -1
  609. package/src/app/components/workspace-reach.tsx +2 -0
  610. package/src/components/artifacts/artifact-chrome.tsx +6 -0
  611. package/src/components/artifacts/artifact-sandbox.tsx +119 -20
  612. package/src/components/artifacts/chat-interactive-block.tsx +1 -0
  613. package/src/components/artifacts/inline-html-document.ts +13 -3
  614. package/src/components/artifacts/published-html-artifact-frame.tsx +60 -4
  615. package/src/components/preview-loading.tsx +2 -2
  616. package/src/meetings/meeting-detail-page.tsx +232 -112
  617. package/src/meetings/meeting-notes.tsx +48 -24
  618. package/src/meetings/meeting-transcript.tsx +75 -57
  619. package/src/meetings/meetings-pages.test.tsx +181 -2
  620. package/src/messages/en.ts +6 -2
  621. package/src/testing/meetings-fixture.ts +35 -1
  622. package/styles/compiled.css +8 -0
  623. package/styles/index.css +7 -0
  624. package/dist/browser-viewer-KFMM5S2B.js +0 -23
  625. package/dist/chat-interactive-block-5DJ72HU7.js +0 -22
  626. package/dist/chunk-2B3RQRNQ.js +0 -584
  627. package/dist/chunk-2DA7DTHO.js +0 -83
  628. package/dist/chunk-2GXAXCS2.js +0 -401
  629. package/dist/chunk-2JTZMHQK.js +0 -57
  630. package/dist/chunk-2LRJ32SO.js +0 -114
  631. package/dist/chunk-2VK7FJNR.js +0 -307
  632. package/dist/chunk-2YJS75C3.js +0 -269
  633. package/dist/chunk-2YNEUYWM.js +0 -231
  634. package/dist/chunk-2ZR75AUO.js +0 -225
  635. package/dist/chunk-32LD46VC.js +0 -72
  636. package/dist/chunk-3FVVZW7J.js +0 -84
  637. package/dist/chunk-4327UGUS.js +0 -79
  638. package/dist/chunk-45TILHFZ.js +0 -249
  639. package/dist/chunk-4AUSS7CX.js +0 -318
  640. package/dist/chunk-4ECOHGUL.js +0 -818
  641. package/dist/chunk-4FKE42TW.js +0 -1333
  642. package/dist/chunk-4K5UVYZQ.js +0 -113
  643. package/dist/chunk-4UZE7ZT4.js +0 -54
  644. package/dist/chunk-4XQH4XPP.js +0 -400
  645. package/dist/chunk-4Z7BPBS7.js +0 -34
  646. package/dist/chunk-56KVDNOS.js +0 -98
  647. package/dist/chunk-56NHT2TZ.js +0 -56
  648. package/dist/chunk-57QWSJLX.js +0 -114
  649. package/dist/chunk-5AGRFQSH.js +0 -432
  650. package/dist/chunk-5JMX5FRF.js +0 -1309
  651. package/dist/chunk-5UTHPGFF.js +0 -93
  652. package/dist/chunk-5VPQVMJI.js +0 -84
  653. package/dist/chunk-5WJCOFIU.js +0 -207
  654. package/dist/chunk-62T2ZPD5.js +0 -266
  655. package/dist/chunk-63AVTSUI.js +0 -383
  656. package/dist/chunk-6CDBX3XG.js +0 -33
  657. package/dist/chunk-6D3D2JWY.js +0 -278
  658. package/dist/chunk-6GUG7FXP.js +0 -380
  659. package/dist/chunk-6GUG7FXP.js.map +0 -1
  660. package/dist/chunk-6JGMBTXP.js +0 -114
  661. package/dist/chunk-6LYBRPUG.js +0 -931
  662. package/dist/chunk-6PHBW7SS.js +0 -287
  663. package/dist/chunk-6S2XVKNI.js +0 -91
  664. package/dist/chunk-6TWS6AXT.js +0 -1021
  665. package/dist/chunk-6VEIDSF4.js +0 -73
  666. package/dist/chunk-76NGRVCY.js +0 -340
  667. package/dist/chunk-7FFZLLCH.js +0 -391
  668. package/dist/chunk-7RRDXPNC.js +0 -111
  669. package/dist/chunk-7TLYFHMT.js +0 -851
  670. package/dist/chunk-7V2CQLTN.js +0 -20
  671. package/dist/chunk-7VDWXFTL.js +0 -772
  672. package/dist/chunk-A2OMNLDF.js +0 -150
  673. package/dist/chunk-A3QEJ2IZ.js +0 -229
  674. package/dist/chunk-A6Q6EUBR.js +0 -209
  675. package/dist/chunk-AJSRYRJS.js +0 -138
  676. package/dist/chunk-APNPWJCK.js +0 -66
  677. package/dist/chunk-ARNQH2XE.js +0 -178
  678. package/dist/chunk-B6AH43UQ.js +0 -2434
  679. package/dist/chunk-BIXGAYDJ.js +0 -276
  680. package/dist/chunk-BJ3WRO2K.js +0 -441
  681. package/dist/chunk-BO3D22BS.js +0 -12
  682. package/dist/chunk-BR62BHVY.js +0 -357
  683. package/dist/chunk-BTMSR4OA.js +0 -214
  684. package/dist/chunk-BVZYHORS.js +0 -40
  685. package/dist/chunk-BWBBS6HJ.js +0 -42
  686. package/dist/chunk-C22UPHA2.js +0 -274
  687. package/dist/chunk-C2EERTYX.js +0 -353
  688. package/dist/chunk-C2F6SKOS.js +0 -270
  689. package/dist/chunk-C625ODRG.js +0 -92
  690. package/dist/chunk-CAF3HFJH.js +0 -184
  691. package/dist/chunk-CAF3HFJH.js.map +0 -1
  692. package/dist/chunk-CC4JBFWY.js +0 -85
  693. package/dist/chunk-CDB66JAO.js +0 -283
  694. package/dist/chunk-CG2HT7TI.js +0 -269
  695. package/dist/chunk-CNNOPEAK.js +0 -570
  696. package/dist/chunk-CRBHMSAP.js +0 -469
  697. package/dist/chunk-CSK2WOOX.js +0 -83
  698. package/dist/chunk-CTBPPPLR.js +0 -2580
  699. package/dist/chunk-CTOLX2EW.js +0 -2317
  700. package/dist/chunk-CVDY7P3E.js +0 -246
  701. package/dist/chunk-CX3Z7W5Y.js +0 -107
  702. package/dist/chunk-D5K2BS5Q.js +0 -259
  703. package/dist/chunk-DA7XLT5F.js +0 -366
  704. package/dist/chunk-DAKKJ3XM.js +0 -298
  705. package/dist/chunk-DAKKJ3XM.js.map +0 -1
  706. package/dist/chunk-DC6KFW2R.js +0 -333
  707. package/dist/chunk-DIHPR5KJ.js +0 -15
  708. package/dist/chunk-DLMYANZX.js +0 -3851
  709. package/dist/chunk-DRAG2LZP.js +0 -171
  710. package/dist/chunk-E2SGFW2B.js +0 -3321
  711. package/dist/chunk-EAXZSBWV.js +0 -412
  712. package/dist/chunk-EFKWOXBP.js +0 -428
  713. package/dist/chunk-EGD5RPRX.js +0 -401
  714. package/dist/chunk-ELC2ZPHI.js +0 -1177
  715. package/dist/chunk-EZ5ZBOGQ.js +0 -1032
  716. package/dist/chunk-F2JKNL73.js +0 -187
  717. package/dist/chunk-F3LIUDXN.js +0 -738
  718. package/dist/chunk-F3LIUDXN.js.map +0 -1
  719. package/dist/chunk-FAB5SXNO.js +0 -640
  720. package/dist/chunk-FQ33JHJN.js +0 -63
  721. package/dist/chunk-FX343J2L.js +0 -132
  722. package/dist/chunk-FXFOKD7A.js +0 -449
  723. package/dist/chunk-FY42DW2R.js +0 -515
  724. package/dist/chunk-G4E5WKY7.js +0 -65
  725. package/dist/chunk-GFTV3RR6.js +0 -187
  726. package/dist/chunk-GGBMQNAB.js +0 -33
  727. package/dist/chunk-GGU7KV4G.js +0 -124
  728. package/dist/chunk-GIHE7U3Y.js +0 -174
  729. package/dist/chunk-GRGK3JJI.js +0 -10074
  730. package/dist/chunk-GRGK3JJI.js.map +0 -1
  731. package/dist/chunk-GT3FJVU6.js +0 -4596
  732. package/dist/chunk-GTGPKGWC.js +0 -65
  733. package/dist/chunk-GY6DSWBM.js +0 -82
  734. package/dist/chunk-H3EP6GNA.js +0 -538
  735. package/dist/chunk-HD2MCYQF.js +0 -234
  736. package/dist/chunk-HE4VN5D3.js +0 -4979
  737. package/dist/chunk-HFROJDFQ.js +0 -118
  738. package/dist/chunk-HHFFPE67.js +0 -220
  739. package/dist/chunk-HJ2CDFZX.js +0 -117
  740. package/dist/chunk-HJ2J2XQI.js +0 -88
  741. package/dist/chunk-HLLZPULI.js +0 -172
  742. package/dist/chunk-HPYQ5MES.js +0 -103
  743. package/dist/chunk-HRLJNDDC.js +0 -197
  744. package/dist/chunk-HVGM5IME.js +0 -170
  745. package/dist/chunk-HZE6V7GW.js +0 -214
  746. package/dist/chunk-I5DW76GB.js +0 -200
  747. package/dist/chunk-I7MZOZGC.js +0 -121
  748. package/dist/chunk-IB2EX6GX.js +0 -292
  749. package/dist/chunk-IEDDIJ6B.js +0 -4601
  750. package/dist/chunk-IEDDIJ6B.js.map +0 -1
  751. package/dist/chunk-IGFZFLI2.js +0 -1390
  752. package/dist/chunk-IGFZFLI2.js.map +0 -1
  753. package/dist/chunk-IIMRBCA4.js +0 -271
  754. package/dist/chunk-IIWNSYFA.js +0 -129
  755. package/dist/chunk-IN2ZJR2A.js +0 -96
  756. package/dist/chunk-IUPIJWFK.js +0 -905
  757. package/dist/chunk-IZA2KBYK.js +0 -57
  758. package/dist/chunk-IZZINUFM.js +0 -527
  759. package/dist/chunk-JFEAJRG6.js +0 -1029
  760. package/dist/chunk-JG7MEMJP.js +0 -1184
  761. package/dist/chunk-JIZWFW5A.js +0 -107
  762. package/dist/chunk-JJKUERR4.js +0 -131
  763. package/dist/chunk-JL4PMUDG.js +0 -192
  764. package/dist/chunk-JTWK3VE7.js +0 -202
  765. package/dist/chunk-JV2TJLUW.js +0 -144
  766. package/dist/chunk-KBDWMUYA.js +0 -175
  767. package/dist/chunk-KF65UG2L.js +0 -1628
  768. package/dist/chunk-KFYLTQGK.js +0 -133
  769. package/dist/chunk-KJI2DVSO.js +0 -26
  770. package/dist/chunk-KLYBSXHE.js +0 -3183
  771. package/dist/chunk-KPD6TBO4.js +0 -89
  772. package/dist/chunk-KTGKGHEA.js +0 -75
  773. package/dist/chunk-KUYQTNVT.js +0 -794
  774. package/dist/chunk-KZE7M52Y.js +0 -598
  775. package/dist/chunk-KZYZ3JHS.js +0 -112
  776. package/dist/chunk-L6WVCO6D.js +0 -61
  777. package/dist/chunk-L7T7M2P3.js +0 -5222
  778. package/dist/chunk-LKF6IPFC.js +0 -247
  779. package/dist/chunk-LLU7VKCZ.js +0 -188
  780. package/dist/chunk-LWEJGMVO.js +0 -50
  781. package/dist/chunk-LX5IEXDF.js +0 -505
  782. package/dist/chunk-LYEALWBN.js +0 -251
  783. package/dist/chunk-M722GGD3.js +0 -566
  784. package/dist/chunk-MCPKUVMQ.js +0 -99
  785. package/dist/chunk-MDGNCUAC.js +0 -145
  786. package/dist/chunk-MFLU3466.js +0 -99
  787. package/dist/chunk-MITT6IZG.js +0 -134
  788. package/dist/chunk-MN4LJYKQ.js +0 -608
  789. package/dist/chunk-MNCBL5AX.js +0 -449
  790. package/dist/chunk-MNCBL5AX.js.map +0 -1
  791. package/dist/chunk-MO3XJQN2.js +0 -629
  792. package/dist/chunk-MPP6BEAN.js +0 -158
  793. package/dist/chunk-MQRUZ2LW.js +0 -335
  794. package/dist/chunk-MRJFF5KY.js +0 -351
  795. package/dist/chunk-MUB44LD3.js +0 -75
  796. package/dist/chunk-MYDFABO6.js +0 -296
  797. package/dist/chunk-NJVHMK5R.js +0 -3158
  798. package/dist/chunk-NO6VQNWH.js +0 -396
  799. package/dist/chunk-NUF43R2F.js +0 -278
  800. package/dist/chunk-NUM3QV66.js +0 -107
  801. package/dist/chunk-NW4RPGET.js +0 -48
  802. package/dist/chunk-NZBZLY7H.js +0 -165
  803. package/dist/chunk-O664PL2U.js +0 -47
  804. package/dist/chunk-O664PL2U.js.map +0 -1
  805. package/dist/chunk-OCS3KIYC.js +0 -378
  806. package/dist/chunk-OKI45WHM.js +0 -311
  807. package/dist/chunk-ONF5M5GP.js +0 -283
  808. package/dist/chunk-OPCPBLHA.js +0 -79
  809. package/dist/chunk-OROXCA6L.js +0 -251
  810. package/dist/chunk-OTMJS3FV.js +0 -56
  811. package/dist/chunk-OXM267RC.js +0 -128
  812. package/dist/chunk-P5FLGDXW.js +0 -723
  813. package/dist/chunk-PC3FWPOP.js +0 -828
  814. package/dist/chunk-PPQJIVGM.js +0 -175
  815. package/dist/chunk-PQOVMZI2.js +0 -372
  816. package/dist/chunk-PVGD2RAV.js +0 -5926
  817. package/dist/chunk-PVGD2RAV.js.map +0 -1
  818. package/dist/chunk-PYU7CLEG.js +0 -215
  819. package/dist/chunk-Q2N5UR7Q.js +0 -505
  820. package/dist/chunk-Q4GB2QU3.js +0 -199
  821. package/dist/chunk-Q4RJKXQM.js +0 -606
  822. package/dist/chunk-Q4ZNRQKH.js +0 -196
  823. package/dist/chunk-Q7QXSQ46.js +0 -1185
  824. package/dist/chunk-QAVSUXLA.js +0 -773
  825. package/dist/chunk-QBJDMSFA.js +0 -27
  826. package/dist/chunk-QCB3WNCA.js +0 -176
  827. package/dist/chunk-QIOIJ7K5.js +0 -162
  828. package/dist/chunk-QR72J6WR.js +0 -650
  829. package/dist/chunk-QUTMVW4P.js +0 -141
  830. package/dist/chunk-QUXQYYZO.js +0 -73
  831. package/dist/chunk-RDHK2NYW.js +0 -129
  832. package/dist/chunk-RFBYAUZH.js +0 -311
  833. package/dist/chunk-RFBYAUZH.js.map +0 -1
  834. package/dist/chunk-RGCCRYTY.js +0 -46
  835. package/dist/chunk-RSTS3RWN.js +0 -211
  836. package/dist/chunk-RY7YRYVT.js +0 -126
  837. package/dist/chunk-S4LRL5BA.js +0 -439
  838. package/dist/chunk-S62CVC5C.js +0 -850
  839. package/dist/chunk-S62CVC5C.js.map +0 -1
  840. package/dist/chunk-SHVW3C3Y.js +0 -50
  841. package/dist/chunk-SL4CLUHR.js +0 -48
  842. package/dist/chunk-SOPKVWZJ.js +0 -1187
  843. package/dist/chunk-ST3H53IJ.js +0 -201
  844. package/dist/chunk-SYYFA7W7.js +0 -23
  845. package/dist/chunk-TBUWK3RP.js +0 -399
  846. package/dist/chunk-TC42NAIJ.js +0 -177
  847. package/dist/chunk-TJBTP6LH.js +0 -297
  848. package/dist/chunk-TQQALBLU.js +0 -391
  849. package/dist/chunk-TW56PZBB.js +0 -407
  850. package/dist/chunk-U6XRXK2T.js +0 -1356
  851. package/dist/chunk-U735UBHS.js +0 -2431
  852. package/dist/chunk-U735UBHS.js.map +0 -1
  853. package/dist/chunk-UAKG7GLE.js +0 -155
  854. package/dist/chunk-UB4GKFCI.js +0 -1095
  855. package/dist/chunk-UEAAF27Y.js +0 -108
  856. package/dist/chunk-UITWSZH3.js +0 -162
  857. package/dist/chunk-UQ67SEGH.js +0 -234
  858. package/dist/chunk-URSNCM57.js +0 -37
  859. package/dist/chunk-V77BSX2F.js +0 -1152
  860. package/dist/chunk-VATOL3OZ.js +0 -110
  861. package/dist/chunk-VEJG6GQQ.js +0 -103
  862. package/dist/chunk-VFQZPHZR.js +0 -436
  863. package/dist/chunk-VFZJV26C.js +0 -41
  864. package/dist/chunk-VJZPVP6C.js +0 -230
  865. package/dist/chunk-VQL7FHIF.js +0 -27
  866. package/dist/chunk-VSS6LRAK.js +0 -263
  867. package/dist/chunk-VSSXDLO3.js +0 -467
  868. package/dist/chunk-VVCKB62D.js +0 -1024
  869. package/dist/chunk-VVJDYTD4.js +0 -168
  870. package/dist/chunk-VVXOG3ZC.js +0 -52
  871. package/dist/chunk-W2EX346X.js +0 -85
  872. package/dist/chunk-W3R4C7Z2.js +0 -166
  873. package/dist/chunk-W43FINJV.js +0 -218
  874. package/dist/chunk-W6PJWSZ6.js +0 -1769
  875. package/dist/chunk-WCP32H3P.js +0 -2984
  876. package/dist/chunk-WKELNNIG.js +0 -3690
  877. package/dist/chunk-WRFXCMRW.js +0 -2591
  878. package/dist/chunk-WRLEHV4A.js +0 -386
  879. package/dist/chunk-WTNQHM6Q.js +0 -43
  880. package/dist/chunk-WTZ6OJUY.js +0 -3070
  881. package/dist/chunk-WVFMFQRZ.js +0 -256
  882. package/dist/chunk-WVFMFQRZ.js.map +0 -1
  883. package/dist/chunk-WYIC3CXE.js +0 -157
  884. package/dist/chunk-WZABXFUL.js +0 -246
  885. package/dist/chunk-WZABXFUL.js.map +0 -1
  886. package/dist/chunk-X3GBTLKD.js +0 -175
  887. package/dist/chunk-XBOLFS6I.js +0 -532
  888. package/dist/chunk-XF4UH54P.js +0 -250
  889. package/dist/chunk-XHPBQTJP.js +0 -1260
  890. package/dist/chunk-XQ4TJITR.js +0 -270
  891. package/dist/chunk-XRFMGLCE.js +0 -466
  892. package/dist/chunk-XV2F7PGS.js +0 -236
  893. package/dist/chunk-Y2EQTW5Q.js +0 -100
  894. package/dist/chunk-YAOXCAQD.js +0 -371
  895. package/dist/chunk-YCDB3HPS.js +0 -137
  896. package/dist/chunk-YCONEOZQ.js +0 -191
  897. package/dist/chunk-YG243U6J.js +0 -158
  898. package/dist/chunk-YGQANOSV.js +0 -113
  899. package/dist/chunk-YKRWKRNX.js +0 -138
  900. package/dist/chunk-YKT5NYYJ.js +0 -3996
  901. package/dist/chunk-YKT5NYYJ.js.map +0 -1
  902. package/dist/chunk-YLWABUFE.js +0 -406
  903. package/dist/chunk-YOKIE7NG.js +0 -227
  904. package/dist/chunk-YRCDL3GO.js +0 -2582
  905. package/dist/chunk-YVBAYE7Y.js +0 -1236
  906. package/dist/chunk-YYKPRX4P.js +0 -29
  907. package/dist/chunk-Z4MW635R.js +0 -849
  908. package/dist/chunk-Z7IPPKG6.js +0 -403
  909. package/dist/chunk-ZFGXQ54H.js +0 -114
  910. package/dist/chunk-ZGBXHHCL.js +0 -373
  911. package/dist/computer-viewer-AVH5J4TC.js +0 -21
  912. package/dist/connection-step-up-T2B25VP7.js +0 -148
  913. package/dist/connection-step-up-T2B25VP7.js.map +0 -1
  914. package/dist/embedded-new-voice-M6PBWMQZ.js +0 -25
  915. package/dist/embedded-voice-7USALJKI.js +0 -25
  916. package/dist/fleet-decision-row-XY6OZPHA.js +0 -361
  917. package/dist/model-policy-picker-menu-S5RTVLMQ.js +0 -23
  918. package/dist/payment-page-card-XSY5NO7D.js +0 -227
  919. package/dist/platform-activity-row-77WER5O3.js +0 -156
  920. package/dist/queue-surface-implementation-SDV7I32L.js +0 -933
  921. package/dist/recorder-host-7GNQG6BB.js +0 -80
  922. package/dist/sandbox-files-JOH2Q57T.js +0 -29
  923. package/dist/session-connect-cards-HZIR4ZWT.js +0 -28
  924. package/dist/session-realtime-OPCPTIAP.js +0 -30
  925. package/dist/timeline-annotation-markers-WXCRA4BY.js +0 -157
  926. package/dist/timeline-annotation-selection-YBZQNCNX.js +0 -208
  927. package/dist/timeline-annotations-dialog-4WVXTKFW.js +0 -283
  928. /package/dist/{browser-viewer-KFMM5S2B.js.map → browser-viewer-TRPZI6NT.js.map} +0 -0
  929. /package/dist/{chat-interactive-block-5DJ72HU7.js.map → chat-interactive-block-Y4BS4JCM.js.map} +0 -0
  930. /package/dist/{chunk-CRBHMSAP.js.map → chunk-22E2YJHT.js.map} +0 -0
  931. /package/dist/{chunk-H3EP6GNA.js.map → chunk-2T6TN2YL.js.map} +0 -0
  932. /package/dist/{chunk-KBDWMUYA.js.map → chunk-2WNN26NW.js.map} +0 -0
  933. /package/dist/{chunk-HJ2J2XQI.js.map → chunk-3432A6XB.js.map} +0 -0
  934. /package/dist/{chunk-DA7XLT5F.js.map → chunk-35U7NSOR.js.map} +0 -0
  935. /package/dist/{chunk-QAVSUXLA.js.map → chunk-3EPR76WS.js.map} +0 -0
  936. /package/dist/{chunk-JV2TJLUW.js.map → chunk-3FXXEU5D.js.map} +0 -0
  937. /package/dist/{chunk-QR72J6WR.js.map → chunk-3MXOPOEU.js.map} +0 -0
  938. /package/dist/{chunk-76NGRVCY.js.map → chunk-3PKDU4JI.js.map} +0 -0
  939. /package/dist/{chunk-BO3D22BS.js.map → chunk-3PMO2BIV.js.map} +0 -0
  940. /package/dist/{chunk-SL4CLUHR.js.map → chunk-3XWHJNFY.js.map} +0 -0
  941. /package/dist/{chunk-EGD5RPRX.js.map → chunk-45WD2PKE.js.map} +0 -0
  942. /package/dist/{chunk-KZE7M52Y.js.map → chunk-4H2OWNRA.js.map} +0 -0
  943. /package/dist/{chunk-VSS6LRAK.js.map → chunk-4HVGOTMU.js.map} +0 -0
  944. /package/dist/{chunk-4ECOHGUL.js.map → chunk-4JER2ZMV.js.map} +0 -0
  945. /package/dist/{chunk-HZE6V7GW.js.map → chunk-4LVZ2VOQ.js.map} +0 -0
  946. /package/dist/{chunk-B6AH43UQ.js.map → chunk-4OGDD2EM.js.map} +0 -0
  947. /package/dist/{chunk-4UZE7ZT4.js.map → chunk-4PQC6WMF.js.map} +0 -0
  948. /package/dist/{chunk-KUYQTNVT.js.map → chunk-4UVSWAT3.js.map} +0 -0
  949. /package/dist/{chunk-BTMSR4OA.js.map → chunk-53A47RBX.js.map} +0 -0
  950. /package/dist/{chunk-57QWSJLX.js.map → chunk-552KKENW.js.map} +0 -0
  951. /package/dist/{chunk-TC42NAIJ.js.map → chunk-55F7L6M3.js.map} +0 -0
  952. /package/dist/{chunk-FXFOKD7A.js.map → chunk-5AHIKB3O.js.map} +0 -0
  953. /package/dist/{chunk-Q4GB2QU3.js.map → chunk-5N4L5WTE.js.map} +0 -0
  954. /package/dist/{chunk-4327UGUS.js.map → chunk-5OUJCVZI.js.map} +0 -0
  955. /package/dist/{chunk-GTGPKGWC.js.map → chunk-5OYXQ7MH.js.map} +0 -0
  956. /package/dist/{chunk-2ZR75AUO.js.map → chunk-5TAVVMFX.js.map} +0 -0
  957. /package/dist/{chunk-2YJS75C3.js.map → chunk-5Y3LYRNH.js.map} +0 -0
  958. /package/dist/{chunk-WRLEHV4A.js.map → chunk-5ZJKKE4T.js.map} +0 -0
  959. /package/dist/{chunk-2JTZMHQK.js.map → chunk-62DPSQRZ.js.map} +0 -0
  960. /package/dist/{chunk-MN4LJYKQ.js.map → chunk-64KMWTJ6.js.map} +0 -0
  961. /package/dist/{chunk-QUXQYYZO.js.map → chunk-6MZBNUS7.js.map} +0 -0
  962. /package/dist/{chunk-XF4UH54P.js.map → chunk-6YCE4ZC4.js.map} +0 -0
  963. /package/dist/{chunk-X3GBTLKD.js.map → chunk-6YROWWMX.js.map} +0 -0
  964. /package/dist/{chunk-YVBAYE7Y.js.map → chunk-73RZ72VU.js.map} +0 -0
  965. /package/dist/{chunk-5VPQVMJI.js.map → chunk-74KV436L.js.map} +0 -0
  966. /package/dist/{chunk-CSK2WOOX.js.map → chunk-7HKGLPV5.js.map} +0 -0
  967. /package/dist/{chunk-XRFMGLCE.js.map → chunk-7JSWODT6.js.map} +0 -0
  968. /package/dist/{chunk-EFKWOXBP.js.map → chunk-7K3PKWER.js.map} +0 -0
  969. /package/dist/{chunk-U6XRXK2T.js.map → chunk-7MPWC42V.js.map} +0 -0
  970. /package/dist/{chunk-QUTMVW4P.js.map → chunk-7REO6FRN.js.map} +0 -0
  971. /package/dist/{chunk-MDGNCUAC.js.map → chunk-7YMWRNRQ.js.map} +0 -0
  972. /package/dist/{chunk-JJKUERR4.js.map → chunk-A6H3KJ7G.js.map} +0 -0
  973. /package/dist/{chunk-W6PJWSZ6.js.map → chunk-AGQIE6YU.js.map} +0 -0
  974. /package/dist/{chunk-ZGBXHHCL.js.map → chunk-AHQM4I5V.js.map} +0 -0
  975. /package/dist/{chunk-HLLZPULI.js.map → chunk-AMTRO7XF.js.map} +0 -0
  976. /package/dist/{chunk-6S2XVKNI.js.map → chunk-AO4LTCG7.js.map} +0 -0
  977. /package/dist/{chunk-CTBPPPLR.js.map → chunk-APJ22OZV.js.map} +0 -0
  978. /package/dist/{chunk-TW56PZBB.js.map → chunk-APWL37KW.js.map} +0 -0
  979. /package/dist/{chunk-DIHPR5KJ.js.map → chunk-AQEJOBQ2.js.map} +0 -0
  980. /package/dist/{chunk-HD2MCYQF.js.map → chunk-ARKNT6BX.js.map} +0 -0
  981. /package/dist/{chunk-RSTS3RWN.js.map → chunk-B2IHDMAR.js.map} +0 -0
  982. /package/dist/{chunk-KZYZ3JHS.js.map → chunk-BCKIV26W.js.map} +0 -0
  983. /package/dist/{chunk-D5K2BS5Q.js.map → chunk-BE26JUSD.js.map} +0 -0
  984. /package/dist/{chunk-DRAG2LZP.js.map → chunk-BOVCD6KD.js.map} +0 -0
  985. /package/dist/{chunk-IIWNSYFA.js.map → chunk-BQWV66A6.js.map} +0 -0
  986. /package/dist/{chunk-BJ3WRO2K.js.map → chunk-BSQJXGGP.js.map} +0 -0
  987. /package/dist/{chunk-KLYBSXHE.js.map → chunk-BZY3MEVZ.js.map} +0 -0
  988. /package/dist/{chunk-MQRUZ2LW.js.map → chunk-C3D3OOEY.js.map} +0 -0
  989. /package/dist/{chunk-GY6DSWBM.js.map → chunk-CDHYO3DP.js.map} +0 -0
  990. /package/dist/{chunk-OPCPBLHA.js.map → chunk-CDV5JGVI.js.map} +0 -0
  991. /package/dist/{chunk-5WJCOFIU.js.map → chunk-CNW45M7G.js.map} +0 -0
  992. /package/dist/{chunk-A2OMNLDF.js.map → chunk-CUVQ37HB.js.map} +0 -0
  993. /package/dist/{chunk-XBOLFS6I.js.map → chunk-D32T3IIC.js.map} +0 -0
  994. /package/dist/{chunk-YAOXCAQD.js.map → chunk-D65BSM64.js.map} +0 -0
  995. /package/dist/{chunk-CNNOPEAK.js.map → chunk-D7435DWV.js.map} +0 -0
  996. /package/dist/{chunk-32LD46VC.js.map → chunk-DFH3M7B3.js.map} +0 -0
  997. /package/dist/{chunk-QIOIJ7K5.js.map → chunk-DGWBQ76M.js.map} +0 -0
  998. /package/dist/{chunk-PQOVMZI2.js.map → chunk-DHJDTGSJ.js.map} +0 -0
  999. /package/dist/{chunk-4XQH4XPP.js.map → chunk-DKEFTNCD.js.map} +0 -0
  1000. /package/dist/{chunk-JIZWFW5A.js.map → chunk-DNAF6MT4.js.map} +0 -0
  1001. /package/dist/{chunk-QBJDMSFA.js.map → chunk-E35XY7DS.js.map} +0 -0
  1002. /package/dist/{chunk-NO6VQNWH.js.map → chunk-E5T5WIIP.js.map} +0 -0
  1003. /package/dist/{chunk-W3R4C7Z2.js.map → chunk-EL6ECD34.js.map} +0 -0
  1004. /package/dist/{chunk-VSSXDLO3.js.map → chunk-ELR6ITRC.js.map} +0 -0
  1005. /package/dist/{chunk-7TLYFHMT.js.map → chunk-EPE3V2VE.js.map} +0 -0
  1006. /package/dist/{chunk-2B3RQRNQ.js.map → chunk-EYGQHHVW.js.map} +0 -0
  1007. /package/dist/{chunk-2VK7FJNR.js.map → chunk-EYQEJHYP.js.map} +0 -0
  1008. /package/dist/{chunk-BIXGAYDJ.js.map → chunk-EZTH2XMH.js.map} +0 -0
  1009. /package/dist/{chunk-6PHBW7SS.js.map → chunk-F3QVHVFS.js.map} +0 -0
  1010. /package/dist/{chunk-SOPKVWZJ.js.map → chunk-F5VWPREQ.js.map} +0 -0
  1011. /package/dist/{chunk-YGQANOSV.js.map → chunk-FM7AQUBL.js.map} +0 -0
  1012. /package/dist/{chunk-Y2EQTW5Q.js.map → chunk-FP6BUXJM.js.map} +0 -0
  1013. /package/dist/{chunk-45TILHFZ.js.map → chunk-FVU52L3I.js.map} +0 -0
  1014. /package/dist/{chunk-W43FINJV.js.map → chunk-FZKNXNNO.js.map} +0 -0
  1015. /package/dist/{chunk-XV2F7PGS.js.map → chunk-G3IXJWRY.js.map} +0 -0
  1016. /package/dist/{chunk-DC6KFW2R.js.map → chunk-G6EI2O3N.js.map} +0 -0
  1017. /package/dist/{chunk-2GXAXCS2.js.map → chunk-GB5T6YMZ.js.map} +0 -0
  1018. /package/dist/{chunk-WYIC3CXE.js.map → chunk-GBLD6FOG.js.map} +0 -0
  1019. /package/dist/{chunk-YCDB3HPS.js.map → chunk-GJBFFXCY.js.map} +0 -0
  1020. /package/dist/{chunk-APNPWJCK.js.map → chunk-GJDP2K2S.js.map} +0 -0
  1021. /package/dist/{chunk-GFTV3RR6.js.map → chunk-GP26XTDX.js.map} +0 -0
  1022. /package/dist/{chunk-Q4RJKXQM.js.map → chunk-GTE6WP4N.js.map} +0 -0
  1023. /package/dist/{chunk-UEAAF27Y.js.map → chunk-GWG3OAV7.js.map} +0 -0
  1024. /package/dist/{chunk-6LYBRPUG.js.map → chunk-GXMHTMM6.js.map} +0 -0
  1025. /package/dist/{chunk-NUM3QV66.js.map → chunk-GYRN5O2E.js.map} +0 -0
  1026. /package/dist/{chunk-G4E5WKY7.js.map → chunk-GZX7W2WW.js.map} +0 -0
  1027. /package/dist/{chunk-Z7IPPKG6.js.map → chunk-H3QI2G2B.js.map} +0 -0
  1028. /package/dist/{chunk-Z4MW635R.js.map → chunk-H7D4DVWY.js.map} +0 -0
  1029. /package/dist/{chunk-YCONEOZQ.js.map → chunk-HCDGBBBJ.js.map} +0 -0
  1030. /package/dist/{chunk-DLMYANZX.js.map → chunk-HDSH6MIJ.js.map} +0 -0
  1031. /package/dist/{chunk-KPD6TBO4.js.map → chunk-HOEUPZ6O.js.map} +0 -0
  1032. /package/dist/{chunk-7VDWXFTL.js.map → chunk-HPQRWTQB.js.map} +0 -0
  1033. /package/dist/{chunk-GIHE7U3Y.js.map → chunk-HUKGLWAY.js.map} +0 -0
  1034. /package/dist/{chunk-SYYFA7W7.js.map → chunk-HUTQJY3F.js.map} +0 -0
  1035. /package/dist/{chunk-62T2ZPD5.js.map → chunk-HWOYJOKK.js.map} +0 -0
  1036. /package/dist/{chunk-IN2ZJR2A.js.map → chunk-HZR3WGUP.js.map} +0 -0
  1037. /package/dist/{chunk-YKRWKRNX.js.map → chunk-I7YUDPDR.js.map} +0 -0
  1038. /package/dist/{chunk-VQL7FHIF.js.map → chunk-IDII52M4.js.map} +0 -0
  1039. /package/dist/{chunk-HPYQ5MES.js.map → chunk-IDPWEUM7.js.map} +0 -0
  1040. /package/dist/{chunk-JL4PMUDG.js.map → chunk-IEWQFGEC.js.map} +0 -0
  1041. /package/dist/{chunk-MRJFF5KY.js.map → chunk-IMTACEXF.js.map} +0 -0
  1042. /package/dist/{chunk-2LRJ32SO.js.map → chunk-IVWT6M6N.js.map} +0 -0
  1043. /package/dist/{chunk-7RRDXPNC.js.map → chunk-JEUPIHIP.js.map} +0 -0
  1044. /package/dist/{chunk-VVJDYTD4.js.map → chunk-JF4WX3GQ.js.map} +0 -0
  1045. /package/dist/{chunk-WRFXCMRW.js.map → chunk-JJPYXUKC.js.map} +0 -0
  1046. /package/dist/{chunk-WTNQHM6Q.js.map → chunk-JNHWTYDD.js.map} +0 -0
  1047. /package/dist/{chunk-RGCCRYTY.js.map → chunk-JP7AOJWD.js.map} +0 -0
  1048. /package/dist/{chunk-TJBTP6LH.js.map → chunk-JTWT2WQA.js.map} +0 -0
  1049. /package/dist/{chunk-HJ2CDFZX.js.map → chunk-JW3WIHWO.js.map} +0 -0
  1050. /package/dist/{chunk-MITT6IZG.js.map → chunk-JW7RJMEZ.js.map} +0 -0
  1051. /package/dist/{chunk-CTOLX2EW.js.map → chunk-K76PXR3O.js.map} +0 -0
  1052. /package/dist/{chunk-CX3Z7W5Y.js.map → chunk-KCNIQN6V.js.map} +0 -0
  1053. /package/dist/{chunk-2YNEUYWM.js.map → chunk-KH6KHYST.js.map} +0 -0
  1054. /package/dist/{chunk-LKF6IPFC.js.map → chunk-KK4SEN7N.js.map} +0 -0
  1055. /package/dist/{chunk-63AVTSUI.js.map → chunk-KOKRGAAI.js.map} +0 -0
  1056. /package/dist/{chunk-F2JKNL73.js.map → chunk-KQFNTGAF.js.map} +0 -0
  1057. /package/dist/{chunk-SHVW3C3Y.js.map → chunk-KRLNC6TH.js.map} +0 -0
  1058. /package/dist/{chunk-MFLU3466.js.map → chunk-KYDLVMKA.js.map} +0 -0
  1059. /package/dist/{chunk-UAKG7GLE.js.map → chunk-KZQDP2JM.js.map} +0 -0
  1060. /package/dist/{chunk-FX343J2L.js.map → chunk-L2EZ2HOX.js.map} +0 -0
  1061. /package/dist/{chunk-GGBMQNAB.js.map → chunk-L2UAFR2D.js.map} +0 -0
  1062. /package/dist/{chunk-GT3FJVU6.js.map → chunk-L4R7ORMD.js.map} +0 -0
  1063. /package/dist/{chunk-YOKIE7NG.js.map → chunk-LCLWN64E.js.map} +0 -0
  1064. /package/dist/{chunk-PPQJIVGM.js.map → chunk-LFQI2C46.js.map} +0 -0
  1065. /package/dist/{chunk-KF65UG2L.js.map → chunk-LLYX4F5A.js.map} +0 -0
  1066. /package/dist/{chunk-PYU7CLEG.js.map → chunk-LQX5QCDS.js.map} +0 -0
  1067. /package/dist/{chunk-Q4ZNRQKH.js.map → chunk-LRMHASG2.js.map} +0 -0
  1068. /package/dist/{chunk-MO3XJQN2.js.map → chunk-M5FX5KH5.js.map} +0 -0
  1069. /package/dist/{chunk-ST3H53IJ.js.map → chunk-MLOTUQJJ.js.map} +0 -0
  1070. /package/dist/{chunk-A6Q6EUBR.js.map → chunk-MPUKGKXZ.js.map} +0 -0
  1071. /package/dist/{chunk-ONF5M5GP.js.map → chunk-MS6LW4VU.js.map} +0 -0
  1072. /package/dist/{chunk-NUF43R2F.js.map → chunk-MXPW4F74.js.map} +0 -0
  1073. /package/dist/{chunk-MPP6BEAN.js.map → chunk-MZ7GJX5S.js.map} +0 -0
  1074. /package/dist/{chunk-XHPBQTJP.js.map → chunk-N5OUIUYD.js.map} +0 -0
  1075. /package/dist/{chunk-EAXZSBWV.js.map → chunk-N6FNORC7.js.map} +0 -0
  1076. /package/dist/{chunk-4K5UVYZQ.js.map → chunk-NALVKY4U.js.map} +0 -0
  1077. /package/dist/{chunk-L7T7M2P3.js.map → chunk-NJ77ZL5T.js.map} +0 -0
  1078. /package/dist/{chunk-XQ4TJITR.js.map → chunk-NM2DNJDJ.js.map} +0 -0
  1079. /package/dist/{chunk-VATOL3OZ.js.map → chunk-NNKRRF7E.js.map} +0 -0
  1080. /package/dist/{chunk-4AUSS7CX.js.map → chunk-NP5UFWU4.js.map} +0 -0
  1081. /package/dist/{chunk-HFROJDFQ.js.map → chunk-NV3AEIFO.js.map} +0 -0
  1082. /package/dist/{chunk-PC3FWPOP.js.map → chunk-O6JDF7KH.js.map} +0 -0
  1083. /package/dist/{chunk-OROXCA6L.js.map → chunk-OERZH3J4.js.map} +0 -0
  1084. /package/dist/{chunk-V77BSX2F.js.map → chunk-OKHWTWWU.js.map} +0 -0
  1085. /package/dist/{chunk-C22UPHA2.js.map → chunk-OLAIUVGT.js.map} +0 -0
  1086. /package/dist/{chunk-C2F6SKOS.js.map → chunk-OO36IUMS.js.map} +0 -0
  1087. /package/dist/{chunk-IZA2KBYK.js.map → chunk-OVDK7K2Z.js.map} +0 -0
  1088. /package/dist/{chunk-FQ33JHJN.js.map → chunk-OX5ZCHZQ.js.map} +0 -0
  1089. /package/dist/{chunk-FY42DW2R.js.map → chunk-P6LLCGPO.js.map} +0 -0
  1090. /package/dist/{chunk-LX5IEXDF.js.map → chunk-PA2CUHTD.js.map} +0 -0
  1091. /package/dist/{chunk-HE4VN5D3.js.map → chunk-PB4CQIRA.js.map} +0 -0
  1092. /package/dist/{chunk-M722GGD3.js.map → chunk-PBV2P632.js.map} +0 -0
  1093. /package/dist/{chunk-KTGKGHEA.js.map → chunk-PCSRHFRF.js.map} +0 -0
  1094. /package/dist/{chunk-VFQZPHZR.js.map → chunk-PEPWW5BC.js.map} +0 -0
  1095. /package/dist/{chunk-6CDBX3XG.js.map → chunk-PMBZMVKE.js.map} +0 -0
  1096. /package/dist/{chunk-4Z7BPBS7.js.map → chunk-PP32RE26.js.map} +0 -0
  1097. /package/dist/{chunk-6VEIDSF4.js.map → chunk-PTXAPI3Q.js.map} +0 -0
  1098. /package/dist/{chunk-OTMJS3FV.js.map → chunk-PULNNF7G.js.map} +0 -0
  1099. /package/dist/{chunk-YG243U6J.js.map → chunk-Q6KNROUT.js.map} +0 -0
  1100. /package/dist/{chunk-EZ5ZBOGQ.js.map → chunk-QGJIFIKN.js.map} +0 -0
  1101. /package/dist/{chunk-VFZJV26C.js.map → chunk-QKKKORGL.js.map} +0 -0
  1102. /package/dist/{chunk-W2EX346X.js.map → chunk-QKUMMG6P.js.map} +0 -0
  1103. /package/dist/{chunk-BVZYHORS.js.map → chunk-QNOWKKZ4.js.map} +0 -0
  1104. /package/dist/{chunk-3FVVZW7J.js.map → chunk-QSWD3AHE.js.map} +0 -0
  1105. /package/dist/{chunk-7FFZLLCH.js.map → chunk-QZ4U2VL5.js.map} +0 -0
  1106. /package/dist/{chunk-IIMRBCA4.js.map → chunk-QZJNCLHV.js.map} +0 -0
  1107. /package/dist/{chunk-6D3D2JWY.js.map → chunk-R6CFPY3F.js.map} +0 -0
  1108. /package/dist/{chunk-YLWABUFE.js.map → chunk-R6QRUYUH.js.map} +0 -0
  1109. /package/dist/{chunk-WCP32H3P.js.map → chunk-RE3GAQI5.js.map} +0 -0
  1110. /package/dist/{chunk-JG7MEMJP.js.map → chunk-RFHUVPFA.js.map} +0 -0
  1111. /package/dist/{chunk-WKELNNIG.js.map → chunk-RH45HT5T.js.map} +0 -0
  1112. /package/dist/{chunk-S4LRL5BA.js.map → chunk-RJNQTZ5O.js.map} +0 -0
  1113. /package/dist/{chunk-URSNCM57.js.map → chunk-S2BJTAAB.js.map} +0 -0
  1114. /package/dist/{chunk-AJSRYRJS.js.map → chunk-S56PWXIX.js.map} +0 -0
  1115. /package/dist/{chunk-FAB5SXNO.js.map → chunk-S6FFDIHD.js.map} +0 -0
  1116. /package/dist/{chunk-56NHT2TZ.js.map → chunk-S6MAMIK2.js.map} +0 -0
  1117. /package/dist/{chunk-OKI45WHM.js.map → chunk-SERTO6H6.js.map} +0 -0
  1118. /package/dist/{chunk-I5DW76GB.js.map → chunk-STOOH7EI.js.map} +0 -0
  1119. /package/dist/{chunk-I7MZOZGC.js.map → chunk-SWSTEUXX.js.map} +0 -0
  1120. /package/dist/{chunk-JFEAJRG6.js.map → chunk-SWZN7NNZ.js.map} +0 -0
  1121. /package/dist/{chunk-ARNQH2XE.js.map → chunk-SYDF57KS.js.map} +0 -0
  1122. /package/dist/{chunk-YYKPRX4P.js.map → chunk-T275CUVD.js.map} +0 -0
  1123. /package/dist/{chunk-OCS3KIYC.js.map → chunk-T4OT7QWP.js.map} +0 -0
  1124. /package/dist/{chunk-YRCDL3GO.js.map → chunk-TCSRY2NP.js.map} +0 -0
  1125. /package/dist/{chunk-ELC2ZPHI.js.map → chunk-TCX5OA2X.js.map} +0 -0
  1126. /package/dist/{chunk-NJVHMK5R.js.map → chunk-TDW5CSO5.js.map} +0 -0
  1127. /package/dist/{chunk-MCPKUVMQ.js.map → chunk-TGG3ODCS.js.map} +0 -0
  1128. /package/dist/{chunk-Q2N5UR7Q.js.map → chunk-TILSTYUC.js.map} +0 -0
  1129. /package/dist/{chunk-4FKE42TW.js.map → chunk-TJ5DYWXU.js.map} +0 -0
  1130. /package/dist/{chunk-TQQALBLU.js.map → chunk-TNRI4ZE6.js.map} +0 -0
  1131. /package/dist/{chunk-LLU7VKCZ.js.map → chunk-TPIFVUMF.js.map} +0 -0
  1132. /package/dist/{chunk-UITWSZH3.js.map → chunk-TSW6OF22.js.map} +0 -0
  1133. /package/dist/{chunk-UB4GKFCI.js.map → chunk-TTSTBHGR.js.map} +0 -0
  1134. /package/dist/{chunk-HVGM5IME.js.map → chunk-U3JYAWMR.js.map} +0 -0
  1135. /package/dist/{chunk-GGU7KV4G.js.map → chunk-U7ODSHA5.js.map} +0 -0
  1136. /package/dist/{chunk-NW4RPGET.js.map → chunk-UEGEPRNP.js.map} +0 -0
  1137. /package/dist/{chunk-2DA7DTHO.js.map → chunk-UGIA2YEJ.js.map} +0 -0
  1138. /package/dist/{chunk-5AGRFQSH.js.map → chunk-UHLKKDNF.js.map} +0 -0
  1139. /package/dist/{chunk-KJI2DVSO.js.map → chunk-ULVXKIPX.js.map} +0 -0
  1140. /package/dist/{chunk-56KVDNOS.js.map → chunk-USUDKZ5G.js.map} +0 -0
  1141. /package/dist/{chunk-CC4JBFWY.js.map → chunk-UVO6I2F6.js.map} +0 -0
  1142. /package/dist/{chunk-BR62BHVY.js.map → chunk-V6NVG4K2.js.map} +0 -0
  1143. /package/dist/{chunk-Q7QXSQ46.js.map → chunk-VCMQFD3G.js.map} +0 -0
  1144. /package/dist/{chunk-CVDY7P3E.js.map → chunk-VKPBDNIO.js.map} +0 -0
  1145. /package/dist/{chunk-L6WVCO6D.js.map → chunk-VLDKWGHD.js.map} +0 -0
  1146. /package/dist/{chunk-IUPIJWFK.js.map → chunk-VM2NA2EL.js.map} +0 -0
  1147. /package/dist/{chunk-6JGMBTXP.js.map → chunk-VMZTCVEL.js.map} +0 -0
  1148. /package/dist/{chunk-CG2HT7TI.js.map → chunk-VQH5AXZY.js.map} +0 -0
  1149. /package/dist/{chunk-ZFGXQ54H.js.map → chunk-VTBTW6N4.js.map} +0 -0
  1150. /package/dist/{chunk-VJZPVP6C.js.map → chunk-VV7PLDX4.js.map} +0 -0
  1151. /package/dist/{chunk-LWEJGMVO.js.map → chunk-VYGGLH5H.js.map} +0 -0
  1152. /package/dist/{chunk-KFYLTQGK.js.map → chunk-VYQHHTQ4.js.map} +0 -0
  1153. /package/dist/{chunk-IB2EX6GX.js.map → chunk-VYSGRD2W.js.map} +0 -0
  1154. /package/dist/{chunk-5JMX5FRF.js.map → chunk-W4W63LTP.js.map} +0 -0
  1155. /package/dist/{chunk-HRLJNDDC.js.map → chunk-WHTRR66J.js.map} +0 -0
  1156. /package/dist/{chunk-BWBBS6HJ.js.map → chunk-WICIQFHJ.js.map} +0 -0
  1157. /package/dist/{chunk-CDB66JAO.js.map → chunk-WJYYMCCC.js.map} +0 -0
  1158. /package/dist/{chunk-TBUWK3RP.js.map → chunk-WSJOWQJE.js.map} +0 -0
  1159. /package/dist/{chunk-C2EERTYX.js.map → chunk-WYDUXZ2R.js.map} +0 -0
  1160. /package/dist/{chunk-E2SGFW2B.js.map → chunk-X62CN4YR.js.map} +0 -0
  1161. /package/dist/{chunk-VVCKB62D.js.map → chunk-XFQHKMO6.js.map} +0 -0
  1162. /package/dist/{chunk-IZZINUFM.js.map → chunk-XGJ7XZHS.js.map} +0 -0
  1163. /package/dist/{chunk-P5FLGDXW.js.map → chunk-XJFJNOEV.js.map} +0 -0
  1164. /package/dist/{chunk-UQ67SEGH.js.map → chunk-XKJLHMXZ.js.map} +0 -0
  1165. /package/dist/{chunk-VEJG6GQQ.js.map → chunk-XLFPJVQS.js.map} +0 -0
  1166. /package/dist/{chunk-RDHK2NYW.js.map → chunk-XM4ZLZFW.js.map} +0 -0
  1167. /package/dist/{chunk-6TWS6AXT.js.map → chunk-Y2GAWEJD.js.map} +0 -0
  1168. /package/dist/{chunk-MYDFABO6.js.map → chunk-Y3A74SVK.js.map} +0 -0
  1169. /package/dist/{chunk-C625ODRG.js.map → chunk-YANEVGI3.js.map} +0 -0
  1170. /package/dist/{chunk-OXM267RC.js.map → chunk-YHHSO5QR.js.map} +0 -0
  1171. /package/dist/{chunk-VVXOG3ZC.js.map → chunk-YOSOCHCB.js.map} +0 -0
  1172. /package/dist/{chunk-HHFFPE67.js.map → chunk-YP4SNX4P.js.map} +0 -0
  1173. /package/dist/{chunk-QCB3WNCA.js.map → chunk-YQH6AMIH.js.map} +0 -0
  1174. /package/dist/{chunk-NZBZLY7H.js.map → chunk-YRWL2IAE.js.map} +0 -0
  1175. /package/dist/{chunk-LYEALWBN.js.map → chunk-YTWRQ3WK.js.map} +0 -0
  1176. /package/dist/{chunk-7V2CQLTN.js.map → chunk-YV5GGSLK.js.map} +0 -0
  1177. /package/dist/{chunk-RY7YRYVT.js.map → chunk-YXUDK37V.js.map} +0 -0
  1178. /package/dist/{chunk-MUB44LD3.js.map → chunk-YYM5TSCR.js.map} +0 -0
  1179. /package/dist/{chunk-JTWK3VE7.js.map → chunk-ZG2CKFQF.js.map} +0 -0
  1180. /package/dist/{chunk-5UTHPGFF.js.map → chunk-ZGJXO2HH.js.map} +0 -0
  1181. /package/dist/{chunk-WTZ6OJUY.js.map → chunk-ZGV76PZ4.js.map} +0 -0
  1182. /package/dist/{chunk-A3QEJ2IZ.js.map → chunk-ZOBUR2VC.js.map} +0 -0
  1183. /package/dist/{computer-viewer-AVH5J4TC.js.map → computer-viewer-S6AL3XDT.js.map} +0 -0
  1184. /package/dist/{embedded-new-voice-M6PBWMQZ.js.map → embedded-new-voice-T3BXRYJX.js.map} +0 -0
  1185. /package/dist/{embedded-voice-7USALJKI.js.map → embedded-voice-ZJXMF3RP.js.map} +0 -0
  1186. /package/dist/{fleet-decision-row-XY6OZPHA.js.map → fleet-decision-row-AUCMLBCV.js.map} +0 -0
  1187. /package/dist/{model-policy-picker-menu-S5RTVLMQ.js.map → model-policy-picker-menu-TO57YUQ6.js.map} +0 -0
  1188. /package/dist/{payment-page-card-XSY5NO7D.js.map → payment-page-card-DFGDAMTG.js.map} +0 -0
  1189. /package/dist/{platform-activity-row-77WER5O3.js.map → platform-activity-row-ZMBEJGXN.js.map} +0 -0
  1190. /package/dist/{queue-surface-implementation-SDV7I32L.js.map → queue-surface-implementation-KDK5CYH6.js.map} +0 -0
  1191. /package/dist/{recorder-host-7GNQG6BB.js.map → recorder-host-3HLYRL4H.js.map} +0 -0
  1192. /package/dist/{sandbox-files-JOH2Q57T.js.map → sandbox-files-UOZ4OJZU.js.map} +0 -0
  1193. /package/dist/{session-connect-cards-HZIR4ZWT.js.map → session-connect-cards-VZIYLH45.js.map} +0 -0
  1194. /package/dist/{session-realtime-OPCPTIAP.js.map → session-realtime-2ZGJWVZP.js.map} +0 -0
  1195. /package/dist/{timeline-annotation-markers-WXCRA4BY.js.map → timeline-annotation-markers-KBTFWLME.js.map} +0 -0
  1196. /package/dist/{timeline-annotation-selection-YBZQNCNX.js.map → timeline-annotation-selection-VI4YSDR5.js.map} +0 -0
  1197. /package/dist/{timeline-annotations-dialog-4WVXTKFW.js.map → timeline-annotations-dialog-4PLWNLRB.js.map} +0 -0
@@ -0,0 +1,3321 @@
1
+ "use client";
2
+ import {
3
+ useCalmServiceFailure
4
+ } from "./chunk-SVKPSCTH.js";
5
+ import {
6
+ OPEN_WORKSTREAM_CONTROL_EVENT
7
+ } from "./chunk-3IWPC6O3.js";
8
+ import {
9
+ COMPOSER_VOICE_INPUT_START_EVENT,
10
+ ComposerFooterSignalProvider,
11
+ composerVoiceEventScope,
12
+ useComposerFooterSignal,
13
+ useComposerFooterSignalState
14
+ } from "./chunk-6F34IWSA.js";
15
+ import {
16
+ shouldRecallQueuedOnKey
17
+ } from "./chunk-2NPJEEJ5.js";
18
+ import {
19
+ readStoredFilePreviewUrl,
20
+ useStoredFiles
21
+ } from "./chunk-PSXDRW2R.js";
22
+ import {
23
+ shouldSteerOnKey,
24
+ shouldSubmitOnKey
25
+ } from "./chunk-TDW5CSO5.js";
26
+ import {
27
+ OPENGENI_UPDATING_ACTION_NOTICE,
28
+ OPENGENI_UPDATING_NOTICE,
29
+ isActionFailure
30
+ } from "./chunk-5AIMVW6Y.js";
31
+ import {
32
+ Tooltip,
33
+ TooltipContent,
34
+ TooltipProvider,
35
+ TooltipTrigger
36
+ } from "./chunk-6IWKHHRS.js";
37
+ import {
38
+ ShimmerText
39
+ } from "./chunk-HZPCSRSB.js";
40
+ import {
41
+ useLightboxOptional
42
+ } from "./chunk-VM2NA2EL.js";
43
+ import {
44
+ defaultChatComposerMessages
45
+ } from "./chunk-EYGBHGY5.js";
46
+ import {
47
+ useVoiceInput
48
+ } from "./chunk-LLYX4F5A.js";
49
+ import {
50
+ ComposerResponsiveContext
51
+ } from "./chunk-XEA5BCMA.js";
52
+ import {
53
+ composerSubmissionErrorMessage
54
+ } from "./chunk-UIK52VL4.js";
55
+ import {
56
+ useErrorMessage
57
+ } from "./chunk-CM7LVUKC.js";
58
+ import {
59
+ groupPickerRowsByBillingClass,
60
+ projectClientModelRows
61
+ } from "./chunk-4VEIBNC2.js";
62
+ import {
63
+ cn
64
+ } from "./chunk-TXS65BB2.js";
65
+ import {
66
+ singleSendText,
67
+ useOpenGeniText
68
+ } from "./chunk-LVUSG56I.js";
69
+
70
+ // src/commands/registry.ts
71
+ import { formatErrorMessage } from "@opengeni/sdk";
72
+ function parseCommandLine(value) {
73
+ if (value[0] !== "/") {
74
+ return null;
75
+ }
76
+ const body = value.slice(1);
77
+ const firstSpace = body.indexOf(" ");
78
+ if (firstSpace === -1) {
79
+ return { name: body, rest: "", hasTrailingSpace: false, args: [] };
80
+ }
81
+ const name = body.slice(0, firstSpace);
82
+ const rest = body.slice(firstSpace + 1);
83
+ return {
84
+ name,
85
+ rest,
86
+ hasTrailingSpace: true,
87
+ args: rest.split(/\s+/).filter((token) => token.length > 0)
88
+ };
89
+ }
90
+ var PERMISSION_SUPERUSER = "workspace:admin";
91
+ function hasPermission(required, permissions) {
92
+ if (!required) {
93
+ return true;
94
+ }
95
+ return permissions.includes(required) || permissions.includes(PERMISSION_SUPERUSER);
96
+ }
97
+ function matchCommand(commands, value) {
98
+ const parsed = parseCommandLine(value);
99
+ if (!parsed) {
100
+ return null;
101
+ }
102
+ const token = parsed.name.toLowerCase();
103
+ return commands.find((command) => command.name === token || command.aliases?.includes(token)) ?? null;
104
+ }
105
+ function filterCommands(commands, token, ctx) {
106
+ const needle = token.toLowerCase();
107
+ return commands.filter((command) => {
108
+ if (!hasPermission(command.permission, ctx.permissions)) {
109
+ return false;
110
+ }
111
+ if (command.available && !command.available(ctx)) {
112
+ return false;
113
+ }
114
+ if (needle.length === 0) {
115
+ return true;
116
+ }
117
+ return command.name.startsWith(needle) || (command.aliases?.some((alias) => alias.startsWith(needle)) ?? false);
118
+ });
119
+ }
120
+ function argHint(args) {
121
+ if (!args || args.length === 0) {
122
+ return "";
123
+ }
124
+ return args.map((arg) => {
125
+ const label = arg.oneOf ? arg.oneOf.join("|") : arg.name;
126
+ return arg.required ? `<${label}>` : `[${label}]`;
127
+ }).join(" ");
128
+ }
129
+ function firstMissingRequiredArg(command, args) {
130
+ const required = (command.args ?? []).filter((arg) => arg.required);
131
+ for (let i = 0; i < required.length; i += 1) {
132
+ const value = args[i];
133
+ if (value === void 0 || value.length === 0) {
134
+ return required[i] ?? null;
135
+ }
136
+ }
137
+ return null;
138
+ }
139
+ function requireSession(t, ctx) {
140
+ if (!ctx.sessionId) {
141
+ throw new Error(t("commands.registry.noActiveSessionYetStart"));
142
+ }
143
+ return ctx.sessionId;
144
+ }
145
+ var hasSession = (ctx) => ctx.sessionId !== null;
146
+ var defaultCommands = (t) => [
147
+ {
148
+ name: "help",
149
+ aliases: ["?"],
150
+ description: t("commands.registry.showAvailableCommands"),
151
+ run: (_args, ctx) => {
152
+ ctx.openHelp();
153
+ return { status: "ok" };
154
+ }
155
+ },
156
+ {
157
+ name: "clear-view",
158
+ description: t("commands.registry.clearTheLocalTimelineView"),
159
+ run: (_args, ctx) => {
160
+ const cleared = ctx.clearView();
161
+ if (!cleared) {
162
+ return {
163
+ status: "error",
164
+ message: t("commands.registry.thisViewCanTBe")
165
+ };
166
+ }
167
+ return { status: "ok", message: t("commands.registry.localViewCleared") };
168
+ }
169
+ },
170
+ {
171
+ name: "goal",
172
+ description: t("commands.registry.pauseOrResumeTheSession"),
173
+ permission: "sessions:control",
174
+ available: hasSession,
175
+ args: [
176
+ { name: "action", required: true, oneOf: ["pause", "resume"], description: "pause | resume" }
177
+ ],
178
+ run: async (args, ctx) => {
179
+ const sessionId = requireSession(t, ctx);
180
+ const action = args[0];
181
+ if (action !== "pause" && action !== "resume") {
182
+ return { status: "error", message: "Usage: /goal pause | /goal resume" };
183
+ }
184
+ try {
185
+ await ctx.client.updateGoal(ctx.workspaceId, sessionId, {
186
+ status: action === "pause" ? "paused" : "active"
187
+ });
188
+ return {
189
+ status: "ok",
190
+ message: action === "pause" ? t("commands.registry.goalPaused") : t("commands.registry.goalResumed")
191
+ };
192
+ } catch (cause) {
193
+ return {
194
+ status: "error",
195
+ message: commandErrorMessage(ctx, cause, goalErrorMessage(t, cause, action))
196
+ };
197
+ }
198
+ }
199
+ },
200
+ {
201
+ name: "compact",
202
+ description: t("commands.registry.compactTheConversationContextNow"),
203
+ permission: "sessions:control",
204
+ available: hasSession,
205
+ run: async (_args, ctx) => {
206
+ const sessionId = requireSession(t, ctx);
207
+ try {
208
+ const result = await ctx.client.compactSessionContext(ctx.workspaceId, sessionId);
209
+ return { status: "ok", message: result.message };
210
+ } catch (cause) {
211
+ return { status: "error", message: commandErrorMessage(ctx, cause) };
212
+ }
213
+ }
214
+ },
215
+ {
216
+ name: "clear",
217
+ description: t("commands.registry.clearTheConversationContextDestructive"),
218
+ permission: "sessions:control",
219
+ danger: true,
220
+ available: hasSession,
221
+ run: async (_args, ctx) => {
222
+ const sessionId = requireSession(t, ctx);
223
+ const confirmed = await ctx.confirm();
224
+ if (!confirmed) {
225
+ return { status: "ok", keepDraft: true };
226
+ }
227
+ try {
228
+ await ctx.client.clearSessionContext(ctx.workspaceId, sessionId);
229
+ return { status: "ok", message: t("commands.registry.contextCleared") };
230
+ } catch (cause) {
231
+ return {
232
+ status: "error",
233
+ message: commandErrorMessage(ctx, cause, clearErrorMessage(t, cause))
234
+ };
235
+ }
236
+ }
237
+ }
238
+ ];
239
+ function commandErrorMessage(ctx, cause, message = formatErrorMessage(cause)) {
240
+ return ctx.formatError?.(cause, message) || message;
241
+ }
242
+ function statusCode(cause) {
243
+ if (cause && typeof cause === "object" && "status" in cause && typeof cause.status === "number") {
244
+ return cause.status;
245
+ }
246
+ return void 0;
247
+ }
248
+ function goalErrorMessage(t, cause, action) {
249
+ const code = statusCode(cause);
250
+ if (code === 404) {
251
+ return t("commands.registry.thisSessionHasNoGoal");
252
+ }
253
+ if (code === 409) {
254
+ return action === "resume" ? t("commands.registry.onlyAPausedGoalCan") : t("commands.registry.goalIsAlreadyInA");
255
+ }
256
+ return formatErrorMessage(cause);
257
+ }
258
+ function clearErrorMessage(t, cause) {
259
+ if (statusCode(cause) === 409) {
260
+ return t("commands.registry.pauseTheSessionAndWait");
261
+ }
262
+ return formatErrorMessage(cause);
263
+ }
264
+
265
+ // src/hooks/use-slash-commands.ts
266
+ import { useCallback, useMemo, useRef, useState } from "react";
267
+ function useSlashCommands(options) {
268
+ const formatError = useErrorMessage();
269
+ const { commands, context, handlers, value, setValue } = options;
270
+ const [highlight, setHighlight] = useState(0);
271
+ const [dismissedValue, setDismissedValue] = useState(null);
272
+ const dismissed = dismissedValue !== null && dismissedValue === value;
273
+ const navigatedRef = useRef(false);
274
+ const navTokenRef = useRef(value);
275
+ if (navTokenRef.current !== value) {
276
+ navTokenRef.current = value;
277
+ navigatedRef.current = false;
278
+ }
279
+ const parsed = useMemo(() => parseCommandLine(value), [value]);
280
+ const filterCtx = useMemo(
281
+ () => ({
282
+ sessionId: context?.sessionId ?? null,
283
+ status: context?.status ?? null,
284
+ permissions: context?.permissions ?? []
285
+ }),
286
+ [context?.sessionId, context?.status, context?.permissions]
287
+ );
288
+ const activeCommand = useMemo(() => {
289
+ if (!parsed || !parsed.hasTrailingSpace) {
290
+ return null;
291
+ }
292
+ return matchCommand(commands, value);
293
+ }, [commands, value, parsed]);
294
+ const items = useMemo(() => {
295
+ if (!parsed) {
296
+ return [];
297
+ }
298
+ if (activeCommand) {
299
+ return [activeCommand];
300
+ }
301
+ return filterCommands(commands, parsed.name, filterCtx);
302
+ }, [commands, parsed, activeCommand, filterCtx]);
303
+ const open = parsed !== null && items.length > 0 && !dismissed;
304
+ const isCommandDraft = parsed !== null && items.length > 0;
305
+ const clampedHighlight = items.length === 0 ? 0 : Math.min(highlight, items.length - 1);
306
+ const activeArgHint = activeCommand ? argHint(activeCommand.args) : "";
307
+ const buildContext = useCallback(
308
+ (command) => {
309
+ if (!context) {
310
+ return null;
311
+ }
312
+ return { ...context, ...handlers, formatError, confirm: () => handlers.confirm(command) };
313
+ },
314
+ [context, handlers, formatError]
315
+ );
316
+ const execute = useCallback(
317
+ async (command, args) => {
318
+ const ctx = buildContext(command);
319
+ if (!ctx) {
320
+ return;
321
+ }
322
+ try {
323
+ const result = await command.run(args, ctx);
324
+ if (result.message) {
325
+ ctx.notice({ tone: result.status === "ok" ? "ok" : "error", message: result.message });
326
+ }
327
+ if (result.status === "ok" && !result.keepDraft) {
328
+ setValue("");
329
+ }
330
+ } catch (cause) {
331
+ ctx.notice({ tone: "error", message: formatError(cause) });
332
+ }
333
+ },
334
+ [buildContext, setValue, formatError]
335
+ );
336
+ const autocomplete = useCallback(
337
+ (command) => {
338
+ setValue(`/${command.name} `);
339
+ setHighlight(0);
340
+ },
341
+ [setValue]
342
+ );
343
+ const autocompleteHighlighted = useCallback(() => {
344
+ const command = items[clampedHighlight];
345
+ if (command) {
346
+ autocomplete(command);
347
+ }
348
+ }, [items, clampedHighlight, autocomplete]);
349
+ const runningRef = useRef(false);
350
+ const runResolved = useCallback(
351
+ async (command, executionOptions) => {
352
+ if (!parsed || runningRef.current) {
353
+ return;
354
+ }
355
+ runningRef.current = true;
356
+ try {
357
+ const explicit = executionOptions?.explicit ?? false;
358
+ const nameMatchesToken = command.name === parsed.name.toLowerCase() || (command.aliases?.includes(parsed.name.toLowerCase()) ?? false);
359
+ if (!explicit && !activeCommand && !nameMatchesToken && !parsed.hasTrailingSpace) {
360
+ autocomplete(command);
361
+ return;
362
+ }
363
+ const args = nameMatchesToken || parsed.hasTrailingSpace ? parsed.args : [];
364
+ const missing = firstMissingRequiredArg(command, args);
365
+ if (missing) {
366
+ if (!parsed.hasTrailingSpace) {
367
+ autocomplete(command);
368
+ }
369
+ return;
370
+ }
371
+ await execute(command, args);
372
+ } finally {
373
+ runningRef.current = false;
374
+ }
375
+ },
376
+ [parsed, activeCommand, autocomplete, execute]
377
+ );
378
+ const runHighlighted = useCallback(async () => {
379
+ if (!parsed) {
380
+ return;
381
+ }
382
+ if (navigatedRef.current && !activeCommand) {
383
+ const highlighted = items[clampedHighlight];
384
+ if (highlighted) {
385
+ await runResolved(highlighted, { explicit: true });
386
+ }
387
+ return;
388
+ }
389
+ const token = parsed.name.toLowerCase();
390
+ const exact = items.find((item) => item.name === token || item.aliases?.includes(token));
391
+ const command = activeCommand ?? exact ?? items[clampedHighlight];
392
+ if (!command) {
393
+ return;
394
+ }
395
+ await runResolved(command);
396
+ }, [parsed, activeCommand, items, clampedHighlight, runResolved]);
397
+ const runAt = useCallback(
398
+ async (index) => {
399
+ const command = items[index];
400
+ if (!command) {
401
+ return;
402
+ }
403
+ await runResolved(command, { explicit: true });
404
+ },
405
+ [items, runResolved]
406
+ );
407
+ const onKeyDown = useCallback(
408
+ (event) => {
409
+ if (!open) {
410
+ return false;
411
+ }
412
+ switch (event.key) {
413
+ case "ArrowDown": {
414
+ event.preventDefault();
415
+ navigatedRef.current = true;
416
+ setHighlight(
417
+ (current) => items.length === 0 ? 0 : (Math.min(current, items.length - 1) + 1) % items.length
418
+ );
419
+ return true;
420
+ }
421
+ case "ArrowUp": {
422
+ event.preventDefault();
423
+ navigatedRef.current = true;
424
+ setHighlight((current) => {
425
+ const base = Math.min(current, items.length - 1);
426
+ return items.length === 0 ? 0 : (base - 1 + items.length) % items.length;
427
+ });
428
+ return true;
429
+ }
430
+ case "Tab": {
431
+ event.preventDefault();
432
+ autocompleteHighlighted();
433
+ return true;
434
+ }
435
+ case "Enter": {
436
+ if (event.shiftKey || event.nativeEvent?.isComposing) {
437
+ return false;
438
+ }
439
+ event.preventDefault();
440
+ void runHighlighted();
441
+ return true;
442
+ }
443
+ case "Escape": {
444
+ event.preventDefault();
445
+ setDismissedValue(value);
446
+ return true;
447
+ }
448
+ default:
449
+ return false;
450
+ }
451
+ },
452
+ [open, items, autocompleteHighlighted, runHighlighted, value]
453
+ );
454
+ return {
455
+ open,
456
+ isCommandDraft,
457
+ items,
458
+ highlight: clampedHighlight,
459
+ setHighlight,
460
+ activeCommand,
461
+ activeArgHint,
462
+ onKeyDown,
463
+ runHighlighted,
464
+ runAt,
465
+ autocompleteHighlighted
466
+ };
467
+ }
468
+
469
+ // src/components/command-palette.tsx
470
+ import { AnimatePresence, motion } from "motion/react";
471
+ import { jsx, jsxs } from "react/jsx-runtime";
472
+ function CommandPalette({
473
+ open,
474
+ items,
475
+ highlight,
476
+ onHighlight,
477
+ onRun,
478
+ argHintText,
479
+ listboxId,
480
+ label: labelProp,
481
+ dangerLabel = "danger"
482
+ }) {
483
+ const t = useOpenGeniText();
484
+ const label = labelProp === void 0 ? t("commandPalette.slashCommands") : labelProp;
485
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: open ? /* @__PURE__ */ jsxs(
486
+ motion.div,
487
+ {
488
+ initial: { opacity: 0, y: 6, scale: 0.99 },
489
+ animate: { opacity: 1, y: 0, scale: 1 },
490
+ exit: { opacity: 0, y: 6, scale: 0.99 },
491
+ transition: { duration: 0.13, ease: "easeOut" },
492
+ className: cn(
493
+ "absolute bottom-full left-0 right-0 z-20 mb-2 overflow-hidden",
494
+ "rounded-og-lg border border-og-border bg-og-surface-2 shadow-og-sm"
495
+ ),
496
+ children: [
497
+ /* @__PURE__ */ jsx(
498
+ "ul",
499
+ {
500
+ id: listboxId,
501
+ role: "listbox",
502
+ "aria-label": label,
503
+ className: "max-h-72 overflow-y-auto py-1",
504
+ children: items.map((command, index) => {
505
+ const selected = index === highlight;
506
+ const hint = argHint(command.args);
507
+ return /* @__PURE__ */ jsxs(
508
+ "li",
509
+ {
510
+ id: `${listboxId}-option-${index}`,
511
+ role: "option",
512
+ "aria-selected": selected,
513
+ onMouseEnter: () => onHighlight(index),
514
+ onMouseDown: (event) => {
515
+ event.preventDefault();
516
+ onRun(index);
517
+ },
518
+ className: cn(
519
+ "mx-1 flex cursor-pointer items-center gap-2 rounded-og-md px-2.5 py-1.5",
520
+ "transition-colors duration-100",
521
+ selected ? "bg-og-accent/15 text-og-fg" : "text-og-fg-muted hover:bg-og-surface-3"
522
+ ),
523
+ children: [
524
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [
525
+ /* @__PURE__ */ jsxs(
526
+ "span",
527
+ {
528
+ className: cn(
529
+ "font-mono text-[13px]",
530
+ selected ? "text-og-accent" : "text-og-fg"
531
+ ),
532
+ children: [
533
+ "/",
534
+ command.name
535
+ ]
536
+ }
537
+ ),
538
+ hint ? /* @__PURE__ */ jsx("span", { className: "truncate font-mono text-[11px] text-og-fg-subtle", children: hint }) : null
539
+ ] }),
540
+ /* @__PURE__ */ jsxs("span", { className: "ml-auto flex items-center gap-1.5", children: [
541
+ command.danger ? /* @__PURE__ */ jsx("span", { className: "rounded-og-xs bg-og-status-failed/15 px-1 text-[10px] uppercase tracking-wide text-og-status-failed", children: dangerLabel }) : null,
542
+ /* @__PURE__ */ jsx("span", { className: "og-command-description truncate text-[12px] text-og-fg-subtle max-sm:hidden", children: command.description })
543
+ ] })
544
+ ]
545
+ },
546
+ command.name
547
+ );
548
+ })
549
+ }
550
+ ),
551
+ argHintText ? /* @__PURE__ */ jsx("div", { className: "border-t border-og-border px-3 py-1.5 font-mono text-[11px] text-og-fg-subtle", children: argHintText }) : null
552
+ ]
553
+ }
554
+ ) : null });
555
+ }
556
+
557
+ // src/components/model-picker.tsx
558
+ import { modelDisplayName } from "@opengeni/sdk/model-display";
559
+ import { ChevronDownIcon } from "lucide-react";
560
+ import { useId, useMemo as useMemo2 } from "react";
561
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
562
+ var EMPTY_CLIENT_MODELS = [];
563
+ function isCodexClientModel(model) {
564
+ return model.id.startsWith("codex/") || model.source === "codex";
565
+ }
566
+ function isCodexPickerRow(row) {
567
+ return row.id.startsWith("codex/") || row.catalog.source === "codex";
568
+ }
569
+ function applyCodexOnlyRows(t, rows, codexOnly) {
570
+ if (!codexOnly) return rows;
571
+ return rows.map((row) => {
572
+ if (isCodexPickerRow(row)) return row;
573
+ return {
574
+ ...row,
575
+ selectable: false,
576
+ unavailableReason: row.unavailableReason ?? t("modelPicker.codexOnlySession")
577
+ };
578
+ });
579
+ }
580
+ function providerGroups(models, codexOnly) {
581
+ const byProvider = /* @__PURE__ */ new Map();
582
+ for (const model of models) {
583
+ let group = byProvider.get(model.provider);
584
+ if (!group) {
585
+ group = { label: model.providerLabel, models: [] };
586
+ byProvider.set(model.provider, group);
587
+ }
588
+ group.models.push({
589
+ ...model,
590
+ optionDisabled: codexOnly && !isCodexClientModel(model)
591
+ });
592
+ }
593
+ const groups = [...byProvider.values()];
594
+ if (codexOnly) {
595
+ const codexIndex = groups.findIndex(
596
+ (group) => group.models.some((model) => !model.optionDisabled && isCodexClientModel(model))
597
+ );
598
+ if (codexIndex > 0) groups.unshift(...groups.splice(codexIndex, 1));
599
+ }
600
+ return groups;
601
+ }
602
+ function ModelPicker({
603
+ models = EMPTY_CLIENT_MODELS,
604
+ rows,
605
+ value,
606
+ onChange,
607
+ disabled,
608
+ className,
609
+ label: labelProp,
610
+ codexOnly = false
611
+ }) {
612
+ const t = useOpenGeniText();
613
+ const label = labelProp === void 0 ? t("modelPicker.model") : labelProp;
614
+ const selectId = useId();
615
+ const effectiveRows = useMemo2(
616
+ () => rows && rows.length > 0 ? applyCodexOnlyRows(t, rows, codexOnly) : [],
617
+ [rows, codexOnly, t]
618
+ );
619
+ const billingGroups = useMemo2(
620
+ () => effectiveRows.length > 0 ? groupPickerRowsByBillingClass(t, effectiveRows, { codexOnly, selectedId: value }) : [],
621
+ [effectiveRows, codexOnly, value, t]
622
+ );
623
+ const providerGroupList = useMemo2(() => providerGroups(models, codexOnly), [models, codexOnly]);
624
+ const modelLabels = useMemo2(
625
+ () => new Map(projectClientModelRows(t, models).map((row) => [row.id, row.label])),
626
+ [models, t]
627
+ );
628
+ const useBillingGroups = Boolean(effectiveRows.length);
629
+ if (models.length === 0 && effectiveRows.length === 0) {
630
+ return null;
631
+ }
632
+ return /* @__PURE__ */ jsxs2("span", { className: cn("relative inline-flex items-center", className), children: [
633
+ /* @__PURE__ */ jsx2("label", { htmlFor: selectId, className: "sr-only", children: label }),
634
+ /* @__PURE__ */ jsx2(
635
+ "select",
636
+ {
637
+ id: selectId,
638
+ value: value ?? "",
639
+ onChange: (event) => onChange(event.target.value),
640
+ disabled: disabled === true,
641
+ "aria-label": label,
642
+ className: cn(
643
+ "og-model-picker-native h-8 max-w-[180px] cursor-pointer appearance-none truncate rounded-og-md bg-transparent pointer-coarse:h-11",
644
+ "py-0 pl-2 pr-6 text-[13px] text-og-fg-muted",
645
+ "transition-colors duration-150 hover:bg-og-surface-2 hover:text-og-fg",
646
+ "focus:outline-hidden focus-visible:outline-hidden",
647
+ "disabled:cursor-not-allowed disabled:opacity-50"
648
+ ),
649
+ children: useBillingGroups ? billingGroups.map((group) => /* @__PURE__ */ jsx2("optgroup", { label: group.label, children: group.rows.map((row) => /* @__PURE__ */ jsx2("option", { value: row.id, disabled: !row.selectable, children: row.unavailableReason ? `${row.label} (${row.unavailableReason})` : row.label }, row.id)) }, group.billingClass)) : providerGroupList.map((group) => /* @__PURE__ */ jsx2("optgroup", { label: group.label, children: group.models.map((model) => /* @__PURE__ */ jsx2("option", { value: model.id, disabled: model.optionDisabled, children: modelLabels.get(model.id) ?? modelDisplayName(model) }, model.id)) }, group.label))
650
+ }
651
+ ),
652
+ /* @__PURE__ */ jsx2(
653
+ ChevronDownIcon,
654
+ {
655
+ "aria-hidden": true,
656
+ className: "pointer-events-none absolute right-1.5 size-3.5 text-og-fg-subtle"
657
+ }
658
+ )
659
+ ] });
660
+ }
661
+
662
+ // src/components/composer.tsx
663
+ import {
664
+ ArrowUpIcon,
665
+ ChevronDownIcon as ChevronDownIcon2,
666
+ FileIcon as FileIcon2,
667
+ LoaderCircleIcon as LoaderCircleIcon2,
668
+ PaperclipIcon,
669
+ PauseIcon,
670
+ PlayIcon,
671
+ SquareIcon,
672
+ XIcon as XIcon2
673
+ } from "lucide-react";
674
+ import { AnimatePresence as AnimatePresence2, motion as motion2 } from "motion/react";
675
+ import {
676
+ createContext,
677
+ forwardRef,
678
+ useCallback as useCallback2,
679
+ useContext,
680
+ useEffect as useEffect3,
681
+ useId as useId2,
682
+ useLayoutEffect,
683
+ useMemo as useMemo4,
684
+ useRef as useRef4,
685
+ useState as useState4
686
+ } from "react";
687
+
688
+ // src/hooks/use-composer-image-tags.ts
689
+ import { useEffect, useMemo as useMemo3, useRef as useRef2, useState as useState2 } from "react";
690
+
691
+ // src/lib/image-markers.ts
692
+ var TAG = /\[Image (\d+)\]/g;
693
+ function imageMarker(number) {
694
+ return `[Image ${number}]`;
695
+ }
696
+ function reconcileImageMarkers({
697
+ text,
698
+ previous,
699
+ next,
700
+ insert,
701
+ caret
702
+ }) {
703
+ const nextNumber = new Map(next.map((id, index) => [id, index + 1]));
704
+ const inserted = new Set(insert.filter((id) => nextNumber.has(id)));
705
+ const changedOrder = previous.length !== next.length || previous.some((id, index) => next[index] !== id);
706
+ if (!inserted.size && !changedOrder) return null;
707
+ let position = Math.max(0, Math.min(caret, text.length));
708
+ let result = "";
709
+ let last = 0;
710
+ for (const match of text.matchAll(TAG)) {
711
+ const start = match.index;
712
+ const end = start + match[0].length;
713
+ const id = previous[Number(match[1]) - 1];
714
+ if (id === void 0) continue;
715
+ const number = nextNumber.get(id);
716
+ let cutStart = start;
717
+ let cutEnd = end;
718
+ const replacement = number === void 0 ? "" : imageMarker(number);
719
+ if (number === void 0) {
720
+ if (text[cutEnd] === " ") cutEnd += 1;
721
+ else if (start > last && text[start - 1] === " ") cutStart -= 1;
722
+ }
723
+ result += text.slice(last, cutStart) + replacement;
724
+ if (position >= cutEnd) position += replacement.length - (cutEnd - cutStart);
725
+ else if (position > cutStart) position = cutStart + replacement.length;
726
+ last = cutEnd;
727
+ }
728
+ result += text.slice(last);
729
+ if (inserted.size) {
730
+ const tags = next.filter((id) => inserted.has(id)).map((id) => imageMarker(nextNumber.get(id))).join(" ");
731
+ const before = result.slice(0, position);
732
+ const after = result.slice(position);
733
+ const lead = before.length && !/\s$/.test(before) ? " " : "";
734
+ const trail = !/^\s/.test(after) ? " " : "";
735
+ result = before + lead + tags + trail + after;
736
+ position = before.length + lead.length + tags.length + trail.length;
737
+ }
738
+ return result === text ? null : { text: result, caret: position };
739
+ }
740
+ function messageImageIds(restoredImageFileIds, attachments) {
741
+ const restored = new Set(restoredImageFileIds);
742
+ return [
743
+ ...restoredImageFileIds.map(restoredImageKey),
744
+ ...attachments.filter(
745
+ (attachment) => attachment.contentType.startsWith("image/") && !(attachment.file && restored.has(attachment.file.id))
746
+ ).map((attachment) => attachment.id)
747
+ ];
748
+ }
749
+ function restoredImageKey(fileId) {
750
+ return `restored-file:${fileId}`;
751
+ }
752
+
753
+ // src/hooks/use-composer-image-tags.ts
754
+ function useComposerImageTags({
755
+ enabled,
756
+ attachments,
757
+ restoredResources,
758
+ loadFileContentType,
759
+ readValue,
760
+ setValue,
761
+ textareaRef
762
+ }) {
763
+ const restoredFileIds = useMemo3(
764
+ () => enabled ? restoredResources.flatMap(
765
+ (resource) => resource.kind === "file" ? [resource.fileId] : []
766
+ ) : [],
767
+ [enabled, restoredResources]
768
+ );
769
+ const restoredKey = restoredFileIds.join("\n");
770
+ const [restoredKinds, setRestoredKinds] = useState2(() => /* @__PURE__ */ new Map());
771
+ const restoredKindsRef = useRef2(restoredKinds);
772
+ restoredKindsRef.current = restoredKinds;
773
+ useEffect(() => {
774
+ const unknown = restoredFileIds.filter((fileId) => !restoredKindsRef.current.has(fileId));
775
+ if (unknown.length === 0) return;
776
+ const controller = new AbortController();
777
+ const kindOf = async (fileId) => {
778
+ try {
779
+ const contentType = await loadFileContentType?.(fileId, controller.signal);
780
+ return [fileId, contentType === void 0 || contentType.startsWith("image/")];
781
+ } catch {
782
+ return [fileId, true];
783
+ }
784
+ };
785
+ void Promise.all(unknown.map(kindOf)).then((entries) => {
786
+ if (controller.signal.aborted) return;
787
+ setRestoredKinds((current) => new Map([...current, ...entries]));
788
+ });
789
+ return () => controller.abort();
790
+ }, [restoredKey, loadFileContentType]);
791
+ const restoredReady = restoredFileIds.every((fileId) => restoredKinds.has(fileId));
792
+ const imageIds = useMemo3(
793
+ () => enabled && restoredReady ? messageImageIds(
794
+ restoredFileIds.filter((fileId) => restoredKinds.get(fileId) === true),
795
+ attachments
796
+ ) : null,
797
+ [attachments, enabled, restoredFileIds, restoredKinds, restoredReady]
798
+ );
799
+ const imageNumbers = useMemo3(
800
+ () => imageIds ? new Map(imageIds.map((id, index) => [id, index + 1])) : void 0,
801
+ [imageIds]
802
+ );
803
+ const previousRef = useRef2(null);
804
+ const attachmentsRef = useRef2(attachments);
805
+ attachmentsRef.current = attachments;
806
+ const imageIdsKey = imageIds?.join("\n") ?? null;
807
+ useEffect(() => {
808
+ if (!enabled) {
809
+ previousRef.current = null;
810
+ return;
811
+ }
812
+ if (!imageIds) return;
813
+ const previous = previousRef.current;
814
+ previousRef.current = imageIds;
815
+ if (previous === null) return;
816
+ const added = new Set(
817
+ attachmentsRef.current.filter((attachment) => attachment.restored !== true).map((attachment) => attachment.id)
818
+ );
819
+ const insert = imageIds.filter((id) => added.has(id) && !previous.includes(id));
820
+ const value = readValue();
821
+ const textarea = textareaRef.current;
822
+ const edit = reconcileImageMarkers({
823
+ text: value,
824
+ previous,
825
+ next: imageIds,
826
+ insert,
827
+ caret: textarea && textarea.value === value ? textarea.selectionStart : value.length
828
+ });
829
+ if (!edit) return;
830
+ setValue(edit.text);
831
+ window.requestAnimationFrame(() => {
832
+ const current = textareaRef.current;
833
+ if (current && current.value === edit.text) current.setSelectionRange(edit.caret, edit.caret);
834
+ });
835
+ }, [imageIdsKey, enabled]);
836
+ return imageNumbers;
837
+ }
838
+
839
+ // src/components/attachment-chips.tsx
840
+ import {
841
+ AppWindowIcon,
842
+ FileIcon,
843
+ ImageIcon,
844
+ LoaderCircleIcon,
845
+ RotateCwIcon,
846
+ XIcon
847
+ } from "lucide-react";
848
+ import {
849
+ cloneElement,
850
+ useEffect as useEffect2,
851
+ useRef as useRef3,
852
+ useState as useState3
853
+ } from "react";
854
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
855
+ function ComposerTip({
856
+ tip,
857
+ children
858
+ }) {
859
+ if (!tip) return children;
860
+ return cloneElement(children, { title: tip });
861
+ }
862
+ function ImageTagLabel({ children }) {
863
+ return /* @__PURE__ */ jsx3("span", { "data-image-tag": "", className: "shrink-0 font-medium text-og-fg tabular-nums", children });
864
+ }
865
+ function storedFileAttachment(id, file) {
866
+ return {
867
+ id,
868
+ name: file.filename,
869
+ contentType: file.contentType,
870
+ sizeBytes: file.sizeBytes,
871
+ status: "ready",
872
+ file,
873
+ ...file.appShot ? { appShot: file.appShot } : {}
874
+ };
875
+ }
876
+ var noRetainedPreview = () => void 0;
877
+ function AttachmentChips({
878
+ attachments,
879
+ messages,
880
+ disabled = false,
881
+ onRemove,
882
+ onRetry,
883
+ onRetainPreview = noRetainedPreview,
884
+ onLoadPreview,
885
+ openFile,
886
+ imageNumbers,
887
+ className
888
+ }) {
889
+ const t = useOpenGeniText();
890
+ const lightbox = useLightboxOptional();
891
+ const previewRequest = useRef3(null);
892
+ const [previewLoadingId, setPreviewLoadingId] = useState3(null);
893
+ const [previewErrorId, setPreviewErrorId] = useState3(null);
894
+ const [opening, setOpening] = useState3(null);
895
+ const [storedThumbs, setStoredThumbs] = useState3({});
896
+ const [brokenLocal, setBrokenLocal] = useState3(() => /* @__PURE__ */ new Set());
897
+ const thumbRequests = useRef3(/* @__PURE__ */ new Map());
898
+ const localPreview = (attachment) => attachment.previewUrl && !brokenLocal.has(attachment.id) ? attachment.previewUrl : void 0;
899
+ useEffect2(() => {
900
+ if (!onLoadPreview) return;
901
+ for (const attachment of attachments) {
902
+ const id = attachment.id;
903
+ if (attachment.status !== "ready" || !attachment.file || !attachment.contentType.startsWith("image/") || attachment.previewUrl && !brokenLocal.has(id) || storedThumbs[id] || thumbRequests.current.has(id)) {
904
+ continue;
905
+ }
906
+ const controller = new AbortController();
907
+ thumbRequests.current.set(id, controller);
908
+ void onLoadPreview(id, controller.signal).then((url) => {
909
+ if (url && !controller.signal.aborted) {
910
+ setStoredThumbs((current) => ({ ...current, [id]: url }));
911
+ }
912
+ }).catch(() => void 0).finally(() => {
913
+ if (thumbRequests.current.get(id) === controller) thumbRequests.current.delete(id);
914
+ });
915
+ }
916
+ }, [attachments, brokenLocal, onLoadPreview, storedThumbs]);
917
+ useEffect2(() => {
918
+ const requests = thumbRequests.current;
919
+ return () => {
920
+ for (const controller of requests.values()) controller.abort();
921
+ requests.clear();
922
+ };
923
+ }, []);
924
+ useEffect2(() => () => previewRequest.current?.abort(), [onLoadPreview]);
925
+ async function openPreview(attachment, source, canLoadPreview) {
926
+ previewRequest.current?.abort();
927
+ const attachmentId = attachment.id;
928
+ const local = localPreview(attachment);
929
+ const releaseSource = local ? onRetainPreview(attachmentId) : void 0;
930
+ let src = local ?? storedThumbs[attachmentId];
931
+ if (!releaseSource && canLoadPreview) src = storedThumbs[attachmentId];
932
+ if (!src && canLoadPreview) {
933
+ const controller = new AbortController();
934
+ previewRequest.current = controller;
935
+ setPreviewLoadingId(attachmentId);
936
+ setPreviewErrorId(null);
937
+ try {
938
+ src = await onLoadPreview(attachmentId, controller.signal);
939
+ if (controller.signal.aborted) return;
940
+ if (!src) {
941
+ setPreviewErrorId(attachmentId);
942
+ return;
943
+ }
944
+ } catch {
945
+ if (!controller.signal.aborted) setPreviewErrorId(attachmentId);
946
+ return;
947
+ } finally {
948
+ if (previewRequest.current === controller) {
949
+ setPreviewLoadingId(null);
950
+ }
951
+ }
952
+ }
953
+ lightbox.open(
954
+ src,
955
+ attachment.name,
956
+ source,
957
+ messages.attachmentPreviewLabel,
958
+ attachment.name,
959
+ {
960
+ download: messages.downloadAttachment(attachment.name),
961
+ close: messages.closeAttachmentPreview
962
+ },
963
+ releaseSource
964
+ );
965
+ }
966
+ function runOpen(attachmentId, open) {
967
+ if (opening?.id === attachmentId && !opening.failed) return;
968
+ setOpening({ id: attachmentId, failed: false });
969
+ void Promise.resolve().then(open).then(
970
+ () => setOpening((current) => current?.id === attachmentId ? null : current),
971
+ () => setOpening(
972
+ (current) => current?.id === attachmentId ? { id: attachmentId, failed: true } : current
973
+ )
974
+ );
975
+ }
976
+ const readOnly = !onRemove;
977
+ return (
978
+ // Compact chips extend their touch targets beyond their visible borders.
979
+ // Keep neighboring rows and columns outside those expanded hit areas.
980
+ /* @__PURE__ */ jsx3("div", { className: cn("flex flex-wrap gap-1.5 pointer-coarse:gap-2.5", className), children: attachments.map((attachment) => {
981
+ const failed = attachment.status === "failed";
982
+ const secureContextRequired = attachment.errorCode === "secure_context_required";
983
+ const previewFailed = previewErrorId === attachment.id;
984
+ const previewLoading = previewLoadingId === attachment.id;
985
+ const local = localPreview(attachment);
986
+ const thumb = local ?? storedThumbs[attachment.id];
987
+ const onThumbError = local ? () => setBrokenLocal(
988
+ (current) => current.has(attachment.id) ? current : new Set(current).add(attachment.id)
989
+ ) : void 0;
990
+ const canLoadPreview = Boolean(
991
+ lightbox && onLoadPreview && attachment.status === "ready" && attachment.file && attachment.contentType.startsWith("image/")
992
+ );
993
+ const previewable = Boolean(lightbox && (thumb || canLoadPreview));
994
+ const resolution = readOnly && !previewable ? openFile?.(attachment) : void 0;
995
+ const fileOpening = opening?.id === attachment.id && !opening.failed;
996
+ const openFailed = opening?.id === attachment.id && opening.failed;
997
+ const unavailable = readOnly && attachment.status === "ready" && !attachment.file;
998
+ const appShot = attachment.appShot;
999
+ const statusText = previewFailed ? messages.previewUnavailable ?? t("composer.previewUnavailable") : openFailed ? t("composerMessages.openFailed") : attachment.status === "uploading" ? messages.uploading : failed ? attachment.error || messages.uploadFailed : appShot ? t("composer.appShotSummary", { app: appShot.app }) : unavailable ? t("composerMessages.unavailable") : messages.formatBytes(attachment.sizeBytes);
1000
+ const displayName = appShot ? appShot.title.trim() || appShot.app : attachment.name;
1001
+ const compact = !appShot && !failed && !previewFailed && !openFailed;
1002
+ const imageNumber = imageNumbers?.get(attachment.id);
1003
+ const thumbSize = appShot ? "h-10 w-16" : compact ? "size-6" : "size-8";
1004
+ const chipClass = cn(
1005
+ "flex min-w-0 items-center gap-2 rounded-og-md border text-left text-og-sm",
1006
+ compact ? cn("py-1 pl-1", readOnly ? "pr-2" : "pr-1") : "px-2 py-1.5",
1007
+ // A captured window arrives from outside the page: let it settle in.
1008
+ appShot && "animate-og-enter",
1009
+ failed ? cn(
1010
+ "border-og-status-failed/40 bg-og-status-failed/10",
1011
+ secureContextRequired ? "max-w-full items-start sm:max-w-[32rem]" : appShot ? "max-w-[320px]" : "max-w-[240px]"
1012
+ ) : cn("border-og-border bg-og-surface-2", appShot ? "max-w-[320px]" : "max-w-[240px]")
1013
+ );
1014
+ const interactiveClass = "cursor-pointer outline-hidden transition-colors hover:bg-og-surface-3 focus-visible:ring-2 focus-visible:ring-og-accent disabled:cursor-wait pointer-coarse:min-h-11";
1015
+ const thumbImage = /* @__PURE__ */ jsx3(
1016
+ "img",
1017
+ {
1018
+ src: thumb,
1019
+ alt: "",
1020
+ onError: onThumbError,
1021
+ className: cn(
1022
+ "h-full w-full object-cover",
1023
+ !readOnly && "transition-opacity hover:opacity-80",
1024
+ appShot && "object-top",
1025
+ compact && "rounded"
1026
+ )
1027
+ }
1028
+ );
1029
+ const pendingIcon = /* @__PURE__ */ jsx3(LoaderCircleIcon, { className: "size-4 animate-og-spin text-og-fg-muted" });
1030
+ const leading = readOnly && previewable ? /* @__PURE__ */ jsx3(
1031
+ "span",
1032
+ {
1033
+ className: cn(
1034
+ thumbSize,
1035
+ "shrink-0 overflow-hidden rounded",
1036
+ appShot && "border border-og-border bg-og-surface-1",
1037
+ !thumb && "flex items-center justify-center"
1038
+ ),
1039
+ children: thumb ? thumbImage : previewLoading ? pendingIcon : /* @__PURE__ */ jsx3(ImageIcon, { className: "size-4 text-og-fg-muted" })
1040
+ }
1041
+ ) : previewable ? /* @__PURE__ */ jsx3(
1042
+ "button",
1043
+ {
1044
+ type: "button",
1045
+ className: cn(
1046
+ thumbSize,
1047
+ "shrink-0 overflow-hidden rounded outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent",
1048
+ // The slim chip's 24px preview keeps a 44px touch target; the
1049
+ // hit area grows over the name, never the remove button.
1050
+ compact && "relative overflow-visible pointer-coarse:before:absolute pointer-coarse:before:-inset-y-2.5 pointer-coarse:before:-left-2.5 pointer-coarse:before:-right-2.5 pointer-coarse:before:content-['']",
1051
+ appShot && "border border-og-border bg-og-surface-1",
1052
+ !thumb && "flex items-center justify-center disabled:cursor-wait"
1053
+ ),
1054
+ "aria-label": messages.previewAttachment(displayName),
1055
+ "aria-busy": previewLoading || void 0,
1056
+ disabled: previewLoading,
1057
+ onClick: (event) => void openPreview(attachment, event.currentTarget, canLoadPreview),
1058
+ children: thumb ? thumbImage : previewLoading ? pendingIcon : /* @__PURE__ */ jsx3(ImageIcon, { className: "size-4 text-og-fg-muted" })
1059
+ }
1060
+ ) : thumb ? /* @__PURE__ */ jsx3(
1061
+ "img",
1062
+ {
1063
+ src: thumb,
1064
+ alt: "",
1065
+ onError: onThumbError,
1066
+ className: cn(thumbSize, "shrink-0 rounded object-cover", appShot && "object-top")
1067
+ }
1068
+ ) : fileOpening ? /* @__PURE__ */ jsx3(LoaderCircleIcon, { className: "size-4 shrink-0 animate-og-spin text-og-fg-muted" }) : attachment.contentType.startsWith("image/") ? /* @__PURE__ */ jsx3(ImageIcon, { className: "size-4 shrink-0 text-og-fg-muted" }) : /* @__PURE__ */ jsx3(FileIcon, { className: "size-4 shrink-0 text-og-fg-muted" });
1069
+ const content = /* @__PURE__ */ jsxs3(Fragment, { children: [
1070
+ leading,
1071
+ compact ? /* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 flex-1 items-baseline gap-1.5", children: [
1072
+ imageNumber !== void 0 ? /* @__PURE__ */ jsx3(ImageTagLabel, { children: t("composer.imageTag", { number: imageNumber }) }) : null,
1073
+ /* @__PURE__ */ jsx3(
1074
+ "span",
1075
+ {
1076
+ className: cn(
1077
+ "truncate",
1078
+ imageNumber === void 0 ? "font-medium text-og-fg" : "text-og-fg-muted"
1079
+ ),
1080
+ children: displayName
1081
+ }
1082
+ ),
1083
+ /* @__PURE__ */ jsx3("span", { className: "shrink-0 text-og-xs text-og-fg-subtle tabular-nums", children: statusText })
1084
+ ] }) : /* @__PURE__ */ jsxs3("span", { className: "min-w-0 flex-1", children: [
1085
+ /* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 items-baseline gap-1.5", children: [
1086
+ imageNumber !== void 0 ? /* @__PURE__ */ jsx3(ImageTagLabel, { children: t("composer.imageTag", { number: imageNumber }) }) : null,
1087
+ /* @__PURE__ */ jsx3("span", { className: "block min-w-0 truncate font-medium text-og-fg", children: displayName })
1088
+ ] }),
1089
+ appShot && !failed && !previewFailed && attachment.status !== "uploading" ? /* @__PURE__ */ jsx3(
1090
+ ComposerTip,
1091
+ {
1092
+ tip: appShot.text?.trim() ? t("composer.appShotTextIncluded") : t("composer.appShotNoText"),
1093
+ children: /* @__PURE__ */ jsxs3("span", { className: "flex min-w-0 items-center gap-1 text-og-xs text-og-fg-subtle", children: [
1094
+ /* @__PURE__ */ jsx3(AppWindowIcon, { "aria-hidden": true, className: "size-3 shrink-0" }),
1095
+ /* @__PURE__ */ jsx3("span", { className: "truncate", children: statusText })
1096
+ ] })
1097
+ }
1098
+ ) : secureContextRequired ? /* @__PURE__ */ jsx3("span", { className: "block break-words text-og-xs leading-4 text-og-status-failed", children: statusText }) : failed || previewFailed || openFailed ? /* @__PURE__ */ jsx3(ComposerTip, { tip: statusText, children: /* @__PURE__ */ jsx3("span", { className: "block truncate text-og-xs text-og-status-failed", children: statusText }) }) : /* @__PURE__ */ jsx3("span", { className: "block truncate text-og-xs text-og-fg-subtle", children: statusText })
1099
+ ] }),
1100
+ attachment.status === "uploading" ? /* @__PURE__ */ jsx3(LoaderCircleIcon, { className: "size-3.5 shrink-0 animate-og-spin" }) : null,
1101
+ failed && !secureContextRequired && onRetry ? /* @__PURE__ */ jsx3(ComposerTip, { tip: messages.retryUpload, children: /* @__PURE__ */ jsx3(
1102
+ "button",
1103
+ {
1104
+ type: "button",
1105
+ onClick: () => onRetry(attachment.id),
1106
+ disabled,
1107
+ className: "shrink-0 rounded-og-xs p-1 text-og-fg-muted hover:bg-og-surface-1 hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-10",
1108
+ "aria-label": messages.retryAttachment(displayName),
1109
+ children: /* @__PURE__ */ jsx3(RotateCwIcon, { className: "size-3.5" })
1110
+ }
1111
+ ) }) : null,
1112
+ onRemove ? /* @__PURE__ */ jsx3(
1113
+ "button",
1114
+ {
1115
+ type: "button",
1116
+ onClick: () => onRemove(attachment.id),
1117
+ disabled,
1118
+ className: cn(
1119
+ "shrink-0 rounded-og-xs p-1 text-og-fg-muted hover:bg-og-surface-1 hover:text-og-fg disabled:cursor-not-allowed disabled:opacity-50",
1120
+ // The slim chip keeps a 44px touch target with an invisible hit area.
1121
+ compact ? "relative pointer-coarse:p-1.5 pointer-coarse:before:absolute pointer-coarse:before:-inset-2.5 pointer-coarse:before:content-['']" : "pointer-coarse:size-10"
1122
+ ),
1123
+ "aria-label": messages.removeAttachment(displayName),
1124
+ children: /* @__PURE__ */ jsx3(XIcon, { className: "size-3.5" })
1125
+ }
1126
+ ) : null
1127
+ ] });
1128
+ if (readOnly && previewable) {
1129
+ return /* @__PURE__ */ jsx3(
1130
+ "button",
1131
+ {
1132
+ type: "button",
1133
+ "data-app-shot": appShot ? "" : void 0,
1134
+ className: cn(chipClass, interactiveClass),
1135
+ "aria-label": messages.previewAttachment(displayName),
1136
+ "aria-busy": previewLoading || void 0,
1137
+ disabled: previewLoading,
1138
+ onClick: (event) => void openPreview(attachment, event.currentTarget, canLoadPreview),
1139
+ children: content
1140
+ },
1141
+ attachment.id
1142
+ );
1143
+ }
1144
+ if (resolution?.href) {
1145
+ const navigate = resolution.open;
1146
+ return /* @__PURE__ */ jsx3(
1147
+ "a",
1148
+ {
1149
+ href: resolution.href,
1150
+ target: "_blank",
1151
+ rel: "noopener noreferrer",
1152
+ className: cn(chipClass, interactiveClass),
1153
+ "aria-label": t("composerMessages.openName", { name: displayName }),
1154
+ onClick: (event) => {
1155
+ if (!navigate || event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
1156
+ return;
1157
+ event.preventDefault();
1158
+ navigate();
1159
+ },
1160
+ children: content
1161
+ },
1162
+ attachment.id
1163
+ );
1164
+ }
1165
+ if (resolution?.open) {
1166
+ const open = resolution.open;
1167
+ return /* @__PURE__ */ jsx3(
1168
+ "button",
1169
+ {
1170
+ type: "button",
1171
+ className: cn(chipClass, interactiveClass),
1172
+ "aria-label": t("composerMessages.openName", { name: displayName }),
1173
+ "aria-busy": fileOpening || void 0,
1174
+ disabled: fileOpening,
1175
+ onClick: () => runOpen(attachment.id, open),
1176
+ children: content
1177
+ },
1178
+ attachment.id
1179
+ );
1180
+ }
1181
+ return /* @__PURE__ */ jsx3("div", { "data-app-shot": appShot ? "" : void 0, className: chipClass, children: content }, attachment.id);
1182
+ }) })
1183
+ );
1184
+ }
1185
+
1186
+ // src/components/composer.tsx
1187
+ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1188
+ var HELD_SEND_LIMIT_MS = 3e4;
1189
+ var composerHeightMirror = null;
1190
+ function measureComposerContentHeight(textarea) {
1191
+ if (typeof document === "undefined") {
1192
+ return textarea.scrollHeight;
1193
+ }
1194
+ const width = textarea.clientWidth;
1195
+ if (width <= 0) {
1196
+ return textarea.offsetHeight;
1197
+ }
1198
+ let mirror = composerHeightMirror;
1199
+ if (!mirror) {
1200
+ mirror = document.createElement("textarea");
1201
+ mirror.setAttribute("aria-hidden", "true");
1202
+ mirror.tabIndex = -1;
1203
+ mirror.rows = 1;
1204
+ mirror.style.cssText = "position:fixed;top:0;left:-100000px;visibility:hidden;pointer-events:none;height:auto;min-height:0;max-height:none;overflow:hidden;z-index:-1;";
1205
+ composerHeightMirror = mirror;
1206
+ }
1207
+ const style = getComputedStyle(textarea);
1208
+ mirror.style.width = `${width}px`;
1209
+ mirror.style.boxSizing = style.boxSizing;
1210
+ mirror.style.font = style.font;
1211
+ mirror.style.fontSize = style.fontSize;
1212
+ mirror.style.fontFamily = style.fontFamily;
1213
+ mirror.style.fontWeight = style.fontWeight;
1214
+ mirror.style.fontStyle = style.fontStyle;
1215
+ mirror.style.letterSpacing = style.letterSpacing;
1216
+ mirror.style.lineHeight = style.lineHeight;
1217
+ mirror.style.textTransform = style.textTransform;
1218
+ mirror.style.paddingTop = style.paddingTop;
1219
+ mirror.style.paddingRight = style.paddingRight;
1220
+ mirror.style.paddingBottom = style.paddingBottom;
1221
+ mirror.style.paddingLeft = style.paddingLeft;
1222
+ mirror.style.borderTopWidth = style.borderTopWidth;
1223
+ mirror.style.borderRightWidth = style.borderRightWidth;
1224
+ mirror.style.borderBottomWidth = style.borderBottomWidth;
1225
+ mirror.style.borderLeftWidth = style.borderLeftWidth;
1226
+ mirror.style.borderStyle = style.borderStyle;
1227
+ mirror.style.whiteSpace = style.whiteSpace;
1228
+ mirror.style.wordBreak = style.wordBreak;
1229
+ mirror.style.overflowWrap = style.overflowWrap;
1230
+ mirror.value = textarea.value;
1231
+ if (!mirror.isConnected) {
1232
+ document.documentElement.appendChild(mirror);
1233
+ }
1234
+ return mirror.scrollHeight;
1235
+ }
1236
+ function applyComposerTextareaHeight(textarea, maxPx = 220, measure = measureComposerContentHeight) {
1237
+ const before = textarea.offsetHeight;
1238
+ const nextPx = Math.min(
1239
+ textarea.scrollHeight > textarea.clientHeight + 1 ? textarea.scrollHeight : measure(textarea),
1240
+ maxPx
1241
+ );
1242
+ if (Math.abs(nextPx - before) < 1) {
1243
+ return;
1244
+ }
1245
+ textarea.style.height = `${nextPx}px`;
1246
+ }
1247
+ var WORKING_CONTROLS_LINGER_MS = 1e3;
1248
+ var NO_ATTACHMENTS = [];
1249
+ var NO_RESOURCES = [];
1250
+ function useLingeringTrue(value, lingerMs) {
1251
+ const [state, setState] = useState4({ value, lingering: false });
1252
+ let current = state;
1253
+ if (state.value !== value) {
1254
+ current = { value, lingering: state.value && !value };
1255
+ setState(current);
1256
+ }
1257
+ const { lingering } = current;
1258
+ const currentValue = current.value;
1259
+ useEffect3(() => {
1260
+ if (!lingering || currentValue) return;
1261
+ const timer = setTimeout(
1262
+ () => setState((latest) => latest.value ? latest : { value: false, lingering: false }),
1263
+ lingerMs
1264
+ );
1265
+ return () => clearTimeout(timer);
1266
+ }, [currentValue, lingering, lingerMs]);
1267
+ return current.value || current.lingering;
1268
+ }
1269
+ function useChatComposerController({
1270
+ delivery,
1271
+ draft,
1272
+ control,
1273
+ effectiveControl,
1274
+ queuedAheadCount = 0,
1275
+ canControlWorkspace = false,
1276
+ controlLinks,
1277
+ disabled = false,
1278
+ attachments,
1279
+ commands: commandsProp,
1280
+ commandContext,
1281
+ onClearView,
1282
+ onPaste,
1283
+ messages: messageOverrides,
1284
+ runControl = "pause",
1285
+ running = false,
1286
+ queuedRecall,
1287
+ imageTags = false
1288
+ }) {
1289
+ const t = useOpenGeniText();
1290
+ const commands = useMemo4(() => commandsProp ?? defaultCommands(t), [commandsProp, t]);
1291
+ const formatError = useErrorMessage();
1292
+ const singleSend = delivery.singleSend === true;
1293
+ const deliveryWorking = delivery.working ?? true;
1294
+ const working = deliveryWorking;
1295
+ const workstreamWorking = useLingeringTrue(
1296
+ deliveryWorking || running,
1297
+ WORKING_CONTROLS_LINGER_MS
1298
+ );
1299
+ const messages = useMemo4(
1300
+ () => ({
1301
+ ...defaultChatComposerMessages(singleSend ? singleSendText(t) : t),
1302
+ ...messageOverrides
1303
+ }),
1304
+ [messageOverrides, singleSend, t]
1305
+ );
1306
+ const id = useId2();
1307
+ const rootRef = useRef4(null);
1308
+ const textareaRef = useRef4(null);
1309
+ const pauseButtonRef = useRef4(null);
1310
+ const fileInputRef = useRef4(null);
1311
+ const listboxId = useId2();
1312
+ const controlPaused = effectiveControl?.state === "paused";
1313
+ const [stoppedHere, setStoppedHere] = useState4(false);
1314
+ useEffect3(() => {
1315
+ if (!controlPaused) setStoppedHere(false);
1316
+ }, [controlPaused]);
1317
+ const resumesOnSend = runControl === "stop" && stoppedHere && controlPaused && effectiveControl?.directState === "paused" && effectiveControl.additionalBlockerCount === 0 && queuedAheadCount === 0;
1318
+ const paused = controlPaused && !resumesOnSend;
1319
+ const [controlDetailsOpen, setControlDetailsOpen] = useState4(false);
1320
+ const [paletteMounted, setPaletteMounted] = useState4(false);
1321
+ const [submitting, setSubmitting] = useState4(false);
1322
+ const [submittingMode, setSubmittingMode] = useState4(null);
1323
+ const submittingRef = useRef4(false);
1324
+ const controlOperationRef = useRef4(false);
1325
+ const deliveryValue = delivery.value;
1326
+ const setDeliveryValue = delivery.setValue;
1327
+ const mountedRef = useRef4(true);
1328
+ const deliveredValueRef = useRef4(deliveryValue);
1329
+ const liveValueRef = useRef4(deliveryValue);
1330
+ const [renderedValue, setRenderedValue] = useState4(deliveryValue);
1331
+ const deliveryChanged = deliveryValue !== deliveredValueRef.current;
1332
+ if (deliveryChanged) {
1333
+ deliveredValueRef.current = deliveryValue;
1334
+ liveValueRef.current = deliveryValue;
1335
+ }
1336
+ const setComposerValue = useCallback2(
1337
+ (next) => {
1338
+ liveValueRef.current = next;
1339
+ setRenderedValue(next);
1340
+ setDeliveryValue(next);
1341
+ },
1342
+ [setDeliveryValue]
1343
+ );
1344
+ const visibleValue = deliveryChanged ? deliveryValue : renderedValue;
1345
+ const imageNumbers = useComposerImageTags({
1346
+ enabled: imageTags,
1347
+ attachments: attachments?.attachments ?? NO_ATTACHMENTS,
1348
+ restoredResources: draft?.restoredResources ?? NO_RESOURCES,
1349
+ loadFileContentType: attachments?.loadFileContentType,
1350
+ readValue: () => liveValueRef.current,
1351
+ setValue: setComposerValue,
1352
+ textareaRef
1353
+ });
1354
+ useLayoutEffect(() => {
1355
+ if (renderedValue !== liveValueRef.current) {
1356
+ setRenderedValue(liveValueRef.current);
1357
+ }
1358
+ }, [deliveryValue, renderedValue]);
1359
+ useEffect3(() => {
1360
+ mountedRef.current = true;
1361
+ return () => {
1362
+ mountedRef.current = false;
1363
+ };
1364
+ }, []);
1365
+ useEffect3(() => {
1366
+ const openControl = (event) => {
1367
+ const requestedId = event instanceof CustomEvent && isRecord(event.detail) && typeof event.detail.composerId === "string" ? event.detail.composerId : null;
1368
+ if (requestedId && requestedId !== id) return;
1369
+ if (!requestedId) {
1370
+ const roots = document.querySelectorAll("[data-og-composer-id]");
1371
+ if (roots.length > 1 && !rootRef.current?.contains(document.activeElement)) return;
1372
+ }
1373
+ textareaRef.current?.scrollIntoView({ block: "end", behavior: "smooth" });
1374
+ if (paused) {
1375
+ setControlDetailsOpen(true);
1376
+ return;
1377
+ }
1378
+ window.requestAnimationFrame(() => pauseButtonRef.current?.focus());
1379
+ };
1380
+ document.addEventListener(OPEN_WORKSTREAM_CONTROL_EVENT, openControl);
1381
+ return () => document.removeEventListener(OPEN_WORKSTREAM_CONTROL_EVENT, openControl);
1382
+ }, [id, paused]);
1383
+ const blockedByAttachment = attachments?.hasUnresolved === true;
1384
+ const [dragging, setDragging] = useState4(false);
1385
+ const dragCarriesFiles = (event) => event.dataTransfer !== null && [...event.dataTransfer.types].includes("Files");
1386
+ const handleDragOver = useCallback2(
1387
+ (event) => {
1388
+ if (!attachments || !dragCarriesFiles(event)) return;
1389
+ event.preventDefault();
1390
+ if (!disabled) setDragging(true);
1391
+ },
1392
+ [attachments, disabled]
1393
+ );
1394
+ const handleDragLeave = useCallback2(
1395
+ (event) => {
1396
+ if (!attachments) return;
1397
+ if (event.currentTarget.contains(event.relatedTarget)) return;
1398
+ setDragging(false);
1399
+ },
1400
+ [attachments]
1401
+ );
1402
+ const handleDrop = useCallback2(
1403
+ (event) => {
1404
+ if (!attachments || !dragCarriesFiles(event)) return;
1405
+ event.preventDefault();
1406
+ setDragging(false);
1407
+ if (!disabled && event.dataTransfer.files.length > 0)
1408
+ attachments.addFiles(event.dataTransfer.files);
1409
+ },
1410
+ [attachments, disabled]
1411
+ );
1412
+ useEffect3(() => {
1413
+ if (disabled) setDragging(false);
1414
+ }, [disabled]);
1415
+ const [notice, setNotice] = useState4(null);
1416
+ const [helpOpen, setHelpOpen] = useState4(false);
1417
+ const [confirmState, setConfirmState] = useState4(null);
1418
+ const pendingConfirm = useRef4(null);
1419
+ const settleConfirmation = useCallback2((confirmed) => {
1420
+ const resolve = pendingConfirm.current;
1421
+ pendingConfirm.current = null;
1422
+ setConfirmState(null);
1423
+ resolve?.(confirmed);
1424
+ }, []);
1425
+ useEffect3(
1426
+ () => () => {
1427
+ pendingConfirm.current?.(false);
1428
+ pendingConfirm.current = null;
1429
+ },
1430
+ []
1431
+ );
1432
+ const resizeInputRafRef = useRef4(null);
1433
+ const resizeInput = useCallback2(() => {
1434
+ if (resizeInputRafRef.current !== null) {
1435
+ return;
1436
+ }
1437
+ resizeInputRafRef.current = requestAnimationFrame(() => {
1438
+ resizeInputRafRef.current = null;
1439
+ const textarea = textareaRef.current;
1440
+ if (!textarea) {
1441
+ return;
1442
+ }
1443
+ applyComposerTextareaHeight(textarea, 220);
1444
+ });
1445
+ }, []);
1446
+ useEffect3(() => resizeInput(), [resizeInput, visibleValue]);
1447
+ useEffect3(
1448
+ () => () => {
1449
+ if (resizeInputRafRef.current !== null) {
1450
+ cancelAnimationFrame(resizeInputRafRef.current);
1451
+ resizeInputRafRef.current = null;
1452
+ }
1453
+ },
1454
+ []
1455
+ );
1456
+ const handlers = useMemo4(
1457
+ () => ({
1458
+ notice: (next) => {
1459
+ setNotice(next);
1460
+ delivery.clearError();
1461
+ },
1462
+ openHelp: () => setHelpOpen(true),
1463
+ clearView: () => {
1464
+ if (!onClearView) return false;
1465
+ onClearView();
1466
+ return true;
1467
+ },
1468
+ confirm: (command) => new Promise((resolve) => {
1469
+ pendingConfirm.current?.(false);
1470
+ pendingConfirm.current = resolve;
1471
+ setConfirmState({ command, resolve: settleConfirmation });
1472
+ })
1473
+ }),
1474
+ [delivery, onClearView, settleConfirmation]
1475
+ );
1476
+ const palette = useSlashCommands({
1477
+ commands,
1478
+ context: commandContext,
1479
+ handlers,
1480
+ value: visibleValue,
1481
+ setValue: setComposerValue
1482
+ });
1483
+ const paletteEnabled = commandContext !== void 0;
1484
+ const commandDraftBlocked = paletteEnabled && palette.isCommandDraft;
1485
+ const annotationsIncomplete = (delivery.annotations ?? []).some(
1486
+ (annotation) => annotation.note.trim().length === 0
1487
+ );
1488
+ const preparing = delivery.preparing === true;
1489
+ const hasDraftText = visibleValue.trim().length > 0 || (attachments?.attachments.length ?? 0) > 0;
1490
+ const waitsForPreparation = preparing && hasDraftText;
1491
+ const heldSendRef = useRef4(null);
1492
+ const heldSendNoticeRef = useRef4(null);
1493
+ const clearHeldSendNotice = useCallback2(() => {
1494
+ const shown = heldSendNoticeRef.current;
1495
+ if (!shown) return;
1496
+ heldSendNoticeRef.current = null;
1497
+ setNotice((current) => current === shown ? null : current);
1498
+ }, []);
1499
+ const latestSendRef = useRef4({ delivery, resumesOnSend, singleSend });
1500
+ useLayoutEffect(() => {
1501
+ latestSendRef.current = { delivery, resumesOnSend, singleSend };
1502
+ });
1503
+ const deliveryCanSend = delivery.canSend;
1504
+ useEffect3(() => {
1505
+ const release = heldSendRef.current;
1506
+ if (!release) return;
1507
+ const ready = deliveryCanSend && !disabled;
1508
+ if (!ready && waitsForPreparation) return;
1509
+ heldSendRef.current = null;
1510
+ release(ready);
1511
+ }, [deliveryCanSend, disabled, waitsForPreparation]);
1512
+ useEffect3(
1513
+ () => () => {
1514
+ heldSendRef.current?.(false);
1515
+ heldSendRef.current = null;
1516
+ },
1517
+ []
1518
+ );
1519
+ const submitBlocker = disabled ? "disabled" : blockedByAttachment ? "attachment" : delivery.sending || submitting ? "sending" : commandDraftBlocked ? "command" : annotationsIncomplete ? "annotations" : delivery.canSend || waitsForPreparation ? null : "empty";
1520
+ const canSubmit = submitBlocker === null;
1521
+ const submit = useCallback2(
1522
+ async (mode) => {
1523
+ clearHeldSendNotice();
1524
+ if (commandDraftBlocked) {
1525
+ setNotice({ tone: "error", message: messages.slashCommandBlocked });
1526
+ delivery.clearError();
1527
+ return false;
1528
+ }
1529
+ if (disabled || blockedByAttachment || delivery.sending || submittingRef.current)
1530
+ return false;
1531
+ if (annotationsIncomplete) {
1532
+ setNotice({ tone: "error", message: messages.annotationNotesRequired });
1533
+ delivery.clearError();
1534
+ delivery.requestAnnotationReview?.();
1535
+ return false;
1536
+ }
1537
+ if (!delivery.canSend && !waitsForPreparation) return false;
1538
+ submittingRef.current = true;
1539
+ setSubmitting(true);
1540
+ setSubmittingMode(mode);
1541
+ try {
1542
+ if (!delivery.canSend) {
1543
+ let gaveUp = false;
1544
+ const ready = await new Promise((resolve) => {
1545
+ const limit = window.setTimeout(() => {
1546
+ if (heldSendRef.current !== settle) return;
1547
+ heldSendRef.current = null;
1548
+ gaveUp = true;
1549
+ resolve(false);
1550
+ }, HELD_SEND_LIMIT_MS);
1551
+ const settle = (value) => {
1552
+ window.clearTimeout(limit);
1553
+ resolve(value);
1554
+ };
1555
+ heldSendRef.current = settle;
1556
+ });
1557
+ if (!ready) {
1558
+ if (gaveUp && mountedRef.current) {
1559
+ const gaveUpNotice = {
1560
+ tone: "error",
1561
+ message: messages.heldSendGaveUp ?? t("composerMessages.heldSendGaveUp")
1562
+ };
1563
+ heldSendNoticeRef.current = gaveUpNotice;
1564
+ setNotice(gaveUpNotice);
1565
+ }
1566
+ return false;
1567
+ }
1568
+ }
1569
+ const current = latestSendRef.current;
1570
+ if (current.resumesOnSend) return await current.delivery.steer();
1571
+ if (mode !== "steer" || current.singleSend) return await current.delivery.send();
1572
+ return current.delivery.sendAlternate ? await current.delivery.sendAlternate() : await current.delivery.steer();
1573
+ } finally {
1574
+ submittingRef.current = false;
1575
+ if (mountedRef.current) {
1576
+ setSubmitting(false);
1577
+ setSubmittingMode(null);
1578
+ }
1579
+ }
1580
+ },
1581
+ [
1582
+ annotationsIncomplete,
1583
+ blockedByAttachment,
1584
+ clearHeldSendNotice,
1585
+ commandDraftBlocked,
1586
+ delivery,
1587
+ disabled,
1588
+ messages.annotationNotesRequired,
1589
+ messages.heldSendGaveUp,
1590
+ messages.slashCommandBlocked,
1591
+ t,
1592
+ waitsForPreparation
1593
+ ]
1594
+ );
1595
+ const recallingRef = useRef4(false);
1596
+ const caretToEndRef = useRef4(false);
1597
+ const placeCaretAtEnd = useCallback2(() => {
1598
+ const textarea = textareaRef.current;
1599
+ if (!textarea) return;
1600
+ textarea.focus();
1601
+ const end = textarea.value.length;
1602
+ textarea.setSelectionRange(end, end);
1603
+ }, []);
1604
+ useLayoutEffect(() => {
1605
+ if (!caretToEndRef.current) return;
1606
+ caretToEndRef.current = false;
1607
+ placeCaretAtEnd();
1608
+ }, [placeCaretAtEnd, visibleValue]);
1609
+ const recallQueued = useCallback2(async () => {
1610
+ if (!queuedRecall || recallingRef.current) return;
1611
+ recallingRef.current = true;
1612
+ try {
1613
+ const outcome = await queuedRecall.recall();
1614
+ if (!mountedRef.current) return;
1615
+ if (outcome === "recalled") {
1616
+ caretToEndRef.current = true;
1617
+ window.requestAnimationFrame(() => {
1618
+ if (!caretToEndRef.current) return;
1619
+ caretToEndRef.current = false;
1620
+ placeCaretAtEnd();
1621
+ });
1622
+ } else if (outcome === "already_sent") {
1623
+ setNotice({
1624
+ tone: "ok",
1625
+ message: messages.queuedPromptAlreadySent ?? t("composerMessages.queuedPromptAlreadySent")
1626
+ });
1627
+ }
1628
+ } catch {
1629
+ } finally {
1630
+ recallingRef.current = false;
1631
+ }
1632
+ }, [messages.queuedPromptAlreadySent, placeCaretAtEnd, queuedRecall, t]);
1633
+ const handleKeyDown = useCallback2(
1634
+ (event) => {
1635
+ if (paletteEnabled && paletteMounted && palette.onKeyDown(event)) return;
1636
+ if (queuedRecall?.available && !disabled && shouldRecallQueuedOnKey(event, {
1637
+ value: event.currentTarget.value,
1638
+ selectionStart: event.currentTarget.selectionStart,
1639
+ selectionEnd: event.currentTarget.selectionEnd,
1640
+ hasOtherContent: (delivery.annotations?.length ?? 0) > 0 || (draft?.restoredResources.length ?? 0) > 0 || (attachments?.attachments.length ?? 0) > 0,
1641
+ popupOpen: paletteEnabled && paletteMounted && palette.open
1642
+ })) {
1643
+ event.preventDefault();
1644
+ void recallQueued();
1645
+ return;
1646
+ }
1647
+ if (!shouldSubmitOnKey(event)) return;
1648
+ event.preventDefault();
1649
+ void submit(shouldSteerOnKey(event) ? "steer" : "queue");
1650
+ },
1651
+ [
1652
+ attachments,
1653
+ delivery.annotations,
1654
+ disabled,
1655
+ draft?.restoredResources,
1656
+ palette,
1657
+ paletteEnabled,
1658
+ paletteMounted,
1659
+ queuedRecall,
1660
+ recallQueued,
1661
+ submit
1662
+ ]
1663
+ );
1664
+ const handlePaste = useCallback2(
1665
+ (event) => {
1666
+ if (disabled) return;
1667
+ onPaste?.(event);
1668
+ attachments?.addFromPaste(event);
1669
+ },
1670
+ [attachments, disabled, onPaste]
1671
+ );
1672
+ const handleFileChange = useCallback2(
1673
+ (event) => {
1674
+ if (!disabled && event.target.files) attachments?.addFiles(event.target.files);
1675
+ event.target.value = "";
1676
+ },
1677
+ [attachments, disabled]
1678
+ );
1679
+ const helpCommands = useMemo4(
1680
+ () => commands.filter((command) => {
1681
+ if (command.permission && commandContext) {
1682
+ const permissions = commandContext.permissions;
1683
+ return permissions.includes(command.permission) || permissions.includes("workspace:admin");
1684
+ }
1685
+ return true;
1686
+ }),
1687
+ [commandContext, commands]
1688
+ );
1689
+ const calmServiceFailure = useCalmServiceFailure(delivery.error);
1690
+ const calmActionFailure = calmServiceFailure && isActionFailure(delivery.error);
1691
+ const serviceUpdating = calmServiceFailure && !calmActionFailure || delivery.reconnecting === true;
1692
+ const activeNotice = notice ?? (calmActionFailure ? { tone: "ok", message: OPENGENI_UPDATING_ACTION_NOTICE(t) } : delivery.error && !calmServiceFailure ? {
1693
+ tone: "error",
1694
+ message: /control changed|paused while/i.test(delivery.error.message) ? messages.controlChangedError : formatError(
1695
+ delivery.error,
1696
+ composerSubmissionErrorMessage(
1697
+ t,
1698
+ delivery.error,
1699
+ delivery.canBuyCredits ?? true
1700
+ ) || messages.sendFailedError
1701
+ )
1702
+ } : null);
1703
+ useEffect3(() => {
1704
+ if (notice?.tone !== "ok") return;
1705
+ const timer = window.setTimeout(
1706
+ () => setNotice((current) => current === notice ? null : current),
1707
+ 2400
1708
+ );
1709
+ return () => window.clearTimeout(timer);
1710
+ }, [notice]);
1711
+ useEffect3(() => {
1712
+ if (annotationsIncomplete) return;
1713
+ setNotice(
1714
+ (current) => current?.message === messages.annotationNotesRequired ? null : current
1715
+ );
1716
+ }, [annotationsIncomplete, messages.annotationNotesRequired]);
1717
+ const attachmentCount = attachments?.attachments.length ?? 0;
1718
+ useEffect3(() => {
1719
+ clearHeldSendNotice();
1720
+ }, [attachmentCount, clearHeldSendNotice, visibleValue]);
1721
+ const runControlOperation = useCallback2(async (operation) => {
1722
+ if (controlOperationRef.current) return false;
1723
+ controlOperationRef.current = true;
1724
+ try {
1725
+ await operation();
1726
+ return true;
1727
+ } finally {
1728
+ controlOperationRef.current = false;
1729
+ }
1730
+ }, []);
1731
+ const pause = useCallback2(
1732
+ async (reason) => {
1733
+ if (!control || control.pausing || control.resuming) return false;
1734
+ return await runControlOperation(() => control.pause(reason));
1735
+ },
1736
+ [control, runControlOperation]
1737
+ );
1738
+ const resume = useCallback2(
1739
+ async (reason) => {
1740
+ if (!control || control.pausing || control.resuming) return false;
1741
+ return await runControlOperation(() => control.resume(reason));
1742
+ },
1743
+ [control, runControlOperation]
1744
+ );
1745
+ const resumeScope = useCallback2(
1746
+ async (option) => {
1747
+ if (!control || control.pausing || control.resuming) return false;
1748
+ return await runControlOperation(() => control.resumeScope(option));
1749
+ },
1750
+ [control, runControlOperation]
1751
+ );
1752
+ const stop = useCallback2(async () => {
1753
+ const stopped = await pause();
1754
+ if (stopped && mountedRef.current) setStoppedHere(true);
1755
+ return stopped;
1756
+ }, [pause]);
1757
+ return {
1758
+ id,
1759
+ rootRef,
1760
+ textareaRef,
1761
+ imageNumbers,
1762
+ pauseButtonRef,
1763
+ fileInputRef,
1764
+ listboxId,
1765
+ effectiveControl,
1766
+ queuedAheadCount,
1767
+ canControlWorkspace,
1768
+ controlLinks,
1769
+ disabled,
1770
+ attachments,
1771
+ messages,
1772
+ sending: delivery.sending || submitting,
1773
+ error: delivery.error,
1774
+ clearError: delivery.clearError,
1775
+ hasDraftState: draft !== void 0,
1776
+ draftConflict: draft?.draftConflict ?? null,
1777
+ draftSaving: draft?.draftSaving ?? false,
1778
+ restoredResources: draft?.restoredResources ?? [],
1779
+ removeRestoredResource: draft?.removeRestoredResource,
1780
+ fileSource: draft?.fileSource,
1781
+ resolveDraftConflict: draft?.resolveDraftConflict,
1782
+ hasControl: control !== void 0,
1783
+ runControl,
1784
+ running,
1785
+ pausing: control?.pausing ?? false,
1786
+ resuming: control?.resuming ?? false,
1787
+ pause,
1788
+ stop,
1789
+ resume,
1790
+ resumeScope,
1791
+ paused,
1792
+ controlDetailsOpen,
1793
+ setControlDetailsOpen,
1794
+ paletteMounted,
1795
+ setPaletteMounted,
1796
+ dragging,
1797
+ handleDragOver,
1798
+ handleDragLeave,
1799
+ handleDrop,
1800
+ palette,
1801
+ paletteEnabled,
1802
+ commandDraftBlocked,
1803
+ confirmState,
1804
+ settleConfirmation,
1805
+ helpOpen,
1806
+ setHelpOpen,
1807
+ helpCommands,
1808
+ activeNotice,
1809
+ /** Opengeni is updating: show the calm reconnecting line, not an error. */
1810
+ serviceUpdating,
1811
+ serviceUpdatingMessage: OPENGENI_UPDATING_NOTICE(t),
1812
+ canSubmit,
1813
+ submitBlocker,
1814
+ submit,
1815
+ busySend: delivery.busySend ?? "queue",
1816
+ singleSend,
1817
+ /** The agent works here (a turn runs or messages wait); Send uses its working wording and the Steer/Queue choice shows. */
1818
+ working,
1819
+ /** This conversation, work it started or a pending wake keeps it working; Pause is offered (lingers briefly). */
1820
+ workstreamWorking,
1821
+ alternateSend: delivery.sendAlternate && working ? delivery.alternateSend ?? null : null,
1822
+ submittingMode,
1823
+ handleKeyDown,
1824
+ handlePaste,
1825
+ handleFileChange,
1826
+ focusInput: () => textareaRef.current?.focus(),
1827
+ setValue: setComposerValue,
1828
+ value: visibleValue
1829
+ };
1830
+ }
1831
+ var ComposerContext = createContext(null);
1832
+ function useComposerController() {
1833
+ const controller = useContext(ComposerContext);
1834
+ if (!controller) throw new Error("useChatComposer must be used inside <Composer.Root>");
1835
+ return controller;
1836
+ }
1837
+ function useChatComposer() {
1838
+ return useComposerController();
1839
+ }
1840
+ function isRecord(value) {
1841
+ return typeof value === "object" && value !== null;
1842
+ }
1843
+ var Root = forwardRef(function ComposerRoot({ controller, children, className, style, responsiveBasis = "viewport", ...props }, forwardedRef) {
1844
+ const responsiveRootRef = useRef4(null);
1845
+ const responsiveContext = useMemo4(
1846
+ () => ({ responsiveBasis, rootRef: responsiveRootRef }),
1847
+ [responsiveBasis]
1848
+ );
1849
+ return /* @__PURE__ */ jsx4(ComposerContext.Provider, { value: controller, children: /* @__PURE__ */ jsx4(ComposerResponsiveContext.Provider, { value: responsiveContext, children: /* @__PURE__ */ jsx4(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs4(
1850
+ "div",
1851
+ {
1852
+ ...props,
1853
+ ref: mergeRefs(controller.rootRef, responsiveRootRef, forwardedRef),
1854
+ "data-og-composer-id": controller.id,
1855
+ "data-og-responsive-basis": responsiveBasis,
1856
+ className: cn("og-root og-composer", className),
1857
+ style: { paddingBottom: "env(safe-area-inset-bottom)", ...style },
1858
+ children: [
1859
+ children,
1860
+ /* @__PURE__ */ jsx4(ComposerAnnouncements, {})
1861
+ ]
1862
+ }
1863
+ ) }) }) });
1864
+ });
1865
+ var Frame = forwardRef(function ComposerFrame({ className, ...props }, ref) {
1866
+ return /* @__PURE__ */ jsx4("div", { ...props, ref, className: cn("relative", className) });
1867
+ });
1868
+ function CommandPalette2({ className }) {
1869
+ const controller = useComposerController();
1870
+ const setPaletteMounted = controller.setPaletteMounted;
1871
+ useEffect3(() => {
1872
+ setPaletteMounted(true);
1873
+ return () => setPaletteMounted(false);
1874
+ }, [setPaletteMounted]);
1875
+ if (!controller.paletteEnabled) return null;
1876
+ return /* @__PURE__ */ jsx4("div", { className, children: /* @__PURE__ */ jsx4(
1877
+ CommandPalette,
1878
+ {
1879
+ open: controller.palette.open && controller.confirmState === null,
1880
+ items: controller.palette.items,
1881
+ highlight: controller.palette.highlight,
1882
+ onHighlight: controller.palette.setHighlight,
1883
+ onRun: (index) => {
1884
+ controller.palette.setHighlight(index);
1885
+ void controller.palette.runAt(index);
1886
+ },
1887
+ argHintText: controller.palette.activeArgHint,
1888
+ listboxId: controller.listboxId,
1889
+ label: controller.messages.slashCommandsLabel,
1890
+ dangerLabel: controller.messages.danger
1891
+ }
1892
+ ) });
1893
+ }
1894
+ var Surface = forwardRef(function ComposerSurface({ className, children, ...props }, ref) {
1895
+ const controller = useComposerController();
1896
+ return /* @__PURE__ */ jsxs4(
1897
+ "div",
1898
+ {
1899
+ "data-og-composer-surface": "",
1900
+ ...props,
1901
+ ref,
1902
+ onDragOver: controller.attachments ? controller.handleDragOver : void 0,
1903
+ onDragLeave: controller.attachments ? controller.handleDragLeave : void 0,
1904
+ onDrop: controller.attachments ? controller.handleDrop : void 0,
1905
+ className: cn(
1906
+ "relative rounded-og-lg border border-og-border/90 bg-og-surface-1 shadow-og-sm",
1907
+ "transition-[border-color,box-shadow] duration-200 ease-og-out",
1908
+ "focus-within:border-og-accent/50 focus-within:shadow-og-glow",
1909
+ controller.dragging && "border-dashed border-og-accent",
1910
+ className
1911
+ ),
1912
+ children: [
1913
+ controller.dragging ? /* @__PURE__ */ jsx4(
1914
+ "div",
1915
+ {
1916
+ "aria-hidden": true,
1917
+ className: cn(
1918
+ "pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
1919
+ "rounded-og-lg bg-og-surface-1/85 text-og-menu font-medium text-og-accent backdrop-blur-[1px]"
1920
+ ),
1921
+ children: /* @__PURE__ */ jsxs4("span", { className: "inline-flex items-center gap-2", children: [
1922
+ /* @__PURE__ */ jsx4(PaperclipIcon, { className: "size-4" }),
1923
+ controller.messages.dropFiles
1924
+ ] })
1925
+ }
1926
+ ) : null,
1927
+ children
1928
+ ]
1929
+ }
1930
+ );
1931
+ });
1932
+ function PausedState() {
1933
+ const controller = useComposerController();
1934
+ if (!controller.paused || !controller.effectiveControl || !controller.hasControl) return null;
1935
+ return /* @__PURE__ */ jsx4(
1936
+ WorkstreamPausedStrip,
1937
+ {
1938
+ control: controller.effectiveControl,
1939
+ queuedAheadCount: controller.queuedAheadCount,
1940
+ open: controller.controlDetailsOpen,
1941
+ busy: controller.resuming,
1942
+ sending: controller.sending,
1943
+ canControlWorkspace: controller.canControlWorkspace,
1944
+ controlLinks: controller.controlLinks,
1945
+ messages: controller.messages,
1946
+ onOpenChange: controller.setControlDetailsOpen,
1947
+ onResume: () => void controller.resume(),
1948
+ onResumeOption: (option) => void controller.resumeScope(option)
1949
+ }
1950
+ );
1951
+ }
1952
+ function RestoredResources() {
1953
+ const controller = useComposerController();
1954
+ const resources = controller.restoredResources;
1955
+ const onRemove = controller.removeRestoredResource;
1956
+ const fileSource = controller.fileSource;
1957
+ const uploadedFileIds = new Set(
1958
+ controller.attachments?.attachments.flatMap(
1959
+ (attachment) => attachment.file ? [attachment.file.id] : []
1960
+ ) ?? []
1961
+ );
1962
+ const restoredFiles = resources.flatMap(
1963
+ (resource, index) => resource.kind === "file" && !uploadedFileIds.has(resource.fileId) ? [{ fileId: resource.fileId, index }] : []
1964
+ );
1965
+ const stored = useStoredFiles(
1966
+ fileSource,
1967
+ restoredFiles.map((file) => file.fileId)
1968
+ );
1969
+ const fileIdByIdRef = useRef4(/* @__PURE__ */ new Map());
1970
+ const previewClient = fileSource?.client;
1971
+ const previewWorkspaceId = fileSource?.workspaceId;
1972
+ const previewSessionId = fileSource?.sessionId;
1973
+ const loadPreview = useMemo4(
1974
+ () => previewClient && previewWorkspaceId !== void 0 && typeof previewClient.createFileDownloadUrl === "function" ? async (id) => {
1975
+ const fileId = fileIdByIdRef.current.get(id);
1976
+ return fileId ? await readStoredFilePreviewUrl(
1977
+ {
1978
+ client: previewClient,
1979
+ workspaceId: previewWorkspaceId,
1980
+ sessionId: previewSessionId
1981
+ },
1982
+ fileId
1983
+ ) : void 0;
1984
+ } : void 0,
1985
+ [previewClient, previewSessionId, previewWorkspaceId]
1986
+ );
1987
+ if (resources.length === 0 || !onRemove) return null;
1988
+ const fileEntries = stored.ready ? restoredFiles.flatMap(({ fileId, index }) => {
1989
+ const file = stored.files.get(fileId);
1990
+ return file ? [
1991
+ {
1992
+ index,
1993
+ attachment: storedFileAttachment(`restored-resource:${index}:${file.id}`, file)
1994
+ }
1995
+ ] : [];
1996
+ }) : [];
1997
+ const shownFileIds = new Set(fileEntries.map((entry) => entry.attachment.file.id));
1998
+ const otherEntries = resources.flatMap(
1999
+ (resource, index) => resource.kind !== "file" || stored.ready && !uploadedFileIds.has(resource.fileId) && !shownFileIds.has(resource.fileId) ? [{ resource, index }] : []
2000
+ );
2001
+ const indexById = new Map(fileEntries.map((entry) => [entry.attachment.id, entry.index]));
2002
+ fileIdByIdRef.current = new Map(
2003
+ fileEntries.map((entry) => [entry.attachment.id, entry.attachment.file.id])
2004
+ );
2005
+ const imageNumbers = controller.imageNumbers;
2006
+ const restoredImageNumbers = imageNumbers ? new Map(
2007
+ fileEntries.flatMap((entry) => {
2008
+ const number = imageNumbers.get(restoredImageKey(entry.attachment.file.id));
2009
+ return number === void 0 ? [] : [[entry.attachment.id, number]];
2010
+ })
2011
+ ) : void 0;
2012
+ return /* @__PURE__ */ jsxs4(Fragment2, { children: [
2013
+ fileEntries.length > 0 ? /* @__PURE__ */ jsx4(
2014
+ AttachmentChips,
2015
+ {
2016
+ className: ATTACHMENT_CHIPS_PADDING,
2017
+ attachments: fileEntries.map((entry) => entry.attachment),
2018
+ messages: controller.messages,
2019
+ disabled: controller.disabled,
2020
+ onRemove: (id) => {
2021
+ const index = indexById.get(id);
2022
+ if (index !== void 0) onRemove(index);
2023
+ },
2024
+ onLoadPreview: loadPreview,
2025
+ imageNumbers: restoredImageNumbers
2026
+ }
2027
+ ) : null,
2028
+ otherEntries.length > 0 ? /* @__PURE__ */ jsx4(
2029
+ RestoredResourceChips,
2030
+ {
2031
+ entries: otherEntries,
2032
+ messages: controller.messages,
2033
+ onRemove,
2034
+ imageNumbers: controller.imageNumbers
2035
+ }
2036
+ ) : null
2037
+ ] });
2038
+ }
2039
+ var ATTACHMENT_CHIPS_PADDING = "px-3 pt-2 pb-0.5";
2040
+ function Attachments() {
2041
+ const controller = useComposerController();
2042
+ if (!controller.attachments || controller.attachments.attachments.length === 0) return null;
2043
+ return /* @__PURE__ */ jsx4(
2044
+ AttachmentChips,
2045
+ {
2046
+ className: ATTACHMENT_CHIPS_PADDING,
2047
+ attachments: controller.attachments.attachments,
2048
+ messages: controller.messages,
2049
+ disabled: controller.disabled,
2050
+ onRemove: controller.attachments.remove,
2051
+ onRetry: controller.attachments.retry,
2052
+ onRetainPreview: controller.attachments.retainPreview,
2053
+ onLoadPreview: controller.attachments.loadPreview,
2054
+ imageNumbers: controller.imageNumbers
2055
+ }
2056
+ );
2057
+ }
2058
+ var EDITING_FOCUS_SELECTOR = 'input, textarea, select, [contenteditable="true"], [role="textbox"]';
2059
+ var POPUP_FOCUS_SELECTOR = '[role="menu"], [role="menubar"], [role="listbox"], [role="dialog"], [role="alertdialog"]';
2060
+ function focusBelongsElsewhere(textarea) {
2061
+ const active = textarea.ownerDocument.activeElement;
2062
+ if (!active || active === textarea) return false;
2063
+ if (active.closest(EDITING_FOCUS_SELECTOR)) return true;
2064
+ const popup = active.closest(POPUP_FOCUS_SELECTOR);
2065
+ if (popup) return !popup.contains(textarea);
2066
+ return active !== textarea.ownerDocument.body && active !== textarea.ownerDocument.documentElement;
2067
+ }
2068
+ var Input = forwardRef(function ComposerInput({ rows = 1, placeholder, className, "aria-label": ariaLabel, autoFocus = false, ...props }, forwardedRef) {
2069
+ const controller = useComposerController();
2070
+ const autoFocusedRef = useRef4(false);
2071
+ const paletteOpen = controller.paletteEnabled && controller.paletteMounted && controller.palette.open;
2072
+ useEffect3(() => {
2073
+ if (!autoFocus || controller.disabled || autoFocusedRef.current) return;
2074
+ const frame = window.requestAnimationFrame(() => {
2075
+ const textarea = controller.textareaRef.current;
2076
+ if (!textarea || textarea.disabled) return;
2077
+ autoFocusedRef.current = true;
2078
+ if (focusBelongsElsewhere(textarea)) return;
2079
+ textarea.focus();
2080
+ });
2081
+ return () => window.cancelAnimationFrame(frame);
2082
+ }, [autoFocus, controller.disabled, controller.textareaRef]);
2083
+ useEffect3(() => {
2084
+ const textarea = controller.textareaRef.current;
2085
+ if (!textarea || typeof ResizeObserver === "undefined") return;
2086
+ let width = textarea.clientWidth;
2087
+ let frame = null;
2088
+ const observer = new ResizeObserver(() => {
2089
+ if (textarea.clientWidth === width) return;
2090
+ width = textarea.clientWidth;
2091
+ if (frame !== null) return;
2092
+ frame = window.requestAnimationFrame(() => {
2093
+ frame = null;
2094
+ applyComposerTextareaHeight(textarea, 220);
2095
+ });
2096
+ });
2097
+ observer.observe(textarea);
2098
+ return () => {
2099
+ observer.disconnect();
2100
+ if (frame !== null) window.cancelAnimationFrame(frame);
2101
+ };
2102
+ }, [controller.textareaRef]);
2103
+ return /* @__PURE__ */ jsx4(
2104
+ "textarea",
2105
+ {
2106
+ ...props,
2107
+ ref: mergeRefs(controller.textareaRef, forwardedRef),
2108
+ rows,
2109
+ value: controller.value,
2110
+ onChange: (event) => controller.setValue(event.target.value),
2111
+ onKeyDown: controller.handleKeyDown,
2112
+ onPaste: controller.handlePaste,
2113
+ placeholder: controller.paused && !controller.disabled ? controller.messages.pausedPlaceholder : placeholder ?? controller.messages.messagePlaceholder,
2114
+ disabled: controller.disabled,
2115
+ "aria-label": ariaLabel ?? controller.messages.inputLabel,
2116
+ "aria-keyshortcuts": "Enter Meta+Enter Control+Enter Shift+Enter",
2117
+ "aria-autocomplete": controller.paletteEnabled && controller.paletteMounted ? "list" : void 0,
2118
+ "aria-controls": paletteOpen ? controller.listboxId : void 0,
2119
+ "aria-activedescendant": paletteOpen ? `${controller.listboxId}-option-${controller.palette.highlight}` : void 0,
2120
+ className: cn(
2121
+ "og-composer-input block w-full resize-none bg-transparent px-3.5 pt-3 pb-1 text-og-composer md:px-4 md:text-og-composer-wide pointer-coarse:min-h-11",
2122
+ "text-og-fg placeholder:text-og-fg-subtle focus:outline-hidden focus-visible:outline-hidden",
2123
+ "disabled:cursor-not-allowed disabled:opacity-60",
2124
+ className
2125
+ )
2126
+ }
2127
+ );
2128
+ });
2129
+ function Confirmation() {
2130
+ const controller = useComposerController();
2131
+ const command = controller.confirmState?.command;
2132
+ if (!command || !controller.confirmState) return null;
2133
+ return /* @__PURE__ */ jsx4(
2134
+ ConfirmBar,
2135
+ {
2136
+ command,
2137
+ messages: controller.messages,
2138
+ onCancel: () => controller.settleConfirmation(false),
2139
+ onConfirm: () => controller.settleConfirmation(true),
2140
+ returnFocusRef: controller.textareaRef
2141
+ }
2142
+ );
2143
+ }
2144
+ var Footer = forwardRef(function ComposerFooter({ className, children, ...props }, ref) {
2145
+ const signals = useComposerFooterSignalState();
2146
+ return /* @__PURE__ */ jsx4(
2147
+ "div",
2148
+ {
2149
+ ...props,
2150
+ ...signals.attributes,
2151
+ ref,
2152
+ className: cn(
2153
+ "og-composer-footer flex items-end gap-1.5 px-2 pb-2 pt-0.5 sm:px-2.5 sm:pb-2.5",
2154
+ // Mobile: one control row — never wrap into a second toolbar line.
2155
+ "max-sm:flex-nowrap max-sm:items-center max-sm:gap-1",
2156
+ className
2157
+ ),
2158
+ children: /* @__PURE__ */ jsx4(ComposerFooterSignalProvider, { value: signals.report, children })
2159
+ }
2160
+ );
2161
+ });
2162
+ var Controls = forwardRef(
2163
+ function ComposerControls({ className, ...props }, ref) {
2164
+ return /* @__PURE__ */ jsx4(
2165
+ "span",
2166
+ {
2167
+ ...props,
2168
+ ref,
2169
+ className: cn(
2170
+ "og-composer-controls flex min-w-0 flex-1 flex-wrap items-center gap-1.5",
2171
+ // Phone: 44px touch targets already space themselves; tight gaps leave
2172
+ // the model pill room for its name.
2173
+ "max-sm:flex-nowrap max-sm:gap-0.5",
2174
+ className
2175
+ )
2176
+ }
2177
+ );
2178
+ }
2179
+ );
2180
+ var Hint = forwardRef(function ComposerHint({ className, children, ...props }, ref) {
2181
+ const controller = useComposerController();
2182
+ return /* @__PURE__ */ jsx4(
2183
+ "span",
2184
+ {
2185
+ ...props,
2186
+ ref,
2187
+ className: cn(
2188
+ "og-composer-hint min-w-0 flex-1 px-1.5 text-og-xs text-og-fg-subtle max-sm:hidden",
2189
+ className
2190
+ ),
2191
+ children: children ?? controller.messages.keyboardHint
2192
+ }
2193
+ );
2194
+ });
2195
+ var Actions = forwardRef(function ComposerActions({ className, ...props }, ref) {
2196
+ return /* @__PURE__ */ jsx4(
2197
+ "span",
2198
+ {
2199
+ ...props,
2200
+ ref,
2201
+ className: cn(
2202
+ "og-composer-actions ml-auto flex shrink-0 items-center gap-1.5",
2203
+ "max-sm:flex-nowrap max-sm:gap-0.5",
2204
+ className
2205
+ )
2206
+ }
2207
+ );
2208
+ });
2209
+ var AttachButton = forwardRef(
2210
+ function ComposerAttachButton({ accept, multiple = true, className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2211
+ const controller = useComposerController();
2212
+ if (!controller.attachments) return null;
2213
+ const tip = title ?? controller.messages.attachFiles;
2214
+ return /* @__PURE__ */ jsxs4(Fragment2, { children: [
2215
+ /* @__PURE__ */ jsx4(
2216
+ "input",
2217
+ {
2218
+ ref: controller.fileInputRef,
2219
+ type: "file",
2220
+ accept,
2221
+ multiple,
2222
+ "data-og-composer-attach": true,
2223
+ className: "hidden",
2224
+ onChange: controller.handleFileChange
2225
+ }
2226
+ ),
2227
+ /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2228
+ "button",
2229
+ {
2230
+ ...props,
2231
+ ref,
2232
+ type: "button",
2233
+ disabled: controller.disabled,
2234
+ onClick: () => controller.fileInputRef.current?.click(),
2235
+ "aria-label": ariaLabel ?? tip,
2236
+ className: cn(
2237
+ "inline-flex size-8 items-center justify-center rounded-og-md",
2238
+ "text-og-fg-muted transition-colors duration-150 hover:bg-og-surface-2 hover:text-og-fg",
2239
+ "disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11",
2240
+ className
2241
+ ),
2242
+ children: children ?? /* @__PURE__ */ jsx4(PaperclipIcon, { className: "size-4" })
2243
+ }
2244
+ ) })
2245
+ ] });
2246
+ }
2247
+ );
2248
+ function ModelPicker2({
2249
+ models,
2250
+ rows,
2251
+ value,
2252
+ onChange,
2253
+ label,
2254
+ className,
2255
+ codexOnly
2256
+ }) {
2257
+ const controller = useComposerController();
2258
+ return /* @__PURE__ */ jsx4(
2259
+ ModelPicker,
2260
+ {
2261
+ models,
2262
+ rows,
2263
+ value,
2264
+ onChange: (modelId) => onChange?.(modelId),
2265
+ disabled: controller.disabled,
2266
+ label: label ?? controller.messages.modelLabel,
2267
+ className,
2268
+ codexOnly
2269
+ }
2270
+ );
2271
+ }
2272
+ function pausePresence(controller) {
2273
+ if (controller.runControl !== "pause" || !controller.effectiveControl || controller.paused || !controller.hasControl)
2274
+ return "none";
2275
+ return controller.workstreamWorking ? "shown" : "reserved";
2276
+ }
2277
+ var PAUSE_BOX_CLASS = "inline-flex size-8 items-center justify-center pointer-coarse:size-11";
2278
+ var PAUSE_YIELDS_CLASS = "og-composer-pause-yields max-sm:hidden";
2279
+ function PauseButtonSlot() {
2280
+ const controller = useComposerController();
2281
+ if (pausePresence(controller) !== "reserved") return null;
2282
+ return /* @__PURE__ */ jsx4(
2283
+ "span",
2284
+ {
2285
+ "aria-hidden": true,
2286
+ "data-og-composer-pause-slot": "",
2287
+ className: cn(
2288
+ PAUSE_BOX_CLASS,
2289
+ "invisible shrink-0",
2290
+ controller.submitBlocker !== "empty" && PAUSE_YIELDS_CLASS
2291
+ )
2292
+ }
2293
+ );
2294
+ }
2295
+ var PauseButton = forwardRef(
2296
+ function ComposerPauseButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2297
+ const controller = useComposerController();
2298
+ if (pausePresence(controller) !== "shown") return null;
2299
+ const busy = controller.pausing || controller.resuming;
2300
+ const tip = title ?? controller.messages.pauseTitle;
2301
+ const yieldsToDraft = controller.submitBlocker !== "empty";
2302
+ return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2303
+ "button",
2304
+ {
2305
+ "data-analytics-action": "pause",
2306
+ ...props,
2307
+ ref: mergeRefs(controller.pauseButtonRef, ref),
2308
+ type: "button",
2309
+ onClick: () => void controller.pause(),
2310
+ disabled: busy,
2311
+ "aria-label": ariaLabel ?? controller.messages.pauseAriaLabel,
2312
+ className: cn(
2313
+ PAUSE_BOX_CLASS,
2314
+ "rounded-og-md border border-og-border",
2315
+ "bg-og-surface-2 text-og-fg-muted transition-colors duration-150",
2316
+ "hover:border-og-status-waiting/50 hover:text-og-status-waiting",
2317
+ "disabled:opacity-50",
2318
+ yieldsToDraft && PAUSE_YIELDS_CLASS,
2319
+ className
2320
+ ),
2321
+ children: children ?? (busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon2, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(PauseIcon, { className: "size-3.5 fill-current" }))
2322
+ }
2323
+ ) });
2324
+ }
2325
+ );
2326
+ var StopButton = forwardRef(
2327
+ function ComposerStopButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2328
+ const t = useOpenGeniText();
2329
+ const controller = useComposerController();
2330
+ if (controller.runControl !== "stop" || !controller.running || !controller.hasControl || controller.effectiveControl?.state === "paused")
2331
+ return null;
2332
+ const busy = controller.pausing;
2333
+ const label = ariaLabel ?? controller.messages.stopAriaLabel ?? t("composer.stop");
2334
+ const tip = title ?? controller.messages.stopTitle ?? label;
2335
+ return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2336
+ "button",
2337
+ {
2338
+ "data-analytics-action": "stop",
2339
+ "data-og-composer-stop": "",
2340
+ ...props,
2341
+ ref,
2342
+ type: "button",
2343
+ onClick: () => void controller.stop(),
2344
+ disabled: busy,
2345
+ "aria-label": label,
2346
+ className: cn(
2347
+ "inline-flex size-8 items-center justify-center rounded-og-md border border-og-border pointer-coarse:size-11",
2348
+ "bg-og-surface-1 text-og-fg transition-colors duration-150",
2349
+ "hover:bg-og-surface-2 disabled:opacity-50",
2350
+ className
2351
+ ),
2352
+ children: children ?? (busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon2, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(SquareIcon, { className: "size-3 fill-current" }))
2353
+ }
2354
+ ) });
2355
+ }
2356
+ );
2357
+ var AlternateSendButton = forwardRef(
2358
+ function ComposerAlternateSendButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2359
+ const t = useOpenGeniText();
2360
+ const controller = useComposerController();
2361
+ if (controller.alternateSend === null || controller.paused || controller.submitBlocker === "empty" || controller.submitBlocker === "disabled")
2362
+ return null;
2363
+ const queues = controller.alternateSend === "queue";
2364
+ const label = queues ? controller.messages.queueLabel ?? t("composerMessages.queue") : controller.messages.steerLabel ?? t("composerMessages.steer");
2365
+ const tip = title ?? (controller.submitBlocker === "annotations" ? controller.messages.annotationNotesRequired : queues ? controller.messages.queueTitle ?? t("composerMessages.queueRunsAfterCurrentWork") : controller.messages.steerTitle ?? t("composerMessages.steerReadsItSoon"));
2366
+ const inFlight = controller.sending && controller.submittingMode === "steer";
2367
+ return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2368
+ "button",
2369
+ {
2370
+ "data-analytics-action": queues ? "queue" : "steer",
2371
+ "data-og-composer-alternate-send": "",
2372
+ ...props,
2373
+ ref,
2374
+ type: "button",
2375
+ onClick: (event) => {
2376
+ const hadFocus = event.currentTarget === document.activeElement;
2377
+ void controller.submit("steer").then((sent) => {
2378
+ if (sent && hadFocus) controller.focusInput();
2379
+ });
2380
+ },
2381
+ disabled: !controller.canSubmit,
2382
+ "aria-label": ariaLabel ?? label,
2383
+ "aria-keyshortcuts": "Meta+Enter Control+Enter",
2384
+ className: cn(
2385
+ "inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-og-md px-2.5 pointer-coarse:h-11 pointer-coarse:px-3.5",
2386
+ "border border-og-border bg-og-surface-1 text-og-control font-medium text-og-fg",
2387
+ "transition-[background-color,transform,opacity] duration-150 ease-og-spring",
2388
+ "hover:bg-og-surface-2 active:scale-95",
2389
+ "disabled:cursor-not-allowed disabled:opacity-50",
2390
+ className
2391
+ ),
2392
+ children: children ?? (inFlight ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
2393
+ /* @__PURE__ */ jsx4(LoaderCircleIcon2, { "aria-hidden": "true", className: "size-3.5 animate-og-spin" }),
2394
+ /* @__PURE__ */ jsx4("span", { children: label })
2395
+ ] }) : label)
2396
+ }
2397
+ ) });
2398
+ }
2399
+ );
2400
+ var SendButton = forwardRef(
2401
+ function ComposerSendButton({ className, "aria-label": ariaLabel, title, children, ...props }, ref) {
2402
+ const controller = useComposerController();
2403
+ const tip = title ?? (controller.submitBlocker === "annotations" ? controller.messages.annotationNotesRequired : controller.paused ? controller.messages.sendAndResumeTitle : !controller.working ? controller.messages.idleSendTitle ?? controller.messages.sendTitle : controller.busySend === "steer" ? controller.messages.steerSendTitle ?? controller.messages.sendTitle : controller.messages.sendTitle);
2404
+ return /* @__PURE__ */ jsx4(ComposerTip, { tip, children: /* @__PURE__ */ jsx4(
2405
+ "button",
2406
+ {
2407
+ "data-analytics-action": "send",
2408
+ ...props,
2409
+ ref,
2410
+ type: "button",
2411
+ onClick: (event) => {
2412
+ const hadFocus = event.currentTarget === document.activeElement;
2413
+ void controller.submit("queue").then((sent) => {
2414
+ if (sent && hadFocus) controller.focusInput();
2415
+ });
2416
+ },
2417
+ disabled: !controller.canSubmit,
2418
+ "data-og-tip": tip,
2419
+ "aria-label": ariaLabel ?? (controller.paused ? controller.messages.sendAndResumeAriaLabel : controller.messages.sendMessageAriaLabel),
2420
+ className: cn(
2421
+ "inline-flex size-8 items-center justify-center rounded-og-md pointer-coarse:size-11",
2422
+ "border border-og-primary-border bg-og-primary text-og-primary-fg",
2423
+ "transition-[background-color,transform,opacity] duration-150 ease-og-spring",
2424
+ "hover:bg-og-primary-hover active:scale-95",
2425
+ "disabled:cursor-not-allowed disabled:opacity-50",
2426
+ className
2427
+ ),
2428
+ children: children ?? (controller.sending && controller.submittingMode !== "steer" ? /* @__PURE__ */ jsx4(LoaderCircleIcon2, { className: "size-4 animate-og-spin" }) : /* @__PURE__ */ jsx4(ArrowUpIcon, { className: "size-4" }))
2429
+ }
2430
+ ) });
2431
+ }
2432
+ );
2433
+ function Help() {
2434
+ const controller = useComposerController();
2435
+ return /* @__PURE__ */ jsx4(AnimatePresence2, { children: controller.helpOpen ? /* @__PURE__ */ jsx4(
2436
+ HelpPanel,
2437
+ {
2438
+ commands: controller.helpCommands,
2439
+ messages: controller.messages,
2440
+ onClose: () => controller.setHelpOpen(false)
2441
+ }
2442
+ ) : null });
2443
+ }
2444
+ function Status() {
2445
+ const controller = useComposerController();
2446
+ return /* @__PURE__ */ jsxs4(Fragment2, { children: [
2447
+ /* @__PURE__ */ jsx4(AnimatePresence2, { children: controller.activeNotice ? (
2448
+ // Visible only: the composer root's ComposerAnnouncements region
2449
+ // already announces this notice, so a second live region here would
2450
+ // make screen readers read it twice.
2451
+ /* @__PURE__ */ jsx4(
2452
+ motion2.p,
2453
+ {
2454
+ initial: { opacity: 0, height: 0 },
2455
+ animate: { opacity: 1, height: "auto" },
2456
+ exit: { opacity: 0, height: 0 },
2457
+ className: cn(
2458
+ "overflow-hidden px-1 pt-1.5 text-og-control",
2459
+ controller.activeNotice.tone === "ok" ? "text-og-fg-muted" : "text-og-status-failed"
2460
+ ),
2461
+ children: controller.activeNotice.message
2462
+ },
2463
+ "notice"
2464
+ )
2465
+ ) : controller.serviceUpdating ? /* @__PURE__ */ jsxs4(
2466
+ motion2.p,
2467
+ {
2468
+ "data-og-composer-status": "updating",
2469
+ initial: { opacity: 0, height: 0 },
2470
+ animate: { opacity: 1, height: "auto" },
2471
+ exit: { opacity: 0, height: 0 },
2472
+ className: "flex items-center gap-1.5 overflow-hidden px-1 pt-1.5 text-og-control text-og-fg-muted",
2473
+ children: [
2474
+ /* @__PURE__ */ jsx4(
2475
+ LoaderCircleIcon2,
2476
+ {
2477
+ "aria-hidden": "true",
2478
+ className: "size-3.5 shrink-0 animate-og-spin motion-reduce:animate-none"
2479
+ }
2480
+ ),
2481
+ /* @__PURE__ */ jsx4("span", { children: controller.serviceUpdatingMessage })
2482
+ ]
2483
+ },
2484
+ "service-updating"
2485
+ ) : null }),
2486
+ controller.draftConflict ? /* @__PURE__ */ jsxs4("div", { className: "mt-1.5 flex flex-wrap items-center gap-2 px-1 text-og-xs text-og-status-failed", children: [
2487
+ /* @__PURE__ */ jsx4("span", { className: "min-w-0 flex-1", children: controller.messages.draftConflict }),
2488
+ /* @__PURE__ */ jsx4(
2489
+ "button",
2490
+ {
2491
+ type: "button",
2492
+ className: "underline underline-offset-2",
2493
+ onClick: () => void controller.resolveDraftConflict?.("use_remote"),
2494
+ children: controller.messages.useOtherDraft
2495
+ }
2496
+ ),
2497
+ /* @__PURE__ */ jsx4(
2498
+ "button",
2499
+ {
2500
+ type: "button",
2501
+ className: "font-medium underline underline-offset-2",
2502
+ onClick: () => void controller.resolveDraftConflict?.("keep_mine"),
2503
+ children: controller.messages.keepMine
2504
+ }
2505
+ )
2506
+ ] }) : null
2507
+ ] });
2508
+ }
2509
+ function ComposerAnnouncements() {
2510
+ const controller = useComposerController();
2511
+ return /* @__PURE__ */ jsxs4("div", { className: "sr-only", children: [
2512
+ controller.activeNotice ? /* @__PURE__ */ jsx4("p", { role: controller.activeNotice.tone === "error" ? "alert" : "status", children: controller.activeNotice.message }) : controller.serviceUpdating ? /* @__PURE__ */ jsx4("p", { role: "status", children: controller.serviceUpdatingMessage }) : null,
2513
+ controller.draftConflict ? /* @__PURE__ */ jsx4("p", { role: "alert", children: controller.messages.draftConflict }) : null
2514
+ ] });
2515
+ }
2516
+ function mergeRefs(...refs) {
2517
+ return (node) => {
2518
+ for (const ref of refs) {
2519
+ if (typeof ref === "function") ref(node);
2520
+ else if (ref) ref.current = node;
2521
+ }
2522
+ };
2523
+ }
2524
+ function WorkstreamPausedStrip({
2525
+ control,
2526
+ queuedAheadCount,
2527
+ open,
2528
+ busy,
2529
+ sending,
2530
+ canControlWorkspace,
2531
+ controlLinks,
2532
+ messages,
2533
+ onOpenChange,
2534
+ onResume,
2535
+ onResumeOption
2536
+ }) {
2537
+ const blocker = control.primaryBlocker;
2538
+ const cause = blocker?.kind === "workspace" ? messages.workspacePaused : control.directState === "paused" ? messages.pausedHere : messages.pausedBy(blocker?.displayName ?? messages.parentBlocker);
2539
+ const primary = control.resumeOptions.find((option) => option.scope === "selected");
2540
+ const broaderOptions = control.resumeOptions.filter(
2541
+ (option) => option !== primary && option.scope !== "selected" && (option.scope !== "workspace" || canControlWorkspace)
2542
+ );
2543
+ return /* @__PURE__ */ jsxs4("div", { className: "border-b border-og-status-waiting/25 bg-og-status-waiting/[0.07]", children: [
2544
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 px-3 py-2", children: [
2545
+ /* @__PURE__ */ jsx4(PauseIcon, { className: "size-3.5 shrink-0 text-og-status-waiting" }),
2546
+ /* @__PURE__ */ jsxs4(
2547
+ "button",
2548
+ {
2549
+ type: "button",
2550
+ className: "min-w-0 flex-1 text-left",
2551
+ onClick: () => onOpenChange(!open),
2552
+ "aria-expanded": open,
2553
+ children: [
2554
+ /* @__PURE__ */ jsx4("span", { className: "block truncate text-og-xs font-medium text-og-fg", children: cause }),
2555
+ /* @__PURE__ */ jsx4("span", { className: "block truncate text-[11px] text-og-fg-muted", children: queuedAheadCount > 0 ? messages.queuedAhead(queuedAheadCount) : sending ? messages.resumingAndSending : messages.nextMessageResumes })
2556
+ ]
2557
+ }
2558
+ ),
2559
+ /* @__PURE__ */ jsxs4(
2560
+ "button",
2561
+ {
2562
+ type: "button",
2563
+ "aria-label": messages.resumeThisWorkstream,
2564
+ className: "inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-og-md border border-og-primary-border bg-og-primary px-2.5 text-og-xs font-medium text-og-primary-fg hover:bg-og-primary-hover disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:min-h-11",
2565
+ disabled: busy,
2566
+ onClick: onResume,
2567
+ children: [
2568
+ busy ? /* @__PURE__ */ jsx4(LoaderCircleIcon2, { className: "size-3.5 animate-og-spin" }) : /* @__PURE__ */ jsx4(PlayIcon, { className: "size-3.5 fill-current" }),
2569
+ /* @__PURE__ */ jsx4("span", { className: "og-composer-resume-label-long hidden min-[400px]:inline", children: messages.resumeThisWorkstream }),
2570
+ /* @__PURE__ */ jsx4("span", { className: "og-composer-resume-label-short min-[400px]:hidden", children: messages.resumeShort })
2571
+ ]
2572
+ }
2573
+ ),
2574
+ /* @__PURE__ */ jsx4(
2575
+ "button",
2576
+ {
2577
+ type: "button",
2578
+ className: "inline-flex size-8 shrink-0 items-center justify-center rounded-og-md text-og-fg-muted hover:bg-og-surface-2 pointer-coarse:size-11",
2579
+ onClick: () => onOpenChange(!open),
2580
+ "aria-label": open ? messages.hidePauseDetails : messages.showPauseDetails,
2581
+ children: /* @__PURE__ */ jsx4(ChevronDownIcon2, { className: cn("size-3.5 transition-transform", open && "rotate-180") })
2582
+ }
2583
+ )
2584
+ ] }),
2585
+ open ? /* @__PURE__ */ jsxs4("div", { className: "border-t border-og-status-waiting/20 px-3 pb-3 pt-2", children: [
2586
+ /* @__PURE__ */ jsx4("ul", { className: "grid gap-2", "aria-label": messages.pauseReasonsLabel, children: control.blockers.map((entry, index) => /* @__PURE__ */ jsxs4(
2587
+ "li",
2588
+ {
2589
+ className: "text-og-xs",
2590
+ children: [
2591
+ /* @__PURE__ */ jsx4("span", { className: "font-medium text-og-fg", children: index === 0 ? messages.pausedByLabel : messages.alsoPausedByLabel }),
2592
+ blockerHref(entry, controlLinks) ? /* @__PURE__ */ jsx4(
2593
+ "a",
2594
+ {
2595
+ href: blockerHref(entry, controlLinks),
2596
+ className: "font-medium text-og-fg underline decoration-og-border-strong underline-offset-2 hover:text-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent/40",
2597
+ children: entry.displayName
2598
+ }
2599
+ ) : /* @__PURE__ */ jsx4("span", { className: "font-medium text-og-fg", children: entry.displayName }),
2600
+ entry.reason ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-muted", children: [
2601
+ " \xB7 ",
2602
+ entry.reason
2603
+ ] }) : null,
2604
+ entry.actor ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-subtle", children: [
2605
+ " \xB7 ",
2606
+ entry.actor
2607
+ ] }) : null,
2608
+ entry.changedAt ? /* @__PURE__ */ jsxs4("span", { className: "text-og-fg-subtle", children: [
2609
+ " ",
2610
+ "\xB7 ",
2611
+ messages.formatRelativeTime(entry.changedAt)
2612
+ ] }) : null
2613
+ ]
2614
+ },
2615
+ `${entry.kind}-${entry.sessionId ?? "workspace"}-${entry.revision}`
2616
+ )) }),
2617
+ broaderOptions.length > 0 ? /* @__PURE__ */ jsx4("div", { className: "mt-2 flex flex-wrap gap-1.5", children: broaderOptions.map((option) => /* @__PURE__ */ jsx4(
2618
+ ComposerTip,
2619
+ {
2620
+ tip: option.impactCopy,
2621
+ children: /* @__PURE__ */ jsxs4(
2622
+ "button",
2623
+ {
2624
+ type: "button",
2625
+ disabled: busy,
2626
+ onClick: () => onResumeOption(option),
2627
+ className: "rounded-og-md border border-og-border bg-og-surface-1 px-2 py-1 text-og-xs text-og-fg-muted hover:bg-og-surface-2 hover:text-og-fg pointer-coarse:min-h-10",
2628
+ children: [
2629
+ /* @__PURE__ */ jsx4("span", { className: "block font-medium", children: option.scope === "workspace" ? messages.resumeWorkspace : messages.resumeFromSession }),
2630
+ /* @__PURE__ */ jsx4("span", { className: "block text-[10px] text-og-fg-subtle", children: option.selectedStateAfter === "active" ? messages.sessionCanRun : messages.stillPausedBy(
2631
+ option.remainingPrimaryBlocker?.displayName ?? messages.narrowerPause
2632
+ ) })
2633
+ ]
2634
+ }
2635
+ )
2636
+ },
2637
+ `${option.scope}-${option.targetId ?? "selected"}`
2638
+ )) }) : null
2639
+ ] }) : null
2640
+ ] });
2641
+ }
2642
+ function blockerHref(blocker, links) {
2643
+ if (blocker.kind === "workspace") return links?.workspaceHref;
2644
+ return blocker.sessionId ? links?.sessionHref?.(blocker.sessionId) : void 0;
2645
+ }
2646
+ function RestoredResourceChips({
2647
+ entries,
2648
+ messages,
2649
+ onRemove,
2650
+ imageNumbers
2651
+ }) {
2652
+ const t = useOpenGeniText();
2653
+ return /* @__PURE__ */ jsx4(
2654
+ "div",
2655
+ {
2656
+ className: "flex flex-wrap gap-1.5 border-b border-og-border px-3 py-2",
2657
+ "aria-label": messages.restoredResourcesLabel,
2658
+ children: entries.map(({ resource, index }) => /* @__PURE__ */ jsxs4(
2659
+ "span",
2660
+ {
2661
+ className: "inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-og-md border border-og-border bg-og-surface-2 px-2 py-1 text-og-xs text-og-fg-muted",
2662
+ children: [
2663
+ /* @__PURE__ */ jsx4(FileIcon2, { className: "size-3 shrink-0" }),
2664
+ resource.kind === "file" && imageNumbers?.has(restoredImageKey(resource.fileId)) ? /* @__PURE__ */ jsx4(ImageTagLabel, { children: t("composer.imageTag", {
2665
+ number: imageNumbers.get(restoredImageKey(resource.fileId))
2666
+ }) }) : null,
2667
+ /* @__PURE__ */ jsx4("span", { className: "truncate", children: resource.kind === "file" ? messages.restoredFile(resource.fileId) : resource.uri }),
2668
+ /* @__PURE__ */ jsx4(
2669
+ "button",
2670
+ {
2671
+ type: "button",
2672
+ className: "shrink-0 hover:text-og-fg",
2673
+ onClick: () => onRemove(index),
2674
+ "aria-label": messages.removeRestoredResource(index),
2675
+ children: /* @__PURE__ */ jsx4(XIcon2, { className: "size-3" })
2676
+ }
2677
+ )
2678
+ ]
2679
+ },
2680
+ `${resource.kind}-${resource.kind === "file" ? resource.fileId : resource.uri}`
2681
+ ))
2682
+ }
2683
+ );
2684
+ }
2685
+ function ConfirmBar({
2686
+ command,
2687
+ messages,
2688
+ onCancel,
2689
+ onConfirm,
2690
+ returnFocusRef
2691
+ }) {
2692
+ const confirmRef = useRef4(null);
2693
+ const descriptionId = useId2();
2694
+ useEffect3(() => {
2695
+ const returnTo = returnFocusRef?.current ?? null;
2696
+ confirmRef.current?.focus();
2697
+ return () => returnTo?.focus();
2698
+ }, [returnFocusRef]);
2699
+ return /* @__PURE__ */ jsxs4(
2700
+ "div",
2701
+ {
2702
+ role: "alertdialog",
2703
+ "aria-label": messages.confirmCommand(command.name),
2704
+ "aria-describedby": descriptionId,
2705
+ "data-testid": "danger-confirm",
2706
+ onKeyDown: (event) => {
2707
+ if (event.key === "Escape") {
2708
+ event.preventDefault();
2709
+ event.stopPropagation();
2710
+ onCancel();
2711
+ }
2712
+ },
2713
+ className: "flex items-end justify-between gap-2 px-2.5 pb-2.5 pt-1",
2714
+ children: [
2715
+ /* @__PURE__ */ jsx4("span", { id: descriptionId, className: "min-w-0 flex-1 px-1.5 text-og-sm text-og-status-failed", children: messages.confirmDescription(command) }),
2716
+ /* @__PURE__ */ jsxs4("span", { className: "flex shrink-0 items-center gap-1.5", children: [
2717
+ /* @__PURE__ */ jsx4(
2718
+ "button",
2719
+ {
2720
+ type: "button",
2721
+ onClick: onCancel,
2722
+ className: "rounded-og-md border border-og-border bg-og-surface-2 px-2.5 py-1 text-og-sm text-og-fg-muted hover:bg-og-surface-3 pointer-coarse:min-h-11",
2723
+ children: messages.cancel
2724
+ }
2725
+ ),
2726
+ /* @__PURE__ */ jsx4(
2727
+ "button",
2728
+ {
2729
+ ref: confirmRef,
2730
+ type: "button",
2731
+ onClick: onConfirm,
2732
+ className: "rounded-og-md border border-og-status-failed/50 bg-og-status-failed/15 px-2.5 py-1 text-og-sm text-og-status-failed hover:bg-og-status-failed/25 pointer-coarse:min-h-11",
2733
+ children: messages.runCommand(command.name)
2734
+ }
2735
+ )
2736
+ ] })
2737
+ ]
2738
+ }
2739
+ );
2740
+ }
2741
+ function HelpPanel({
2742
+ commands,
2743
+ messages,
2744
+ onClose
2745
+ }) {
2746
+ return /* @__PURE__ */ jsxs4(
2747
+ motion2.div,
2748
+ {
2749
+ initial: { opacity: 0, height: 0 },
2750
+ animate: { opacity: 1, height: "auto" },
2751
+ exit: { opacity: 0, height: 0 },
2752
+ className: "mt-2 overflow-hidden rounded-og-lg border border-og-border bg-og-surface-2",
2753
+ children: [
2754
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between border-b border-og-border px-3 py-1.5", children: [
2755
+ /* @__PURE__ */ jsx4("span", { className: "text-og-sm font-medium text-og-fg", children: messages.commands }),
2756
+ /* @__PURE__ */ jsx4(
2757
+ "button",
2758
+ {
2759
+ type: "button",
2760
+ onClick: onClose,
2761
+ className: "text-og-xs text-og-fg-subtle hover:text-og-fg",
2762
+ children: messages.close
2763
+ }
2764
+ )
2765
+ ] }),
2766
+ /* @__PURE__ */ jsx4("ul", { className: "py-1", children: commands.map((command) => {
2767
+ const hint = argHint(command.args);
2768
+ return /* @__PURE__ */ jsxs4("li", { className: "flex items-baseline gap-2 px-3 py-1", children: [
2769
+ /* @__PURE__ */ jsxs4("span", { className: "font-mono text-og-sm text-og-accent", children: [
2770
+ "/",
2771
+ command.name,
2772
+ hint ? /* @__PURE__ */ jsx4("span", { className: "ml-1 text-og-fg-subtle", children: hint }) : null
2773
+ ] }),
2774
+ /* @__PURE__ */ jsx4("span", { className: "text-og-sm text-og-fg-muted", children: command.description }),
2775
+ command.danger ? /* @__PURE__ */ jsx4("span", { className: "ml-auto rounded-og-xs bg-og-status-failed/15 px-1 text-og-xs uppercase tracking-wide text-og-status-failed", children: messages.danger }) : null
2776
+ ] }, command.name);
2777
+ }) })
2778
+ ]
2779
+ }
2780
+ );
2781
+ }
2782
+
2783
+ // src/components/composer-transcription-control.tsx
2784
+ import {
2785
+ ClipboardPasteIcon,
2786
+ LoaderCircleIcon as LoaderCircleIcon3,
2787
+ MicIcon,
2788
+ RefreshCwIcon,
2789
+ SquareIcon as SquareIcon2,
2790
+ Trash2Icon,
2791
+ XIcon as XIcon3
2792
+ } from "lucide-react";
2793
+ import { AnimatePresence as AnimatePresence3, motion as motion3 } from "motion/react";
2794
+ import {
2795
+ forwardRef as forwardRef2,
2796
+ useCallback as useCallback3,
2797
+ useEffect as useEffect4,
2798
+ useRef as useRef5,
2799
+ useState as useState5
2800
+ } from "react";
2801
+ import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2802
+ var Tip = /* @__PURE__ */ forwardRef2(
2803
+ function Tip2({ tip, children }, ref) {
2804
+ return /* @__PURE__ */ jsxs5(Tooltip, { children: [
2805
+ /* @__PURE__ */ jsx5(TooltipTrigger, { ref, asChild: true, children }),
2806
+ /* @__PURE__ */ jsx5(TooltipContent, { side: "top", children: tip })
2807
+ ] });
2808
+ }
2809
+ );
2810
+ var defaultMessages = (t) => ({
2811
+ start: t("composerTranscriptionControl.startVoiceInput"),
2812
+ stop: t("composerTranscriptionControl.stopAndTranscribe"),
2813
+ cancel: t("composerTranscriptionControl.discardDictation"),
2814
+ retry: t("composerTranscriptionControl.retryVoiceInput"),
2815
+ transcribeSaved: t("composerTranscriptionControl.transcribeSavedRecording"),
2816
+ timeRemaining: t("composerTranscriptionControl.stopsAndTranscribesInSeconds", {
2817
+ seconds: "{seconds}"
2818
+ }),
2819
+ pauseRetrying: t("composerTranscriptionControl.pauseAutomaticRetry"),
2820
+ requestingPermission: t("composerTranscriptionControl.requestingMicrophone"),
2821
+ recording: t("composerTranscriptionControl.recordingPressEscapeToDiscard"),
2822
+ saving: t("composerTranscriptionControl.savingAudioLocally"),
2823
+ transcribing: t("composerTranscriptionControl.transcribing"),
2824
+ retrying: t("composerTranscriptionControl.savedRetryingTranscription"),
2825
+ recovered: t("composerTranscriptionControl.recordingSavedOnThisDevice"),
2826
+ recoveredTranscript: t("composerTranscriptionControl.transcriptSavedInsertItInto"),
2827
+ insertRecoveredTranscript: t("composerTranscriptionControl.insertSavedTranscript"),
2828
+ discardRecovered: t("composerTranscriptionControl.discardSavedRecording"),
2829
+ unavailableDisabled: t("composerTranscriptionControl.voiceInputIsUnavailableWhile"),
2830
+ unavailable: t("composerTranscriptionControl.voiceInputIsUnavailableFor"),
2831
+ errorPermissionDenied: t("composerTranscriptionControl.microphoneAccessIsBlockedAllow"),
2832
+ errorNotSupported: t("composerTranscriptionControl.voiceInputIsNotSupported"),
2833
+ errorUnavailable: t("composerTranscriptionControl.voiceInputIsNotConfigured"),
2834
+ errorInsufficientCredits: t("composerTranscriptionControl.voiceInputNeedsCreditsRecording"),
2835
+ errorAllowanceExhausted: t("composerTranscriptionControl.usageLimitReachedRecordingSaved"),
2836
+ errorPolicyBlocked: t("composerTranscriptionControl.voiceInputIsnTAllowed"),
2837
+ errorRegionRestricted: t("inferenceRegion.notSupportedInEu"),
2838
+ errorTooLarge: t("composerTranscriptionControl.recordingIsTooLargeTry"),
2839
+ errorInvalidAudio: t("composerTranscriptionControl.theRecordingCouldNotBe"),
2840
+ errorStorageUnavailable: t("composerTranscriptionControl.voiceInputStoppedBecauseAudio"),
2841
+ errorProviderQuotaExceeded: t("composerTranscriptionControl.speechServiceOutOfCredit"),
2842
+ errorRetryable: t("composerTranscriptionControl.savedTranscriptionFailedRetryWhen"),
2843
+ errorHandoffUncertain: t("composerTranscriptionControl.transcriptSavedCheckYourDraft"),
2844
+ errorUnknown: t("composerTranscriptionControl.voiceInputCouldNotStart")
2845
+ });
2846
+ var WAVEFORM_BARS = 18;
2847
+ var WAVEFORM_BAR_KEYS = Array.from(
2848
+ { length: WAVEFORM_BARS },
2849
+ (_, index) => `voice-waveform-bar-${index + 1}`
2850
+ );
2851
+ function ComposerTranscriptionControl({
2852
+ client = null,
2853
+ workspaceId = "",
2854
+ capability = null,
2855
+ workspaceEnabled = false,
2856
+ language = null,
2857
+ beforeStart,
2858
+ messages: overrides,
2859
+ className,
2860
+ recordings,
2861
+ platform,
2862
+ suppressed = false
2863
+ }) {
2864
+ const t = useOpenGeniText();
2865
+ const composer = useChatComposer();
2866
+ const messages = { ...defaultMessages(t), ...overrides };
2867
+ const startScope = useRef5(null);
2868
+ const hostGate = useRef5(beforeStart);
2869
+ hostGate.current = beforeStart;
2870
+ const gate = useCallback3(async () => {
2871
+ if (hostGate.current && !await hostGate.current()) return false;
2872
+ startScope.current?.dispatchEvent(new Event(COMPOSER_VOICE_INPUT_START_EVENT));
2873
+ return true;
2874
+ }, []);
2875
+ const transcription = useVoiceInput({
2876
+ client,
2877
+ workspaceId,
2878
+ capability,
2879
+ enabled: workspaceEnabled && !suppressed,
2880
+ value: composer.value,
2881
+ setValue: composer.setValue,
2882
+ focusInput: composer.focusInput,
2883
+ disabled: composer.disabled,
2884
+ language,
2885
+ beforeStart: gate,
2886
+ recordings,
2887
+ platform
2888
+ });
2889
+ const { status } = transcription;
2890
+ const retrying = status === "retrying";
2891
+ const capturing = status === "requesting-permission" || status === "recording";
2892
+ const setAsideTranscription = transcription.setAside;
2893
+ const discardTranscription = transcription.discard;
2894
+ const hasRecoverableRecording = transcription.hasRecoverableRecording;
2895
+ useEffect4(() => {
2896
+ if (!suppressed) return;
2897
+ if (status === "recording" || status === "requesting-permission") {
2898
+ setAsideTranscription();
2899
+ } else if (status === "error" && !hasRecoverableRecording) {
2900
+ void discardTranscription();
2901
+ }
2902
+ }, [setAsideTranscription, discardTranscription, hasRecoverableRecording, status, suppressed]);
2903
+ const active = capturing || status === "saving" || status === "transcribing";
2904
+ const recoverable = transcription.hasRecoverableRecording && (retrying || status === "recovered" || status === "transcript-ready" || status === "error");
2905
+ const savedTranscript = status === "transcript-ready" && transcription.savedTranscript !== null;
2906
+ const unavailableMessage = composer.disabled ? messages.unavailableDisabled : !capability?.available || !workspaceEnabled ? messages.unavailable : !transcription.available ? messages.errorStorageUnavailable : null;
2907
+ const idleLabel = unavailableMessage ?? (status === "error" ? messages.retry : messages.start);
2908
+ const errorMessage = transcription.error ? transcriptionErrorMessage(transcription.error, messages) : null;
2909
+ const announcement = status === "requesting-permission" ? messages.requestingPermission : status === "recording" ? messages.recording : status === "saving" ? messages.saving : status === "transcribing" ? messages.transcribing : retrying ? messages.retrying : status === "recovered" ? messages.recovered : status === "transcript-ready" ? messages.recoveredTranscript : status === "error" ? errorMessage ?? messages.errorUnknown : unavailableMessage;
2910
+ const recoveredLabel = savedTranscript ? errorMessage ?? messages.recoveredTranscript : retrying ? messages.retrying : status === "error" ? errorMessage ?? messages.errorRetryable : messages.recovered;
2911
+ function start(event) {
2912
+ if (unavailableMessage) {
2913
+ event.preventDefault();
2914
+ return;
2915
+ }
2916
+ startScope.current = composerVoiceEventScope(event.currentTarget) ?? null;
2917
+ void transcription.start();
2918
+ }
2919
+ const needsAttention = !capturing && (recoverable || status === "error" && !!errorMessage);
2920
+ useComposerFooterSignal("transcription-capturing", !suppressed && capturing);
2921
+ useComposerFooterSignal("transcription-attention", !suppressed && needsAttention);
2922
+ return /* @__PURE__ */ jsx5(AnimatePresence3, { initial: false, children: suppressed ? null : /* @__PURE__ */ jsx5(
2923
+ motion3.span,
2924
+ {
2925
+ initial: { opacity: 0, width: 0 },
2926
+ animate: { opacity: 1, width: "auto" },
2927
+ exit: { opacity: 0, width: 0 },
2928
+ transition: { duration: 0.36, ease: [0.22, 1, 0.36, 1] },
2929
+ className: cn(
2930
+ "inline-flex min-w-0 overflow-hidden",
2931
+ // Mobile capture mode reserves the footer for this control. Keep the
2932
+ // shell itself from shrinking and clipping its trailing actions.
2933
+ capturing && "shrink-0",
2934
+ className
2935
+ ),
2936
+ "data-transcription-status": status,
2937
+ "data-transcription-capturing": capturing ? "" : void 0,
2938
+ "data-transcription-attention": needsAttention ? "" : void 0,
2939
+ children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
2940
+ /* @__PURE__ */ jsx5(AnimatePresence3, { mode: "popLayout", initial: false, children: recoverable ? /* @__PURE__ */ jsxs5(
2941
+ motion3.span,
2942
+ {
2943
+ initial: { opacity: 0, scale: 0.96 },
2944
+ animate: { opacity: 1, scale: 1 },
2945
+ exit: { opacity: 0, scale: 0.96 },
2946
+ transition: { duration: 0.16, ease: [0.22, 1, 0.36, 1] },
2947
+ className: cn(
2948
+ "inline-flex h-8 min-w-0 items-center gap-1 rounded-og-md border border-og-border/80",
2949
+ "bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
2950
+ ),
2951
+ children: [
2952
+ /* @__PURE__ */ jsx5(
2953
+ "span",
2954
+ {
2955
+ title: recoveredLabel,
2956
+ className: "og-transcription-recovered-label max-w-56 line-clamp-2 text-og-xs leading-tight text-og-fg-muted max-sm:max-w-32",
2957
+ children: recoveredLabel
2958
+ }
2959
+ ),
2960
+ /* @__PURE__ */ jsx5(
2961
+ Tip,
2962
+ {
2963
+ tip: savedTranscript ? messages.insertRecoveredTranscript : retrying ? messages.pauseRetrying : status === "recovered" ? messages.transcribeSaved : messages.retry,
2964
+ children: /* @__PURE__ */ jsx5(
2965
+ "button",
2966
+ {
2967
+ type: "button",
2968
+ disabled: composer.disabled && !retrying,
2969
+ onClick: () => savedTranscript ? void transcription.insertSavedTranscript() : retrying ? transcription.setAside() : transcription.retry(),
2970
+ "aria-label": savedTranscript ? messages.insertRecoveredTranscript : retrying ? messages.pauseRetrying : status === "recovered" ? messages.transcribeSaved : messages.retry,
2971
+ className: cn(
2972
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
2973
+ "border border-og-primary-border bg-og-primary text-og-primary-fg hover:bg-og-primary-hover transition-colors duration-150 motion-reduce:transition-none",
2974
+ "disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11"
2975
+ ),
2976
+ children: savedTranscript ? /* @__PURE__ */ jsx5(ClipboardPasteIcon, { className: "size-3.5" }) : retrying ? /* @__PURE__ */ jsx5(SquareIcon2, { className: "size-3.5" }) : /* @__PURE__ */ jsx5(RefreshCwIcon, { className: "size-3.5" })
2977
+ }
2978
+ )
2979
+ }
2980
+ ),
2981
+ /* @__PURE__ */ jsx5(Tip, { tip: messages.discardRecovered, children: /* @__PURE__ */ jsx5(
2982
+ "button",
2983
+ {
2984
+ type: "button",
2985
+ disabled: composer.disabled,
2986
+ onClick: () => void transcription.discard(),
2987
+ "aria-label": messages.discardRecovered,
2988
+ className: cn(
2989
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
2990
+ "text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
2991
+ "hover:bg-og-surface-3 hover:text-og-status-failed disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:size-11"
2992
+ ),
2993
+ children: /* @__PURE__ */ jsx5(Trash2Icon, { className: "size-3.5" })
2994
+ }
2995
+ ) })
2996
+ ]
2997
+ },
2998
+ "recovered"
2999
+ ) : active ? /* @__PURE__ */ jsxs5(
3000
+ motion3.span,
3001
+ {
3002
+ initial: { opacity: 0, scale: 0.96 },
3003
+ animate: { opacity: 1, scale: 1 },
3004
+ exit: { opacity: 0, scale: 0.96 },
3005
+ transition: { duration: 0.16, ease: [0.22, 1, 0.36, 1] },
3006
+ className: cn(
3007
+ "inline-flex h-8 items-center gap-1 rounded-og-md border border-og-border/80",
3008
+ "bg-og-surface-2/70 pl-2 pr-1 pointer-coarse:h-11"
3009
+ ),
3010
+ children: [
3011
+ status === "requesting-permission" ? /* @__PURE__ */ jsx5(
3012
+ LoaderCircleIcon3,
3013
+ {
3014
+ className: "size-3.5 shrink-0 text-og-fg-muted animate-og-spin motion-reduce:animate-none",
3015
+ "aria-hidden": true
3016
+ }
3017
+ ) : /* @__PURE__ */ jsxs5("span", { className: "flex items-center gap-1.5", children: [
3018
+ status === "recording" ? /* @__PURE__ */ jsx5(
3019
+ "span",
3020
+ {
3021
+ "aria-hidden": true,
3022
+ className: "size-1.5 shrink-0 rounded-full bg-og-status-failed animate-og-pulse motion-reduce:animate-none"
3023
+ }
3024
+ ) : null,
3025
+ /* @__PURE__ */ jsx5(
3026
+ VoiceWaveform,
3027
+ {
3028
+ stream: status === "recording" ? transcription.stream : null,
3029
+ mode: status === "recording" ? "recording" : "transcribing"
3030
+ }
3031
+ ),
3032
+ status === "recording" && transcription.recordingStartedAt !== null ? /* @__PURE__ */ jsx5(
3033
+ RecordingClock,
3034
+ {
3035
+ startedAt: transcription.recordingStartedAt,
3036
+ maxSeconds: transcription.maxRecordingSeconds,
3037
+ remainingLabel: messages.timeRemaining
3038
+ }
3039
+ ) : null
3040
+ ] }),
3041
+ status === "recording" ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
3042
+ /* @__PURE__ */ jsx5(Tip, { tip: messages.cancel, children: /* @__PURE__ */ jsx5(
3043
+ "button",
3044
+ {
3045
+ type: "button",
3046
+ onClick: () => transcription.cancel(),
3047
+ "aria-label": messages.cancel,
3048
+ className: cn(
3049
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
3050
+ "text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
3051
+ "hover:bg-og-surface-3 hover:text-og-fg pointer-coarse:size-11"
3052
+ ),
3053
+ children: /* @__PURE__ */ jsx5(XIcon3, { className: "size-3.5" })
3054
+ }
3055
+ ) }),
3056
+ /* @__PURE__ */ jsx5(Tip, { tip: messages.stop, children: /* @__PURE__ */ jsx5(
3057
+ "button",
3058
+ {
3059
+ type: "button",
3060
+ onClick: () => transcription.stop(),
3061
+ "aria-label": messages.stop,
3062
+ className: cn(
3063
+ "inline-flex size-7 shrink-0 items-center justify-center rounded-og-sm",
3064
+ "border border-og-primary-border bg-og-primary text-og-primary-fg hover:bg-og-primary-hover",
3065
+ "transition-colors duration-150 motion-reduce:transition-none pointer-coarse:size-11"
3066
+ ),
3067
+ children: /* @__PURE__ */ jsx5(SquareIcon2, { className: "size-2.5 fill-current" })
3068
+ }
3069
+ ) })
3070
+ ] }) : status === "transcribing" || status === "saving" ? /* @__PURE__ */ jsx5(ShimmerText, { className: "px-1.5 text-og-xs font-medium whitespace-nowrap", children: status === "saving" ? messages.saving : messages.transcribing }) : /* @__PURE__ */ jsx5("span", { className: "px-1.5 text-og-xs text-og-fg-muted whitespace-nowrap", children: messages.requestingPermission })
3071
+ ]
3072
+ },
3073
+ status === "transcribing" || status === "saving" ? "processing" : "capture"
3074
+ ) : /* @__PURE__ */ jsx5(Tip, { tip: idleLabel, children: /* @__PURE__ */ jsx5(
3075
+ motion3.button,
3076
+ {
3077
+ type: "button",
3078
+ "data-og-composer-dictate": true,
3079
+ initial: { opacity: 0, scale: 0.96 },
3080
+ animate: { opacity: 1, scale: 1 },
3081
+ exit: { opacity: 0, scale: 0.96 },
3082
+ transition: { duration: 0.14, ease: [0.22, 1, 0.36, 1] },
3083
+ onClick: start,
3084
+ "aria-label": idleLabel,
3085
+ "aria-pressed": false,
3086
+ "aria-disabled": unavailableMessage !== null,
3087
+ className: cn(
3088
+ "inline-flex size-8 shrink-0 items-center justify-center rounded-og-md pointer-coarse:size-11",
3089
+ "text-og-fg-muted transition-colors duration-150 motion-reduce:transition-none",
3090
+ unavailableMessage ? "cursor-not-allowed opacity-45" : "hover:bg-og-surface-2 hover:text-og-fg"
3091
+ ),
3092
+ children: /* @__PURE__ */ jsx5(MicIcon, { className: "size-4" })
3093
+ }
3094
+ ) }, "idle") }),
3095
+ status === "error" && errorMessage && !recoverable ? (
3096
+ // Nothing is saved in this state, so dismissing loses no speech.
3097
+ /* @__PURE__ */ jsxs5(
3098
+ "button",
3099
+ {
3100
+ type: "button",
3101
+ title: errorMessage,
3102
+ "aria-label": t("composerTranscriptionControl.dismissErrormessage", { errorMessage }),
3103
+ onClick: () => void transcription.discard(),
3104
+ className: cn(
3105
+ "inline-flex min-w-0 items-center gap-1 rounded-og-sm text-left outline-hidden",
3106
+ "text-og-status-failed focus-visible:ring-2 focus-visible:ring-og-accent/45"
3107
+ ),
3108
+ children: [
3109
+ /* @__PURE__ */ jsx5("span", { className: "og-transcription-error-label max-w-56 line-clamp-2 text-og-xs leading-tight max-sm:max-w-32", children: errorMessage }),
3110
+ /* @__PURE__ */ jsx5(XIcon3, { className: "size-3 shrink-0 opacity-70", "aria-hidden": true })
3111
+ ]
3112
+ }
3113
+ )
3114
+ ) : null,
3115
+ /* @__PURE__ */ jsx5(
3116
+ "span",
3117
+ {
3118
+ className: "sr-only",
3119
+ role: status === "error" ? "alert" : "status",
3120
+ "aria-live": "polite",
3121
+ children: announcement
3122
+ }
3123
+ )
3124
+ ] })
3125
+ },
3126
+ "composer-dictate"
3127
+ ) });
3128
+ }
3129
+ function RecordingClock({
3130
+ startedAt,
3131
+ maxSeconds,
3132
+ remainingLabel
3133
+ }) {
3134
+ const [now, setNow] = useState5(() => Date.now());
3135
+ useEffect4(() => {
3136
+ const timer = setInterval(() => setNow(Date.now()), 500);
3137
+ return () => clearInterval(timer);
3138
+ }, []);
3139
+ const elapsed = Math.max(0, Math.floor((now - startedAt) / 1e3));
3140
+ const remaining = maxSeconds === null ? null : Math.max(0, maxSeconds - elapsed);
3141
+ const warn = remaining !== null && remaining <= 15;
3142
+ const label = `${Math.floor(elapsed / 60)}:${String(elapsed % 60).padStart(2, "0")}`;
3143
+ return /* @__PURE__ */ jsxs5(
3144
+ "span",
3145
+ {
3146
+ "data-recording-clock": true,
3147
+ title: warn ? remainingLabel.replace("{seconds}", String(remaining)) : void 0,
3148
+ className: cn(
3149
+ "min-w-[2.25rem] text-right text-og-xs tabular-nums",
3150
+ warn ? "font-medium text-og-status-failed" : "text-og-fg-muted"
3151
+ ),
3152
+ children: [
3153
+ label,
3154
+ warn ? /* @__PURE__ */ jsx5("span", { className: "sr-only", children: remainingLabel.replace("{seconds}", String(remaining)) }) : null
3155
+ ]
3156
+ }
3157
+ );
3158
+ }
3159
+ function VoiceWaveform({
3160
+ stream,
3161
+ mode
3162
+ }) {
3163
+ const [levels, setLevels] = useState5(() => restingLevels(WAVEFORM_BARS));
3164
+ const [live, setLive] = useState5(false);
3165
+ useEffect4(() => {
3166
+ if (!stream || mode !== "recording") {
3167
+ setLive(false);
3168
+ setLevels(restingLevels(WAVEFORM_BARS));
3169
+ return;
3170
+ }
3171
+ const AudioCtx = window.AudioContext ?? window.webkitAudioContext;
3172
+ if (!AudioCtx) return;
3173
+ let cancelled = false;
3174
+ let frame = 0;
3175
+ let context = null;
3176
+ try {
3177
+ context = new AudioCtx();
3178
+ const source = context.createMediaStreamSource(stream);
3179
+ const analyser = context.createAnalyser();
3180
+ analyser.fftSize = 64;
3181
+ analyser.smoothingTimeConstant = 0.8;
3182
+ source.connect(analyser);
3183
+ const bins = new Uint8Array(analyser.frequencyBinCount);
3184
+ const tick = () => {
3185
+ if (cancelled) return;
3186
+ analyser.getByteFrequencyData(bins);
3187
+ const next = new Array(WAVEFORM_BARS);
3188
+ const usable = Math.max(8, Math.floor(bins.length * 0.65));
3189
+ for (let i = 0; i < WAVEFORM_BARS; i++) {
3190
+ const start = Math.floor(i / WAVEFORM_BARS * usable);
3191
+ const end = Math.max(start + 1, Math.floor((i + 1) / WAVEFORM_BARS * usable));
3192
+ let sum = 0;
3193
+ for (let j = start; j < end; j++) sum += bins[j] ?? 0;
3194
+ const avg = sum / (end - start) / 255;
3195
+ next[i] = Math.min(1, 0.14 + avg * 1.65);
3196
+ }
3197
+ setLevels(next);
3198
+ setLive(true);
3199
+ frame = requestAnimationFrame(tick);
3200
+ };
3201
+ void context.resume().then(() => {
3202
+ if (!cancelled) frame = requestAnimationFrame(tick);
3203
+ });
3204
+ } catch {
3205
+ setLive(false);
3206
+ }
3207
+ return () => {
3208
+ cancelled = true;
3209
+ cancelAnimationFrame(frame);
3210
+ void context?.close();
3211
+ };
3212
+ }, [stream, mode]);
3213
+ return /* @__PURE__ */ jsx5(
3214
+ "span",
3215
+ {
3216
+ "aria-hidden": true,
3217
+ "data-voice-waveform": live ? "live" : "fallback",
3218
+ className: "flex h-4 w-[3.75rem] items-center justify-center gap-px",
3219
+ children: WAVEFORM_BAR_KEYS.map((key, index) => {
3220
+ const level = levels[index] ?? 0;
3221
+ return /* @__PURE__ */ jsx5(
3222
+ "span",
3223
+ {
3224
+ className: cn(
3225
+ "w-0.5 rounded-full bg-og-fg-muted/90 origin-center",
3226
+ !live && "animate-og-waveform motion-reduce:animate-none",
3227
+ mode === "transcribing" && "opacity-45"
3228
+ ),
3229
+ style: {
3230
+ height: live ? `${Math.max(3, Math.round(level * 14))}px` : "14px",
3231
+ animationDelay: live ? void 0 : `${index % 9 * 0.07}s`,
3232
+ opacity: live ? 0.55 + level * 0.45 : void 0
3233
+ }
3234
+ },
3235
+ key
3236
+ );
3237
+ })
3238
+ }
3239
+ );
3240
+ }
3241
+ function restingLevels(count) {
3242
+ return Array.from({ length: count }, (_, index) => 0.22 + index * 17 % 5 * 0.06);
3243
+ }
3244
+ function transcriptionErrorMessage(code, messages) {
3245
+ switch (code) {
3246
+ case "insufficient_credits":
3247
+ return messages.errorInsufficientCredits;
3248
+ case "allowance_exhausted":
3249
+ case "monthly_model_cost_limit":
3250
+ return messages.errorAllowanceExhausted;
3251
+ case "policy_blocked":
3252
+ return messages.errorPolicyBlocked;
3253
+ case "region_restricted":
3254
+ return messages.errorRegionRestricted;
3255
+ case "permission_denied":
3256
+ return messages.errorPermissionDenied;
3257
+ case "not_supported":
3258
+ return messages.errorNotSupported;
3259
+ case "unavailable":
3260
+ return messages.errorUnavailable;
3261
+ case "too_large":
3262
+ return messages.errorTooLarge;
3263
+ case "invalid_audio":
3264
+ return messages.errorInvalidAudio;
3265
+ case "storage_unavailable":
3266
+ return messages.errorStorageUnavailable;
3267
+ case "provider_quota_exceeded":
3268
+ return messages.errorProviderQuotaExceeded;
3269
+ case "network":
3270
+ case "provider":
3271
+ case "timeout":
3272
+ return messages.errorRetryable;
3273
+ case "handoff_uncertain":
3274
+ return messages.errorHandoffUncertain;
3275
+ case "unknown":
3276
+ return messages.errorUnknown;
3277
+ default:
3278
+ return messages.errorUnknown;
3279
+ }
3280
+ }
3281
+
3282
+ export {
3283
+ parseCommandLine,
3284
+ hasPermission,
3285
+ matchCommand,
3286
+ filterCommands,
3287
+ argHint,
3288
+ firstMissingRequiredArg,
3289
+ defaultCommands,
3290
+ useSlashCommands,
3291
+ CommandPalette,
3292
+ ModelPicker,
3293
+ storedFileAttachment,
3294
+ AttachmentChips,
3295
+ useChatComposerController,
3296
+ useChatComposer,
3297
+ Root,
3298
+ Frame,
3299
+ CommandPalette2,
3300
+ Surface,
3301
+ PausedState,
3302
+ RestoredResources,
3303
+ Attachments,
3304
+ Input,
3305
+ Confirmation,
3306
+ Footer,
3307
+ Controls,
3308
+ Hint,
3309
+ Actions,
3310
+ AttachButton,
3311
+ ModelPicker2,
3312
+ PauseButtonSlot,
3313
+ PauseButton,
3314
+ StopButton,
3315
+ AlternateSendButton,
3316
+ SendButton,
3317
+ Help,
3318
+ Status,
3319
+ ComposerTranscriptionControl
3320
+ };
3321
+ //# sourceMappingURL=chunk-X62CN4YR.js.map