decocms 4.374.1 → 4.375.1

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 (373) hide show
  1. package/dist/client/assets/{AlertCircle-CvB24fpQ.js → AlertCircle-BI1-7G_T.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CC-VldiG.js → AreaChart-DtIBv_u2.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CuPXwhY9.js → ArrowLeft-C7E68hAX.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DaeNVQjU.js → ArrowRight-Dvm5zccu.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CMB2_B55.js → ArrowUp-CeEuKFtz.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-fcGDW8tl.js → CartesianChart-DiSH3Vx4.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-L9rxLy8_.js → CheckCircle-Dhae72wt.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-Dy-cXbOz.js → ChevronUp-DLj1P2Yi.js} +1 -1
  9. package/dist/client/assets/{Copy01-KomJ49aq.js → Copy01-BSU2TbGt.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-DNXTqT2E.js → CreditCard01-rQeWrMiX.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-CycZdUV6.js → DotsVertical-Bpcc3aU6.js} +1 -1
  12. package/dist/client/assets/{Download01-CK_3UsO1.js → Download01-C7Po_zTZ.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-C_8xGdFw.js → ErrorBarContext-CFqnzxdu.js} +1 -1
  14. package/dist/client/assets/{Eye-KAte8whD.js → Eye-BMH8bL1o.js} +1 -1
  15. package/dist/client/assets/{Globe01-BmMm30Hp.js → Globe01-B8Fw27to.js} +1 -1
  16. package/dist/client/assets/{Globe04-D2pxwWDa.js → Globe04-DiaT8ud7.js} +1 -1
  17. package/dist/client/assets/{Image01-BHoZzJSj.js → Image01-8GW5hNSe.js} +1 -1
  18. package/dist/client/assets/{Key01-BiLmhCHZ.js → Key01-BlY-YbB_.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-Dk8cMo-H.js → LayoutLeft-CRUlRVYr.js} +1 -1
  20. package/dist/client/assets/{Line-QF9kobp-.js → Line-wWCkiK5e.js} +1 -1
  21. package/dist/client/assets/{Link01-BSX_7wIu.js → Link01-Cx5QfFm-.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-COMF34Up.js → LinkExternal01-CiW1JxGO.js} +1 -1
  23. package/dist/client/assets/{Monitor01-C25vfwGa.js → Monitor01-D_u2VBNm.js} +1 -1
  24. package/dist/client/assets/{Package-BCflABQ6.js → Package-5wNrOSeZ.js} +1 -1
  25. package/dist/client/assets/{Palette-By8W7B7e.js → Palette-D-JKiEQc.js} +1 -1
  26. package/dist/client/assets/{Play-C6orNG1z.js → Play-C3paeMv9.js} +1 -1
  27. package/dist/client/assets/{Plus-BuCQnPNG.js → Plus-DtW_ZAb1.js} +1 -1
  28. package/dist/client/assets/{SearchLg-VMEsA-e7.js → SearchLg-dxZebJdV.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DnahVlUn.js → SearchMd-CYWyu5N6.js} +1 -1
  30. package/dist/client/assets/{Sector-CzI1MlO5.js → Sector-BG5qLfZm.js} +1 -1
  31. package/dist/client/assets/{Settings02-BZd-qcWS.js → Settings02-BST604Dz.js} +1 -1
  32. package/dist/client/assets/{Share07-tpVfUX9-.js → Share07-D1cfUHPt.js} +1 -1
  33. package/dist/client/assets/{Stars01-BcbLgM7d.js → Stars01-C7tX23wY.js} +1 -1
  34. package/dist/client/assets/{Sun-C6ausIaw.js → Sun-DYyCG7at.js} +1 -1
  35. package/dist/client/assets/{Tool01-BlcXvpRH.js → Tool01-uWjCo1g4.js} +1 -1
  36. package/dist/client/assets/{Tool02-BcSzj1eN.js → Tool02-C01DHNkH.js} +1 -1
  37. package/dist/client/assets/{Trash01-Bt7knSgw.js → Trash01-CuAclZjJ.js} +1 -1
  38. package/dist/client/assets/{TrendUp01-kAJZHj1O.js → TrendUp01-DDcnGTKu.js} +1 -1
  39. package/dist/client/assets/{Upload01-CgS71RUS.js → Upload01-C_WGdZv1.js} +1 -1
  40. package/dist/client/assets/{User01-DKY_ILGI.js → User01-BtTyL8Q1.js} +1 -1
  41. package/dist/client/assets/{UserSquare-DU12tvTU.js → UserSquare-DseugbrQ.js} +1 -1
  42. package/dist/client/assets/{Users01-COWDl5zV.js → Users01-DcFsssIu.js} +1 -1
  43. package/dist/client/assets/{X-DcceC-EQ.js → X-DvXoapdv.js} +1 -1
  44. package/dist/client/assets/{XCircle-BirmII4v.js → XCircle-IF6IhAA6.js} +1 -1
  45. package/dist/client/assets/{XClose-CZo1KF0t.js → XClose-DV3Gf7XO.js} +1 -1
  46. package/dist/client/assets/{Zap-CIXkomUE.js → Zap-3MjslAd_.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-CvMfmw42.js → ZoomOut-CmGFFntk.js} +1 -1
  48. package/dist/client/assets/{access-gate-BkpH0rYV.js → access-gate-BzmM6oxY.js} +1 -1
  49. package/dist/client/assets/{add-connection-dialog-DDFaH4NS.js → add-connection-dialog-D-qRDxvj.js} +1 -1
  50. package/dist/client/assets/{agent-analytics-DI585OA2.js → agent-analytics-smucAkLj.js} +1 -1
  51. package/dist/client/assets/agent-app-x_Rm4WGj.js +1 -0
  52. package/dist/client/assets/agent-assets-CLJ5OX6e.js +1 -0
  53. package/dist/client/assets/{agent-automation-CoXN7oT_.js → agent-automation-CFAGaP8l.js} +1 -1
  54. package/dist/client/assets/{agent-automations-Dh2ldvlj.js → agent-automations-BHCDA4--.js} +1 -1
  55. package/dist/client/assets/{agent-connect-sources-p5uTnj09.js → agent-connect-sources-7wd232rO.js} +1 -1
  56. package/dist/client/assets/agent-deck-C-uXPiCc.js +1 -0
  57. package/dist/client/assets/{agent-e2e-CgjMtxKa.js → agent-e2e-DcyQRI-0.js} +1 -1
  58. package/dist/client/assets/{agent-experiments-Z90gGdDa.js → agent-experiments-B01FeZKr.js} +1 -1
  59. package/dist/client/assets/agent-file-DfTcN9rV.js +1 -0
  60. package/dist/client/assets/{agent-git-8ujBeOTw.js → agent-git-DVbYIVmK.js} +2 -2
  61. package/dist/client/assets/{agent-hosting-Bzvqx7RN.js → agent-hosting-D77MUjq-.js} +1 -1
  62. package/dist/client/assets/{agent-icon-Bbnm30MH.js → agent-icon-CB6qOgGd.js} +1 -1
  63. package/dist/client/assets/agent-library-file-BbSJ9eSF.js +1 -0
  64. package/dist/client/assets/{agent-monitor-pcRQgKqs.js → agent-monitor-DUdJ3jIv.js} +1 -1
  65. package/dist/client/assets/{agent-overview-wBMo3ArI.js → agent-overview-BLq3g-uv.js} +1 -1
  66. package/dist/client/assets/agent-settings-D7S8zdvD.js +1 -0
  67. package/dist/client/assets/{agent-site-editor-B_7293-6.js → agent-site-editor-BsPAglDy.js} +1 -1
  68. package/dist/client/assets/agent-site-editor-code-R25H_qVE.js +2 -0
  69. package/dist/client/assets/agent-site-editor-content-GFspdniw.js +2 -0
  70. package/dist/client/assets/{agent-site-editor-preview-BoUgjuFc.js → agent-site-editor-preview-J-wwVAJd.js} +3 -3
  71. package/dist/client/assets/agent-view-BPulnPyH.js +1 -0
  72. package/dist/client/assets/{agent-view-guard-CE-w87FC.js → agent-view-guard-NkVREFXG.js} +1 -1
  73. package/dist/client/assets/{agents-list-DYu2megT.js → agents-list-CuqRd0XO.js} +1 -1
  74. package/dist/client/assets/{ai-providers-C4xd0vpP.js → ai-providers-C6O4KvR1.js} +2 -2
  75. package/dist/client/assets/{alert-JJIsthFC.js → alert-BqDw83Zr.js} +1 -1
  76. package/dist/client/assets/{alert-dialog-DQ7VA4it.js → alert-dialog-Cwo6u0Rd.js} +1 -1
  77. package/dist/client/assets/{api-keys-Da7XeDcP.js → api-keys-D2_4Kgi1.js} +1 -1
  78. package/dist/client/assets/api-keys-tBRZg_0R.js +1 -0
  79. package/dist/client/assets/app-editor-h2HqcY-W.js +1 -0
  80. package/dist/client/assets/{asset-utils-Ckrgql68.js → asset-utils-DFfJ7SbA.js} +1 -1
  81. package/dist/client/assets/{auth-BAIe_T8g.js → auth-C673ACq9.js} +1 -1
  82. package/dist/client/assets/{auth-catchall-C3HcGo7O.js → auth-catchall-DCl9R8ez.js} +1 -1
  83. package/dist/client/assets/{auth-entry-CXeBQuWy.js → auth-entry-GzlRhrO7.js} +1 -1
  84. package/dist/client/assets/{auth-split-layout-BLHoHl9d.js → auth-split-layout-C04c2KsR.js} +1 -1
  85. package/dist/client/assets/{authenticate-and-persist-oauth-B_2a5Vfr.js → authenticate-and-persist-oauth-D7US-yKl.js} +1 -1
  86. package/dist/client/assets/{automation-list-row-zcGZ57kC.js → automation-list-row-CPHwWy2p.js} +1 -1
  87. package/dist/client/assets/{automation-runs-CO5cfbAL.js → automation-runs-DxfhwHuV.js} +1 -1
  88. package/dist/client/assets/automations-BJ_8vGY-.js +1 -0
  89. package/dist/client/assets/{autosend-DrbiZ7KD.js → autosend-C_B7nqHB.js} +1 -1
  90. package/dist/client/assets/{avatar-DAAVe66-.js → avatar-DeEBt3V6.js} +1 -1
  91. package/dist/client/assets/{badge-Cxdo9MSD.js → badge-CTOzYKcw.js} +1 -1
  92. package/dist/client/assets/{block-document-BmtOSR_U.js → block-document-p1v2niSl.js} +3 -3
  93. package/dist/client/assets/{blocks-preview-workspace-context-B9WGUHQW.js → blocks-preview-workspace-context-cspKlB4e.js} +1 -1
  94. package/dist/client/assets/{breadcrumb-Cl92-rSB.js → breadcrumb-D_dKwwik.js} +1 -1
  95. package/dist/client/assets/{buckets-IfbnGi1h.js → buckets-Bb80omnE.js} +1 -1
  96. package/dist/client/assets/{build-improve-prompt-doc-BjB8yBFt.js → build-improve-prompt-doc-4VuHodwx.js} +1 -1
  97. package/dist/client/assets/{bulk-category-panel-BCXzorgr.js → bulk-category-panel-D0Zx1WOc.js} +1 -1
  98. package/dist/client/assets/{calendar-D29VArmq.js → calendar-Cp1CsC2G.js} +1 -1
  99. package/dist/client/assets/{capability-load-error-BML32Rgk.js → capability-load-error-CPK5gzZD.js} +1 -1
  100. package/dist/client/assets/category-editor-CkLv7gDy.js +1 -0
  101. package/dist/client/assets/{chart-DPH16IOZ.js → chart-C_3KaMyn.js} +1 -1
  102. package/dist/client/assets/{chat-context-BSf3NsZt.js → chat-context-9vL2FEPm.js} +5 -5
  103. package/dist/client/assets/{chat-draft-CYnWSaLo.js → chat-draft-BfGVY5UT.js} +1 -1
  104. package/dist/client/assets/{checkbox-Dabg6CvC.js → checkbox-CzlOjnq8.js} +1 -1
  105. package/dist/client/assets/{choose-editor-Cp-nak_V.js → choose-editor-BKH0c2th.js} +1 -1
  106. package/dist/client/assets/{cli-auth-success-Cn8-SffB.js → cli-auth-success-Bv_-kJFI.js} +1 -1
  107. package/dist/client/assets/{client-icons-I35gtKUf.js → client-icons-DWXRTDgi.js} +1 -1
  108. package/dist/client/assets/{collapsible-Cc5z9cdY.js → collapsible-CbjXckba.js} +1 -1
  109. package/dist/client/assets/{collection-detail-DjBn5zYW.js → collection-detail-DMMWvL23.js} +1 -1
  110. package/dist/client/assets/{collection-display-button-BMj7QQEq.js → collection-display-button-DDOKmMN0.js} +1 -1
  111. package/dist/client/assets/{collection-search-ACimtR3t.js → collection-search-C3Nd4_WF.js} +1 -1
  112. package/dist/client/assets/{collection-table-wrapper-D6uxp16B.js → collection-table-wrapper-B-FFQlMk.js} +1 -1
  113. package/dist/client/assets/{collection-tabs-wZHzLlos.js → collection-tabs-BTNTMmYy.js} +1 -1
  114. package/dist/client/assets/{combobox-CFiHpYi-.js → combobox-DJpsl8XJ.js} +1 -1
  115. package/dist/client/assets/{command-uelHA4Qc.js → command-Cd7TqAMz.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-CElJkf6T.js → companion-mcps-section-C51wKLDC.js} +1 -1
  117. package/dist/client/assets/{connect-C1wR3kQS.js → connect-DL2wIZjF.js} +2 -2
  118. package/dist/client/assets/{connect-layout-CEjyLlsQ.js → connect-layout-DlpViE9y.js} +1 -1
  119. package/dist/client/assets/{connection-card-z-DTL8a8.js → connection-card-BC6VQgEM.js} +1 -1
  120. package/dist/client/assets/{connection-detail-DTW_zDz8.js → connection-detail-CUwTeXbu.js} +1 -1
  121. package/dist/client/assets/{connection-form-helpers-w89tRjJb.js → connection-form-helpers-Dhjm3H4V.js} +1 -1
  122. package/dist/client/assets/{connection-CCOtyiTz.js → connection-pRtqDo5s.js} +1 -1
  123. package/dist/client/assets/{connections-BCg7O22V.js → connections-OTQGx-8T.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-DgZgs9aG.js → create-organization-dialog-F-F4v3Bl.js} +1 -1
  125. package/dist/client/assets/{decofile-api-BCvZWky6.js → decofile-api-CPSMqNwB.js} +1 -1
  126. package/dist/client/assets/{decopilot-JzsJWa1H.js → decopilot-Byyy6GRB.js} +2 -2
  127. package/dist/client/assets/{dialog-BVRmgEZZ.js → dialog-Djn7c9nl.js} +1 -1
  128. package/dist/client/assets/{discover-CPUegLX9.js → discover-CgHIqstZ.js} +1 -1
  129. package/dist/client/assets/{domain-settings-BL6MiMeP.js → domain-settings-BVYaDlxU.js} +1 -1
  130. package/dist/client/assets/{download-app-dialog-BSQlf9Pn.js → download-app-dialog-CPQDFMO_.js} +1 -1
  131. package/dist/client/assets/{drawer-BwM5wPz_.js → drawer-CcumUZPh.js} +1 -1
  132. package/dist/client/assets/{editor-B9nqdqUb.js → editor-Bq1ZBF8A.js} +1 -1
  133. package/dist/client/assets/{empty-state-CUy_IWGW.js → empty-state-BRQafZPm.js} +1 -1
  134. package/dist/client/assets/{empty-state-CyI2CaLY.js → empty-state-C2oFPF-n.js} +1 -1
  135. package/dist/client/assets/{extract-connection-data-BYtH8M2u.js → extract-connection-data-C8xiH7IM.js} +1 -1
  136. package/dist/client/assets/{feature-gate-Cf4hZv0B.js → feature-gate-_oqPdUHE.js} +1 -1
  137. package/dist/client/assets/{feature-paywall-BSg5h6Wb.js → feature-paywall-Ipi4hKsO.js} +1 -1
  138. package/dist/client/assets/{file-explorer-BaQZtdi0.js → file-explorer-B1pmunvu.js} +1 -1
  139. package/dist/client/assets/{file-preview-C3-dWXmK.js → file-preview-BADsX5FY.js} +1 -1
  140. package/dist/client/assets/{file-share-button-BuCRyD4f.js → file-share-button-CJVW9-2r.js} +1 -1
  141. package/dist/client/assets/{file-type-icon-Dg8sADAf.js → file-type-icon-61vCm4NO.js} +1 -1
  142. package/dist/client/assets/{folder-icon-DA4ZaB45.js → folder-icon-DLuVHdgH.js} +1 -1
  143. package/dist/client/assets/{form-DwCt2SR2.js → form-D-nyx1PA.js} +1 -1
  144. package/dist/client/assets/{gateway-client-D0oBW_qu.js → gateway-client-Dy7XUNem.js} +1 -1
  145. package/dist/client/assets/{general-B9q-xe3O.js → general-CHWPS_9e.js} +1 -1
  146. package/dist/client/assets/{github-icon-C0b5ErP6.js → github-icon-YTcHmNlJ.js} +1 -1
  147. package/dist/client/assets/{home-Dd28TK1r.js → home-DgPPVff1.js} +1 -1
  148. package/dist/client/assets/{hooks-D0h9yhqP.js → hooks-Tk18TRVH.js} +2 -2
  149. package/dist/client/assets/{hooks-DZN1ZKP-.js → hooks-p4Q94DpI.js} +1 -1
  150. package/dist/client/assets/{icon-button-DU-Ln0Ge.js → icon-button-BDccBwxx.js} +1 -1
  151. package/dist/client/assets/{index--5vhPfMl.js → index-BmOHjvYS.js} +1 -1
  152. package/dist/client/assets/{index-BNah-P_g.css → index-CCCwF5vG.css} +1 -1
  153. package/dist/client/assets/{index-BfbICK5t.js → index-CQSV5NNK.js} +1 -1
  154. package/dist/client/assets/{index-AOu8Y3dB.js → index-CVBQnECc.js} +1 -1
  155. package/dist/client/assets/{index-CB_d_Ww9.js → index-CXUyZtYP.js} +1 -1
  156. package/dist/client/assets/index-D5yWNDr1.js +1 -0
  157. package/dist/client/assets/{index-0kHkZucW.js → index-DRlLQrFc.js} +1 -1
  158. package/dist/client/assets/{index-BfTKB7dV.js → index-Di_BAeVO.js} +1 -1
  159. package/dist/client/assets/{index-CjolVbvM.js → index-DopULJi0.js} +1 -1
  160. package/dist/client/assets/{index-ChGB7Srd.js → index-Dvd4Od7g.js} +1 -1
  161. package/dist/client/assets/{index-B4_5ne-m.js → index-ViRfM1Gu.js} +54 -54
  162. package/dist/client/assets/{index-B4Sw3hof.js → index-X2eOQPgI.js} +1 -1
  163. package/dist/client/assets/{index-IS0010-i.js → index-YBhFd3U8.js} +1 -1
  164. package/dist/client/assets/{index-BK4gf4on.js → index-aoyaciW5.js} +1 -1
  165. package/dist/client/assets/{index-redirect-BeZh12s-.js → index-redirect-DAWKfZzt.js} +1 -1
  166. package/dist/client/assets/{index-D_t5RQk4.js → index-uZNfeQt8.js} +1 -1
  167. package/dist/client/assets/{infiniteQueryObserver-CzIaF1BV.js → infiniteQueryObserver-D531v4aA.js} +1 -1
  168. package/dist/client/assets/{infra-billing-DMsr0Q0z.js → infra-billing-C3r6_l-d.js} +1 -1
  169. package/dist/client/assets/{input-D7rTqiZA.js → input-Bw5CcCxY.js} +2 -2
  170. package/dist/client/assets/{input-DhQYTu0H.js → input-CZi9DBsg.js} +1 -1
  171. package/dist/client/assets/{input-DmFaWWaQ.js → input-CanXr3zf.js} +1 -1
  172. package/dist/client/assets/{integration-icon-CT7gtNMF.js → integration-icon-BUiAcjJI.js} +1 -1
  173. package/dist/client/assets/{label-C5dVgFkO.js → label-C0Z8BQK8.js} +1 -1
  174. package/dist/client/assets/{last-preview-page-BbdRTqMd.js → last-preview-page-Bw5iq9BG.js} +1 -1
  175. package/dist/client/assets/{layout-CXaobmoR.js → layout-CLlZ53T9.js} +1 -1
  176. package/dist/client/assets/{legacy-agents-deep-B2dKvF3G.js → legacy-agents-deep-CPHek8zK.js} +1 -1
  177. package/dist/client/assets/{legacy-main-redirect-psdr3_pB.js → legacy-main-redirect-DaK05WFD.js} +1 -1
  178. package/dist/client/assets/library-BOlU1qHF.js +161 -0
  179. package/dist/client/assets/{login-D0perYnq.js → login-zkguOyNC.js} +1 -1
  180. package/dist/client/assets/{markdown-CdMnKnHM.js → markdown-BAxgNtTV.js} +1 -1
  181. package/dist/client/assets/{mcp-app-renderer-kud7EQ1E.js → mcp-app-renderer-s982DJoX.js} +2 -2
  182. package/dist/client/assets/{mcp-oauth-Bqx9uZfn.js → mcp-oauth-CuN2M9eY.js} +1 -1
  183. package/dist/client/assets/{members-BWNEw7IY.js → members-CHg0X5Qv.js} +1 -1
  184. package/dist/client/assets/{message-templates-CwYx_hD_.js → message-templates-DiXmLQv9.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-i9lqZoyF.js → mini-report-page-BP2VfDmW.js} +1 -1
  186. package/dist/client/assets/{mock-board-DDxAYcbL.js → mock-board-CsD-jS_t.js} +7 -7
  187. package/dist/client/assets/{monaco-editor-BM2SBH_J.js → monaco-editor-GTuWbg2n.js} +1 -1
  188. package/dist/client/assets/{monitoring-stats-row-BAfuoPc4.js → monitoring-stats-row-C0txjqQF.js} +1 -1
  189. package/dist/client/assets/{multi-select-Cma9DT-0.js → multi-select-BSBeiPDs.js} +1 -1
  190. package/dist/client/assets/{mustache-DCrtQrVG.js → mustache-CBCEG5qI.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-Bjj2LnDu.js → oauth-callback-BzXzh5YU.js} +1 -1
  192. package/dist/client/assets/{oauth-callback-ai-provider-iJcxShkv.js → oauth-callback-ai-provider-P5-Mdqw7.js} +1 -1
  193. package/dist/client/assets/{onboarding-DdPHiaTb.js → onboarding-Cfx2WJWh.js} +1 -1
  194. package/dist/client/assets/{optimistic-project-sidebar-views-DbUoja1k.js → optimistic-project-sidebar-views-DL2cPEil.js} +1 -1
  195. package/dist/client/assets/org-file-open-context-ClVFPMFS.js +1 -0
  196. package/dist/client/assets/{organization-choice-DSZdyMNl.js → organization-choice-D8YfGT0z.js} +1 -1
  197. package/dist/client/assets/{orgs-EQ3dRKq1.js → orgs-DTy0l6iW.js} +1 -1
  198. package/dist/client/assets/{page-seo-form-BgfALyeP.js → page-seo-form-BDho5kHd.js} +1 -1
  199. package/dist/client/assets/{pair-mgqlVrg4.js → pair-CXtHPu_2.js} +7 -7
  200. package/dist/client/assets/{plan-ladder-DFDsraie.js → plan-ladder-Cz1SRX7G.js} +1 -1
  201. package/dist/client/assets/{popover-BREpugAm.js → popover-D9J3Ecq5.js} +1 -1
  202. package/dist/client/assets/{post-calendar-CnbsL0eo.js → post-calendar-B6HqShTj.js} +1 -1
  203. package/dist/client/assets/{post-editor-9KdgWdvu.js → post-editor-Dub0lnIC.js} +1 -1
  204. package/dist/client/assets/{preview-content-BZq0WigR.js → preview-content-DqZbwIgq.js} +1 -1
  205. package/dist/client/assets/{preview-dialog-h7LoP6ZX.js → preview-dialog-DwsfWiX4.js} +1 -1
  206. package/dist/client/assets/{primitives-zMFwX0Jx.js → primitives-B3jGlz5R.js} +1 -1
  207. package/dist/client/assets/{profile-CstkdBJB.js → profile-DRpLAxpV.js} +1 -1
  208. package/dist/client/assets/{project-app-view-BUXGEIxz.js → project-app-view-CDnyZsfy.js} +1 -1
  209. package/dist/client/assets/{project-feed-B2rjMsm6.js → project-feed-BNODHWCd.js} +1 -1
  210. package/dist/client/assets/{project-icon-BuXyfXr6.js → project-icon-C2aP6VAt.js} +1 -1
  211. package/dist/client/assets/project-reports-pxfEiDuc.js +1 -0
  212. package/dist/client/assets/project-tasks-BHr51N_5.js +1 -0
  213. package/dist/client/assets/{prompts-C8Tw6ift.js → prompts-ChUmDgBe.js} +1 -1
  214. package/dist/client/assets/record-editor-DFMI1izT.js +1 -0
  215. package/dist/client/assets/{redirect-editor-fDaBjJbA.js → redirect-editor-DCDkcBex.js} +1 -1
  216. package/dist/client/assets/registry-DAYpp-LB.js +2 -0
  217. package/dist/client/assets/{registry-layout-CBmayW3a.js → registry-layout-Dj4Ep3NC.js} +1 -1
  218. package/dist/client/assets/reports-Ac74_llD.js +1 -0
  219. package/dist/client/assets/{reports-D3ZxTpvh.js → reports-CX9Egd7g.js} +1 -1
  220. package/dist/client/assets/{reports-onboarding-C-jYNNpv.js → reports-onboarding-Dr7ZP07o.js} +1 -1
  221. package/dist/client/assets/{reports-tab-ClSQGtJf.js → reports-tab-6o6Xq74z.js} +2 -2
  222. package/dist/client/assets/{repositories-VKk9R6NV.js → repositories-DVzvtTGH.js} +1 -1
  223. package/dist/client/assets/{repository-import-picker-Bxit3rwH.js → repository-import-picker-_MvWhsff.js} +1 -1
  224. package/dist/client/assets/{repository-picker-Dtn2F8yh.js → repository-picker-CUSn6z2H.js} +1 -1
  225. package/dist/client/assets/{require-capability-DNPqpx0A.js → require-capability-Co3UWcKm.js} +1 -1
  226. package/dist/client/assets/{required-auth-layout-DbcZh8KB.js → required-auth-layout-CCMTdUQL.js} +1 -1
  227. package/dist/client/assets/{reset-password-H5cLuWq1.js → reset-password-372vF6mz.js} +1 -1
  228. package/dist/client/assets/{resizable-Dw8LR1j8.js → resizable-C1agfd9G.js} +1 -1
  229. package/dist/client/assets/{review-settings-CQBykdsR.js → review-settings-B1JUgDgo.js} +1 -1
  230. package/dist/client/assets/{rich-text-link-control-XbfHUQMq.js → rich-text-link-control-CtGfeDDb.js} +1 -1
  231. package/dist/client/assets/{roles-CoipftcE.js → roles-BsnaB11h.js} +1 -1
  232. package/dist/client/assets/{route-COHKdv7H.js → route-BORVoZ7m.js} +1 -1
  233. package/dist/client/assets/route-CA1mAWwz.js +1 -0
  234. package/dist/client/assets/{route-BKi-EnKl.js → route-D-IJHs-q.js} +1 -1
  235. package/dist/client/assets/route-page-header-B0gCkOLw.js +1 -0
  236. package/dist/client/assets/runnable-block-editor-C3xUpeAq.js +16 -0
  237. package/dist/client/assets/{sandbox-lifecycle-context-HIhyPh-5.js → sandbox-lifecycle-context-CFxv8KuN.js} +1 -1
  238. package/dist/client/assets/{schema-iizf-P2g.js → schema-CblLKjlF.js} +1 -1
  239. package/dist/client/assets/{scroll-area-BcoH4ReJ.js → scroll-area-C4UXe6MK.js} +1 -1
  240. package/dist/client/assets/{search-input-CmWlEMU8.js → search-input-BIO2PIb8.js} +1 -1
  241. package/dist/client/assets/{search-toggle-4qgH_UjE.js → search-toggle-DZJDiHhs.js} +1 -1
  242. package/dist/client/assets/{secrets-Bi8Smqwe.js → secrets-D5ZQ2jkM.js} +1 -1
  243. package/dist/client/assets/sections-editor-B1KSvQYw.js +2 -0
  244. package/dist/client/assets/{select--0Nrx9pz.js → select-CWiwZCZH.js} +1 -1
  245. package/dist/client/assets/{select-model-BKF1kjR-.js → select-model-FJtjM4qQ.js} +1 -1
  246. package/dist/client/assets/seo-editor-R3X5vWTc.js +1 -0
  247. package/dist/client/assets/{separator-CMAG9KMM.js → separator-CvknKP-S.js} +1 -1
  248. package/dist/client/assets/{settings-tab-BrwOMHxn.js → settings-tab-TZNv4ip9.js} +1 -1
  249. package/dist/client/assets/{sheet-KfyT4iJh.js → sheet-Dcv1ruqq.js} +1 -1
  250. package/dist/client/assets/{shell-layout-C7iq_ybu.js → shell-layout-DCySlmes.js} +1 -1
  251. package/dist/client/assets/{sidebar-Ce0KwGyJ.js → sidebar-VKfmQpw1.js} +1 -1
  252. package/dist/client/assets/{skill-preview-DaiAGQ8W.js → skill-preview-DWlT0CSK.js} +1 -1
  253. package/dist/client/assets/{skills-BfYJXdvY.js → skills-B0BBHtWL.js} +1 -1
  254. package/dist/client/assets/{sso-j34bPfk7.js → sso-DtIjqKzq.js} +1 -1
  255. package/dist/client/assets/{store-DjXldX1F.js → store-DcF0sBj5.js} +1 -1
  256. package/dist/client/assets/store-registry-BRzSXXLO.js +2 -0
  257. package/dist/client/assets/{switch-uCmnTmA3.js → switch-jCtPlC36.js} +1 -1
  258. package/dist/client/assets/{synced-repos-C07oiVeE.js → synced-repos-CE0cMzCA.js} +1 -1
  259. package/dist/client/assets/{table-Cx5xJBa9.js → table-DEPBOuqW.js} +1 -1
  260. package/dist/client/assets/{tabs-CMPX7aLH.js → tabs-D5BcvYFg.js} +1 -1
  261. package/dist/client/assets/{task-board-CwfOEd0p.js → task-board-irpkYNP7.js} +1 -1
  262. package/dist/client/assets/{task-route-C0NB5FI3.js → task-route-CCPOLwd0.js} +1 -1
  263. package/dist/client/assets/{task-status-CunX_b1I.js → task-status-6ym4yCkI.js} +1 -1
  264. package/dist/client/assets/{taskboard-analytics-BVZIpmtK.js → taskboard-analytics-DX9L7_MQ.js} +1 -1
  265. package/dist/client/assets/tasks-C18rS0d8.js +1 -0
  266. package/dist/client/assets/{tasks-CKy3IGSO.js → tasks-gWGPTcMJ.js} +2 -2
  267. package/dist/client/assets/{textarea-CNloF_6k.js → textarea-B9gSFrNU.js} +1 -1
  268. package/dist/client/assets/{thread-button-0wpTVhK0.js → thread-button-CRojH2Q6.js} +1 -1
  269. package/dist/client/assets/{thread-intent-BcdlSG8J.js → thread-intent-D7RSnMtr.js} +1 -1
  270. package/dist/client/assets/{thread-route-Bq7TohAn.js → thread-route-B6q872tw.js} +1 -1
  271. package/dist/client/assets/{thread-route-D5lCt0bb.js → thread-route-BvQ3N33X.js} +1 -1
  272. package/dist/client/assets/{thread-sheet-body-CZ7U6WOP.js → thread-sheet-body-4Hdc-P_4.js} +1 -1
  273. package/dist/client/assets/{toggle-group-BPpZ90Kk.js → toggle-group-Cs6LukfB.js} +1 -1
  274. package/dist/client/assets/{toolbar-icon-button-Da8s1pOb.js → toolbar-icon-button-BrvzhCgp.js} +1 -1
  275. package/dist/client/assets/{tooltip-Ch_anXXw.js → tooltip-CJ5hpTtY.js} +1 -1
  276. package/dist/client/assets/{track-B2ai-lhp.js → track-CQmWzPGe.js} +1 -1
  277. package/dist/client/assets/{types-DAtj8pL_.js → types-o4JUcB5t.js} +1 -1
  278. package/dist/client/assets/{usage-stats-DECzmKdw.js → usage-stats-BkyaWsuw.js} +1 -1
  279. package/dist/client/assets/{use-ai-providers-BLQu9X4b.js → use-ai-providers-D7TBn2gf.js} +1 -1
  280. package/dist/client/assets/{use-automations-DGQLDHfM.js → use-automations-BnCVpUqP.js} +1 -1
  281. package/dist/client/assets/{use-autosave-D2GJMvju.js → use-autosave-DyNoS35U.js} +1 -1
  282. package/dist/client/assets/{use-connect-companion-TpX59d2A.js → use-connect-companion-9ZpyI9Fc.js} +1 -1
  283. package/dist/client/assets/{use-connection-DEkZ7Z3y.js → use-connection-CWmCnJzq.js} +1 -1
  284. package/dist/client/assets/{use-copy-BdX2_tpS.js → use-copy-C4Sqw6FJ.js} +1 -1
  285. package/dist/client/assets/{use-create-virtual-mcp-B22agNFs.js → use-create-virtual-mcp-CF6SrwfA.js} +1 -1
  286. package/dist/client/assets/{use-date-fns-locale-DdFVZp6l.js → use-date-fns-locale-FAB4qsTj.js} +1 -1
  287. package/dist/client/assets/{use-debounced-autosave-g0CT53cz.js → use-debounced-autosave-DyrcpQku.js} +1 -1
  288. package/dist/client/assets/{use-debounced-value-CPADjlu8.js → use-debounced-value-CTsArd76.js} +1 -1
  289. package/dist/client/assets/{use-deco-credits-0LI1tSh2.js → use-deco-credits-DX-A_4LZ.js} +1 -1
  290. package/dist/client/assets/{use-decopilot-events-CztvGxbe.js → use-decopilot-events-B_U6akcK.js} +1 -1
  291. package/dist/client/assets/{use-delete-connection-BrxuwVV0.js → use-delete-connection-zGLdQuFY.js} +1 -1
  292. package/dist/client/assets/{use-deployment-admin-BW07NJZx.js → use-deployment-admin-ClPzrInO.js} +1 -1
  293. package/dist/client/assets/{use-entitlements-Cpg4O4cU.js → use-entitlements-zp_dUL_T.js} +1 -1
  294. package/dist/client/assets/{use-fast-preview-draft-url-BS4vDkY8.js → use-fast-preview-draft-url-Cz3sAOXf.js} +1 -1
  295. package/dist/client/assets/{use-file-configs-T83FDKTN.js → use-file-configs-CNHCYE4_.js} +1 -1
  296. package/dist/client/assets/{use-in-settings-CCWZ9EQU.js → use-in-settings-7N-jImN-.js} +1 -1
  297. package/dist/client/assets/{use-infinite-scroll-CQVHxZ2X.js → use-infinite-scroll-tKxzTnAi.js} +1 -1
  298. package/dist/client/assets/{use-join-requests-BM1WOs-R.js → use-join-requests-DsMh_VIg.js} +1 -1
  299. package/dist/client/assets/{use-main-panel-tabs-BGkjNCY6.js → use-main-panel-tabs-osVdCCKw.js} +1 -1
  300. package/dist/client/assets/{use-mcp-auth-status-DPrXZk0m.js → use-mcp-auth-status-BN0fGnjh.js} +1 -1
  301. package/dist/client/assets/{use-mcp-client-Di29uH1Z.js → use-mcp-client-DRrvMA7R.js} +1 -1
  302. package/dist/client/assets/{use-mcp-prompts-pRQvLesG.js → use-mcp-prompts-CFfQkfFk.js} +1 -1
  303. package/dist/client/assets/{use-mcp-tools-BTMKYjmq.js → use-mcp-tools-ZkLjVEAC.js} +1 -1
  304. package/dist/client/assets/{use-members-2-cC5S8b.js → use-members-Dtgbai4E.js} +1 -1
  305. package/dist/client/assets/{use-mobile-Br1FbuT5.js → use-mobile-DlkLKfXJ.js} +1 -1
  306. package/dist/client/assets/{use-navigate-to-agent-BIB5Nkxx.js → use-navigate-to-agent-B7EkWSI-.js} +1 -1
  307. package/dist/client/assets/{use-open-billing-url-DwCvmaT1.js → use-open-billing-url-rAHLvZUq.js} +1 -1
  308. package/dist/client/assets/{use-org-auth-client-BQN7hmW6.js → use-org-auth-client-DRDr1ayU.js} +1 -1
  309. package/dist/client/assets/{use-org-fs-up6Ae3F-.js → use-org-fs-CRcsrb-3.js} +1 -1
  310. package/dist/client/assets/{use-org-repo-syncs-B1-u1Sww.js → use-org-repo-syncs-BDI_NBKG.js} +1 -1
  311. package/dist/client/assets/{use-org-sso-CSb7uzWR.js → use-org-sso-sXA-lCl2.js} +1 -1
  312. package/dist/client/assets/{use-organization-roles-DP4t5Npf.js → use-organization-roles-BGK09C8Z.js} +1 -1
  313. package/dist/client/assets/{use-organization-settings-B7QbhgeU.js → use-organization-settings-BWh5ecK1.js} +1 -1
  314. package/dist/client/assets/{use-panel-navigate-7owLLl5-.js → use-panel-navigate-aNh4qA0w.js} +1 -1
  315. package/dist/client/assets/{use-project-native-view-presence-C6Z-dNAC.js → use-project-native-view-presence-bc-dlOed.js} +1 -1
  316. package/dist/client/assets/{use-project-scope-D7MgPnbk.js → use-project-scope-BWH2x_Fv.js} +1 -1
  317. package/dist/client/assets/{use-registry-connections-CvrvQHoJ.js → use-registry-connections-BEkW1hW1.js} +1 -1
  318. package/dist/client/assets/{use-releases-DYrm3R-D.js → use-releases-BqU5AbHR.js} +1 -1
  319. package/dist/client/assets/{use-reports-diagnostic-B0GD9uDf.js → use-reports-diagnostic-DbkBmwAy.js} +1 -1
  320. package/dist/client/assets/{use-route-default-main--vHXCkHM.js → use-route-default-main-C08nBhva.js} +1 -1
  321. package/dist/client/assets/{use-secrets-DwITZFB8.js → use-secrets-_TBYCToI.js} +1 -1
  322. package/dist/client/assets/use-section-preview-base-CIB9ERj3.js +1 -0
  323. package/dist/client/assets/{use-session-runtime-B1xdg1Mc.js → use-session-runtime-DXJsM3Xo.js} +1 -1
  324. package/dist/client/assets/{use-tags-DXxTmE03.js → use-tags-BtlTltF7.js} +1 -1
  325. package/dist/client/assets/{use-task-board-analytics-5o37lq8z.js → use-task-board-analytics-Bn5ZBvNV.js} +1 -1
  326. package/dist/client/assets/{use-task-metadata-xMti_d98.js → use-task-metadata-n3_Ckq8i.js} +1 -1
  327. package/dist/client/assets/{use-thread-outputs-BwzUBEaq.js → use-thread-outputs-hUD6BIlr.js} +1 -1
  328. package/dist/client/assets/{use-view-mode-DB3Sv4EV.js → use-view-mode-z9PDHpCl.js} +1 -1
  329. package/dist/client/assets/{use-virtual-mcp-CdMkF3Nz.js → use-virtual-mcp-mXTxLOzX.js} +1 -1
  330. package/dist/client/assets/useInfiniteQuery-B8BU5xZL.js +1 -0
  331. package/dist/client/assets/{useQueries-B3o1rvWe.js → useQueries-9_e6uzO5.js} +1 -1
  332. package/dist/client/assets/useSuspenseInfiniteQuery-B0apeUzG.js +1 -0
  333. package/dist/client/assets/{users-DBFRWsia.js → users-cZqUrAVc.js} +1 -1
  334. package/dist/client/assets/{utils-gTOau_mh.js → utils-BCIk8m53.js} +1 -1
  335. package/dist/client/assets/{variant-calendar-DOxG9iwM.js → variant-calendar-B_X3Kgq2.js} +1 -1
  336. package/dist/client/assets/{variant-matcher-override-DPq8EH6t.js → variant-matcher-override-C3r4SJlV.js} +1 -1
  337. package/dist/client/assets/{view-mode-toggle-DYECPSMs.js → view-mode-toggle-DwUTECrP.js} +1 -1
  338. package/dist/client/assets/{virtual-mcp-AqKeX5w8.js → virtual-mcp-B-vJ4hSc.js} +1 -1
  339. package/dist/client/index.html +2 -2
  340. package/dist/server/cli.js +1 -1
  341. package/dist/server/server.js +1 -1
  342. package/package.json +1 -1
  343. package/dist/client/assets/agent-app-Dd4FMRFP.js +0 -1
  344. package/dist/client/assets/agent-assets-ihYul22E.js +0 -1
  345. package/dist/client/assets/agent-deck-BWPlKksS.js +0 -1
  346. package/dist/client/assets/agent-file-BKO35b36.js +0 -1
  347. package/dist/client/assets/agent-library-file-B3_-CXIA.js +0 -1
  348. package/dist/client/assets/agent-settings-BxZaeWUx.js +0 -1
  349. package/dist/client/assets/agent-site-editor-code-B-pWeSRV.js +0 -2
  350. package/dist/client/assets/agent-site-editor-content-BGJ14_Az.js +0 -2
  351. package/dist/client/assets/agent-view-DDrzopEk.js +0 -1
  352. package/dist/client/assets/api-keys-DEkuX1eT.js +0 -1
  353. package/dist/client/assets/app-editor-ChfXMKUs.js +0 -1
  354. package/dist/client/assets/automations-BQHaweWF.js +0 -1
  355. package/dist/client/assets/category-editor-BTonT0GY.js +0 -1
  356. package/dist/client/assets/index-DbfxHNth.js +0 -1
  357. package/dist/client/assets/library-CHpieazL.js +0 -161
  358. package/dist/client/assets/org-file-open-context-DNcgI0Uf.js +0 -1
  359. package/dist/client/assets/project-reports-BCqm5aO0.js +0 -1
  360. package/dist/client/assets/project-tasks-Bka5utN5.js +0 -1
  361. package/dist/client/assets/record-editor-BpAD-e4x.js +0 -1
  362. package/dist/client/assets/registry-CtLO9kjB.js +0 -2
  363. package/dist/client/assets/reports-D2RKwYmT.js +0 -1
  364. package/dist/client/assets/route-C9H7VfVw.js +0 -1
  365. package/dist/client/assets/route-page-header-KctxVQ_e.js +0 -1
  366. package/dist/client/assets/runnable-block-editor-BzVWSPHL.js +0 -16
  367. package/dist/client/assets/sections-editor-Bo5eUKAB.js +0 -2
  368. package/dist/client/assets/seo-editor-D9L3VA5c.js +0 -1
  369. package/dist/client/assets/store-registry-RTogK1X0.js +0 -2
  370. package/dist/client/assets/tasks-DF_oVYA4.js +0 -1
  371. package/dist/client/assets/use-section-preview-base-BFHyMpzJ.js +0 -1
  372. package/dist/client/assets/useInfiniteQuery-DvCOEAKG.js +0 -1
  373. package/dist/client/assets/useSuspenseInfiniteQuery-DMqlAGdI.js +0 -1
