decocms 4.459.1 → 4.459.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/dist/client/assets/{AlertCircle-hP4CniDw.js → AlertCircle-BhLvKd51.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Bo1dQUQK.js → AreaChart-BXdKk-Jh.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-snrf1tGx.js → ArrowLeft-BGBmg7V7.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DKlHzRUJ.js → ArrowUp-BiSVkN3f.js} +1 -1
  5. package/dist/client/assets/{Building02-C7IJqjKK.js → Building02-Cn4v8u0T.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-D_y9VlNF.js → CartesianChart-CaWYdC9u.js} +1 -1
  7. package/dist/client/assets/{Check-Ck9dGdFT.js → Check-BIm8oPAI.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-C10CcdE5.js → CheckCircle-DtMOIYIN.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DxC2mC66.js → ChevronUp-CW9NwQNu.js} +1 -1
  10. package/dist/client/assets/{Copy01-efUKcLhv.js → Copy01-CVhdu84v.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-DdwRSoSe.js → CreditCard01-YvQwrjsc.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-MvZCuAVY.js → DotsVertical-D-FvZQn0.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-BeBU7UDa.js → ErrorBarContext-D3MulA5M.js} +1 -1
  14. package/dist/client/assets/{Image01-DvcgVgi7.js → Image01-CGBVFmAI.js} +1 -1
  15. package/dist/client/assets/{Key01-Cj8Vm4p6.js → Key01-CwVo9Cfv.js} +1 -1
  16. package/dist/client/assets/{Line-C-48JBMZ.js → Line-C48uhTy3.js} +1 -1
  17. package/dist/client/assets/{Link01-tmXFK6e3.js → Link01-9k5oDSP-.js} +1 -1
  18. package/dist/client/assets/{LinkBroken01-CP7hyYh2.js → LinkBroken01-CKAYv5Ws.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-DA-xCJ3a.js → LinkExternal01-DNJF5sr3.js} +1 -1
  20. package/dist/client/assets/{Monitor01-CWOF0aXq.js → Monitor01-emBSPIO-.js} +1 -1
  21. package/dist/client/assets/{Palette-BqhzEvZt.js → Palette-CbtdR6wJ.js} +1 -1
  22. package/dist/client/assets/{Plus-C_BzVsMU.js → Plus-088McVZs.js} +1 -1
  23. package/dist/client/assets/{SearchMd-Cn3ttzXj.js → SearchMd-CRK8FN15.js} +1 -1
  24. package/dist/client/assets/{Sector-CGnau01_.js → Sector-cSOsr2E-.js} +1 -1
  25. package/dist/client/assets/{ShoppingBag01-Wr2FrDdb.js → ShoppingBag01-BxQzf-9l.js} +1 -1
  26. package/dist/client/assets/{Sun-DYaxr-kZ.js → Sun-D6nY-Bb0.js} +1 -1
  27. package/dist/client/assets/{Tool01-BlNfFonn.js → Tool01-DQQGDcpr.js} +1 -1
  28. package/dist/client/assets/{Trash01-DfS7U4fp.js → Trash01-B3Mmvw35.js} +1 -1
  29. package/dist/client/assets/{Upload01-BcP6uGW4.js → Upload01-jQPNdEwy.js} +1 -1
  30. package/dist/client/assets/{User01-C_D1KbSG.js → User01-B-OC1WKF.js} +1 -1
  31. package/dist/client/assets/{UserSquare-DnwMjdPq.js → UserSquare-DAPHqKUt.js} +1 -1
  32. package/dist/client/assets/{Users01-DmsoNf0W.js → Users01-ClTO42s_.js} +1 -1
  33. package/dist/client/assets/{X-B2rdTMzZ.js → X-B8pJz_49.js} +1 -1
  34. package/dist/client/assets/{XAxis-xi6RGTb2.js → XAxis-D6VwqdrO.js} +1 -1
  35. package/dist/client/assets/{XClose-C-LhQLI0.js → XClose-BqnBpCCh.js} +1 -1
  36. package/dist/client/assets/{ZoomOut-D334bw-H.js → ZoomOut-DsjWT-m0.js} +1 -1
  37. package/dist/client/assets/{access-gate-DSweS_O9.js → access-gate-Bn9w-zIx.js} +1 -1
  38. package/dist/client/assets/{add-connection-dialog-BXpA-FpE.js → add-connection-dialog-BhN1VUAm.js} +1 -1
  39. package/dist/client/assets/{agent-analytics-BTDOeRM6.js → agent-analytics-DqtV4MPf.js} +1 -1
  40. package/dist/client/assets/agent-app-CwRJsLag.js +1 -0
  41. package/dist/client/assets/{agent-assets-wghI4Amx.js → agent-assets-BFqhddLD.js} +1 -1
  42. package/dist/client/assets/{agent-automation-q7dN1ZRz.js → agent-automation-C8klKvKY.js} +1 -1
  43. package/dist/client/assets/{agent-automations-BMZxs2g_.js → agent-automations-DqhEODAb.js} +1 -1
  44. package/dist/client/assets/{agent-connect-sources-DhGbXZpi.js → agent-connect-sources-C86EyOB5.js} +1 -1
  45. package/dist/client/assets/agent-deck-DGV-pK2t.js +1 -0
  46. package/dist/client/assets/{agent-e2e-9WJZyE0h.js → agent-e2e-DzJ9sAzc.js} +1 -1
  47. package/dist/client/assets/{agent-experiments-CoxpwEG5.js → agent-experiments-VcqTmtZL.js} +1 -1
  48. package/dist/client/assets/{agent-file-kcJOcKYn.js → agent-file-DI2wK--r.js} +1 -1
  49. package/dist/client/assets/{agent-hosting-BbOgSYpL.js → agent-hosting-kfFKqM9r.js} +1 -1
  50. package/dist/client/assets/{agent-icon-DVHfcBN5.js → agent-icon-CP_Ce3vP.js} +1 -1
  51. package/dist/client/assets/agent-library-Dlz_4LiQ.js +1 -0
  52. package/dist/client/assets/agent-library-file-DPfP5s66.js +1 -0
  53. package/dist/client/assets/{agent-monitor-CN2DIugD.js → agent-monitor-Cmsy40BX.js} +1 -1
  54. package/dist/client/assets/agent-overview-CmHeFyml.js +1 -0
  55. package/dist/client/assets/agent-settings-C7f7_N2z.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-Mm1DU721.js → agent-site-editor-Cn5duNcn.js} +1 -1
  57. package/dist/client/assets/agent-site-editor-code-CIrGs6m3.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-TaqaeLdn.js → agent-site-editor-content-CbT525Tv.js} +5 -5
  59. package/dist/client/assets/{agent-site-editor-preview-BPvpmOCG.js → agent-site-editor-preview-CYb_d7vH.js} +3 -3
  60. package/dist/client/assets/agent-view-Be5hcLqc.js +1 -0
  61. package/dist/client/assets/{agent-view-guard-C-kn102z.js → agent-view-guard-C1R2qCc9.js} +1 -1
  62. package/dist/client/assets/{agents-list-HVHSwhFa.js → agents-list-y-TIBGAq.js} +1 -1
  63. package/dist/client/assets/{ai-providers-CWyW_O_N.js → ai-providers-CRe_x6a5.js} +1 -1
  64. package/dist/client/assets/{alert-Ck8KMasQ.js → alert-DtABAm9U.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-Cyf0IXgS.js → alert-dialog-DmVEYAb4.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-d8aBHi-o.js → analytics-sections-B7lS35B2.js} +1 -1
  67. package/dist/client/assets/{api-keys-ByiOQaV4.js → api-keys-Cif1835z.js} +1 -1
  68. package/dist/client/assets/api-keys-Dwm2bo1Y.js +1 -0
  69. package/dist/client/assets/app-editor-C8_M7ADb.js +1 -0
  70. package/dist/client/assets/{asset-utils-CZ6drd0z.js → asset-utils-CT4-E6TK.js} +1 -1
  71. package/dist/client/assets/{auth-DbQy_3_H.js → auth-2OsbyFrK.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-B06-BTfP.js → auth-catchall-BzbXV9-m.js} +1 -1
  73. package/dist/client/assets/{auth-entry-CqUF12aw.js → auth-entry-DGYmKia4.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-Ci1D9n5y.js → auth-split-layout-95LDkF8r.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-BbZoD5Jl.js → authenticate-and-persist-oauth-BGZheh1t.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-Bt0pDv1X.js → automation-list-row-DVowGYyJ.js} +1 -1
  77. package/dist/client/assets/{automation-runs-Dl8dgTPp.js → automation-runs-C4ptawD5.js} +1 -1
  78. package/dist/client/assets/{automations-BGOyn9e5.js → automations-9sMoXMlz.js} +1 -1
  79. package/dist/client/assets/{autosend-DWW-s_U0.js → autosend-BL2q_s0u.js} +1 -1
  80. package/dist/client/assets/{avatar-DWGXIvcf.js → avatar-BE-fSFZD.js} +1 -1
  81. package/dist/client/assets/{badge-we6p4hry.js → badge-CWkPL4_H.js} +1 -1
  82. package/dist/client/assets/{block-document-_9FVQevS.js → block-document-B5Nbhvq6.js} +3 -3
  83. package/dist/client/assets/{blocks-preview-workspace-context-Bpwyq7XF.js → blocks-preview-workspace-context-BmQuZmk0.js} +1 -1
  84. package/dist/client/assets/{blog-schema-CCBE-1lK.js → blog-schema-C5vM1gTk.js} +1 -1
  85. package/dist/client/assets/{buckets-IYr5nWy_.js → buckets-CSwPt34t.js} +1 -1
  86. package/dist/client/assets/{build-improve-prompt-doc-DETXagAT.js → build-improve-prompt-doc-ztgqv-Z4.js} +1 -1
  87. package/dist/client/assets/{calendar-CUA9Aez6.js → calendar-BibeDh1C.js} +1 -1
  88. package/dist/client/assets/{capability-load-error-BneCHbnb.js → capability-load-error-Cifg-uxi.js} +1 -1
  89. package/dist/client/assets/category-editor-LUC4tS1v.js +1 -0
  90. package/dist/client/assets/{chart-CX74ottm.js → chart-Dtz_P3D3.js} +5 -5
  91. package/dist/client/assets/{chat-context-CiWqcBU2.js → chat-context-Blq_eRG7.js} +6 -6
  92. package/dist/client/assets/{chat-draft-DkpmcsoX.js → chat-draft-jYk7-XVU.js} +1 -1
  93. package/dist/client/assets/{checkbox-CXteSDot.js → checkbox-D5Dxpou_.js} +1 -1
  94. package/dist/client/assets/{choose-editor-BD3DdNIK.js → choose-editor-db_FowHS.js} +1 -1
  95. package/dist/client/assets/{claim-phase-copy-BexHEX8r.js → claim-phase-copy-8K3qgNLh.js} +1 -1
  96. package/dist/client/assets/{cli-auth-success-CNGA7JlE.js → cli-auth-success-DjOImTaI.js} +1 -1
  97. package/dist/client/assets/{client-icons-CqX4a6Ar.js → client-icons-BkFbGfWa.js} +1 -1
  98. package/dist/client/assets/{collapsible-DwAPS6G8.js → collapsible-DsS_PEhd.js} +1 -1
  99. package/dist/client/assets/{collection-detail-DF6WGwCf.js → collection-detail-DP9fd0Dw.js} +1 -1
  100. package/dist/client/assets/{collection-display-button-BIc0dgaJ.js → collection-display-button-C2K7H_M_.js} +1 -1
  101. package/dist/client/assets/{collection-search-DoIg4pOf.js → collection-search-9MFDsQ6p.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-CQxrxnX9.js → collection-table-wrapper-SA5bpKVN.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-Dvji2ooE.js → collection-tabs-jDuTyfYq.js} +1 -1
  104. package/dist/client/assets/{column-rules-BrooYRIh.js → column-rules-D6JxKTRe.js} +1 -1
  105. package/dist/client/assets/{combobox-CPn_s26Q.js → combobox-DF39TceE.js} +1 -1
  106. package/dist/client/assets/{command-CLhlH1Qw.js → command-B4jGFd17.js} +1 -1
  107. package/dist/client/assets/{companion-mcps-section-CZ7xsA0m.js → companion-mcps-section-CVSn-aTg.js} +1 -1
  108. package/dist/client/assets/config-bg0vG3sC.js +1 -0
  109. package/dist/client/assets/{connect-B0dB034l.js → connect-D_b6-CyS.js} +1 -1
  110. package/dist/client/assets/{connect-layout-XfG0VjQ8.js → connect-layout-DDUc-hD-.js} +1 -1
  111. package/dist/client/assets/{connection-7beMMzWx.js → connection-CwaA-4mr.js} +1 -1
  112. package/dist/client/assets/{connection-card-Be7WoVGH.js → connection-card-BtsAXkN4.js} +1 -1
  113. package/dist/client/assets/{connection-detail-B768OXfU.js → connection-detail-QHFcVXMr.js} +1 -1
  114. package/dist/client/assets/{connection-form-helpers-RVubyUH7.js → connection-form-helpers-BV0FZHte.js} +1 -1
  115. package/dist/client/assets/{connections-Bg73jyCK.js → connections-CNadoE5b.js} +1 -1
  116. package/dist/client/assets/context-CFdmX9Xg.js +1 -0
  117. package/dist/client/assets/{context-menu-B4Jf6CPJ.js → context-menu-BnfFPukJ.js} +1 -1
  118. package/dist/client/assets/core.esm-C5SAJNWk.js +5 -0
  119. package/dist/client/assets/{create-organization-dialog-CfLH7Jh9.js → create-organization-dialog-mc6cUsWg.js} +1 -1
  120. package/dist/client/assets/{daily-pulse-BWzYVao8.js → daily-pulse-DxbyF8Ez.js} +1 -1
  121. package/dist/client/assets/{decopilot-Dfink1sA.js → decopilot-NLRNUzMe.js} +1 -1
  122. package/dist/client/assets/{device-hint-DXVtdDhz.js → device-hint-Bk3hM3wv.js} +1 -1
  123. package/dist/client/assets/{dialog-KYKWBSL1.js → dialog-BGB8jiGJ.js} +1 -1
  124. package/dist/client/assets/{discover-BD3jqwiC.js → discover-DTxiggmr.js} +1 -1
  125. package/dist/client/assets/{domain-settings-Cf29Okkv.js → domain-settings--d3mBGQt.js} +1 -1
  126. package/dist/client/assets/{download-app-dialog-BubP7yx-.js → download-app-dialog-C1623CnU.js} +1 -1
  127. package/dist/client/assets/{drawer-DWkQ_glv.js → drawer-CDzlciSr.js} +1 -1
  128. package/dist/client/assets/{editor-D2Dbl7hJ.js → editor-CtDmuL7X.js} +3 -3
  129. package/dist/client/assets/{empty-state-NNLhOgxH.js → empty-state-CjQyKZ-1.js} +1 -1
  130. package/dist/client/assets/{empty-state-CWduWzjT.js → empty-state-ClSZs1JG.js} +1 -1
  131. package/dist/client/assets/{extract-connection-data-qdZ9yL7M.js → extract-connection-data-BnK0gWOf.js} +1 -1
  132. package/dist/client/assets/{feature-gate-DmrYDfD0.js → feature-gate-cEqP5nQK.js} +1 -1
  133. package/dist/client/assets/{feature-paywall-za9mjhQi.js → feature-paywall-B0iudT_s.js} +1 -1
  134. package/dist/client/assets/{file-explorer-C3BfL1pu.js → file-explorer-CPmbjsZ0.js} +1 -1
  135. package/dist/client/assets/{file-preview-C2exPqDj.js → file-preview-FOaYPomf.js} +1 -1
  136. package/dist/client/assets/{file-share-button-Bd0_1kzN.js → file-share-button-C99y-deU.js} +1 -1
  137. package/dist/client/assets/{file-type-icon-e3GEv92g.js → file-type-icon-CaoQ1xmx.js} +1 -1
  138. package/dist/client/assets/flat-project-U_elHLQG.js +1 -0
  139. package/dist/client/assets/{folder-icon-dsxfjOg0.js → folder-icon-C189zm-A.js} +1 -1
  140. package/dist/client/assets/{form-C8X8xSNl.js → form-Bc6DsBML.js} +1 -1
  141. package/dist/client/assets/{gateway-client-C7cRG-yz.js → gateway-client-C0zWKCU4.js} +1 -1
  142. package/dist/client/assets/{general-BVagQQFp.js → general-BtREXR3p.js} +1 -1
  143. package/dist/client/assets/home-twE7M1iU.js +1 -0
  144. package/dist/client/assets/{icon-button-Be0mspeY.js → icon-button-DI_TQN14.js} +1 -1
  145. package/dist/client/assets/{index-QvCrIW6i.js → index-BDhW9xxN.js} +3 -3
  146. package/dist/client/assets/{index-3ZF9KrLG.js → index-BOGlzqxy.js} +1 -1
  147. package/dist/client/assets/{index-B4vDpFwz.js → index-BgnBPJ_k.js} +1 -1
  148. package/dist/client/assets/{index-I0YWuNWN.js → index-Bjctp948.js} +1 -1
  149. package/dist/client/assets/{index-MxA60P88.js → index-CKHLb67S.js} +5 -5
  150. package/dist/client/assets/{index-BhYlaEJD.js → index-CN7c5BIN.js} +1 -1
  151. package/dist/client/assets/{index-BoWpPmYJ.js → index-C_I69v1G.js} +1 -1
  152. package/dist/client/assets/{index-5_KsGXx0.js → index-CdXinK8k.js} +1 -1
  153. package/dist/client/assets/{index-DQcfF-hP.js → index-ChB9J_RZ.js} +1 -1
  154. package/dist/client/assets/{index-CtFpwpsJ.js → index-DClhYi2n.js} +1 -1
  155. package/dist/client/assets/{index-DEn9wDzc.js → index-DH9SXre1.js} +1 -1
  156. package/dist/client/assets/{index-CxhjDVE6.js → index-G3JSHUT3.js} +1 -1
  157. package/dist/client/assets/{index-gTfftS9m.js → index-RmHD0J0J.js} +1 -1
  158. package/dist/client/assets/{index-WiELi86Y.js → index-XEhCSGBE.js} +1 -1
  159. package/dist/client/assets/{index-D-LNUFaS.js → index-kogfMavo.js} +1 -1
  160. package/dist/client/assets/{index-redirect-BWvJ00h7.js → index-redirect-BVO0FWKk.js} +1 -1
  161. package/dist/client/assets/{infiniteQueryObserver-B4E75_QN.js → infiniteQueryObserver-8nco6j0l.js} +1 -1
  162. package/dist/client/assets/{infra-billing-C2_mgW0r.js → infra-billing-D_L2KNiI.js} +1 -1
  163. package/dist/client/assets/{input-DzrhMQKQ.js → input--BdO_-Si.js} +1 -1
  164. package/dist/client/assets/{input-rYFgozUW.js → input-Bl8RoIF_.js} +3 -3
  165. package/dist/client/assets/{input-dnKef9VJ.js → input-DrKcGYrl.js} +1 -1
  166. package/dist/client/assets/{integration-icon-B1V7QJ0Z.js → integration-icon-BDP6F9Pj.js} +1 -1
  167. package/dist/client/assets/{label-Bn6aGS7S.js → label-uTNaIuWI.js} +1 -1
  168. package/dist/client/assets/{layout-C0VOhGsK.js → layout-wln6hIY8.js} +1 -1
  169. package/dist/client/assets/{legacy-agents-deep-Di9MZNFv.js → legacy-agents-deep-CawwPAe9.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-Bq-7qzen.js → legacy-main-redirect-BRfxPgdK.js} +1 -1
  171. package/dist/client/assets/library-DvaCz1Wk.js +1 -0
  172. package/dist/client/assets/{library-tab-B7Gkfwc-.js → library-tab-CX8njRPr.js} +1 -1
  173. package/dist/client/assets/{login-ela4cJW6.js → login-Ba7PbDUP.js} +1 -1
  174. package/dist/client/assets/{markdown-BSSkHnhk.js → markdown-LIOti3qC.js} +1 -1
  175. package/dist/client/assets/{mcp-app-renderer-BDnK-zdP.js → mcp-app-renderer-Z11oKtDn.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-UG4bZwDx.js → mcp-oauth-DdEBE0Y7.js} +1 -1
  177. package/dist/client/assets/{members-DVJlgztX.js → members-BpY2Uunx.js} +1 -1
  178. package/dist/client/assets/{memory-DTVmF33x.js → memory-BOfe9xo8.js} +1 -1
  179. package/dist/client/assets/{mini-report-page-Bm4NxYHw.js → mini-report-page-CDObofTo.js} +1 -1
  180. package/dist/client/assets/{mock-board-TB0C3oxv.js → mock-board-DTiFXXEW.js} +1 -1
  181. package/dist/client/assets/{monaco-editor-DTrO_g8e.js → monaco-editor-J-McljL4.js} +1 -1
  182. package/dist/client/assets/{monitoring-stats-row-BK60Uszk.js → monitoring-stats-row-BuUSw5n9.js} +1 -1
  183. package/dist/client/assets/{multi-select-Cv6XwHp_.js → multi-select-YETcY4pN.js} +1 -1
  184. package/dist/client/assets/{mustache-CkVzTK04.js → mustache-B6NVLdGZ.js} +1 -1
  185. package/dist/client/assets/{new-project-dialog-BltQa2EK.js → new-project-dialog-C_qrCiK3.js} +1 -1
  186. package/dist/client/assets/{oauth-callback-Dfb0SnH3.js → oauth-callback-CoY1dClF.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-ai-provider-Cc0Ol4YV.js → oauth-callback-ai-provider-DRzdFuFq.js} +1 -1
  188. package/dist/client/assets/{onboarding-4jSRiUhV.js → onboarding-ZdgIxalP.js} +1 -1
  189. package/dist/client/assets/{openai-conversation-eMBxQyXE.js → openai-conversation-D0z85aeO.js} +1 -1
  190. package/dist/client/assets/{optimistic-project-sidebar-views-C1m8dTzY.js → optimistic-project-sidebar-views-F9PSyz4u.js} +1 -1
  191. package/dist/client/assets/{org-file-open-context-BPs82lJA.js → org-file-open-context-BMxi_LQF.js} +1 -1
  192. package/dist/client/assets/{organization-choice-Bb6SyphX.js → organization-choice-BByF2TD6.js} +1 -1
  193. package/dist/client/assets/{orgs-D0sK64fg.js → orgs-DNf-zQVQ.js} +1 -1
  194. package/dist/client/assets/{page-seo-form-C5VxItck.js → page-seo-form-D3EpRlka.js} +1 -1
  195. package/dist/client/assets/{pair-PcsLH4D0.js → pair-DcQaouFq.js} +1 -1
  196. package/dist/client/assets/{plan-ladder-BdvlpVQQ.js → plan-ladder-DCJHDLS1.js} +1 -1
  197. package/dist/client/assets/{popover-BaUprubX.js → popover-BeYdUP-7.js} +1 -1
  198. package/dist/client/assets/post-calendar-CWlL1qOv.js +1 -0
  199. package/dist/client/assets/{post-editor-BD6O003-.js → post-editor-BqiuLn6r.js} +2 -2
  200. package/dist/client/assets/{preview-content-Sk08Pr7A.js → preview-content-wfTnwfYO.js} +1 -1
  201. package/dist/client/assets/{preview-dialog-o8jh9tjn.js → preview-dialog-BBD3jkZw.js} +1 -1
  202. package/dist/client/assets/{profile-CrHlRdpp.js → profile-C4Rt4NnT.js} +1 -1
  203. package/dist/client/assets/project-app-view-BSuJFE5I.js +1 -0
  204. package/dist/client/assets/project-feed-DmY6xTEa.js +1 -0
  205. package/dist/client/assets/{project-icon-Cg1qPEYk.js → project-icon-CtBv5qE9.js} +1 -1
  206. package/dist/client/assets/project-reports-DqdW9cvU.js +1 -0
  207. package/dist/client/assets/project-tasks-n0fjaerW.js +1 -0
  208. package/dist/client/assets/{projects-CZ04La1N.js → projects-C5p0nBlq.js} +1 -1
  209. package/dist/client/assets/{projects-empty-state-CmBktXtC.js → projects-empty-state-CTShW1Lx.js} +1 -1
  210. package/dist/client/assets/{prompts-B-79ciZU.js → prompts-CQ9lRosC.js} +1 -1
  211. package/dist/client/assets/record-editor-CuQArctF.js +1 -0
  212. package/dist/client/assets/redirect-editor-BqLcv-Nb.js +1 -0
  213. package/dist/client/assets/{reports-BbEyCsO0.js → reports-D1mTKUWD.js} +1 -1
  214. package/dist/client/assets/reports-eg7qCRZt.js +1 -0
  215. package/dist/client/assets/{reports-onboarding-DaafOk4M.js → reports-onboarding-Bhi9ZgPz.js} +1 -1
  216. package/dist/client/assets/reports-tab-CvuocIip.js +2 -0
  217. package/dist/client/assets/{repositories-CMmN2qAu.js → repositories-BYsSTJU-.js} +1 -1
  218. package/dist/client/assets/{repository-binding-Dmtv7YGN.js → repository-binding-C6IRmj-B.js} +1 -1
  219. package/dist/client/assets/{repository-import-picker-CKbCQvk9.js → repository-import-picker-COTFeOcQ.js} +1 -1
  220. package/dist/client/assets/{repository-picker-DYjy65xM.js → repository-picker-sBc4_JWX.js} +1 -1
  221. package/dist/client/assets/{require-capability-BN4N7OVD.js → require-capability-BhFz_zS7.js} +1 -1
  222. package/dist/client/assets/{required-auth-layout-8zcKPB4g.js → required-auth-layout-CslXPG0m.js} +1 -1
  223. package/dist/client/assets/{reset-password-CZSibvEr.js → reset-password-D0bAgN3-.js} +1 -1
  224. package/dist/client/assets/{resizable-D2ZfrSi0.js → resizable-DQ19gouy.js} +1 -1
  225. package/dist/client/assets/{resolve-tab-icon-Cg2e1659.js → resolve-tab-icon-CY3X9f4_.js} +1 -1
  226. package/dist/client/assets/{review-settings-5LRZ1Xo7.js → review-settings-BV2AxARx.js} +1 -1
  227. package/dist/client/assets/rich-text-link-control-B1QtoX3z.js +1 -0
  228. package/dist/client/assets/{roles-BoXMUY1f.js → roles-BeG_4GHR.js} +1 -1
  229. package/dist/client/assets/route-BqiT-Ol6.js +1 -0
  230. package/dist/client/assets/route-CAFnuBNg.js +1 -0
  231. package/dist/client/assets/{route-oh01RQ-w.js → route-CHYkbxgn.js} +1 -1
  232. package/dist/client/assets/{runnable-block-editor-BJjjoCmo.js → runnable-block-editor-DcMkYuUb.js} +4 -4
  233. package/dist/client/assets/{sandbox-lifecycle-context-m3f3mnES.js → sandbox-lifecycle-context-DeQIS6JV.js} +1 -1
  234. package/dist/client/assets/{schema-qHqkHHod.js → schema-B4_xo1tD.js} +1 -1
  235. package/dist/client/assets/{scroll-area-5fAK7i7z.js → scroll-area-DCMK1tWu.js} +1 -1
  236. package/dist/client/assets/{search-input-DlDEo9jW.js → search-input-BSOQ3ySE.js} +1 -1
  237. package/dist/client/assets/{search-toggle-DBB9-mcC.js → search-toggle-C-N7d4fN.js} +1 -1
  238. package/dist/client/assets/{secret-picker-BLIlbF-9.js → secret-picker-DZTMfxXL.js} +1 -1
  239. package/dist/client/assets/{secrets-B6ciBsym.js → secrets-Bx2QImFq.js} +1 -1
  240. package/dist/client/assets/sections-editor-BYNA13Qk.js +1 -0
  241. package/dist/client/assets/{select-C4t2zfNW.js → select-B6DzqJiH.js} +1 -1
  242. package/dist/client/assets/{select-model-B4hpstt-.js → select-model-bJPmmx5f.js} +1 -1
  243. package/dist/client/assets/seo-editor-qeEunz7R.js +1 -0
  244. package/dist/client/assets/{separator-7dF6xfxz.js → separator-iMNYfJb7.js} +1 -1
  245. package/dist/client/assets/{settings-tab-DsxCSMdM.js → settings-tab-BhyiSM9Z.js} +1 -1
  246. package/dist/client/assets/{sheet-CCkRwnEO.js → sheet-CMNWdtKR.js} +1 -1
  247. package/dist/client/assets/{shell-layout-Cvnu1xoQ.js → shell-layout-CTITeNJr.js} +1 -1
  248. package/dist/client/assets/{skills-Bh6FhxA_.js → skills-BsLVR3Vn.js} +1 -1
  249. package/dist/client/assets/{sso-DfdpWUJy.js → sso-Jw8gC2hK.js} +1 -1
  250. package/dist/client/assets/{suggestion-BZrPkOTO.js → suggestion-CRtEJ9La.js} +1 -1
  251. package/dist/client/assets/{switch-BQeWPFJM.js → switch-Ay_EsHPF.js} +1 -1
  252. package/dist/client/assets/{synced-repos-CCBM75q2.js → synced-repos-DMWgs820.js} +1 -1
  253. package/dist/client/assets/{tab-icon-glyph-yziZ2PV_.js → tab-icon-glyph-C5LJrgle.js} +1 -1
  254. package/dist/client/assets/{table-D-iIBiS4.js → table-BDAYwSIe.js} +1 -1
  255. package/dist/client/assets/{tabs-ewvilFDB.js → tabs-QC_e18gg.js} +1 -1
  256. package/dist/client/assets/{task-board-pB5Y0hMn.js → task-board-BpcFKojY.js} +1 -1
  257. package/dist/client/assets/task-route-CaaYbxyP.js +1 -0
  258. package/dist/client/assets/{task-status-CSzVGIzm.js → task-status-CtgvGjEg.js} +1 -1
  259. package/dist/client/assets/{taskboard-analytics-DGW4w9FB.js → taskboard-analytics-CkC7VEhH.js} +1 -1
  260. package/dist/client/assets/tasks-COTcKNjz.js +1 -0
  261. package/dist/client/assets/{tasks-BXROCEAf.js → tasks-D-EA-uwO.js} +1 -1
  262. package/dist/client/assets/{textarea-Da9tbVx7.js → textarea-MfQKTdum.js} +1 -1
  263. package/dist/client/assets/{thread-analytics-jc5WX2sb.js → thread-analytics-xc71V_Jy.js} +1 -1
  264. package/dist/client/assets/{thread-button-BGoWabG7.js → thread-button-RYt2155P.js} +1 -1
  265. package/dist/client/assets/{thread-intent-KcG0jvJo.js → thread-intent-y4sFV6nC.js} +1 -1
  266. package/dist/client/assets/{thread-route-I67M6zVK.js → thread-route-BRm6UAyi.js} +1 -1
  267. package/dist/client/assets/{thread-route-CrNJBu9Z.js → thread-route-ZX2rkhqS.js} +1 -1
  268. package/dist/client/assets/{thread-sheet-body-MIAAoZeF.js → thread-sheet-body-B9fTAvbI.js} +1 -1
  269. package/dist/client/assets/{toggle-group-CWERIeKx.js → toggle-group-B2CGQVNc.js} +1 -1
  270. package/dist/client/assets/{toolbar-icon-button-BQ4ZQSu9.js → toolbar-icon-button-CsZD8f-r.js} +1 -1
  271. package/dist/client/assets/{tooltip-C1he18et.js → tooltip-D555rgHk.js} +1 -1
  272. package/dist/client/assets/{track-Carz3f1c.js → track-DQPZdUAl.js} +1 -1
  273. package/dist/client/assets/{types-CJepGNea.js → types-C1FT5lJw.js} +1 -1
  274. package/dist/client/assets/{usage-stats-DW00xCiE.js → usage-stats-cLtXqoaq.js} +1 -1
  275. package/dist/client/assets/{use-ai-providers-B_uDPHx4.js → use-ai-providers-cz2PnRt5.js} +1 -1
  276. package/dist/client/assets/{use-automations-MXr63Elt.js → use-automations-BITjz5uS.js} +1 -1
  277. package/dist/client/assets/{use-autosave-DS6DEI0c.js → use-autosave-CXwSXrBr.js} +1 -1
  278. package/dist/client/assets/{use-chat-layout-state-B-w0TqPh.js → use-chat-layout-state-C_QstcMu.js} +1 -1
  279. package/dist/client/assets/{use-clock-tick-BxAer4Nn.js → use-clock-tick-Dx4PkWs4.js} +1 -1
  280. package/dist/client/assets/{use-connect-companion-B_aablGf.js → use-connect-companion-DdM71OKb.js} +1 -1
  281. package/dist/client/assets/{use-connection-Bxzd0HJT.js → use-connection-hMJ4m1KM.js} +1 -1
  282. package/dist/client/assets/{use-copy-DRzLqLAb.js → use-copy-D1Nm-kgX.js} +1 -1
  283. package/dist/client/assets/{use-create-virtual-mcp-B9dVaAK7.js → use-create-virtual-mcp-CHjD7uCu.js} +1 -1
  284. package/dist/client/assets/{use-date-fns-locale-Cz4lpYqP.js → use-date-fns-locale-Bp7nVQWs.js} +1 -1
  285. package/dist/client/assets/{use-debounced-autosave-Cmyk2rKG.js → use-debounced-autosave-SzIG02td.js} +1 -1
  286. package/dist/client/assets/{use-debounced-value-BDfI-sPg.js → use-debounced-value-DCwb28TF.js} +1 -1
  287. package/dist/client/assets/{use-deco-credits-Dr3QUmqQ.js → use-deco-credits-3BarR1a3.js} +1 -1
  288. package/dist/client/assets/{use-decopilot-events-wck0cVko.js → use-decopilot-events-CY9KSVWJ.js} +1 -1
  289. package/dist/client/assets/{use-delete-connection-Ch8H_X4I.js → use-delete-connection-B4ggOZlI.js} +1 -1
  290. package/dist/client/assets/{use-deployment-admin-bef_4H2t.js → use-deployment-admin-D9OrJmDH.js} +1 -1
  291. package/dist/client/assets/{use-fast-preview-draft-url-B6LJboyj.js → use-fast-preview-draft-url-QLdWZwPZ.js} +1 -1
  292. package/dist/client/assets/{use-file-configs-B-rmtKOK.js → use-file-configs-Dk0C1WSo.js} +1 -1
  293. package/dist/client/assets/{use-infinite-scroll-DZuBfYhD.js → use-infinite-scroll-DoBJIre7.js} +1 -1
  294. package/dist/client/assets/{use-join-requests-UioqYvHw.js → use-join-requests-51xqIM_A.js} +1 -1
  295. package/dist/client/assets/{use-main-panel-tabs-BwErZW6K.js → use-main-panel-tabs-DmvkA1OF.js} +1 -1
  296. package/dist/client/assets/{use-mcp-auth-status-Do2QZm9L.js → use-mcp-auth-status-CVLugyb-.js} +1 -1
  297. package/dist/client/assets/{use-mcp-client-COnRDE1N.js → use-mcp-client-alN3BSuJ.js} +1 -1
  298. package/dist/client/assets/{use-mcp-prompts-D6kpqd0T.js → use-mcp-prompts-C5SH_xGs.js} +1 -1
  299. package/dist/client/assets/{use-mcp-tools-jthd3Rd0.js → use-mcp-tools-s04xKOM2.js} +1 -1
  300. package/dist/client/assets/{use-members-CkNBEhUe.js → use-members-DF7c1t5_.js} +1 -1
  301. package/dist/client/assets/{use-mobile-9NhDeVlP.js → use-mobile-DEWonsbr.js} +1 -1
  302. package/dist/client/assets/{use-navigate-to-agent-DINkoobx.js → use-navigate-to-agent-MADN_glW.js} +1 -1
  303. package/dist/client/assets/use-new-blocks-editor-D6QRwqGF.js +1 -0
  304. package/dist/client/assets/{use-open-billing-url-DoBvvVEE.js → use-open-billing-url-CSK9y7YW.js} +1 -1
  305. package/dist/client/assets/{use-org-auth-client-3w2oRMXg.js → use-org-auth-client-CoFPUjTd.js} +1 -1
  306. package/dist/client/assets/{use-org-fs-D1ZsCp-k.js → use-org-fs-BQ9rCXmr.js} +1 -1
  307. package/dist/client/assets/{use-org-repo-syncs-BNvVEyTX.js → use-org-repo-syncs-CaR1Xa1F.js} +1 -1
  308. package/dist/client/assets/{use-org-sso-BJWlQYTu.js → use-org-sso-DzvTriO7.js} +1 -1
  309. package/dist/client/assets/{use-organization-roles-BgjgbvTH.js → use-organization-roles-DGclowcu.js} +1 -1
  310. package/dist/client/assets/{use-organization-settings-C5NCyvVD.js → use-organization-settings-BBoTt-lq.js} +1 -1
  311. package/dist/client/assets/{use-panel-navigate-D3_-3ULo.js → use-panel-navigate-yk7t3bcJ.js} +1 -1
  312. package/dist/client/assets/{use-project-scope-Cgetuc5v.js → use-project-scope-BxM698pt.js} +1 -1
  313. package/dist/client/assets/{use-releases-0U9GbBbc.js → use-releases-BwrUbxxj.js} +1 -1
  314. package/dist/client/assets/{use-reports-diagnostic-Bwcj9zK7.js → use-reports-diagnostic-CpCwaiXg.js} +1 -1
  315. package/dist/client/assets/{use-secrets-R8Tap4VY.js → use-secrets-BebZ2nF0.js} +1 -1
  316. package/dist/client/assets/{use-section-preview-base-C2CmSKKI.js → use-section-preview-base-Z5lePfkA.js} +1 -1
  317. package/dist/client/assets/{use-session-runtime-BGC0nV3W.js → use-session-runtime-Cgb0XGQC.js} +1 -1
  318. package/dist/client/assets/{use-tags-Bg5j1QlT.js → use-tags-D9QMq4tP.js} +1 -1
  319. package/dist/client/assets/{use-task-board-analytics-CjIlkwSI.js → use-task-board-analytics-jg77_cwt.js} +1 -1
  320. package/dist/client/assets/{use-task-board-events-wodqZnnT.js → use-task-board-events-gPs9mr0g.js} +1 -1
  321. package/dist/client/assets/{use-task-metadata-CtiuebFQ.js → use-task-metadata-DhhvrkSV.js} +1 -1
  322. package/dist/client/assets/{use-thread-analytics-CNI0VVVf.js → use-thread-analytics-DJFeqMXb.js} +1 -1
  323. package/dist/client/assets/{use-thread-outputs-l48Wu5jh.js → use-thread-outputs-CHJvnckm.js} +1 -1
  324. package/dist/client/assets/useInfiniteQuery-DWxFiM4L.js +1 -0
  325. package/dist/client/assets/{useQueries-BgbmDVzb.js → useQueries-Ckdgdjes.js} +1 -1
  326. package/dist/client/assets/useSuspenseInfiniteQuery-Cc2PctH-.js +1 -0
  327. package/dist/client/assets/{users-CuuvzgXl.js → users-BTZ7odtd.js} +1 -1
  328. package/dist/client/assets/{utils-BDOPgaMb.js → utils-BFq73cJ1.js} +1 -1
  329. package/dist/client/assets/variant-calendar-KMXxLfQ4.js +1 -0
  330. package/dist/client/assets/{variant-matcher-override-CQQJKk3b.js → variant-matcher-override-M6HMnoKw.js} +1 -1
  331. package/dist/client/assets/{view-mode-toggle-Dp-_utlA.js → view-mode-toggle-Bed1vKIv.js} +1 -1
  332. package/dist/client/assets/{virtual-mcp-D5QMxytx.js → virtual-mcp-DYlKBgbY.js} +1 -1
  333. package/dist/client/index.html +1 -1
  334. package/dist/server/cli.js +1 -1
  335. package/dist/server/server.js +1 -1
  336. package/package.json +1 -1
  337. package/dist/client/assets/agent-app-CWryStLp.js +0 -1
  338. package/dist/client/assets/agent-deck-1hNe0UfH.js +0 -1
  339. package/dist/client/assets/agent-library-C5witbkT.js +0 -1
  340. package/dist/client/assets/agent-library-file-DM3xkn-4.js +0 -1
  341. package/dist/client/assets/agent-overview-D3QLErbg.js +0 -1
  342. package/dist/client/assets/agent-settings-B4HC6tVf.js +0 -1
  343. package/dist/client/assets/agent-site-editor-code-ccdMrNae.js +0 -2
  344. package/dist/client/assets/agent-view-CwL0Ihke.js +0 -1
  345. package/dist/client/assets/api-keys-ClicNfxt.js +0 -1
  346. package/dist/client/assets/app-editor-B-3eao_i.js +0 -1
  347. package/dist/client/assets/category-editor-AJY0SMuG.js +0 -1
  348. package/dist/client/assets/config-BnXYxCUo.js +0 -1
  349. package/dist/client/assets/context-DzV3rzpW.js +0 -1
  350. package/dist/client/assets/flat-project-BZWINo8t.js +0 -1
  351. package/dist/client/assets/home-CaODs6J7.js +0 -1
  352. package/dist/client/assets/library-DbAhPtYr.js +0 -1
  353. package/dist/client/assets/post-calendar-Dfqfwp_c.js +0 -1
  354. package/dist/client/assets/project-app-view-Ci7wEdcu.js +0 -1
  355. package/dist/client/assets/project-feed-DpZMpeRT.js +0 -1
  356. package/dist/client/assets/project-reports-DE-0rcyS.js +0 -1
  357. package/dist/client/assets/project-tasks-BNyRFXYP.js +0 -1
  358. package/dist/client/assets/record-editor-D7BVOr7k.js +0 -1
  359. package/dist/client/assets/redirect-editor-DyPuscgG.js +0 -1
  360. package/dist/client/assets/reports-BxLGsxUd.js +0 -1
  361. package/dist/client/assets/reports-tab-D5bY459Y.js +0 -2
  362. package/dist/client/assets/rich-text-link-control-hBc2uTx7.js +0 -5
  363. package/dist/client/assets/route-BM-hTsDg.js +0 -1
  364. package/dist/client/assets/route-CcOcrij-.js +0 -1
  365. package/dist/client/assets/sections-editor-CYDtyAMS.js +0 -1
  366. package/dist/client/assets/seo-editor-CVsDdTJJ.js +0 -1
  367. package/dist/client/assets/task-route-dM3BzNeJ.js +0 -1
  368. package/dist/client/assets/tasks-BjNzn_32.js +0 -1
  369. package/dist/client/assets/use-new-blocks-editor-Ebux8YL4.js +0 -1
  370. package/dist/client/assets/useInfiniteQuery-DYqcvYaF.js +0 -1
  371. package/dist/client/assets/useSuspenseInfiniteQuery-BpUn49Al.js +0 -1
  372. package/dist/client/assets/variant-calendar-DSUsUR9c.js +0 -1