@@ -1,8 +1,8 @@
1
- import{c as R,b as G,r as L,l as O,j as s,ao as fe,bL as os,ap as be,bN as $e,B as ee,ar as rs,aq as as,bM as Vs,bK as is,x as he,aU as ls,dS as me,dT as st,a6 as cs,e as ds,t as ye,q as X,a0 as we,d as Oe,a9 as Ke,dK as us,T as ps,K as ms,m as fs,I as hs,F as xs,H as gs,G as pe,aR as nt,aS as ot,aT as rt,h as bs,aD as As,aC as vs,an as js,a as ys,_ as ws,$ as Cs,au as ze,R as bt,bT as Ns,aB as Ss}from"./index-B4_5ne-m.js";import{c as ks,d as At,P as Ts,i as Is}from"./index-B4Sw3hof.js";import{K as _s,b as Ds}from"./shell-layout-C7iq_ybu.js";import{a as Ps}from"./use-virtual-mcp-CdMkF3Nz.js";import{w as Rs,A as Ms}from"./autosend-DrbiZ7KD.js";import{s as Es,r as at,i as Fs,c as Ls,w as zs,H as Us}from"./chat-draft-CYnWSaLo.js";import{u as Bs}from"./use-session-runtime-B1xdg1Mc.js";import{i as vt}from"./ArrowRight-DaeNVQjU.js";import{i as jt}from"./ArrowUp-CMB2_B55.js";import{t as Ie,as as $s,a9 as yt,d as Qe,ab as Os,O as Ks,at as Qs,L as wt,j as Ct,au as Nt,x as Ys,av as Gs,aw as qs}from"./agent-icon-Bbnm30MH.js";import{a as St}from"./Image01-BHoZzJSj.js";import{i as Hs}from"./Upload01-CgS71RUS.js";import{i as Ye}from"./X-DcceC-EQ.js";import{a as Ge,b as Ws,c as _e,i as Zs,k as Js,l as Xs,m as en,n as tn,o as sn,p as nn,q as on,f as rn,u as an,s as Vn,d as ln}from"./chat-context-BSf3NsZt.js";import{e as cn,z as dn,p as un,c as pn}from"./hooks-DZN1ZKP-.js";import{i as mn}from"./AlertCircle-CvB24fpQ.js";import{a as fn}from"./Copy01-KomJ49aq.js";import{a as Ue,b as qe,d as He,f as We,F as kt}from"./form-DwCt2SR2.js";import{c as hn,S as xn,b as gn,a as bn,d as An}from"./select--0Nrx9pz.js";import{t as Tt}from"./ChevronUp-Dy-cXbOz.js";import{T as De,a as Pe,c as Re}from"./tooltip-Ch_anXXw.js";import{i as vn}from"./ArrowLeft-CuPXwhY9.js";import{M as jn,S as yn}from"./usage-stats-DECzmKdw.js";import{c as wn,b as Cn}from"./tabs-CMPX7aLH.js";import{t as Be}from"./Tool02-BcSzj1eN.js";import{d as Nn,h as Sn,c as kn,b as Tn,D as In}from"./dialog-BVRmgEZZ.js";import{d as Ce,e as _n,b as Dn,f as Pn}from"./use-entitlements-Cpg4O4cU.js";import{u as Rn}from"./use-deco-credits-0LI1tSh2.js";import{I as Mn}from"./input-DhQYTu0H.js";import{T as Vt,a as En}from"./toggle-group-BPpZ90Kk.js";import{s as Fn}from"./tool-namespace-DmnQIdtF.js";import{t as Ln}from"./utils-CVEq3hMx.js";import{u as zn}from"./use-open-billing-url-DwCvmaT1.js";import{s as Un}from"./XClose-CZo1KF0t.js";import{M as Bn,m as Ze,g as $n,a as On}from"./decopilot-JzsJWa1H.js";import{a as It,b as _t,P as Dt}from"./popover-BREpugAm.js";import{c as Kn,b as Qn,a as Yn,D as Gn}from"./drawer-BwM5wPz_.js";import{u as qn}from"./use-mobile-Br1FbuT5.js";import{t as Hn}from"./Stars01-BcbLgM7d.js";import{d as Wn}from"./use-organization-settings-B7QbhgeU.js";import{u as Pt,c as Zn}from"./use-ai-providers-BLQu9X4b.js";import{M as Jn}from"./index-0kHkZucW.js";import{p as Rt,u as Xn,T as eo,a as to,U as so}from"./input-DmFaWWaQ.js";import{d as no,g as it,s as oo}from"./gateway-client-D0oBW_qu.js";import{u as ro}from"./use-mcp-client-Di29uH1Z.js";import{l as ao,g as Vo}from"./use-mcp-prompts-pRQvLesG.js";import{i as io}from"./Link01-BSX_7wIu.js";import{s as lt}from"./Plus-BuCQnPNG.js";import"./hooks-D0h9yhqP.js";import{p as lo,q as co}from"./question-004-sINsf4GQ.js";import{A as uo}from"./avatar-DAAVe66-.js";import{u as po}from"./use-members-2-cC5S8b.js";import{F as ct}from"./feature-paywall-BSg5h6Wb.js";import{A as mo}from"./add-connection-dialog-DDFaH4NS.js";import{u as fo}from"./use-is-desktop-app-BNujXJc_.js";const Le="cubic-bezier(0.645, 0.045, 0.355, 1)",iV=44,ho={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-warning/5 after:pointer-events-none after:-z-10"},xo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},go={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=R.c(69),{icon:n,label:o,count:a,title:V,footerLeft:r,footerRight:i,children:l,defaultExpanded:p,variant:d,onClose:c}=t,u=d===void 0?"default":d,m=G(),[h,f]=L.useState(p),[x,b]=L.useState(!1);let g;e[0]!==c?(g=()=>{b(!0),c?.()},e[0]=c,e[1]=g):g=e[1];const v=g;if(x)return null;const A=xo[u],j=ho[u];let w;e[2]!==A||e[3]!==j?(w=O("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,j),e[2]=A,e[3]=j,e[4]=w):w=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>f(bo),e[5]=y):y=e[5];const C=h&&"rounded-b-none",S=!h&&"rounded-b-xl";let N;e[6]!==C||e[7]!==S?(N=O("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",C,S),e[6]=C,e[7]=S,e[8]=N):N=e[8];const _=go[u];let k;e[9]!==_?(k=O("shrink-0",_),e[9]=_,e[10]=k):k=e[10];let P;e[11]!==n||e[12]!==k?(P=s.jsx("span",{className:k,children:n}),e[11]=n,e[12]=k,e[13]=P):P=e[13];let D;e[14]!==o?(D=s.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=D):D=e[15];let M;e[16]!==a?(M=a?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:a}):null,e[16]=a,e[17]=M):M=e[17];const E=h?"rotate(180deg)":"rotate(0deg)";let T;e[18]!==E?(T=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(Tt,{size:16,style:{transform:E,transition:`transform 180ms ${Le}`}})}),e[18]=E,e[19]=T):T=e[19];let F;e[20]!==m?(F=m("chat.collapsibleHighlight.closeLabel"),e[20]=m,e[21]=F):F=e[21];let U;e[22]!==m?(U=m("chat.collapsibleHighlight.closeTitle"),e[22]=m,e[23]=U):U=e[23];let q,$;e[24]!==v?(q=re=>{re.stopPropagation(),v()},$=re=>{(re.key==="Enter"||re.key===" ")&&(re.preventDefault(),re.stopPropagation(),v())},e[24]=v,e[25]=q,e[26]=$):(q=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ye,{size:16}),e[27]=z):z=e[27];let Q;e[28]!==F||e[29]!==U||e[30]!==q||e[31]!==$?(Q=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":F,title:U,onClick:q,onKeyDown:$,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:z}),e[28]=F,e[29]=U,e[30]=q,e[31]=$,e[32]=Q):Q=e[32];let B;e[33]!==h||e[34]!==P||e[35]!==D||e[36]!==M||e[37]!==T||e[38]!==Q||e[39]!==N?(B=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:N,children:[P,D,M,T,Q]}),e[33]=h,e[34]=P,e[35]=D,e[36]=M,e[37]=T,e[38]=Q,e[39]=N,e[40]=B):B=e[40];const te=h?"1fr":"0fr";let J;e[41]!==te?(J={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${Le}`},e[41]=te,e[42]=J):J=e[42];let I;e[43]===Symbol.for("react.memo_cache_sentinel")?(I={overflow:"hidden",minHeight:0},e[43]=I):I=e[43];const Y=h?1:0;let H;e[44]!==Y?(H={opacity:Y,transition:`opacity 120ms ${Le}`,maxHeight:"60vh"},e[44]=Y,e[45]=H):H=e[45];let Z;e[46]!==V?(Z=V?s.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:s.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:V})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=V,e[47]=Z):Z=e[47];let W;e[48]!==l||e[49]!==V?(W=l?s.jsx("div",{className:O("pb-4",!V&&"pt-4"),children:l}):null,e[48]=l,e[49]=V,e[50]=W):W=e[50];let se;e[51]!==Z||e[52]!==W?(se=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,W]}),e[51]=Z,e[52]=W,e[53]=se):se=e[53];let ae;e[54]!==r||e[55]!==i?(ae=r||i?s.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:r}),s.jsx("div",{className:"flex items-center gap-2",children:i})]})}):null,e[54]=r,e[55]=i,e[56]=ae):ae=e[56];let Ve;e[57]!==H||e[58]!==se||e[59]!==ae?(Ve=s.jsx("div",{style:I,children:s.jsxs("div",{className:"flex flex-col",style:H,children:[se,ae]})}),e[57]=H,e[58]=se,e[59]=ae,e[60]=Ve):Ve=e[60];let ne;e[61]!==J||e[62]!==Ve?(ne=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:Ve}),e[61]=J,e[62]=Ve,e[63]=ne):ne=e[63];let ie;return e[64]!==B||e[65]!==ne||e[66]!==w||e[67]!==u?(ie=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":u,className:w,children:[B,ne]}),e[64]=B,e[65]=ne,e[66]=w,e[67]=u,e[68]=ie):ie=e[68],ie}function bo(t){return!t}const Ao=fe({content:be().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:$e(["pending","in_progress","completed"]),activeForm:be().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),Mt=fe({todos:os(Ao)}),vo="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";cn({description:vo,inputSchema:dn(Mt),execute:async({todos:t})=>({ok:!0,count:t.length})});const jo="tool-todo_write",yo=new Set(["input-available","output-available"]);function wo(t){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.role!=="assistant")continue;const o=n.parts;if(Array.isArray(o))for(let a=o.length-1;a>=0;a--){const V=o[a];if(V.type!==jo||typeof V.state!="string"||!yo.has(V.state))continue;const r=Mt.safeParse(V.input);if(r.success)return r.data.todos}}return[]}function Et(t){const e=[];for(const n of t)if("state"in n&&n.state==="approval-requested"&&"approval"in n&&n.approval?.id&&"toolCallId"in n&&n.toolCallId){const o="toolName"in n&&typeof n.toolName=="string"?n.toolName:n.type.startsWith("tool-")?n.type.replace("tool-",""):"Tool";e.push({approvalId:n.approval.id,toolCallId:n.toolCallId,toolName:o,friendlyName:Ln(Fn(o)),input:n.input})}return e}function Ft(t){return t.at(-1)}function Lt(t){const e=[];for(const n of t)n.type==="tool-propose_plan"&&n.state==="input-available"&&e.push({toolCallId:n.toolCallId,plan:n.input.plan,state:n.state});return e}function Co(t){return t?t.message.startsWith("[CREDITS]"):!1}const No={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,todos:[]};function So(t){const{messages:e,error:n,finishReason:o,isStreaming:a,isWaitingForApprovals:V}=t;if(!a&&n&&Co(n))return{...No,isCreditExhausted:!0};const r=e.at(-1),i=r?.role==="assistant"?r.parts:[],l=i,d=!!l.filter(j=>j.type==="tool-user_ask").filter(j=>j.state!=="output-available").length,c=Lt(i),u=Et(l),m=wo(e),h=a?null:Es(n),f=a?null:un(n),x=!a&&!!n&&!h&&!f,b=u.length>0||a&&V,g=c.length>0,A=!a&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(d||b||g))&&!x;return{isCreditExhausted:!1,planRefusal:f,subscriptionErrorKind:h,hasTodos:m.length>0,showError:x,showWarning:A,hasApprovals:b,hasPlans:g,isWaitingForUserInput:d,todos:m}}function zt(){const t=R.c(6),{messages:e,error:n,finishReason:o,isStreaming:a,isWaitingForApprovals:V}=Ge(),r=n??null,i=o??null;let l;return t[0]!==a||t[1]!==V||t[2]!==e||t[3]!==r||t[4]!==i?(l=So({messages:e,error:r,finishReason:i,isStreaming:a,isWaitingForApprovals:V}),t[0]=a,t[1]=V,t[2]=e,t[3]=r,t[4]=i,t[5]=l):l=t[5],l}function lV(){const t=zt(),e=Ce("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)}const dt="start-task",ko=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
1
+ import{c as R,b as G,r as F,l as O,j as s,ao as fe,bM as os,ap as be,bO as $e,B as ee,ar as rs,aq as as,bN as Vs,bL as is,x as he,aU as ls,dT as me,dU as st,a6 as cs,e as ds,t as ye,q as X,a0 as we,d as Oe,a9 as Ke,dL as us,T as ps,K as ms,m as fs,I as hs,F as xs,H as gs,G as pe,aR as nt,aS as ot,aT as rt,h as bs,aD as As,aC as vs,an as js,a as ys,_ as ws,$ as Cs,au as ze,R as bt,bU as Ns,aB as Ss}from"./index-ViRfM1Gu.js";import{c as ks,d as At,P as Ts,i as Is}from"./index-X2eOQPgI.js";import{K as _s,b as Ds}from"./shell-layout-DCySlmes.js";import{a as Ps}from"./use-virtual-mcp-mXTxLOzX.js";import{w as Rs,A as Ms}from"./autosend-C_B7nqHB.js";import{s as Es,r as at,i as Ls,c as Fs,w as zs,H as Us}from"./chat-draft-BfGVY5UT.js";import{u as Bs}from"./use-session-runtime-DXJsM3Xo.js";import{i as vt}from"./ArrowRight-Dvm5zccu.js";import{i as jt}from"./ArrowUp-CeEuKFtz.js";import{t as Ie,as as $s,a9 as yt,d as Qe,ab as Os,O as Ks,at as Qs,L as wt,j as Ct,au as Nt,x as Ys,av as Gs,aw as qs}from"./agent-icon-CB6qOgGd.js";import{a as St}from"./Image01-8GW5hNSe.js";import{i as Hs}from"./Upload01-C_WGdZv1.js";import{i as Ye}from"./X-DvXoapdv.js";import{a as Ge,b as Ws,c as _e,i as Zs,k as Js,l as Xs,m as en,n as tn,o as sn,p as nn,q as on,f as rn,u as an,s as Vn,d as ln}from"./chat-context-9vL2FEPm.js";import{e as cn,z as dn,p as un,c as pn}from"./hooks-p4Q94DpI.js";import{i as mn}from"./AlertCircle-BI1-7G_T.js";import{a as fn}from"./Copy01-BSU2TbGt.js";import{a as Ue,b as qe,d as He,f as We,F as kt}from"./form-D-nyx1PA.js";import{c as hn,S as xn,b as gn,a as bn,d as An}from"./select-CWiwZCZH.js";import{t as Tt}from"./ChevronUp-DLj1P2Yi.js";import{T as De,a as Pe,c as Re}from"./tooltip-CJ5hpTtY.js";import{i as vn}from"./ArrowLeft-C7E68hAX.js";import{M as jn,S as yn}from"./usage-stats-BkyaWsuw.js";import{c as wn,b as Cn}from"./tabs-D5BcvYFg.js";import{t as Be}from"./Tool02-C01DHNkH.js";import{d as Nn,h as Sn,c as kn,b as Tn,D as In}from"./dialog-Djn7c9nl.js";import{d as Ce,e as _n,b as Dn,f as Pn}from"./use-entitlements-zp_dUL_T.js";import{u as Rn}from"./use-deco-credits-DX-A_4LZ.js";import{I as Mn}from"./input-CZi9DBsg.js";import{T as Vt,a as En}from"./toggle-group-Cs6LukfB.js";import{s as Ln}from"./tool-namespace-DmnQIdtF.js";import{t as Fn}from"./utils-CVEq3hMx.js";import{u as zn}from"./use-open-billing-url-rAHLvZUq.js";import{s as Un}from"./XClose-DV3Gf7XO.js";import{M as Bn,m as Ze,g as $n,a as On}from"./decopilot-Byyy6GRB.js";import{a as It,b as _t,P as Dt}from"./popover-D9J3Ecq5.js";import{c as Kn,b as Qn,a as Yn,D as Gn}from"./drawer-CcumUZPh.js";import{u as qn}from"./use-mobile-DlkLKfXJ.js";import{t as Hn}from"./Stars01-C7tX23wY.js";import{d as Wn}from"./use-organization-settings-BWh5ecK1.js";import{u as Pt,c as Zn}from"./use-ai-providers-D7TBn2gf.js";import{M as Jn}from"./index-DRlLQrFc.js";import{p as Rt,u as Xn,T as eo,a as to,U as so}from"./input-CanXr3zf.js";import{d as no,g as it,s as oo}from"./gateway-client-Dy7XUNem.js";import{u as ro}from"./use-mcp-client-DRrvMA7R.js";import{l as ao,g as Vo}from"./use-mcp-prompts-CFfQkfFk.js";import{i as io}from"./Link01-Cx5QfFm-.js";import{s as lt}from"./Plus-DtW_ZAb1.js";import"./hooks-Tk18TRVH.js";import{p as lo,q as co}from"./question-004-sINsf4GQ.js";import{A as uo}from"./avatar-DeEBt3V6.js";import{u as po}from"./use-members-Dtgbai4E.js";import{F as ct}from"./feature-paywall-Ipi4hKsO.js";import{A as mo}from"./add-connection-dialog-D-qRDxvj.js";import{u as fo}from"./use-is-desktop-app-BNujXJc_.js";const Fe="cubic-bezier(0.645, 0.045, 0.355, 1)",iV=44,ho={default:"",error:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-destructive/5 after:pointer-events-none after:-z-10",warning:"isolate after:content-[''] after:absolute after:inset-0 after:rounded-xl after:bg-warning/5 after:pointer-events-none after:-z-10"},xo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},go={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function ue(t){const e=R.c(69),{icon:n,label:o,count:a,title:V,footerLeft:r,footerRight:i,children:l,defaultExpanded:p,variant:d,onClose:c}=t,u=d===void 0?"default":d,m=G(),[h,f]=F.useState(p),[x,b]=F.useState(!1);let g;e[0]!==c?(g=()=>{b(!0),c?.()},e[0]=c,e[1]=g):g=e[1];const v=g;if(x)return null;const A=xo[u],j=ho[u];let w;e[2]!==A||e[3]!==j?(w=O("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",A,j),e[2]=A,e[3]=j,e[4]=w):w=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>f(bo),e[5]=y):y=e[5];const C=h&&"rounded-b-none",S=!h&&"rounded-b-xl";let N;e[6]!==C||e[7]!==S?(N=O("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",C,S),e[6]=C,e[7]=S,e[8]=N):N=e[8];const _=go[u];let k;e[9]!==_?(k=O("shrink-0",_),e[9]=_,e[10]=k):k=e[10];let P;e[11]!==n||e[12]!==k?(P=s.jsx("span",{className:k,children:n}),e[11]=n,e[12]=k,e[13]=P):P=e[13];let D;e[14]!==o?(D=s.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=D):D=e[15];let M;e[16]!==a?(M=a?s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:a}):null,e[16]=a,e[17]=M):M=e[17];const E=h?"rotate(180deg)":"rotate(0deg)";let T;e[18]!==E?(T=s.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:s.jsx(Tt,{size:16,style:{transform:E,transition:`transform 180ms ${Fe}`}})}),e[18]=E,e[19]=T):T=e[19];let L;e[20]!==m?(L=m("chat.collapsibleHighlight.closeLabel"),e[20]=m,e[21]=L):L=e[21];let U;e[22]!==m?(U=m("chat.collapsibleHighlight.closeTitle"),e[22]=m,e[23]=U):U=e[23];let q,$;e[24]!==v?(q=re=>{re.stopPropagation(),v()},$=re=>{(re.key==="Enter"||re.key===" ")&&(re.preventDefault(),re.stopPropagation(),v())},e[24]=v,e[25]=q,e[26]=$):(q=e[25],$=e[26]);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ye,{size:16}),e[27]=z):z=e[27];let Q;e[28]!==L||e[29]!==U||e[30]!==q||e[31]!==$?(Q=s.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,title:U,onClick:q,onKeyDown:$,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 flex items-center justify-center -mr-1 ml-1 p-1 rounded-md hover:bg-accent",children:z}),e[28]=L,e[29]=U,e[30]=q,e[31]=$,e[32]=Q):Q=e[32];let B;e[33]!==h||e[34]!==P||e[35]!==D||e[36]!==M||e[37]!==T||e[38]!==Q||e[39]!==N?(B=s.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":h,onClick:y,className:N,children:[P,D,M,T,Q]}),e[33]=h,e[34]=P,e[35]=D,e[36]=M,e[37]=T,e[38]=Q,e[39]=N,e[40]=B):B=e[40];const te=h?"1fr":"0fr";let J;e[41]!==te?(J={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${Fe}`},e[41]=te,e[42]=J):J=e[42];let I;e[43]===Symbol.for("react.memo_cache_sentinel")?(I={overflow:"hidden",minHeight:0},e[43]=I):I=e[43];const Y=h?1:0;let H;e[44]!==Y?(H={opacity:Y,transition:`opacity 120ms ${Fe}`,maxHeight:"60vh"},e[44]=Y,e[45]=H):H=e[45];let Z;e[46]!==V?(Z=V?s.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:s.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:V})}):s.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=V,e[47]=Z):Z=e[47];let W;e[48]!==l||e[49]!==V?(W=l?s.jsx("div",{className:O("pb-4",!V&&"pt-4"),children:l}):null,e[48]=l,e[49]=V,e[50]=W):W=e[50];let se;e[51]!==Z||e[52]!==W?(se=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,W]}),e[51]=Z,e[52]=W,e[53]=se):se=e[53];let ae;e[54]!==r||e[55]!==i?(ae=r||i?s.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:r}),s.jsx("div",{className:"flex items-center gap-2",children:i})]})}):null,e[54]=r,e[55]=i,e[56]=ae):ae=e[56];let Ve;e[57]!==H||e[58]!==se||e[59]!==ae?(Ve=s.jsx("div",{style:I,children:s.jsxs("div",{className:"flex flex-col",style:H,children:[se,ae]})}),e[57]=H,e[58]=se,e[59]=ae,e[60]=Ve):Ve=e[60];let ne;e[61]!==J||e[62]!==Ve?(ne=s.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:Ve}),e[61]=J,e[62]=Ve,e[63]=ne):ne=e[63];let ie;return e[64]!==B||e[65]!==ne||e[66]!==w||e[67]!==u?(ie=s.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":u,className:w,children:[B,ne]}),e[64]=B,e[65]=ne,e[66]=w,e[67]=u,e[68]=ie):ie=e[68],ie}function bo(t){return!t}const Ao=fe({content:be().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:$e(["pending","in_progress","completed"]),activeForm:be().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),Mt=fe({todos:os(Ao)}),vo="Plan and track multi-step work. Call with the FULL todo list every time — this replaces the prior list. Call at the start of every multi-step request. Skip only for true one-shots (a single tool call or a direct answer). Mark exactly one todo `in_progress` at a time. Flip a todo to `in_progress` before starting it and to `completed` the moment it finishes — do not batch completions. Your prior tool-call inputs are your current state — read your last call to see where you are.";cn({description:vo,inputSchema:dn(Mt),execute:async({todos:t})=>({ok:!0,count:t.length})});const jo="tool-todo_write",yo=new Set(["input-available","output-available"]);function wo(t){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n.role!=="assistant")continue;const o=n.parts;if(Array.isArray(o))for(let a=o.length-1;a>=0;a--){const V=o[a];if(V.type!==jo||typeof V.state!="string"||!yo.has(V.state))continue;const r=Mt.safeParse(V.input);if(r.success)return r.data.todos}}return[]}function Et(t){const e=[];for(const n of t)if("state"in n&&n.state==="approval-requested"&&"approval"in n&&n.approval?.id&&"toolCallId"in n&&n.toolCallId){const o="toolName"in n&&typeof n.toolName=="string"?n.toolName:n.type.startsWith("tool-")?n.type.replace("tool-",""):"Tool";e.push({approvalId:n.approval.id,toolCallId:n.toolCallId,toolName:o,friendlyName:Fn(Ln(o)),input:n.input})}return e}function Lt(t){return t.at(-1)}function Ft(t){const e=[];for(const n of t)n.type==="tool-propose_plan"&&n.state==="input-available"&&e.push({toolCallId:n.toolCallId,plan:n.input.plan,state:n.state});return e}function Co(t){return t?t.message.startsWith("[CREDITS]"):!1}const No={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,todos:[]};function So(t){const{messages:e,error:n,finishReason:o,isStreaming:a,isWaitingForApprovals:V}=t;if(!a&&n&&Co(n))return{...No,isCreditExhausted:!0};const r=e.at(-1),i=r?.role==="assistant"?r.parts:[],l=i,d=!!l.filter(j=>j.type==="tool-user_ask").filter(j=>j.state!=="output-available").length,c=Ft(i),u=Et(l),m=wo(e),h=a?null:Es(n),f=a?null:un(n),x=!a&&!!n&&!h&&!f,b=u.length>0||a&&V,g=c.length>0,A=!a&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(d||b||g))&&!x;return{isCreditExhausted:!1,planRefusal:f,subscriptionErrorKind:h,hasTodos:m.length>0,showError:x,showWarning:A,hasApprovals:b,hasPlans:g,isWaitingForUserInput:d,todos:m}}function zt(){const t=R.c(6),{messages:e,error:n,finishReason:o,isStreaming:a,isWaitingForApprovals:V}=Ge(),r=n??null,i=o??null;let l;return t[0]!==a||t[1]!==V||t[2]!==e||t[3]!==r||t[4]!==i?(l=So({messages:e,error:r,finishReason:i,isStreaming:a,isWaitingForApprovals:V}),t[0]=a,t[1]=V,t[2]=e,t[3]=r,t[4]=i,t[5]=l):l=t[5],l}function lV(){const t=zt(),e=Ce("credits");return t.isCreditExhausted?e?0:1:Number(t.hasTodos)+Number(t.showError)+ +!!t.subscriptionErrorKind+ +!!t.planRefusal+Number(t.showWarning)+Number(t.hasApprovals)+Number(t.hasPlans)+Number(t.isWaitingForUserInput)}const dt="start-task",ko=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
2
2
 
3
3
  1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
4
4
  2. Call TASK_BOARD_ITEM_LIST. Its \`repos\` are this organization's repositories — the only valid values for a task's repo, so pick the one the report is about and never invent a name. Its \`items\` tell you whether an open task already covers this report: if one does, link it and stop.
5
5
  3. Otherwise call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, and assigneeId "super-agent". That assignment is what queues the work.
6
6
  4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. Never invent a URL. Do NOT implement the fix here; the task's own run does that, and the reporter gets an email when its PR is ready for review.
7
7
 
8
- The report follows.`;function To(t){return{...t,content:[{type:"paragraph",content:[ks({id:dt,name:dt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:ko}}]})]},...t.content??[]]}}function Io(t){const e=R.c(30),{current:n,total:o,onPrev:a,onNext:V}=t,r=G();if(o<=1)return null;const i=n===0,l=n===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let p;e[0]!==l?(p=O("p-0.5 classic:rounded transition-colors compact:rounded-lg",l),e[0]=l,e[1]=p):p=e[1];let d;e[2]!==r?(d=r("chat.pagination.previousLabel"),e[2]=r,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(vn,{size:14}),e[4]=c):c=e[4];let u;e[5]!==a||e[6]!==i||e[7]!==p||e[8]!==d?(u=s.jsx("button",{type:"button",onClick:a,disabled:i,className:p,"aria-label":d,children:c}),e[5]=a,e[6]=i,e[7]=p,e[8]=d,e[9]=u):u=e[9];const m=n+1;let h;e[10]!==r||e[11]!==m||e[12]!==o?(h=r("chat.pagination.counter",{current:m,total:o}),e[10]=r,e[11]=m,e[12]=o,e[13]=h):h=e[13];let f;e[14]!==h?(f=s.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=f):f=e[15];const x=n===o-1,b=n===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let g;e[16]!==b?(g=O("p-0.5 classic:rounded transition-colors compact:rounded-lg",b),e[16]=b,e[17]=g):g=e[17];let v;e[18]!==r?(v=r("chat.pagination.nextLabel"),e[18]=r,e[19]=v):v=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(vt,{size:14}),e[20]=A):A=e[20];let j;e[21]!==V||e[22]!==x||e[23]!==g||e[24]!==v?(j=s.jsx("button",{type:"button",onClick:V,disabled:x,className:g,"aria-label":v,children:A}),e[21]=V,e[22]=x,e[23]=g,e[24]=v,e[25]=j):j=e[25];let w;return e[26]!==j||e[27]!==u||e[28]!==f?(w=s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[u,f,j]}),e[26]=j,e[27]=u,e[28]=f,e[29]=w):w=e[29],w}function Ut(t){const e=R.c(8),{currentIndex:n,total:o,onPrev:a,onNext:V,extraLeft:r}=t;let i;e[0]!==n||e[1]!==V||e[2]!==a||e[3]!==o?(i=s.jsx(Io,{current:n,total:o,onPrev:a,onNext:V}),e[0]=n,e[1]=V,e[2]=a,e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[i,r]}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function _o(t){const e=R.c(17),{isStreaming:n,isAllAnswered:o,isCurrentAnswered:a,onAdvanceOrSubmit:V,submitLabel:r,nextLabel:i}=t,d=o?r===void 0?"Submit":r:i===void 0?"Next":i,c=o?n:!a,u=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let m;e[0]!==c||e[1]!==V?(m=()=>{c||V()},e[0]=c,e[1]=V,e[2]=m):m=e[2];const h=c&&"opacity-50 cursor-not-allowed";let f;e[3]!==h?(f=O("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=f):f=e[4];let x;e[5]!==c||e[6]!==d||e[7]!==m||e[8]!==f?(x=s.jsx(ee,{type:"button",size:"sm","aria-disabled":c,onClick:m,className:f,children:d}),e[5]=c,e[6]=d,e[7]=m,e[8]=f,e[9]=x):x=e[9];const b=x;if(!u)return b;let g;e[10]!==b?(g=s.jsx(De,{asChild:!0,children:b}),e[10]=b,e[11]=g):g=e[11];let v;e[12]!==u?(v=s.jsx(Pe,{children:u}),e[12]=u,e[13]=v):v=e[13];let A;return e[14]!==g||e[15]!==v?(A=s.jsxs(Re,{children:[g,v]}),e[14]=g,e[15]=v,e[16]=A):A=e[16],A}function Bt(t,e,n){return t.findIndex(o=>e(o)===n)}function ut(t,e,n,o){return t.length===0?!1:t.every(a=>o(n[e(a)]))}function pt(t,e,n,o,a){if(t.length===0)return null;const V=Bt(t,e,a);for(let r=1;r<=t.length;r++){const i=t[(V+r)%t.length];if(!i)continue;const l=e(i);if(l!==a&&!o(n[l]))return l}return null}function Do(t){return!t.isStreaming&&t.allAnswered}function $t(t){const{parts:e,partKey:n,schema:o,defaultValues:a,isStreaming:V,hasAnswer:r,onSubmit:i}=t,l=e[0]?n(e[0]):"",[p,d]=L.useState(l),[c,u]=L.useState(!1),m=rs({resolver:as(o),defaultValues:a}),h=m.watch(),f=Bt(e,n,p),x=f>=0?e[f]:void 0,b=r(h[p]),g=ut(e,n,h,r),v=Do({isStreaming:V,allAnswered:g}),A=()=>{if(f>0){const _=e[f-1];_&&d(n(_))}},j=()=>{if(f>=0&&f<e.length-1){const _=e[f+1];_&&d(n(_))}},w=()=>{const _=m.getValues(),k=pt(e,n,_,r,p);k&&d(k)},y=()=>{m.handleSubmit(_=>{const k=_;for(const P of e)i(P,k[n(P)])})()},C=L.useRef(y);C.current=y;const S=()=>{v&&(u(!1),C.current())},N=()=>{const _=m.getValues();if(ut(e,n,_,r)){if(V){u(!0);return}u(!1),C.current()}else{const k=pt(e,n,_,r,p);k&&d(k)}};return L.useEffect(()=>{if(c&&!V){if(!g){u(!1);return}u(!1),C.current()}},[c,V,g]),{form:m,activeKey:p,setActiveKey:d,currentIndex:f,currentPart:x,isCurrentAnswered:b,isAllAnswered:g,canSubmit:v,goPrev:A,goNext:j,advanceToNextUnanswered:w,submit:S,submitOrAdvance:N}}const Ot="chat.approval.defaultDenyReason";function Kt(t){const e=R.c(36),{onYolo:n}=t,o=G(),[a,V]=he();let r,i,l,p,d,c,u,m,h;if(e[0]!==n||e[1]!==a||e[2]!==V||e[3]!==o){const A=me.find(y=>y.value===a.toolApprovalLevel)??me[0];let j;e[13]!==n||e[14]!==a||e[15]!==V?(j=y=>{const C=y,S=a.toolApprovalLevel??"readonly";V({...a,toolApprovalLevel:C}),C==="auto"&&n(S)},e[13]=n,e[14]=a,e[15]=V,e[16]=j):j=e[16];const w=j;l=xn,m=a.toolApprovalLevel,h=w,i=gn,d="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",u=Po,r=bn,p=o(A.shortKey),e[0]=n,e[1]=a,e[2]=V,e[3]=o,e[4]=r,e[5]=i,e[6]=l,e[7]=p,e[8]=d,e[9]=c,e[10]=u,e[11]=m,e[12]=h}else r=e[4],i=e[5],l=e[6],p=e[7],d=e[8],c=e[9],u=e[10],m=e[11],h=e[12];let f;e[17]!==r||e[18]!==p?(f=s.jsx(r,{children:p}),e[17]=r,e[18]=p,e[19]=f):f=e[19];let x;e[20]!==i||e[21]!==d||e[22]!==c||e[23]!==u||e[24]!==f?(x=s.jsx(i,{size:d,className:c,onClick:u,children:f}),e[20]=i,e[21]=d,e[22]=c,e[23]=u,e[24]=f,e[25]=x):x=e[25];let b;e[26]!==o?(b=me.map(A=>s.jsx(hn,{value:A.value,children:o(A.labelKey)},A.value)),e[26]=o,e[27]=b):b=e[27];let g;e[28]!==b?(g=s.jsx(An,{children:b}),e[28]=b,e[29]=g):g=e[29];let v;return e[30]!==l||e[31]!==g||e[32]!==m||e[33]!==h||e[34]!==x?(v=s.jsxs(l,{value:m,onValueChange:h,children:[x,g]}),e[30]=l,e[31]=g,e[32]=m,e[33]=h,e[34]=x,e[35]=v):v=e[35],v}function Po(t){return t.stopPropagation()}function Qt(t){const e=R.c(8),{input:n}=t,o=G();if(n==null){let r;e[0]!==o?(r=o("chat.approval.noInput"),e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==r?(i=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=i):i=e[3],i}let a;try{let r;e[4]!==n?(r=JSON.stringify(n,null,2),e[4]=n,e[5]=r):r=e[5],a=r}catch{a=String(n)}let V;return e[6]!==a?(V=s.jsx("div",{className:"px-4",children:s.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:a})}),e[6]=a,e[7]=V):V=e[7],V}function Ro(t){const e=R.c(38),{approval:n,onRespond:o}=t,a=G(),[V]=he(),r=V.toolApprovalLevel??"readonly";let i;e[0]!==n.approvalId||e[1]!==r||e[2]!==o||e[3]!==a?(i=()=>o(n.approvalId,!1,a(Ot),r),e[0]=n.approvalId,e[1]=r,e[2]=o,e[3]=a,e[4]=i):i=e[4];const l=i;let p;e[5]!==n.approvalId||e[6]!==r||e[7]!==o?(p=()=>o(n.approvalId,!0,void 0,r),e[5]=n.approvalId,e[6]=r,e[7]=o,e[8]=p):p=e[8];const d=p;let c;e[9]!==n.approvalId||e[10]!==o?(c=S=>o(n.approvalId,!0,void 0,S),e[9]=n.approvalId,e[10]=o,e[11]=c):c=e[11];const u=c;let m;e[12]!==u?(m=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Kt,{onYolo:u})}),e[12]=u,e[13]=m):m=e[13];const h=m;let f;e[14]!==a?(f=a("chat.approval.denyButton"),e[14]=a,e[15]=f):f=e[15];let x;e[16]!==l||e[17]!==f?(x=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:l,children:f}),e[16]=l,e[17]=f,e[18]=x):x=e[18];let b;e[19]!==a?(b=a("chat.approval.acceptButton"),e[19]=a,e[20]=b):b=e[20];let g;e[21]!==d||e[22]!==b?(g=s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:d,children:b}),e[21]=d,e[22]=b,e[23]=g):g=e[23];let v;e[24]!==x||e[25]!==g?(v=s.jsxs(s.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=v):v=e[26];const A=v;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ie,{size:14}),e[27]=j):j=e[27];let w;e[28]!==a?(w=a("chat.approval.needsApproval"),e[28]=a,e[29]=w):w=e[29];let y;e[30]!==n.input?(y=s.jsx(Qt,{input:n.input}),e[30]=n.input,e[31]=y):y=e[31];let C;return e[32]!==n.friendlyName||e[33]!==h||e[34]!==A||e[35]!==w||e[36]!==y?(C=s.jsx(ue,{icon:j,label:w,title:n.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:A,children:y}),e[32]=n.friendlyName,e[33]=h,e[34]=A,e[35]=w,e[36]=y,e[37]=C):C=e[37],C}const Mo=Vs(be(),fe({approved:is().optional(),levelOverride:$e(["auto","readonly"]).optional()}));function Eo(t){const e=R.c(46),{approvals:n,isStreaming:o,onRespond:a}=t,V=G(),[r]=he(),i=r.toolApprovalLevel??"readonly";let l;e[0]!==n?(l=Object.fromEntries(n.map(zo)),e[0]=n,e[1]=l):l=e[1];const p=l;let d;e[2]!==i||e[3]!==a||e[4]!==V?(d=(k,P)=>{const D=P;typeof D?.approved=="boolean"&&a(k.approvalId,D.approved,D.approved===!1?V(Ot):void 0,D.levelOverride??i)},e[2]=i,e[3]=a,e[4]=V,e[5]=d):d=e[5];let c;e[6]!==n||e[7]!==p||e[8]!==o||e[9]!==d?(c={parts:n,partKey:Lo,schema:Mo,defaultValues:p,isStreaming:o,hasAnswer:Fo,onSubmit:d},e[6]=n,e[7]=p,e[8]=o,e[9]=d,e[10]=c):c=e[10];const u=$t(c);let m;e[11]!==n||e[12]!==u?(m=k=>{u.form.reset(Object.fromEntries(n.map(P=>[P.approvalId,{approved:!0,levelOverride:k}]))),u.submitOrAdvance()},e[11]=n,e[12]=u,e[13]=m):m=e[13];const h=m,f=u.currentPart,x=u.form;let b;e[14]!==u?(b=k=>{k.preventDefault(),u.submit()},e[14]=u,e[15]=b):b=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ie,{size:14}),e[16]=g):g=e[16];let v;e[17]!==n.length||e[18]!==V?(v=V("chat.approval.batchedLabel",{count:n.length}),e[17]=n.length,e[18]=V,e[19]=v):v=e[19];const A=f?.friendlyName??"";let j;e[20]!==h?(j=s.jsx(Kt,{onYolo:h}),e[20]=h,e[21]=j):j=e[21];let w;e[22]!==n.length||e[23]!==u.currentIndex||e[24]!==u.goNext||e[25]!==u.goPrev||e[26]!==j?(w=s.jsx(Ut,{currentIndex:u.currentIndex,total:n.length,onPrev:u.goPrev,onNext:u.goNext,extraLeft:j}),e[22]=n.length,e[23]=u.currentIndex,e[24]=u.goNext,e[25]=u.goPrev,e[26]=j,e[27]=w):w=e[27];let y;e[28]!==f||e[29]!==u.form.control||e[30]!==u.submitOrAdvance?(y=f?s.jsx(Uo,{approvalId:f.approvalId,control:u.form.control,onChange:u.submitOrAdvance}):null,e[28]=f,e[29]=u.form.control,e[30]=u.submitOrAdvance,e[31]=y):y=e[31];let C;e[32]!==f?(C=f?s.jsx(Qt,{input:f.input}):null,e[32]=f,e[33]=C):C=e[33];let S;e[34]!==w||e[35]!==y||e[36]!==C||e[37]!==v||e[38]!==A?(S=s.jsx(ue,{icon:g,label:v,title:A,defaultExpanded:!0,footerLeft:w,footerRight:y,children:C}),e[34]=w,e[35]=y,e[36]=C,e[37]=v,e[38]=A,e[39]=S):S=e[39];let N;e[40]!==S||e[41]!==b?(N=s.jsx("form",{onSubmit:b,children:S}),e[40]=S,e[41]=b,e[42]=N):N=e[42];let _;return e[43]!==u.form||e[44]!==N?(_=s.jsx(Ue,{...x,children:N}),e[43]=u.form,e[44]=N,e[45]=_):_=e[45],_}function Fo(t){return typeof t?.approved=="boolean"}function Lo(t){return t.approvalId}function zo(t){return[t.approvalId,{approved:void 0}]}function Uo(t){const e=R.c(7),{approvalId:n,control:o,onChange:a}=t,V=G(),r=`${n}.approved`;let i;e[0]!==a||e[1]!==V?(i=p=>{const{field:d}=p,c=d.value===!0,u=d.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(ee,{type:"button",variant:u?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!1),a()},"aria-pressed":u,children:V("chat.approval.denyButton")}),s.jsx(ee,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!0),a()},"aria-pressed":c,children:V("chat.approval.acceptButton")})]})},e[0]=a,e[1]=V,e[2]=i):i=e[2];let l;return e[3]!==o||e[4]!==r||e[5]!==i?(l=s.jsx(ls,{control:o,name:r,render:i}),e[3]=o,e[4]=r,e[5]=i,e[6]=l):l=e[6],l}function Bo(){const t=R.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ie,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function $o(t){const e=R.c(8),{approvals:n,isStreaming:o,onRespond:a}=t;if(o&&n.length===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Bo,{}),e[0]=r):r=e[0],r}if(n.length===0)return null;if(n.length===1){const r=n[0];if(!r)return null;let i;return e[1]!==a||e[2]!==r?(i=s.jsx(Ro,{approval:r,onRespond:a}),e[1]=a,e[2]=r,e[3]=i):i=e[3],i}let V;return e[4]!==n||e[5]!==o||e[6]!==a?(V=s.jsx(Eo,{approvals:n,isStreaming:o,onRespond:a}),e[4]=n,e[5]=o,e[6]=a,e[7]=V):V=e[7],V}function Oo(t){const e=R.c(28),{plan:n,onApprove:o,onDismiss:a}=t,V=G();let r;e[0]!==o||e[1]!==n.plan?(r=()=>{o(n.plan)},e[0]=o,e[1]=n.plan,e[2]=r):r=e[2];const i=r;let l;e[3]!==V?(l=V("chat.proposePlan.keepIterating"),e[3]=V,e[4]=l):l=e[4];let p;e[5]!==a||e[6]!==l?(p=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:a,children:l}),e[5]=a,e[6]=l,e[7]=p):p=e[7];let d;e[8]!==V?(d=V("chat.proposePlan.letsGo"),e[8]=V,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:i,children:d}),e[10]=i,e[11]=d,e[12]=c):c=e[12];let u;e[13]!==p||e[14]!==c?(u=s.jsxs(s.Fragment,{children:[p,c]}),e[13]=p,e[14]=c,e[15]=u):u=e[15];const m=u;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx($s,{size:14}),e[16]=h):h=e[16];let f;e[17]!==V?(f=V("chat.proposePlan.planReady"),e[17]=V,e[18]=f):f=e[18];let x;e[19]!==V?(x=V("chat.proposePlan.implementationPlan"),e[19]=V,e[20]=x):x=e[20];let b;e[21]!==n.plan?(b=s.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:s.jsx(jn,{id:"plan-preview",part:{type:"text",text:n.plan}})})}),e[21]=n.plan,e[22]=b):b=e[22];let g;return e[23]!==m||e[24]!==b||e[25]!==f||e[26]!==x?(g=s.jsx(ue,{icon:h,label:f,title:x,defaultExpanded:!0,footerRight:m,children:b}),e[23]=m,e[24]=b,e[25]=f,e[26]=x,e[27]=g):g=e[27],g}function Ko(t){const e=R.c(6),{plans:n,onApprove:o,onDismiss:a}=t;let V;e[0]!==n?(V=Ft(n),e[0]=n,e[1]=V):V=e[1];const r=V;if(!r)return null;let i;return e[2]!==r||e[3]!==o||e[4]!==a?(i=s.jsx(Oo,{plan:r,onApprove:o,onDismiss:a}),e[2]=r,e[3]=o,e[4]=a,e[5]=i):i=e[5],i}function Yt(t){return t?"response"in t?t.response:t.option??t.draft:""}const mt=fe({response:be().min(1,"Response is required")}),Qo=fe({option:be().nullable(),draft:be()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Yo=fe({response:$e(["yes","no"])});function Go(t){switch(t.type){case"text":return mt;case"choice":return Qo;case"confirm":return Yo;default:return mt}}function qo(t){const e={};for(const n of t)e[n.toolCallId]=Go(n.input);return fe(e)}function Ho(t){const e=R.c(7),{control:n,name:o,placeholder:a}=t,V=G();let r;e[0]!==a||e[1]!==V?(r=l=>{const{field:p}=l,d=p.value??"";return s.jsxs(qe,{children:[s.jsx(He,{children:s.jsx("div",{className:"px-2",children:s.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(yt,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...p,value:d,type:"text",placeholder:a||V("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":V("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx(We,{})]})},e[0]=a,e[1]=V,e[2]=r):r=e[2];let i;return e[3]!==n||e[4]!==o||e[5]!==r?(i=s.jsx(kt,{control:n,name:o,render:r}),e[3]=n,e[4]=o,e[5]=r,e[6]=i):i=e[6],i}function Gt(t,e){const n=R.c(4);let o,a;n[0]!==t||n[1]!==e?(o=()=>{const V=r=>{const i=r.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||r.metaKey||r.ctrlKey||r.altKey)return;const l=Number.parseInt(r.key,10);l>=1&&l<=t&&(r.preventDefault(),e(l-1))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},a=[t,e],n[0]=t,n[1]=e,n[2]=o,n[3]=a):(o=n[2],a=n[3]),L.useEffect(o,a)}function Wo(t){const e=R.c(51),{control:n,name:o,options:a}=t,V=G(),r=`${o}.option`;let i;e[0]!==n||e[1]!==r?(i={control:n,name:r,defaultValue:null},e[0]=n,e[1]=r,e[2]=i):i=e[2];const{field:l}=st(i),p=`${o}.draft`;let d;e[3]!==n||e[4]!==p?(d={control:n,name:p,defaultValue:""},e[3]=n,e[4]=p,e[5]=d):d=e[5];const{field:c}=st(d),u=l.value,m=c.value??"";let h;if(e[6]!==l||e[7]!==a?(h=E=>{const T=a[E];T!=null&&l.onChange(T)},e[6]=l,e[7]=a,e[8]=h):h=e[8],Gt(a.length,h),a.length===0)return null;const f=u===null;let x;e[9]!==V?(x=V("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=V,e[10]=x):x=e[10];let b;if(e[11]!==l||e[12]!==u||e[13]!==a||e[14]!==V){let E;e[16]!==l||e[17]!==u||e[18]!==V?(E=(T,F)=>{const U=u===T;return s.jsxs("button",{type:"button",onClick:()=>l.onChange(T),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",U&&"bg-accent/50",!U&&"hover:bg-accent/30"),"aria-label":V("chat.userAskQuestion.selectOption",{option:T}),children:[s.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",U?"bg-chart-1 text-white":"bg-muted text-foreground"),children:F+1}),s.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:T})]},`${F}-${T}`)},e[16]=l,e[17]=u,e[18]=V,e[19]=E):E=e[19],b=a.map(E),e[11]=l,e[12]=u,e[13]=a,e[14]=V,e[15]=b}else b=e[15];const g=f&&"bg-accent/50",v=!f&&"hover:bg-accent/30";let A;e[20]!==g||e[21]!==v?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,v),e[20]=g,e[21]=v,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(yt,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const w=f?m:"";let y;e[24]!==c||e[25]!==l||e[26]!==u?(y=E=>{c.onChange(E.target.value),u!==null&&l.onChange(null)},e[24]=c,e[25]=l,e[26]=u,e[27]=y):y=e[27];let C;e[28]!==l||e[29]!==u?(C=()=>{u!==null&&l.onChange(null)},e[28]=l,e[29]=u,e[30]=C):C=e[30];let S;e[31]!==V?(S=V("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=V,e[32]=S):S=e[32];let N;e[33]!==V?(N=V("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=V,e[34]=N):N=e[34];let _;e[35]!==w||e[36]!==y||e[37]!==C||e[38]!==S||e[39]!==N?(_=s.jsx("input",{type:"text",value:w,onChange:y,onFocus:C,placeholder:S,"aria-label":N,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=w,e[36]=y,e[37]=C,e[38]=S,e[39]=N,e[40]=_):_=e[40];let k;e[41]!==A||e[42]!==_?(k=s.jsxs("label",{className:A,children:[j,_]}),e[41]=A,e[42]=_,e[43]=k):k=e[43];let P;e[44]!==k||e[45]!==x||e[46]!==b?(P=s.jsx(He,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[b,k]})}),e[44]=k,e[45]=x,e[46]=b,e[47]=P):P=e[47];let D;e[48]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(We,{}),e[48]=D):D=e[48];let M;return e[49]!==P?(M=s.jsxs(qe,{children:[P,D]}),e[49]=P,e[50]=M):M=e[50],M}function Zo(t){const e=R.c(8),{control:n,name:o}=t,a=G();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=["yes","no"],e[0]=V):V=e[0];const r=V,i=L.useRef(null);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=c=>{i.current?.onChange(r[c]??"")},e[1]=l):l=e[1],Gt(r.length,l);let p;e[2]!==a?(p=c=>{const{field:u}=c;return i.current=u,s.jsxs(qe,{children:[s.jsx(He,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":a("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:r.map(m=>{const h=u.value===m;return s.jsxs("button",{type:"button",onClick:()=>u.onChange(m),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":a("chat.userAskQuestion.confirmValue",{value:a(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)}),children:[s.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:m==="yes"?1:2}),s.jsx("span",{className:"text-sm text-foreground capitalize",children:a(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)})]},m)})})}),s.jsx(We,{})]})},e[2]=a,e[3]=p):p=e[3];let d;return e[4]!==n||e[5]!==o||e[6]!==p?(d=s.jsx(kt,{control:n,name:o,render:p}),e[4]=n,e[5]=o,e[6]=p,e[7]=d):d=e[7],d}function ft(t){const e=R.c(13),{input:n,control:o,toolCallId:a}=t;switch(n.type){case"text":{const V=`${a}.response`;let r;return e[0]!==o||e[1]!==n.default||e[2]!==V?(r=s.jsx(Ho,{control:o,name:V,placeholder:n.default}),e[0]=o,e[1]=n.default,e[2]=V,e[3]=r):r=e[3],r}case"choice":{let V;e[4]!==n.options?(V=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=V):V=e[5];const r=V;let i;return e[6]!==o||e[7]!==r||e[8]!==a?(i=s.jsx(Wo,{control:o,name:a,options:r}),e[6]=o,e[7]=r,e[8]=a,e[9]=i):i=e[9],i}case"confirm":{const V=`${a}.response`;let r;return e[10]!==o||e[11]!==V?(r=s.jsx(Zo,{control:o,name:V}),e[10]=o,e[11]=V,e[12]=r):r=e[12],r}default:return null}}function Jo(t){const e=R.c(91),{parts:n,isStreaming:o,onSubmit:a}=t;let V;e[0]!==n?(V=qo(n.map(sr)),e[0]=n,e[1]=V):V=e[1];const r=V;let i;e[2]!==n?(i=Object.fromEntries(n.map(tr)),e[2]=n,e[3]=i):i=e[3];const l=i;let p;e[4]!==a?(p=($,z)=>{const Q=Yt(z);Q&&a($,Q)},e[4]=a,e[5]=p):p=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==n||e[9]!==r||e[10]!==p?(d={parts:n,partKey:er,schema:r,defaultValues:l,isStreaming:o,hasAnswer:Xo,onSubmit:p},e[6]=l,e[7]=o,e[8]=n,e[9]=r,e[10]=p,e[11]=d):d=e[11];const c=$t(d),u=c.currentPart,m=G();let h;e[12]!==u||e[13]!==c||e[14]!==m?(h=()=>{const $=u;if(!$)return;const z=m("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${Q}.option`,null),c.form.setValue(`${Q}.draft`,z)):c.form.setValue(`${Q}.response`,z),c.advanceToNextUnanswered()},e[12]=u,e[13]=c,e[14]=m,e[15]=h):h=e[15];const f=h;let x;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==n.length?(x=s.jsx(Ut,{currentIndex:c.currentIndex,total:n.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=n.length,e[20]=x):x=e[20];const b=x;let g;e[21]!==m?(g=m("chat.userAskQuestion.skip"),e[21]=m,e[22]=g):g=e[22];let v;e[23]!==f||e[24]!==g?(v=s.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:f,className:"h-7",children:g}),e[23]=f,e[24]=g,e[25]=v):v=e[25];let A;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(A=s.jsx(_o,{isStreaming:o,isAllAnswered:c.isAllAnswered,isCurrentAnswered:c.isCurrentAnswered,onAdvanceOrSubmit:c.submitOrAdvance}),e[26]=c.isAllAnswered,e[27]=c.isCurrentAnswered,e[28]=c.submitOrAdvance,e[29]=o,e[30]=A):A=e[30];let j;e[31]!==v||e[32]!==A?(j=s.jsxs(s.Fragment,{children:[v,A]}),e[31]=v,e[32]=A,e[33]=j):j=e[33];const w=j;if(n.length===1){const $=n[0];if(!$?.input)return null;const z=c.form;let Q;e[34]!==c?(Q=se=>{se.preventDefault(),c.submit()},e[34]=c,e[35]=Q):Q=e[35];let B;e[36]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Be,{size:14}),e[36]=B):B=e[36];let te;e[37]!==m?(te=m("chat.userAskQuestion.questionPending"),e[37]=m,e[38]=te):te=e[38];let J;e[39]!==$.input?.prompt||e[40]!==m?(J=$.input?.prompt??m("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=m,e[41]=J):J=e[41];const I=$.input;let Y;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==I?(Y=s.jsx(ft,{input:I,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=I,e[45]=Y):Y=e[45];let H;e[46]!==w||e[47]!==te||e[48]!==J||e[49]!==Y?(H=s.jsx(ue,{icon:B,label:te,title:J,defaultExpanded:!0,footerRight:w,children:Y}),e[46]=w,e[47]=te,e[48]=J,e[49]=Y,e[50]=H):H=e[50];let Z;e[51]!==Q||e[52]!==H?(Z=s.jsx("form",{onSubmit:Q,autoComplete:"off",children:H}),e[51]=Q,e[52]=H,e[53]=Z):Z=e[53];let W;return e[54]!==c.form||e[55]!==Z?(W=s.jsx(Ue,{...z,children:Z}),e[54]=c.form,e[55]=Z,e[56]=W):W=e[56],W}const y=c.form;let C;e[57]!==c?(C=$=>{$.preventDefault(),c.submit()},e[57]=c,e[58]=C):C=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Be,{size:14}),e[59]=S):S=e[59];let N;e[60]!==m?(N=m("chat.userAskQuestion.questionPending"),e[60]=m,e[61]=N):N=e[61];const _=c.currentIndex+1;let k;e[62]!==n.length||e[63]!==m||e[64]!==_?(k=m("chat.userAskQuestion.questionCount",{current:_,total:n.length}),e[62]=n.length,e[63]=m,e[64]=_,e[65]=k):k=e[65];let P;e[66]!==u?.input?.prompt||e[67]!==m?(P=u?.input?.prompt??m("chat.userAskQuestion.question"),e[66]=u?.input?.prompt,e[67]=m,e[68]=P):P=e[68];const D=c.activeKey,M=c.setActiveKey;let E;if(e[69]!==c.form||e[70]!==n){let $;e[72]!==c.form?($=z=>s.jsx(wn,{value:z.toolCallId,className:"mt-0",children:s.jsx(ft,{input:z.input,control:c.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=c.form,e[73]=$):$=e[73],E=n.map($),e[69]=c.form,e[70]=n,e[71]=E}else E=e[71];let T;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==E?(T=s.jsx(Cn,{value:D,onValueChange:M,children:E}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=E,e[77]=T):T=e[77];let F;e[78]!==b||e[79]!==w||e[80]!==N||e[81]!==k||e[82]!==P||e[83]!==T?(F=s.jsx(ue,{icon:S,label:N,count:k,title:P,defaultExpanded:!0,footerLeft:b,footerRight:w,children:T}),e[78]=b,e[79]=w,e[80]=N,e[81]=k,e[82]=P,e[83]=T,e[84]=F):F=e[84];let U;e[85]!==C||e[86]!==F?(U=s.jsx("form",{onSubmit:C,autoComplete:"off",children:F}),e[85]=C,e[86]=F,e[87]=U):U=e[87];let q;return e[88]!==c.form||e[89]!==U?(q=s.jsx(Ue,{...y,children:U}),e[88]=c.form,e[89]=U,e[90]=q):q=e[90],q}function Xo(t){return!!Yt(t)}function er(t){return t.toolCallId}function tr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function sr(t){return{toolCallId:t.toolCallId,input:t.input}}function nr(){const t=R.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Be,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function qt(t){const e=R.c(7),{userAskParts:n,isStreaming:o,onSubmit:a}=t;let V;e[0]!==n?(V=n.filter(or),e[0]=n,e[1]=V):V=e[1];const r=V;if(r.length===0){if(o){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(nr,{}),e[2]=l):l=e[2],l}return null}let i;return e[3]!==o||e[4]!==a||e[5]!==r?(i=s.jsx(Jo,{parts:r,isStreaming:o,onSubmit:a}),e[3]=o,e[4]=a,e[5]=r,e[6]=i):i=e[6],i}function or(t){return t.state==="input-available"}function rr(t){const e=t.filter(V=>V.status==="in_progress"),n=t.filter(V=>V.status==="completed").length,o=t.length;if(o>0&&n===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[a]=e;return a&&e.length===1?{icon:"in_progress",activity:a.activeForm,progress:`${n}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${n}/${o} done`}:n>0?{icon:"pending",activity:`${o-n} pending`,progress:`${n}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function ar(t){const e=R.c(13),{todos:n}=t;if(n.length===0)return null;let o;e[0]!==n?(o=rr(n),e[0]=n,e[1]=o):o=e[1];const a=o;let V;e[2]!==a.icon?(V=s.jsx(cr,{status:a.icon}),e[2]=a.icon,e[3]=V):V=e[3];const r=a.activity,i=a.progress;let l;e[4]!==n?(l=n.map(Vr),e[4]=n,e[5]=l):l=e[5];let p;e[6]!==l?(p=s.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:l}),e[6]=l,e[7]=p):p=e[7];let d;return e[8]!==a.activity||e[9]!==a.progress||e[10]!==V||e[11]!==p?(d=s.jsx(ue,{icon:V,label:r,count:i,defaultExpanded:!1,children:p}),e[8]=a.activity,e[9]=a.progress,e[10]=V,e[11]=p,e[12]=d):d=e[12],d}function Vr(t,e){return s.jsx(ir,{todo:t},e)}function ir(t){const e=R.c(14),{todo:n}=t,o=n.status==="completed",V=n.status==="in_progress"?n.activeForm:n.content;let r;e[0]!==n.status?(r=s.jsx(lr,{status:n.status}),e[0]=n.status,e[1]=r):r=e[1];const i=o&&"text-muted-foreground";let l;e[2]!==i?(l=O("relative text-sm leading-snug pt-px select-none",i),e[2]=i,e[3]=l):l=e[3];const p=o?"100%":"0%",d=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==p||e[5]!==d?(c=s.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:p,transition:d}}),e[4]=p,e[5]=d,e[6]=c):c=e[6];let u;e[7]!==V||e[8]!==l||e[9]!==c?(u=s.jsxs("span",{className:l,children:[V,c]}),e[7]=V,e[8]=l,e[9]=c,e[10]=u):u=e[10];let m;return e[11]!==r||e[12]!==u?(m=s.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[r,u]}),e[11]=r,e[12]=u,e[13]=m):m=e[13],m}function lr(t){const e=R.c(4),{status:n}=t,o=n==="completed"?"true":void 0,a=n==="in_progress"?"true":void 0;let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("svg",{viewBox:"0 0 21 21",children:s.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=V):V=e[0];let r;return e[1]!==o||e[2]!==a?(r=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":a,"aria-hidden":"true",children:V}),e[1]=o,e[2]=a,e[3]=r):r=e[3],r}function cr(t){const e=R.c(13),{status:n}=t,o=G();if(n==="completed"){let r;e[0]!==o?(r=o("chat.todoStatus.completed"),e[0]=o,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:s.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=i):i=e[2];let l;return e[3]!==r?(l=s.jsx("span",{"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:i}),e[3]=r,e[4]=l):l=e[4],l}if(n==="in_progress"){let r;e[5]!==o?(r=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=r):r=e[6];let i;return e[7]!==r?(i=s.jsx("span",{"aria-label":r,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=r,e[8]=i):i=e[8],i}let a;e[9]!==o?(a=o("chat.todoStatus.pending"),e[9]=o,e[10]=a):a=e[10];let V;return e[11]!==a?(V=s.jsx("span",{"aria-label":a,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=a,e[12]=V):V=e[12],V}const dr={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},ur={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function pr(t){const e=R.c(46),{source:n,onDone:o}=t,a=G(),V=cs(),[r]=he(),[i,l]=L.useState(r.language==="pt-BR"?"brl":"usd"),[p,d]=L.useState(""),[c,u]=L.useState(!1),m=i==="brl"?"R$":"$";let h;e[0]!==i||e[1]!==V?(h=async T=>{const{url:F}=await V.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:T,currency:i});return F},e[0]=i,e[1]=V,e[2]=h):h=e[2];let f;e[3]!==o?(f=T=>{T&&window.open(T,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=f):f=e[4];let x;e[5]!==a?(x=T=>{ye.error(a("credits.topUp.failed",{message:T.message}))},e[5]=a,e[6]=x):x=e[6];let b;e[7]!==h||e[8]!==f||e[9]!==x?(b={mutationFn:h,onSuccess:f,onError:x},e[7]=h,e[8]=f,e[9]=x,e[10]=b):b=e[10];const{mutate:g,isPending:v}=ds(b);let A;e[11]!==i||e[12]!==n||e[13]!==g?(A=(T,F)=>{X("credits_topup_clicked",{amount_cents:T,currency:i,tier_label:F,source:n}),g(T)},e[11]=i,e[12]=n,e[13]=g,e[14]=A):A=e[14];const j=A,w=parseFloat(p),y=!isNaN(w)&&w>=1;let C,S,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=T=>{T&&l(T)},S=s.jsx(Vt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=s.jsx(Vt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=C,e[16]=S,e[17]=N):(C=e[15],S=e[16],N=e[17]);let _;e[18]!==i?(_=s.jsx("div",{className:"mb-4",children:s.jsxs(En,{type:"single",variant:"outline",size:"sm",value:i,onValueChange:C,children:[S,N]})}),e[18]=i,e[19]=_):_=e[19];const k=dr[i];let P;if(e[20]!==j||e[21]!==m||e[22]!==v||e[23]!==a||e[24]!==k){let T;e[26]!==j||e[27]!==m||e[28]!==v||e[29]!==a?(T=F=>{const{dollars:U,labelKey:q}=F;return s.jsxs("button",{type:"button",disabled:v,onClick:()=>j(U*100,ur[q]??"preset"),className:O("relative flex flex-col items-center gap-1 py-5 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[m,U]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:a(q)})]},U)},e[26]=j,e[27]=m,e[28]=v,e[29]=a,e[30]=T):T=e[30],P=k.map(T),e[20]=j,e[21]=m,e[22]=v,e[23]=a,e[24]=k,e[25]=P}else P=e[25];let D;e[31]!==P?(D=s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:P}),e[31]=P,e[32]=D):D=e[32];let M;e[33]!==j||e[34]!==m||e[35]!==p||e[36]!==w||e[37]!==y||e[38]!==v||e[39]!==c||e[40]!==a?(M=c?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:m}),s.jsx(Mn,{type:"number",min:"1",step:"1",placeholder:a("credits.topUp.customPlaceholder"),value:p,onChange:T=>d(T.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(ee,{className:"h-10",disabled:!y||v,onClick:()=>j(Math.round(w*100),"custom"),children:a(v?"credits.topUp.opening":"credits.topUp.add")})]}):s.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>u(!0),children:a("credits.topUp.enterCustom")}),e[33]=j,e[34]=m,e[35]=p,e[36]=w,e[37]=y,e[38]=v,e[39]=c,e[40]=a,e[41]=M):M=e[41];let E;return e[42]!==D||e[43]!==M||e[44]!==_?(E=s.jsxs("div",{children:[_,D,M]}),e[42]=D,e[43]=M,e[44]=_,e[45]=E):E=e[45],E}const mr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function fr(t){const e=R.c(47),{onDismiss:n}=t,{org:o}=we(),a=Oe(),{decoKeyId:V}=Rn(),r=G(),i=Ce("credits");let l,p;if(e[0]!==o.id?(l=()=>{X("credits_exhausted_shown",{organization_id:o.id})},p=[o.id],e[0]=o.id,e[1]=l,e[2]=p):(l=e[1],p=e[2]),L.useEffect(l,p),!i)return null;let d;e[3]!==n?(d=k=>!k&&n?.(),e[3]=n,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=u):u=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[7]=m):m=e[7];let h;e[8]!==r?(h=r("chat.creditsExhaustedBanner.title"),e[8]=r,e[9]=h):h=e[9];let f;e[10]!==h?(f=s.jsx(Nn,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=f):f=e[11];let x;e[12]!==r?(x=r("chat.creditsExhaustedBanner.description"),e[12]=r,e[13]=x):x=e[13];let b;e[14]!==x?(b=s.jsx(Sn,{className:"mt-1.5 text-sm leading-relaxed",children:x}),e[14]=x,e[15]=b):b=e[15];let g;e[16]!==b||e[17]!==f?(g=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[u,s.jsxs(kn,{className:"relative gap-4",children:[m,s.jsxs("div",{children:[f,b]})]})]}),e[16]=b,e[17]=f,e[18]=g):g=e[18];let v;e[19]!==V||e[20]!==n||e[21]!==r?(v=V&&s.jsxs("div",{className:"px-8 pt-5 pb-6",children:[s.jsx("div",{className:"rounded-xl border border-border p-5",children:s.jsx(pr,{source:"exhausted_banner",onDone:n})}),s.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:mr.map(k=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:s.jsx(Ke,{size:12,className:"text-success"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:r(k)})]},k))})]}),e[19]=V,e[20]=n,e[21]=r,e[22]=v):v=e[22];let A;e[23]!==r?(A=r("chat.creditsExhaustedBanner.dismiss"),e[23]=r,e[24]=A):A=e[24];let j;e[25]!==n||e[26]!==A?(j=s.jsx(ee,{variant:"ghost",size:"sm",onClick:n,children:A}),e[25]=n,e[26]=A,e[27]=j):j=e[27];let w;e[28]!==a||e[29]!==n||e[30]!==o.slug?(w=()=>{a({to:"/$org/settings/ai-providers",params:{org:o.slug}}),n?.()},e[28]=a,e[29]=n,e[30]=o.slug,e[31]=w):w=e[31];let y;e[32]!==r?(y=r("chat.creditsExhaustedBanner.manageProviders"),e[32]=r,e[33]=y):y=e[33];let C;e[34]!==w||e[35]!==y?(C=s.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:w,children:y}),e[34]=w,e[35]=y,e[36]=C):C=e[36];let S;e[37]!==j||e[38]!==C?(S=s.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,C]}),e[37]=j,e[38]=C,e[39]=S):S=e[39];let N;e[40]!==g||e[41]!==v||e[42]!==S?(N=s.jsxs(Tn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:hr,children:[g,v,S]}),e[40]=g,e[41]=v,e[42]=S,e[43]=N):N=e[43];let _;return e[44]!==N||e[45]!==d?(_=s.jsx(In,{open:!0,onOpenChange:d,children:N}),e[44]=N,e[45]=d,e[46]=_):_=e[46],_}function hr(t){return t.preventDefault()}const xr={trial_exhausted:{label:"chat.subscriptionLimit.trialLabel",title:"chat.subscriptionLimit.trialTitle"},monthly_exhausted:{label:"chat.subscriptionLimit.monthlyLabel",title:"chat.subscriptionLimit.monthlyTitle"},runs_exhausted:{label:"chat.subscriptionLimit.runsLabel",title:"chat.subscriptionLimit.runsTitle"}};function gr(t){const e=R.c(16),{kind:n,onDismiss:o,onSubscribe:a}=t,V=G(),{label:r,title:i}=xr[n];let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Qe,{size:14}),e[0]=l):l=e[0];let p;e[1]!==r||e[2]!==V?(p=V(r),e[1]=r,e[2]=V,e[3]=p):p=e[3];let d;e[4]!==V||e[5]!==i?(d=V(i),e[4]=V,e[5]=i,e[6]=d):d=e[6];let c;e[7]!==n||e[8]!==a||e[9]!==V?(c=n==="trial_exhausted"?s.jsx(ee,{size:"sm",onClick:a,className:"h-7 text-xs",children:V("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=n,e[8]=a,e[9]=V,e[10]=c):c=e[10];let u;return e[11]!==o||e[12]!==p||e[13]!==d||e[14]!==c?(u=s.jsx(ue,{icon:l,label:p,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=p,e[13]=d,e[14]=c,e[15]=u):u=e[15],u}const br={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function ht(t){const e=R.c(21),{kind:n,onDismiss:o}=t,a=G(),V=Oe(),{org:r}=we(),{label:i,title:l}=br[n];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Qe,{size:14}),e[0]=p):p=e[0];let d;e[1]!==i||e[2]!==a?(d=a(i),e[1]=i,e[2]=a,e[3]=d):d=e[3];let c;e[4]!==a||e[5]!==l?(c=a(l),e[4]=a,e[5]=l,e[6]=c):c=e[6];let u;e[7]!==V||e[8]!==o||e[9]!==r.slug?(u=()=>{V({to:"/$org/settings/ai-providers",params:{org:r.slug}}),o()},e[7]=V,e[8]=o,e[9]=r.slug,e[10]=u):u=e[10];let m;e[11]!==a?(m=a("chat.planRefused.seePlans"),e[11]=a,e[12]=m):m=e[12];let h;e[13]!==u||e[14]!==m?(h=s.jsx(ee,{size:"sm",className:"h-7 text-xs",onClick:u,children:m}),e[13]=u,e[14]=m,e[15]=h):h=e[15];let f;return e[16]!==o||e[17]!==d||e[18]!==c||e[19]!==h?(f=s.jsx(ue,{icon:p,label:d,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:h}),e[16]=o,e[17]=d,e[18]=c,e[19]=h,e[20]=f):f=e[20],f}function Ht(t){const e=Ar(t);if(e!==null){const p=Ht(e);return{summary:p.summary,rawDetails:p.rawDetails??t}}const n=t.trim(),o=n.startsWith("<")&&/<[a-z][\s\S]*>/i.test(n),a=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(n),V=/failed to fetch|networkerror|load failed|offline/i.test(n),r=/timeout|timed out|aborted|deadline/i.test(n),i=n.length>240,l=/sandbox failed to start(?::\s*(.+))?/is.exec(n);if(l){const p=l[1]?.trim().replace(/\.$/,"");return{summary:p?`Your sandbox didn't finish starting up (${p}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return a||o&&i?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:V?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:r?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||i?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Ar(t){const e=t.trim();if(!e.startsWith("{"))return null;let n;try{n=JSON.parse(e)}catch{return null}if(!n||typeof n!="object")return null;const{error:o,message:a}=n,V=typeof o=="string"?o:a;return typeof V=="string"&&V.trim()&&!V.trim().startsWith("{")?V:null}const vr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Te(t){const e=R.c(29),n=G(),{variant:o,onDismiss:a}=t,V=o==="error";let r;e[0]!==V||e[1]!==n?(r=n(V?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=V,e[1]=n,e[2]=r):r=e[2];const i=r,l=V?mn:ps;let p;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==n?(p=t.variant==="error"?t.error.message:(()=>{const g=vr[t.finishReason];return g?n(g):n("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=n,e[7]=p):p=e[7];const d=p;let c;e[8]!==V||e[9]!==d?(c=V?Ht(d):{summary:d,rawDetails:null},e[8]=V,e[9]=d,e[10]=c):c=e[10];const{summary:u,rawDetails:m}=c;let h;e[11]!==l?(h=s.jsx(l,{size:14}),e[11]=l,e[12]=h):h=e[12];let f;e[13]!==V||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==n?(f=V?s.jsx(ee,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:n("chat.highlight.fixInChat")}):s.jsx(ee,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:n("chat.highlight.continue")}),e[13]=V,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=n,e[17]=f):f=e[17];let x;e[18]!==m||e[19]!==n?(x=m?s.jsxs("details",{className:"group mx-4",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[s.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"m4.5 3 3 3-3 3"})}),s.jsx("span",{className:"group-open:hidden",children:n("chat.highlight.showTechnicalDetails")}),s.jsx("span",{className:"hidden group-open:inline",children:n("chat.highlight.hideTechnicalDetails")})]}),s.jsxs("div",{className:"relative mt-2",children:[s.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(m).then(()=>ye.success(n("chat.highlight.copiedToClipboard"))).catch(()=>ye.error(n("chat.highlight.couldNotCopy")))},"aria-label":n("chat.highlight.copyErrorDetails"),title:n("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center classic:rounded-md compact:rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(fn,{className:"size-3.5"})}),s.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:m})]})]}):null,e[18]=m,e[19]=n,e[20]=x):x=e[20];let b;return e[21]!==i||e[22]!==a||e[23]!==u||e[24]!==h||e[25]!==f||e[26]!==x||e[27]!==o?(b=s.jsx(ue,{icon:h,label:i,title:u,defaultExpanded:!0,variant:o,onClose:a,footerRight:f,children:x}),e[21]=i,e[22]=a,e[23]=u,e[24]=h,e[25]=f,e[26]=x,e[27]=o,e[28]=b):b=e[28],b}function Me(){const t=R.c(78),e=G(),{error:n,clearError:o,finishReason:a,clearFinishReason:V,messages:r,isStreaming:i,submit:l,sendMessage:p}=Ge(),[d,c]=he(),{virtualMcpId:u,createTaskWithMessage:m}=Ws(),{chatMode:h,simpleModeTier:f}=_e(),x=Ce("credits"),{mutate:b}=zn("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let g;t[0]!==b?(g=()=>b(),t[0]=b,t[1]=g):g=t[1];const v=g;let A;t[2]!==h||t[3]!==f||t[4]!==u?(A=oe=>({tier:f,mode:h,toolApprovalLevel:oe,agent:u?{id:u}:void 0}),t[2]=h,t[3]=f,t[4]=u,t[5]=A):A=t[5];const j=A;let w;t[6]!==d.toolApprovalLevel?(w=d.toolApprovalLevel??us(),t[6]=d.toolApprovalLevel,t[7]=w):w=t[7];const y=w,C=r.at(-1),S=C?.role==="assistant"?C.parts:[],N=S.filter(Cr),_=Lt(S),k=Et(S);let P;t[8]!==n||t[9]!==p||t[10]!==e?(P=()=>{if(n){const le={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.fixInChatMessage",{error:n.message})}]}]};p(le)}},t[8]=n,t[9]=p,t[10]=e,t[11]=P):P=t[11];const D=P;let M;t[12]!==p||t[13]!==e?(M=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.pleaseContinue")}]}]};p(oe)},t[12]=p,t[13]=e,t[14]=M):M=t[14];const E=M;let T;t[15]!==j||t[16]!==y||t[17]!==l?(T=(oe,le)=>{l({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:le}},j(y))},t[15]=j,t[16]=y,t[17]=l,t[18]=T):T=t[18];const F=T;let U;t[19]!==m||t[20]!==d||t[21]!==c||t[22]!==e||t[23]!==u?(U=oe=>{c({...d,toolApprovalLevel:"auto"}),m({virtualMcpId:u,message:{parts:[{type:"text",text:e("chat.highlight.implementPlanMessage",{plan:oe})}]}})},t[19]=m,t[20]=d,t[21]=c,t[22]=e,t[23]=u,t[24]=U):U=t[24];const q=U,$=wr;let z;t[25]!==j||t[26]!==l?(z=(oe,le,ve,Ee)=>{l({kind:"approval",approvalId:oe,approved:le,...ve?{reason:ve}:{}},j(Ee))},t[25]=j,t[26]=l,t[27]=z):z=t[27];const Q=z,B=zt();if(B.isCreditExhausted){let oe;return t[28]!==x||t[29]!==o?(oe=x?s.jsx(fr,{onDismiss:o}):s.jsx("div",{className:"absolute bottom-full left-0 right-0",children:s.jsx(ht,{kind:"ai_budget_exhausted",onDismiss:o})}),t[28]=x,t[29]=o,t[30]=oe):oe=t[30],oe}const{showError:te,showWarning:J,hasApprovals:I}=B,Y=N.map(yr).join("|"),H=Ft(_)?.toolCallId??"",Z=k.map(jr).join("|");let W;t[31]!==B.todos?(W=s.jsx(ar,{todos:B.todos}),t[31]=B.todos,t[32]=W):W=t[32];let se;t[33]!==o||t[34]!==B.subscriptionErrorKind||t[35]!==v?(se=B.subscriptionErrorKind&&s.jsx(gr,{kind:B.subscriptionErrorKind,onDismiss:o,onSubscribe:v}),t[33]=o,t[34]=B.subscriptionErrorKind,t[35]=v,t[36]=se):se=t[36];let ae;t[37]!==o||t[38]!==B.planRefusal?(ae=B.planRefusal&&s.jsx(ht,{kind:B.planRefusal,onDismiss:o}),t[37]=o,t[38]=B.planRefusal,t[39]=ae):ae=t[39];let Ve;t[40]!==o||t[41]!==n||t[42]!==D||t[43]!==te?(Ve=te&&s.jsx(Te,{variant:"error",error:n,onDismiss:o,onFixInChat:D}),t[40]=o,t[41]=n,t[42]=D,t[43]=te,t[44]=Ve):Ve=t[44];let ne;t[45]!==V||t[46]!==a||t[47]!==E||t[48]!==J?(ne=J&&s.jsx(Te,{variant:"warning",finishReason:a,onDismiss:V,onContinue:E}),t[45]=V,t[46]=a,t[47]=E,t[48]=J,t[49]=ne):ne=t[49];let ie;t[50]!==Z||t[51]!==Q||t[52]!==I||t[53]!==i||t[54]!==k?(ie=I&&s.jsx($o,{approvals:k,isStreaming:i,onRespond:Q},Z),t[50]=Z,t[51]=Q,t[52]=I,t[53]=i,t[54]=k,t[55]=ie):ie=t[55];let re;t[56]!==B.hasPlans||t[57]!==q||t[58]!==$||t[59]!==i||t[60]!==_||t[61]!==H?(re=B.hasPlans&&s.jsx(Ko,{plans:_,isStreaming:i,onApprove:q,onDismiss:$},H),t[56]=B.hasPlans,t[57]=q,t[58]=$,t[59]=i,t[60]=_,t[61]=H,t[62]=re):re=t[62];let ce;t[63]!==B.isWaitingForUserInput||t[64]!==F||t[65]!==i||t[66]!==Y||t[67]!==N?(ce=B.isWaitingForUserInput&&s.jsx(qt,{userAskParts:N,isStreaming:i,onSubmit:F},Y),t[63]=B.isWaitingForUserInput,t[64]=F,t[65]=i,t[66]=Y,t[67]=N,t[68]=ce):ce=t[68];let Ae;return t[69]!==ae||t[70]!==Ve||t[71]!==ne||t[72]!==ie||t[73]!==re||t[74]!==ce||t[75]!==W||t[76]!==se?(Ae=s.jsxs("div",{className:"absolute bottom-full left-0 right-0",children:[W,se,ae,Ve,ne,ie,re,ce]}),t[69]=ae,t[70]=Ve,t[71]=ne,t[72]=ie,t[73]=re,t[74]=ce,t[75]=W,t[76]=se,t[77]=Ae):Ae=t[77],Ae}function jr(t){return t.approvalId}function yr(t){return t.toolCallId}function wr(){document.querySelector("[data-chat-input]")?.focus()}function Cr(t){return t.type==="tool-user_ask"}Me.Error=function(e){return s.jsx(Te,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Me.Warning=function(e){return s.jsx(Te,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Me.UserAskQuestion=qt;function Nr(t){const e=R.c(20),{taskId:n}=t,o=G(),a=Zs(n),V=Js(a),r=Xs(),{stop:i,removeLocalMessage:l}=Ge();if(V.length===0)return null;let p;e[0]!==o?(p=o("chat.queueTray.sendNow"),e[0]=o,e[1]=p):p=e[1];let d;e[2]!==i?(d=()=>{i()},e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(jt,{size:14}),e[4]=c):c=e[4];let u;e[5]!==p||e[6]!==d?(u=s.jsx(De,{asChild:!0,children:s.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p,onClick:d,children:c})}),e[5]=p,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==o?(m=o("chat.queueTray.sendNow"),e[8]=o,e[9]=m):m=e[9];let h;e[10]!==m?(h=s.jsx(Pe,{side:"top",children:s.jsx("p",{className:"text-xs",children:m})}),e[10]=m,e[11]=h):h=e[11];let f;e[12]!==u||e[13]!==h?(f=s.jsxs(Re,{delayDuration:400,children:[u,h]}),e[12]=u,e[13]=h,e[14]=f):f=e[14];let x;return e[15]!==r||e[16]!==l||e[17]!==o||e[18]!==n?(x=(b,g)=>s.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[s.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:g+1}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:b.text}),s.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:s.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{r.cancel(n,b.messageId).then(v=>{v&&(en(n,b.messageId),l(b.messageId))})},children:s.jsx(Un,{className:"size-3.5"})})})]},b.messageId),e[15]=r,e[16]=l,e[17]=o,e[18]=n,e[19]=x):x=e[19],s.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[s.jsx("span",{children:o(V.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:V.length})}),f]}),V.map(x)]})}function Sr(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const kr={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Tr(t){const e=R.c(31),{tier:n,orgSlot:o,userSlot:a,autoSlot:V,onPick:r,onReset:i,onClose:l}=t,p=G(),d=Pt(),c=new Set(d.map(Ir)),u=tn([a,o,V],c),m=u?.keyId??null,[h,f]=L.useState(m??d[0]?.id??null),x=d.some(F=>F.id===h)?h:m??d[0]?.id??null,b=x?d.find(F=>F.id===x):null,g="flex h-[70vh] max-h-[460px] w-full flex-col",v=kr[n];let A;e[0]!==p||e[1]!==v?(A=p(v),e[0]=p,e[1]=v,e[2]=A):A=e[2];let j;e[3]!==A?(j=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=j):j=e[4];let w;e[5]!==i||e[6]!==p||e[7]!==a?(w=a&&s.jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 classic:rounded-md compact:rounded-lg hover:bg-accent cursor-pointer",children:p("chat.modelPreferences.reset")}),e[5]=i,e[6]=p,e[7]=a,e[8]=w):w=e[8];let y;e[9]!==j||e[10]!==w?(y=s.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[j,w]}),e[9]=j,e[10]=w,e[11]=y):y=e[11];const C="flex-1 min-h-0",S=L.Suspense;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Bn,{}),e[12]=N):N=e[12];const _=Jn,k=!0,P=Sr(m?u:null,b?.providerId??"deco");let D;e[13]!==x||e[14]!==r||e[15]!==f?(D=F=>{const U=F.keyId??x??"";f(U),r({keyId:U,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=r,e[15]=f,e[16]=D):D=e[16];let M;e[17]!==_||e[18]!==x||e[19]!==l||e[20]!==f||e[21]!==P||e[22]!==D?(M=s.jsx(_,{compact:k,onClose:l,credentialId:x,onCredentialChange:f,selectedModel:P,onModelChange:D}),e[17]=_,e[18]=x,e[19]=l,e[20]=f,e[21]=P,e[22]=D,e[23]=M):M=e[23];let E;e[24]!==S||e[25]!==M||e[26]!==N?(E=s.jsx("div",{className:C,children:s.jsx(S,{fallback:N,children:M})}),e[24]=S,e[25]=M,e[26]=N,e[27]=E):E=e[27];let T;return e[28]!==E||e[29]!==y?(T=s.jsxs("div",{className:g,children:[y,E]}),e[28]=E,e[29]=y,e[30]=T):T=e[30],T}function Ir(t){return t.id}const _r=["fast","smart","thinking"];function Wt(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const xt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function Dr(t){const e=R.c(28),{tier:n,pillIcon:o,groups:a}=t,V=G();let r;e[0]!==V?(r=Wt(V),e[0]=V,e[1]=r):r=e[1];const i=r,[l,p]=L.useState(!1);let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=C=>{C.onSelect(),p(!1)},e[2]=d):d=e[2];const c=d,u=i[n];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=m):m=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[4]=h):h=e[4];const f=i[n];let x;e[5]!==f?(x=s.jsx("span",{className:h,children:f}),e[5]=f,e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Tt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=b):b=e[7];let g;e[8]!==o||e[9]!==u||e[10]!==x?(g=s.jsx(De,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(It,{asChild:!0,children:s.jsxs(ee,{type:"button",variant:"ghost",size:"default","aria-label":u,className:m,children:[o,x,b]})})})}),e[8]=o,e[9]=u,e[10]=x,e[11]=g):g=e[11];let v;e[12]!==u?(v=s.jsx(Pe,{children:u}),e[12]=u,e[13]=v):v=e[13];let A;e[14]!==g||e[15]!==v?(A=s.jsxs(Re,{children:[g,v]}),e[14]=g,e[15]=v,e[16]=A):A=e[16];let j;if(e[17]!==a||e[18]!==V){let C;e[20]!==V?(C=S=>s.jsx("div",{className:"flex flex-col",children:S.rows.map(N=>s.jsxs("div",{className:"group/tier-row relative flex items-stretch classic:rounded-md compact:rounded-lg hover:bg-muted",children:[s.jsxs("button",{type:"button",role:"menuitem","aria-label":N.title,onClick:()=>c(N),className:O("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",N.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[N.icon&&s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:N.icon}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm",children:N.title}),N.subtitle&&s.jsx("div",{className:"text-xs text-muted-foreground",children:N.subtitle})]}),N.active&&s.jsx("span",{title:V("chat.tierTrigger.selected"),children:s.jsx(Ke,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&s.jsx(Rr,{label:N.title,render:N.modelOverride})]},N.key))},S.key),e[20]=V,e[21]=C):C=e[21],j=a.map(C),e[17]=a,e[18]=V,e[19]=j}else j=e[19];let w;e[22]!==j?(w=s.jsx(_t,{align:"end",className:"p-1 w-64",onOpenAutoFocus:Pr,children:s.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=w):w=e[23];let y;return e[24]!==l||e[25]!==A||e[26]!==w?(y=s.jsxs(Dt,{open:l,onOpenChange:p,children:[A,w]}),e[24]=l,e[25]=A,e[26]=w,e[27]=y):y=e[27],y}function Pr(t){return t.preventDefault()}function Rr(t){const e=R.c(38),{label:n,render:o}=t,a=G(),V=qn(),[r,i]=L.useState(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!1),e[0]=l):l=e[0];const p=l;let d;e[1]!==n||e[2]!==a?(d=a("chat.modelPreferences.customizeModel",{tier:n}),e[1]=n,e[2]=a,e[3]=d):d=e[3];const c=r&&"opacity-100";let u;e[4]!==c?(u=O("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 classic:rounded-md compact:rounded-lg bg-background border border-border/60 shadow-sm","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",c),e[4]=c,e[5]=u):u=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ks,{size:14}),e[6]=m):m=e[6];let h;e[7]!==d||e[8]!==u?(h=s.jsx("button",{type:"button","aria-label":d,className:u,children:m}),e[7]=d,e[8]=u,e[9]=h):h=e[9];const f=h;if(V){let A;e[10]!==f?(A=s.jsx(Kn,{asChild:!0,children:f}),e[10]=f,e[11]=A):A=e[11];let j;e[12]!==n||e[13]!==a?(j=a("chat.modelPreferences.customizeModel",{tier:n}),e[12]=n,e[13]=a,e[14]=j):j=e[14];let w;e[15]!==j?(w=s.jsx(Qn,{className:"sr-only",children:j}),e[15]=j,e[16]=w):w=e[16];let y;e[17]!==r||e[18]!==o?(y=r&&o(p),e[17]=r,e[18]=o,e[19]=y):y=e[19];let C;e[20]!==y||e[21]!==w?(C=s.jsxs(Yn,{className:"p-0 flex flex-col max-h-[95vh]",children:[w,y]}),e[20]=y,e[21]=w,e[22]=C):C=e[22];let S;return e[23]!==r||e[24]!==C||e[25]!==A?(S=s.jsxs(Gn,{open:r,onOpenChange:i,children:[A,C]}),e[23]=r,e[24]=C,e[25]=A,e[26]=S):S=e[26],S}let x;e[27]!==f?(x=s.jsx(It,{asChild:!0,children:f}),e[27]=f,e[28]=x):x=e[28];let b;e[29]!==r||e[30]!==o?(b=r&&o(p),e[29]=r,e[30]=o,e[31]=b):b=e[31];let g;e[32]!==b?(g=s.jsx(_t,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:b}),e[32]=b,e[33]=g):g=e[33];let v;return e[34]!==r||e[35]!==x||e[36]!==g?(v=s.jsxs(Dt,{open:r,onOpenChange:i,children:[x,g]}),e[34]=r,e[35]=x,e[36]=g,e[37]=v):v=e[37],v}function gt(t){return t==="fast"?s.jsx(Qe,{size:16}):t==="thinking"?s.jsx(Os,{size:16}):s.jsx(Hn,{size:16})}function Mr(t){const e=R.c(13),n=on();let o;e[0]!==t||e[1]!==n.tiers?(o=p=>{const d=n.tiers[p];return d?d.title??d.modelId:t.chat[p]?.title},e[0]=t,e[1]=n.tiers,e[2]=o):o=e[2];const a=o;let V;e[3]!==a?(V=a("fast"),e[3]=a,e[4]=V):V=e[4];let r;e[5]!==a?(r=a("smart"),e[5]=a,e[6]=r):r=e[6];let i;e[7]!==a?(i=a("thinking"),e[7]=a,e[8]=i):i=e[8];let l;return e[9]!==V||e[10]!==r||e[11]!==i?(l={fast:V,smart:r,thinking:i},e[9]=V,e[10]=r,e[11]=i,e[12]=l):l=e[12],l}function Er(){const t=R.c(23),e=G(),{simpleModeTier:n,setSimpleModeTier:o}=_e(),a=Wn(),V=Pt(),r=Zn(V),i=Mr(r),{data:l,error:p}=sn();let d;t[0]!==l?(d=l===void 0?{tiers:{}}:l,t[0]=l,t[1]=d):d=t[1];const c=d,u=nn(),m=Ce("model_choice"),h=_n(),f=Dn();if(!h||!m)return null;let x,b;if(t[2]!==r||t[3]!==f||t[4]!==a||t[5]!==o||t[6]!==e||t[7]!==n||t[8]!==i||t[9]!==u||t[10]!==c||t[11]!==p){const w=Wt(e);x="decopilot",b=_r.map(y=>{const C=i[y],S=c.tiers[y];return{key:`decopilot-${y}`,icon:gt(y),title:w[y],subtitle:f?C??e(xt[y]):e(xt[y]),active:n===y,onSelect:()=>o(y),modelOverride:f?N=>s.jsxs(s.Fragment,{children:[p&&s.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),s.jsx(Tr,{tier:y,orgSlot:a.tiers[y],userSlot:S,autoSlot:r.chat[y],onClose:N,onPick:_=>u.mutate({tier:y,slot:_}),onReset:()=>u.mutate({tier:y,slot:null})},`${y}:${S?.keyId??"org"}:${S?.modelId??""}`)]}):void 0}}),t[2]=r,t[3]=f,t[4]=a,t[5]=o,t[6]=e,t[7]=n,t[8]=i,t[9]=u,t[10]=c,t[11]=p,t[12]=x,t[13]=b}else x=t[12],b=t[13];let g;t[14]!==x||t[15]!==b?(g=[{key:x,rows:b}],t[14]=x,t[15]=b,t[16]=g):g=t[16];const v=g;let A;t[17]!==n?(A=gt(n),t[17]=n,t[18]=A):A=t[18];let j;return t[19]!==v||t[20]!==A||t[21]!==n?(j=s.jsx(Dr,{tier:n,pillIcon:A,groups:v}),t[19]=v,t[20]=A,t[21]=n,t[22]=j):j=t[22],j}function Zt(t){const e=R.c(3),[n]=he();let o;return e[0]!==n.enableSounds||e[1]!==t?(o=()=>{n.enableSounds&&lo(t.dataUri).catch(V=>{console.warn(`[sound] ${t.name} playback failed:`,V)})},e[0]=n.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Fr={name:"switch-005",dataUri:"data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0VAAAAOAAADTGF2ZjYyLjMuMTAwAAAAAAAAAAAAAAD/+1DAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABkAABU4ABMTEx0dHR0nJycnMTExMTs7OztERERETk5OTlhYWFhiYmJibGxsbHZ2dnZ/f39/iYmJiZOTk5OdnZ2dp6enp7GxsbG7u7u7xMTExM7Ozs7Y2NjY4uLi4uzs7Oz29vb2/////wAAAABMYXZjNjIuMTEAAAAAAAAAAAAAAAAkBVYAAAAAAAAVOPCP8KUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//tQxAAACEwDXvQRAAG8Ii93HtACUCAABAKCJwfaCEHwfeoEAQdEAYygIHBOCAIAgCAJh9QIOg+D5/ygPh/wfB8DuKAgCHyn9QPh/5SCDv+CEHAQdxOD4B27c39tbckkqYbBAYAN9bNJLB+aXAf5wQAKdzxfbmrVIRQ4xNx3HwnoDmLhfMhgJiiw/HREXNCHqjvHEPEG8QjBYlxQNepJAT0kC8ip6JzSWj1TasoG+iyycbf2Uil1ovf1f/oUtR1qP+s1WSBFKoAAU02BDjMhuP/7UsQEgws8bRpd8YABJYPeBf9wCGXTGxBYcw5AJFMFMAmQQAhGAxgLBgHIAMYAAALhgAchipbe/91aU1VV4zcZj1Vf1XgYCIMBNrsBAIGs9/Ue4i/xFPeqCqwViI9/UeLf///rOngdA3OPHFjmOBv+EQnGahgaZxVplmkAH5JadDTQlNCEuGNiWYbCCONWdUJg6HXNazFdu1T+VgaEpOP70exv7f2/4b/yH//2/4cqCX/zWRUrIw+IPNMNlDnjAXQas/I4AzmYifA0tMSCgQDF//tSxBCDSzzi3k/sQwEyCtjJ/rBZAk+Uqj1YhA5YMCAAMwgOUchTkK7OR7LbMl0W1H6SvzG0Q2ZzfKUhnmTobv9DNhS1v7P8h//8Gv8gTRt1jReZ7YEjmMQg9hhwwMycHooasFmZyjcZGBKJD+IwbMCQQLoi+IQXCcIoydKoilI2MWFS5uJdDEu2taRrYI2ZSqKY50pJLv2NfjUAAuQAMfqVQ/T3PDQgMJMeEZ45hJzY6MNoFMxqTj1zNGQKJjAxEsSCBgQJBSIL0mcKYQJfVAn/+1LEGwLKlEKrD3MiYcuMkVa/wABB8Vh6M1q1epbvXwWBURhkyEhWZ/////////////9gjZ/Wt4w+4MNMCpE4TBYQl4w1IHvMDdA2zBngBMwc8COMDhCpDAfgOAAgrBgNYU+YC0FBGAkAMpgWoSCYAGESGBGAKBgXgJOdiOJmMCmNwCYNDJhYRPykRCJhTBnEUzlsjv4UNLj/z97n3Mv/7z1nZqyitYAZIqErIwMwJAqEw0GAAMFptJMaqFwB8CQIWlhuhuDAwNjfuwrQFAYXCf/7UsQVAA+9PTP42gYRdiIu9zBwAPbFUCi0DAhgNcS+7cDwVgM05A9bUDeuQMyE/u3CygVISgZhpIau/9PhdQG2C9DpxZZJmn/dn/Psmt0EFm////l84ThUTopE4VD/9JkubOGasTvN30C20G21qgUCkVCoUCgPMywrPCGly27V5q5t24vl/8jSlSAPCxzNseNCw3oh3NGBu4BZJ5hv7DRSfR/+eWG7nA8IKh2Olv5iz3q5m3//Joxo3JqNyYkSuGt/k6D4DeoBOHmHdl0dkZYA//tSxAUAC4B1Z/2DADEcA17Z/uhI4Yoik/TrZo+ww7UtmpW4LDWu2IacoJKJJeTSM+ZmAYBEiU+ZnnAwCn1VVVV6JUJQVnioKhrgqdKgqGpUFeCp0sDR3ztQNREDRUFioKuxKCpYGQBlRIBk+aLwb8KblGQVDdphPYTUdBOGbVpAaTF6ZdjEV0iRUZRCYkA4oUQDx5zqDugtXvza/7fuNNvfZ+j9v+T/2f//J/4cAAOTpE5K4zksR9MfIB+TDcQTI4gNs1XKAzEFUrGkxABYEBb/+1LEEYNKrEjgT/TCwYYVmUX+mHoKgWhKU5Eiw9SFIRmppw+3fYo4siPhUFeexM8KgIO6wVuPDDy01qeRaVbw357//y3+o8M0pBNlNLCGBzGKwyYw2IIFOE1WNTjRM6x8MlA1AxDhUHTAkEiyKpnbWrLcaOBotBUKbk1pypcWDAIK00AhKLGkUco6q9VWvM53mcaq3tVa8zjTM/tX//EDP//////////XAAmrwAAPoKwcw0ShDCZD/BQlhzinxQdorsOuXTEIC01ZkJyu4k/qPP/7UsQUAEjkrrkvZaPBIRXUoe5QObfMhYKX9RVgTPqCSCaSCaSC0XVdV1f/////6IAlguuAJSiDRNloNBsZg+0+Ts8MMCn81WUTRAlIi+GHECD0y8AWDIqswYsxGOSKVV7MqOni8tkVOip0fZX/////9HrMCbAz2EHGS4GKAAiRAAAYAcDdKd4G6Z/nwYgJ0ZAIgZyC8aPAs/iPBhwMpWDQNARltNS5Y61v//9i8Yl4SkFkIGTkAc0UBrIYLPA4MYBEy+YLMRuY4nhTC3hZA68H//tSxCoAyQC6mY6CkWDJBIsBz/QUrgNmahSzcrYw0/HhfnMAZBojDsgTFkDR5MDkG/DZEbk2FCmowqdqv2TYABiJwqqYjaQRGZ1URZ1DhSsdiHX/GBu0QpzIBNSaLqZ0ARkwFARxMrpt/Eh47mbQAhhU6sisFUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LESoHHJCRaj/dmYAIAQAAQAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsSLg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsShg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",duration:.609,format:"mp3",license:"CC0",author:"Kenney"},Lr=_s.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),zr=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Ur(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1.5",children:zr.map(Br)}),t[0]=e):e=t[0],e}function Br(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function $r({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:o,isStreaming:a,onUnsupportedFile:V}){const r=G(),[i,l]=L.useState(!1),p=Zt(Fr),{org:d}=we(),{editor:c}=At(),u=L.useRef(null),m=Ze(o),h=()=>{!m||a||(l(!1),u.current?.click())},f=async I=>{const Y=I.target.files;if(!Y||Y.length===0||!c)return;const H=Array.from(Y);try{let Z=c.state.selection.from;for(const W of H)await Rt(c,o??null,W,Z,V,r),Z=c.state.selection.to}finally{u.current&&(u.current.value="")}},x=ro({connectionId:n,orgId:d.id,orgSlug:d.slug}),b=ms.virtualMcpPrompts(n,d.id),{data:g,isLoading:v}=fs({queryKey:b,queryFn:()=>ao(x),staleTime:6e4,enabled:i&&!!x}),A=g?.prompts??[],[j,w]=L.useState(null),{chatMode:y,setChatMode:C}=_e(),[S,N]=he(),_=me.find(I=>I.value===S.toolApprovalLevel)??me[0],k=r(_.shortKey),P=I=>{const Y=me.find(H=>H.value===I);if(Y){if(Y.value===S.toolApprovalLevel){l(!1);return}p(),X("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:Y.value,source:"tools_popover"}),N({...S,toolApprovalLevel:Y.value}),l(!1)}},D=y==="plan",M=()=>{p();const I=D?"default":"plan";X("chat_mode_changed",{from_mode:y,to_mode:I,source:"tools_popover"}),C(I),l(!1)},E=()=>{e(),l(!1)},T=async(I,Y)=>{if(!c||!x)return;const H=it(I._meta),Z={from:c.state.selection.from,to:c.state.selection.to};try{const W=await Vo(x,I.name,Y);Is(c,Z,{id:I.name,name:oo(I.name,H),metadata:W.messages,char:"/",kind:"prompt",args:Y})}catch{ye.error(r("chat.toolsPopover.failedLoadPrompt"))}},F=async I=>{l(!1);const Y=!!(I.arguments&&I.arguments.length>0);if(X("chat_prompt_inserted",{prompt_name:I.name,with_arguments:Y}),Y){w(I);return}await T(I)},U=async I=>{j&&(await T(j,I),w(null))},q=()=>{p();const I=y==="gen-image"?"default":"gen-image";X("chat_mode_changed",{from_mode:y,to_mode:I,source:"tools_popover"}),C(I),l(!1)},$=()=>{p();const I=y==="web-search"?"default":"web-search";X("chat_mode_changed",{from_mode:y,to_mode:I,source:"tools_popover"}),C(I),l(!1)},z=()=>{p();const I=y==="deep-research"?"default":"deep-research";X("chat_mode_changed",{from_mode:y,to_mode:I,source:"tools_popover"}),C(I),l(!1)},Q=y==="gen-image",B=y==="web-search",te=y==="deep-research",J=s.jsx("input",{ref:u,type:"file",multiple:!0,accept:$n(o??null),className:"hidden",onChange:f,disabled:a});return s.jsxs(s.Fragment,{children:[J,s.jsxs(hs,{open:i,onOpenChange:I=>{I&&!i&&X("chat_tools_popover_opened",{chat_mode:y}),l(I)},children:[s.jsx(xs,{asChild:!0,children:s.jsxs(ee,{type:"button",variant:"ghost",size:"default",disabled:t,title:r("chat.toolsPopover.tools"),"aria-label":r("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[s.jsx(Qs,{size:14}),s.jsx("span",{className:O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:r("chat.toolsPopover.tools")})]})}),s.jsxs(gs,{align:"start",className:"w-56 p-1.5 space-y-1",children:[m?s.jsxs(pe,{onClick:h,disabled:a,children:[s.jsx(lt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]}):s.jsxs(Re,{children:[s.jsx(De,{asChild:!0,children:s.jsxs(pe,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:I=>I.preventDefault(),children:[s.jsx(lt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]})}),s.jsx(Pe,{side:"right",children:r("chat.toolsPopover.modelNoFileSupport")})]}),s.jsxs(pe,{onClick:M,className:O(D&&"text-special"),children:[s.jsx(wt,{size:16,className:O(D&&"text-special")}),s.jsx("span",{className:"flex-1 whitespace-nowrap",children:r("chat.toolsPopover.planMode")}),s.jsx("span",{className:O("text-xs text-muted-foreground",D&&"text-special font-medium"),children:Lr})]}),s.jsxs(pe,{onClick:q,className:O(Q&&"text-special"),children:[s.jsx(St,{size:16,className:O(Q&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.createImage")}),Q&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(pe,{onClick:$,className:O(B&&"text-special"),children:[s.jsx(Ct,{size:16,className:O(B&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.webSearch")}),B&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(pe,{onClick:z,className:O(te&&"text-special"),children:[s.jsx(Nt,{size:16,className:O(te&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.deepResearch")}),te&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(nt,{children:[s.jsxs(ot,{className:"gap-2",children:[s.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.prompts")})]}),s.jsx(rt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:v?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(bs,{className:"size-3.5"}),r("chat.toolsPopover.loadingPrompts")]}):A.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:r("chat.toolsPopover.noPromptsAvailable")}):A.map(I=>s.jsxs(pe,{onClick:()=>F(I),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:I.title||no(I.name,it(I._meta))}),I.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:I.description})]},I.name))})]}),s.jsxs(nt,{children:[s.jsxs(ot,{className:"gap-2",children:[s.jsx(Ie,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.approval")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),s.jsx(rt,{className:"w-48 p-1.5",children:s.jsx(As,{value:S.toolApprovalLevel,onValueChange:P,children:me.map(I=>s.jsx(vs,{value:I.value,children:r(I.labelKey)},I.value))})})]}),s.jsxs(pe,{onClick:E,children:[s.jsx(io,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.connections")}),s.jsx(L.Suspense,{children:s.jsx(Ur,{})})]})]})]}),s.jsx(Ts,{prompt:j,setPrompt:w,onSubmit:U})]})}const Or=[{src:"/connections/github.png",name:"GitHub"},{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/linear.png",name:"Linear"},{src:"/connections/shopify.png",name:"Shopify"},{src:"/connections/firecrawl.png",name:"Firecrawl"},{src:"/connections/perplexity.png",name:"Perplexity"}];function Kr(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1",children:Or.map(Qr)}),t[0]=e):e=t[0],e}function Qr(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Yr(t){const e=R.c(10),{onClick:n}=t,o=G();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=O("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=a):a=e[0];let V;e[1]!==o?(V=o("chat.connectionsBanner.description"),e[1]=o,e[2]=V):V=e[2];let r;e[3]!==V?(r=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:V}),e[3]=V,e[4]=r):r=e[4];let i,l;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Kr,{}),l=s.jsx(js,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=i,e[6]=l):(i=e[5],l=e[6]);let p;return e[7]!==n||e[8]!==r?(p=s.jsxs("button",{type:"button",onClick:n,className:a,children:[r,i,l]}),e[7]=n,e[8]=r,e[9]=p):p=e[9],p}const je=48;function Gr(){const t=R.c(9),[e,n]=L.useState("idle"),[o,a]=L.useState(""),[V,r]=L.useState(""),[i,l]=L.useState(Wr),p=L.useRef(null),d=L.useRef(null),c=L.useRef(null),u=L.useRef(null),m=L.useRef(0),h=L.useRef(!1),f=L.useRef(""),x=L.useRef(""),b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m.current&&(cancelAnimationFrame(m.current),m.current=0),d.current?.close().catch(Hr),u.current?.getTracks().forEach(qr),c.current=null,d.current=null,u.current=null},t[0]=g):g=t[0];const v=g;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const _=k=>{u.current=k;const P=new AudioContext;d.current=P;const D=P.createMediaStreamSource(k),M=P.createAnalyser();M.fftSize=128,M.smoothingTimeConstant=.8,D.connect(M),c.current=M;const E=new Uint8Array(M.frequencyBinCount),T=()=>{if(!c.current)return;c.current.getByteFrequencyData(E);const F=[];for(let U=0;U<je;U++){const q=Math.floor(U/je*E.length);F.push(Math.max(.04,(E[q]??0)/255))}l(F),m.current=requestAnimationFrame(T)};T()};A=async()=>{const k=window.SpeechRecognition||window.webkitSpeechRecognition;if(!k)return n("unsupported"),"unsupported";let P;try{P=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return n("permission-denied"),"permission-denied"}a(""),r(""),x.current="",f.current="",h.current=!0,n("recording"),_(P);const D=new k;p.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=M=>{if(p.current!==D)return;let E="",T="";for(let F=M.resultIndex;F<M.results.length;F++){const U=M.results[F],q=U?.[0]?.transcript??"";U?.isFinal?T=T+q:E=E+q}T&&(f.current=f.current+T,a(f.current)),x.current=E,r(E)},D.onerror=M=>{p.current===D&&M.error!=="no-speech"&&(h.current=!1,p.current=null,v(),n(M.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(p.current===D&&h.current)try{D.start()}catch{}};try{D.start()}catch{return h.current=!1,p.current=null,v(),n("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,p.current?.stop(),v(),n("idle"),l(Array(je).fill(.05)),r("");const _=(f.current+(x.current?" "+x.current:"")).trim();return a(""),f.current="",x.current="",_},t[2]=w):w=t[2];const y=w;let C;t[3]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{h.current=!1,p.current?.abort(),v(),n("idle"),a(""),r(""),l(Array(je).fill(.05)),f.current="",x.current=""},t[3]=C):C=t[3];const S=C;let N;return t[4]!==V||t[5]!==e||t[6]!==o||t[7]!==i?(N={status:e,transcript:o,interimTranscript:V,waveformData:i,isSupported:b,startRecording:j,stopRecording:y,cancelRecording:S},t[4]=V,t[5]=e,t[6]=o,t[7]=i,t[8]=N):N=t[8],N}function qr(t){return t.stop()}function Hr(){}function Wr(){return Array(je).fill(.05)}function Zr(t){const e=R.c(4),{data:n}=t;let o;e[0]!==n?(o=n.map(Jr),e[0]=n,e[1]=o):o=e[1];let a;return e[2]!==o?(a=s.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=a):a=e[3],a}function Jr(t,e){return s.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}function Xr(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function Se(t){const e=R.c(7),{message:n,icon:o}=t;let a;e[0]!==o?(a=o??s.jsx(bt,{size:14,className:"shrink-0"}),e[0]=o,e[1]=a):a=e[1];const V=n??"";let r;e[2]!==V?(r=s.jsx("span",{className:"text-sm",children:V}),e[2]=V,e[3]=r):r=e[3];let i;return e[4]!==a||e[5]!==r?(i=s.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[a,r]}),e[4]=a,e[5]=r,e[6]=i):i=e[6],i}function ea(t,e,n){const o=R.c(7),{editor:a}=At(),V=G(),[r,i]=L.useState(!1),l=L.useRef(0);let p,d;return o[0]!==n||o[1]!==a||o[2]!==e||o[3]!==t||o[4]!==V?(p=()=>{const c=f=>{f.dataTransfer?.types.includes("Files")&&(f.preventDefault(),l.current=l.current+1,i(!0))},u=f=>{f.preventDefault(),l.current=Math.max(0,l.current-1),l.current===0&&i(!1)},m=ta,h=f=>{if(f.preventDefault(),l.current=0,i(!1),n||!a||!t||!Ze(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const b=Array.from(x);(async()=>{let g=a.state.selection.from;for(const v of b)await Rt(a,t,v,g,e,V),g=a.state.selection.to})()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",u),window.addEventListener("dragover",m),window.addEventListener("drop",h),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",u),window.removeEventListener("dragover",m),window.removeEventListener("drop",h)}},d=[a,t,e,V,n],o[0]=n,o[1]=a,o[2]=e,o[3]=t,o[4]=V,o[5]=p,o[6]=d):(p=o[5],d=o[6]),L.useEffect(p,d),r}function ta(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function sa(t){const e=R.c(14),{selectedModel:n}=t,o=G();let a,V,r;if(e[0]!==n||e[1]!==o){const{parts:p}=On(n);e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Hs,{size:24}),e[5]=r):r=e[5],a="text-sm font-medium";let d;e[6]!==o?(d=c=>o(c),e[6]=o,e[7]=d):d=e[7],V=o("chat.input.dropFilesHere",{fileTypes:p.map(d).join(", ")}),e[0]=n,e[1]=o,e[2]=a,e[3]=V,e[4]=r}else a=e[2],V=e[3],r=e[4];let i;e[8]!==a||e[9]!==V?(i=s.jsx("span",{className:a,children:V}),e[8]=a,e[9]=V,e[10]=i):i=e[10];let l;return e[11]!==r||e[12]!==i?(l=s.jsxs(s.Fragment,{children:[r,i]}),e[11]=r,e[12]=i,e[13]=l):l=e[13],l}function na(){const t=R.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(bt,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=s.jsxs(s.Fragment,{children:[n,s.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function oa(t){const e=R.c(11),{selectedModel:n,onUnsupportedFile:o,disabled:a}=t,V=ea(n,o,a);let r;e[0]!==n?(r=Ze(n),e[0]=n,e[1]=r):r=e[1];const i=r,l=V?"opacity-100":"opacity-0 pointer-events-none",p=i?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let d;e[2]!==l||e[3]!==p?(d=O("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",l,p),e[2]=l,e[3]=p,e[4]=d):d=e[4];let c;e[5]!==n||e[6]!==i?(c=i?s.jsx(sa,{selectedModel:n}):s.jsx(na,{}),e[5]=n,e[6]=i,e[7]=c):c=e[7];let u;return e[8]!==d||e[9]!==c?(u=s.jsx("div",{className:d,children:c}),e[8]=d,e[9]=c,e[10]=u):u=e[10],u}function ke(t){const e=R.c(14),{onClick:n,label:o,icon:a,colorClass:V,maxWidthClass:r}=t;let i;e[0]!==V?(i=O("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",V),e[0]=V,e[1]=i):i=e[1];let l;e[2]!==r?(l=O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",r),e[2]=r,e[3]=l):l=e[3];let p;e[4]!==o||e[5]!==l?(p=s.jsx("span",{className:l,children:o}),e[4]=o,e[5]=l,e[6]=p):p=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ye,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=d):d=e[7];let c;return e[8]!==a||e[9]!==o||e[10]!==n||e[11]!==i||e[12]!==p?(c=s.jsxs("button",{type:"button",onClick:n,title:o,"aria-label":o,className:i,children:[a,p,d]}),e[8]=a,e[9]=o,e[10]=n,e[11]=i,e[12]=p,e[13]=c):c=e[13],c}function ra(){const t=R.c(6),e=Oe(),{org:n,locator:o}=we(),{create:a}=pn();let V;return t[0]!==a||t[1]!==o||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(V=async r=>{const{tiptapDoc:i,virtualMcp:l,taskIntake:p}=r,d=p===void 0?!1:p,c=crypto.randomUUID(),u=l?.id??ze(n.id).id;Rs(sessionStorage,o,c,{tiptapDoc:d&&i?To(i):i});try{await a({id:c,virtual_mcp_id:u})}catch{}const m={autosend:Ms};d&&(m.sidepanel=!0,m.mainpanel=!1),Ns(e,Ss({org:n.slug,agentId:u,superAgentId:ze(n.id).id}),{search:()=>({...m,thread:c}),replace:!1})},t[0]=a,t[1]=o,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=V):V=t[5],V}function cV({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:n=!1}){const o=G(),a=rn(),V=an(),r=a?.messages??[],i=a?.isStreaming??!1,l=a?.isRunInProgress??!1,p=a?.stop??(()=>{}),d=V?.taskId??"",c=d||Us,u=ra(),{selectedModel:m,selectedVirtualMcp:h,isModelsLoading:f,tiptapDocRef:x,imageModel:b,webSearchModel:g,deepResearchModel:v,chatMode:A,setChatMode:j}=_e(),{data:w}=ys.useSession(),y=w?.user?.id,{org:C,locator:S}=we(),[N,_]=ws(Cs.homeTaskMode(S),!0),k=n&&N,P=ze(C.id).id,D=Ps(h?.id),M=Bs(D?.id).runtime==="cms",E=Zt(co),[T,F]=L.useState(!1),{unsupportedFile:U,onUnsupportedFile:q,clearUnsupportedFile:$}=Xn(),z=Gr(),Q=L.useRef(void 0),B=async()=>{Q.current=ne;const K=await z.startRecording();X("chat_voice_started",{thread_id:d,outcome:K==="recording"?"started":K==="unsupported"?"unsupported":K==="permission-denied"?"permission_denied":"unknown"})},te=()=>{X("chat_voice_confirmed",{thread_id:d});const K=z.stopRecording();le.current?.syncVoiceText(Q.current,K),le.current?.focus()},J=()=>{X("chat_voice_cancelled",{thread_id:d}),z.cancelRecording(),le.current?.restoreContent(Q.current)};L.useEffect(()=>{if(z.status!=="recording")return;const K=(z.transcript+(z.interimTranscript?" "+z.interimTranscript:"")).trim();le.current?.syncVoiceText(Q.current,K)},[z.transcript,z.interimTranscript,z.status]);const I=V?.activeTask??null,Y=I?.created_by,H=!!(y&&Y&&Y!==y),{data:Z}=po({enabled:H}),W=(Z?.data?.members??[]).find(K=>K.userId===Y),se=W?.user?.name??W?.user?.email?.split("@")[0]??null,ae=fo(),Ve=Vn({isDesktopApp:ae,harnessId:I?.harness_id}),[ne,ie]=L.useState(()=>at(sessionStorage,S,c)??void 0),re=K=>{ie(K),x.current=K,zs(sessionStorage,S,c,K,{onQuotaExceeded:({docSizeBytes:de})=>{X("chat_draft_quota_exceeded",{thread_id:d||null,doc_size_bytes:de}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},ce=L.useRef(d);if(ce.current!==d){ce.current=d;const K=at(sessionStorage,S,c)??void 0;ie(K),x.current=K}const oe=[...r].reverse().find(K=>K.role==="assistant")?.metadata?.modelLimits?.contextWindow??m?.limits?.contextWindow,le=L.useRef(null),ve=L.useRef(!1),Ee=A==="plan",Ne=K=>{E(),X("chat_mode_changed",{from_mode:K,to_mode:"default",source:"pill_dismiss"}),j("default")};L.useEffect(()=>{const K=de=>{Ds(de)&&de.code==="KeyL"&&(de.preventDefault(),de.shiftKey&&j(A==="plan"?"default":"plan"),le.current?.focus())};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[A,j]);const Jt=ln(r),Je=[...r].reverse().find(K=>K.role==="assistant"&&K.metadata?.usage)?.metadata?.usage?.contextTokens??0,Xt=Ce("chat"),es=Pn(),[ts,Xe]=L.useState(!1),[ss,et]=L.useState(!1),ns=!f&&!Fs(ne),xe=Xr({hasDraft:ns,isStreaming:i,isRunInProgress:l}),Fe=xe==="send",ge=xe==="stop",tt=K=>{if(K?.preventDefault(),!Xt){Xe(!0);return}if(es){et(!0);return}if(xe==="send"&&ne){if(X("chat_message_sent",{thread_id:d||null,mode:A,model_id:m?.modelId??null,model_provider:m?.providerId??null,virtual_mcp_id:h?.id??null,submission:K?"button_or_enter":"programmatic"}),a){if(a.isSendInFlight()){ye.info(o("chat.input.stillSendingPreviousMessage"));return}a.sendMessage(ne)}else k&&X("task_report_submitted",{source:"home"}),u({tiptapDoc:ne,virtualMcp:k?null:h,taskIntake:k});Ls(sessionStorage,S,c),re(void 0)}else xe==="stop"&&(X("chat_message_stopped",{thread_id:d}),p())};if(H)return s.jsx(Se,{message:se?o("chat.input.readOnlyOthersChatNamed",{name:se}):o("chat.input.readOnlyOthersChat"),icon:se?s.jsx(uo,{shape:"circle",size:"2xs",url:W?.user?.image??void 0,fallback:se.slice(0,2).toUpperCase()}):void 0});if(I?.metadata?.read_only)return s.jsx(Se,{message:o("chat.input.readOnlyThread")});if(Ve)return s.jsx(Se,{message:o("chat.input.codingAgentRequiresDesktop")});if(M){if(!V)return s.jsx(Se,{message:o("chat.input.fastPreviewUnavailable")});const K=()=>{const de=V.createTask({runtime:"sandbox"});X("coding_session_started",{thread_id:de})};return s.jsxs("button",{type:"button",onClick:K,className:"group flex w-full items-center gap-3 rounded-2xl border border-border bg-background/60 px-4 py-3.5 text-left shadow-sm backdrop-blur-sm transition-colors hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(Ys,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:o("chat.fastPreview.startCodingSession")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.fastPreview.chatNeedsSession")})]}),s.jsx(vt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return s.jsxs(s.Fragment,{children:[ts&&s.jsx(ct,{feature:"chat",onDismiss:()=>Xe(!1)}),ss&&s.jsx(ct,{feature:"chat",copy:{title:o("chat.input.allowanceExhaustedTitle")},onDismiss:()=>et(!1)}),s.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:s.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&s.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),a&&V&&s.jsx(Me,{}),a&&V&&d?s.jsx(Nr,{taskId:d}):null,s.jsx(eo,{tiptapDoc:ne,setTiptapDoc:re,disabled:z.status==="recording",enterToSubmit:!0,placeholder:o(k?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:tt,suggestionOpenRef:ve,children:s.jsxs("form",{onSubmit:tt,className:O("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[s.jsx(oa,{selectedModel:m,onUnsupportedFile:q,disabled:z.status==="recording"}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(to,{ref:le,disabled:z.status==="recording",virtualMcpId:h?.id??P,showFileUploader:!0,selectedModel:m,onUnsupportedFile:q,suggestionOpenRef:ve})}),s.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:z.status==="recording"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx(Zr,{data:z.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:J,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":o("chat.input.cancelRecording"),children:s.jsx(Ye,{size:16})}),s.jsx("button",{type:"button",onClick:te,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":o("chat.input.useTranscription"),children:s.jsx(Ke,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&s.jsx(ee,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>_(!N),className:"h-8",children:o("chat.input.taskMode")}),s.jsx($r,{disabled:!1,onOpenConnections:()=>{X("connections_dialog_opened",{source:"tools_popover",mode:"add"}),F(!0)},virtualMcpId:h?.id??P,selectedModel:m,isStreaming:i,onUnsupportedFile:q}),Ee&&s.jsx(ke,{onClick:()=>Ne("plan"),label:o("chat.input.planMode"),icon:s.jsx(wt,{size:14,className:"shrink-0"}),colorClass:"text-violet-600 dark:text-violet-400 hover:bg-violet-500/10",maxWidthClass:"@[320px]/chat-bottom:max-w-32"}),A==="gen-image"&&b&&s.jsx(ke,{onClick:()=>Ne("gen-image"),label:o("chat.input.createImage"),icon:s.jsx(St,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),A==="web-search"&&g&&s.jsx(ke,{onClick:()=>Ne("web-search"),label:o("chat.input.webSearch"),icon:s.jsx(Ct,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),A==="deep-research"&&v&&s.jsx(ke,{onClick:()=>Ne("deep-research"),label:o("chat.input.deepResearch"),icon:s.jsx(Nt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),oe&&Je>0&&s.jsx(yn,{usage:Jt,totalTokens:Je,contextWindow:oe,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(Er,{}),z.isSupported&&s.jsx(ee,{type:"button",onClick:B,disabled:!1,variant:"ghost",size:"icon",className:O("size-8 classic:rounded-lg transition-colors",z.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:z.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),"aria-label":z.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),children:s.jsx(Gs,{size:18})}),s.jsx(ee,{type:ge?"button":"submit",onClick:K=>{ge&&(K.preventDefault(),K.stopPropagation(),p())},variant:Fe||ge?"default":"ghost",size:k?"sm":"icon",disabled:!Fe&&!ge,className:O(k?"h-8 px-3 classic:rounded-lg transition-all":"size-8 classic:rounded-lg transition-all",!Fe&&!ge&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:o(xe==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":k?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":o(xe==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":k?"chat.input.startTask":"chat.input.sendMessage"),children:ge?s.jsx(qs,{size:20}):s.jsxs(s.Fragment,{children:[k&&o("chat.input.startTask"),s.jsx(jt,{size:20})]})})]})]})})]})},d),n&&k&&s.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:o("chat.input.taskHint")}),e&&s.jsx(Yr,{onClick:()=>{X("connections_banner_clicked",{source:"home_chat_input"}),X("connections_dialog_opened",{source:"home_banner",mode:"add"}),F(!0)}})]})}),s.jsx(mo,{mode:"browse",open:T,onOpenChange:F,defaultTab:"all"}),s.jsx(so,{info:U,onClose:$})]})}export{cV as C,iV as H,pr as T,fr as a,lV as u};
8
+ The report follows.`;function To(t){return{...t,content:[{type:"paragraph",content:[ks({id:dt,name:dt,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:ko}}]})]},...t.content??[]]}}function Io(t){const e=R.c(30),{current:n,total:o,onPrev:a,onNext:V}=t,r=G();if(o<=1)return null;const i=n===0,l=n===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let p;e[0]!==l?(p=O("p-0.5 classic:rounded transition-colors compact:rounded-lg",l),e[0]=l,e[1]=p):p=e[1];let d;e[2]!==r?(d=r("chat.pagination.previousLabel"),e[2]=r,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(vn,{size:14}),e[4]=c):c=e[4];let u;e[5]!==a||e[6]!==i||e[7]!==p||e[8]!==d?(u=s.jsx("button",{type:"button",onClick:a,disabled:i,className:p,"aria-label":d,children:c}),e[5]=a,e[6]=i,e[7]=p,e[8]=d,e[9]=u):u=e[9];const m=n+1;let h;e[10]!==r||e[11]!==m||e[12]!==o?(h=r("chat.pagination.counter",{current:m,total:o}),e[10]=r,e[11]=m,e[12]=o,e[13]=h):h=e[13];let f;e[14]!==h?(f=s.jsx("span",{className:"tabular-nums text-xs",children:h}),e[14]=h,e[15]=f):f=e[15];const x=n===o-1,b=n===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let g;e[16]!==b?(g=O("p-0.5 classic:rounded transition-colors compact:rounded-lg",b),e[16]=b,e[17]=g):g=e[17];let v;e[18]!==r?(v=r("chat.pagination.nextLabel"),e[18]=r,e[19]=v):v=e[19];let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(vt,{size:14}),e[20]=A):A=e[20];let j;e[21]!==V||e[22]!==x||e[23]!==g||e[24]!==v?(j=s.jsx("button",{type:"button",onClick:V,disabled:x,className:g,"aria-label":v,children:A}),e[21]=V,e[22]=x,e[23]=g,e[24]=v,e[25]=j):j=e[25];let w;return e[26]!==j||e[27]!==u||e[28]!==f?(w=s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[u,f,j]}),e[26]=j,e[27]=u,e[28]=f,e[29]=w):w=e[29],w}function Ut(t){const e=R.c(8),{currentIndex:n,total:o,onPrev:a,onNext:V,extraLeft:r}=t;let i;e[0]!==n||e[1]!==V||e[2]!==a||e[3]!==o?(i=s.jsx(Io,{current:n,total:o,onPrev:a,onNext:V}),e[0]=n,e[1]=V,e[2]=a,e[3]=o,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==i?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[i,r]}),e[5]=r,e[6]=i,e[7]=l):l=e[7],l}function _o(t){const e=R.c(17),{isStreaming:n,isAllAnswered:o,isCurrentAnswered:a,onAdvanceOrSubmit:V,submitLabel:r,nextLabel:i}=t,d=o?r===void 0?"Submit":r:i===void 0?"Next":i,c=o?n:!a,u=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let m;e[0]!==c||e[1]!==V?(m=()=>{c||V()},e[0]=c,e[1]=V,e[2]=m):m=e[2];const h=c&&"opacity-50 cursor-not-allowed";let f;e[3]!==h?(f=O("h-7 px-2.5 text-xs",h),e[3]=h,e[4]=f):f=e[4];let x;e[5]!==c||e[6]!==d||e[7]!==m||e[8]!==f?(x=s.jsx(ee,{type:"button",size:"sm","aria-disabled":c,onClick:m,className:f,children:d}),e[5]=c,e[6]=d,e[7]=m,e[8]=f,e[9]=x):x=e[9];const b=x;if(!u)return b;let g;e[10]!==b?(g=s.jsx(De,{asChild:!0,children:b}),e[10]=b,e[11]=g):g=e[11];let v;e[12]!==u?(v=s.jsx(Pe,{children:u}),e[12]=u,e[13]=v):v=e[13];let A;return e[14]!==g||e[15]!==v?(A=s.jsxs(Re,{children:[g,v]}),e[14]=g,e[15]=v,e[16]=A):A=e[16],A}function Bt(t,e,n){return t.findIndex(o=>e(o)===n)}function ut(t,e,n,o){return t.length===0?!1:t.every(a=>o(n[e(a)]))}function pt(t,e,n,o,a){if(t.length===0)return null;const V=Bt(t,e,a);for(let r=1;r<=t.length;r++){const i=t[(V+r)%t.length];if(!i)continue;const l=e(i);if(l!==a&&!o(n[l]))return l}return null}function Do(t){return!t.isStreaming&&t.allAnswered}function $t(t){const{parts:e,partKey:n,schema:o,defaultValues:a,isStreaming:V,hasAnswer:r,onSubmit:i}=t,l=e[0]?n(e[0]):"",[p,d]=F.useState(l),[c,u]=F.useState(!1),m=rs({resolver:as(o),defaultValues:a}),h=m.watch(),f=Bt(e,n,p),x=f>=0?e[f]:void 0,b=r(h[p]),g=ut(e,n,h,r),v=Do({isStreaming:V,allAnswered:g}),A=()=>{if(f>0){const _=e[f-1];_&&d(n(_))}},j=()=>{if(f>=0&&f<e.length-1){const _=e[f+1];_&&d(n(_))}},w=()=>{const _=m.getValues(),k=pt(e,n,_,r,p);k&&d(k)},y=()=>{m.handleSubmit(_=>{const k=_;for(const P of e)i(P,k[n(P)])})()},C=F.useRef(y);C.current=y;const S=()=>{v&&(u(!1),C.current())},N=()=>{const _=m.getValues();if(ut(e,n,_,r)){if(V){u(!0);return}u(!1),C.current()}else{const k=pt(e,n,_,r,p);k&&d(k)}};return F.useEffect(()=>{if(c&&!V){if(!g){u(!1);return}u(!1),C.current()}},[c,V,g]),{form:m,activeKey:p,setActiveKey:d,currentIndex:f,currentPart:x,isCurrentAnswered:b,isAllAnswered:g,canSubmit:v,goPrev:A,goNext:j,advanceToNextUnanswered:w,submit:S,submitOrAdvance:N}}const Ot="chat.approval.defaultDenyReason";function Kt(t){const e=R.c(36),{onYolo:n}=t,o=G(),[a,V]=he();let r,i,l,p,d,c,u,m,h;if(e[0]!==n||e[1]!==a||e[2]!==V||e[3]!==o){const A=me.find(y=>y.value===a.toolApprovalLevel)??me[0];let j;e[13]!==n||e[14]!==a||e[15]!==V?(j=y=>{const C=y,S=a.toolApprovalLevel??"readonly";V({...a,toolApprovalLevel:C}),C==="auto"&&n(S)},e[13]=n,e[14]=a,e[15]=V,e[16]=j):j=e[16];const w=j;l=xn,m=a.toolApprovalLevel,h=w,i=gn,d="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",u=Po,r=bn,p=o(A.shortKey),e[0]=n,e[1]=a,e[2]=V,e[3]=o,e[4]=r,e[5]=i,e[6]=l,e[7]=p,e[8]=d,e[9]=c,e[10]=u,e[11]=m,e[12]=h}else r=e[4],i=e[5],l=e[6],p=e[7],d=e[8],c=e[9],u=e[10],m=e[11],h=e[12];let f;e[17]!==r||e[18]!==p?(f=s.jsx(r,{children:p}),e[17]=r,e[18]=p,e[19]=f):f=e[19];let x;e[20]!==i||e[21]!==d||e[22]!==c||e[23]!==u||e[24]!==f?(x=s.jsx(i,{size:d,className:c,onClick:u,children:f}),e[20]=i,e[21]=d,e[22]=c,e[23]=u,e[24]=f,e[25]=x):x=e[25];let b;e[26]!==o?(b=me.map(A=>s.jsx(hn,{value:A.value,children:o(A.labelKey)},A.value)),e[26]=o,e[27]=b):b=e[27];let g;e[28]!==b?(g=s.jsx(An,{children:b}),e[28]=b,e[29]=g):g=e[29];let v;return e[30]!==l||e[31]!==g||e[32]!==m||e[33]!==h||e[34]!==x?(v=s.jsxs(l,{value:m,onValueChange:h,children:[x,g]}),e[30]=l,e[31]=g,e[32]=m,e[33]=h,e[34]=x,e[35]=v):v=e[35],v}function Po(t){return t.stopPropagation()}function Qt(t){const e=R.c(8),{input:n}=t,o=G();if(n==null){let r;e[0]!==o?(r=o("chat.approval.noInput"),e[0]=o,e[1]=r):r=e[1];let i;return e[2]!==r?(i=s.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=i):i=e[3],i}let a;try{let r;e[4]!==n?(r=JSON.stringify(n,null,2),e[4]=n,e[5]=r):r=e[5],a=r}catch{a=String(n)}let V;return e[6]!==a?(V=s.jsx("div",{className:"px-4",children:s.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word max-h-32 overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:a})}),e[6]=a,e[7]=V):V=e[7],V}function Ro(t){const e=R.c(38),{approval:n,onRespond:o}=t,a=G(),[V]=he(),r=V.toolApprovalLevel??"readonly";let i;e[0]!==n.approvalId||e[1]!==r||e[2]!==o||e[3]!==a?(i=()=>o(n.approvalId,!1,a(Ot),r),e[0]=n.approvalId,e[1]=r,e[2]=o,e[3]=a,e[4]=i):i=e[4];const l=i;let p;e[5]!==n.approvalId||e[6]!==r||e[7]!==o?(p=()=>o(n.approvalId,!0,void 0,r),e[5]=n.approvalId,e[6]=r,e[7]=o,e[8]=p):p=e[8];const d=p;let c;e[9]!==n.approvalId||e[10]!==o?(c=S=>o(n.approvalId,!0,void 0,S),e[9]=n.approvalId,e[10]=o,e[11]=c):c=e[11];const u=c;let m;e[12]!==u?(m=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Kt,{onYolo:u})}),e[12]=u,e[13]=m):m=e[13];const h=m;let f;e[14]!==a?(f=a("chat.approval.denyButton"),e[14]=a,e[15]=f):f=e[15];let x;e[16]!==l||e[17]!==f?(x=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:l,children:f}),e[16]=l,e[17]=f,e[18]=x):x=e[18];let b;e[19]!==a?(b=a("chat.approval.acceptButton"),e[19]=a,e[20]=b):b=e[20];let g;e[21]!==d||e[22]!==b?(g=s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:d,children:b}),e[21]=d,e[22]=b,e[23]=g):g=e[23];let v;e[24]!==x||e[25]!==g?(v=s.jsxs(s.Fragment,{children:[x,g]}),e[24]=x,e[25]=g,e[26]=v):v=e[26];const A=v;let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ie,{size:14}),e[27]=j):j=e[27];let w;e[28]!==a?(w=a("chat.approval.needsApproval"),e[28]=a,e[29]=w):w=e[29];let y;e[30]!==n.input?(y=s.jsx(Qt,{input:n.input}),e[30]=n.input,e[31]=y):y=e[31];let C;return e[32]!==n.friendlyName||e[33]!==h||e[34]!==A||e[35]!==w||e[36]!==y?(C=s.jsx(ue,{icon:j,label:w,title:n.friendlyName,defaultExpanded:!0,footerLeft:h,footerRight:A,children:y}),e[32]=n.friendlyName,e[33]=h,e[34]=A,e[35]=w,e[36]=y,e[37]=C):C=e[37],C}const Mo=Vs(be(),fe({approved:is().optional(),levelOverride:$e(["auto","readonly"]).optional()}));function Eo(t){const e=R.c(46),{approvals:n,isStreaming:o,onRespond:a}=t,V=G(),[r]=he(),i=r.toolApprovalLevel??"readonly";let l;e[0]!==n?(l=Object.fromEntries(n.map(zo)),e[0]=n,e[1]=l):l=e[1];const p=l;let d;e[2]!==i||e[3]!==a||e[4]!==V?(d=(k,P)=>{const D=P;typeof D?.approved=="boolean"&&a(k.approvalId,D.approved,D.approved===!1?V(Ot):void 0,D.levelOverride??i)},e[2]=i,e[3]=a,e[4]=V,e[5]=d):d=e[5];let c;e[6]!==n||e[7]!==p||e[8]!==o||e[9]!==d?(c={parts:n,partKey:Fo,schema:Mo,defaultValues:p,isStreaming:o,hasAnswer:Lo,onSubmit:d},e[6]=n,e[7]=p,e[8]=o,e[9]=d,e[10]=c):c=e[10];const u=$t(c);let m;e[11]!==n||e[12]!==u?(m=k=>{u.form.reset(Object.fromEntries(n.map(P=>[P.approvalId,{approved:!0,levelOverride:k}]))),u.submitOrAdvance()},e[11]=n,e[12]=u,e[13]=m):m=e[13];const h=m,f=u.currentPart,x=u.form;let b;e[14]!==u?(b=k=>{k.preventDefault(),u.submit()},e[14]=u,e[15]=b):b=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ie,{size:14}),e[16]=g):g=e[16];let v;e[17]!==n.length||e[18]!==V?(v=V("chat.approval.batchedLabel",{count:n.length}),e[17]=n.length,e[18]=V,e[19]=v):v=e[19];const A=f?.friendlyName??"";let j;e[20]!==h?(j=s.jsx(Kt,{onYolo:h}),e[20]=h,e[21]=j):j=e[21];let w;e[22]!==n.length||e[23]!==u.currentIndex||e[24]!==u.goNext||e[25]!==u.goPrev||e[26]!==j?(w=s.jsx(Ut,{currentIndex:u.currentIndex,total:n.length,onPrev:u.goPrev,onNext:u.goNext,extraLeft:j}),e[22]=n.length,e[23]=u.currentIndex,e[24]=u.goNext,e[25]=u.goPrev,e[26]=j,e[27]=w):w=e[27];let y;e[28]!==f||e[29]!==u.form.control||e[30]!==u.submitOrAdvance?(y=f?s.jsx(Uo,{approvalId:f.approvalId,control:u.form.control,onChange:u.submitOrAdvance}):null,e[28]=f,e[29]=u.form.control,e[30]=u.submitOrAdvance,e[31]=y):y=e[31];let C;e[32]!==f?(C=f?s.jsx(Qt,{input:f.input}):null,e[32]=f,e[33]=C):C=e[33];let S;e[34]!==w||e[35]!==y||e[36]!==C||e[37]!==v||e[38]!==A?(S=s.jsx(ue,{icon:g,label:v,title:A,defaultExpanded:!0,footerLeft:w,footerRight:y,children:C}),e[34]=w,e[35]=y,e[36]=C,e[37]=v,e[38]=A,e[39]=S):S=e[39];let N;e[40]!==S||e[41]!==b?(N=s.jsx("form",{onSubmit:b,children:S}),e[40]=S,e[41]=b,e[42]=N):N=e[42];let _;return e[43]!==u.form||e[44]!==N?(_=s.jsx(Ue,{...x,children:N}),e[43]=u.form,e[44]=N,e[45]=_):_=e[45],_}function Lo(t){return typeof t?.approved=="boolean"}function Fo(t){return t.approvalId}function zo(t){return[t.approvalId,{approved:void 0}]}function Uo(t){const e=R.c(7),{approvalId:n,control:o,onChange:a}=t,V=G(),r=`${n}.approved`;let i;e[0]!==a||e[1]!==V?(i=p=>{const{field:d}=p,c=d.value===!0,u=d.value===!1;return s.jsxs(s.Fragment,{children:[s.jsx(ee,{type:"button",variant:u?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!1),a()},"aria-pressed":u,children:V("chat.approval.denyButton")}),s.jsx(ee,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{d.onChange(!0),a()},"aria-pressed":c,children:V("chat.approval.acceptButton")})]})},e[0]=a,e[1]=V,e[2]=i):i=e[2];let l;return e[3]!==o||e[4]!==r||e[5]!==i?(l=s.jsx(ls,{control:o,name:r,render:i}),e[3]=o,e[4]=r,e[5]=i,e[6]=l):l=e[6],l}function Bo(){const t=R.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ie,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function $o(t){const e=R.c(8),{approvals:n,isStreaming:o,onRespond:a}=t;if(o&&n.length===0){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Bo,{}),e[0]=r):r=e[0],r}if(n.length===0)return null;if(n.length===1){const r=n[0];if(!r)return null;let i;return e[1]!==a||e[2]!==r?(i=s.jsx(Ro,{approval:r,onRespond:a}),e[1]=a,e[2]=r,e[3]=i):i=e[3],i}let V;return e[4]!==n||e[5]!==o||e[6]!==a?(V=s.jsx(Eo,{approvals:n,isStreaming:o,onRespond:a}),e[4]=n,e[5]=o,e[6]=a,e[7]=V):V=e[7],V}function Oo(t){const e=R.c(28),{plan:n,onApprove:o,onDismiss:a}=t,V=G();let r;e[0]!==o||e[1]!==n.plan?(r=()=>{o(n.plan)},e[0]=o,e[1]=n.plan,e[2]=r):r=e[2];const i=r;let l;e[3]!==V?(l=V("chat.proposePlan.keepIterating"),e[3]=V,e[4]=l):l=e[4];let p;e[5]!==a||e[6]!==l?(p=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs text-muted-foreground [@media(hover:hover)]:hover:text-foreground active:scale-[0.97] transition-transform",onClick:a,children:l}),e[5]=a,e[6]=l,e[7]=p):p=e[7];let d;e[8]!==V?(d=V("chat.proposePlan.letsGo"),e[8]=V,e[9]=d):d=e[9];let c;e[10]!==i||e[11]!==d?(c=s.jsx(ee,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs bg-special hover:bg-special/90 text-special-foreground active:scale-[0.97] transition-transform",onClick:i,children:d}),e[10]=i,e[11]=d,e[12]=c):c=e[12];let u;e[13]!==p||e[14]!==c?(u=s.jsxs(s.Fragment,{children:[p,c]}),e[13]=p,e[14]=c,e[15]=u):u=e[15];const m=u;let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx($s,{size:14}),e[16]=h):h=e[16];let f;e[17]!==V?(f=V("chat.proposePlan.planReady"),e[17]=V,e[18]=f):f=e[18];let x;e[19]!==V?(x=V("chat.proposePlan.implementationPlan"),e[19]=V,e[20]=x):x=e[20];let b;e[21]!==n.plan?(b=s.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:s.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:s.jsx(jn,{id:"plan-preview",part:{type:"text",text:n.plan}})})}),e[21]=n.plan,e[22]=b):b=e[22];let g;return e[23]!==m||e[24]!==b||e[25]!==f||e[26]!==x?(g=s.jsx(ue,{icon:h,label:f,title:x,defaultExpanded:!0,footerRight:m,children:b}),e[23]=m,e[24]=b,e[25]=f,e[26]=x,e[27]=g):g=e[27],g}function Ko(t){const e=R.c(6),{plans:n,onApprove:o,onDismiss:a}=t;let V;e[0]!==n?(V=Lt(n),e[0]=n,e[1]=V):V=e[1];const r=V;if(!r)return null;let i;return e[2]!==r||e[3]!==o||e[4]!==a?(i=s.jsx(Oo,{plan:r,onApprove:o,onDismiss:a}),e[2]=r,e[3]=o,e[4]=a,e[5]=i):i=e[5],i}function Yt(t){return t?"response"in t?t.response:t.option??t.draft:""}const mt=fe({response:be().min(1,"Response is required")}),Qo=fe({option:be().nullable(),draft:be()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Yo=fe({response:$e(["yes","no"])});function Go(t){switch(t.type){case"text":return mt;case"choice":return Qo;case"confirm":return Yo;default:return mt}}function qo(t){const e={};for(const n of t)e[n.toolCallId]=Go(n.input);return fe(e)}function Ho(t){const e=R.c(7),{control:n,name:o,placeholder:a}=t,V=G();let r;e[0]!==a||e[1]!==V?(r=l=>{const{field:p}=l,d=p.value??"";return s.jsxs(qe,{children:[s.jsx(He,{children:s.jsx("div",{className:"px-2",children:s.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(yt,{size:16,className:"text-muted-foreground"})}),s.jsx("input",{...p,value:d,type:"text",placeholder:a||V("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":V("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),s.jsx(We,{})]})},e[0]=a,e[1]=V,e[2]=r):r=e[2];let i;return e[3]!==n||e[4]!==o||e[5]!==r?(i=s.jsx(kt,{control:n,name:o,render:r}),e[3]=n,e[4]=o,e[5]=r,e[6]=i):i=e[6],i}function Gt(t,e){const n=R.c(4);let o,a;n[0]!==t||n[1]!==e?(o=()=>{const V=r=>{const i=r.target.tagName;if(i==="INPUT"||i==="TEXTAREA"||r.metaKey||r.ctrlKey||r.altKey)return;const l=Number.parseInt(r.key,10);l>=1&&l<=t&&(r.preventDefault(),e(l-1))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},a=[t,e],n[0]=t,n[1]=e,n[2]=o,n[3]=a):(o=n[2],a=n[3]),F.useEffect(o,a)}function Wo(t){const e=R.c(51),{control:n,name:o,options:a}=t,V=G(),r=`${o}.option`;let i;e[0]!==n||e[1]!==r?(i={control:n,name:r,defaultValue:null},e[0]=n,e[1]=r,e[2]=i):i=e[2];const{field:l}=st(i),p=`${o}.draft`;let d;e[3]!==n||e[4]!==p?(d={control:n,name:p,defaultValue:""},e[3]=n,e[4]=p,e[5]=d):d=e[5];const{field:c}=st(d),u=l.value,m=c.value??"";let h;if(e[6]!==l||e[7]!==a?(h=E=>{const T=a[E];T!=null&&l.onChange(T)},e[6]=l,e[7]=a,e[8]=h):h=e[8],Gt(a.length,h),a.length===0)return null;const f=u===null;let x;e[9]!==V?(x=V("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=V,e[10]=x):x=e[10];let b;if(e[11]!==l||e[12]!==u||e[13]!==a||e[14]!==V){let E;e[16]!==l||e[17]!==u||e[18]!==V?(E=(T,L)=>{const U=u===T;return s.jsxs("button",{type:"button",onClick:()=>l.onChange(T),className:O("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",U&&"bg-accent/50",!U&&"hover:bg-accent/30"),"aria-label":V("chat.userAskQuestion.selectOption",{option:T}),children:[s.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",U?"bg-chart-1 text-white":"bg-muted text-foreground"),children:L+1}),s.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:T})]},`${L}-${T}`)},e[16]=l,e[17]=u,e[18]=V,e[19]=E):E=e[19],b=a.map(E),e[11]=l,e[12]=u,e[13]=a,e[14]=V,e[15]=b}else b=e[15];const g=f&&"bg-accent/50",v=!f&&"hover:bg-accent/30";let A;e[20]!==g||e[21]!==v?(A=O("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",g,v),e[20]=g,e[21]=v,e[22]=A):A=e[22];let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:s.jsx(yt,{size:16,className:"text-muted-foreground"})}),e[23]=j):j=e[23];const w=f?m:"";let y;e[24]!==c||e[25]!==l||e[26]!==u?(y=E=>{c.onChange(E.target.value),u!==null&&l.onChange(null)},e[24]=c,e[25]=l,e[26]=u,e[27]=y):y=e[27];let C;e[28]!==l||e[29]!==u?(C=()=>{u!==null&&l.onChange(null)},e[28]=l,e[29]=u,e[30]=C):C=e[30];let S;e[31]!==V?(S=V("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=V,e[32]=S):S=e[32];let N;e[33]!==V?(N=V("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=V,e[34]=N):N=e[34];let _;e[35]!==w||e[36]!==y||e[37]!==C||e[38]!==S||e[39]!==N?(_=s.jsx("input",{type:"text",value:w,onChange:y,onFocus:C,placeholder:S,"aria-label":N,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=w,e[36]=y,e[37]=C,e[38]=S,e[39]=N,e[40]=_):_=e[40];let k;e[41]!==A||e[42]!==_?(k=s.jsxs("label",{className:A,children:[j,_]}),e[41]=A,e[42]=_,e[43]=k):k=e[43];let P;e[44]!==k||e[45]!==x||e[46]!==b?(P=s.jsx(He,{children:s.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":x,children:[b,k]})}),e[44]=k,e[45]=x,e[46]=b,e[47]=P):P=e[47];let D;e[48]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(We,{}),e[48]=D):D=e[48];let M;return e[49]!==P?(M=s.jsxs(qe,{children:[P,D]}),e[49]=P,e[50]=M):M=e[50],M}function Zo(t){const e=R.c(8),{control:n,name:o}=t,a=G();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=["yes","no"],e[0]=V):V=e[0];const r=V,i=F.useRef(null);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=c=>{i.current?.onChange(r[c]??"")},e[1]=l):l=e[1],Gt(r.length,l);let p;e[2]!==a?(p=c=>{const{field:u}=c;return i.current=u,s.jsxs(qe,{children:[s.jsx(He,{children:s.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":a("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:r.map(m=>{const h=u.value===m;return s.jsxs("button",{type:"button",onClick:()=>u.onChange(m),className:O("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",h&&"bg-accent/50",!h&&"hover:bg-accent/30"),"aria-label":a("chat.userAskQuestion.confirmValue",{value:a(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)}),children:[s.jsx("span",{className:O("flex items-center justify-center size-6 rounded-md text-sm shrink-0",h?"bg-chart-1 text-white":"bg-muted text-foreground"),children:m==="yes"?1:2}),s.jsx("span",{className:"text-sm text-foreground capitalize",children:a(`chat.userAskQuestion.confirm${m==="yes"?"Yes":"No"}`)})]},m)})})}),s.jsx(We,{})]})},e[2]=a,e[3]=p):p=e[3];let d;return e[4]!==n||e[5]!==o||e[6]!==p?(d=s.jsx(kt,{control:n,name:o,render:p}),e[4]=n,e[5]=o,e[6]=p,e[7]=d):d=e[7],d}function ft(t){const e=R.c(13),{input:n,control:o,toolCallId:a}=t;switch(n.type){case"text":{const V=`${a}.response`;let r;return e[0]!==o||e[1]!==n.default||e[2]!==V?(r=s.jsx(Ho,{control:o,name:V,placeholder:n.default}),e[0]=o,e[1]=n.default,e[2]=V,e[3]=r):r=e[3],r}case"choice":{let V;e[4]!==n.options?(V=n.options?.filter(Boolean)??[],e[4]=n.options,e[5]=V):V=e[5];const r=V;let i;return e[6]!==o||e[7]!==r||e[8]!==a?(i=s.jsx(Wo,{control:o,name:a,options:r}),e[6]=o,e[7]=r,e[8]=a,e[9]=i):i=e[9],i}case"confirm":{const V=`${a}.response`;let r;return e[10]!==o||e[11]!==V?(r=s.jsx(Zo,{control:o,name:V}),e[10]=o,e[11]=V,e[12]=r):r=e[12],r}default:return null}}function Jo(t){const e=R.c(91),{parts:n,isStreaming:o,onSubmit:a}=t;let V;e[0]!==n?(V=qo(n.map(sr)),e[0]=n,e[1]=V):V=e[1];const r=V;let i;e[2]!==n?(i=Object.fromEntries(n.map(tr)),e[2]=n,e[3]=i):i=e[3];const l=i;let p;e[4]!==a?(p=($,z)=>{const Q=Yt(z);Q&&a($,Q)},e[4]=a,e[5]=p):p=e[5];let d;e[6]!==l||e[7]!==o||e[8]!==n||e[9]!==r||e[10]!==p?(d={parts:n,partKey:er,schema:r,defaultValues:l,isStreaming:o,hasAnswer:Xo,onSubmit:p},e[6]=l,e[7]=o,e[8]=n,e[9]=r,e[10]=p,e[11]=d):d=e[11];const c=$t(d),u=c.currentPart,m=G();let h;e[12]!==u||e[13]!==c||e[14]!==m?(h=()=>{const $=u;if(!$)return;const z=m("chat.userAskQuestion.skipMessage"),Q=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${Q}.option`,null),c.form.setValue(`${Q}.draft`,z)):c.form.setValue(`${Q}.response`,z),c.advanceToNextUnanswered()},e[12]=u,e[13]=c,e[14]=m,e[15]=h):h=e[15];const f=h;let x;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==n.length?(x=s.jsx(Ut,{currentIndex:c.currentIndex,total:n.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=n.length,e[20]=x):x=e[20];const b=x;let g;e[21]!==m?(g=m("chat.userAskQuestion.skip"),e[21]=m,e[22]=g):g=e[22];let v;e[23]!==f||e[24]!==g?(v=s.jsx(ee,{type:"button",variant:"outline",size:"sm",onClick:f,className:"h-7",children:g}),e[23]=f,e[24]=g,e[25]=v):v=e[25];let A;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(A=s.jsx(_o,{isStreaming:o,isAllAnswered:c.isAllAnswered,isCurrentAnswered:c.isCurrentAnswered,onAdvanceOrSubmit:c.submitOrAdvance}),e[26]=c.isAllAnswered,e[27]=c.isCurrentAnswered,e[28]=c.submitOrAdvance,e[29]=o,e[30]=A):A=e[30];let j;e[31]!==v||e[32]!==A?(j=s.jsxs(s.Fragment,{children:[v,A]}),e[31]=v,e[32]=A,e[33]=j):j=e[33];const w=j;if(n.length===1){const $=n[0];if(!$?.input)return null;const z=c.form;let Q;e[34]!==c?(Q=se=>{se.preventDefault(),c.submit()},e[34]=c,e[35]=Q):Q=e[35];let B;e[36]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Be,{size:14}),e[36]=B):B=e[36];let te;e[37]!==m?(te=m("chat.userAskQuestion.questionPending"),e[37]=m,e[38]=te):te=e[38];let J;e[39]!==$.input?.prompt||e[40]!==m?(J=$.input?.prompt??m("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=m,e[41]=J):J=e[41];const I=$.input;let Y;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==I?(Y=s.jsx(ft,{input:I,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=I,e[45]=Y):Y=e[45];let H;e[46]!==w||e[47]!==te||e[48]!==J||e[49]!==Y?(H=s.jsx(ue,{icon:B,label:te,title:J,defaultExpanded:!0,footerRight:w,children:Y}),e[46]=w,e[47]=te,e[48]=J,e[49]=Y,e[50]=H):H=e[50];let Z;e[51]!==Q||e[52]!==H?(Z=s.jsx("form",{onSubmit:Q,autoComplete:"off",children:H}),e[51]=Q,e[52]=H,e[53]=Z):Z=e[53];let W;return e[54]!==c.form||e[55]!==Z?(W=s.jsx(Ue,{...z,children:Z}),e[54]=c.form,e[55]=Z,e[56]=W):W=e[56],W}const y=c.form;let C;e[57]!==c?(C=$=>{$.preventDefault(),c.submit()},e[57]=c,e[58]=C):C=e[58];let S;e[59]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Be,{size:14}),e[59]=S):S=e[59];let N;e[60]!==m?(N=m("chat.userAskQuestion.questionPending"),e[60]=m,e[61]=N):N=e[61];const _=c.currentIndex+1;let k;e[62]!==n.length||e[63]!==m||e[64]!==_?(k=m("chat.userAskQuestion.questionCount",{current:_,total:n.length}),e[62]=n.length,e[63]=m,e[64]=_,e[65]=k):k=e[65];let P;e[66]!==u?.input?.prompt||e[67]!==m?(P=u?.input?.prompt??m("chat.userAskQuestion.question"),e[66]=u?.input?.prompt,e[67]=m,e[68]=P):P=e[68];const D=c.activeKey,M=c.setActiveKey;let E;if(e[69]!==c.form||e[70]!==n){let $;e[72]!==c.form?($=z=>s.jsx(wn,{value:z.toolCallId,className:"mt-0",children:s.jsx(ft,{input:z.input,control:c.form.control,toolCallId:z.toolCallId})},z.toolCallId),e[72]=c.form,e[73]=$):$=e[73],E=n.map($),e[69]=c.form,e[70]=n,e[71]=E}else E=e[71];let T;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==E?(T=s.jsx(Cn,{value:D,onValueChange:M,children:E}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=E,e[77]=T):T=e[77];let L;e[78]!==b||e[79]!==w||e[80]!==N||e[81]!==k||e[82]!==P||e[83]!==T?(L=s.jsx(ue,{icon:S,label:N,count:k,title:P,defaultExpanded:!0,footerLeft:b,footerRight:w,children:T}),e[78]=b,e[79]=w,e[80]=N,e[81]=k,e[82]=P,e[83]=T,e[84]=L):L=e[84];let U;e[85]!==C||e[86]!==L?(U=s.jsx("form",{onSubmit:C,autoComplete:"off",children:L}),e[85]=C,e[86]=L,e[87]=U):U=e[87];let q;return e[88]!==c.form||e[89]!==U?(q=s.jsx(Ue,{...y,children:U}),e[88]=c.form,e[89]=U,e[90]=q):q=e[90],q}function Xo(t){return!!Yt(t)}function er(t){return t.toolCallId}function tr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function sr(t){return{toolCallId:t.toolCallId,input:t.input}}function nr(){const t=R.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Be,{className:"size-5 text-muted-foreground shimmer"}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=s.jsxs("div",{className:"flex items-center gap-2 p-4 border border-dashed rounded-lg bg-accent/50 w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",children:[n,s.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function qt(t){const e=R.c(7),{userAskParts:n,isStreaming:o,onSubmit:a}=t;let V;e[0]!==n?(V=n.filter(or),e[0]=n,e[1]=V):V=e[1];const r=V;if(r.length===0){if(o){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(nr,{}),e[2]=l):l=e[2],l}return null}let i;return e[3]!==o||e[4]!==a||e[5]!==r?(i=s.jsx(Jo,{parts:r,isStreaming:o,onSubmit:a}),e[3]=o,e[4]=a,e[5]=r,e[6]=i):i=e[6],i}function or(t){return t.state==="input-available"}function rr(t){const e=t.filter(V=>V.status==="in_progress"),n=t.filter(V=>V.status==="completed").length,o=t.length;if(o>0&&n===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[a]=e;return a&&e.length===1?{icon:"in_progress",activity:a.activeForm,progress:`${n}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${n}/${o} done`}:n>0?{icon:"pending",activity:`${o-n} pending`,progress:`${n}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function ar(t){const e=R.c(13),{todos:n}=t;if(n.length===0)return null;let o;e[0]!==n?(o=rr(n),e[0]=n,e[1]=o):o=e[1];const a=o;let V;e[2]!==a.icon?(V=s.jsx(cr,{status:a.icon}),e[2]=a.icon,e[3]=V):V=e[3];const r=a.activity,i=a.progress;let l;e[4]!==n?(l=n.map(Vr),e[4]=n,e[5]=l):l=e[5];let p;e[6]!==l?(p=s.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:l}),e[6]=l,e[7]=p):p=e[7];let d;return e[8]!==a.activity||e[9]!==a.progress||e[10]!==V||e[11]!==p?(d=s.jsx(ue,{icon:V,label:r,count:i,defaultExpanded:!1,children:p}),e[8]=a.activity,e[9]=a.progress,e[10]=V,e[11]=p,e[12]=d):d=e[12],d}function Vr(t,e){return s.jsx(ir,{todo:t},e)}function ir(t){const e=R.c(14),{todo:n}=t,o=n.status==="completed",V=n.status==="in_progress"?n.activeForm:n.content;let r;e[0]!==n.status?(r=s.jsx(lr,{status:n.status}),e[0]=n.status,e[1]=r):r=e[1];const i=o&&"text-muted-foreground";let l;e[2]!==i?(l=O("relative text-sm leading-snug pt-px select-none",i),e[2]=i,e[3]=l):l=e[3];const p=o?"100%":"0%",d=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==p||e[5]!==d?(c=s.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:p,transition:d}}),e[4]=p,e[5]=d,e[6]=c):c=e[6];let u;e[7]!==V||e[8]!==l||e[9]!==c?(u=s.jsxs("span",{className:l,children:[V,c]}),e[7]=V,e[8]=l,e[9]=c,e[10]=u):u=e[10];let m;return e[11]!==r||e[12]!==u?(m=s.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[r,u]}),e[11]=r,e[12]=u,e[13]=m):m=e[13],m}function lr(t){const e=R.c(4),{status:n}=t,o=n==="completed"?"true":void 0,a=n==="in_progress"?"true":void 0;let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("svg",{viewBox:"0 0 21 21",children:s.jsx("path",{d:"M5,10.75 L8.5,14.25 L19.4,2.3 C18.8333333,1.43333333 18.0333333,1 17,1 L4,1 C2.35,1 1,2.35 1,4 L1,17 C1,18.65 2.35,20 4,20 L17,20 C18.65,20 20,18.65 20,17 L20,7.99769186"})}),e[0]=V):V=e[0];let r;return e[1]!==o||e[2]!==a?(r=s.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":a,"aria-hidden":"true",children:V}),e[1]=o,e[2]=a,e[3]=r):r=e[3],r}function cr(t){const e=R.c(13),{status:n}=t,o=G();if(n==="completed"){let r;e[0]!==o?(r=o("chat.todoStatus.completed"),e[0]=o,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("svg",{viewBox:"0 0 10 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",className:"w-2 h-2 text-primary-foreground",style:{strokeWidth:2},children:s.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=i):i=e[2];let l;return e[3]!==r?(l=s.jsx("span",{"aria-label":r,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:i}),e[3]=r,e[4]=l):l=e[4],l}if(n==="in_progress"){let r;e[5]!==o?(r=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=r):r=e[6];let i;return e[7]!==r?(i=s.jsx("span",{"aria-label":r,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=r,e[8]=i):i=e[8],i}let a;e[9]!==o?(a=o("chat.todoStatus.pending"),e[9]=o,e[10]=a):a=e[10];let V;return e[11]!==a?(V=s.jsx("span",{"aria-label":a,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=a,e[12]=V):V=e[12],V}const dr={usd:[{dollars:10,labelKey:"credits.topUp.starter"},{dollars:20,labelKey:"credits.topUp.popular"},{dollars:100,labelKey:"credits.topUp.bestValue"}],brl:[{dollars:50,labelKey:"credits.topUp.starter"},{dollars:100,labelKey:"credits.topUp.popular"},{dollars:500,labelKey:"credits.topUp.bestValue"}]},ur={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function pr(t){const e=R.c(46),{source:n,onDone:o}=t,a=G(),V=cs(),[r]=he(),[i,l]=F.useState(r.language==="pt-BR"?"brl":"usd"),[p,d]=F.useState(""),[c,u]=F.useState(!1),m=i==="brl"?"R$":"$";let h;e[0]!==i||e[1]!==V?(h=async T=>{const{url:L}=await V.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:T,currency:i});return L},e[0]=i,e[1]=V,e[2]=h):h=e[2];let f;e[3]!==o?(f=T=>{T&&window.open(T,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=f):f=e[4];let x;e[5]!==a?(x=T=>{ye.error(a("credits.topUp.failed",{message:T.message}))},e[5]=a,e[6]=x):x=e[6];let b;e[7]!==h||e[8]!==f||e[9]!==x?(b={mutationFn:h,onSuccess:f,onError:x},e[7]=h,e[8]=f,e[9]=x,e[10]=b):b=e[10];const{mutate:g,isPending:v}=ds(b);let A;e[11]!==i||e[12]!==n||e[13]!==g?(A=(T,L)=>{X("credits_topup_clicked",{amount_cents:T,currency:i,tier_label:L,source:n}),g(T)},e[11]=i,e[12]=n,e[13]=g,e[14]=A):A=e[14];const j=A,w=parseFloat(p),y=!isNaN(w)&&w>=1;let C,S,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=T=>{T&&l(T)},S=s.jsx(Vt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),N=s.jsx(Vt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=C,e[16]=S,e[17]=N):(C=e[15],S=e[16],N=e[17]);let _;e[18]!==i?(_=s.jsx("div",{className:"mb-4",children:s.jsxs(En,{type:"single",variant:"outline",size:"sm",value:i,onValueChange:C,children:[S,N]})}),e[18]=i,e[19]=_):_=e[19];const k=dr[i];let P;if(e[20]!==j||e[21]!==m||e[22]!==v||e[23]!==a||e[24]!==k){let T;e[26]!==j||e[27]!==m||e[28]!==v||e[29]!==a?(T=L=>{const{dollars:U,labelKey:q}=L;return s.jsxs("button",{type:"button",disabled:v,onClick:()=>j(U*100,ur[q]??"preset"),className:O("relative flex flex-col items-center gap-1 py-5 rounded-xl border transition-all duration-150 cursor-pointer","disabled:opacity-50 disabled:cursor-wait","border-border hover:border-foreground/20 hover:bg-muted/30"),children:[s.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[m,U]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:a(q)})]},U)},e[26]=j,e[27]=m,e[28]=v,e[29]=a,e[30]=T):T=e[30],P=k.map(T),e[20]=j,e[21]=m,e[22]=v,e[23]=a,e[24]=k,e[25]=P}else P=e[25];let D;e[31]!==P?(D=s.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:P}),e[31]=P,e[32]=D):D=e[32];let M;e[33]!==j||e[34]!==m||e[35]!==p||e[36]!==w||e[37]!==y||e[38]!==v||e[39]!==c||e[40]!==a?(M=c?s.jsxs("div",{className:"flex gap-2 mt-3",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:m}),s.jsx(Mn,{type:"number",min:"1",step:"1",placeholder:a("credits.topUp.customPlaceholder"),value:p,onChange:T=>d(T.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(ee,{className:"h-10",disabled:!y||v,onClick:()=>j(Math.round(w*100),"custom"),children:a(v?"credits.topUp.opening":"credits.topUp.add")})]}):s.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>u(!0),children:a("credits.topUp.enterCustom")}),e[33]=j,e[34]=m,e[35]=p,e[36]=w,e[37]=y,e[38]=v,e[39]=c,e[40]=a,e[41]=M):M=e[41];let E;return e[42]!==D||e[43]!==M||e[44]!==_?(E=s.jsxs("div",{children:[_,D,M]}),e[42]=D,e[43]=M,e[44]=_,e[45]=E):E=e[45],E}const mr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function fr(t){const e=R.c(47),{onDismiss:n}=t,{org:o}=we(),a=Oe(),{decoKeyId:V}=Rn(),r=G(),i=Ce("credits");let l,p;if(e[0]!==o.id?(l=()=>{X("credits_exhausted_shown",{organization_id:o.id})},p=[o.id],e[0]=o.id,e[1]=l,e[2]=p):(l=e[1],p=e[2]),F.useEffect(l,p),!i)return null;let d;e[3]!==n?(d=k=>!k&&n?.(),e[3]=n,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=["radial-gradient(ellipse 40% 200% at -5% 100%, rgba(165,149,255,0.5) 0%, transparent 100%)","radial-gradient(ellipse 40% 200% at 105% -10%, rgba(208,236,26,0.45) 0%, transparent 100%)"],e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{className:"absolute inset-x-0 top-0 h-36 pointer-events-none",style:{backgroundImage:c.join(", "),maskImage:"linear-gradient(to bottom, black 0%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, transparent 100%)"}}),e[6]=u):u=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),e[7]=m):m=e[7];let h;e[8]!==r?(h=r("chat.creditsExhaustedBanner.title"),e[8]=r,e[9]=h):h=e[9];let f;e[10]!==h?(f=s.jsx(Nn,{className:"text-xl font-semibold tracking-tight",children:h}),e[10]=h,e[11]=f):f=e[11];let x;e[12]!==r?(x=r("chat.creditsExhaustedBanner.description"),e[12]=r,e[13]=x):x=e[13];let b;e[14]!==x?(b=s.jsx(Sn,{className:"mt-1.5 text-sm leading-relaxed",children:x}),e[14]=x,e[15]=b):b=e[15];let g;e[16]!==b||e[17]!==f?(g=s.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[u,s.jsxs(kn,{className:"relative gap-4",children:[m,s.jsxs("div",{children:[f,b]})]})]}),e[16]=b,e[17]=f,e[18]=g):g=e[18];let v;e[19]!==V||e[20]!==n||e[21]!==r?(v=V&&s.jsxs("div",{className:"px-8 pt-5 pb-6",children:[s.jsx("div",{className:"rounded-xl border border-border p-5",children:s.jsx(pr,{source:"exhausted_banner",onDone:n})}),s.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:mr.map(k=>s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:s.jsx(Ke,{size:12,className:"text-success"})}),s.jsx("span",{className:"text-sm text-foreground/80",children:r(k)})]},k))})]}),e[19]=V,e[20]=n,e[21]=r,e[22]=v):v=e[22];let A;e[23]!==r?(A=r("chat.creditsExhaustedBanner.dismiss"),e[23]=r,e[24]=A):A=e[24];let j;e[25]!==n||e[26]!==A?(j=s.jsx(ee,{variant:"ghost",size:"sm",onClick:n,children:A}),e[25]=n,e[26]=A,e[27]=j):j=e[27];let w;e[28]!==a||e[29]!==n||e[30]!==o.slug?(w=()=>{a({to:"/$org/settings/ai-providers",params:{org:o.slug}}),n?.()},e[28]=a,e[29]=n,e[30]=o.slug,e[31]=w):w=e[31];let y;e[32]!==r?(y=r("chat.creditsExhaustedBanner.manageProviders"),e[32]=r,e[33]=y):y=e[33];let C;e[34]!==w||e[35]!==y?(C=s.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:w,children:y}),e[34]=w,e[35]=y,e[36]=C):C=e[36];let S;e[37]!==j||e[38]!==C?(S=s.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[j,C]}),e[37]=j,e[38]=C,e[39]=S):S=e[39];let N;e[40]!==g||e[41]!==v||e[42]!==S?(N=s.jsxs(Tn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:hr,children:[g,v,S]}),e[40]=g,e[41]=v,e[42]=S,e[43]=N):N=e[43];let _;return e[44]!==N||e[45]!==d?(_=s.jsx(In,{open:!0,onOpenChange:d,children:N}),e[44]=N,e[45]=d,e[46]=_):_=e[46],_}function hr(t){return t.preventDefault()}const xr={trial_exhausted:{label:"chat.subscriptionLimit.trialLabel",title:"chat.subscriptionLimit.trialTitle"},monthly_exhausted:{label:"chat.subscriptionLimit.monthlyLabel",title:"chat.subscriptionLimit.monthlyTitle"},runs_exhausted:{label:"chat.subscriptionLimit.runsLabel",title:"chat.subscriptionLimit.runsTitle"}};function gr(t){const e=R.c(16),{kind:n,onDismiss:o,onSubscribe:a}=t,V=G(),{label:r,title:i}=xr[n];let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Qe,{size:14}),e[0]=l):l=e[0];let p;e[1]!==r||e[2]!==V?(p=V(r),e[1]=r,e[2]=V,e[3]=p):p=e[3];let d;e[4]!==V||e[5]!==i?(d=V(i),e[4]=V,e[5]=i,e[6]=d):d=e[6];let c;e[7]!==n||e[8]!==a||e[9]!==V?(c=n==="trial_exhausted"?s.jsx(ee,{size:"sm",onClick:a,className:"h-7 text-xs",children:V("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=n,e[8]=a,e[9]=V,e[10]=c):c=e[10];let u;return e[11]!==o||e[12]!==p||e[13]!==d||e[14]!==c?(u=s.jsx(ue,{icon:l,label:p,title:d,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=p,e[13]=d,e[14]=c,e[15]=u):u=e[15],u}const br={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function ht(t){const e=R.c(21),{kind:n,onDismiss:o}=t,a=G(),V=Oe(),{org:r}=we(),{label:i,title:l}=br[n];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Qe,{size:14}),e[0]=p):p=e[0];let d;e[1]!==i||e[2]!==a?(d=a(i),e[1]=i,e[2]=a,e[3]=d):d=e[3];let c;e[4]!==a||e[5]!==l?(c=a(l),e[4]=a,e[5]=l,e[6]=c):c=e[6];let u;e[7]!==V||e[8]!==o||e[9]!==r.slug?(u=()=>{V({to:"/$org/settings/ai-providers",params:{org:r.slug}}),o()},e[7]=V,e[8]=o,e[9]=r.slug,e[10]=u):u=e[10];let m;e[11]!==a?(m=a("chat.planRefused.seePlans"),e[11]=a,e[12]=m):m=e[12];let h;e[13]!==u||e[14]!==m?(h=s.jsx(ee,{size:"sm",className:"h-7 text-xs",onClick:u,children:m}),e[13]=u,e[14]=m,e[15]=h):h=e[15];let f;return e[16]!==o||e[17]!==d||e[18]!==c||e[19]!==h?(f=s.jsx(ue,{icon:p,label:d,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:h}),e[16]=o,e[17]=d,e[18]=c,e[19]=h,e[20]=f):f=e[20],f}function Ht(t){const e=Ar(t);if(e!==null){const p=Ht(e);return{summary:p.summary,rawDetails:p.rawDetails??t}}const n=t.trim(),o=n.startsWith("<")&&/<[a-z][\s\S]*>/i.test(n),a=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(n),V=/failed to fetch|networkerror|load failed|offline/i.test(n),r=/timeout|timed out|aborted|deadline/i.test(n),i=n.length>240,l=/sandbox failed to start(?::\s*(.+))?/is.exec(n);if(l){const p=l[1]?.trim().replace(/\.$/,"");return{summary:p?`Your sandbox didn't finish starting up (${p}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return a||o&&i?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:V?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:r?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||i?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Ar(t){const e=t.trim();if(!e.startsWith("{"))return null;let n;try{n=JSON.parse(e)}catch{return null}if(!n||typeof n!="object")return null;const{error:o,message:a}=n,V=typeof o=="string"?o:a;return typeof V=="string"&&V.trim()&&!V.trim().startsWith("{")?V:null}const vr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Te(t){const e=R.c(29),n=G(),{variant:o,onDismiss:a}=t,V=o==="error";let r;e[0]!==V||e[1]!==n?(r=n(V?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=V,e[1]=n,e[2]=r):r=e[2];const i=r,l=V?mn:ps;let p;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==n?(p=t.variant==="error"?t.error.message:(()=>{const g=vr[t.finishReason];return g?n(g):n("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=n,e[7]=p):p=e[7];const d=p;let c;e[8]!==V||e[9]!==d?(c=V?Ht(d):{summary:d,rawDetails:null},e[8]=V,e[9]=d,e[10]=c):c=e[10];const{summary:u,rawDetails:m}=c;let h;e[11]!==l?(h=s.jsx(l,{size:14}),e[11]=l,e[12]=h):h=e[12];let f;e[13]!==V||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==n?(f=V?s.jsx(ee,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:n("chat.highlight.fixInChat")}):s.jsx(ee,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:n("chat.highlight.continue")}),e[13]=V,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=n,e[17]=f):f=e[17];let x;e[18]!==m||e[19]!==n?(x=m?s.jsxs("details",{className:"group mx-4",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[s.jsx("svg",{"aria-hidden":"true",className:"size-3 transition-transform group-open:rotate-90",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"m4.5 3 3 3-3 3"})}),s.jsx("span",{className:"group-open:hidden",children:n("chat.highlight.showTechnicalDetails")}),s.jsx("span",{className:"hidden group-open:inline",children:n("chat.highlight.hideTechnicalDetails")})]}),s.jsxs("div",{className:"relative mt-2",children:[s.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(m).then(()=>ye.success(n("chat.highlight.copiedToClipboard"))).catch(()=>ye.error(n("chat.highlight.couldNotCopy")))},"aria-label":n("chat.highlight.copyErrorDetails"),title:n("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center classic:rounded-md compact:rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:s.jsx(fn,{className:"size-3.5"})}),s.jsx("pre",{className:"max-h-40 overflow-auto rounded-md border border-border/60 bg-background px-3 py-2 pr-8 font-mono text-xs text-foreground/80 whitespace-pre-wrap break-all",children:m})]})]}):null,e[18]=m,e[19]=n,e[20]=x):x=e[20];let b;return e[21]!==i||e[22]!==a||e[23]!==u||e[24]!==h||e[25]!==f||e[26]!==x||e[27]!==o?(b=s.jsx(ue,{icon:h,label:i,title:u,defaultExpanded:!0,variant:o,onClose:a,footerRight:f,children:x}),e[21]=i,e[22]=a,e[23]=u,e[24]=h,e[25]=f,e[26]=x,e[27]=o,e[28]=b):b=e[28],b}function Me(){const t=R.c(78),e=G(),{error:n,clearError:o,finishReason:a,clearFinishReason:V,messages:r,isStreaming:i,submit:l,sendMessage:p}=Ge(),[d,c]=he(),{virtualMcpId:u,createTaskWithMessage:m}=Ws(),{chatMode:h,simpleModeTier:f}=_e(),x=Ce("credits"),{mutate:b}=zn("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let g;t[0]!==b?(g=()=>b(),t[0]=b,t[1]=g):g=t[1];const v=g;let A;t[2]!==h||t[3]!==f||t[4]!==u?(A=oe=>({tier:f,mode:h,toolApprovalLevel:oe,agent:u?{id:u}:void 0}),t[2]=h,t[3]=f,t[4]=u,t[5]=A):A=t[5];const j=A;let w;t[6]!==d.toolApprovalLevel?(w=d.toolApprovalLevel??us(),t[6]=d.toolApprovalLevel,t[7]=w):w=t[7];const y=w,C=r.at(-1),S=C?.role==="assistant"?C.parts:[],N=S.filter(Cr),_=Ft(S),k=Et(S);let P;t[8]!==n||t[9]!==p||t[10]!==e?(P=()=>{if(n){const le={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.fixInChatMessage",{error:n.message})}]}]};p(le)}},t[8]=n,t[9]=p,t[10]=e,t[11]=P):P=t[11];const D=P;let M;t[12]!==p||t[13]!==e?(M=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:e("chat.highlight.pleaseContinue")}]}]};p(oe)},t[12]=p,t[13]=e,t[14]=M):M=t[14];const E=M;let T;t[15]!==j||t[16]!==y||t[17]!==l?(T=(oe,le)=>{l({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:le}},j(y))},t[15]=j,t[16]=y,t[17]=l,t[18]=T):T=t[18];const L=T;let U;t[19]!==m||t[20]!==d||t[21]!==c||t[22]!==e||t[23]!==u?(U=oe=>{c({...d,toolApprovalLevel:"auto"}),m({virtualMcpId:u,message:{parts:[{type:"text",text:e("chat.highlight.implementPlanMessage",{plan:oe})}]}})},t[19]=m,t[20]=d,t[21]=c,t[22]=e,t[23]=u,t[24]=U):U=t[24];const q=U,$=wr;let z;t[25]!==j||t[26]!==l?(z=(oe,le,ve,Ee)=>{l({kind:"approval",approvalId:oe,approved:le,...ve?{reason:ve}:{}},j(Ee))},t[25]=j,t[26]=l,t[27]=z):z=t[27];const Q=z,B=zt();if(B.isCreditExhausted){let oe;return t[28]!==x||t[29]!==o?(oe=x?s.jsx(fr,{onDismiss:o}):s.jsx("div",{className:"absolute bottom-full left-0 right-0",children:s.jsx(ht,{kind:"ai_budget_exhausted",onDismiss:o})}),t[28]=x,t[29]=o,t[30]=oe):oe=t[30],oe}const{showError:te,showWarning:J,hasApprovals:I}=B,Y=N.map(yr).join("|"),H=Lt(_)?.toolCallId??"",Z=k.map(jr).join("|");let W;t[31]!==B.todos?(W=s.jsx(ar,{todos:B.todos}),t[31]=B.todos,t[32]=W):W=t[32];let se;t[33]!==o||t[34]!==B.subscriptionErrorKind||t[35]!==v?(se=B.subscriptionErrorKind&&s.jsx(gr,{kind:B.subscriptionErrorKind,onDismiss:o,onSubscribe:v}),t[33]=o,t[34]=B.subscriptionErrorKind,t[35]=v,t[36]=se):se=t[36];let ae;t[37]!==o||t[38]!==B.planRefusal?(ae=B.planRefusal&&s.jsx(ht,{kind:B.planRefusal,onDismiss:o}),t[37]=o,t[38]=B.planRefusal,t[39]=ae):ae=t[39];let Ve;t[40]!==o||t[41]!==n||t[42]!==D||t[43]!==te?(Ve=te&&s.jsx(Te,{variant:"error",error:n,onDismiss:o,onFixInChat:D}),t[40]=o,t[41]=n,t[42]=D,t[43]=te,t[44]=Ve):Ve=t[44];let ne;t[45]!==V||t[46]!==a||t[47]!==E||t[48]!==J?(ne=J&&s.jsx(Te,{variant:"warning",finishReason:a,onDismiss:V,onContinue:E}),t[45]=V,t[46]=a,t[47]=E,t[48]=J,t[49]=ne):ne=t[49];let ie;t[50]!==Z||t[51]!==Q||t[52]!==I||t[53]!==i||t[54]!==k?(ie=I&&s.jsx($o,{approvals:k,isStreaming:i,onRespond:Q},Z),t[50]=Z,t[51]=Q,t[52]=I,t[53]=i,t[54]=k,t[55]=ie):ie=t[55];let re;t[56]!==B.hasPlans||t[57]!==q||t[58]!==$||t[59]!==i||t[60]!==_||t[61]!==H?(re=B.hasPlans&&s.jsx(Ko,{plans:_,isStreaming:i,onApprove:q,onDismiss:$},H),t[56]=B.hasPlans,t[57]=q,t[58]=$,t[59]=i,t[60]=_,t[61]=H,t[62]=re):re=t[62];let ce;t[63]!==B.isWaitingForUserInput||t[64]!==L||t[65]!==i||t[66]!==Y||t[67]!==N?(ce=B.isWaitingForUserInput&&s.jsx(qt,{userAskParts:N,isStreaming:i,onSubmit:L},Y),t[63]=B.isWaitingForUserInput,t[64]=L,t[65]=i,t[66]=Y,t[67]=N,t[68]=ce):ce=t[68];let Ae;return t[69]!==ae||t[70]!==Ve||t[71]!==ne||t[72]!==ie||t[73]!==re||t[74]!==ce||t[75]!==W||t[76]!==se?(Ae=s.jsxs("div",{className:"absolute bottom-full left-0 right-0",children:[W,se,ae,Ve,ne,ie,re,ce]}),t[69]=ae,t[70]=Ve,t[71]=ne,t[72]=ie,t[73]=re,t[74]=ce,t[75]=W,t[76]=se,t[77]=Ae):Ae=t[77],Ae}function jr(t){return t.approvalId}function yr(t){return t.toolCallId}function wr(){document.querySelector("[data-chat-input]")?.focus()}function Cr(t){return t.type==="tool-user_ask"}Me.Error=function(e){return s.jsx(Te,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};Me.Warning=function(e){return s.jsx(Te,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};Me.UserAskQuestion=qt;function Nr(t){const e=R.c(20),{taskId:n}=t,o=G(),a=Zs(n),V=Js(a),r=Xs(),{stop:i,removeLocalMessage:l}=Ge();if(V.length===0)return null;let p;e[0]!==o?(p=o("chat.queueTray.sendNow"),e[0]=o,e[1]=p):p=e[1];let d;e[2]!==i?(d=()=>{i()},e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(jt,{size:14}),e[4]=c):c=e[4];let u;e[5]!==p||e[6]!==d?(u=s.jsx(De,{asChild:!0,children:s.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm","aria-label":p,onClick:d,children:c})}),e[5]=p,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==o?(m=o("chat.queueTray.sendNow"),e[8]=o,e[9]=m):m=e[9];let h;e[10]!==m?(h=s.jsx(Pe,{side:"top",children:s.jsx("p",{className:"text-xs",children:m})}),e[10]=m,e[11]=h):h=e[11];let f;e[12]!==u||e[13]!==h?(f=s.jsxs(Re,{delayDuration:400,children:[u,h]}),e[12]=u,e[13]=h,e[14]=f):f=e[14];let x;return e[15]!==r||e[16]!==l||e[17]!==o||e[18]!==n?(x=(b,g)=>s.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[s.jsx("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full bg-muted text-[10px] font-semibold text-muted-foreground dark:bg-background",children:g+1}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:b.text}),s.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:s.jsx(ee,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{r.cancel(n,b.messageId).then(v=>{v&&(en(n,b.messageId),l(b.messageId))})},children:s.jsx(Un,{className:"size-3.5"})})})]},b.messageId),e[15]=r,e[16]=l,e[17]=o,e[18]=n,e[19]=x):x=e[19],s.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border py-1.5 pr-2 pl-3 text-xs text-muted-foreground",children:[s.jsx("span",{children:o(V.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:V.length})}),f]}),V.map(x)]})}function Sr(t,e){return t?{modelId:t.modelId,title:t.title??t.modelId,keyId:t.keyId,providerId:e,description:null,logo:null,capabilities:[],limits:null,costs:null}:null}const kr={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function Tr(t){const e=R.c(31),{tier:n,orgSlot:o,userSlot:a,autoSlot:V,onPick:r,onReset:i,onClose:l}=t,p=G(),d=Pt(),c=new Set(d.map(Ir)),u=tn([a,o,V],c),m=u?.keyId??null,[h,f]=F.useState(m??d[0]?.id??null),x=d.some(L=>L.id===h)?h:m??d[0]?.id??null,b=x?d.find(L=>L.id===x):null,g="flex h-[70vh] max-h-[460px] w-full flex-col",v=kr[n];let A;e[0]!==p||e[1]!==v?(A=p(v),e[0]=p,e[1]=v,e[2]=A):A=e[2];let j;e[3]!==A?(j=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=j):j=e[4];let w;e[5]!==i||e[6]!==p||e[7]!==a?(w=a&&s.jsx("button",{type:"button",onClick:i,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 classic:rounded-md compact:rounded-lg hover:bg-accent cursor-pointer",children:p("chat.modelPreferences.reset")}),e[5]=i,e[6]=p,e[7]=a,e[8]=w):w=e[8];let y;e[9]!==j||e[10]!==w?(y=s.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[j,w]}),e[9]=j,e[10]=w,e[11]=y):y=e[11];const C="flex-1 min-h-0",S=F.Suspense;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Bn,{}),e[12]=N):N=e[12];const _=Jn,k=!0,P=Sr(m?u:null,b?.providerId??"deco");let D;e[13]!==x||e[14]!==r||e[15]!==f?(D=L=>{const U=L.keyId??x??"";f(U),r({keyId:U,modelId:L.modelId,title:L.title})},e[13]=x,e[14]=r,e[15]=f,e[16]=D):D=e[16];let M;e[17]!==_||e[18]!==x||e[19]!==l||e[20]!==f||e[21]!==P||e[22]!==D?(M=s.jsx(_,{compact:k,onClose:l,credentialId:x,onCredentialChange:f,selectedModel:P,onModelChange:D}),e[17]=_,e[18]=x,e[19]=l,e[20]=f,e[21]=P,e[22]=D,e[23]=M):M=e[23];let E;e[24]!==S||e[25]!==M||e[26]!==N?(E=s.jsx("div",{className:C,children:s.jsx(S,{fallback:N,children:M})}),e[24]=S,e[25]=M,e[26]=N,e[27]=E):E=e[27];let T;return e[28]!==E||e[29]!==y?(T=s.jsxs("div",{className:g,children:[y,E]}),e[28]=E,e[29]=y,e[30]=T):T=e[30],T}function Ir(t){return t.id}const _r=["fast","smart","thinking"];function Wt(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const xt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function Dr(t){const e=R.c(28),{tier:n,pillIcon:o,groups:a}=t,V=G();let r;e[0]!==V?(r=Wt(V),e[0]=V,e[1]=r):r=e[1];const i=r,[l,p]=F.useState(!1);let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=C=>{C.onSelect(),p(!1)},e[2]=d):d=e[2];const c=d,u=i[n];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=m):m=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),e[4]=h):h=e[4];const f=i[n];let x;e[5]!==f?(x=s.jsx("span",{className:h,children:f}),e[5]=f,e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Tt,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=b):b=e[7];let g;e[8]!==o||e[9]!==u||e[10]!==x?(g=s.jsx(De,{asChild:!0,children:s.jsx("span",{className:"inline-flex min-w-0 shrink",children:s.jsx(It,{asChild:!0,children:s.jsxs(ee,{type:"button",variant:"ghost",size:"default","aria-label":u,className:m,children:[o,x,b]})})})}),e[8]=o,e[9]=u,e[10]=x,e[11]=g):g=e[11];let v;e[12]!==u?(v=s.jsx(Pe,{children:u}),e[12]=u,e[13]=v):v=e[13];let A;e[14]!==g||e[15]!==v?(A=s.jsxs(Re,{children:[g,v]}),e[14]=g,e[15]=v,e[16]=A):A=e[16];let j;if(e[17]!==a||e[18]!==V){let C;e[20]!==V?(C=S=>s.jsx("div",{className:"flex flex-col",children:S.rows.map(N=>s.jsxs("div",{className:"group/tier-row relative flex items-stretch classic:rounded-md compact:rounded-lg hover:bg-muted",children:[s.jsxs("button",{type:"button",role:"menuitem","aria-label":N.title,onClick:()=>c(N),className:O("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",N.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[N.icon&&s.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:N.icon}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm",children:N.title}),N.subtitle&&s.jsx("div",{className:"text-xs text-muted-foreground",children:N.subtitle})]}),N.active&&s.jsx("span",{title:V("chat.tierTrigger.selected"),children:s.jsx(Ke,{size:14,className:"text-foreground mt-0.5"})})]}),N.modelOverride&&s.jsx(Rr,{label:N.title,render:N.modelOverride})]},N.key))},S.key),e[20]=V,e[21]=C):C=e[21],j=a.map(C),e[17]=a,e[18]=V,e[19]=j}else j=e[19];let w;e[22]!==j?(w=s.jsx(_t,{align:"end",className:"p-1 w-64",onOpenAutoFocus:Pr,children:s.jsx("div",{role:"menu",className:"flex flex-col",children:j})}),e[22]=j,e[23]=w):w=e[23];let y;return e[24]!==l||e[25]!==A||e[26]!==w?(y=s.jsxs(Dt,{open:l,onOpenChange:p,children:[A,w]}),e[24]=l,e[25]=A,e[26]=w,e[27]=y):y=e[27],y}function Pr(t){return t.preventDefault()}function Rr(t){const e=R.c(38),{label:n,render:o}=t,a=G(),V=qn(),[r,i]=F.useState(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>i(!1),e[0]=l):l=e[0];const p=l;let d;e[1]!==n||e[2]!==a?(d=a("chat.modelPreferences.customizeModel",{tier:n}),e[1]=n,e[2]=a,e[3]=d):d=e[3];const c=r&&"opacity-100";let u;e[4]!==c?(u=O("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 classic:rounded-md compact:rounded-lg bg-background border border-border/60 shadow-sm","text-muted-foreground hover:text-foreground","opacity-100 [@media(hover:hover)]:opacity-0","[@media(hover:hover)]:group-hover/tier-row:opacity-100","[@media(hover:hover)]:group-focus-within/tier-row:opacity-100",c),e[4]=c,e[5]=u):u=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ks,{size:14}),e[6]=m):m=e[6];let h;e[7]!==d||e[8]!==u?(h=s.jsx("button",{type:"button","aria-label":d,className:u,children:m}),e[7]=d,e[8]=u,e[9]=h):h=e[9];const f=h;if(V){let A;e[10]!==f?(A=s.jsx(Kn,{asChild:!0,children:f}),e[10]=f,e[11]=A):A=e[11];let j;e[12]!==n||e[13]!==a?(j=a("chat.modelPreferences.customizeModel",{tier:n}),e[12]=n,e[13]=a,e[14]=j):j=e[14];let w;e[15]!==j?(w=s.jsx(Qn,{className:"sr-only",children:j}),e[15]=j,e[16]=w):w=e[16];let y;e[17]!==r||e[18]!==o?(y=r&&o(p),e[17]=r,e[18]=o,e[19]=y):y=e[19];let C;e[20]!==y||e[21]!==w?(C=s.jsxs(Yn,{className:"p-0 flex flex-col max-h-[95vh]",children:[w,y]}),e[20]=y,e[21]=w,e[22]=C):C=e[22];let S;return e[23]!==r||e[24]!==C||e[25]!==A?(S=s.jsxs(Gn,{open:r,onOpenChange:i,children:[A,C]}),e[23]=r,e[24]=C,e[25]=A,e[26]=S):S=e[26],S}let x;e[27]!==f?(x=s.jsx(It,{asChild:!0,children:f}),e[27]=f,e[28]=x):x=e[28];let b;e[29]!==r||e[30]!==o?(b=r&&o(p),e[29]=r,e[30]=o,e[31]=b):b=e[31];let g;e[32]!==b?(g=s.jsx(_t,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:b}),e[32]=b,e[33]=g):g=e[33];let v;return e[34]!==r||e[35]!==x||e[36]!==g?(v=s.jsxs(Dt,{open:r,onOpenChange:i,children:[x,g]}),e[34]=r,e[35]=x,e[36]=g,e[37]=v):v=e[37],v}function gt(t){return t==="fast"?s.jsx(Qe,{size:16}):t==="thinking"?s.jsx(Os,{size:16}):s.jsx(Hn,{size:16})}function Mr(t){const e=R.c(13),n=on();let o;e[0]!==t||e[1]!==n.tiers?(o=p=>{const d=n.tiers[p];return d?d.title??d.modelId:t.chat[p]?.title},e[0]=t,e[1]=n.tiers,e[2]=o):o=e[2];const a=o;let V;e[3]!==a?(V=a("fast"),e[3]=a,e[4]=V):V=e[4];let r;e[5]!==a?(r=a("smart"),e[5]=a,e[6]=r):r=e[6];let i;e[7]!==a?(i=a("thinking"),e[7]=a,e[8]=i):i=e[8];let l;return e[9]!==V||e[10]!==r||e[11]!==i?(l={fast:V,smart:r,thinking:i},e[9]=V,e[10]=r,e[11]=i,e[12]=l):l=e[12],l}function Er(){const t=R.c(23),e=G(),{simpleModeTier:n,setSimpleModeTier:o}=_e(),a=Wn(),V=Pt(),r=Zn(V),i=Mr(r),{data:l,error:p}=sn();let d;t[0]!==l?(d=l===void 0?{tiers:{}}:l,t[0]=l,t[1]=d):d=t[1];const c=d,u=nn(),m=Ce("model_choice"),h=_n(),f=Dn();if(!h||!m)return null;let x,b;if(t[2]!==r||t[3]!==f||t[4]!==a||t[5]!==o||t[6]!==e||t[7]!==n||t[8]!==i||t[9]!==u||t[10]!==c||t[11]!==p){const w=Wt(e);x="decopilot",b=_r.map(y=>{const C=i[y],S=c.tiers[y];return{key:`decopilot-${y}`,icon:gt(y),title:w[y],subtitle:f?C??e(xt[y]):e(xt[y]),active:n===y,onSelect:()=>o(y),modelOverride:f?N=>s.jsxs(s.Fragment,{children:[p&&s.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),s.jsx(Tr,{tier:y,orgSlot:a.tiers[y],userSlot:S,autoSlot:r.chat[y],onClose:N,onPick:_=>u.mutate({tier:y,slot:_}),onReset:()=>u.mutate({tier:y,slot:null})},`${y}:${S?.keyId??"org"}:${S?.modelId??""}`)]}):void 0}}),t[2]=r,t[3]=f,t[4]=a,t[5]=o,t[6]=e,t[7]=n,t[8]=i,t[9]=u,t[10]=c,t[11]=p,t[12]=x,t[13]=b}else x=t[12],b=t[13];let g;t[14]!==x||t[15]!==b?(g=[{key:x,rows:b}],t[14]=x,t[15]=b,t[16]=g):g=t[16];const v=g;let A;t[17]!==n?(A=gt(n),t[17]=n,t[18]=A):A=t[18];let j;return t[19]!==v||t[20]!==A||t[21]!==n?(j=s.jsx(Dr,{tier:n,pillIcon:A,groups:v}),t[19]=v,t[20]=A,t[21]=n,t[22]=j):j=t[22],j}function Zt(t){const e=R.c(3),[n]=he();let o;return e[0]!==n.enableSounds||e[1]!==t?(o=()=>{n.enableSounds&&lo(t.dataUri).catch(V=>{console.warn(`[sound] ${t.name} playback failed:`,V)})},e[0]=n.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const Lr={name:"switch-005",dataUri:"data:audio/mpeg;base64,SUQzBAAAAAAAIlRTU0VAAAAOAAADTGF2ZjYyLjMuMTAwAAAAAAAAAAAAAAD/+1DAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABkAABU4ABMTEx0dHR0nJycnMTExMTs7OztERERETk5OTlhYWFhiYmJibGxsbHZ2dnZ/f39/iYmJiZOTk5OdnZ2dp6enp7GxsbG7u7u7xMTExM7Ozs7Y2NjY4uLi4uzs7Oz29vb2/////wAAAABMYXZjNjIuMTEAAAAAAAAAAAAAAAAkBVYAAAAAAAAVOPCP8KUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//tQxAAACEwDXvQRAAG8Ii93HtACUCAABAKCJwfaCEHwfeoEAQdEAYygIHBOCAIAgCAJh9QIOg+D5/ygPh/wfB8DuKAgCHyn9QPh/5SCDv+CEHAQdxOD4B27c39tbckkqYbBAYAN9bNJLB+aXAf5wQAKdzxfbmrVIRQ4xNx3HwnoDmLhfMhgJiiw/HREXNCHqjvHEPEG8QjBYlxQNepJAT0kC8ip6JzSWj1TasoG+iyycbf2Uil1ovf1f/oUtR1qP+s1WSBFKoAAU02BDjMhuP/7UsQEgws8bRpd8YABJYPeBf9wCGXTGxBYcw5AJFMFMAmQQAhGAxgLBgHIAMYAAALhgAchipbe/91aU1VV4zcZj1Vf1XgYCIMBNrsBAIGs9/Ue4i/xFPeqCqwViI9/UeLf///rOngdA3OPHFjmOBv+EQnGahgaZxVplmkAH5JadDTQlNCEuGNiWYbCCONWdUJg6HXNazFdu1T+VgaEpOP70exv7f2/4b/yH//2/4cqCX/zWRUrIw+IPNMNlDnjAXQas/I4AzmYifA0tMSCgQDF//tSxBCDSzzi3k/sQwEyCtjJ/rBZAk+Uqj1YhA5YMCAAMwgOUchTkK7OR7LbMl0W1H6SvzG0Q2ZzfKUhnmTobv9DNhS1v7P8h//8Gv8gTRt1jReZ7YEjmMQg9hhwwMycHooasFmZyjcZGBKJD+IwbMCQQLoi+IQXCcIoydKoilI2MWFS5uJdDEu2taRrYI2ZSqKY50pJLv2NfjUAAuQAMfqVQ/T3PDQgMJMeEZ45hJzY6MNoFMxqTj1zNGQKJjAxEsSCBgQJBSIL0mcKYQJfVAn/+1LEGwLKlEKrD3MiYcuMkVa/wABB8Vh6M1q1epbvXwWBURhkyEhWZ/////////////9gjZ/Wt4w+4MNMCpE4TBYQl4w1IHvMDdA2zBngBMwc8COMDhCpDAfgOAAgrBgNYU+YC0FBGAkAMpgWoSCYAGESGBGAKBgXgJOdiOJmMCmNwCYNDJhYRPykRCJhTBnEUzlsjv4UNLj/z97n3Mv/7z1nZqyitYAZIqErIwMwJAqEw0GAAMFptJMaqFwB8CQIWlhuhuDAwNjfuwrQFAYXCf/7UsQVAA+9PTP42gYRdiIu9zBwAPbFUCi0DAhgNcS+7cDwVgM05A9bUDeuQMyE/u3CygVISgZhpIau/9PhdQG2C9DpxZZJmn/dn/Psmt0EFm////l84ThUTopE4VD/9JkubOGasTvN30C20G21qgUCkVCoUCgPMywrPCGly27V5q5t24vl/8jSlSAPCxzNseNCw3oh3NGBu4BZJ5hv7DRSfR/+eWG7nA8IKh2Olv5iz3q5m3//Joxo3JqNyYkSuGt/k6D4DeoBOHmHdl0dkZYA//tSxAUAC4B1Z/2DADEcA17Z/uhI4Yoik/TrZo+ww7UtmpW4LDWu2IacoJKJJeTSM+ZmAYBEiU+ZnnAwCn1VVVV6JUJQVnioKhrgqdKgqGpUFeCp0sDR3ztQNREDRUFioKuxKCpYGQBlRIBk+aLwb8KblGQVDdphPYTUdBOGbVpAaTF6ZdjEV0iRUZRCYkA4oUQDx5zqDugtXvza/7fuNNvfZ+j9v+T/2f//J/4cAAOTpE5K4zksR9MfIB+TDcQTI4gNs1XKAzEFUrGkxABYEBb/+1LEEYNKrEjgT/TCwYYVmUX+mHoKgWhKU5Eiw9SFIRmppw+3fYo4siPhUFeexM8KgIO6wVuPDDy01qeRaVbw357//y3+o8M0pBNlNLCGBzGKwyYw2IIFOE1WNTjRM6x8MlA1AxDhUHTAkEiyKpnbWrLcaOBotBUKbk1pypcWDAIK00AhKLGkUco6q9VWvM53mcaq3tVa8zjTM/tX//EDP//////////XAAmrwAAPoKwcw0ShDCZD/BQlhzinxQdorsOuXTEIC01ZkJyu4k/qPP/7UsQUAEjkrrkvZaPBIRXUoe5QObfMhYKX9RVgTPqCSCaSCaSC0XVdV1f/////6IAlguuAJSiDRNloNBsZg+0+Ts8MMCn81WUTRAlIi+GHECD0y8AWDIqswYsxGOSKVV7MqOni8tkVOip0fZX/////9HrMCbAz2EHGS4GKAAiRAAAYAcDdKd4G6Z/nwYgJ0ZAIgZyC8aPAs/iPBhwMpWDQNARltNS5Y61v//9i8Yl4SkFkIGTkAc0UBrIYLPA4MYBEy+YLMRuY4nhTC3hZA68H//tSxCoAyQC6mY6CkWDJBIsBz/QUrgNmahSzcrYw0/HhfnMAZBojDsgTFkDR5MDkG/DZEbk2FCmowqdqv2TYABiJwqqYjaQRGZ1URZ1DhSsdiHX/GBu0QpzIBNSaLqZ0ARkwFARxMrpt/Eh47mbQAhhU6sisFUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LESoHHJCRaj/dmYAIAQAAQAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsSLg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7UsShg8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVX/+1LEoYPAAAGkAAAAIAAANIAAAARVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//tSxKGDwAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",duration:.609,format:"mp3",license:"CC0",author:"Kenney"},Fr=_s.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),zr=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function Ur(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1.5",children:zr.map(Br)}),t[0]=e):e=t[0],e}function Br(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function $r({disabled:t,onOpenConnections:e,virtualMcpId:n,selectedModel:o,isStreaming:a,onUnsupportedFile:V}){const r=G(),[i,l]=F.useState(!1),p=Zt(Lr),{org:d}=we(),{editor:c}=At(),u=F.useRef(null),m=Ze(o),h=()=>{!m||a||(l(!1),u.current?.click())},f=async I=>{const Y=I.target.files;if(!Y||Y.length===0||!c)return;const H=Array.from(Y);try{let Z=c.state.selection.from;for(const W of H)await Rt(c,o??null,W,Z,V,r),Z=c.state.selection.to}finally{u.current&&(u.current.value="")}},x=ro({connectionId:n,orgId:d.id,orgSlug:d.slug}),b=ms.virtualMcpPrompts(n,d.id),{data:g,isLoading:v}=fs({queryKey:b,queryFn:()=>ao(x),staleTime:6e4,enabled:i&&!!x}),A=g?.prompts??[],[j,w]=F.useState(null),{chatMode:y,setChatMode:C}=_e(),[S,N]=he(),_=me.find(I=>I.value===S.toolApprovalLevel)??me[0],k=r(_.shortKey),P=I=>{const Y=me.find(H=>H.value===I);if(Y){if(Y.value===S.toolApprovalLevel){l(!1);return}p(),X("chat_approval_level_changed",{from_level:S.toolApprovalLevel,to_level:Y.value,source:"tools_popover"}),N({...S,toolApprovalLevel:Y.value}),l(!1)}},D=y==="plan",M=()=>{p();const I=D?"default":"plan";X("chat_mode_changed",{from_mode:y,to_mode:I,source:"tools_popover"}),C(I),l(!1)},E=()=>{e(),l(!1)},T=async(I,Y)=>{if(!c||!x)return;const H=it(I._meta),Z={from:c.state.selection.from,to:c.state.selection.to};try{const W=await Vo(x,I.name,Y);Is(c,Z,{id:I.name,name:oo(I.name,H),metadata:W.messages,char:"/",kind:"prompt",args:Y})}catch{ye.error(r("chat.toolsPopover.failedLoadPrompt"))}},L=async I=>{l(!1);const Y=!!(I.arguments&&I.arguments.length>0);if(X("chat_prompt_inserted",{prompt_name:I.name,with_arguments:Y}),Y){w(I);return}await T(I)},U=async I=>{j&&(await T(j,I),w(null))},q=()=>{p();const I=y==="gen-image"?"default":"gen-image";X("chat_mode_changed",{from_mode:y,to_mode:I,source:"tools_popover"}),C(I),l(!1)},$=()=>{p();const I=y==="web-search"?"default":"web-search";X("chat_mode_changed",{from_mode:y,to_mode:I,source:"tools_popover"}),C(I),l(!1)},z=()=>{p();const I=y==="deep-research"?"default":"deep-research";X("chat_mode_changed",{from_mode:y,to_mode:I,source:"tools_popover"}),C(I),l(!1)},Q=y==="gen-image",B=y==="web-search",te=y==="deep-research",J=s.jsx("input",{ref:u,type:"file",multiple:!0,accept:$n(o??null),className:"hidden",onChange:f,disabled:a});return s.jsxs(s.Fragment,{children:[J,s.jsxs(hs,{open:i,onOpenChange:I=>{I&&!i&&X("chat_tools_popover_opened",{chat_mode:y}),l(I)},children:[s.jsx(xs,{asChild:!0,children:s.jsxs(ee,{type:"button",variant:"ghost",size:"default",disabled:t,title:r("chat.toolsPopover.tools"),"aria-label":r("chat.toolsPopover.tools"),className:O("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[s.jsx(Qs,{size:14}),s.jsx("span",{className:O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0","@[320px]/chat-bottom:max-w-24 @[320px]/chat-bottom:opacity-100"),children:r("chat.toolsPopover.tools")})]})}),s.jsxs(gs,{align:"start",className:"w-56 p-1.5 space-y-1",children:[m?s.jsxs(pe,{onClick:h,disabled:a,children:[s.jsx(lt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]}):s.jsxs(Re,{children:[s.jsx(De,{asChild:!0,children:s.jsxs(pe,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:I=>I.preventDefault(),children:[s.jsx(lt,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.addFile")})]})}),s.jsx(Pe,{side:"right",children:r("chat.toolsPopover.modelNoFileSupport")})]}),s.jsxs(pe,{onClick:M,className:O(D&&"text-special"),children:[s.jsx(wt,{size:16,className:O(D&&"text-special")}),s.jsx("span",{className:"flex-1 whitespace-nowrap",children:r("chat.toolsPopover.planMode")}),s.jsx("span",{className:O("text-xs text-muted-foreground",D&&"text-special font-medium"),children:Fr})]}),s.jsxs(pe,{onClick:q,className:O(Q&&"text-special"),children:[s.jsx(St,{size:16,className:O(Q&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.createImage")}),Q&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(pe,{onClick:$,className:O(B&&"text-special"),children:[s.jsx(Ct,{size:16,className:O(B&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.webSearch")}),B&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(pe,{onClick:z,className:O(te&&"text-special"),children:[s.jsx(Nt,{size:16,className:O(te&&"text-special")}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.deepResearch")}),te&&s.jsx("span",{className:"text-xs text-special font-medium",children:r("chat.toolsPopover.on")})]}),s.jsxs(nt,{children:[s.jsxs(ot,{className:"gap-2",children:[s.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.prompts")})]}),s.jsx(rt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:v?s.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[s.jsx(bs,{className:"size-3.5"}),r("chat.toolsPopover.loadingPrompts")]}):A.length===0?s.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:r("chat.toolsPopover.noPromptsAvailable")}):A.map(I=>s.jsxs(pe,{onClick:()=>L(I),className:"flex flex-col items-start gap-0.5",children:[s.jsx("span",{className:"font-medium text-sm capitalize",children:I.title||no(I.name,it(I._meta))}),I.description&&s.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:I.description})]},I.name))})]}),s.jsxs(nt,{children:[s.jsxs(ot,{className:"gap-2",children:[s.jsx(Ie,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.approval")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),s.jsx(rt,{className:"w-48 p-1.5",children:s.jsx(As,{value:S.toolApprovalLevel,onValueChange:P,children:me.map(I=>s.jsx(vs,{value:I.value,children:r(I.labelKey)},I.value))})})]}),s.jsxs(pe,{onClick:E,children:[s.jsx(io,{size:16}),s.jsx("span",{className:"flex-1",children:r("chat.toolsPopover.connections")}),s.jsx(F.Suspense,{children:s.jsx(Ur,{})})]})]})]}),s.jsx(Ts,{prompt:j,setPrompt:w,onSubmit:U})]})}const Or=[{src:"/connections/github.png",name:"GitHub"},{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/linear.png",name:"Linear"},{src:"/connections/shopify.png",name:"Shopify"},{src:"/connections/firecrawl.png",name:"Firecrawl"},{src:"/connections/perplexity.png",name:"Perplexity"}];function Kr(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex items-center -space-x-1",children:Or.map(Qr)}),t[0]=e):e=t[0],e}function Qr(t){return s.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function Yr(t){const e=R.c(10),{onClick:n}=t,o=G();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=O("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=a):a=e[0];let V;e[1]!==o?(V=o("chat.connectionsBanner.description"),e[1]=o,e[2]=V):V=e[2];let r;e[3]!==V?(r=s.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:V}),e[3]=V,e[4]=r):r=e[4];let i,l;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Kr,{}),l=s.jsx(js,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=i,e[6]=l):(i=e[5],l=e[6]);let p;return e[7]!==n||e[8]!==r?(p=s.jsxs("button",{type:"button",onClick:n,className:a,children:[r,i,l]}),e[7]=n,e[8]=r,e[9]=p):p=e[9],p}const je=48;function Gr(){const t=R.c(9),[e,n]=F.useState("idle"),[o,a]=F.useState(""),[V,r]=F.useState(""),[i,l]=F.useState(Wr),p=F.useRef(null),d=F.useRef(null),c=F.useRef(null),u=F.useRef(null),m=F.useRef(0),h=F.useRef(!1),f=F.useRef(""),x=F.useRef(""),b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let g;t[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m.current&&(cancelAnimationFrame(m.current),m.current=0),d.current?.close().catch(Hr),u.current?.getTracks().forEach(qr),c.current=null,d.current=null,u.current=null},t[0]=g):g=t[0];const v=g;let A;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const _=k=>{u.current=k;const P=new AudioContext;d.current=P;const D=P.createMediaStreamSource(k),M=P.createAnalyser();M.fftSize=128,M.smoothingTimeConstant=.8,D.connect(M),c.current=M;const E=new Uint8Array(M.frequencyBinCount),T=()=>{if(!c.current)return;c.current.getByteFrequencyData(E);const L=[];for(let U=0;U<je;U++){const q=Math.floor(U/je*E.length);L.push(Math.max(.04,(E[q]??0)/255))}l(L),m.current=requestAnimationFrame(T)};T()};A=async()=>{const k=window.SpeechRecognition||window.webkitSpeechRecognition;if(!k)return n("unsupported"),"unsupported";let P;try{P=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return n("permission-denied"),"permission-denied"}a(""),r(""),x.current="",f.current="",h.current=!0,n("recording"),_(P);const D=new k;p.current=D,D.interimResults=!0,D.continuous=!0,D.lang=navigator.language||"en-US",D.onresult=M=>{if(p.current!==D)return;let E="",T="";for(let L=M.resultIndex;L<M.results.length;L++){const U=M.results[L],q=U?.[0]?.transcript??"";U?.isFinal?T=T+q:E=E+q}T&&(f.current=f.current+T,a(f.current)),x.current=E,r(E)},D.onerror=M=>{p.current===D&&M.error!=="no-speech"&&(h.current=!1,p.current=null,v(),n(M.error==="not-allowed"?"permission-denied":"idle"))},D.onend=()=>{if(p.current===D&&h.current)try{D.start()}catch{}};try{D.start()}catch{return h.current=!1,p.current=null,v(),n("idle"),"idle"}return"recording"},t[1]=A}else A=t[1];const j=A;let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{h.current=!1,p.current?.stop(),v(),n("idle"),l(Array(je).fill(.05)),r("");const _=(f.current+(x.current?" "+x.current:"")).trim();return a(""),f.current="",x.current="",_},t[2]=w):w=t[2];const y=w;let C;t[3]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{h.current=!1,p.current?.abort(),v(),n("idle"),a(""),r(""),l(Array(je).fill(.05)),f.current="",x.current=""},t[3]=C):C=t[3];const S=C;let N;return t[4]!==V||t[5]!==e||t[6]!==o||t[7]!==i?(N={status:e,transcript:o,interimTranscript:V,waveformData:i,isSupported:b,startRecording:j,stopRecording:y,cancelRecording:S},t[4]=V,t[5]=e,t[6]=o,t[7]=i,t[8]=N):N=t[8],N}function qr(t){return t.stop()}function Hr(){}function Wr(){return Array(je).fill(.05)}function Zr(t){const e=R.c(4),{data:n}=t;let o;e[0]!==n?(o=n.map(Jr),e[0]=n,e[1]=o):o=e[1];let a;return e[2]!==o?(a=s.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=a):a=e[3],a}function Jr(t,e){return s.jsx("div",{className:"w-[2px] shrink-0 rounded-full bg-chart-2 transition-[height] duration-75 ease-out",style:{height:`${Math.max(4,Math.round(t*40))}px`}},e)}function Xr(t){return t.hasDraft?"send":t.isStreaming||t.isRunInProgress?"stop":"disabled"}function Se(t){const e=R.c(7),{message:n,icon:o}=t;let a;e[0]!==o?(a=o??s.jsx(bt,{size:14,className:"shrink-0"}),e[0]=o,e[1]=a):a=e[1];const V=n??"";let r;e[2]!==V?(r=s.jsx("span",{className:"text-sm",children:V}),e[2]=V,e[3]=r):r=e[3];let i;return e[4]!==a||e[5]!==r?(i=s.jsxs("div",{className:"flex w-full items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-muted/40 text-muted-foreground",children:[a,r]}),e[4]=a,e[5]=r,e[6]=i):i=e[6],i}function ea(t,e,n){const o=R.c(7),{editor:a}=At(),V=G(),[r,i]=F.useState(!1),l=F.useRef(0);let p,d;return o[0]!==n||o[1]!==a||o[2]!==e||o[3]!==t||o[4]!==V?(p=()=>{const c=f=>{f.dataTransfer?.types.includes("Files")&&(f.preventDefault(),l.current=l.current+1,i(!0))},u=f=>{f.preventDefault(),l.current=Math.max(0,l.current-1),l.current===0&&i(!1)},m=ta,h=f=>{if(f.preventDefault(),l.current=0,i(!1),n||!a||!t||!Ze(t))return;const x=f.dataTransfer?.files;if(!x||x.length===0)return;const b=Array.from(x);(async()=>{let g=a.state.selection.from;for(const v of b)await Rt(a,t,v,g,e,V),g=a.state.selection.to})()};return window.addEventListener("dragenter",c),window.addEventListener("dragleave",u),window.addEventListener("dragover",m),window.addEventListener("drop",h),()=>{window.removeEventListener("dragenter",c),window.removeEventListener("dragleave",u),window.removeEventListener("dragover",m),window.removeEventListener("drop",h)}},d=[a,t,e,V,n],o[0]=n,o[1]=a,o[2]=e,o[3]=t,o[4]=V,o[5]=p,o[6]=d):(p=o[5],d=o[6]),F.useEffect(p,d),r}function ta(t){t.dataTransfer?.types.includes("Files")&&t.preventDefault()}function sa(t){const e=R.c(14),{selectedModel:n}=t,o=G();let a,V,r;if(e[0]!==n||e[1]!==o){const{parts:p}=On(n);e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Hs,{size:24}),e[5]=r):r=e[5],a="text-sm font-medium";let d;e[6]!==o?(d=c=>o(c),e[6]=o,e[7]=d):d=e[7],V=o("chat.input.dropFilesHere",{fileTypes:p.map(d).join(", ")}),e[0]=n,e[1]=o,e[2]=a,e[3]=V,e[4]=r}else a=e[2],V=e[3],r=e[4];let i;e[8]!==a||e[9]!==V?(i=s.jsx("span",{className:a,children:V}),e[8]=a,e[9]=V,e[10]=i):i=e[10];let l;return e[11]!==r||e[12]!==i?(l=s.jsxs(s.Fragment,{children:[r,i]}),e[11]=r,e[12]=i,e[13]=l):l=e[13],l}function na(){const t=R.c(5),e=G();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(bt,{size:24}),t[0]=n):n=t[0];let o;t[1]!==e?(o=e("chat.input.modelCannotReadAttachments"),t[1]=e,t[2]=o):o=t[2];let a;return t[3]!==o?(a=s.jsxs(s.Fragment,{children:[n,s.jsx("span",{className:"text-sm font-medium",children:o})]}),t[3]=o,t[4]=a):a=t[4],a}function oa(t){const e=R.c(11),{selectedModel:n,onUnsupportedFile:o,disabled:a}=t,V=ea(n,o,a);let r;e[0]!==n?(r=Ze(n),e[0]=n,e[1]=r):r=e[1];const i=r,l=V?"opacity-100":"opacity-0 pointer-events-none",p=i?"border-primary/40 text-primary/70":"border-destructive/30 text-destructive/70";let d;e[2]!==l||e[3]!==p?(d=O("absolute inset-0 z-20 rounded-xl flex flex-col items-center justify-center gap-2 bg-muted border-2 border-dashed transition-opacity",l,p),e[2]=l,e[3]=p,e[4]=d):d=e[4];let c;e[5]!==n||e[6]!==i?(c=i?s.jsx(sa,{selectedModel:n}):s.jsx(na,{}),e[5]=n,e[6]=i,e[7]=c):c=e[7];let u;return e[8]!==d||e[9]!==c?(u=s.jsx("div",{className:d,children:c}),e[8]=d,e[9]=c,e[10]=u):u=e[10],u}function ke(t){const e=R.c(14),{onClick:n,label:o,icon:a,colorClass:V,maxWidthClass:r}=t;let i;e[0]!==V?(i=O("flex items-center gap-1.5 h-8 rounded-lg px-2.5 text-sm font-medium group min-w-0 shrink animate-in fade-in duration-200",V),e[0]=V,e[1]=i):i=e[1];let l;e[2]!==r?(l=O("min-w-0 truncate transition-[max-width,opacity] duration-200 ease-out max-w-0 opacity-0 @[320px]/chat-bottom:opacity-100",r),e[2]=r,e[3]=l):l=e[3];let p;e[4]!==o||e[5]!==l?(p=s.jsx("span",{className:l,children:o}),e[4]=o,e[5]=l,e[6]=p):p=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ye,{size:14,className:"shrink-0 hidden group-hover:block group-disabled:hidden"}),e[7]=d):d=e[7];let c;return e[8]!==a||e[9]!==o||e[10]!==n||e[11]!==i||e[12]!==p?(c=s.jsxs("button",{type:"button",onClick:n,title:o,"aria-label":o,className:i,children:[a,p,d]}),e[8]=a,e[9]=o,e[10]=n,e[11]=i,e[12]=p,e[13]=c):c=e[13],c}function ra(){const t=R.c(6),e=Oe(),{org:n,locator:o}=we(),{create:a}=pn();let V;return t[0]!==a||t[1]!==o||t[2]!==e||t[3]!==n.id||t[4]!==n.slug?(V=async r=>{const{tiptapDoc:i,virtualMcp:l,taskIntake:p}=r,d=p===void 0?!1:p,c=crypto.randomUUID(),u=l?.id??ze(n.id).id;Rs(sessionStorage,o,c,{tiptapDoc:d&&i?To(i):i});try{await a({id:c,virtual_mcp_id:u})}catch{}const m={autosend:Ms};d&&(m.sidepanel=!0,m.mainpanel=!1),Ns(e,Ss({org:n.slug,agentId:u,superAgentId:ze(n.id).id}),{search:()=>({...m,thread:c}),replace:!1})},t[0]=a,t[1]=o,t[2]=e,t[3]=n.id,t[4]=n.slug,t[5]=V):V=t[5],V}function cV({onOpenContextPanel:t,showConnectionsBanner:e=!1,homeTaskComposer:n=!1}){const o=G(),a=rn(),V=an(),r=a?.messages??[],i=a?.isStreaming??!1,l=a?.isRunInProgress??!1,p=a?.stop??(()=>{}),d=V?.taskId??"",c=d||Us,u=ra(),{selectedModel:m,selectedVirtualMcp:h,isModelsLoading:f,tiptapDocRef:x,imageModel:b,webSearchModel:g,deepResearchModel:v,chatMode:A,setChatMode:j}=_e(),{data:w}=ys.useSession(),y=w?.user?.id,{org:C,locator:S}=we(),[N,_]=ws(Cs.homeTaskMode(S),!0),k=n&&N,P=ze(C.id).id,D=Ps(h?.id),M=Bs(D?.id).runtime==="cms",E=Zt(co),[T,L]=F.useState(!1),{unsupportedFile:U,onUnsupportedFile:q,clearUnsupportedFile:$}=Xn(),z=Gr(),Q=F.useRef(void 0),B=async()=>{Q.current=ne;const K=await z.startRecording();X("chat_voice_started",{thread_id:d,outcome:K==="recording"?"started":K==="unsupported"?"unsupported":K==="permission-denied"?"permission_denied":"unknown"})},te=()=>{X("chat_voice_confirmed",{thread_id:d});const K=z.stopRecording();le.current?.syncVoiceText(Q.current,K),le.current?.focus()},J=()=>{X("chat_voice_cancelled",{thread_id:d}),z.cancelRecording(),le.current?.restoreContent(Q.current)};F.useEffect(()=>{if(z.status!=="recording")return;const K=(z.transcript+(z.interimTranscript?" "+z.interimTranscript:"")).trim();le.current?.syncVoiceText(Q.current,K)},[z.transcript,z.interimTranscript,z.status]);const I=V?.activeTask??null,Y=I?.created_by,H=!!(y&&Y&&Y!==y),{data:Z}=po({enabled:H}),W=(Z?.data?.members??[]).find(K=>K.userId===Y),se=W?.user?.name??W?.user?.email?.split("@")[0]??null,ae=fo(),Ve=Vn({isDesktopApp:ae,harnessId:I?.harness_id}),[ne,ie]=F.useState(()=>at(sessionStorage,S,c)??void 0),re=K=>{ie(K),x.current=K,zs(sessionStorage,S,c,K,{onQuotaExceeded:({docSizeBytes:de})=>{X("chat_draft_quota_exceeded",{thread_id:d||null,doc_size_bytes:de}),console.warn("[chat-draft] sessionStorage quota exceeded; draft not saved")}})},ce=F.useRef(d);if(ce.current!==d){ce.current=d;const K=at(sessionStorage,S,c)??void 0;ie(K),x.current=K}const oe=[...r].reverse().find(K=>K.role==="assistant")?.metadata?.modelLimits?.contextWindow??m?.limits?.contextWindow,le=F.useRef(null),ve=F.useRef(!1),Ee=A==="plan",Ne=K=>{E(),X("chat_mode_changed",{from_mode:K,to_mode:"default",source:"pill_dismiss"}),j("default")};F.useEffect(()=>{const K=de=>{Ds(de)&&de.code==="KeyL"&&(de.preventDefault(),de.shiftKey&&j(A==="plan"?"default":"plan"),le.current?.focus())};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[A,j]);const Jt=ln(r),Je=[...r].reverse().find(K=>K.role==="assistant"&&K.metadata?.usage)?.metadata?.usage?.contextTokens??0,Xt=Ce("chat"),es=Pn(),[ts,Xe]=F.useState(!1),[ss,et]=F.useState(!1),ns=!f&&!Ls(ne),xe=Xr({hasDraft:ns,isStreaming:i,isRunInProgress:l}),Le=xe==="send",ge=xe==="stop",tt=K=>{if(K?.preventDefault(),!Xt){Xe(!0);return}if(es){et(!0);return}if(xe==="send"&&ne){if(X("chat_message_sent",{thread_id:d||null,mode:A,model_id:m?.modelId??null,model_provider:m?.providerId??null,virtual_mcp_id:h?.id??null,submission:K?"button_or_enter":"programmatic"}),a){if(a.isSendInFlight()){ye.info(o("chat.input.stillSendingPreviousMessage"));return}a.sendMessage(ne)}else k&&X("task_report_submitted",{source:"home"}),u({tiptapDoc:ne,virtualMcp:k?null:h,taskIntake:k});Fs(sessionStorage,S,c),re(void 0)}else xe==="stop"&&(X("chat_message_stopped",{thread_id:d}),p())};if(H)return s.jsx(Se,{message:se?o("chat.input.readOnlyOthersChatNamed",{name:se}):o("chat.input.readOnlyOthersChat"),icon:se?s.jsx(uo,{shape:"circle",size:"2xs",url:W?.user?.image??void 0,fallback:se.slice(0,2).toUpperCase()}):void 0});if(I?.metadata?.read_only)return s.jsx(Se,{message:o("chat.input.readOnlyThread")});if(Ve)return s.jsx(Se,{message:o("chat.input.codingAgentRequiresDesktop")});if(M){if(!V)return s.jsx(Se,{message:o("chat.input.fastPreviewUnavailable")});const K=()=>{const de=V.createTask({runtime:"sandbox"});X("coding_session_started",{thread_id:de})};return s.jsxs("button",{type:"button",onClick:K,className:"group flex w-full items-center gap-3 rounded-2xl border border-border bg-background/60 px-4 py-3.5 text-left shadow-sm backdrop-blur-sm transition-colors hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[s.jsx(Ys,{size:18,className:"shrink-0 text-muted-foreground"}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:o("chat.fastPreview.startCodingSession")}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o("chat.fastPreview.chatNeedsSession")})]}),s.jsx(vt,{size:16,className:"shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]})}return s.jsxs(s.Fragment,{children:[ts&&s.jsx(ct,{feature:"chat",onDismiss:()=>Xe(!1)}),ss&&s.jsx(ct,{feature:"chat",copy:{title:o("chat.input.allowanceExhaustedTitle")},onDismiss:()=>et(!1)}),s.jsx("div",{className:"flex flex-col w-full justify-end text-left",children:s.jsxs("div",{className:"relative rounded-2xl w-full flex flex-col",children:[e&&s.jsx("div",{className:"absolute inset-0 rounded-2xl pointer-events-none bg-muted/50"}),a&&V&&s.jsx(Me,{}),a&&V&&d?s.jsx(Nr,{taskId:d}):null,s.jsx(eo,{tiptapDoc:ne,setTiptapDoc:re,disabled:z.status==="recording",enterToSubmit:!0,placeholder:o(k?"chat.input.taskPlaceholder":"chat.input.placeholder"),onSubmit:tt,suggestionOpenRef:ve,children:s.jsxs("form",{onSubmit:tt,className:O("w-full relative rounded-2xl min-h-[110px] md:min-h-[130px] flex flex-col bg-card dark:bg-muted card-shadow overflow-hidden"),children:[s.jsx(oa,{selectedModel:m,onUnsupportedFile:q,disabled:z.status==="recording"}),s.jsx("div",{className:"group/input relative flex flex-col gap-2 flex-1",children:s.jsx(to,{ref:le,disabled:z.status==="recording",virtualMcpId:h?.id??P,showFileUploader:!0,selectedModel:m,onUnsupportedFile:q,suggestionOpenRef:ve})}),s.jsx("div",{className:"@container/chat-bottom flex items-center justify-between p-2.5 gap-1",children:z.status==="recording"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsx(Zr,{data:z.waveformData.slice(0,28)}),s.jsx("button",{type:"button",onClick:J,className:"flex items-center justify-center size-8 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":o("chat.input.cancelRecording"),children:s.jsx(Ye,{size:16})}),s.jsx("button",{type:"button",onClick:te,className:"flex items-center justify-center size-8 rounded-lg bg-foreground text-background hover:opacity-80 transition-opacity","aria-label":o("chat.input.useTranscription"),children:s.jsx(Ke,{size:16})})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&s.jsx(ee,{type:"button",size:"sm",variant:N?"secondary":"ghost","aria-pressed":N,onClick:()=>_(!N),className:"h-8",children:o("chat.input.taskMode")}),s.jsx($r,{disabled:!1,onOpenConnections:()=>{X("connections_dialog_opened",{source:"tools_popover",mode:"add"}),L(!0)},virtualMcpId:h?.id??P,selectedModel:m,isStreaming:i,onUnsupportedFile:q}),Ee&&s.jsx(ke,{onClick:()=>Ne("plan"),label:o("chat.input.planMode"),icon:s.jsx(wt,{size:14,className:"shrink-0"}),colorClass:"text-violet-600 dark:text-violet-400 hover:bg-violet-500/10",maxWidthClass:"@[320px]/chat-bottom:max-w-32"}),A==="gen-image"&&b&&s.jsx(ke,{onClick:()=>Ne("gen-image"),label:o("chat.input.createImage"),icon:s.jsx(St,{size:14,className:"shrink-0"}),colorClass:"text-pink-600 dark:text-pink-400 hover:bg-pink-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),A==="web-search"&&g&&s.jsx(ke,{onClick:()=>Ne("web-search"),label:o("chat.input.webSearch"),icon:s.jsx(Ct,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),A==="deep-research"&&v&&s.jsx(ke,{onClick:()=>Ne("deep-research"),label:o("chat.input.deepResearch"),icon:s.jsx(Nt,{size:14,className:"shrink-0"}),colorClass:"text-blue-600 dark:text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",maxWidthClass:"@[320px]/chat-bottom:max-w-[120px]"}),oe&&Je>0&&s.jsx(yn,{usage:Jt,totalTokens:Je,contextWindow:oe,onOpenContextPanel:t})]}),s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(Er,{}),z.isSupported&&s.jsx(ee,{type:"button",onClick:B,disabled:!1,variant:"ghost",size:"icon",className:O("size-8 classic:rounded-lg transition-colors",z.status==="permission-denied"?"text-destructive hover:text-destructive hover:bg-destructive/10":"text-muted-foreground hover:text-foreground"),title:z.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),"aria-label":z.status==="permission-denied"?o("chat.input.microphoneAccessDenied"):o("chat.input.voiceInput"),children:s.jsx(Gs,{size:18})}),s.jsx(ee,{type:ge?"button":"submit",onClick:K=>{ge&&(K.preventDefault(),K.stopPropagation(),p())},variant:Le||ge?"default":"ghost",size:k?"sm":"icon",disabled:!Le&&!ge,className:O(k?"h-8 px-3 classic:rounded-lg transition-all":"size-8 classic:rounded-lg transition-all",!Le&&!ge&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed"),title:o(xe==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":k?"chat.input.startTask":"chat.input.sendMessageEnter"),"aria-label":o(xe==="stop"?i?"chat.input.stopGenerating":"chat.input.cancelRun":k?"chat.input.startTask":"chat.input.sendMessage"),children:ge?s.jsx(qs,{size:20}):s.jsxs(s.Fragment,{children:[k&&o("chat.input.startTask"),s.jsx(jt,{size:20})]})})]})]})})]})},d),n&&k&&s.jsx("p",{className:"px-3 pt-3 text-left text-xs text-muted-foreground",children:o("chat.input.taskHint")}),e&&s.jsx(Yr,{onClick:()=>{X("connections_banner_clicked",{source:"home_chat_input"}),X("connections_dialog_opened",{source:"home_banner",mode:"add"}),L(!0)}})]})}),s.jsx(mo,{mode:"browse",open:T,onOpenChange:L,defaultTab:"all"}),s.jsx(so,{info:U,onClose:$})]})}export{cV as C,iV as H,pr as T,fr as a,lV as u};
@@ -1 +1 @@
1
- import{c as s,l as a,j as d}from"./index-B4_5ne-m.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-[var(--studio-input-background)] px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
1
+ import{c as s,l as a,j as d}from"./index-ViRfM1Gu.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-[var(--studio-input-background)] px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};