@@ -1,12 +1,12 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-eMBxQyXE.js","assets/index-QvCrIW6i.js","assets/index-Cj9p5mwA.css","assets/index-CtFpwpsJ.js","assets/gateway-client-C7cRG-yz.js","assets/dialog-KYKWBSL1.js","assets/X-B2rdTMzZ.js","assets/form-C8X8xSNl.js","assets/label-Bn6aGS7S.js","assets/input-dnKef9VJ.js","assets/utils-CVEq3hMx.js","assets/org-file-open-context-BPs82lJA.js","assets/use-mobile-9NhDeVlP.js","assets/use-panel-navigate-D3_-3ULo.js","assets/thread-route-I67M6zVK.js","assets/use-project-scope-Cgetuc5v.js","assets/repository-binding-Dmtv7YGN.js","assets/use-mcp-client-COnRDE1N.js","assets/auth-DbQy_3_H.js","assets/tooltip-C1he18et.js","assets/index-I0YWuNWN.js","assets/shell-layout-Cvnu1xoQ.js","assets/avatar-DWGXIvcf.js","assets/User01-C_D1KbSG.js","assets/Building02-C7IJqjKK.js","assets/UserSquare-DnwMjdPq.js","assets/agent-icon-DVHfcBN5.js","assets/AlertCircle-hP4CniDw.js","assets/Tool01-BlNfFonn.js","assets/ArrowUp-DKlHzRUJ.js","assets/ArrowLeft-snrf1tGx.js","assets/LinkBroken01-CP7hyYh2.js","assets/ShoppingBag01-Wr2FrDdb.js","assets/ZoomOut-D334bw-H.js","assets/CheckCircle-C10CcdE5.js","assets/Check-Ck9dGdFT.js","assets/ChevronUp-DxC2mC66.js","assets/Copy01-efUKcLhv.js","assets/CreditCard01-DdwRSoSe.js","assets/DotsVertical-MvZCuAVY.js","assets/Image01-DvcgVgi7.js","assets/Palette-BqhzEvZt.js","assets/XClose-C-LhQLI0.js","assets/Key01-Cj8Vm4p6.js","assets/Link01-tmXFK6e3.js","assets/LinkExternal01-DA-xCJ3a.js","assets/Monitor01-CWOF0aXq.js","assets/Sun-DYaxr-kZ.js","assets/Plus-C_BzVsMU.js","assets/SearchMd-Cn3ttzXj.js","assets/Trash01-DfS7U4fp.js","assets/Upload01-BcP6uGW4.js","assets/Users01-DmsoNf0W.js","assets/download-app-dialog-BubP7yx-.js","assets/use-clock-tick-BxAer4Nn.js","assets/command-CLhlH1Qw.js","assets/index-3ZF9KrLG.js","assets/integration-icon-B1V7QJ0Z.js","assets/project-icon-Cg1qPEYk.js","assets/new-project-dialog-BltQa2EK.js","assets/repository-import-picker-CKbCQvk9.js","assets/use-navigate-to-agent-DINkoobx.js","assets/thread-intent-KcG0jvJo.js","assets/backoff-8mStPHYB.js","assets/task-board-pB5Y0hMn.js","assets/schema-qHqkHHod.js","assets/slugify-CEUa2lfQ.js","assets/repository-picker-DYjy65xM.js","assets/useInfiniteQuery-DYqcvYaF.js","assets/infiniteQueryObserver-B4E75_QN.js","assets/collection-search-DoIg4pOf.js","assets/use-debounced-value-BDfI-sPg.js","assets/use-organization-settings-C5NCyvVD.js","assets/use-is-desktop-app-BNujXJc_.js","assets/required-auth-layout-8zcKPB4g.js","assets/autosend-DWW-s_U0.js","assets/use-org-sso-BJWlQYTu.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-DkpmcsoX.js","assets/use-session-runtime-BGC0nV3W.js","assets/chat-context-CiWqcBU2.js","assets/use-decopilot-events-wck0cVko.js","assets/use-ai-providers-B_uDPHx4.js","assets/location-DPIrGNp7.js","assets/select-C4t2zfNW.js","assets/usage-stats-DW00xCiE.js","assets/use-copy-DRzLqLAb.js","assets/markdown-BSSkHnhk.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/tabs-ewvilFDB.js","assets/use-deco-credits-Dr3QUmqQ.js","assets/toggle-group-CWERIeKx.js","assets/tool-namespace-DmnQIdtF.js","assets/use-open-billing-url-DoBvvVEE.js","assets/decopilot-Dfink1sA.js","assets/checkbox-CXteSDot.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-BaUprubX.js","assets/drawer-DWkQ_glv.js","assets/index-BhYlaEJD.js","assets/input-DzrhMQKQ.js","assets/suggestion-BZrPkOTO.js","assets/use-mcp-prompts-D6kpqd0T.js","assets/use-org-fs-D1ZsCp-k.js","assets/question-004-sINsf4GQ.js","assets/use-members-CkNBEhUe.js","assets/use-org-auth-client-3w2oRMXg.js","assets/feature-paywall-za9mjhQi.js","assets/plan-ladder-BdvlpVQQ.js","assets/add-connection-dialog-BXpA-FpE.js","assets/extract-connection-data-qdZ9yL7M.js","assets/metadata-D72DunRR.js","assets/connection-7beMMzWx.js","assets/connection-card-Be7WoVGH.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-Da9tbVx7.js","assets/use-connection-Bxzd0HJT.js","assets/connection-form-helpers-RVubyUH7.js","assets/authenticate-and-persist-oauth-BbZoD5Jl.js","assets/mcp-oauth-UG4bZwDx.js","assets/collection-tabs-Dvji2ooE.js","assets/badge-we6p4hry.js","assets/use-infinite-scroll-DZuBfYhD.js","assets/useSuspenseInfiniteQuery-BpUn49Al.js","assets/use-task-board-events-wodqZnnT.js","assets/use-chat-layout-state-B-w0TqPh.js","assets/use-file-configs-B-rmtKOK.js","assets/site-slug-DebpOoQq.js"])))=>i.map(i=>d[i]);
2
- import{aO as Ue,c as E,b as B,r as P,l as z,j as n,au as re,bM as Lt,av as se,bL as Le,B as Y,at as ws,as as Ss,bN as Cs,bK as Ns,x as Se,aU as Is,e3 as we,e4 as gt,a2 as Ts,e as _s,t as Ee,q as ee,X as Ce,d as rt,e1 as Ms,Z as Ds,K as Rs,m as Es,I as Ps,F as Us,H as Ls,G as Ae,aj as xt,ah as vt,ai as bt,h as Fs,aG as Os,aF as zs,ak as $s,cQ as Bs,cU as ye,aK as Ks,cW as qs,aL as At,aP as Qs,a as Ws,U as Ys,V as Gs,ay as tt,a7 as Ft,bT as Hs,aE as Js}from"./index-QvCrIW6i.js";import{c as Zs,d as Ot,P as Xs,i as en}from"./index-CtFpwpsJ.js";import{K as tn,b as sn}from"./shell-layout-Cvnu1xoQ.js";import{a as nn}from"./repository-binding-Dmtv7YGN.js";import{w as on,A as rn}from"./autosend-DWW-s_U0.js";import{s as an,r as yt,i as ln,c as Vn,w as cn,H as dn}from"./chat-draft-DkpmcsoX.js";import{u as un}from"./use-session-runtime-BGC0nV3W.js";import{i as zt}from"./LinkBroken01-CP7hyYh2.js";import{i as $t}from"./ArrowUp-DKlHzRUJ.js";import{n as Bt}from"./ShoppingBag01-Wr2FrDdb.js";import{i as it}from"./Check-Ck9dGdFT.js";import{t as We,aK as Kt,a2 as qt,aL as st,f as at,as as pn,_ as fn,aM as hn,q as Qt,aN as Wt,I as mn,aO as gn}from"./agent-icon-DVHfcBN5.js";import{a as Yt}from"./Image01-DvcgVgi7.js";import{h as xn}from"./UserSquare-DnwMjdPq.js";import{i as vn}from"./Upload01-BcP6uGW4.js";import{i as lt}from"./X-B2rdTMzZ.js";import{a as Fe,b as Ye,c as Ge,i as bn,k as An,l as yn,m as jn,n as kn,o as wn,p as Sn,u as Vt,q as Cn,f as Nn,s as In,d as Tn}from"./chat-context-CiWqcBU2.js";import{o as _n,z as Mn,q as Dn,c as Rn}from"./thread-intent-KcG0jvJo.js";import{i as En}from"./AlertCircle-hP4CniDw.js";import{a as Pn}from"./Copy01-efUKcLhv.js";import{a as nt,b as ct,d as dt,f as ut,F as Gt}from"./form-C8X8xSNl.js";import{c as Un,S as Ln,b as Fn,a as On,d as zn}from"./select-C4t2zfNW.js";import{t as Ht}from"./ChevronUp-DxC2mC66.js";import{T as He,a as Je,b as Ze}from"./tooltip-C1he18et.js";import{i as $n}from"./ArrowLeft-snrf1tGx.js";import{i as Jt,M as Bn,S as Kn}from"./usage-stats-DW00xCiE.js";import{c as qn,b as Qn}from"./tabs-ewvilFDB.js";import{d as Wn,h as Yn,c as Gn,b as Hn,D as Jn}from"./dialog-KYKWBSL1.js";import{e as Oe,f as Zn,c as Xn,g as eo}from"./use-decopilot-events-wck0cVko.js";import{u as to}from"./use-deco-credits-Dr3QUmqQ.js";import{I as so}from"./input-dnKef9VJ.js";import{T as jt,a as no}from"./toggle-group-CWERIeKx.js";import{s as oo}from"./tool-namespace-DmnQIdtF.js";import{t as ro}from"./utils-CVEq3hMx.js";import{u as io}from"./use-open-billing-url-DoBvvVEE.js";import{s as ao}from"./XClose-C-LhQLI0.js";import{M as lo,m as pt,g as Vo,a as co}from"./decopilot-Dfink1sA.js";import{a as Zt,b as Xt,P as es}from"./popover-BaUprubX.js";import{c as uo,b as po,a as fo,D as ho}from"./drawer-DWkQ_glv.js";import{u as ts}from"./use-mobile-9NhDeVlP.js";import{t as mo}from"./Tool01-BlNfFonn.js";import{d as go,a as xo}from"./use-organization-settings-C5NCyvVD.js";import{u as ss,c as vo,d as bo}from"./use-ai-providers-B_uDPHx4.js";import{M as Ao}from"./index-BhYlaEJD.js";import{p as ns,u as yo,T as jo,a as ko,U as wo}from"./input-DzrhMQKQ.js";import{d as So,g as kt,s as Co}from"./gateway-client-C7cRG-yz.js";import{u as No}from"./use-mcp-client-COnRDE1N.js";import{l as Io,g as To}from"./use-mcp-prompts-D6kpqd0T.js";import{i as _o}from"./Link01-tmXFK6e3.js";import{s as wt}from"./Plus-C_BzVsMU.js";import"./suggestion-BZrPkOTO.js";import{p as Mo,q as Do}from"./question-004-sINsf4GQ.js";import{A as Ro}from"./avatar-DWGXIvcf.js";import{u as Eo}from"./use-members-CkNBEhUe.js";import{F as St}from"./feature-paywall-za9mjhQi.js";import{A as Po}from"./add-connection-dialog-BXpA-FpE.js";import{u as Uo}from"./use-task-board-events-wodqZnnT.js";import{d as Lo}from"./use-chat-layout-state-B-w0TqPh.js";import{u as Fo}from"./use-is-desktop-app-BNujXJc_.js";const Oo=Ue("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const zo=Ue("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const $o=Ue("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Bo=Ue("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Ko=Ue("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",tl=44,qo={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"},Qo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Wo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=E.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,f=B(),[m,h]=P.useState(d),[g,x]=P.useState(!1);let v;e[0]!==c?(v=()=>{x(!0),c?.()},e[0]=c,e[1]=v):v=e[1];const b=v;if(g)return null;const j=Qo[p],A=qo[p];let k;e[2]!==j||e[3]!==A?(k=z("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",j,A),e[2]=j,e[3]=A,e[4]=k):k=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=()=>h(Yo),e[5]=w):w=e[5];const y=m&&"rounded-b-none",C=!m&&"rounded-b-xl";let S;e[6]!==y||e[7]!==C?(S=z("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",y,C),e[6]=y,e[7]=C,e[8]=S):S=e[8];const I=Wo[p];let N;e[9]!==I?(N=z("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let M;e[11]!==s||e[12]!==N?(M=n.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=M):M=e[13];let R;e[14]!==o?(R=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=R):R=e[15];let D;e[16]!==r?(D=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=D):D=e[17];const U=m?"rotate(180deg)":"rotate(0deg)";let _;e[18]!==U?(_=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Ht,{size:16,style:{transform:U,transition:`transform 180ms ${et}`}})}),e[18]=U,e[19]=_):_=e[19];let L;e[20]!==f?(L=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=L):L=e[21];let F;e[22]!==f?(F=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=F):F=e[23];let q,$;e[24]!==b?(q=le=>{le.stopPropagation(),b()},$=le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),le.stopPropagation(),b())},e[24]=b,e[25]=q,e[26]=$):(q=e[25],$=e[26]);let O;e[27]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(lt,{size:16}),e[27]=O):O=e[27];let W;e[28]!==L||e[29]!==F||e[30]!==q||e[31]!==$?(W=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,title:F,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:O}),e[28]=L,e[29]=F,e[30]=q,e[31]=$,e[32]=W):W=e[32];let X;e[33]!==m||e[34]!==M||e[35]!==R||e[36]!==D||e[37]!==_||e[38]!==W||e[39]!==S?(X=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":m,onClick:w,className:S,children:[M,R,D,_,W]}),e[33]=m,e[34]=M,e[35]=R,e[36]=D,e[37]=_,e[38]=W,e[39]=S,e[40]=X):X=e[40];const te=m?"1fr":"0fr";let J;e[41]!==te?(J={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${et}`},e[41]=te,e[42]=J):J=e[42];let ae;e[43]===Symbol.for("react.memo_cache_sentinel")?(ae={overflow:"hidden",minHeight:0},e[43]=ae):ae=e[43];const T=m?1:0;let Q;e[44]!==T?(Q={opacity:T,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=T,e[45]=Q):Q=e[45];let Z;e[46]!==i?(Z=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=Z):Z=e[47];let H;e[48]!==V||e[49]!==i?(H=V?n.jsx("div",{className:z("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=H):H=e[50];let ne;e[51]!==Z||e[52]!==H?(ne=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,H]}),e[51]=Z,e[52]=H,e[53]=ne):ne=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ce;e[57]!==Q||e[58]!==ne||e[59]!==G?(ce=n.jsx("div",{style:ae,children:n.jsxs("div",{className:"flex flex-col",style:Q,children:[ne,G]})}),e[57]=Q,e[58]=ne,e[59]=G,e[60]=ce):ce=e[60];let ie;e[61]!==J||e[62]!==ce?(ie=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:ce}),e[61]=J,e[62]=ce,e[63]=ie):ie=e[63];let fe;return e[64]!==X||e[65]!==ie||e[66]!==k||e[67]!==p?(fe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:k,children:[X,ie]}),e[64]=X,e[65]=ie,e[66]=k,e[67]=p,e[68]=fe):fe=e[68],fe}function Yo(t){return!t}const Go=re({content:se().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Le(["pending","in_progress","completed"]),activeForm:se().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),os=re({todos:Lt(Go)}),Ho="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.";_n({description:Ho,inputSchema:Mn(os),execute:async({todos:t})=>({ok:!0,count:t.length})});const Jo="tool-todo_write",Zo=new Set(["input-available","output-available"]);function Xo(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==Jo||typeof i.state!="string"||!Zo.has(i.state))continue;const a=os.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function rs(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:ro(oo(o)),input:s.input})}return e}function is(t){return t.at(-1)}function as(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function er(t){return t?t.message.startsWith("[CREDITS]"):!1}const tr={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function sr(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&er(s))return{...tr,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(k=>k.type==="tool-user_ask").filter(k=>k.state!=="output-available").length,c=V.some(Jt),p=as(l),f=rs(V),m=Xo(e),h=r?null:an(s),g=r?null:Dn(s),x=!r&&!!s&&!h&&!g,v=f.length>0||r&&i,b=p.length>0,A=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||v||b||c))&&!x;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:h,hasTodos:m.length>0,showError:x,showWarning:A,hasApprovals:v,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:m}}function ls(){const t=E.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=Fe(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=sr({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function sl(){const t=ls(),e=Oe("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)+Number(t.hasTaskSuggestion)}const Ct="start-task",nr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openai-conversation-D0z85aeO.js","assets/index-BDhW9xxN.js","assets/index-Cj9p5mwA.css","assets/index-DClhYi2n.js","assets/gateway-client-C0zWKCU4.js","assets/dialog-BGB8jiGJ.js","assets/X-B8pJz_49.js","assets/form-Bc6DsBML.js","assets/label-uTNaIuWI.js","assets/input-DrKcGYrl.js","assets/utils-CVEq3hMx.js","assets/org-file-open-context-BMxi_LQF.js","assets/use-mobile-DEWonsbr.js","assets/use-panel-navigate-yk7t3bcJ.js","assets/thread-route-BRm6UAyi.js","assets/use-project-scope-BxM698pt.js","assets/repository-binding-C6IRmj-B.js","assets/use-mcp-client-alN3BSuJ.js","assets/auth-2OsbyFrK.js","assets/tooltip-D555rgHk.js","assets/index-Bjctp948.js","assets/shell-layout-CTITeNJr.js","assets/avatar-BE-fSFZD.js","assets/User01-B-OC1WKF.js","assets/Building02-Cn4v8u0T.js","assets/UserSquare-DAPHqKUt.js","assets/agent-icon-CP_Ce3vP.js","assets/AlertCircle-BhLvKd51.js","assets/Tool01-DQQGDcpr.js","assets/ArrowUp-BiSVkN3f.js","assets/ArrowLeft-BGBmg7V7.js","assets/LinkBroken01-CKAYv5Ws.js","assets/ShoppingBag01-BxQzf-9l.js","assets/ZoomOut-DsjWT-m0.js","assets/CheckCircle-DtMOIYIN.js","assets/Check-BIm8oPAI.js","assets/ChevronUp-CW9NwQNu.js","assets/Copy01-CVhdu84v.js","assets/CreditCard01-YvQwrjsc.js","assets/DotsVertical-D-FvZQn0.js","assets/Image01-CGBVFmAI.js","assets/Palette-CbtdR6wJ.js","assets/XClose-BqnBpCCh.js","assets/Key01-CwVo9Cfv.js","assets/Link01-9k5oDSP-.js","assets/LinkExternal01-DNJF5sr3.js","assets/Monitor01-emBSPIO-.js","assets/Sun-D6nY-Bb0.js","assets/Plus-088McVZs.js","assets/SearchMd-CRK8FN15.js","assets/Trash01-B3Mmvw35.js","assets/Upload01-jQPNdEwy.js","assets/Users01-ClTO42s_.js","assets/download-app-dialog-C1623CnU.js","assets/use-clock-tick-Dx4PkWs4.js","assets/command-B4jGFd17.js","assets/index-BOGlzqxy.js","assets/integration-icon-BDP6F9Pj.js","assets/project-icon-CtBv5qE9.js","assets/new-project-dialog-C_qrCiK3.js","assets/repository-import-picker-COTFeOcQ.js","assets/use-navigate-to-agent-MADN_glW.js","assets/thread-intent-y4sFV6nC.js","assets/backoff-8mStPHYB.js","assets/task-board-BpcFKojY.js","assets/schema-B4_xo1tD.js","assets/slugify-CEUa2lfQ.js","assets/repository-picker-sBc4_JWX.js","assets/useInfiniteQuery-DWxFiM4L.js","assets/infiniteQueryObserver-8nco6j0l.js","assets/collection-search-9MFDsQ6p.js","assets/use-debounced-value-DCwb28TF.js","assets/use-organization-settings-BBoTt-lq.js","assets/use-is-desktop-app-BNujXJc_.js","assets/required-auth-layout-CslXPG0m.js","assets/autosend-BL2q_s0u.js","assets/use-org-sso-DzvTriO7.js","assets/shell-layout-CE2Eihra.css","assets/chat-draft-jYk7-XVU.js","assets/use-session-runtime-Cgb0XGQC.js","assets/chat-context-Blq_eRG7.js","assets/use-decopilot-events-CY9KSVWJ.js","assets/use-ai-providers-cz2PnRt5.js","assets/location-DPIrGNp7.js","assets/select-B6DzqJiH.js","assets/usage-stats-cLtXqoaq.js","assets/use-copy-D1Nm-kgX.js","assets/markdown-LIOti3qC.js","assets/format-time-CjIPQhCN.js","assets/differenceInSeconds-C3x8sHUj.js","assets/tabs-QC_e18gg.js","assets/use-deco-credits-3BarR1a3.js","assets/toggle-group-B2CGQVNc.js","assets/tool-namespace-DmnQIdtF.js","assets/use-open-billing-url-CSK9y7YW.js","assets/decopilot-NLRNUzMe.js","assets/checkbox-D5Dxpou_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/popover-BeYdUP-7.js","assets/drawer-CDzlciSr.js","assets/index-CN7c5BIN.js","assets/input--BdO_-Si.js","assets/suggestion-CRtEJ9La.js","assets/use-mcp-prompts-C5SH_xGs.js","assets/use-org-fs-BQ9rCXmr.js","assets/question-004-sINsf4GQ.js","assets/use-members-DF7c1t5_.js","assets/use-org-auth-client-CoFPUjTd.js","assets/feature-paywall-B0iudT_s.js","assets/plan-ladder-DCJHDLS1.js","assets/add-connection-dialog-BhN1VUAm.js","assets/extract-connection-data-BnK0gWOf.js","assets/metadata-D72DunRR.js","assets/connection-CwaA-4mr.js","assets/connection-card-BtsAXkN4.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-MfQKTdum.js","assets/use-connection-hMJ4m1KM.js","assets/connection-form-helpers-BV0FZHte.js","assets/authenticate-and-persist-oauth-BGZheh1t.js","assets/mcp-oauth-DdEBE0Y7.js","assets/collection-tabs-jDuTyfYq.js","assets/badge-CWkPL4_H.js","assets/use-infinite-scroll-DoBJIre7.js","assets/useSuspenseInfiniteQuery-Cc2PctH-.js","assets/use-task-board-events-gPs9mr0g.js","assets/use-chat-layout-state-C_QstcMu.js","assets/use-file-configs-Dk0C1WSo.js","assets/site-slug-DebpOoQq.js"])))=>i.map(i=>d[i]);
2
+ import{aO as Ue,c as E,b as B,r as P,l as z,j as n,au as re,bM as Lt,av as se,bL as Le,B as Y,at as ws,as as Ss,bN as Cs,bK as Ns,x as Se,aU as Is,e4 as we,e5 as gt,a2 as Ts,e as _s,t as Ee,q as ee,X as Ce,d as rt,e2 as Ms,Z as Ds,K as Rs,m as Es,I as Ps,F as Us,H as Ls,G as Ae,aj as xt,ah as vt,ai as bt,h as Fs,aG as Os,aF as zs,ak as $s,cQ as Bs,cU as ye,aK as Ks,cW as qs,aL as At,aP as Qs,a as Ws,U as Ys,V as Gs,ay as tt,a7 as Ft,bT as Hs,aE as Js}from"./index-BDhW9xxN.js";import{c as Zs,d as Ot,P as Xs,i as en}from"./index-DClhYi2n.js";import{K as tn,b as sn}from"./shell-layout-CTITeNJr.js";import{a as nn}from"./repository-binding-C6IRmj-B.js";import{w as on,A as rn}from"./autosend-BL2q_s0u.js";import{s as an,r as yt,i as ln,c as Vn,w as cn,H as dn}from"./chat-draft-jYk7-XVU.js";import{u as un}from"./use-session-runtime-Cgb0XGQC.js";import{i as zt}from"./LinkBroken01-CKAYv5Ws.js";import{i as $t}from"./ArrowUp-BiSVkN3f.js";import{n as Bt}from"./ShoppingBag01-BxQzf-9l.js";import{i as it}from"./Check-BIm8oPAI.js";import{t as We,aK as Kt,a2 as qt,aL as st,f as at,as as pn,_ as fn,aM as hn,q as Qt,aN as Wt,I as mn,aO as gn}from"./agent-icon-CP_Ce3vP.js";import{a as Yt}from"./Image01-CGBVFmAI.js";import{h as xn}from"./UserSquare-DAPHqKUt.js";import{i as vn}from"./Upload01-jQPNdEwy.js";import{i as lt}from"./X-B8pJz_49.js";import{a as Fe,b as Ye,c as Ge,i as bn,k as An,l as yn,m as jn,n as kn,o as wn,p as Sn,u as Vt,q as Cn,f as Nn,s as In,d as Tn}from"./chat-context-Blq_eRG7.js";import{o as _n,z as Mn,q as Dn,c as Rn}from"./thread-intent-y4sFV6nC.js";import{i as En}from"./AlertCircle-BhLvKd51.js";import{a as Pn}from"./Copy01-CVhdu84v.js";import{a as nt,b as ct,d as dt,f as ut,F as Gt}from"./form-Bc6DsBML.js";import{c as Un,S as Ln,b as Fn,a as On,d as zn}from"./select-B6DzqJiH.js";import{t as Ht}from"./ChevronUp-CW9NwQNu.js";import{T as He,a as Je,b as Ze}from"./tooltip-D555rgHk.js";import{i as $n}from"./ArrowLeft-BGBmg7V7.js";import{i as Jt,M as Bn,S as Kn}from"./usage-stats-cLtXqoaq.js";import{c as qn,b as Qn}from"./tabs-QC_e18gg.js";import{d as Wn,h as Yn,c as Gn,b as Hn,D as Jn}from"./dialog-BGB8jiGJ.js";import{e as Oe,f as Zn,c as Xn,g as eo}from"./use-decopilot-events-CY9KSVWJ.js";import{u as to}from"./use-deco-credits-3BarR1a3.js";import{I as so}from"./input-DrKcGYrl.js";import{T as jt,a as no}from"./toggle-group-B2CGQVNc.js";import{s as oo}from"./tool-namespace-DmnQIdtF.js";import{t as ro}from"./utils-CVEq3hMx.js";import{u as io}from"./use-open-billing-url-CSK9y7YW.js";import{s as ao}from"./XClose-BqnBpCCh.js";import{M as lo,m as pt,g as Vo,a as co}from"./decopilot-NLRNUzMe.js";import{a as Zt,b as Xt,P as es}from"./popover-BeYdUP-7.js";import{c as uo,b as po,a as fo,D as ho}from"./drawer-CDzlciSr.js";import{u as ts}from"./use-mobile-DEWonsbr.js";import{t as mo}from"./Tool01-DQQGDcpr.js";import{d as go,a as xo}from"./use-organization-settings-BBoTt-lq.js";import{u as ss,c as vo,d as bo}from"./use-ai-providers-cz2PnRt5.js";import{M as Ao}from"./index-CN7c5BIN.js";import{p as ns,u as yo,T as jo,a as ko,U as wo}from"./input--BdO_-Si.js";import{d as So,g as kt,s as Co}from"./gateway-client-C0zWKCU4.js";import{u as No}from"./use-mcp-client-alN3BSuJ.js";import{l as Io,g as To}from"./use-mcp-prompts-C5SH_xGs.js";import{i as _o}from"./Link01-9k5oDSP-.js";import{s as wt}from"./Plus-088McVZs.js";import"./suggestion-CRtEJ9La.js";import{p as Mo,q as Do}from"./question-004-sINsf4GQ.js";import{A as Ro}from"./avatar-BE-fSFZD.js";import{u as Eo}from"./use-members-DF7c1t5_.js";import{F as St}from"./feature-paywall-B0iudT_s.js";import{A as Po}from"./add-connection-dialog-BhN1VUAm.js";import{u as Uo}from"./use-task-board-events-gPs9mr0g.js";import{d as Lo}from"./use-chat-layout-state-C_QstcMu.js";import{u as Fo}from"./use-is-desktop-app-BNujXJc_.js";const Oo=Ue("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);const zo=Ue("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const $o=Ue("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Bo=Ue("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Ko=Ue("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),et="cubic-bezier(0.645, 0.045, 0.355, 1)",tl=44,qo={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"},Qo={default:"border-border",error:"border-destructive/30",warning:"border-warning/30"},Wo={default:"text-muted-foreground",error:"text-destructive",warning:"text-warning"};function pe(t){const e=E.c(69),{icon:s,label:o,count:r,title:i,footerLeft:a,footerRight:l,children:V,defaultExpanded:d,variant:u,onClose:c}=t,p=u===void 0?"default":u,f=B(),[m,h]=P.useState(d),[g,x]=P.useState(!1);let v;e[0]!==c?(v=()=>{x(!0),c?.()},e[0]=c,e[1]=v):v=e[1];const b=v;if(g)return null;const j=Qo[p],A=qo[p];let k;e[2]!==j||e[3]!==A?(k=z("relative flex flex-col rounded-xl bg-background border shadow-md","w-[calc(100%-16px)] max-w-[640px] mx-auto mb-2",j,A),e[2]=j,e[3]=A,e[4]=k):k=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=()=>h(Yo),e[5]=w):w=e[5];const y=m&&"rounded-b-none",C=!m&&"rounded-b-xl";let S;e[6]!==y||e[7]!==C?(S=z("flex items-center gap-2 w-full px-3 py-2 text-sm text-left","hover:bg-accent/50 transition-colors rounded-t-xl",y,C),e[6]=y,e[7]=C,e[8]=S):S=e[8];const I=Wo[p];let N;e[9]!==I?(N=z("shrink-0",I),e[9]=I,e[10]=N):N=e[10];let M;e[11]!==s||e[12]!==N?(M=n.jsx("span",{className:N,children:s}),e[11]=s,e[12]=N,e[13]=M):M=e[13];let R;e[14]!==o?(R=n.jsx("span",{className:"flex-1 min-w-0 truncate",children:o}),e[14]=o,e[15]=R):R=e[15];let D;e[16]!==r?(D=r?n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:r}):null,e[16]=r,e[17]=D):D=e[17];const U=m?"rotate(180deg)":"rotate(0deg)";let _;e[18]!==U?(_=n.jsx("span",{"aria-hidden":"true",className:"text-muted-foreground shrink-0 flex items-center justify-center",children:n.jsx(Ht,{size:16,style:{transform:U,transition:`transform 180ms ${et}`}})}),e[18]=U,e[19]=_):_=e[19];let L;e[20]!==f?(L=f("chat.collapsibleHighlight.closeLabel"),e[20]=f,e[21]=L):L=e[21];let F;e[22]!==f?(F=f("chat.collapsibleHighlight.closeTitle"),e[22]=f,e[23]=F):F=e[23];let q,$;e[24]!==b?(q=le=>{le.stopPropagation(),b()},$=le=>{(le.key==="Enter"||le.key===" ")&&(le.preventDefault(),le.stopPropagation(),b())},e[24]=b,e[25]=q,e[26]=$):(q=e[25],$=e[26]);let O;e[27]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(lt,{size:16}),e[27]=O):O=e[27];let W;e[28]!==L||e[29]!==F||e[30]!==q||e[31]!==$?(W=n.jsx("span",{role:"button",tabIndex:0,"data-testid":"collapsible-highlight-close","aria-label":L,title:F,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:O}),e[28]=L,e[29]=F,e[30]=q,e[31]=$,e[32]=W):W=e[32];let X;e[33]!==m||e[34]!==M||e[35]!==R||e[36]!==D||e[37]!==_||e[38]!==W||e[39]!==S?(X=n.jsxs("button",{type:"button","data-testid":"collapsible-highlight-chip","aria-expanded":m,onClick:w,className:S,children:[M,R,D,_,W]}),e[33]=m,e[34]=M,e[35]=R,e[36]=D,e[37]=_,e[38]=W,e[39]=S,e[40]=X):X=e[40];const te=m?"1fr":"0fr";let J;e[41]!==te?(J={display:"grid",gridTemplateRows:te,transition:`grid-template-rows 180ms ${et}`},e[41]=te,e[42]=J):J=e[42];let ae;e[43]===Symbol.for("react.memo_cache_sentinel")?(ae={overflow:"hidden",minHeight:0},e[43]=ae):ae=e[43];const T=m?1:0;let Q;e[44]!==T?(Q={opacity:T,transition:`opacity 120ms ${et}`,maxHeight:"60vh"},e[44]=T,e[45]=Q):Q=e[45];let Z;e[46]!==i?(Z=i?n.jsx("div",{className:"flex items-start gap-2 px-4 pt-4 pb-5 border-t border-dashed border-border/60",children:n.jsx("p",{className:"flex-1 text-base font-medium text-foreground min-w-0",children:i})}):n.jsx("div",{className:"border-t border-dashed border-border/60"}),e[46]=i,e[47]=Z):Z=e[47];let H;e[48]!==V||e[49]!==i?(H=V?n.jsx("div",{className:z("pb-4",!i&&"pt-4"),children:V}):null,e[48]=V,e[49]=i,e[50]=H):H=e[50];let ne;e[51]!==Z||e[52]!==H?(ne=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[Z,H]}),e[51]=Z,e[52]=H,e[53]=ne):ne=e[53];let G;e[54]!==a||e[55]!==l?(G=a||l?n.jsx("div",{className:"shrink-0 border-t border-border px-3 py-3 pb-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{children:a}),n.jsx("div",{className:"flex items-center gap-2",children:l})]})}):null,e[54]=a,e[55]=l,e[56]=G):G=e[56];let ce;e[57]!==Q||e[58]!==ne||e[59]!==G?(ce=n.jsx("div",{style:ae,children:n.jsxs("div",{className:"flex flex-col",style:Q,children:[ne,G]})}),e[57]=Q,e[58]=ne,e[59]=G,e[60]=ce):ce=e[60];let ie;e[61]!==J||e[62]!==ce?(ie=n.jsx("div",{"data-testid":"collapsible-highlight-body",style:J,children:ce}),e[61]=J,e[62]=ce,e[63]=ie):ie=e[63];let fe;return e[64]!==X||e[65]!==ie||e[66]!==k||e[67]!==p?(fe=n.jsxs("div",{"data-testid":"collapsible-highlight","data-variant":p,className:k,children:[X,ie]}),e[64]=X,e[65]=ie,e[66]=k,e[67]=p,e[68]=fe):fe=e[68],fe}function Yo(t){return!t}const Go=re({content:se().min(1).describe("Imperative form, e.g. 'Implement the login flow'"),status:Le(["pending","in_progress","completed"]),activeForm:se().min(1).describe("Present-continuous form shown in the UI while the todo is in progress, e.g. 'Implementing the login flow'")}),os=re({todos:Lt(Go)}),Ho="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.";_n({description:Ho,inputSchema:Mn(os),execute:async({todos:t})=>({ok:!0,count:t.length})});const Jo="tool-todo_write",Zo=new Set(["input-available","output-available"]);function Xo(t){for(let e=t.length-1;e>=0;e--){const s=t[e];if(s.role!=="assistant")continue;const o=s.parts;if(Array.isArray(o))for(let r=o.length-1;r>=0;r--){const i=o[r];if(i.type!==Jo||typeof i.state!="string"||!Zo.has(i.state))continue;const a=os.safeParse(i.input);if(a.success)return a.data.todos}}return[]}function rs(t){const e=[];for(const s of t)if("state"in s&&s.state==="approval-requested"&&"approval"in s&&s.approval?.id&&"toolCallId"in s&&s.toolCallId){const o="toolName"in s&&typeof s.toolName=="string"?s.toolName:s.type.startsWith("tool-")?s.type.replace("tool-",""):"Tool";e.push({approvalId:s.approval.id,toolCallId:s.toolCallId,toolName:o,friendlyName:ro(oo(o)),input:s.input})}return e}function is(t){return t.at(-1)}function as(t){const e=[];for(const s of t)s.type==="tool-propose_plan"&&s.state==="input-available"&&e.push({toolCallId:s.toolCallId,plan:s.input.plan,state:s.state});return e}function er(t){return t?t.message.startsWith("[CREDITS]"):!1}const tr={isCreditExhausted:!1,planRefusal:null,subscriptionErrorKind:null,hasTodos:!1,showError:!1,showWarning:!1,hasApprovals:!1,hasPlans:!1,isWaitingForUserInput:!1,hasTaskSuggestion:!1,todos:[]};function sr(t){const{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=t;if(!r&&s&&er(s))return{...tr,isCreditExhausted:!0};const a=e.at(-1),l=a?.role==="assistant"?a.parts:[],V=l,u=!!V.filter(k=>k.type==="tool-user_ask").filter(k=>k.state!=="output-available").length,c=V.some(Jt),p=as(l),f=rs(V),m=Xo(e),h=r?null:an(s),g=r?null:Dn(s),x=!r&&!!s&&!h&&!g,v=f.length>0||r&&i,b=p.length>0,A=!r&&!!o&&o!=="stop"&&!(o==="tool-calls"&&(u||v||b||c))&&!x;return{isCreditExhausted:!1,planRefusal:g,subscriptionErrorKind:h,hasTodos:m.length>0,showError:x,showWarning:A,hasApprovals:v,hasPlans:b,isWaitingForUserInput:u,hasTaskSuggestion:c,todos:m}}function ls(){const t=E.c(6),{messages:e,error:s,finishReason:o,isStreaming:r,isWaitingForApprovals:i}=Fe(),a=s??null,l=o??null;let V;return t[0]!==r||t[1]!==i||t[2]!==e||t[3]!==a||t[4]!==l?(V=sr({messages:e,error:a,finishReason:l,isStreaming:r,isWaitingForApprovals:i}),t[0]=r,t[1]=i,t[2]=e,t[3]=a,t[4]=l,t[5]=V):V=t[5],V}function sl(){const t=ls(),e=Oe("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)+Number(t.hasTaskSuggestion)}const Ct="start-task",nr=`Turn the report below into a running task. The user pressed "Start task", which authorizes delegation.
3
3
 
4
4
  1. Read the report and any attached screenshots. Carry the reporter's own words into the task description, plus the URL of any attachment.
5
5
  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.
6
6
  3. Call TASK_BOARD_ITEM_CREATE with a concise title, the full description, the chosen repo as owner/name, assigneeId "super-agent", and onDuplicate "return_existing". That assignment is what queues the work; the duplicate option makes the tool hand back an existing task when one already covers this report instead of opening a second one.
7
7
  4. Reply with the task key the tool returned (e.g. DECO-144) and one line on what you filed. If the output says \`deduplicated: true\`, say the report was already tracked by that task and quote its \`duplicateReason\`. 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.
8
8
 
9
- The report follows.`;function or(t){return{...t,content:[{type:"paragraph",content:[Zs({id:Ct,name:Ct,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:nr}}]})]},...t.content??[]]}}function rr(t){const e=E.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=B();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==V?(d=z("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx($n,{size:14}),e[4]=c):c=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:c}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let m;e[10]!==a||e[11]!==f||e[12]!==o?(m=a("chat.pagination.counter",{current:f,total:o}),e[10]=a,e[11]=f,e[12]=o,e[13]=m):m=e[13];let h;e[14]!==m?(h=n.jsx("span",{className:"tabular-nums text-xs",children:m}),e[14]=m,e[15]=h):h=e[15];const g=s===o-1,x=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let v;e[16]!==x?(v=z("p-0.5 transition-colors rounded-lg",x),e[16]=x,e[17]=v):v=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(zt,{size:14}),e[20]=j):j=e[20];let A;e[21]!==i||e[22]!==g||e[23]!==v||e[24]!==b?(A=n.jsx("button",{type:"button",onClick:i,disabled:g,className:v,"aria-label":b,children:j}),e[21]=i,e[22]=g,e[23]=v,e[24]=b,e[25]=A):A=e[25];let k;return e[26]!==A||e[27]!==p||e[28]!==h?(k=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,h,A]}),e[26]=A,e[27]=p,e[28]=h,e[29]=k):k=e[29],k}function Vs(t){const e=E.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(rr,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function ir(t){const e=E.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,c=o?s:!r,p=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==c||e[1]!==i?(f=()=>{c||i()},e[0]=c,e[1]=i,e[2]=f):f=e[2];const m=c&&"opacity-50 cursor-not-allowed";let h;e[3]!==m?(h=z("h-7 px-2.5 text-xs",m),e[3]=m,e[4]=h):h=e[4];let g;e[5]!==c||e[6]!==u||e[7]!==f||e[8]!==h?(g=n.jsx(Y,{type:"button",size:"sm","aria-disabled":c,onClick:f,className:h,children:u}),e[5]=c,e[6]=u,e[7]=f,e[8]=h,e[9]=g):g=e[9];const x=g;if(!p)return x;let v;e[10]!==x?(v=n.jsx(He,{asChild:!0,children:x}),e[10]=x,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;return e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16],j}function cs(t,e,s){return t.findIndex(o=>e(o)===s)}function Nt(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function It(t,e,s,o,r){if(t.length===0)return null;const i=cs(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function ar(t){return!t.isStreaming&&t.allAnswered}function ds(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[d,u]=P.useState(V),[c,p]=P.useState(!1),f=ws({resolver:Ss(o),defaultValues:r}),m=f.watch(),h=cs(e,s,d),g=h>=0?e[h]:void 0,x=a(m[d]),v=Nt(e,s,m,a),b=ar({isStreaming:i,allAnswered:v}),j=()=>{if(h>0){const I=e[h-1];I&&u(s(I))}},A=()=>{if(h>=0&&h<e.length-1){const I=e[h+1];I&&u(s(I))}},k=()=>{const I=f.getValues(),N=It(e,s,I,a,d);N&&u(N)},w=()=>{f.handleSubmit(I=>{const N=I;for(const M of e)l(M,N[s(M)])})()},y=P.useRef(w);y.current=w;const C=()=>{b&&(p(!1),y.current())},S=()=>{const I=f.getValues();if(Nt(e,s,I,a)){if(i){p(!0);return}p(!1),y.current()}else{const N=It(e,s,I,a,d);N&&u(N)}};return P.useEffect(()=>{if(c&&!i){if(!v){p(!1);return}p(!1),y.current()}},[c,i,v]),{form:f,activeKey:d,setActiveKey:u,currentIndex:h,currentPart:g,isCurrentAnswered:x,isAllAnswered:v,canSubmit:b,goPrev:j,goNext:A,advanceToNextUnanswered:k,submit:C,submitOrAdvance:S}}const us="chat.approval.defaultDenyReason";function ps(t){const e=E.c(36),{onYolo:s}=t,o=B(),[r,i]=Se();let a,l,V,d,u,c,p,f,m;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const j=we.find(w=>w.value===r.toolApprovalLevel)??we[0];let A;e[13]!==s||e[14]!==r||e[15]!==i?(A=w=>{const y=w,C=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:y}),y==="auto"&&s(C)},e[13]=s,e[14]=r,e[15]=i,e[16]=A):A=e[16];const k=A;V=Ln,f=r.toolApprovalLevel,m=k,l=Fn,u="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=lr,a=On,d=o(j.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=d,e[8]=u,e[9]=c,e[10]=p,e[11]=f,e[12]=m}else a=e[4],l=e[5],V=e[6],d=e[7],u=e[8],c=e[9],p=e[10],f=e[11],m=e[12];let h;e[17]!==a||e[18]!==d?(h=n.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=h):h=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==c||e[23]!==p||e[24]!==h?(g=n.jsx(l,{size:u,className:c,onClick:p,children:h}),e[20]=l,e[21]=u,e[22]=c,e[23]=p,e[24]=h,e[25]=g):g=e[25];let x;e[26]!==o?(x=we.map(j=>n.jsx(Un,{value:j.value,children:o(j.labelKey)},j.value)),e[26]=o,e[27]=x):x=e[27];let v;e[28]!==x?(v=n.jsx(zn,{children:x}),e[28]=x,e[29]=v):v=e[29];let b;return e[30]!==V||e[31]!==v||e[32]!==f||e[33]!==m||e[34]!==g?(b=n.jsxs(V,{value:f,onValueChange:m,children:[g,v]}),e[30]=V,e[31]=v,e[32]=f,e[33]=m,e[34]=g,e[35]=b):b=e[35],b}function lr(t){return t.stopPropagation()}function fs(t){const e=E.c(8),{input:s}=t,o=B();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(i=n.jsx("div",{className:"px-4",children:n.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:r})}),e[6]=r,e[7]=i):i=e[7],i}function Vr(t){const e=E.c(38),{approval:s,onRespond:o}=t,r=B(),[i]=Se(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(us),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(d=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=d):d=e[8];const u=d;let c;e[9]!==s.approvalId||e[10]!==o?(c=C=>o(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=o,e[11]=c):c=e[11];const p=c;let f;e[12]!==p?(f=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(ps,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const m=f;let h;e[14]!==r?(h=r("chat.approval.denyButton"),e[14]=r,e[15]=h):h=e[15];let g;e[16]!==V||e[17]!==h?(g=n.jsx(Y,{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:V,children:h}),e[16]=V,e[17]=h,e[18]=g):g=e[18];let x;e[19]!==r?(x=r("chat.approval.acceptButton"),e[19]=r,e[20]=x):x=e[20];let v;e[21]!==u||e[22]!==x?(v=n.jsx(Y,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:x}),e[21]=u,e[22]=x,e[23]=v):v=e[23];let b;e[24]!==g||e[25]!==v?(b=n.jsxs(n.Fragment,{children:[g,v]}),e[24]=g,e[25]=v,e[26]=b):b=e[26];const j=b;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(We,{size:14}),e[27]=A):A=e[27];let k;e[28]!==r?(k=r("chat.approval.needsApproval"),e[28]=r,e[29]=k):k=e[29];let w;e[30]!==s.input?(w=n.jsx(fs,{input:s.input}),e[30]=s.input,e[31]=w):w=e[31];let y;return e[32]!==s.friendlyName||e[33]!==m||e[34]!==j||e[35]!==k||e[36]!==w?(y=n.jsx(pe,{icon:A,label:k,title:s.friendlyName,defaultExpanded:!0,footerLeft:m,footerRight:j,children:w}),e[32]=s.friendlyName,e[33]=m,e[34]=j,e[35]=k,e[36]=w,e[37]=y):y=e[37],y}const cr=Cs(se(),re({approved:Ns().optional(),levelOverride:Le(["auto","readonly"]).optional()}));function dr(t){const e=E.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=B(),[a]=Se(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(fr)),e[0]=s,e[1]=V):V=e[1];const d=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,M)=>{const R=M;typeof R?.approved=="boolean"&&r(N.approvalId,R.approved,R.approved===!1?i(us):void 0,R.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let c;e[6]!==s||e[7]!==d||e[8]!==o||e[9]!==u?(c={parts:s,partKey:pr,schema:cr,defaultValues:d,isStreaming:o,hasAnswer:ur,onSubmit:u},e[6]=s,e[7]=d,e[8]=o,e[9]=u,e[10]=c):c=e[10];const p=ds(c);let f;e[11]!==s||e[12]!==p?(f=N=>{p.form.reset(Object.fromEntries(s.map(M=>[M.approvalId,{approved:!0,levelOverride:N}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const m=f,h=p.currentPart,g=p.form;let x;e[14]!==p?(x=N=>{N.preventDefault(),p.submit()},e[14]=p,e[15]=x):x=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(We,{size:14}),e[16]=v):v=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const j=h?.friendlyName??"";let A;e[20]!==m?(A=n.jsx(ps,{onYolo:m}),e[20]=m,e[21]=A):A=e[21];let k;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==A?(k=n.jsx(Vs,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:A}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=A,e[27]=k):k=e[27];let w;e[28]!==h||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(w=h?n.jsx(hr,{approvalId:h.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=h,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=w):w=e[31];let y;e[32]!==h?(y=h?n.jsx(fs,{input:h.input}):null,e[32]=h,e[33]=y):y=e[33];let C;e[34]!==k||e[35]!==w||e[36]!==y||e[37]!==b||e[38]!==j?(C=n.jsx(pe,{icon:v,label:b,title:j,defaultExpanded:!0,footerLeft:k,footerRight:w,children:y}),e[34]=k,e[35]=w,e[36]=y,e[37]=b,e[38]=j,e[39]=C):C=e[39];let S;e[40]!==C||e[41]!==x?(S=n.jsx("form",{onSubmit:x,children:C}),e[40]=C,e[41]=x,e[42]=S):S=e[42];let I;return e[43]!==p.form||e[44]!==S?(I=n.jsx(nt,{...g,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function ur(t){return typeof t?.approved=="boolean"}function pr(t){return t.approvalId}function fr(t){return[t.approvalId,{approved:void 0}]}function hr(t){const e=E.c(7),{approvalId:s,control:o,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,c=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(Y,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(Y,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":c,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(Is,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function mr(){const t=E.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(We,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.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:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function gr(t){const e=E.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(mr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=n.jsx(Vr,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==r?(i=n.jsx(dr,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function xr(t){const e=E.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=B();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let d;e[5]!==r||e[6]!==V?(d=n.jsx(Y,{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:r,children:V}),e[5]=r,e[6]=V,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let c;e[10]!==l||e[11]!==u?(c=n.jsx(Y,{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:l,children:u}),e[10]=l,e[11]=u,e[12]=c):c=e[12];let p;e[13]!==d||e[14]!==c?(p=n.jsxs(n.Fragment,{children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15];const f=p;let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Kt,{size:14}),e[16]=m):m=e[16];let h;e[17]!==i?(h=i("chat.proposePlan.planReady"),e[17]=i,e[18]=h):h=e[18];let g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let x;e[21]!==s.plan?(x=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx(Bn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=x):x=e[22];let v;return e[23]!==f||e[24]!==x||e[25]!==h||e[26]!==g?(v=n.jsx(pe,{icon:m,label:h,title:g,defaultExpanded:!0,footerRight:f,children:x}),e[23]=f,e[24]=x,e[25]=h,e[26]=g,e[27]=v):v=e[27],v}function vr(t){const e=E.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=is(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==o||e[4]!==r?(l=n.jsx(xr,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function hs(t){return t?"response"in t?t.response:t.option??t.draft:""}const Tt=re({response:se().min(1,"Response is required")}),br=re({option:se().nullable(),draft:se()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ar=re({response:Le(["yes","no"])});function yr(t){switch(t.type){case"text":return Tt;case"choice":return br;case"confirm":return Ar;default:return Tt}}function jr(t){const e={};for(const s of t)e[s.toolCallId]=yr(s.input);return re(e)}function kr(t){const e=E.c(7),{control:s,name:o,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:d}=V,u=d.value??"";return n.jsxs(ct,{children:[n.jsx(dt,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(qt,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...d,value:u,type:"text",placeholder:r||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),n.jsx(ut,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Gt,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function ms(t,e){const s=E.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{const l=a.target.tagName;if(l==="INPUT"||l==="TEXTAREA"||a.metaKey||a.ctrlKey||a.altKey)return;const V=Number.parseInt(a.key,10);V>=1&&V<=t&&(a.preventDefault(),e(V-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),P.useEffect(o,r)}function wr(t){const e=E.c(51),{control:s,name:o,options:r}=t,i=B(),a=`${o}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:V}=gt(l),d=`${o}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:c}=gt(u),p=V.value,f=c.value??"";let m;if(e[6]!==V||e[7]!==r?(m=U=>{const _=r[U];_!=null&&V.onChange(_)},e[6]=V,e[7]=r,e[8]=m):m=e[8],ms(r.length,m),r.length===0)return null;const h=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let x;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let U;e[16]!==V||e[17]!==p||e[18]!==i?(U=(_,L)=>{const F=p===_;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(_),className:z("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",F&&"bg-accent/50",!F&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:_}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",F?"bg-chart-1 text-white":"bg-muted text-foreground"),children:L+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:_})]},`${L}-${_}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=U):U=e[19],x=r.map(U),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=x}else x=e[15];const v=h&&"bg-accent/50",b=!h&&"hover:bg-accent/30";let j;e[20]!==v||e[21]!==b?(j=z("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",v,b),e[20]=v,e[21]=b,e[22]=j):j=e[22];let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(qt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const k=h?f:"";let w;e[24]!==c||e[25]!==V||e[26]!==p?(w=U=>{c.onChange(U.target.value),p!==null&&V.onChange(null)},e[24]=c,e[25]=V,e[26]=p,e[27]=w):w=e[27];let y;e[28]!==V||e[29]!==p?(y=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=y):y=e[30];let C;e[31]!==i?(C=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=C):C=e[32];let S;e[33]!==i?(S=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=S):S=e[34];let I;e[35]!==k||e[36]!==w||e[37]!==y||e[38]!==C||e[39]!==S?(I=n.jsx("input",{type:"text",value:k,onChange:w,onFocus:y,placeholder:C,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=k,e[36]=w,e[37]=y,e[38]=C,e[39]=S,e[40]=I):I=e[40];let N;e[41]!==j||e[42]!==I?(N=n.jsxs("label",{className:j,children:[A,I]}),e[41]=j,e[42]=I,e[43]=N):N=e[43];let M;e[44]!==N||e[45]!==g||e[46]!==x?(M=n.jsx(dt,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[x,N]})}),e[44]=N,e[45]=g,e[46]=x,e[47]=M):M=e[47];let R;e[48]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx(ut,{}),e[48]=R):R=e[48];let D;return e[49]!==M?(D=n.jsxs(ct,{children:[M,R]}),e[49]=M,e[50]=D):D=e[50],D}function Sr(t){const e=E.c(8),{control:s,name:o}=t,r=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=c=>{l.current?.onChange(a[c]??"")},e[1]=V):V=e[1],ms(a.length,V);let d;e[2]!==r?(d=c=>{const{field:p}=c;return l.current=p,n.jsxs(ct,{children:[n.jsx(dt,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const m=p.value===f;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:z("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",m&&"bg-accent/50",!m&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0",m?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),n.jsx(ut,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==d?(u=n.jsx(Gt,{control:s,name:o,render:d}),e[4]=s,e[5]=o,e[6]=d,e[7]=u):u=e[7],u}function _t(t){const e=E.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(kr,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(wr,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(Sr,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Cr(t){const e=E.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=jr(s.map(_r)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Tr)),e[2]=s,e[3]=l):l=e[3];const V=l;let d;e[4]!==r?(d=($,O)=>{const W=hs(O);W&&r($,W)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Ir,schema:a,defaultValues:V,isStreaming:o,hasAnswer:Nr,onSubmit:d},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const c=ds(u),p=c.currentPart,f=B();let m;e[12]!==p||e[13]!==c||e[14]!==f?(m=()=>{const $=p;if(!$)return;const O=f("chat.userAskQuestion.skipMessage"),W=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${W}.option`,null),c.form.setValue(`${W}.draft`,O)):c.form.setValue(`${W}.response`,O),c.advanceToNextUnanswered()},e[12]=p,e[13]=c,e[14]=f,e[15]=m):m=e[15];const h=m;let g;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==s.length?(g=n.jsx(Vs,{currentIndex:c.currentIndex,total:s.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=s.length,e[20]=g):g=e[20];const x=g;let v;e[21]!==f?(v=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=v):v=e[22];let b;e[23]!==h||e[24]!==v?(b=n.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-7",children:v}),e[23]=h,e[24]=v,e[25]=b):b=e[25];let j;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(j=n.jsx(ir,{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]=j):j=e[30];let A;e[31]!==b||e[32]!==j?(A=n.jsxs(n.Fragment,{children:[b,j]}),e[31]=b,e[32]=j,e[33]=A):A=e[33];const k=A;if(s.length===1){const $=s[0];if(!$?.input)return null;const O=c.form;let W;e[34]!==c?(W=ne=>{ne.preventDefault(),c.submit()},e[34]=c,e[35]=W):W=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(st,{size:14}),e[36]=X):X=e[36];let te;e[37]!==f?(te=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=te):te=e[38];let J;e[39]!==$.input?.prompt||e[40]!==f?(J=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=J):J=e[41];const ae=$.input;let T;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==ae?(T=n.jsx(_t,{input:ae,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=ae,e[45]=T):T=e[45];let Q;e[46]!==k||e[47]!==te||e[48]!==J||e[49]!==T?(Q=n.jsx(pe,{icon:X,label:te,title:J,defaultExpanded:!0,footerRight:k,children:T}),e[46]=k,e[47]=te,e[48]=J,e[49]=T,e[50]=Q):Q=e[50];let Z;e[51]!==W||e[52]!==Q?(Z=n.jsx("form",{onSubmit:W,autoComplete:"off",children:Q}),e[51]=W,e[52]=Q,e[53]=Z):Z=e[53];let H;return e[54]!==c.form||e[55]!==Z?(H=n.jsx(nt,{...O,children:Z}),e[54]=c.form,e[55]=Z,e[56]=H):H=e[56],H}const w=c.form;let y;e[57]!==c?(y=$=>{$.preventDefault(),c.submit()},e[57]=c,e[58]=y):y=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(st,{size:14}),e[59]=C):C=e[59];let S;e[60]!==f?(S=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=S):S=e[61];const I=c.currentIndex+1;let N;e[62]!==s.length||e[63]!==f||e[64]!==I?(N=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=N):N=e[65];let M;e[66]!==p?.input?.prompt||e[67]!==f?(M=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=M):M=e[68];const R=c.activeKey,D=c.setActiveKey;let U;if(e[69]!==c.form||e[70]!==s){let $;e[72]!==c.form?($=O=>n.jsx(qn,{value:O.toolCallId,className:"mt-0",children:n.jsx(_t,{input:O.input,control:c.form.control,toolCallId:O.toolCallId})},O.toolCallId),e[72]=c.form,e[73]=$):$=e[73],U=s.map($),e[69]=c.form,e[70]=s,e[71]=U}else U=e[71];let _;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==U?(_=n.jsx(Qn,{value:R,onValueChange:D,children:U}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=U,e[77]=_):_=e[77];let L;e[78]!==x||e[79]!==k||e[80]!==S||e[81]!==N||e[82]!==M||e[83]!==_?(L=n.jsx(pe,{icon:C,label:S,count:N,title:M,defaultExpanded:!0,footerLeft:x,footerRight:k,children:_}),e[78]=x,e[79]=k,e[80]=S,e[81]=N,e[82]=M,e[83]=_,e[84]=L):L=e[84];let F;e[85]!==y||e[86]!==L?(F=n.jsx("form",{onSubmit:y,autoComplete:"off",children:L}),e[85]=y,e[86]=L,e[87]=F):F=e[87];let q;return e[88]!==c.form||e[89]!==F?(q=n.jsx(nt,{...w,children:F}),e[88]=c.form,e[89]=F,e[90]=q):q=e[90],q}function Nr(t){return!!hs(t)}function Ir(t){return t.toolCallId}function Tr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function _r(t){return{toolCallId:t.toolCallId,input:t.input}}function Mr(){const t=E.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.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:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function gs(t){const e=E.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Dr),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Mr,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(Cr,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Dr(t){return t.state==="input-available"}function Rr(t){const e=E.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=B();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Kt,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const c=V.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==i?(f=i("chat.suggestTask.notNow"),e[8]=i,e[9]=f):f=e[9];let m;e[10]!==o||e[11]!==p||e[12]!==f?(m=n.jsx(Y,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:f}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13];let h;e[14]!==r||e[15]!==l?(h=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=h):h=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let x;e[19]!==o||e[20]!==h||e[21]!==g?(x=n.jsx(Y,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:h,children:g}),e[19]=o,e[20]=h,e[21]=g,e[22]=x):x=e[22];let v;e[23]!==x||e[24]!==m?(v=n.jsxs(n.Fragment,{children:[m,x]}),e[23]=x,e[24]=m,e[25]=v):v=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let j;return e[28]!==V.title||e[29]!==v||e[30]!==b||e[31]!==u?(j=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,footerRight:v,children:b}),e[28]=V.title,e[29]=v,e[30]=b,e[31]=u,e[32]=j):j=e[32],j}function Er(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Pr(t){const e=E.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=Er(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Or,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(Ur),e[4]=s,e[5]=V):V=e[5];let d;e[6]!==V?(d=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=n.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function Ur(t,e){return n.jsx(Lr,{todo:t},e)}function Lr(t){const e=E.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(Fr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=z("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const d=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==d||e[5]!==u?(c=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==c?(p=n.jsxs("span",{className:V,children:[i,c]}),e[7]=i,e[8]=V,e[9]=c,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=n.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[a,p]}),e[11]=a,e[12]=p,e[13]=f):f=e[13],f}function Fr(t){const e=E.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.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]=i):i=e[0];let a;return e[1]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Or(t){const e=E.c(13),{status:s}=t,o=B();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.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:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==a?(V=n.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const zr={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"}]},$r={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Br(t){const e=E.c(46),{source:s,onDone:o}=t,r=B(),i=Ts(),[a]=Se(),[l,V]=P.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=P.useState(""),[c,p]=P.useState(!1),f=l==="brl"?"R$":"$";let m;e[0]!==l||e[1]!==i?(m=async _=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:_,currency:l});return L},e[0]=l,e[1]=i,e[2]=m):m=e[2];let h;e[3]!==o?(h=_=>{_&&window.open(_,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=h):h=e[4];let g;e[5]!==r?(g=_=>{Ee.error(r("credits.topUp.failed",{message:_.message}))},e[5]=r,e[6]=g):g=e[6];let x;e[7]!==m||e[8]!==h||e[9]!==g?(x={mutationFn:m,onSuccess:h,onError:g},e[7]=m,e[8]=h,e[9]=g,e[10]=x):x=e[10];const{mutate:v,isPending:b}=_s(x);let j;e[11]!==l||e[12]!==s||e[13]!==v?(j=(_,L)=>{ee("credits_topup_clicked",{amount_cents:_,currency:l,tier_label:L,source:s}),v(_)},e[11]=l,e[12]=s,e[13]=v,e[14]=j):j=e[14];const A=j,k=parseFloat(d),w=!isNaN(k)&&k>=1;let y,C,S;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=_=>{_&&V(_)},C=n.jsx(jt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=n.jsx(jt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=y,e[16]=C,e[17]=S):(y=e[15],C=e[16],S=e[17]);let I;e[18]!==l?(I=n.jsx("div",{className:"mb-4",children:n.jsxs(no,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:y,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=zr[l];let M;if(e[20]!==A||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==N){let _;e[26]!==A||e[27]!==f||e[28]!==b||e[29]!==r?(_=L=>{const{dollars:F,labelKey:q}=L;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>A(F*100,$r[q]??"preset"),className:z("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:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,F]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(q)})]},F)},e[26]=A,e[27]=f,e[28]=b,e[29]=r,e[30]=_):_=e[30],M=N.map(_),e[20]=A,e[21]=f,e[22]=b,e[23]=r,e[24]=N,e[25]=M}else M=e[25];let R;e[31]!==M?(R=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:M}),e[31]=M,e[32]=R):R=e[32];let D;e[33]!==A||e[34]!==f||e[35]!==d||e[36]!==k||e[37]!==w||e[38]!==b||e[39]!==c||e[40]!==r?(D=c?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),n.jsx(so,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:d,onChange:_=>u(_.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(Y,{className:"h-10",disabled:!w||b,onClick:()=>A(Math.round(k*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:r("credits.topUp.enterCustom")}),e[33]=A,e[34]=f,e[35]=d,e[36]=k,e[37]=w,e[38]=b,e[39]=c,e[40]=r,e[41]=D):D=e[41];let U;return e[42]!==R||e[43]!==D||e[44]!==I?(U=n.jsxs("div",{children:[I,R,D]}),e[42]=R,e[43]=D,e[44]=I,e[45]=U):U=e[45],U}const Kr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function qr(t){const e=E.c(47),{onDismiss:s}=t,{org:o}=Ce(),r=rt(),{decoKeyId:i}=to(),a=B(),l=Oe("credits");let V,d;if(e[0]!==o.id?(V=()=>{ee("credits_exhausted_shown",{organization_id:o.id})},d=[o.id],e[0]=o.id,e[1]=V,e[2]=d):(V=e[1],d=e[2]),P.useEffect(V,d),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=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 p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.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]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.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]=f):f=e[7];let m;e[8]!==a?(m=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx(Wn,{className:"text-xl font-semibold tracking-tight",children:m}),e[10]=m,e[11]=h):h=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let x;e[14]!==g?(x=n.jsx(Yn,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=x):x=e[15];let v;e[16]!==x||e[17]!==h?(v=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(Gn,{className:"relative gap-4",children:[f,n.jsxs("div",{children:[h,x]})]})]}),e[16]=x,e[17]=h,e[18]=v):v=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"rounded-xl border border-border p-5",children:n.jsx(Br,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Kr.map(N=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(it,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(N)})]},N))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let j;e[23]!==a?(j=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=j):j=e[24];let A;e[25]!==s||e[26]!==j?(A=n.jsx(Y,{variant:"ghost",size:"sm",onClick:s,children:j}),e[25]=s,e[26]=j,e[27]=A):A=e[27];let k;e[28]!==r||e[29]!==s||e[30]!==o.slug?(k=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=k):k=e[31];let w;e[32]!==a?(w=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=w):w=e[33];let y;e[34]!==k||e[35]!==w?(y=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:k,children:w}),e[34]=k,e[35]=w,e[36]=y):y=e[36];let C;e[37]!==A||e[38]!==y?(C=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[A,y]}),e[37]=A,e[38]=y,e[39]=C):C=e[39];let S;e[40]!==v||e[41]!==b||e[42]!==C?(S=n.jsxs(Hn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Qr,children:[v,b,C]}),e[40]=v,e[41]=b,e[42]=C,e[43]=S):S=e[43];let I;return e[44]!==S||e[45]!==u?(I=n.jsx(Jn,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function Qr(t){return t.preventDefault()}const Wr={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 Yr(t){const e=E.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=B(),{label:a,title:l}=Wr[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(at,{size:14}),e[0]=V):V=e[0];let d;e[1]!==a||e[2]!==i?(d=i(a),e[1]=a,e[2]=i,e[3]=d):d=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let c;e[7]!==s||e[8]!==r||e[9]!==i?(c=s==="trial_exhausted"?n.jsx(Y,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=c):c=e[10];let p;return e[11]!==o||e[12]!==d||e[13]!==u||e[14]!==c?(p=n.jsx(pe,{icon:V,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=d,e[13]=u,e[14]=c,e[15]=p):p=e[15],p}const Gr={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function Mt(t){const e=E.c(21),{kind:s,onDismiss:o}=t,r=B(),i=rt(),{org:a}=Ce(),{label:l,title:V}=Gr[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(at,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let c;e[4]!==r||e[5]!==V?(c=r(V),e[4]=r,e[5]=V,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,e[9]=a.slug,e[10]=p):p=e[10];let f;e[11]!==r?(f=r("chat.planRefused.seePlans"),e[11]=r,e[12]=f):f=e[12];let m;e[13]!==p||e[14]!==f?(m=n.jsx(Y,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=m):m=e[15];let h;return e[16]!==o||e[17]!==u||e[18]!==c||e[19]!==m?(h=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:m}),e[16]=o,e[17]=u,e[18]=c,e[19]=m,e[20]=h):h=e[20],h}function xs(t){const e=Hr(t);if(e!==null){const d=xs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const d=V[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||o&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Hr(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:o,message:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const Jr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=E.c(29),s=B(),{variant:o,onDismiss:r}=t,i=o==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,V=i?En:Ds;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const v=Jr[t.finishReason];return v?s(v):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let c;e[8]!==i||e[9]!==u?(c=i?xs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=c):c=e[10];const{summary:p,rawDetails:f}=c;let m;e[11]!==V?(m=n.jsx(V,{size:14}),e[11]=V,e[12]=m):m=e[12];let h;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(h=i?n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=h):h=e[17];let g;e[18]!==f||e[19]!==s?(g=f?n.jsxs("details",{className:"group mx-4",children:[n.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:[n.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:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Ee.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ee.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:n.jsx(Pn,{className:"size-3.5"})}),n.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:f})]})]}):null,e[18]=f,e[19]=s,e[20]=g):g=e[20];let x;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==m||e[25]!==h||e[26]!==g||e[27]!==o?(x=n.jsx(pe,{icon:m,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:h,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=m,e[25]=h,e[26]=g,e[27]=o,e[28]=x):x=e[28],x}function ze(t){const e=E.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=B(),{error:V,clearError:d,finishReason:u,clearFinishReason:c,messages:p,isStreaming:f,submit:m,sendMessage:h}=Fe(),[g,x]=Se(),{virtualMcpId:v,createTaskWithMessage:b}=Ye(),{chatMode:j,simpleModeTier:A}=Ge(),k=Oe("credits"),{mutate:w}=io("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let y;e[2]!==w?(y=()=>w(),e[2]=w,e[3]=y):y=e[3];const C=y;let S;e[4]!==j||e[5]!==A||e[6]!==v||e[7]!==a?(S=oe=>({...a?{voiceMode:!0}:{},tier:A,mode:j,toolApprovalLevel:oe,agent:v?{id:v}:void 0}),e[4]=j,e[5]=A,e[6]=v,e[7]=a,e[8]=S):S=e[8];const I=S;let N;e[9]!==g.toolApprovalLevel?(N=g.toolApprovalLevel??Ms(),e[9]=g.toolApprovalLevel,e[10]=N):N=e[10];const M=N,R=p.at(-1),D=R?.role==="assistant"?R.parts:[],U=D.filter(ti),_=D.filter(Jt),L=as(D),F=rs(D);let q;e[11]!==V||e[12]!==h||e[13]!==l?(q=()=>{if(V){const ue={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};h(ue)}},e[11]=V,e[12]=h,e[13]=l,e[14]=q):q=e[14];const $=q;let O;e[15]!==h||e[16]!==l?(O=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};h(oe)},e[15]=h,e[16]=l,e[17]=O):O=e[17];const W=O;let X;e[18]!==I||e[19]!==M||e[20]!==m?(X=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:ue}},I(M))},e[18]=I,e[19]=M,e[20]=m,e[21]=X):X=e[21];const te=X;let J;e[22]!==I||e[23]!==M||e[24]!==m?(J=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{accepted:ue}},I(M))},e[22]=I,e[23]=M,e[24]=m,e[25]=J):J=e[25];const ae=J;let T;e[26]!==b||e[27]!==g||e[28]!==x||e[29]!==l||e[30]!==v?(T=oe=>{x({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:v,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:oe})}]}})},e[26]=b,e[27]=g,e[28]=x,e[29]=l,e[30]=v,e[31]=T):T=e[31];const Q=T,Z=ei;let H;e[32]!==I||e[33]!==m?(H=(oe,ue,Be,be)=>{m({kind:"approval",approvalId:oe,approved:ue,...Be?{reason:Be}:{}},I(be))},e[32]=I,e[33]=m,e[34]=H):H=e[34];const ne=H,G=ls();if(G.isCreditExhausted){let oe;return e[35]!==k||e[36]!==d||e[37]!==i?(oe=k?n.jsx(qr,{onDismiss:d}):n.jsx("div",{className:z(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(Mt,{kind:"ai_budget_exhausted",onDismiss:d})}),e[35]=k,e[36]=d,e[37]=i,e[38]=oe):oe=e[38],oe}const{showError:ce,showWarning:ie,hasApprovals:fe}=G,le=U.map(Xr).join("|"),$e=is(L)?.toolCallId??"",ht=F.map(Zr).join("|"),Ne=!i&&"absolute bottom-full left-0 right-0";let Ve;e[39]!==Ne?(Ve=z(Ne),e[39]=Ne,e[40]=Ve):Ve=e[40];let he;e[41]!==G.todos?(he=n.jsx(Pr,{todos:G.todos}),e[41]=G.todos,e[42]=he):he=e[42];let ge;e[43]!==d||e[44]!==G.subscriptionErrorKind||e[45]!==C?(ge=G.subscriptionErrorKind&&n.jsx(Yr,{kind:G.subscriptionErrorKind,onDismiss:d,onSubscribe:C}),e[43]=d,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=ge):ge=e[46];let de;e[47]!==d||e[48]!==G.planRefusal?(de=G.planRefusal&&n.jsx(Mt,{kind:G.planRefusal,onDismiss:d}),e[47]=d,e[48]=G.planRefusal,e[49]=de):de=e[49];let xe;e[50]!==d||e[51]!==V||e[52]!==$||e[53]!==ce?(xe=ce&&n.jsx(Qe,{variant:"error",error:V,onDismiss:d,onFixInChat:$}),e[50]=d,e[51]=V,e[52]=$,e[53]=ce,e[54]=xe):xe=e[54];let je;e[55]!==c||e[56]!==u||e[57]!==W||e[58]!==ie?(je=ie&&n.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:c,onContinue:W}),e[55]=c,e[56]=u,e[57]=W,e[58]=ie,e[59]=je):je=e[59];const Ie=fe&&n.jsx(gr,{approvals:F,isStreaming:f,onRespond:ne},ht),_e=G.hasPlans&&n.jsx(vr,{plans:L,isStreaming:f,onApprove:Q,onDismiss:Z},$e),Me=G.hasTaskSuggestion&&n.jsx(Rr,{parts:_,isStreaming:f,onRespond:ae},_.at(-1)?.toolCallId??"");let ve;e[60]!==G.isWaitingForUserInput||e[61]!==te||e[62]!==f||e[63]!==le||e[64]!==U?(ve=G.isWaitingForUserInput&&n.jsx(gs,{userAskParts:U,isStreaming:f,onSubmit:te},le),e[60]=G.isWaitingForUserInput,e[61]=te,e[62]=f,e[63]=le,e[64]=U,e[65]=ve):ve=e[65];let ke;return e[66]!==Ve||e[67]!==he||e[68]!==ge||e[69]!==de||e[70]!==xe||e[71]!==je||e[72]!==Ie||e[73]!==_e||e[74]!==Me||e[75]!==ve?(ke=n.jsxs("div",{className:Ve,children:[he,ge,de,xe,je,Ie,_e,Me,ve]}),e[66]=Ve,e[67]=he,e[68]=ge,e[69]=de,e[70]=xe,e[71]=je,e[72]=Ie,e[73]=_e,e[74]=Me,e[75]=ve,e[76]=ke):ke=e[76],ke}function Zr(t){return t.approvalId}function Xr(t){return t.toolCallId}function ei(){document.querySelector("[data-chat-input]")?.focus()}function ti(t){return t.type==="tool-user_ask"}ze.Error=function(e){return n.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};ze.Warning=function(e){return n.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};ze.UserAskQuestion=gs;function vs(t){const e=E.c(20),{taskId:s}=t,o=B(),r=bn(s),i=An(r),a=yn(),{stop:l,removeLocalMessage:V}=Fe();if(i.length===0)return null;let d;e[0]!==o?(d=o("chat.queueTray.sendNow"),e[0]=o,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx($t,{size:14}),e[4]=c):c=e[4];let p;e[5]!==d||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:c})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==o?(f=o("chat.queueTray.sendNow"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=n.jsxs(Ze,{delayDuration:400,children:[p,m]}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let g;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(g=(x,v)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.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:v+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:x.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,x.messageId).then(b=>{b&&(jn(s,x.messageId),V(x.messageId))})},children:n.jsx(ao,{className:"size-3.5"})})})]},x.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=g):g=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[n.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:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),h]}),i.map(g)]})}const si={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function ni(t,e){return si[t]?.test(e)??!1}function oi(t){return vo(t)&&ni(t.providerId,t.modelId)}function ri(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 ii={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function ai(t){const e=E.c(32),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:V,onClose:d}=t,u=B(),c=ss(),p=new Set(c.map(li)),f=kn([r,o,i],p),m=f?.keyId??null,[h,g]=P.useState(m??c[0]?.id??null),x=c.some(F=>F.id===h)?h:m??c[0]?.id??null,v=x?c.find(F=>F.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",j=ii[s];let A;e[0]!==u||e[1]!==j?(A=u(j),e[0]=u,e[1]=j,e[2]=A):A=e[2];let k;e[3]!==A?(k=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=k):k=e[4];let w;e[5]!==V||e[6]!==u||e[7]!==r?(w=r&&n.jsx("button",{type:"button",onClick:V,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:u("chat.modelPreferences.reset")}),e[5]=V,e[6]=u,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==k||e[10]!==w?(y=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[k,w]}),e[9]=k,e[10]=w,e[11]=y):y=e[11];const C="flex-1 min-h-0",S=P.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(lo,{}),e[12]=I):I=e[12];const N=Ao,M=!0,R=ri(m?f:null,v?.providerId??"deco");let D;e[13]!==x||e[14]!==l||e[15]!==g?(D=F=>{const q=F.keyId??x??"";g(q),l({keyId:q,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=l,e[15]=g,e[16]=D):D=e[16];let U;e[17]!==N||e[18]!==x||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==R||e[23]!==D?(U=n.jsx(N,{compact:M,filterModels:a,onClose:d,credentialId:x,onCredentialChange:g,selectedModel:R,onModelChange:D}),e[17]=N,e[18]=x,e[19]=a,e[20]=d,e[21]=g,e[22]=R,e[23]=D,e[24]=U):U=e[24];let _;e[25]!==S||e[26]!==U||e[27]!==I?(_=n.jsx("div",{className:C,children:n.jsx(S,{fallback:I,children:U})}),e[25]=S,e[26]=U,e[27]=I,e[28]=_):_=e[28];let L;return e[29]!==_||e[30]!==y?(L=n.jsxs("div",{className:b,children:[y,_]}),e[29]=_,e[30]=y,e[31]=L):L=e[31],L}function li(t){return t.id}const Vi=["fast","smart","thinking"];function bs(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Dt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function ci(t){const e=E.c(28),{tier:s,pillIcon:o,groups:r}=t,i=B();let a;e[0]!==i?(a=bs(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,d]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{y.onSelect(),d(!1)},e[2]=u):u=e[2];const c=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=z("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=z("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]=m):m=e[4];const h=l[s];let g;e[5]!==h?(g=n.jsx("span",{className:m,children:h}),e[5]=h,e[6]=g):g=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ht,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=x):x=e[7];let v;e[8]!==o||e[9]!==p||e[10]!==g?(v=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(Zt,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[o,g,x]})})})}),e[8]=o,e[9]=p,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16];let A;if(e[17]!==r||e[18]!==i){let y;e[20]!==i?(y=C=>n.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>c(S),className:z("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",S.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[S.icon&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(it,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&n.jsx(ui,{label:S.title,render:S.modelOverride})]},S.key))},C.key),e[20]=i,e[21]=y):y=e[21],A=r.map(y),e[17]=r,e[18]=i,e[19]=A}else A=e[19];let k;e[22]!==A?(k=n.jsx(Xt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:di,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:A})}),e[22]=A,e[23]=k):k=e[23];let w;return e[24]!==V||e[25]!==j||e[26]!==k?(w=n.jsxs(es,{open:V,onOpenChange:d,children:[j,k]}),e[24]=V,e[25]=j,e[26]=k,e[27]=w):w=e[27],w}function di(t){return t.preventDefault()}function ui(t){const e=E.c(38),{label:s,render:o}=t,r=B(),i=ts(),[a,l]=P.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const d=V;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const c=a&&"opacity-100";let p;e[4]!==c?(p=z("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 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]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(fn,{size:14}),e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==p?(m=n.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=m):m=e[9];const h=m;if(i){let j;e[10]!==h?(j=n.jsx(uo,{asChild:!0,children:h}),e[10]=h,e[11]=j):j=e[11];let A;e[12]!==s||e[13]!==r?(A=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=A):A=e[14];let k;e[15]!==A?(k=n.jsx(po,{className:"sr-only",children:A}),e[15]=A,e[16]=k):k=e[16];let w;e[17]!==a||e[18]!==o?(w=a&&o(d),e[17]=a,e[18]=o,e[19]=w):w=e[19];let y;e[20]!==w||e[21]!==k?(y=n.jsxs(fo,{className:"p-0 flex flex-col max-h-[95vh]",children:[k,w]}),e[20]=w,e[21]=k,e[22]=y):y=e[22];let C;return e[23]!==a||e[24]!==y||e[25]!==j?(C=n.jsxs(ho,{open:a,onOpenChange:l,children:[j,y]}),e[23]=a,e[24]=y,e[25]=j,e[26]=C):C=e[26],C}let g;e[27]!==h?(g=n.jsx(Zt,{asChild:!0,children:h}),e[27]=h,e[28]=g):g=e[28];let x;e[29]!==a||e[30]!==o?(x=a&&o(d),e[29]=a,e[30]=o,e[31]=x):x=e[31];let v;e[32]!==x?(v=n.jsx(Xt,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:x}),e[32]=x,e[33]=v):v=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==v?(b=n.jsxs(es,{open:a,onOpenChange:l,children:[g,v]}),e[34]=a,e[35]=g,e[36]=v,e[37]=b):b=e[37],b}function Rt(t){return t==="fast"?n.jsx(at,{size:16}):t==="thinking"?n.jsx(pn,{size:16}):n.jsx(mo,{size:16})}function pi(t){const e=E.c(13),s=Cn();let o;e[0]!==t||e[1]!==s.tiers?(o=d=>{const u=s.tiers[d];return u?u.title??u.modelId:t.chat[d]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function fi(){const t=E.c(24),e=B(),{simpleModeTier:s,setSimpleModeTier:o}=Ge(),r=go(),i=ss(),a=bo(i),l=pi(a),{data:V,error:d}=wn();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const c=u,p=Sn(),f=Vt()?.lockedHarness==="claude-code",m=Oe("model_choice"),h=Zn(),g=Xn();if(!h||!m)return null;let x,v;if(t[2]!==a||t[3]!==g||t[4]!==f||t[5]!==r||t[6]!==o||t[7]!==e||t[8]!==s||t[9]!==l||t[10]!==p||t[11]!==c||t[12]!==d){const w=bs(e);x="decopilot",v=Vi.map(y=>{const C=l[y],S=c.tiers[y];return{key:`decopilot-${y}`,icon:Rt(y),title:w[y],subtitle:g?C??e(Dt[y]):e(Dt[y]),active:s===y,onSelect:()=>o(y),modelOverride:g?I=>n.jsxs(n.Fragment,{children:[d&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(ai,{tier:y,orgSlot:r.tiers[y],userSlot:S,autoSlot:a.chat[y],filterModels:f?oi:void 0,onClose:I,onPick:N=>p.mutate({tier:y,slot:N}),onReset:()=>p.mutate({tier:y,slot:null})},`${y}:${S?.keyId??"org"}:${S?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=g,t[4]=f,t[5]=r,t[6]=o,t[7]=e,t[8]=s,t[9]=l,t[10]=p,t[11]=c,t[12]=d,t[13]=x,t[14]=v}else x=t[13],v=t[14];let b;t[15]!==x||t[16]!==v?(b=[{key:x,rows:v}],t[15]=x,t[16]=v,t[17]=b):b=t[17];const j=b;let A;t[18]!==s?(A=Rt(s),t[18]=s,t[19]=A):A=t[19];let k;return t[20]!==j||t[21]!==A||t[22]!==s?(k=n.jsx(ci,{tier:s,pillIcon:A,groups:j}),t[20]=j,t[21]=A,t[22]=s,t[23]=k):k=t[23],k}function As(t){const e=E.c(3),[s]=Se();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&Mo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const hi={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"},mi=tn.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),gi=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function xi(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:gi.map(vi)}),t[0]=e):e=t[0],e}function vi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function bi({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,V]=P.useState(!1),d=As(hi),{org:u}=Ce(),{editor:c}=Ot(),p=P.useRef(null),f=pt(o),m=()=>{!f||r||(V(!1),p.current?.click())},h=async T=>{const Q=T.target.files;if(!Q||Q.length===0||!c)return;const Z=Array.from(Q);try{let H=c.state.selection.from;for(const ne of Z)await ns(c,o??null,ne,H,i,a),H=c.state.selection.to}finally{p.current&&(p.current.value="")}},g=No({connectionId:s,orgId:u.id,orgSlug:u.slug}),x=Rs.virtualMcpPrompts(s,u.id),{data:v,isLoading:b}=Es({queryKey:x,queryFn:()=>Io(g),staleTime:6e4,enabled:l&&!!g}),j=v?.prompts??[],[A,k]=P.useState(null),{chatMode:w,setChatMode:y}=Ge(),[C,S]=Se(),I=Vt()?.lockedHarness!=="claude-code",N=we.find(T=>T.value===C.toolApprovalLevel)??we[0],M=a(N.shortKey),R=T=>{const Q=we.find(Z=>Z.value===T);if(Q){if(Q.value===C.toolApprovalLevel){V(!1);return}d(),ee("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:Q.value,source:"tools_popover"}),S({...C,toolApprovalLevel:Q.value}),V(!1)}},D=w==="plan",U=()=>{d();const T=D?"default":"plan";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},_=()=>{e(),V(!1)},L=async(T,Q)=>{if(!c||!g)return;const Z=kt(T._meta),H={from:c.state.selection.from,to:c.state.selection.to};try{const ne=await To(g,T.name,Q);en(c,H,{id:T.name,name:Co(T.name,Z),metadata:ne.messages,char:"/",kind:"prompt",args:Q})}catch{Ee.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async T=>{V(!1);const Q=!!(T.arguments&&T.arguments.length>0);if(ee("chat_prompt_inserted",{prompt_name:T.name,with_arguments:Q}),Q){k(T);return}await L(T)},q=async T=>{A&&(await L(A,T),k(null))},$=()=>{d();const T=w==="gen-image"?"default":"gen-image";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},O=()=>{d();const T=w==="web-search"?"default":"web-search";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},W=()=>{d();const T=w==="deep-research"?"default":"deep-research";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},X=w==="gen-image",te=w==="web-search",J=w==="deep-research",ae=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:Vo(o??null),className:"hidden",onChange:h,disabled:r});return n.jsxs(n.Fragment,{children:[ae,n.jsxs(Ps,{open:l,onOpenChange:T=>{T&&!l&&ee("chat_tools_popover_opened",{chat_mode:w}),V(T)},children:[n.jsx(Us,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:z("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[n.jsx(hn,{size:14}),n.jsx("span",{className:z("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:a("chat.toolsPopover.tools")})]})}),n.jsxs(Ls,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?n.jsxs(Ae,{onClick:m,disabled:r,children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(Ae,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:T=>T.preventDefault(),children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(Ae,{onClick:U,className:z(D&&"text-special"),children:[n.jsx(Bt,{size:16,className:z(D&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:z("text-xs text-muted-foreground",D&&"text-special font-medium"),children:mi})]}),n.jsxs(Ae,{onClick:$,className:z(X&&"text-special"),children:[n.jsx(Yt,{size:16,className:z(X&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),X&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:O,className:z(te&&"text-special"),children:[n.jsx(Qt,{size:16,className:z(te&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:W,className:z(J&&"text-special"),children:[n.jsx(Wt,{size:16,className:z(J&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),J&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(xt,{children:[n.jsxs(vt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),n.jsx(bt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Fs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):j.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):j.map(T=>n.jsxs(Ae,{onClick:()=>F(T),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:T.title||So(T.name,kt(T._meta))}),T.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:T.description})]},T.name))})]}),I&&n.jsxs(xt,{children:[n.jsxs(vt,{className:"gap-2",children:[n.jsx(We,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:M})]}),n.jsx(bt,{className:"w-48 p-1.5",children:n.jsx(Os,{value:C.toolApprovalLevel,onValueChange:R,children:we.map(T=>n.jsx(zs,{value:T.value,children:a(T.labelKey)},T.value))})})]}),n.jsxs(Ae,{onClick:_,children:[n.jsx(_o,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(P.Suspense,{children:n.jsx(xi,{})})]})]})]}),n.jsx(Xs,{prompt:A,setPrompt:k,onSubmit:q})]})}const Ai=[{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 yi(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:Ai.map(ji)}),t[0]=e):e=t[0],e}function ji(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function ki(t){const e=E.c(10),{onClick:s}=t,o=B();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=z("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(yi,{}),V=n.jsx($s,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let d;return e[7]!==s||e[8]!==a?(d=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Re=48;function wi(){const t=E.c(9),[e,s]=P.useState("idle"),[o,r]=P.useState(""),[i,a]=P.useState(""),[l,V]=P.useState(Ni),d=P.useRef(null),u=P.useRef(null),c=P.useRef(null),p=P.useRef(null),f=P.useRef(0),m=P.useRef(!1),h=P.useRef(""),g=P.useRef(""),x=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let v;t[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(Ci),p.current?.getTracks().forEach(Si),c.current=null,u.current=null,p.current=null},t[0]=v):v=t[0];const b=v;let j;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=N=>{p.current=N;const M=new AudioContext;u.current=M;const R=M.createMediaStreamSource(N),D=M.createAnalyser();D.fftSize=128,D.smoothingTimeConstant=.8,R.connect(D),c.current=D;const U=new Uint8Array(D.frequencyBinCount),_=()=>{if(!c.current)return;c.current.getByteFrequencyData(U);const L=[];for(let F=0;F<Re;F++){const q=Math.floor(F/Re*U.length);L.push(Math.max(.04,(U[q]??0)/255))}V(L),f.current=requestAnimationFrame(_)};_()};j=async()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N)return s("unsupported"),"unsupported";let M;try{M=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),g.current="",h.current="",m.current=!0,s("recording"),I(M);const R=new N;d.current=R,R.interimResults=!0,R.continuous=!0,R.lang=navigator.language||"en-US",R.onresult=D=>{if(d.current!==R)return;let U="",_="";for(let L=D.resultIndex;L<D.results.length;L++){const F=D.results[L],q=F?.[0]?.transcript??"";F?.isFinal?_=_+q:U=U+q}_&&(h.current=h.current+_,r(h.current)),g.current=U,a(U)},R.onerror=D=>{d.current===R&&D.error!=="no-speech"&&(m.current=!1,d.current=null,b(),s(D.error==="not-allowed"?"permission-denied":"idle"))},R.onend=()=>{if(d.current===R&&m.current)try{R.start()}catch{}};try{R.start()}catch{return m.current=!1,d.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=j}else j=t[1];const A=j;let k;t[2]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{m.current=!1,d.current?.stop(),b(),s("idle"),V(Array(Re).fill(.05)),a("");const I=(h.current+(g.current?" "+g.current:"")).trim();return r(""),h.current="",g.current="",I},t[2]=k):k=t[2];const w=k;let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),V(Array(Re).fill(.05)),h.current="",g.current=""},t[3]=y):y=t[3];const C=y;let S;return t[4]!==i||t[5]!==e||t[6]!==o||t[7]!==l?(S={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:x,startRecording:A,stopRecording:w,cancelRecording:C},t[4]=i,t[5]=e,t[6]=o,t[7]=l,t[8]=S):S=t[8],S}function Si(t){return t.stop()}function Ci(){}function Ni(){return Array(Re).fill(.05)}function Ii(t){const e=E.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(Ti),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=r):r=e[3],r}function Ti(t,e){return n.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)}const Pe=12e3,Et=re({token:se(),expiresAt:Ks()});qs("provider",[re({provider:ye("elevenlabs"),conversationToken:se().min(1)}),re({provider:ye("openai"),transport:ye("webrtc")})]);const _i=Bs([Et.extend({provider:ye("elevenlabs").default("elevenlabs"),conversationToken:se().min(1)}),Et.extend({provider:ye("openai"),transport:ye("webrtc")})]);re({token:se().min(1).max(4096),text:se().trim().min(1).max(Pe)});const ys=re({request:se().trim().min(1).max(Pe)}),ot=5e3;Lt(re({role:Le(["user","agent"]),text:se().min(1).max(ot)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=ot,{message:"Voice transcript is too long"});function nl(t){const e=[];let s=ot;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}re({token:se().min(1).max(4096),sdp:se().min(1).max(1e5),language:Le(["en","pt"]).default("en")}).strict();const Mi=re({sdp:se().min(1).max(1e5)});async function Di(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await At(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-eMBxQyXE.js");return{startOpenAIConversation:V}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return l(r,s,o)}const{Conversation:i}=await At(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=ys.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return o.aborted&&(await a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const V=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?a.sendContextualUpdate(V):a.sendUserMessage(`[Studio background event, not a new user request]
9
+ The report follows.`;function or(t){return{...t,content:[{type:"paragraph",content:[Zs({id:Ct,name:Ct,char:"/",kind:"prompt",metadata:[{role:"user",content:{type:"text",text:nr}}]})]},...t.content??[]]}}function rr(t){const e=E.c(30),{current:s,total:o,onPrev:r,onNext:i}=t,a=B();if(o<=1)return null;const l=s===0,V=s===0?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let d;e[0]!==V?(d=z("p-0.5 transition-colors rounded-lg",V),e[0]=V,e[1]=d):d=e[1];let u;e[2]!==a?(u=a("chat.pagination.previousLabel"),e[2]=a,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx($n,{size:14}),e[4]=c):c=e[4];let p;e[5]!==r||e[6]!==l||e[7]!==d||e[8]!==u?(p=n.jsx("button",{type:"button",onClick:r,disabled:l,className:d,"aria-label":u,children:c}),e[5]=r,e[6]=l,e[7]=d,e[8]=u,e[9]=p):p=e[9];const f=s+1;let m;e[10]!==a||e[11]!==f||e[12]!==o?(m=a("chat.pagination.counter",{current:f,total:o}),e[10]=a,e[11]=f,e[12]=o,e[13]=m):m=e[13];let h;e[14]!==m?(h=n.jsx("span",{className:"tabular-nums text-xs",children:m}),e[14]=m,e[15]=h):h=e[15];const g=s===o-1,x=s===o-1?"opacity-30 cursor-not-allowed":"hover:text-foreground cursor-pointer";let v;e[16]!==x?(v=z("p-0.5 transition-colors rounded-lg",x),e[16]=x,e[17]=v):v=e[17];let b;e[18]!==a?(b=a("chat.pagination.nextLabel"),e[18]=a,e[19]=b):b=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(zt,{size:14}),e[20]=j):j=e[20];let A;e[21]!==i||e[22]!==g||e[23]!==v||e[24]!==b?(A=n.jsx("button",{type:"button",onClick:i,disabled:g,className:v,"aria-label":b,children:j}),e[21]=i,e[22]=g,e[23]=v,e[24]=b,e[25]=A):A=e[25];let k;return e[26]!==A||e[27]!==p||e[28]!==h?(k=n.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[p,h,A]}),e[26]=A,e[27]=p,e[28]=h,e[29]=k):k=e[29],k}function Vs(t){const e=E.c(8),{currentIndex:s,total:o,onPrev:r,onNext:i,extraLeft:a}=t;let l;e[0]!==s||e[1]!==i||e[2]!==r||e[3]!==o?(l=n.jsx(rr,{current:s,total:o,onPrev:r,onNext:i}),e[0]=s,e[1]=i,e[2]=r,e[3]=o,e[4]=l):l=e[4];let V;return e[5]!==a||e[6]!==l?(V=n.jsxs("div",{className:"flex items-center gap-2",children:[l,a]}),e[5]=a,e[6]=l,e[7]=V):V=e[7],V}function ir(t){const e=E.c(17),{isStreaming:s,isAllAnswered:o,isCurrentAnswered:r,onAdvanceOrSubmit:i,submitLabel:a,nextLabel:l}=t,u=o?a===void 0?"Submit":a:l===void 0?"Next":l,c=o?s:!r,p=c?o?"Waiting for the assistant to finish…":"Answer this item to continue":null;let f;e[0]!==c||e[1]!==i?(f=()=>{c||i()},e[0]=c,e[1]=i,e[2]=f):f=e[2];const m=c&&"opacity-50 cursor-not-allowed";let h;e[3]!==m?(h=z("h-7 px-2.5 text-xs",m),e[3]=m,e[4]=h):h=e[4];let g;e[5]!==c||e[6]!==u||e[7]!==f||e[8]!==h?(g=n.jsx(Y,{type:"button",size:"sm","aria-disabled":c,onClick:f,className:h,children:u}),e[5]=c,e[6]=u,e[7]=f,e[8]=h,e[9]=g):g=e[9];const x=g;if(!p)return x;let v;e[10]!==x?(v=n.jsx(He,{asChild:!0,children:x}),e[10]=x,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;return e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16],j}function cs(t,e,s){return t.findIndex(o=>e(o)===s)}function Nt(t,e,s,o){return t.length===0?!1:t.every(r=>o(s[e(r)]))}function It(t,e,s,o,r){if(t.length===0)return null;const i=cs(t,e,r);for(let a=1;a<=t.length;a++){const l=t[(i+a)%t.length];if(!l)continue;const V=e(l);if(V!==r&&!o(s[V]))return V}return null}function ar(t){return!t.isStreaming&&t.allAnswered}function ds(t){const{parts:e,partKey:s,schema:o,defaultValues:r,isStreaming:i,hasAnswer:a,onSubmit:l}=t,V=e[0]?s(e[0]):"",[d,u]=P.useState(V),[c,p]=P.useState(!1),f=ws({resolver:Ss(o),defaultValues:r}),m=f.watch(),h=cs(e,s,d),g=h>=0?e[h]:void 0,x=a(m[d]),v=Nt(e,s,m,a),b=ar({isStreaming:i,allAnswered:v}),j=()=>{if(h>0){const I=e[h-1];I&&u(s(I))}},A=()=>{if(h>=0&&h<e.length-1){const I=e[h+1];I&&u(s(I))}},k=()=>{const I=f.getValues(),N=It(e,s,I,a,d);N&&u(N)},w=()=>{f.handleSubmit(I=>{const N=I;for(const M of e)l(M,N[s(M)])})()},y=P.useRef(w);y.current=w;const C=()=>{b&&(p(!1),y.current())},S=()=>{const I=f.getValues();if(Nt(e,s,I,a)){if(i){p(!0);return}p(!1),y.current()}else{const N=It(e,s,I,a,d);N&&u(N)}};return P.useEffect(()=>{if(c&&!i){if(!v){p(!1);return}p(!1),y.current()}},[c,i,v]),{form:f,activeKey:d,setActiveKey:u,currentIndex:h,currentPart:g,isCurrentAnswered:x,isAllAnswered:v,canSubmit:b,goPrev:j,goNext:A,advanceToNextUnanswered:k,submit:C,submitOrAdvance:S}}const us="chat.approval.defaultDenyReason";function ps(t){const e=E.c(36),{onYolo:s}=t,o=B(),[r,i]=Se();let a,l,V,d,u,c,p,f,m;if(e[0]!==s||e[1]!==r||e[2]!==i||e[3]!==o){const j=we.find(w=>w.value===r.toolApprovalLevel)??we[0];let A;e[13]!==s||e[14]!==r||e[15]!==i?(A=w=>{const y=w,C=r.toolApprovalLevel??"readonly";i({...r,toolApprovalLevel:y}),y==="auto"&&s(C)},e[13]=s,e[14]=r,e[15]=i,e[16]=A):A=e[16];const k=A;V=Ln,f=r.toolApprovalLevel,m=k,l=Fn,u="xs",c="text-xs text-muted-foreground border-border/60 bg-transparent hover:bg-accent/60 h-7 gap-1",p=lr,a=On,d=o(j.shortKey),e[0]=s,e[1]=r,e[2]=i,e[3]=o,e[4]=a,e[5]=l,e[6]=V,e[7]=d,e[8]=u,e[9]=c,e[10]=p,e[11]=f,e[12]=m}else a=e[4],l=e[5],V=e[6],d=e[7],u=e[8],c=e[9],p=e[10],f=e[11],m=e[12];let h;e[17]!==a||e[18]!==d?(h=n.jsx(a,{children:d}),e[17]=a,e[18]=d,e[19]=h):h=e[19];let g;e[20]!==l||e[21]!==u||e[22]!==c||e[23]!==p||e[24]!==h?(g=n.jsx(l,{size:u,className:c,onClick:p,children:h}),e[20]=l,e[21]=u,e[22]=c,e[23]=p,e[24]=h,e[25]=g):g=e[25];let x;e[26]!==o?(x=we.map(j=>n.jsx(Un,{value:j.value,children:o(j.labelKey)},j.value)),e[26]=o,e[27]=x):x=e[27];let v;e[28]!==x?(v=n.jsx(zn,{children:x}),e[28]=x,e[29]=v):v=e[29];let b;return e[30]!==V||e[31]!==v||e[32]!==f||e[33]!==m||e[34]!==g?(b=n.jsxs(V,{value:f,onValueChange:m,children:[g,v]}),e[30]=V,e[31]=v,e[32]=f,e[33]=m,e[34]=g,e[35]=b):b=e[35],b}function lr(t){return t.stopPropagation()}function fs(t){const e=E.c(8),{input:s}=t,o=B();if(s==null){let a;e[0]!==o?(a=o("chat.approval.noInput"),e[0]=o,e[1]=a):a=e[1];let l;return e[2]!==a?(l=n.jsx("div",{className:"px-4 text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=l):l=e[3],l}let r;try{let a;e[4]!==s?(a=JSON.stringify(s,null,2),e[4]=s,e[5]=a):a=e[5],r=a}catch{r=String(s)}let i;return e[6]!==r?(i=n.jsx("div",{className:"px-4",children:n.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:r})}),e[6]=r,e[7]=i):i=e[7],i}function Vr(t){const e=E.c(38),{approval:s,onRespond:o}=t,r=B(),[i]=Se(),a=i.toolApprovalLevel??"readonly";let l;e[0]!==s.approvalId||e[1]!==a||e[2]!==o||e[3]!==r?(l=()=>o(s.approvalId,!1,r(us),a),e[0]=s.approvalId,e[1]=a,e[2]=o,e[3]=r,e[4]=l):l=e[4];const V=l;let d;e[5]!==s.approvalId||e[6]!==a||e[7]!==o?(d=()=>o(s.approvalId,!0,void 0,a),e[5]=s.approvalId,e[6]=a,e[7]=o,e[8]=d):d=e[8];const u=d;let c;e[9]!==s.approvalId||e[10]!==o?(c=C=>o(s.approvalId,!0,void 0,C),e[9]=s.approvalId,e[10]=o,e[11]=c):c=e[11];const p=c;let f;e[12]!==p?(f=n.jsx("div",{className:"flex items-center gap-2",children:n.jsx(ps,{onYolo:p})}),e[12]=p,e[13]=f):f=e[13];const m=f;let h;e[14]!==r?(h=r("chat.approval.denyButton"),e[14]=r,e[15]=h):h=e[15];let g;e[16]!==V||e[17]!==h?(g=n.jsx(Y,{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:V,children:h}),e[16]=V,e[17]=h,e[18]=g):g=e[18];let x;e[19]!==r?(x=r("chat.approval.acceptButton"),e[19]=r,e[20]=x):x=e[20];let v;e[21]!==u||e[22]!==x?(v=n.jsx(Y,{type:"button",size:"sm",className:"h-7 px-2.5 text-xs active:scale-[0.97] transition-transform",onClick:u,children:x}),e[21]=u,e[22]=x,e[23]=v):v=e[23];let b;e[24]!==g||e[25]!==v?(b=n.jsxs(n.Fragment,{children:[g,v]}),e[24]=g,e[25]=v,e[26]=b):b=e[26];const j=b;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(We,{size:14}),e[27]=A):A=e[27];let k;e[28]!==r?(k=r("chat.approval.needsApproval"),e[28]=r,e[29]=k):k=e[29];let w;e[30]!==s.input?(w=n.jsx(fs,{input:s.input}),e[30]=s.input,e[31]=w):w=e[31];let y;return e[32]!==s.friendlyName||e[33]!==m||e[34]!==j||e[35]!==k||e[36]!==w?(y=n.jsx(pe,{icon:A,label:k,title:s.friendlyName,defaultExpanded:!0,footerLeft:m,footerRight:j,children:w}),e[32]=s.friendlyName,e[33]=m,e[34]=j,e[35]=k,e[36]=w,e[37]=y):y=e[37],y}const cr=Cs(se(),re({approved:Ns().optional(),levelOverride:Le(["auto","readonly"]).optional()}));function dr(t){const e=E.c(46),{approvals:s,isStreaming:o,onRespond:r}=t,i=B(),[a]=Se(),l=a.toolApprovalLevel??"readonly";let V;e[0]!==s?(V=Object.fromEntries(s.map(fr)),e[0]=s,e[1]=V):V=e[1];const d=V;let u;e[2]!==l||e[3]!==r||e[4]!==i?(u=(N,M)=>{const R=M;typeof R?.approved=="boolean"&&r(N.approvalId,R.approved,R.approved===!1?i(us):void 0,R.levelOverride??l)},e[2]=l,e[3]=r,e[4]=i,e[5]=u):u=e[5];let c;e[6]!==s||e[7]!==d||e[8]!==o||e[9]!==u?(c={parts:s,partKey:pr,schema:cr,defaultValues:d,isStreaming:o,hasAnswer:ur,onSubmit:u},e[6]=s,e[7]=d,e[8]=o,e[9]=u,e[10]=c):c=e[10];const p=ds(c);let f;e[11]!==s||e[12]!==p?(f=N=>{p.form.reset(Object.fromEntries(s.map(M=>[M.approvalId,{approved:!0,levelOverride:N}]))),p.submitOrAdvance()},e[11]=s,e[12]=p,e[13]=f):f=e[13];const m=f,h=p.currentPart,g=p.form;let x;e[14]!==p?(x=N=>{N.preventDefault(),p.submit()},e[14]=p,e[15]=x):x=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(We,{size:14}),e[16]=v):v=e[16];let b;e[17]!==s.length||e[18]!==i?(b=i("chat.approval.batchedLabel",{count:s.length}),e[17]=s.length,e[18]=i,e[19]=b):b=e[19];const j=h?.friendlyName??"";let A;e[20]!==m?(A=n.jsx(ps,{onYolo:m}),e[20]=m,e[21]=A):A=e[21];let k;e[22]!==s.length||e[23]!==p.currentIndex||e[24]!==p.goNext||e[25]!==p.goPrev||e[26]!==A?(k=n.jsx(Vs,{currentIndex:p.currentIndex,total:s.length,onPrev:p.goPrev,onNext:p.goNext,extraLeft:A}),e[22]=s.length,e[23]=p.currentIndex,e[24]=p.goNext,e[25]=p.goPrev,e[26]=A,e[27]=k):k=e[27];let w;e[28]!==h||e[29]!==p.form.control||e[30]!==p.submitOrAdvance?(w=h?n.jsx(hr,{approvalId:h.approvalId,control:p.form.control,onChange:p.submitOrAdvance}):null,e[28]=h,e[29]=p.form.control,e[30]=p.submitOrAdvance,e[31]=w):w=e[31];let y;e[32]!==h?(y=h?n.jsx(fs,{input:h.input}):null,e[32]=h,e[33]=y):y=e[33];let C;e[34]!==k||e[35]!==w||e[36]!==y||e[37]!==b||e[38]!==j?(C=n.jsx(pe,{icon:v,label:b,title:j,defaultExpanded:!0,footerLeft:k,footerRight:w,children:y}),e[34]=k,e[35]=w,e[36]=y,e[37]=b,e[38]=j,e[39]=C):C=e[39];let S;e[40]!==C||e[41]!==x?(S=n.jsx("form",{onSubmit:x,children:C}),e[40]=C,e[41]=x,e[42]=S):S=e[42];let I;return e[43]!==p.form||e[44]!==S?(I=n.jsx(nt,{...g,children:S}),e[43]=p.form,e[44]=S,e[45]=I):I=e[45],I}function ur(t){return typeof t?.approved=="boolean"}function pr(t){return t.approvalId}function fr(t){return[t.approvalId,{approved:void 0}]}function hr(t){const e=E.c(7),{approvalId:s,control:o,onChange:r}=t,i=B(),a=`${s}.approved`;let l;e[0]!==r||e[1]!==i?(l=d=>{const{field:u}=d,c=u.value===!0,p=u.value===!1;return n.jsxs(n.Fragment,{children:[n.jsx(Y,{type:"button",variant:p?"secondary":"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!1),r()},"aria-pressed":p,children:i("chat.approval.denyButton")}),n.jsx(Y,{type:"button",variant:c?"default":"outline",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{u.onChange(!0),r()},"aria-pressed":c,children:i("chat.approval.acceptButton")})]})},e[0]=r,e[1]=i,e[2]=l):l=e[2];let V;return e[3]!==o||e[4]!==a||e[5]!==l?(V=n.jsx(Is,{control:o,name:a,render:l}),e[3]=o,e[4]=a,e[5]=l,e[6]=V):V=e[6],V}function mr(){const t=E.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(We,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.approval.preparingRequest"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.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:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function gr(t){const e=E.c(8),{approvals:s,isStreaming:o,onRespond:r}=t;if(o&&s.length===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(mr,{}),e[0]=a):a=e[0],a}if(s.length===0)return null;if(s.length===1){const a=s[0];if(!a)return null;let l;return e[1]!==r||e[2]!==a?(l=n.jsx(Vr,{approval:a,onRespond:r}),e[1]=r,e[2]=a,e[3]=l):l=e[3],l}let i;return e[4]!==s||e[5]!==o||e[6]!==r?(i=n.jsx(dr,{approvals:s,isStreaming:o,onRespond:r}),e[4]=s,e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function xr(t){const e=E.c(28),{plan:s,onApprove:o,onDismiss:r}=t,i=B();let a;e[0]!==o||e[1]!==s.plan?(a=()=>{o(s.plan)},e[0]=o,e[1]=s.plan,e[2]=a):a=e[2];const l=a;let V;e[3]!==i?(V=i("chat.proposePlan.keepIterating"),e[3]=i,e[4]=V):V=e[4];let d;e[5]!==r||e[6]!==V?(d=n.jsx(Y,{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:r,children:V}),e[5]=r,e[6]=V,e[7]=d):d=e[7];let u;e[8]!==i?(u=i("chat.proposePlan.letsGo"),e[8]=i,e[9]=u):u=e[9];let c;e[10]!==l||e[11]!==u?(c=n.jsx(Y,{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:l,children:u}),e[10]=l,e[11]=u,e[12]=c):c=e[12];let p;e[13]!==d||e[14]!==c?(p=n.jsxs(n.Fragment,{children:[d,c]}),e[13]=d,e[14]=c,e[15]=p):p=e[15];const f=p;let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Kt,{size:14}),e[16]=m):m=e[16];let h;e[17]!==i?(h=i("chat.proposePlan.planReady"),e[17]=i,e[18]=h):h=e[18];let g;e[19]!==i?(g=i("chat.proposePlan.implementationPlan"),e[19]=i,e[20]=g):g=e[20];let x;e[21]!==s.plan?(x=n.jsx("div",{className:"px-4 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"prose prose-sm max-w-none text-sm",children:n.jsx(Bn,{id:"plan-preview",part:{type:"text",text:s.plan}})})}),e[21]=s.plan,e[22]=x):x=e[22];let v;return e[23]!==f||e[24]!==x||e[25]!==h||e[26]!==g?(v=n.jsx(pe,{icon:m,label:h,title:g,defaultExpanded:!0,footerRight:f,children:x}),e[23]=f,e[24]=x,e[25]=h,e[26]=g,e[27]=v):v=e[27],v}function vr(t){const e=E.c(6),{plans:s,onApprove:o,onDismiss:r}=t;let i;e[0]!==s?(i=is(s),e[0]=s,e[1]=i):i=e[1];const a=i;if(!a)return null;let l;return e[2]!==a||e[3]!==o||e[4]!==r?(l=n.jsx(xr,{plan:a,onApprove:o,onDismiss:r}),e[2]=a,e[3]=o,e[4]=r,e[5]=l):l=e[5],l}function hs(t){return t?"response"in t?t.response:t.option??t.draft:""}const Tt=re({response:se().min(1,"Response is required")}),br=re({option:se().nullable(),draft:se()}).refine(t=>(t.option??t.draft).length>0,{message:"Please select or enter an option"}),Ar=re({response:Le(["yes","no"])});function yr(t){switch(t.type){case"text":return Tt;case"choice":return br;case"confirm":return Ar;default:return Tt}}function jr(t){const e={};for(const s of t)e[s.toolCallId]=yr(s.input);return re(e)}function kr(t){const e=E.c(7),{control:s,name:o,placeholder:r}=t,i=B();let a;e[0]!==r||e[1]!==i?(a=V=>{const{field:d}=V,u=d.value??"";return n.jsxs(ct,{children:[n.jsx(dt,{children:n.jsx("div",{className:"px-2",children:n.jsxs("div",{className:"flex items-center gap-3 px-2 py-3 rounded-lg bg-accent/50",children:[n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(qt,{size:16,className:"text-muted-foreground"})}),n.jsx("input",{...d,value:u,type:"text",placeholder:r||i("chat.userAskQuestion.typeResponse"),autoFocus:!0,"aria-label":i("chat.userAskQuestion.textResponseInputAriaLabel"),className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"})]})})}),n.jsx(ut,{})]})},e[0]=r,e[1]=i,e[2]=a):a=e[2];let l;return e[3]!==s||e[4]!==o||e[5]!==a?(l=n.jsx(Gt,{control:s,name:o,render:a}),e[3]=s,e[4]=o,e[5]=a,e[6]=l):l=e[6],l}function ms(t,e){const s=E.c(4);let o,r;s[0]!==t||s[1]!==e?(o=()=>{const i=a=>{const l=a.target.tagName;if(l==="INPUT"||l==="TEXTAREA"||a.metaKey||a.ctrlKey||a.altKey)return;const V=Number.parseInt(a.key,10);V>=1&&V<=t&&(a.preventDefault(),e(V-1))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},r=[t,e],s[0]=t,s[1]=e,s[2]=o,s[3]=r):(o=s[2],r=s[3]),P.useEffect(o,r)}function wr(t){const e=E.c(51),{control:s,name:o,options:r}=t,i=B(),a=`${o}.option`;let l;e[0]!==s||e[1]!==a?(l={control:s,name:a,defaultValue:null},e[0]=s,e[1]=a,e[2]=l):l=e[2];const{field:V}=gt(l),d=`${o}.draft`;let u;e[3]!==s||e[4]!==d?(u={control:s,name:d,defaultValue:""},e[3]=s,e[4]=d,e[5]=u):u=e[5];const{field:c}=gt(u),p=V.value,f=c.value??"";let m;if(e[6]!==V||e[7]!==r?(m=U=>{const _=r[U];_!=null&&V.onChange(_)},e[6]=V,e[7]=r,e[8]=m):m=e[8],ms(r.length,m),r.length===0)return null;const h=p===null;let g;e[9]!==i?(g=i("chat.userAskQuestion.choiceOptionsAriaLabel"),e[9]=i,e[10]=g):g=e[10];let x;if(e[11]!==V||e[12]!==p||e[13]!==r||e[14]!==i){let U;e[16]!==V||e[17]!==p||e[18]!==i?(U=(_,L)=>{const F=p===_;return n.jsxs("button",{type:"button",onClick:()=>V.onChange(_),className:z("flex items-start gap-3 px-2 py-3 rounded-lg text-left transition-colors w-full",F&&"bg-accent/50",!F&&"hover:bg-accent/30"),"aria-label":i("chat.userAskQuestion.selectOption",{option:_}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0 mt-0.5",F?"bg-chart-1 text-white":"bg-muted text-foreground"),children:L+1}),n.jsx("span",{className:"text-sm text-foreground min-w-0 break-words",children:_})]},`${L}-${_}`)},e[16]=V,e[17]=p,e[18]=i,e[19]=U):U=e[19],x=r.map(U),e[11]=V,e[12]=p,e[13]=r,e[14]=i,e[15]=x}else x=e[15];const v=h&&"bg-accent/50",b=!h&&"hover:bg-accent/30";let j;e[20]!==v||e[21]!==b?(j=z("flex items-center gap-3 px-2 py-3 rounded-lg transition-colors w-full cursor-text",v,b),e[20]=v,e[21]=b,e[22]=j):j=e[22];let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("span",{className:"flex items-center justify-center size-6 rounded-md bg-muted shrink-0",children:n.jsx(qt,{size:16,className:"text-muted-foreground"})}),e[23]=A):A=e[23];const k=h?f:"";let w;e[24]!==c||e[25]!==V||e[26]!==p?(w=U=>{c.onChange(U.target.value),p!==null&&V.onChange(null)},e[24]=c,e[25]=V,e[26]=p,e[27]=w):w=e[27];let y;e[28]!==V||e[29]!==p?(y=()=>{p!==null&&V.onChange(null)},e[28]=V,e[29]=p,e[30]=y):y=e[30];let C;e[31]!==i?(C=i("chat.userAskQuestion.somethingElsePlaceholder"),e[31]=i,e[32]=C):C=e[32];let S;e[33]!==i?(S=i("chat.userAskQuestion.customChoiceInputAriaLabel"),e[33]=i,e[34]=S):S=e[34];let I;e[35]!==k||e[36]!==w||e[37]!==y||e[38]!==C||e[39]!==S?(I=n.jsx("input",{type:"text",value:k,onChange:w,onFocus:y,placeholder:C,"aria-label":S,className:"flex-1 text-sm bg-transparent outline-none placeholder:text-foreground/25 text-foreground min-w-0"}),e[35]=k,e[36]=w,e[37]=y,e[38]=C,e[39]=S,e[40]=I):I=e[40];let N;e[41]!==j||e[42]!==I?(N=n.jsxs("label",{className:j,children:[A,I]}),e[41]=j,e[42]=I,e[43]=N):N=e[43];let M;e[44]!==N||e[45]!==g||e[46]!==x?(M=n.jsx(dt,{children:n.jsxs("div",{className:"flex flex-col px-2",role:"group","aria-label":g,children:[x,N]})}),e[44]=N,e[45]=g,e[46]=x,e[47]=M):M=e[47];let R;e[48]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx(ut,{}),e[48]=R):R=e[48];let D;return e[49]!==M?(D=n.jsxs(ct,{children:[M,R]}),e[49]=M,e[50]=D):D=e[50],D}function Sr(t){const e=E.c(8),{control:s,name:o}=t,r=B();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=["yes","no"],e[0]=i):i=e[0];const a=i,l=P.useRef(null);let V;e[1]===Symbol.for("react.memo_cache_sentinel")?(V=c=>{l.current?.onChange(a[c]??"")},e[1]=V):V=e[1],ms(a.length,V);let d;e[2]!==r?(d=c=>{const{field:p}=c;return l.current=p,n.jsxs(ct,{children:[n.jsx(dt,{children:n.jsx("div",{className:"flex gap-2 px-2",role:"group","aria-label":r("chat.userAskQuestion.confirmationOptionsAriaLabel"),children:a.map(f=>{const m=p.value===f;return n.jsxs("button",{type:"button",onClick:()=>p.onChange(f),className:z("flex items-center gap-3 px-4 py-3 rounded-lg text-left transition-colors flex-1",m&&"bg-accent/50",!m&&"hover:bg-accent/30"),"aria-label":r("chat.userAskQuestion.confirmValue",{value:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)}),children:[n.jsx("span",{className:z("flex items-center justify-center size-6 rounded-md text-sm shrink-0",m?"bg-chart-1 text-white":"bg-muted text-foreground"),children:f==="yes"?1:2}),n.jsx("span",{className:"text-sm text-foreground capitalize",children:r(`chat.userAskQuestion.confirm${f==="yes"?"Yes":"No"}`)})]},f)})})}),n.jsx(ut,{})]})},e[2]=r,e[3]=d):d=e[3];let u;return e[4]!==s||e[5]!==o||e[6]!==d?(u=n.jsx(Gt,{control:s,name:o,render:d}),e[4]=s,e[5]=o,e[6]=d,e[7]=u):u=e[7],u}function _t(t){const e=E.c(13),{input:s,control:o,toolCallId:r}=t;switch(s.type){case"text":{const i=`${r}.response`;let a;return e[0]!==o||e[1]!==s.default||e[2]!==i?(a=n.jsx(kr,{control:o,name:i,placeholder:s.default}),e[0]=o,e[1]=s.default,e[2]=i,e[3]=a):a=e[3],a}case"choice":{let i;e[4]!==s.options?(i=s.options?.filter(Boolean)??[],e[4]=s.options,e[5]=i):i=e[5];const a=i;let l;return e[6]!==o||e[7]!==a||e[8]!==r?(l=n.jsx(wr,{control:o,name:r,options:a}),e[6]=o,e[7]=a,e[8]=r,e[9]=l):l=e[9],l}case"confirm":{const i=`${r}.response`;let a;return e[10]!==o||e[11]!==i?(a=n.jsx(Sr,{control:o,name:i}),e[10]=o,e[11]=i,e[12]=a):a=e[12],a}default:return null}}function Cr(t){const e=E.c(91),{parts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=jr(s.map(_r)),e[0]=s,e[1]=i):i=e[1];const a=i;let l;e[2]!==s?(l=Object.fromEntries(s.map(Tr)),e[2]=s,e[3]=l):l=e[3];const V=l;let d;e[4]!==r?(d=($,O)=>{const W=hs(O);W&&r($,W)},e[4]=r,e[5]=d):d=e[5];let u;e[6]!==V||e[7]!==o||e[8]!==s||e[9]!==a||e[10]!==d?(u={parts:s,partKey:Ir,schema:a,defaultValues:V,isStreaming:o,hasAnswer:Nr,onSubmit:d},e[6]=V,e[7]=o,e[8]=s,e[9]=a,e[10]=d,e[11]=u):u=e[11];const c=ds(u),p=c.currentPart,f=B();let m;e[12]!==p||e[13]!==c||e[14]!==f?(m=()=>{const $=p;if(!$)return;const O=f("chat.userAskQuestion.skipMessage"),W=$.toolCallId;$.input?.type==="choice"?(c.form.setValue(`${W}.option`,null),c.form.setValue(`${W}.draft`,O)):c.form.setValue(`${W}.response`,O),c.advanceToNextUnanswered()},e[12]=p,e[13]=c,e[14]=f,e[15]=m):m=e[15];const h=m;let g;e[16]!==c.currentIndex||e[17]!==c.goNext||e[18]!==c.goPrev||e[19]!==s.length?(g=n.jsx(Vs,{currentIndex:c.currentIndex,total:s.length,onPrev:c.goPrev,onNext:c.goNext}),e[16]=c.currentIndex,e[17]=c.goNext,e[18]=c.goPrev,e[19]=s.length,e[20]=g):g=e[20];const x=g;let v;e[21]!==f?(v=f("chat.userAskQuestion.skip"),e[21]=f,e[22]=v):v=e[22];let b;e[23]!==h||e[24]!==v?(b=n.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-7",children:v}),e[23]=h,e[24]=v,e[25]=b):b=e[25];let j;e[26]!==c.isAllAnswered||e[27]!==c.isCurrentAnswered||e[28]!==c.submitOrAdvance||e[29]!==o?(j=n.jsx(ir,{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]=j):j=e[30];let A;e[31]!==b||e[32]!==j?(A=n.jsxs(n.Fragment,{children:[b,j]}),e[31]=b,e[32]=j,e[33]=A):A=e[33];const k=A;if(s.length===1){const $=s[0];if(!$?.input)return null;const O=c.form;let W;e[34]!==c?(W=ne=>{ne.preventDefault(),c.submit()},e[34]=c,e[35]=W):W=e[35];let X;e[36]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(st,{size:14}),e[36]=X):X=e[36];let te;e[37]!==f?(te=f("chat.userAskQuestion.questionPending"),e[37]=f,e[38]=te):te=e[38];let J;e[39]!==$.input?.prompt||e[40]!==f?(J=$.input?.prompt??f("chat.userAskQuestion.question"),e[39]=$.input?.prompt,e[40]=f,e[41]=J):J=e[41];const ae=$.input;let T;e[42]!==c.form.control||e[43]!==$.toolCallId||e[44]!==ae?(T=n.jsx(_t,{input:ae,control:c.form.control,toolCallId:$.toolCallId}),e[42]=c.form.control,e[43]=$.toolCallId,e[44]=ae,e[45]=T):T=e[45];let Q;e[46]!==k||e[47]!==te||e[48]!==J||e[49]!==T?(Q=n.jsx(pe,{icon:X,label:te,title:J,defaultExpanded:!0,footerRight:k,children:T}),e[46]=k,e[47]=te,e[48]=J,e[49]=T,e[50]=Q):Q=e[50];let Z;e[51]!==W||e[52]!==Q?(Z=n.jsx("form",{onSubmit:W,autoComplete:"off",children:Q}),e[51]=W,e[52]=Q,e[53]=Z):Z=e[53];let H;return e[54]!==c.form||e[55]!==Z?(H=n.jsx(nt,{...O,children:Z}),e[54]=c.form,e[55]=Z,e[56]=H):H=e[56],H}const w=c.form;let y;e[57]!==c?(y=$=>{$.preventDefault(),c.submit()},e[57]=c,e[58]=y):y=e[58];let C;e[59]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(st,{size:14}),e[59]=C):C=e[59];let S;e[60]!==f?(S=f("chat.userAskQuestion.questionPending"),e[60]=f,e[61]=S):S=e[61];const I=c.currentIndex+1;let N;e[62]!==s.length||e[63]!==f||e[64]!==I?(N=f("chat.userAskQuestion.questionCount",{current:I,total:s.length}),e[62]=s.length,e[63]=f,e[64]=I,e[65]=N):N=e[65];let M;e[66]!==p?.input?.prompt||e[67]!==f?(M=p?.input?.prompt??f("chat.userAskQuestion.question"),e[66]=p?.input?.prompt,e[67]=f,e[68]=M):M=e[68];const R=c.activeKey,D=c.setActiveKey;let U;if(e[69]!==c.form||e[70]!==s){let $;e[72]!==c.form?($=O=>n.jsx(qn,{value:O.toolCallId,className:"mt-0",children:n.jsx(_t,{input:O.input,control:c.form.control,toolCallId:O.toolCallId})},O.toolCallId),e[72]=c.form,e[73]=$):$=e[73],U=s.map($),e[69]=c.form,e[70]=s,e[71]=U}else U=e[71];let _;e[74]!==c.activeKey||e[75]!==c.setActiveKey||e[76]!==U?(_=n.jsx(Qn,{value:R,onValueChange:D,children:U}),e[74]=c.activeKey,e[75]=c.setActiveKey,e[76]=U,e[77]=_):_=e[77];let L;e[78]!==x||e[79]!==k||e[80]!==S||e[81]!==N||e[82]!==M||e[83]!==_?(L=n.jsx(pe,{icon:C,label:S,count:N,title:M,defaultExpanded:!0,footerLeft:x,footerRight:k,children:_}),e[78]=x,e[79]=k,e[80]=S,e[81]=N,e[82]=M,e[83]=_,e[84]=L):L=e[84];let F;e[85]!==y||e[86]!==L?(F=n.jsx("form",{onSubmit:y,autoComplete:"off",children:L}),e[85]=y,e[86]=L,e[87]=F):F=e[87];let q;return e[88]!==c.form||e[89]!==F?(q=n.jsx(nt,{...w,children:F}),e[88]=c.form,e[89]=F,e[90]=q):q=e[90],q}function Nr(t){return!!hs(t)}function Ir(t){return t.toolCallId}function Tr(t){return t.input?.type==="choice"?[t.toolCallId,{option:null,draft:""}]:[t.toolCallId,{response:""}]}function _r(t){return{toolCallId:t.toolCallId,input:t.input}}function Mr(){const t=E.c(5),e=B();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(st,{className:"size-5 text-muted-foreground shimmer"}),t[0]=s):s=t[0];let o;t[1]!==e?(o=e("chat.userAskQuestion.preparingQuestion"),t[1]=e,t[2]=o):o=t[2];let r;return t[3]!==o?(r=n.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:[s,n.jsx("span",{className:"text-sm text-muted-foreground shimmer",children:o})]}),t[3]=o,t[4]=r):r=t[4],r}function gs(t){const e=E.c(7),{userAskParts:s,isStreaming:o,onSubmit:r}=t;let i;e[0]!==s?(i=s.filter(Dr),e[0]=s,e[1]=i):i=e[1];const a=i;if(a.length===0){if(o){let V;return e[2]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Mr,{}),e[2]=V):V=e[2],V}return null}let l;return e[3]!==o||e[4]!==r||e[5]!==a?(l=n.jsx(Cr,{parts:a,isStreaming:o,onSubmit:r}),e[3]=o,e[4]=r,e[5]=a,e[6]=l):l=e[6],l}function Dr(t){return t.state==="input-available"}function Rr(t){const e=E.c(33),{parts:s,isStreaming:o,onRespond:r}=t,i=B();let a;e[0]!==s?(a=s.at(-1),e[0]=s,e[1]=a):a=e[1];const l=a,V=l?.input;if(!l||!V?.title)return null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Kt,{size:14}),e[2]=d):d=e[2];let u;e[3]!==i?(u=i("chat.suggestTask.label"),e[3]=i,e[4]=u):u=e[4];const c=V.title;let p;e[5]!==r||e[6]!==l?(p=()=>r(l,!1),e[5]=r,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==i?(f=i("chat.suggestTask.notNow"),e[8]=i,e[9]=f):f=e[9];let m;e[10]!==o||e[11]!==p||e[12]!==f?(m=n.jsx(Y,{type:"button",size:"sm",variant:"outline",className:"h-7",disabled:o,onClick:p,children:f}),e[10]=o,e[11]=p,e[12]=f,e[13]=m):m=e[13];let h;e[14]!==r||e[15]!==l?(h=()=>r(l,!0),e[14]=r,e[15]=l,e[16]=h):h=e[16];let g;e[17]!==i?(g=i("chat.suggestTask.create"),e[17]=i,e[18]=g):g=e[18];let x;e[19]!==o||e[20]!==h||e[21]!==g?(x=n.jsx(Y,{type:"button",size:"sm",className:"h-7",disabled:o,onClick:h,children:g}),e[19]=o,e[20]=h,e[21]=g,e[22]=x):x=e[22];let v;e[23]!==x||e[24]!==m?(v=n.jsxs(n.Fragment,{children:[m,x]}),e[23]=x,e[24]=m,e[25]=v):v=e[25];let b;e[26]!==V.summary?(b=V.summary?n.jsx("p",{className:"px-4 pb-1 text-sm leading-snug text-muted-foreground whitespace-pre-wrap",children:V.summary}):null,e[26]=V.summary,e[27]=b):b=e[27];let j;return e[28]!==V.title||e[29]!==v||e[30]!==b||e[31]!==u?(j=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,footerRight:v,children:b}),e[28]=V.title,e[29]=v,e[30]=b,e[31]=u,e[32]=j):j=e[32],j}function Er(t){const e=t.filter(i=>i.status==="in_progress"),s=t.filter(i=>i.status==="completed").length,o=t.length;if(o>0&&s===o)return{icon:"completed",activity:"All done",progress:`${o}/${o}`};const[r]=e;return r&&e.length===1?{icon:"in_progress",activity:r.activeForm,progress:`${s}/${o} done`}:e.length>1?{icon:"in_progress",activity:`${e.length} in progress`,progress:`${s}/${o} done`}:s>0?{icon:"pending",activity:`${o-s} pending`,progress:`${s}/${o} done`}:{icon:"pending",activity:`${o} todos`,progress:"not started"}}function Pr(t){const e=E.c(13),{todos:s}=t;if(s.length===0)return null;let o;e[0]!==s?(o=Er(s),e[0]=s,e[1]=o):o=e[1];const r=o;let i;e[2]!==r.icon?(i=n.jsx(Or,{status:r.icon}),e[2]=r.icon,e[3]=i):i=e[3];const a=r.activity,l=r.progress;let V;e[4]!==s?(V=s.map(Ur),e[4]=s,e[5]=V):V=e[5];let d;e[6]!==V?(d=n.jsx("ul",{"data-testid":"todos-list",className:"flex flex-col px-2 max-h-[40vh] overflow-y-auto",children:V}),e[6]=V,e[7]=d):d=e[7];let u;return e[8]!==r.activity||e[9]!==r.progress||e[10]!==i||e[11]!==d?(u=n.jsx(pe,{icon:i,label:a,count:l,defaultExpanded:!1,children:d}),e[8]=r.activity,e[9]=r.progress,e[10]=i,e[11]=d,e[12]=u):u=e[12],u}function Ur(t,e){return n.jsx(Lr,{todo:t},e)}function Lr(t){const e=E.c(14),{todo:s}=t,o=s.status==="completed",i=s.status==="in_progress"?s.activeForm:s.content;let a;e[0]!==s.status?(a=n.jsx(Fr,{status:s.status}),e[0]=s.status,e[1]=a):a=e[1];const l=o&&"text-muted-foreground";let V;e[2]!==l?(V=z("relative text-sm leading-snug pt-px select-none",l),e[2]=l,e[3]=V):V=e[3];const d=o?"100%":"0%",u=o?"width 300ms ease 200ms":"width 150ms ease";let c;e[4]!==d||e[5]!==u?(c=n.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",height:"1px",background:"currentColor",width:d,transition:u}}),e[4]=d,e[5]=u,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==V||e[9]!==c?(p=n.jsxs("span",{className:V,children:[i,c]}),e[7]=i,e[8]=V,e[9]=c,e[10]=p):p=e[10];let f;return e[11]!==a||e[12]!==p?(f=n.jsxs("li",{className:"flex items-start gap-2.5 px-2 py-1.5 rounded-lg hover:bg-accent/50 transition-colors",children:[a,p]}),e[11]=a,e[12]=p,e[13]=f):f=e[13],f}function Fr(t){const e=E.c(4),{status:s}=t,o=s==="completed"?"true":void 0,r=s==="in_progress"?"true":void 0;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("svg",{viewBox:"0 0 21 21",children:n.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]=i):i=e[0];let a;return e[1]!==o||e[2]!==r?(a=n.jsx("div",{className:"todo-cb mt-0.5","data-checked":o,"data-progress":r,"aria-hidden":"true",children:i}),e[1]=o,e[2]=r,e[3]=a):a=e[3],a}function Or(t){const e=E.c(13),{status:s}=t,o=B();if(s==="completed"){let a;e[0]!==o?(a=o("chat.todoStatus.completed"),e[0]=o,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.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:n.jsx("path",{d:"M1 4l2.5 2.5L9 1"})}),e[2]=l):l=e[2];let V;return e[3]!==a?(V=n.jsx("span",{"aria-label":a,className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-sm bg-primary",children:l}),e[3]=a,e[4]=V):V=e[4],V}if(s==="in_progress"){let a;e[5]!==o?(a=o("chat.todoStatus.inProgress"),e[5]=o,e[6]=a):a=e[6];let l;return e[7]!==a?(l=n.jsx("span",{"aria-label":a,className:"inline-block w-2 h-2 rounded-full bg-primary animate-pulse shrink-0"}),e[7]=a,e[8]=l):l=e[8],l}let r;e[9]!==o?(r=o("chat.todoStatus.pending"),e[9]=o,e[10]=r):r=e[10];let i;return e[11]!==r?(i=n.jsx("span",{"aria-label":r,className:"inline-block w-3.5 h-3.5 rounded-sm border-[1.5px] border-muted-foreground/50 shrink-0"}),e[11]=r,e[12]=i):i=e[12],i}const zr={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"}]},$r={"credits.topUp.starter":"starter","credits.topUp.popular":"popular","credits.topUp.bestValue":"best_value"};function Br(t){const e=E.c(46),{source:s,onDone:o}=t,r=B(),i=Ts(),[a]=Se(),[l,V]=P.useState(a.language==="pt-BR"?"brl":"usd"),[d,u]=P.useState(""),[c,p]=P.useState(!1),f=l==="brl"?"R$":"$";let m;e[0]!==l||e[1]!==i?(m=async _=>{const{url:L}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:_,currency:l});return L},e[0]=l,e[1]=i,e[2]=m):m=e[2];let h;e[3]!==o?(h=_=>{_&&window.open(_,"_blank","noopener,noreferrer"),o?.()},e[3]=o,e[4]=h):h=e[4];let g;e[5]!==r?(g=_=>{Ee.error(r("credits.topUp.failed",{message:_.message}))},e[5]=r,e[6]=g):g=e[6];let x;e[7]!==m||e[8]!==h||e[9]!==g?(x={mutationFn:m,onSuccess:h,onError:g},e[7]=m,e[8]=h,e[9]=g,e[10]=x):x=e[10];const{mutate:v,isPending:b}=_s(x);let j;e[11]!==l||e[12]!==s||e[13]!==v?(j=(_,L)=>{ee("credits_topup_clicked",{amount_cents:_,currency:l,tier_label:L,source:s}),v(_)},e[11]=l,e[12]=s,e[13]=v,e[14]=j):j=e[14];const A=j,k=parseFloat(d),w=!isNaN(k)&&k>=1;let y,C,S;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=_=>{_&&V(_)},C=n.jsx(jt,{value:"usd",className:"h-8 px-3 text-xs",children:"USD"}),S=n.jsx(jt,{value:"brl",className:"h-8 px-3 text-xs",children:"BRL"}),e[15]=y,e[16]=C,e[17]=S):(y=e[15],C=e[16],S=e[17]);let I;e[18]!==l?(I=n.jsx("div",{className:"mb-4",children:n.jsxs(no,{type:"single",variant:"outline",size:"sm",value:l,onValueChange:y,children:[C,S]})}),e[18]=l,e[19]=I):I=e[19];const N=zr[l];let M;if(e[20]!==A||e[21]!==f||e[22]!==b||e[23]!==r||e[24]!==N){let _;e[26]!==A||e[27]!==f||e[28]!==b||e[29]!==r?(_=L=>{const{dollars:F,labelKey:q}=L;return n.jsxs("button",{type:"button",disabled:b,onClick:()=>A(F*100,$r[q]??"preset"),className:z("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:[n.jsxs("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:[f,F]}),n.jsx("span",{className:"text-xs text-muted-foreground",children:r(q)})]},F)},e[26]=A,e[27]=f,e[28]=b,e[29]=r,e[30]=_):_=e[30],M=N.map(_),e[20]=A,e[21]=f,e[22]=b,e[23]=r,e[24]=N,e[25]=M}else M=e[25];let R;e[31]!==M?(R=n.jsx("div",{className:"grid grid-cols-3 gap-2.5",children:M}),e[31]=M,e[32]=R):R=e[32];let D;e[33]!==A||e[34]!==f||e[35]!==d||e[36]!==k||e[37]!==w||e[38]!==b||e[39]!==c||e[40]!==r?(D=c?n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:f}),n.jsx(so,{type:"number",min:"1",step:"1",placeholder:r("credits.topUp.customPlaceholder"),value:d,onChange:_=>u(_.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),n.jsx(Y,{className:"h-10",disabled:!w||b,onClick:()=>A(Math.round(k*100),"custom"),children:r(b?"credits.topUp.opening":"credits.topUp.add")})]}):n.jsx("button",{type:"button",className:"w-full mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",onClick:()=>p(!0),children:r("credits.topUp.enterCustom")}),e[33]=A,e[34]=f,e[35]=d,e[36]=k,e[37]=w,e[38]=b,e[39]=c,e[40]=r,e[41]=D):D=e[41];let U;return e[42]!==R||e[43]!==D||e[44]!==I?(U=n.jsxs("div",{children:[I,R,D]}),e[42]=R,e[43]=D,e[44]=I,e[45]=U):U=e[45],U}const Kr=["chat.creditsExhaustedBanner.benefit1","chat.creditsExhaustedBanner.benefit2","chat.creditsExhaustedBanner.benefit3"];function qr(t){const e=E.c(47),{onDismiss:s}=t,{org:o}=Ce(),r=rt(),{decoKeyId:i}=to(),a=B(),l=Oe("credits");let V,d;if(e[0]!==o.id?(V=()=>{ee("credits_exhausted_shown",{organization_id:o.id})},d=[o.id],e[0]=o.id,e[1]=V,e[2]=d):(V=e[1],d=e[2]),P.useEffect(V,d),!l)return null;let u;e[3]!==s?(u=N=>!N&&s?.(),e[3]=s,e[4]=u):u=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 p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=n.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]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=n.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]=f):f=e[7];let m;e[8]!==a?(m=a("chat.creditsExhaustedBanner.title"),e[8]=a,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx(Wn,{className:"text-xl font-semibold tracking-tight",children:m}),e[10]=m,e[11]=h):h=e[11];let g;e[12]!==a?(g=a("chat.creditsExhaustedBanner.description"),e[12]=a,e[13]=g):g=e[13];let x;e[14]!==g?(x=n.jsx(Yn,{className:"mt-1.5 text-sm leading-relaxed",children:g}),e[14]=g,e[15]=x):x=e[15];let v;e[16]!==x||e[17]!==h?(v=n.jsxs("div",{className:"relative px-8 pt-8 pb-2 overflow-hidden",children:[p,n.jsxs(Gn,{className:"relative gap-4",children:[f,n.jsxs("div",{children:[h,x]})]})]}),e[16]=x,e[17]=h,e[18]=v):v=e[18];let b;e[19]!==i||e[20]!==s||e[21]!==a?(b=i&&n.jsxs("div",{className:"px-8 pt-5 pb-6",children:[n.jsx("div",{className:"rounded-xl border border-border p-5",children:n.jsx(Br,{source:"exhausted_banner",onDone:s})}),n.jsx("div",{className:"mt-5 rounded-xl bg-muted/25 border border-border/50 p-4 space-y-3",children:Kr.map(N=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex items-center justify-center size-5 rounded-full bg-success/15 shrink-0",children:n.jsx(it,{size:12,className:"text-success"})}),n.jsx("span",{className:"text-sm text-foreground/80",children:a(N)})]},N))})]}),e[19]=i,e[20]=s,e[21]=a,e[22]=b):b=e[22];let j;e[23]!==a?(j=a("chat.creditsExhaustedBanner.dismiss"),e[23]=a,e[24]=j):j=e[24];let A;e[25]!==s||e[26]!==j?(A=n.jsx(Y,{variant:"ghost",size:"sm",onClick:s,children:j}),e[25]=s,e[26]=j,e[27]=A):A=e[27];let k;e[28]!==r||e[29]!==s||e[30]!==o.slug?(k=()=>{r({to:"/$org/settings/ai-providers",params:{org:o.slug}}),s?.()},e[28]=r,e[29]=s,e[30]=o.slug,e[31]=k):k=e[31];let w;e[32]!==a?(w=a("chat.creditsExhaustedBanner.manageProviders"),e[32]=a,e[33]=w):w=e[33];let y;e[34]!==k||e[35]!==w?(y=n.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:k,children:w}),e[34]=k,e[35]=w,e[36]=y):y=e[36];let C;e[37]!==A||e[38]!==y?(C=n.jsxs("div",{className:"px-8 py-4 border-t border-border bg-muted/30 flex items-center justify-between",children:[A,y]}),e[37]=A,e[38]=y,e[39]=C):C=e[39];let S;e[40]!==v||e[41]!==b||e[42]!==C?(S=n.jsxs(Hn,{className:"sm:max-w-[520px] gap-0 p-0 overflow-hidden",onOpenAutoFocus:Qr,children:[v,b,C]}),e[40]=v,e[41]=b,e[42]=C,e[43]=S):S=e[43];let I;return e[44]!==S||e[45]!==u?(I=n.jsx(Jn,{open:!0,onOpenChange:u,children:S}),e[44]=S,e[45]=u,e[46]=I):I=e[46],I}function Qr(t){return t.preventDefault()}const Wr={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 Yr(t){const e=E.c(16),{kind:s,onDismiss:o,onSubscribe:r}=t,i=B(),{label:a,title:l}=Wr[s];let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(at,{size:14}),e[0]=V):V=e[0];let d;e[1]!==a||e[2]!==i?(d=i(a),e[1]=a,e[2]=i,e[3]=d):d=e[3];let u;e[4]!==i||e[5]!==l?(u=i(l),e[4]=i,e[5]=l,e[6]=u):u=e[6];let c;e[7]!==s||e[8]!==r||e[9]!==i?(c=s==="trial_exhausted"?n.jsx(Y,{size:"sm",onClick:r,className:"h-7 text-xs",children:i("chat.subscriptionLimit.subscribeButton")}):void 0,e[7]=s,e[8]=r,e[9]=i,e[10]=c):c=e[10];let p;return e[11]!==o||e[12]!==d||e[13]!==u||e[14]!==c?(p=n.jsx(pe,{icon:V,label:d,title:u,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:c}),e[11]=o,e[12]=d,e[13]=u,e[14]=c,e[15]=p):p=e[15],p}const Gr={ai_budget_exhausted:{label:"chat.planRefused.budgetLabel",title:"chat.planRefused.budgetTitle"},feature_not_in_plan:{label:"chat.planRefused.featureLabel",title:"chat.planRefused.featureTitle"}};function Mt(t){const e=E.c(21),{kind:s,onDismiss:o}=t,r=B(),i=rt(),{org:a}=Ce(),{label:l,title:V}=Gr[s];let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(at,{size:14}),e[0]=d):d=e[0];let u;e[1]!==l||e[2]!==r?(u=r(l),e[1]=l,e[2]=r,e[3]=u):u=e[3];let c;e[4]!==r||e[5]!==V?(c=r(V),e[4]=r,e[5]=V,e[6]=c):c=e[6];let p;e[7]!==i||e[8]!==o||e[9]!==a.slug?(p=()=>{i({to:"/$org/settings/ai-providers",params:{org:a.slug}}),o()},e[7]=i,e[8]=o,e[9]=a.slug,e[10]=p):p=e[10];let f;e[11]!==r?(f=r("chat.planRefused.seePlans"),e[11]=r,e[12]=f):f=e[12];let m;e[13]!==p||e[14]!==f?(m=n.jsx(Y,{size:"sm",className:"h-7 text-xs",onClick:p,children:f}),e[13]=p,e[14]=f,e[15]=m):m=e[15];let h;return e[16]!==o||e[17]!==u||e[18]!==c||e[19]!==m?(h=n.jsx(pe,{icon:d,label:u,title:c,defaultExpanded:!0,variant:"warning",onClose:o,footerRight:m}),e[16]=o,e[17]=u,e[18]=c,e[19]=m,e[20]=h):h=e[20],h}function xs(t){const e=Hr(t);if(e!==null){const d=xs(e);return{summary:d.summary,rawDetails:d.rawDetails??t}}const s=t.trim(),o=s.startsWith("<")&&/<[a-z][\s\S]*>/i.test(s),r=/cloudflare|cf-[a-z-]+|error[\s_-]?code[\s_-]?5\d\d/i.test(s),i=/failed to fetch|networkerror|load failed|offline/i.test(s),a=/timeout|timed out|aborted|deadline/i.test(s),l=s.length>240,V=/sandbox failed to start(?::\s*(.+))?/is.exec(s);if(V){const d=V[1]?.trim().replace(/\.$/,"");return{summary:d?`Your sandbox didn't finish starting up (${d}). Try again.`:"Your sandbox didn't finish starting up. Try again.",rawDetails:t}}return r||o&&l?{summary:"Our servers are having a moment. Try sending again in a few seconds.",rawDetails:t}:i?{summary:"Lost connection. Check your network and try again.",rawDetails:t}:a?{summary:"That took longer than expected. Try again.",rawDetails:t}:o||l?{summary:"Something unexpected came back from the server. Try again.",rawDetails:t}:{summary:t,rawDetails:null}}function Hr(t){const e=t.trim();if(!e.startsWith("{"))return null;let s;try{s=JSON.parse(e)}catch{return null}if(!s||typeof s!="object")return null;const{error:o,message:r}=s,i=typeof o=="string"?o:r;return typeof i=="string"&&i.trim()&&!i.trim().startsWith("{")?i:null}const Jr={length:"chat.highlight.warningDescriptionLength","content-filter":"chat.highlight.warningDescriptionContentFilter","tool-calls":"chat.highlight.warningDescriptionToolCalls"};function Qe(t){const e=E.c(29),s=B(),{variant:o,onDismiss:r}=t,i=o==="error";let a;e[0]!==i||e[1]!==s?(a=s(i?"chat.highlight.errorOccurred":"chat.highlight.responseIncomplete"),e[0]=i,e[1]=s,e[2]=a):a=e[2];const l=a,V=i?En:Ds;let d;e[3]!==t.error||e[4]!==t.finishReason||e[5]!==t.variant||e[6]!==s?(d=t.variant==="error"?t.error.message:(()=>{const v=Jr[t.finishReason];return v?s(v):s("chat.highlight.responseStoppedUnexpectedly",{reason:t.finishReason})})(),e[3]=t.error,e[4]=t.finishReason,e[5]=t.variant,e[6]=s,e[7]=d):d=e[7];const u=d;let c;e[8]!==i||e[9]!==u?(c=i?xs(u):{summary:u,rawDetails:null},e[8]=i,e[9]=u,e[10]=c):c=e[10];const{summary:p,rawDetails:f}=c;let m;e[11]!==V?(m=n.jsx(V,{size:14}),e[11]=V,e[12]=m):m=e[12];let h;e[13]!==i||e[14]!==t.onContinue||e[15]!==t.onFixInChat||e[16]!==s?(h=i?n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onFixInChat,className:"h-7 text-xs",children:s("chat.highlight.fixInChat")}):n.jsx(Y,{size:"sm",variant:"outline",onClick:t.onContinue,className:"h-7 text-xs",children:s("chat.highlight.continue")}),e[13]=i,e[14]=t.onContinue,e[15]=t.onFixInChat,e[16]=s,e[17]=h):h=e[17];let g;e[18]!==f||e[19]!==s?(g=f?n.jsxs("details",{className:"group mx-4",children:[n.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:[n.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:n.jsx("path",{d:"m4.5 3 3 3-3 3"})}),n.jsx("span",{className:"group-open:hidden",children:s("chat.highlight.showTechnicalDetails")}),n.jsx("span",{className:"hidden group-open:inline",children:s("chat.highlight.hideTechnicalDetails")})]}),n.jsxs("div",{className:"relative mt-2",children:[n.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(f).then(()=>Ee.success(s("chat.highlight.copiedToClipboard"))).catch(()=>Ee.error(s("chat.highlight.couldNotCopy")))},"aria-label":s("chat.highlight.copyErrorDetails"),title:s("chat.highlight.copy"),className:"absolute right-1.5 top-1.5 z-10 flex h-6 w-6 items-center justify-center rounded-lg bg-background/80 text-muted-foreground backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground",children:n.jsx(Pn,{className:"size-3.5"})}),n.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:f})]})]}):null,e[18]=f,e[19]=s,e[20]=g):g=e[20];let x;return e[21]!==l||e[22]!==r||e[23]!==p||e[24]!==m||e[25]!==h||e[26]!==g||e[27]!==o?(x=n.jsx(pe,{icon:m,label:l,title:p,defaultExpanded:!0,variant:o,onClose:r,footerRight:h,children:g}),e[21]=l,e[22]=r,e[23]=p,e[24]=m,e[25]=h,e[26]=g,e[27]=o,e[28]=x):x=e[28],x}function ze(t){const e=E.c(77);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{inline:o,voiceMode:r}=s,i=o===void 0?!1:o,a=r===void 0?!1:r,l=B(),{error:V,clearError:d,finishReason:u,clearFinishReason:c,messages:p,isStreaming:f,submit:m,sendMessage:h}=Fe(),[g,x]=Se(),{virtualMcpId:v,createTaskWithMessage:b}=Ye(),{chatMode:j,simpleModeTier:A}=Ge(),k=Oe("credits"),{mutate:w}=io("ORGANIZATION_BILLING_CHECKOUT_START","taskBoard.subscriptionPaywall.checkoutError");let y;e[2]!==w?(y=()=>w(),e[2]=w,e[3]=y):y=e[3];const C=y;let S;e[4]!==j||e[5]!==A||e[6]!==v||e[7]!==a?(S=oe=>({...a?{voiceMode:!0}:{},tier:A,mode:j,toolApprovalLevel:oe,agent:v?{id:v}:void 0}),e[4]=j,e[5]=A,e[6]=v,e[7]=a,e[8]=S):S=e[8];const I=S;let N;e[9]!==g.toolApprovalLevel?(N=g.toolApprovalLevel??Ms(),e[9]=g.toolApprovalLevel,e[10]=N):N=e[10];const M=N,R=p.at(-1),D=R?.role==="assistant"?R.parts:[],U=D.filter(ti),_=D.filter(Jt),L=as(D),F=rs(D);let q;e[11]!==V||e[12]!==h||e[13]!==l?(q=()=>{if(V){const ue={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.fixInChatMessage",{error:V.message})}]}]};h(ue)}},e[11]=V,e[12]=h,e[13]=l,e[14]=q):q=e[14];const $=q;let O;e[15]!==h||e[16]!==l?(O=()=>{const oe={type:"doc",content:[{type:"paragraph",content:[{type:"text",text:l("chat.highlight.pleaseContinue")}]}]};h(oe)},e[15]=h,e[16]=l,e[17]=O):O=e[17];const W=O;let X;e[18]!==I||e[19]!==M||e[20]!==m?(X=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{response:ue}},I(M))},e[18]=I,e[19]=M,e[20]=m,e[21]=X):X=e[21];const te=X;let J;e[22]!==I||e[23]!==M||e[24]!==m?(J=(oe,ue)=>{m({kind:"toolOutput",toolCallId:oe.toolCallId,output:{accepted:ue}},I(M))},e[22]=I,e[23]=M,e[24]=m,e[25]=J):J=e[25];const ae=J;let T;e[26]!==b||e[27]!==g||e[28]!==x||e[29]!==l||e[30]!==v?(T=oe=>{x({...g,toolApprovalLevel:"auto"}),b({virtualMcpId:v,message:{parts:[{type:"text",text:l("chat.highlight.implementPlanMessage",{plan:oe})}]}})},e[26]=b,e[27]=g,e[28]=x,e[29]=l,e[30]=v,e[31]=T):T=e[31];const Q=T,Z=ei;let H;e[32]!==I||e[33]!==m?(H=(oe,ue,Be,be)=>{m({kind:"approval",approvalId:oe,approved:ue,...Be?{reason:Be}:{}},I(be))},e[32]=I,e[33]=m,e[34]=H):H=e[34];const ne=H,G=ls();if(G.isCreditExhausted){let oe;return e[35]!==k||e[36]!==d||e[37]!==i?(oe=k?n.jsx(qr,{onDismiss:d}):n.jsx("div",{className:z(!i&&"absolute bottom-full left-0 right-0"),children:n.jsx(Mt,{kind:"ai_budget_exhausted",onDismiss:d})}),e[35]=k,e[36]=d,e[37]=i,e[38]=oe):oe=e[38],oe}const{showError:ce,showWarning:ie,hasApprovals:fe}=G,le=U.map(Xr).join("|"),$e=is(L)?.toolCallId??"",ht=F.map(Zr).join("|"),Ne=!i&&"absolute bottom-full left-0 right-0";let Ve;e[39]!==Ne?(Ve=z(Ne),e[39]=Ne,e[40]=Ve):Ve=e[40];let he;e[41]!==G.todos?(he=n.jsx(Pr,{todos:G.todos}),e[41]=G.todos,e[42]=he):he=e[42];let ge;e[43]!==d||e[44]!==G.subscriptionErrorKind||e[45]!==C?(ge=G.subscriptionErrorKind&&n.jsx(Yr,{kind:G.subscriptionErrorKind,onDismiss:d,onSubscribe:C}),e[43]=d,e[44]=G.subscriptionErrorKind,e[45]=C,e[46]=ge):ge=e[46];let de;e[47]!==d||e[48]!==G.planRefusal?(de=G.planRefusal&&n.jsx(Mt,{kind:G.planRefusal,onDismiss:d}),e[47]=d,e[48]=G.planRefusal,e[49]=de):de=e[49];let xe;e[50]!==d||e[51]!==V||e[52]!==$||e[53]!==ce?(xe=ce&&n.jsx(Qe,{variant:"error",error:V,onDismiss:d,onFixInChat:$}),e[50]=d,e[51]=V,e[52]=$,e[53]=ce,e[54]=xe):xe=e[54];let je;e[55]!==c||e[56]!==u||e[57]!==W||e[58]!==ie?(je=ie&&n.jsx(Qe,{variant:"warning",finishReason:u,onDismiss:c,onContinue:W}),e[55]=c,e[56]=u,e[57]=W,e[58]=ie,e[59]=je):je=e[59];const Ie=fe&&n.jsx(gr,{approvals:F,isStreaming:f,onRespond:ne},ht),_e=G.hasPlans&&n.jsx(vr,{plans:L,isStreaming:f,onApprove:Q,onDismiss:Z},$e),Me=G.hasTaskSuggestion&&n.jsx(Rr,{parts:_,isStreaming:f,onRespond:ae},_.at(-1)?.toolCallId??"");let ve;e[60]!==G.isWaitingForUserInput||e[61]!==te||e[62]!==f||e[63]!==le||e[64]!==U?(ve=G.isWaitingForUserInput&&n.jsx(gs,{userAskParts:U,isStreaming:f,onSubmit:te},le),e[60]=G.isWaitingForUserInput,e[61]=te,e[62]=f,e[63]=le,e[64]=U,e[65]=ve):ve=e[65];let ke;return e[66]!==Ve||e[67]!==he||e[68]!==ge||e[69]!==de||e[70]!==xe||e[71]!==je||e[72]!==Ie||e[73]!==_e||e[74]!==Me||e[75]!==ve?(ke=n.jsxs("div",{className:Ve,children:[he,ge,de,xe,je,Ie,_e,Me,ve]}),e[66]=Ve,e[67]=he,e[68]=ge,e[69]=de,e[70]=xe,e[71]=je,e[72]=Ie,e[73]=_e,e[74]=Me,e[75]=ve,e[76]=ke):ke=e[76],ke}function Zr(t){return t.approvalId}function Xr(t){return t.toolCallId}function ei(){document.querySelector("[data-chat-input]")?.focus()}function ti(t){return t.type==="tool-user_ask"}ze.Error=function(e){return n.jsx(Qe,{variant:"error",error:e.error,onDismiss:e.onDismiss,onFixInChat:e.onFixInChat})};ze.Warning=function(e){return n.jsx(Qe,{variant:"warning",finishReason:e.finishReason,onDismiss:e.onDismiss,onContinue:e.onContinue})};ze.UserAskQuestion=gs;function vs(t){const e=E.c(20),{taskId:s}=t,o=B(),r=bn(s),i=An(r),a=yn(),{stop:l,removeLocalMessage:V}=Fe();if(i.length===0)return null;let d;e[0]!==o?(d=o("chat.queueTray.sendNow"),e[0]=o,e[1]=d):d=e[1];let u;e[2]!==l?(u=()=>{l()},e[2]=l,e[3]=u):u=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx($t,{size:14}),e[4]=c):c=e[4];let p;e[5]!==d||e[6]!==u?(p=n.jsx(He,{asChild:!0,children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm","aria-label":d,onClick:u,children:c})}),e[5]=d,e[6]=u,e[7]=p):p=e[7];let f;e[8]!==o?(f=o("chat.queueTray.sendNow"),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=n.jsx(Je,{side:"top",children:n.jsx("p",{className:"text-xs",children:f})}),e[10]=f,e[11]=m):m=e[11];let h;e[12]!==p||e[13]!==m?(h=n.jsxs(Ze,{delayDuration:400,children:[p,m]}),e[12]=p,e[13]=m,e[14]=h):h=e[14];let g;return e[15]!==a||e[16]!==V||e[17]!==o||e[18]!==s?(g=(x,v)=>n.jsxs("div",{className:"group/queuerow flex items-center gap-2 px-3 py-1.5",children:[n.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:v+1}),n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:x.text}),n.jsx("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/queuerow:opacity-100",children:n.jsx(Y,{type:"button",variant:"ghost",size:"icon-sm",title:o("chat.queueTray.removeFromQueue"),"aria-label":o("chat.queueTray.removeFromQueue"),onClick:()=>{a.cancel(s,x.messageId).then(b=>{b&&(jn(s,x.messageId),V(x.messageId))})},children:n.jsx(ao,{className:"size-3.5"})})})]},x.messageId),e[15]=a,e[16]=V,e[17]=o,e[18]=s,e[19]=g):g=e[19],n.jsxs("div",{className:"mb-1 overflow-hidden rounded-2xl border border-border bg-card dark:bg-muted",children:[n.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:[n.jsx("span",{children:o(i.length===1?"chat.queueTray.queuedMessage":"chat.queueTray.queuedMessages",{count:i.length})}),h]}),i.map(g)]})}const si={anthropic:/^claude-/,openrouter:/^anthropic\/claude-/,deco:/^anthropic\/claude-/};function ni(t,e){return si[t]?.test(e)??!1}function oi(t){return vo(t)&&ni(t.providerId,t.modelId)}function ri(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 ii={fast:"chat.tierTrigger.tierFast",smart:"chat.tierTrigger.tierSmart",thinking:"chat.tierTrigger.tierThinking"};function ai(t){const e=E.c(32),{tier:s,orgSlot:o,userSlot:r,autoSlot:i,filterModels:a,onPick:l,onReset:V,onClose:d}=t,u=B(),c=ss(),p=new Set(c.map(li)),f=kn([r,o,i],p),m=f?.keyId??null,[h,g]=P.useState(m??c[0]?.id??null),x=c.some(F=>F.id===h)?h:m??c[0]?.id??null,v=x?c.find(F=>F.id===x):null,b="flex h-[70vh] max-h-[460px] w-full flex-col",j=ii[s];let A;e[0]!==u||e[1]!==j?(A=u(j),e[0]=u,e[1]=j,e[2]=A):A=e[2];let k;e[3]!==A?(k=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:A}),e[3]=A,e[4]=k):k=e[4];let w;e[5]!==V||e[6]!==u||e[7]!==r?(w=r&&n.jsx("button",{type:"button",onClick:V,className:"text-xs text-muted-foreground hover:text-foreground px-2 py-1 rounded-lg hover:bg-accent cursor-pointer",children:u("chat.modelPreferences.reset")}),e[5]=V,e[6]=u,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==k||e[10]!==w?(y=n.jsxs("div",{className:"flex items-center justify-between px-3 h-8 shrink-0",children:[k,w]}),e[9]=k,e[10]=w,e[11]=y):y=e[11];const C="flex-1 min-h-0",S=P.Suspense;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(lo,{}),e[12]=I):I=e[12];const N=Ao,M=!0,R=ri(m?f:null,v?.providerId??"deco");let D;e[13]!==x||e[14]!==l||e[15]!==g?(D=F=>{const q=F.keyId??x??"";g(q),l({keyId:q,modelId:F.modelId,title:F.title})},e[13]=x,e[14]=l,e[15]=g,e[16]=D):D=e[16];let U;e[17]!==N||e[18]!==x||e[19]!==a||e[20]!==d||e[21]!==g||e[22]!==R||e[23]!==D?(U=n.jsx(N,{compact:M,filterModels:a,onClose:d,credentialId:x,onCredentialChange:g,selectedModel:R,onModelChange:D}),e[17]=N,e[18]=x,e[19]=a,e[20]=d,e[21]=g,e[22]=R,e[23]=D,e[24]=U):U=e[24];let _;e[25]!==S||e[26]!==U||e[27]!==I?(_=n.jsx("div",{className:C,children:n.jsx(S,{fallback:I,children:U})}),e[25]=S,e[26]=U,e[27]=I,e[28]=_):_=e[28];let L;return e[29]!==_||e[30]!==y?(L=n.jsxs("div",{className:b,children:[y,_]}),e[29]=_,e[30]=y,e[31]=L):L=e[31],L}function li(t){return t.id}const Vi=["fast","smart","thinking"];function bs(t){return{fast:t("chat.tierTrigger.tierFast"),smart:t("chat.tierTrigger.tierSmart"),thinking:t("chat.tierTrigger.tierThinking")}}const Dt={fast:"chat.agentModels.quickerResponses",smart:"chat.agentModels.balancedQuality",thinking:"chat.agentModels.deeperReasoning"};function ci(t){const e=E.c(28),{tier:s,pillIcon:o,groups:r}=t,i=B();let a;e[0]!==i?(a=bs(i),e[0]=i,e[1]=a):a=e[1];const l=a,[V,d]=P.useState(!1);let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{y.onSelect(),d(!1)},e[2]=u):u=e[2];const c=u,p=l[s];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=z("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),e[3]=f):f=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=z("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]=m):m=e[4];const h=l[s];let g;e[5]!==h?(g=n.jsx("span",{className:m,children:h}),e[5]=h,e[6]=g):g=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ht,{size:12,className:"opacity-60 hidden @[320px]/chat-bottom:inline-block"}),e[7]=x):x=e[7];let v;e[8]!==o||e[9]!==p||e[10]!==g?(v=n.jsx(He,{asChild:!0,children:n.jsx("span",{className:"inline-flex min-w-0 shrink",children:n.jsx(Zt,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default","aria-label":p,className:f,children:[o,g,x]})})})}),e[8]=o,e[9]=p,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p?(b=n.jsx(Je,{children:p}),e[12]=p,e[13]=b):b=e[13];let j;e[14]!==v||e[15]!==b?(j=n.jsxs(Ze,{children:[v,b]}),e[14]=v,e[15]=b,e[16]=j):j=e[16];let A;if(e[17]!==r||e[18]!==i){let y;e[20]!==i?(y=C=>n.jsx("div",{className:"flex flex-col",children:C.rows.map(S=>n.jsxs("div",{className:"group/tier-row relative flex items-stretch rounded-lg hover:bg-muted",children:[n.jsxs("button",{type:"button",role:"menuitem","aria-label":S.title,onClick:()=>c(S),className:z("flex flex-1 min-w-0 items-start gap-2 px-2 py-1.5 text-left",S.modelOverride&&"pr-7 [@media(hover:hover)]:pr-2"),children:[S.icon&&n.jsx("span",{className:"shrink-0 text-muted-foreground mt-0.5",children:S.icon}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-sm",children:S.title}),S.subtitle&&n.jsx("div",{className:"text-xs text-muted-foreground",children:S.subtitle})]}),S.active&&n.jsx("span",{title:i("chat.tierTrigger.selected"),children:n.jsx(it,{size:14,className:"text-foreground mt-0.5"})})]}),S.modelOverride&&n.jsx(ui,{label:S.title,render:S.modelOverride})]},S.key))},C.key),e[20]=i,e[21]=y):y=e[21],A=r.map(y),e[17]=r,e[18]=i,e[19]=A}else A=e[19];let k;e[22]!==A?(k=n.jsx(Xt,{align:"end",className:"p-1 w-64",onOpenAutoFocus:di,children:n.jsx("div",{role:"menu",className:"flex flex-col",children:A})}),e[22]=A,e[23]=k):k=e[23];let w;return e[24]!==V||e[25]!==j||e[26]!==k?(w=n.jsxs(es,{open:V,onOpenChange:d,children:[j,k]}),e[24]=V,e[25]=j,e[26]=k,e[27]=w):w=e[27],w}function di(t){return t.preventDefault()}function ui(t){const e=E.c(38),{label:s,render:o}=t,r=B(),i=ts(),[a,l]=P.useState(!1);let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V=()=>l(!1),e[0]=V):V=e[0];const d=V;let u;e[1]!==s||e[2]!==r?(u=r("chat.modelPreferences.customizeModel",{tier:s}),e[1]=s,e[2]=r,e[3]=u):u=e[3];const c=a&&"opacity-100";let p;e[4]!==c?(p=z("absolute right-1 top-1/2 -translate-y-1/2 flex items-center justify-center","size-6 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]=p):p=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(fn,{size:14}),e[6]=f):f=e[6];let m;e[7]!==u||e[8]!==p?(m=n.jsx("button",{type:"button","aria-label":u,className:p,children:f}),e[7]=u,e[8]=p,e[9]=m):m=e[9];const h=m;if(i){let j;e[10]!==h?(j=n.jsx(uo,{asChild:!0,children:h}),e[10]=h,e[11]=j):j=e[11];let A;e[12]!==s||e[13]!==r?(A=r("chat.modelPreferences.customizeModel",{tier:s}),e[12]=s,e[13]=r,e[14]=A):A=e[14];let k;e[15]!==A?(k=n.jsx(po,{className:"sr-only",children:A}),e[15]=A,e[16]=k):k=e[16];let w;e[17]!==a||e[18]!==o?(w=a&&o(d),e[17]=a,e[18]=o,e[19]=w):w=e[19];let y;e[20]!==w||e[21]!==k?(y=n.jsxs(fo,{className:"p-0 flex flex-col max-h-[95vh]",children:[k,w]}),e[20]=w,e[21]=k,e[22]=y):y=e[22];let C;return e[23]!==a||e[24]!==y||e[25]!==j?(C=n.jsxs(ho,{open:a,onOpenChange:l,children:[j,y]}),e[23]=a,e[24]=y,e[25]=j,e[26]=C):C=e[26],C}let g;e[27]!==h?(g=n.jsx(Zt,{asChild:!0,children:h}),e[27]=h,e[28]=g):g=e[28];let x;e[29]!==a||e[30]!==o?(x=a&&o(d),e[29]=a,e[30]=o,e[31]=x):x=e[31];let v;e[32]!==x?(v=n.jsx(Xt,{side:"right",align:"start",collisionPadding:12,className:"w-[min(22rem,calc(100vw-2rem))] p-0 overflow-hidden",children:x}),e[32]=x,e[33]=v):v=e[33];let b;return e[34]!==a||e[35]!==g||e[36]!==v?(b=n.jsxs(es,{open:a,onOpenChange:l,children:[g,v]}),e[34]=a,e[35]=g,e[36]=v,e[37]=b):b=e[37],b}function Rt(t){return t==="fast"?n.jsx(at,{size:16}):t==="thinking"?n.jsx(pn,{size:16}):n.jsx(mo,{size:16})}function pi(t){const e=E.c(13),s=Cn();let o;e[0]!==t||e[1]!==s.tiers?(o=d=>{const u=s.tiers[d];return u?u.title??u.modelId:t.chat[d]?.title},e[0]=t,e[1]=s.tiers,e[2]=o):o=e[2];const r=o;let i;e[3]!==r?(i=r("fast"),e[3]=r,e[4]=i):i=e[4];let a;e[5]!==r?(a=r("smart"),e[5]=r,e[6]=a):a=e[6];let l;e[7]!==r?(l=r("thinking"),e[7]=r,e[8]=l):l=e[8];let V;return e[9]!==i||e[10]!==a||e[11]!==l?(V={fast:i,smart:a,thinking:l},e[9]=i,e[10]=a,e[11]=l,e[12]=V):V=e[12],V}function fi(){const t=E.c(24),e=B(),{simpleModeTier:s,setSimpleModeTier:o}=Ge(),r=go(),i=ss(),a=bo(i),l=pi(a),{data:V,error:d}=wn();let u;t[0]!==V?(u=V===void 0?{tiers:{}}:V,t[0]=V,t[1]=u):u=t[1];const c=u,p=Sn(),f=Vt()?.lockedHarness==="claude-code",m=Oe("model_choice"),h=Zn(),g=Xn();if(!h||!m)return null;let x,v;if(t[2]!==a||t[3]!==g||t[4]!==f||t[5]!==r||t[6]!==o||t[7]!==e||t[8]!==s||t[9]!==l||t[10]!==p||t[11]!==c||t[12]!==d){const w=bs(e);x="decopilot",v=Vi.map(y=>{const C=l[y],S=c.tiers[y];return{key:`decopilot-${y}`,icon:Rt(y),title:w[y],subtitle:g?C??e(Dt[y]):e(Dt[y]),active:s===y,onSelect:()=>o(y),modelOverride:g?I=>n.jsxs(n.Fragment,{children:[d&&n.jsx("div",{className:"text-xs text-destructive p-3 pb-0",children:e("chat.modelPreferences.loadFailed")}),n.jsx(ai,{tier:y,orgSlot:r.tiers[y],userSlot:S,autoSlot:a.chat[y],filterModels:f?oi:void 0,onClose:I,onPick:N=>p.mutate({tier:y,slot:N}),onReset:()=>p.mutate({tier:y,slot:null})},`${y}:${S?.keyId??"org"}:${S?.modelId??""}`)]}):void 0}}),t[2]=a,t[3]=g,t[4]=f,t[5]=r,t[6]=o,t[7]=e,t[8]=s,t[9]=l,t[10]=p,t[11]=c,t[12]=d,t[13]=x,t[14]=v}else x=t[13],v=t[14];let b;t[15]!==x||t[16]!==v?(b=[{key:x,rows:v}],t[15]=x,t[16]=v,t[17]=b):b=t[17];const j=b;let A;t[18]!==s?(A=Rt(s),t[18]=s,t[19]=A):A=t[19];let k;return t[20]!==j||t[21]!==A||t[22]!==s?(k=n.jsx(ci,{tier:s,pillIcon:A,groups:j}),t[20]=j,t[21]=A,t[22]=s,t[23]=k):k=t[23],k}function As(t){const e=E.c(3),[s]=Se();let o;return e[0]!==s.enableSounds||e[1]!==t?(o=()=>{s.enableSounds&&Mo(t.dataUri).catch(i=>{console.warn(`[sound] ${t.name} playback failed:`,i)})},e[0]=s.enableSounds,e[1]=t,e[2]=o):o=e[2],o}const hi={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"},mi=tn.togglePlanMode.keys.map(t=>t==="Shift"?"⇧":t).join(""),gi=[{src:"/connections/gmail.png",name:"Gmail"},{src:"/connections/perplexity.png",name:"Perplexity"},{src:"/connections/github.png",name:"GitHub"}];function xi(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1.5",children:gi.map(vi)}),t[0]=e):e=t[0],e}function vi(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-1 ring-border object-cover bg-white"},t.name)}function bi({disabled:t,onOpenConnections:e,virtualMcpId:s,selectedModel:o,isStreaming:r,onUnsupportedFile:i}){const a=B(),[l,V]=P.useState(!1),d=As(hi),{org:u}=Ce(),{editor:c}=Ot(),p=P.useRef(null),f=pt(o),m=()=>{!f||r||(V(!1),p.current?.click())},h=async T=>{const Q=T.target.files;if(!Q||Q.length===0||!c)return;const Z=Array.from(Q);try{let H=c.state.selection.from;for(const ne of Z)await ns(c,o??null,ne,H,i,a),H=c.state.selection.to}finally{p.current&&(p.current.value="")}},g=No({connectionId:s,orgId:u.id,orgSlug:u.slug}),x=Rs.virtualMcpPrompts(s,u.id),{data:v,isLoading:b}=Es({queryKey:x,queryFn:()=>Io(g),staleTime:6e4,enabled:l&&!!g}),j=v?.prompts??[],[A,k]=P.useState(null),{chatMode:w,setChatMode:y}=Ge(),[C,S]=Se(),I=Vt()?.lockedHarness!=="claude-code",N=we.find(T=>T.value===C.toolApprovalLevel)??we[0],M=a(N.shortKey),R=T=>{const Q=we.find(Z=>Z.value===T);if(Q){if(Q.value===C.toolApprovalLevel){V(!1);return}d(),ee("chat_approval_level_changed",{from_level:C.toolApprovalLevel,to_level:Q.value,source:"tools_popover"}),S({...C,toolApprovalLevel:Q.value}),V(!1)}},D=w==="plan",U=()=>{d();const T=D?"default":"plan";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},_=()=>{e(),V(!1)},L=async(T,Q)=>{if(!c||!g)return;const Z=kt(T._meta),H={from:c.state.selection.from,to:c.state.selection.to};try{const ne=await To(g,T.name,Q);en(c,H,{id:T.name,name:Co(T.name,Z),metadata:ne.messages,char:"/",kind:"prompt",args:Q})}catch{Ee.error(a("chat.toolsPopover.failedLoadPrompt"))}},F=async T=>{V(!1);const Q=!!(T.arguments&&T.arguments.length>0);if(ee("chat_prompt_inserted",{prompt_name:T.name,with_arguments:Q}),Q){k(T);return}await L(T)},q=async T=>{A&&(await L(A,T),k(null))},$=()=>{d();const T=w==="gen-image"?"default":"gen-image";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},O=()=>{d();const T=w==="web-search"?"default":"web-search";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},W=()=>{d();const T=w==="deep-research"?"default":"deep-research";ee("chat_mode_changed",{from_mode:w,to_mode:T,source:"tools_popover"}),y(T),V(!1)},X=w==="gen-image",te=w==="web-search",J=w==="deep-research",ae=n.jsx("input",{ref:p,type:"file",multiple:!0,accept:Vo(o??null),className:"hidden",onChange:h,disabled:r});return n.jsxs(n.Fragment,{children:[ae,n.jsxs(Ps,{open:l,onOpenChange:T=>{T&&!l&&ee("chat_tools_popover_opened",{chat_mode:w}),V(T)},children:[n.jsx(Us,{asChild:!0,children:n.jsxs(Y,{type:"button",variant:"ghost",size:"default",disabled:t,title:a("chat.toolsPopover.tools"),"aria-label":a("chat.toolsPopover.tools"),className:z("text-muted-foreground hover:text-foreground transition-[gap] duration-200 shrink min-w-0","gap-0 @[320px]/chat-bottom:gap-1.5"),children:[n.jsx(hn,{size:14}),n.jsx("span",{className:z("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:a("chat.toolsPopover.tools")})]})}),n.jsxs(Ls,{align:"start",className:"w-56 p-1.5 space-y-1",children:[f?n.jsxs(Ae,{onClick:m,disabled:r,children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]}):n.jsxs(Ze,{children:[n.jsx(He,{asChild:!0,children:n.jsxs(Ae,{"aria-disabled":"true",className:"opacity-50 cursor-not-allowed",onSelect:T=>T.preventDefault(),children:[n.jsx(wt,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.addFile")})]})}),n.jsx(Je,{side:"right",children:a("chat.toolsPopover.modelNoFileSupport")})]}),n.jsxs(Ae,{onClick:U,className:z(D&&"text-special"),children:[n.jsx(Bt,{size:16,className:z(D&&"text-special")}),n.jsx("span",{className:"flex-1 whitespace-nowrap",children:a("chat.toolsPopover.planMode")}),n.jsx("span",{className:z("text-xs text-muted-foreground",D&&"text-special font-medium"),children:mi})]}),n.jsxs(Ae,{onClick:$,className:z(X&&"text-special"),children:[n.jsx(Yt,{size:16,className:z(X&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.createImage")}),X&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:O,className:z(te&&"text-special"),children:[n.jsx(Qt,{size:16,className:z(te&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.webSearch")}),te&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(Ae,{onClick:W,className:z(J&&"text-special"),children:[n.jsx(Wt,{size:16,className:z(J&&"text-special")}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.deepResearch")}),J&&n.jsx("span",{className:"text-xs text-special font-medium",children:a("chat.toolsPopover.on")})]}),n.jsxs(xt,{children:[n.jsxs(vt,{className:"gap-2",children:[n.jsx("span",{className:"flex size-4 items-center justify-center text-base font-medium text-muted-foreground",children:"/"}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.prompts")})]}),n.jsx(bt,{className:"w-80 max-h-72 overflow-y-auto p-1.5",children:b?n.jsxs("div",{className:"flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground",children:[n.jsx(Fs,{className:"size-3.5"}),a("chat.toolsPopover.loadingPrompts")]}):j.length===0?n.jsx("div",{className:"px-2 py-3 text-sm text-muted-foreground",children:a("chat.toolsPopover.noPromptsAvailable")}):j.map(T=>n.jsxs(Ae,{onClick:()=>F(T),className:"flex flex-col items-start gap-0.5",children:[n.jsx("span",{className:"font-medium text-sm capitalize",children:T.title||So(T.name,kt(T._meta))}),T.description&&n.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:T.description})]},T.name))})]}),I&&n.jsxs(xt,{children:[n.jsxs(vt,{className:"gap-2",children:[n.jsx(We,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.approval")}),n.jsx("span",{className:"text-xs text-muted-foreground",children:M})]}),n.jsx(bt,{className:"w-48 p-1.5",children:n.jsx(Os,{value:C.toolApprovalLevel,onValueChange:R,children:we.map(T=>n.jsx(zs,{value:T.value,children:a(T.labelKey)},T.value))})})]}),n.jsxs(Ae,{onClick:_,children:[n.jsx(_o,{size:16}),n.jsx("span",{className:"flex-1",children:a("chat.toolsPopover.connections")}),n.jsx(P.Suspense,{children:n.jsx(xi,{})})]})]})]}),n.jsx(Xs,{prompt:A,setPrompt:k,onSubmit:q})]})}const Ai=[{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 yi(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center -space-x-1",children:Ai.map(ji)}),t[0]=e):e=t[0],e}function ji(t){return n.jsx("img",{src:t.src,alt:t.name,className:"size-5 rounded-sm ring-2 ring-muted object-cover bg-white"},t.name)}function ki(t){const e=E.c(10),{onClick:s}=t,o=B();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=z("group relative z-10 flex items-center gap-3 w-full px-4 py-3","rounded-b-2xl","cursor-pointer"),e[0]=r):r=e[0];let i;e[1]!==o?(i=o("chat.connectionsBanner.description"),e[1]=o,e[2]=i):i=e[2];let a;e[3]!==i?(a=n.jsx("p",{className:"flex-1 text-xs text-muted-foreground truncate text-left",children:i}),e[3]=i,e[4]=a):a=e[4];let l,V;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(yi,{}),V=n.jsx($s,{size:14,className:"shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors"}),e[5]=l,e[6]=V):(l=e[5],V=e[6]);let d;return e[7]!==s||e[8]!==a?(d=n.jsxs("button",{type:"button",onClick:s,className:r,children:[a,l,V]}),e[7]=s,e[8]=a,e[9]=d):d=e[9],d}const Re=48;function wi(){const t=E.c(9),[e,s]=P.useState("idle"),[o,r]=P.useState(""),[i,a]=P.useState(""),[l,V]=P.useState(Ni),d=P.useRef(null),u=P.useRef(null),c=P.useRef(null),p=P.useRef(null),f=P.useRef(0),m=P.useRef(!1),h=P.useRef(""),g=P.useRef(""),x=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition);let v;t[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{f.current&&(cancelAnimationFrame(f.current),f.current=0),u.current?.close().catch(Ci),p.current?.getTracks().forEach(Si),c.current=null,u.current=null,p.current=null},t[0]=v):v=t[0];const b=v;let j;if(t[1]===Symbol.for("react.memo_cache_sentinel")){const I=N=>{p.current=N;const M=new AudioContext;u.current=M;const R=M.createMediaStreamSource(N),D=M.createAnalyser();D.fftSize=128,D.smoothingTimeConstant=.8,R.connect(D),c.current=D;const U=new Uint8Array(D.frequencyBinCount),_=()=>{if(!c.current)return;c.current.getByteFrequencyData(U);const L=[];for(let F=0;F<Re;F++){const q=Math.floor(F/Re*U.length);L.push(Math.max(.04,(U[q]??0)/255))}V(L),f.current=requestAnimationFrame(_)};_()};j=async()=>{const N=window.SpeechRecognition||window.webkitSpeechRecognition;if(!N)return s("unsupported"),"unsupported";let M;try{M=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{return s("permission-denied"),"permission-denied"}r(""),a(""),g.current="",h.current="",m.current=!0,s("recording"),I(M);const R=new N;d.current=R,R.interimResults=!0,R.continuous=!0,R.lang=navigator.language||"en-US",R.onresult=D=>{if(d.current!==R)return;let U="",_="";for(let L=D.resultIndex;L<D.results.length;L++){const F=D.results[L],q=F?.[0]?.transcript??"";F?.isFinal?_=_+q:U=U+q}_&&(h.current=h.current+_,r(h.current)),g.current=U,a(U)},R.onerror=D=>{d.current===R&&D.error!=="no-speech"&&(m.current=!1,d.current=null,b(),s(D.error==="not-allowed"?"permission-denied":"idle"))},R.onend=()=>{if(d.current===R&&m.current)try{R.start()}catch{}};try{R.start()}catch{return m.current=!1,d.current=null,b(),s("idle"),"idle"}return"recording"},t[1]=j}else j=t[1];const A=j;let k;t[2]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{m.current=!1,d.current?.stop(),b(),s("idle"),V(Array(Re).fill(.05)),a("");const I=(h.current+(g.current?" "+g.current:"")).trim();return r(""),h.current="",g.current="",I},t[2]=k):k=t[2];const w=k;let y;t[3]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m.current=!1,d.current?.abort(),b(),s("idle"),r(""),a(""),V(Array(Re).fill(.05)),h.current="",g.current=""},t[3]=y):y=t[3];const C=y;let S;return t[4]!==i||t[5]!==e||t[6]!==o||t[7]!==l?(S={status:e,transcript:o,interimTranscript:i,waveformData:l,isSupported:x,startRecording:A,stopRecording:w,cancelRecording:C},t[4]=i,t[5]=e,t[6]=o,t[7]=l,t[8]=S):S=t[8],S}function Si(t){return t.stop()}function Ci(){}function Ni(){return Array(Re).fill(.05)}function Ii(t){const e=E.c(4),{data:s}=t;let o;e[0]!==s?(o=s.map(Ti),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==o?(r=n.jsx("div",{className:"flex items-center justify-center gap-[2px] h-10 overflow-hidden","aria-hidden":"true",children:o}),e[2]=o,e[3]=r):r=e[3],r}function Ti(t,e){return n.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)}const Pe=12e3,Et=re({token:se(),expiresAt:Ks()});qs("provider",[re({provider:ye("elevenlabs"),conversationToken:se().min(1)}),re({provider:ye("openai"),transport:ye("webrtc")})]);const _i=Bs([Et.extend({provider:ye("elevenlabs").default("elevenlabs"),conversationToken:se().min(1)}),Et.extend({provider:ye("openai"),transport:ye("webrtc")})]);re({token:se().min(1).max(4096),text:se().trim().min(1).max(Pe)});const ys=re({request:se().trim().min(1).max(Pe)}),ot=5e3;Lt(re({role:Le(["user","agent"]),text:se().min(1).max(ot)})).max(60).refine(t=>t.reduce((e,s)=>e+s.text.length,0)<=ot,{message:"Voice transcript is too long"});function nl(t){const e=[];let s=ot;for(const o of t.slice(-60).reverse()){if(s<=0)break;const r=o.text.slice(-s);e.unshift({role:o.role,text:r}),s-=r.length}return e}re({token:se().min(1).max(4096),sdp:se().min(1).max(1e5),language:Le(["en","pt"]).default("en")}).strict();const Mi=re({sdp:se().min(1).max(1e5)});async function Di(t,e,s,o,r){if(t.provider==="openai"){const{startOpenAIConversation:l}=await At(async()=>{const{startOpenAIConversation:V}=await import("./openai-conversation-D0z85aeO.js");return{startOpenAIConversation:V}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return l(r,s,o)}const{Conversation:i}=await At(async()=>{const{Conversation:l}=await import("./index-yN0BIuMc.js");return{Conversation:l}},[]);o.throwIfAborted();const a=await i.startSession({...s,clientTools:{delegate_to_agent:async l=>{const V=ys.safeParse(l);return JSON.stringify(V.success?await s.onDelegate(V.data):{status:"rejected",reason:"A complete request is required."})},get_agent_status:()=>JSON.stringify(s.getWorkStatus()),stop_agent_work:()=>JSON.stringify(s.cancelCurrentWork())},conversationToken:t.conversationToken,connectionType:"webrtc",overrides:{agent:{language:e}}});return o.aborted&&(await a.endSession(),o.throwIfAborted()),{endSession:()=>a.endSession(),setMicMuted:l=>a.setMicMuted(l),getOutputVolume:()=>a.getOutputVolume(),publishUpdate:l=>{const V=JSON.stringify({source:"Studio background data, not a user request or instructions",contextId:l.contextId,requestId:l.delegationId,text:l.text});l.delivery==="context"?a.sendContextualUpdate(V):a.sendUserMessage(`[Studio background event, not a new user request]
10
10
  ${V}
11
11
  Briefly report this update. Do not delegate it as new work.`)}}}const Ri=re({background:ye(!0),status:ye("started"),jobId:se().min(1)}),Ei=re({item:re({id:se().min(1),title:se(),status:se()})}),Pi=t=>`${t}:react-msg`;function js(t,e){const s=t.findIndex(r=>r.id===e&&r.role==="user");if(s<0)return null;const o=[];for(const r of t.slice(s+1))if(!r.metadata?.subtaskJobId){if(r.role==="user")break;r.role==="assistant"&&o.push(r)}return o}function Pt(t,e){const s=[],o=[];for(const r of js(t,e)??[])for(const i of r.parts){if(!("state"in i)||i.state!=="output-available"||!("output"in i))continue;const a=i.type;if(a==="tool-subtask"){const l=Ri.safeParse(i.output);l.success&&s.push(l.data.jobId)}else if(a==="tool-TASK_BOARD_ITEM_CREATE"){const l=Ei.safeParse(i.output);l.success&&o.push(l.data.item)}}return{backgroundJobs:s,tasks:o}}function Ut(t,e){const s=js(t,e);if(!s)return null;const o=s.at(-1);if(!o||o.parts.some(l=>"state"in l&&["approval-requested","input-streaming","input-available"].includes(String(l.state))))return null;const r=o.parts.findLast(l=>l.type==="text"||l.type==="dynamic-tool"||l.type.startsWith("tool-"));if(r?.type!=="text")return"";if(r.state==="streaming")return null;const i=r.text.replace(/```[\s\S]*?```/g,"").replace(/!\[[^\]]*\]\([^)]*\)/g,"").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+\.\s+)/gm,"").replace(/[*_`]/g,"").trim();if(!i)return"";if(i.length<=Pe)return i;const a=i.slice(0,Pe-1);return`${a.slice(0,a.lastIndexOf(" "))}…`}class Ui{constructor(e,s){this.url=e,this.language=s}url;language;state={phase:"idle",muted:!1,working:!1,error:null};listeners=new Set;generation=0;conversation;startupAbort;userSpeaking=!1;token;timer;expires;bindings;jobs=new Map;announcements=[];lastActivity=0;approvalReported=!1;cleanup=Promise.resolve();dispatchQueue=Promise.resolve();lastContext="";lastWorkStatus="";utterance=0;seenUserEvents=new Set;tasks=new Map;boardUpdates=new Map;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;outputVolume=()=>this.conversation?.getOutputVolume()??0;patch(e){if(!Object.entries(e).every(([s,o])=>this.state[s]===o)){this.state={...this.state,...e};for(const s of this.listeners)s()}}updateBindings(e,s){if(this.bindings=e,!s&&this.state.phase!=="idle"){this.stop();return}this.conversation&&(this.updateContext(),this.collectResults())}requestStatus(e){return e.result!==void 0?"finished":e.accepted?e.background?"running_in_background":this.bindings?.messages.some(s=>s.id===e.messageId)?"running":"queued":"submitting"}status(){const e=this.bindings;return{status:e?.isWaitingForApprovals?"approval_required":e?.error||e?.status==="error"?"failed":e?.isStreaming||e?.isRunInProgress?"working":"idle",requests:[...this.jobs.values()].slice(-6).map(s=>({id:s.messageId,request:s.request.slice(0,200),status:this.requestStatus(s),result:s.result?.slice(0,500)})),tasks:[...this.tasks.values()].slice(-10).map(s=>({title:s.title.slice(0,120),status:s.status}))}}updateContext(){const e=this.bindings?.voiceContext??"";e!==this.lastContext&&(this.lastContext=e,this.conversation?.publishUpdate({text:`Current Studio view, supplied as context only:
12
12
  ${e.slice(0,12e3)}`,delivery:"context",contextId:"studio-view"}))}collectResults(){const e=this.bindings;if(!e||!this.conversation)return;const s=e.isStreaming||e.isRunInProgress;if(this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus(),e.isWaitingForApprovals){this.approvalReported||(this.approvalReported=!0,this.report("The Studio agent needs the user's approval. The approval controls are visible in this chat. Ask the user to review them; do not approve on their behalf."));return}this.approvalReported=!1;for(const o of this.jobs.values()){if(!o.accepted||o.result!==void 0)continue;if(o.background){this.collectBackground(o,s);continue}const r=e.messages.findIndex(l=>l.id===o.messageId);if(r<0)continue;const i=r>=0&&e.messages.slice(r+1).some(l=>l.role==="user");if(s&&!i)continue;let a;if(!s&&!i&&(e.error||e.status==="error"))a="The agent's run failed. Ask the user to return to the chat for the error details; do not claim completion.";else if(!s&&!i&&e.finishReason&&["error","length","content-filter","aborted"].includes(e.finishReason))a=`The run ended with status ${e.finishReason}; successful completion is not established.`;else{const l=Ut(e.messages,o.messageId);if(l===null)continue;a=l;const V=Pt(e.messages,o.messageId);if(this.track(V.tasks),V.backgroundJobs.length){o.background=V.backgroundJobs,this.collectBackground(o,s);continue}}this.finish(o,a||"The agent finished without a final text response. Do not infer that the requested change succeeded.")}this.patch({working:s||[...this.jobs.values()].some(o=>o.accepted&&o.result===void 0)}),this.publishWorkStatus()}collectBackground(e,s){const o=this.bindings?.messages??[],r=[];for(const i of e.background??[]){const a=Pi(i),l=o.findIndex(u=>u.id===a);if(l<0)return;const V=o.slice(l+1).some(u=>u.role==="user");if(s&&!V)return;const d=Ut(o,a);if(d===null)return;this.track(Pt(o,a).tasks),r.push(d)}this.finish(e,r.filter(Boolean).join(`
@@ -1 +1 @@
1
- import{c as l,l as a,j as d}from"./index-QvCrIW6i.js";function c(s){const e=l.c(10);let i,r,t;e[0]!==s?({className:i,type:t,...r}=s,e[0]=s,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let o;e[4]!==i?(o=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-[var(--studio-control-height,2.25rem)] w-full min-w-0 rounded-[var(--studio-control-radius,var(--radius-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]=o):o=e[5];let n;return e[6]!==r||e[7]!==o||e[8]!==t?(n=d.jsx("input",{type:t,"data-slot":"input",className:o,...r}),e[6]=r,e[7]=o,e[8]=t,e[9]=n):n=e[9],n}export{c as I};
1
+ import{c as l,l as a,j as d}from"./index-BDhW9xxN.js";function c(s){const e=l.c(10);let i,r,t;e[0]!==s?({className:i,type:t,...r}=s,e[0]=s,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let o;e[4]!==i?(o=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-[var(--studio-control-height,2.25rem)] w-full min-w-0 rounded-[var(--studio-control-radius,var(--radius-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]=o):o=e[5];let n;return e[6]!==r||e[7]!==o||e[8]!==t?(n=d.jsx("input",{type:t,"data-slot":"input",className:o,...r}),e[6]=r,e[7]=o,e[8]=t,e[9]=n):n=e[9],n}export{c as I};