decocms 3.30.1 → 3.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/client/assets/{AlertCircle-BQLR7I4E.js → AlertCircle-CNjNg2wb.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DSaWSvAP.js → ArrowUpRight-7-SM74wR.js} +1 -1
  3. package/dist/client/assets/{Check-DCDpfG7m.js → Check-CkY-NLLZ.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-BBK-3Pzt.js → CheckCircle-DYKqL__C.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BD0G-h2k.js → ChevronDown-B8XrNXeE.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-DtP_Ayjz.js → ChevronLeft-B6gErU0k.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DUzhuedZ.js → ChevronRight-BJRYs8bt.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D5M0geM5.js → ChevronUp-CgxnjYlU.js} +1 -1
  9. package/dist/client/assets/{Container-Catp9d2q.js → Container-Dt-ev6Gi.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-Dok1GVxI.js → DotsVertical-BwZzHCbU.js} +1 -1
  11. package/dist/client/assets/{Eye-Dmik5hYP.js → Eye-Co-ItdFE.js} +1 -1
  12. package/dist/client/assets/{FilterLines-C37LaXJ1.js → FilterLines-DwPmuK2v.js} +1 -1
  13. package/dist/client/assets/{Globe01-D1c-3J9t.js → Globe01-BnLBFtky.js} +1 -1
  14. package/dist/client/assets/{HardDrive-C1vRZoAn.js → HardDrive-DmPQQU2w.js} +1 -1
  15. package/dist/client/assets/{Key01-CdveS1HN.js → Key01-BuFH2ztD.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-Bfxz6P9F.js → LayoutLeft-DOdRMzln.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-CxEkPs1F.js → LinkExternal01-ZepkFy5p.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Bkoa3Nbe.js → Monitor01-5IIvvy6H.js} +1 -1
  19. package/dist/client/assets/{Palette-C74Da44y.js → Palette-Cu3PTFf5.js} +1 -1
  20. package/dist/client/assets/{Play-BERjgeke.js → Play-4vubxqND.js} +1 -1
  21. package/dist/client/assets/{Plus-CdvauR8B.js → Plus-DrYyBDmj.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-4ELQWtuB.js → RefreshCcw01-eSV0Gr10.js} +1 -1
  23. package/dist/client/assets/{SearchMd-DvX2rzEB.js → SearchMd-Dq0euRWv.js} +1 -1
  24. package/dist/client/assets/{Settings02-Cqwfv4FN.js → Settings02-B_z2JeIq.js} +1 -1
  25. package/dist/client/assets/{Shield01-6id4oLiZ.js → Shield01-Dmf7TklI.js} +1 -1
  26. package/dist/client/assets/{Star01--MeVNqbA.js → Star01-ChWAyIjY.js} +1 -1
  27. package/dist/client/assets/{Stars01-C2BTpZeS.js → Stars01-DbI-YGmK.js} +1 -1
  28. package/dist/client/assets/{Stars02-D6zEAnUT.js → Stars02-WR3K9Daq.js} +1 -1
  29. package/dist/client/assets/{Sun-BGVsB7Cm.js → Sun-BIJajZBA.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-DC97OO23.js → SwitchHorizontal01-BjyN-RbX.js} +1 -1
  31. package/dist/client/assets/{Tool01-DQ4cTbeu.js → Tool01-Nn7pl58k.js} +1 -1
  32. package/dist/client/assets/{Trash01-Biurgfq6.js → Trash01-BW2v6vxa.js} +1 -1
  33. package/dist/client/assets/{Upload01-B-0o1yeU.js → Upload01-CyW8Wv9e.js} +1 -1
  34. package/dist/client/assets/{User01-CZ5ejYDg.js → User01-BBVMvdD1.js} +1 -1
  35. package/dist/client/assets/{Users01-CKNLJr4G.js → Users01-3QXDJ7kM.js} +1 -1
  36. package/dist/client/assets/{Users03-CA9cu5qb.js → Users03-Dc2Q2YCx.js} +1 -1
  37. package/dist/client/assets/{X-DlMQL-XM.js → X-BUrHvnq3.js} +1 -1
  38. package/dist/client/assets/{XCircle-G0WrPq0g.js → XCircle-Bz32In76.js} +1 -1
  39. package/dist/client/assets/{XClose-LNW85JIs.js → XClose-D4SdKRIc.js} +1 -1
  40. package/dist/client/assets/{Zap-CbtV6Vvm.js → Zap-DAhQN3Qe.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-C9LhFrIW.js → ZapSquare-DdYqdyu4.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-CImzlj9g.js → ZoomOut-BP5vTMyD.js} +1 -1
  43. package/dist/client/assets/{access-gate-DR0BZ9Yv.js → access-gate-CGZv0aLQ.js} +1 -1
  44. package/dist/client/assets/{accordion-CiWkTYYE.js → accordion-CGxHoi6P.js} +1 -1
  45. package/dist/client/assets/add-section-modal-DLCZWYmt.js +1 -0
  46. package/dist/client/assets/agent-capabilities-BOt7wU7l.js +3 -0
  47. package/dist/client/assets/{agent-icon-CjlB-XbA.js → agent-icon-DbC1U9Lv.js} +1 -1
  48. package/dist/client/assets/{agent-icons-COjGtXRX.js → agent-icons-B273VQSG.js} +2 -2
  49. package/dist/client/assets/{agents-list-BbpQy40q.js → agents-list-Dpi-AAFb.js} +1 -1
  50. package/dist/client/assets/{ai-providers-YKtufrsd.js → ai-providers-DGbRuhig.js} +1 -1
  51. package/dist/client/assets/{alert-DUOzDLz2.js → alert-dB15ZxT2.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-ZB1-0uWA.js → alert-dialog-CstddcEP.js} +2 -2
  53. package/dist/client/assets/app-editor-Cq82w23j.js +1 -0
  54. package/dist/client/assets/{auth-catchall-p-9cQrp4.js → auth-catchall-2_Uziri1.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-DCQZj1x8.js → auth-split-layout-BBSUM3P9.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-1QBzAyda.js → automation-list-row-DeSlvYhB.js} +1 -1
  57. package/dist/client/assets/{automation-runs-CbXniThO.js → automation-runs-D6XH4v3a.js} +1 -1
  58. package/dist/client/assets/{automations-DXbm14M-.js → automations-DouKICLt.js} +1 -1
  59. package/dist/client/assets/{avatar-DdrKHW7Q.js → avatar-Glcqg-C7.js} +1 -1
  60. package/dist/client/assets/{badge-GxV01_sa.js → badge-CjjK5Sr7.js} +1 -1
  61. package/dist/client/assets/{brand-context-CckU9jvo.js → brand-context-DdQVWL7M.js} +1 -1
  62. package/dist/client/assets/{buckets-BXxpFWbP.js → buckets-DVxXOURG.js} +1 -1
  63. package/dist/client/assets/{calendar-ndWEDvWe.js → calendar-D0KKVHnd.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-C1lcmzPk.js → capability-load-error-B_GRCsfG.js} +1 -1
  65. package/dist/client/assets/{card-B7vNztnP.js → card-DeDg0Mpx.js} +1 -1
  66. package/dist/client/assets/{chat-context-Dr8mURNn.js → chat-context-Dd9y-6Y-.js} +1 -1
  67. package/dist/client/assets/{checkbox-CvlqSsv8.js → checkbox-D292XxeM.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-DbBnzJkW.js → cli-auth-success-DF9o-evj.js} +1 -1
  69. package/dist/client/assets/{collection-detail-dh1JPTkf.js → collection-detail-ZNirTQKs.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-ByiFEfVE.js → collection-display-button-BHNg4RzF.js} +1 -1
  71. package/dist/client/assets/{collection-search-B62hBYcH.js → collection-search-CFFTRK3x.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-p305Tve_.js → collection-table-wrapper-CJC6Vyfs.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BoWbncvo.js → collection-tabs-Da8fu2pB.js} +1 -1
  74. package/dist/client/assets/{collections-BU-b7Qnp.js → collections-CWnO7g9J.js} +1 -1
  75. package/dist/client/assets/{command-DeymMKPH.js → command-Dm1ALJPS.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-B6fCPmnk.js → connect-desktop-dialog-CNaHa2Dn.js} +1 -1
  77. package/dist/client/assets/{connection-card-BdHs3sI8.js → connection-card-J_g5yRQM.js} +1 -1
  78. package/dist/client/assets/{connection-detail-1bfT9skO.js → connection-detail-CtdPxsW2.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-Cl8WE-Wv.js → connection-form-helpers-0bmqzhLl.js} +1 -1
  80. package/dist/client/assets/connections-P_p0V_Q0.js +1 -0
  81. package/dist/client/assets/decopilot-sse-pool-BemyIcDl.js +1 -0
  82. package/dist/client/assets/{dialog-Bug5LYvY.js → dialog-B4Gk40Ec.js} +1 -1
  83. package/dist/client/assets/{domain-settings-CiVW_jUc.js → domain-settings-BDb8F-pn.js} +1 -1
  84. package/dist/client/assets/{drawer-Ckfnpw8I.js → drawer-C8AwBmXm.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-CggnBdjt.js → dropdown-menu-D2S2HMhI.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-yS0CT9hK.js → dynamic-plugin-layout-Dg3kd-lT.js} +1 -1
  87. package/dist/client/assets/{empty-state-C6yeON6c.js → empty-state-BEPxxZyq.js} +1 -1
  88. package/dist/client/assets/{empty-state-DtTBbW_W.js → empty-state-ZcLmoTrQ.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-BR7VTC2M.js → extract-connection-data-Cdme2PYD.js} +1 -1
  90. package/dist/client/assets/{features-fQ1ChqbW.js → features-Dg5ySgax.js} +1 -1
  91. package/dist/client/assets/file-explorer-NmtOY4n0.js +2 -0
  92. package/dist/client/assets/{file-type-icon-Dg4vNCbL.js → file-type-icon-ByhQy2rW.js} +1 -1
  93. package/dist/client/assets/{files-C7GL35WM.js → files-CGUJegiW.js} +1 -1
  94. package/dist/client/assets/{form-Bkkvnz-_.js → form-DzqpARCW.js} +1 -1
  95. package/dist/client/assets/{general-T2AFh9Ye.js → general-BaZ3r2GW.js} +1 -1
  96. package/dist/client/assets/{generate-id-DfnWKozM.js → generate-id-DCN1LrlB.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-BKJVsWG6.js → github-repo-picker-DifHpnDV.js} +1 -1
  98. package/dist/client/assets/{header-tab-button-CfuW1KOG.js → header-tab-button-CyQ_CUpS.js} +1 -1
  99. package/dist/client/assets/{hover-card-7wnR4X6J.js → hover-card-fQ5zGcbl.js} +1 -1
  100. package/dist/client/assets/{image-field-DsnvgvCV.js → image-field-_Av_lLAg.js} +1 -1
  101. package/dist/client/assets/{index-uM9cBeAz.js → index--VFF-Fa0.js} +1 -1
  102. package/dist/client/assets/{index-BL9vKovB.js → index-0pKQiQw5.js} +4 -4
  103. package/dist/client/assets/{index-CCldjkHi.js → index-Bkgvp8b5.js} +1 -1
  104. package/dist/client/assets/{index-CV7TX6uY.js → index-BlbwvYId.js} +1 -1
  105. package/dist/client/assets/{index-CvubZqsl.js → index-Brb5zXrs.js} +1 -1
  106. package/dist/client/assets/{index-BDwe75Ed.js → index-CDPDznJw.js} +1 -1
  107. package/dist/client/assets/{index-C_NDVGp1.js → index-CDa8r-Ay.js} +1 -1
  108. package/dist/client/assets/index-CXYYh-WP.js +1 -0
  109. package/dist/client/assets/{index-K-cFrJme.js → index-D3IoOs9k.js} +1 -1
  110. package/dist/client/assets/{index-M8U0QO9V.js → index-D7vPwljU.js} +1 -1
  111. package/dist/client/assets/index-D_v0xAjK.js +8 -0
  112. package/dist/client/assets/{index-BjoOIgbb.js → index-DjCrtoJM.js} +3 -3
  113. package/dist/client/assets/{index-C6AFi5aI.js → index-H-an7LFa.js} +1 -1
  114. package/dist/client/assets/{index-BD68Poau.js → index-grq1eXi6.js} +1 -1
  115. package/dist/client/assets/{index-redirect-CDKs11B5.js → index-redirect-DtYqdHDy.js} +1 -1
  116. package/dist/client/assets/index-snZrdd2U.js +1 -0
  117. package/dist/client/assets/{input-CAytkUdm.js → input-odGTsdHi.js} +1 -1
  118. package/dist/client/assets/{integration-icon-BxZqCPgY.js → integration-icon-CYVpZTf5.js} +1 -1
  119. package/dist/client/assets/{label-_bcDhrPn.js → label-CO8q2BMX.js} +1 -1
  120. package/dist/client/assets/{layout-D6JyUu-W.js → layout-mA5Rj_u2.js} +1 -1
  121. package/dist/client/assets/{login-D_Y894-5.js → login-BdTiL4Ph.js} +1 -1
  122. package/dist/client/assets/{members-BiZDHDwm.js → members-K2LSrSOy.js} +1 -1
  123. package/dist/client/assets/monaco-editor-DKpM33ac.js +9 -0
  124. package/dist/client/assets/{monitoring-stats-row-BH1n8Qao.js → monitoring-stats-row-C1HQhYEp.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-Bwrh5dBF.js → oauth-callback-RCth5FgJ.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-DnFWhV-5.js → oauth-callback-ai-provider-Bx_f4SNv.js} +1 -1
  127. package/dist/client/assets/{onboarding-0pY55b33.js → onboarding-Cw0yv-ax.js} +1 -1
  128. package/dist/client/assets/{org-install-CfS-9owX.js → org-install-C5oIAlaU.js} +1 -1
  129. package/dist/client/assets/{org-layout-WjhxFhVG.js → org-layout-AJN3IVEY.js} +1 -1
  130. package/dist/client/assets/{org-plugin-layout-CBd88Pps.js → org-plugin-layout-DeLJrvoA.js} +1 -1
  131. package/dist/client/assets/{page-seo-form-DA-M0CRU.js → page-seo-form-2v7yqwmW.js} +1 -1
  132. package/dist/client/assets/page-seo-sheet-DEYwDlV3.js +1 -0
  133. package/dist/client/assets/{pair-rWOsLIRO.js → pair-C9I7jtDw.js} +6 -6
  134. package/dist/client/assets/{plugin-empty-state-BC-cPjsG.js → plugin-empty-state-BllJH9a8.js} +1 -1
  135. package/dist/client/assets/{plugin-header-CZ1sX2n9.js → plugin-header-pbmKrc1L.js} +1 -1
  136. package/dist/client/assets/{plugin-layout-egGFGy3C.js → plugin-layout-DRXLQokx.js} +1 -1
  137. package/dist/client/assets/{popover-H1IIsqsO.js → popover-ChUM3TFy.js} +1 -1
  138. package/dist/client/assets/{post-editor-D8Amc377.js → post-editor-DBJSrVd6.js} +2 -2
  139. package/dist/client/assets/{primitives-DXNs_riQ.js → primitives-CDySgipF.js} +1 -1
  140. package/dist/client/assets/{profile-jQNt2qst.js → profile-C7vJk0Kt.js} +1 -1
  141. package/dist/client/assets/project-app-view-iV-1n2vK.js +1 -0
  142. package/dist/client/assets/record-editor-bmEKAE4B.js +1 -0
  143. package/dist/client/assets/registry-CT2kzs1z.js +2 -0
  144. package/dist/client/assets/registry-layout-CBGi99kW.js +27 -0
  145. package/dist/client/assets/{require-capability-g-UPmpGK.js → require-capability-XeIce_Pd.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-B5sViZsY.js → required-auth-layout-BBVKG7Ms.js} +1 -1
  147. package/dist/client/assets/{reset-password-BC3ZM7w0.js → reset-password-CZ2_k_ln.js} +1 -1
  148. package/dist/client/assets/{resizable-DaIe2JEk.js → resizable-DYZX4GYZ.js} +1 -1
  149. package/dist/client/assets/roles-eO3gNPsn.js +1 -0
  150. package/dist/client/assets/save-referenced-block-erNAPeZK.js +1 -0
  151. package/dist/client/assets/{save-status-DaG-SHKI.js → save-status-DGCu0Kou.js} +1 -1
  152. package/dist/client/assets/{schema-form-BBSGBJV6.js → schema-form-CnMZQoIC.js} +1 -1
  153. package/dist/client/assets/{scroll-area-7dB1B4gR.js → scroll-area-D-xuBg8S.js} +1 -1
  154. package/dist/client/assets/{search-input-DwwxFJsd.js → search-input-BOFnCDgB.js} +1 -1
  155. package/dist/client/assets/{secrets-BVqejBQE.js → secrets-BLYQN7Zp.js} +1 -1
  156. package/dist/client/assets/{sections-editor-B1P_XWwE.js → sections-editor-BFS_rZo4.js} +2 -2
  157. package/dist/client/assets/{select-Dn6Da_1F.js → select-B1gidrpT.js} +1 -1
  158. package/dist/client/assets/{select-model-W59Bilmt.js → select-model-CCz1D052.js} +1 -1
  159. package/dist/client/assets/seo-editor-ClvdYMyV.js +1 -0
  160. package/dist/client/assets/{settings-layout-DypT7z1u.js → settings-layout-ParxM_Ja.js} +1 -1
  161. package/dist/client/assets/{settings-section-BkgYqxH8.js → settings-section-DDBr5t6q.js} +1 -1
  162. package/dist/client/assets/{sheet-CxiAY8T5.js → sheet-BwcUAu7J.js} +1 -1
  163. package/dist/client/assets/{shell-controls-rZ6L5v7J.js → shell-controls-a5C7q3sv.js} +1 -1
  164. package/dist/client/assets/{shell-layout-B5B3hmRp.js → shell-layout-jPbG1TxD.js} +1 -1
  165. package/dist/client/assets/shell-route-loading-CrwP7Moq.js +1 -0
  166. package/dist/client/assets/{sidebar-CIJpOENy.js → sidebar-D0YkKw2Q.js} +1 -1
  167. package/dist/client/assets/{skeleton-B0e2OkSv.js → skeleton-BnLuwQl0.js} +1 -1
  168. package/dist/client/assets/{sortable.esm-B6-kJBUo.js → sortable.esm-DHNuKLSF.js} +1 -1
  169. package/dist/client/assets/{spinner-C2ljLkNd.js → spinner-C_dp5faG.js} +1 -1
  170. package/dist/client/assets/{sso-DutRn6kP.js → sso-Dv0vfQwF.js} +1 -1
  171. package/dist/client/assets/{store-CuKFTdG_.js → store-CzOlrmK7.js} +1 -1
  172. package/dist/client/assets/store-registry-BBiSNL3g.js +2 -0
  173. package/dist/client/assets/{studio-tools-DfxdEEgB.js → studio-tools-C1zamUp1.js} +1 -1
  174. package/dist/client/assets/{switch-DDGBJlE2.js → switch-Co2WNb8L.js} +1 -1
  175. package/dist/client/assets/{tab-id-TBSp1YxU.js → tab-id-Br9ttHTZ.js} +1 -1
  176. package/dist/client/assets/{table-GnXYzms9.js → table-DXm5sFe0.js} +1 -1
  177. package/dist/client/assets/{tabs-BajnAGhM.js → tabs-Bhgl3qMn.js} +1 -1
  178. package/dist/client/assets/{task-status-fWcsMePP.js → task-status-BYl9XRWC.js} +1 -1
  179. package/dist/client/assets/{textarea-JAS7Y9kw.js → textarea-DkHK4zFC.js} +1 -1
  180. package/dist/client/assets/{toggle-group-Bv21I6Mc.js → toggle-group-i9f6SFf7.js} +1 -1
  181. package/dist/client/assets/{toolbar-CkGflKXn.js → toolbar-CJqhxN0I.js} +1 -1
  182. package/dist/client/assets/{tools-list-DKrbt2O-.js → tools-list-C1LX0lcn.js} +1 -1
  183. package/dist/client/assets/{tooltip-CKtclZb-.js → tooltip-MvXJgTec.js} +1 -1
  184. package/dist/client/assets/{types-2N8PTdbg.js → types-B5hLLDbz.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-CGLipwx3.js → use-ai-providers-BsaGHbRZ.js} +1 -1
  186. package/dist/client/assets/{use-automations-BChOAOA6.js → use-automations-CsEWrXaA.js} +1 -1
  187. package/dist/client/assets/{use-capability-czp9i90U.js → use-capability-COL6vTbP.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-_Fh5zTFQ.js → use-clock-tick-DOOx6g7A.js} +1 -1
  189. package/dist/client/assets/{use-collections-CrAY0KoX.js → use-collections-BTo2RzuF.js} +1 -1
  190. package/dist/client/assets/{use-connection-NiFefepq.js → use-connection-C7K5Qf-S.js} +1 -1
  191. package/dist/client/assets/{use-copy-CQfxrmWX.js → use-copy-CGrsfbTf.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-DwKQGNi1.js → use-create-virtual-mcp-D9KVCrT1.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-DCM6oAgZ.js → use-debounced-autosave-6YBhwe_F.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-bIYVec_d.js → use-delete-connection-BfZlr78w.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-CqXWCLQv.js → use-file-configs-2cFOqoXA.js} +1 -1
  196. package/dist/client/assets/use-infinite-scroll-CHxQ8pHV.js +1 -0
  197. package/dist/client/assets/{use-list-state-DRxXstLB.js → use-list-state-ohTb0Oa4.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-B46VYAN_.js → use-mcp-client-Wf5qUXFF.js} +1 -1
  199. package/dist/client/assets/{use-mcp-prompts-BfYOND3X.js → use-mcp-prompts-C3LVS9Ph.js} +1 -1
  200. package/dist/client/assets/{use-mcp-tools-wPegb5Xs.js → use-mcp-tools-CHOFkJhf.js} +1 -1
  201. package/dist/client/assets/{use-members-DTpTFucv.js → use-members-DPGvEZAM.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-DL0_jMva.js → use-navigate-to-agent-Cyv38GW6.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-DFhI1mXp.js → use-org-auth-client-DEFpPA_h.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-B2JHlDcL.js → use-org-sso-DXk1g-4_.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-Do917bwO.js → use-organization-roles-CgzLzx7m.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-CGdaVuD7.js → use-organization-settings-DYscqYOA.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-B7_YY-15.js → use-registry-connections-BWH6CWaF.js} +1 -1
  208. package/dist/client/assets/{use-secrets-qOLSEePj.js → use-secrets-C2K4Jrkd.js} +1 -1
  209. package/dist/client/assets/{use-status-sounds-EA9ENH60.js → use-status-sounds-CFQ4LNhs.js} +1 -1
  210. package/dist/client/assets/{use-view-mode-C2K6zcu8.js → use-view-mode-Dg3ZmYU0.js} +1 -1
  211. package/dist/client/assets/{use-virtual-mcp-DHileccV.js → use-virtual-mcp-3Wk6GVmY.js} +1 -1
  212. package/dist/client/assets/useInfiniteQuery-DiweShIv.js +1 -0
  213. package/dist/client/assets/{useRouterState-93R-QVdz.js → useRouterState-DyL85Esh.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-BHYoMCUL.js +1 -0
  215. package/dist/client/assets/{user-T0gsPnBH.js → user-CNkzK1zV.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-BvPi1TV1.js → view-mode-toggle-Do2GCdol.js} +1 -1
  217. package/dist/client/assets/{watch-sse-pool-BSePGeIN.js → watch-sse-pool-WsArg2kN.js} +1 -1
  218. package/dist/client/assets/{workflow-aar8VltW.js → workflow-C2UTibro.js} +1 -1
  219. package/dist/client/assets/workflow-detail-B3lltIYe.js +1 -0
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +418 -418
  222. package/dist/server/migrate.js +52 -52
  223. package/dist/server/server.js +292 -292
  224. package/package.json +1 -1
  225. package/dist/client/assets/add-section-modal-Dv2cxIh1.js +0 -1
  226. package/dist/client/assets/agent-capabilities-l_XcUqX-.js +0 -3
  227. package/dist/client/assets/app-editor-CFm4rW9v.js +0 -1
  228. package/dist/client/assets/connections-CQfywKkf.js +0 -1
  229. package/dist/client/assets/decopilot-sse-pool-TF6jERkV.js +0 -1
  230. package/dist/client/assets/file-explorer-Bpe6MxXV.js +0 -2
  231. package/dist/client/assets/index-CoS-DNLH.js +0 -1
  232. package/dist/client/assets/index-DHXKcvHJ.js +0 -1
  233. package/dist/client/assets/index-Dow8MSuu.js +0 -8
  234. package/dist/client/assets/infiniteQueryObserver-DjRZQa58.js +0 -1
  235. package/dist/client/assets/monaco-editor-DR1buwuA.js +0 -9
  236. package/dist/client/assets/page-seo-sheet-BGJM5zp7.js +0 -1
  237. package/dist/client/assets/project-app-view-CByPW7cJ.js +0 -1
  238. package/dist/client/assets/record-editor-BoDJjFQA.js +0 -1
  239. package/dist/client/assets/registry-aermVrqm.js +0 -2
  240. package/dist/client/assets/registry-layout-CC29q8fz.js +0 -27
  241. package/dist/client/assets/roles-C5M6mJ4v.js +0 -1
  242. package/dist/client/assets/save-referenced-block-BLu5E_fA.js +0 -1
  243. package/dist/client/assets/seo-editor-CBSOqlcM.js +0 -1
  244. package/dist/client/assets/shell-route-loading-BURh1jIH.js +0 -1
  245. package/dist/client/assets/store-registry-CRmNQ4V9.js +0 -2
  246. package/dist/client/assets/use-infinite-scroll-CNFLUrB_.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-vMxng0_U.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-_hGeqDYv.js +0 -1
  249. package/dist/client/assets/workflow-detail-Cyps73VW.js +0 -1
@@ -1,8 +1,8 @@
1
- import{e as $,r as H,T as rt,I as Gt,H as Kt,j as n,B as Se,W as Ye,c as V,t as Xt,q as he,G as Jt,a as Qt,K as me,o as Fe,n as He,f as je,E as Yt,C as Zt,bB as We}from"./index-BjoOIgbb.js";import{$ as es,G as ts,B as ss,ac as ns,O as ls,N as os,M as as,a8 as it,ad as rs,ae as is,A as ct,af as ie,ag as cs,ah as us,ai as ds,b as fs}from"./agent-icon-CjlB-XbA.js";import{t as Ue}from"./Stars01-C2BTpZeS.js";import{a as ut,t as ms,b as Ce,d as ps}from"./XCircle-G0WrPq0g.js";import{i as qe}from"./Check-DCDpfG7m.js";import{i as Ze}from"./ChevronRight-DUzhuedZ.js";import{a as dt,s as xs}from"./Eye-Dmik5hYP.js";import{a as de,u as ft,t as mt,c as et}from"./use-clock-tick-_Fh5zTFQ.js";import{N as pt,R as xt,e as gt,C as gs,f as hs,g as bs,u as ys,i as js,d as vs}from"./scroll-area-7dB1B4gR.js";import{u as ht}from"./use-copy-CQfxrmWX.js";import{T as pe,a as xe,b as ge}from"./tooltip-CKtclZb-.js";import{M as bt,I as yt,F as Ns}from"./file-type-icon-Dg4vNCbL.js";import{c as Ss}from"./content-blocks-o63cs2vh.js";import{g as jt,M as ks}from"./types-2N8PTdbg.js";import{g as _e,i as _s,d as Ve,a as ws}from"./chat-context-Dr8mURNn.js";import{l as Ts,f as Cs,m as $s,n as Is}from"./tab-id-TBSp1YxU.js";import{u as Ms}from"./studio-tools-DfxdEEgB.js";import{c as As,u as vt,b as Ls}from"./use-mcp-client-B46VYAN_.js";import{i as Nt}from"./AlertCircle-BQLR7I4E.js";import{s as Ie,t as St}from"./Star01--MeVNqbA.js";import{s as Rs}from"./XClose-LNW85JIs.js";import{n as kt}from"./ZapSquare-C9LhFrIW.js";import{n as _t,i as Es}from"./Globe01-D1c-3J9t.js";import{b as zs,i as Ps,a as Ee}from"./Tool01-DQ4cTbeu.js";import{a as tt,i as Fs}from"./ZoomOut-CImzlj9g.js";import{i as Ne}from"./Monitor01-Bkoa3Nbe.js";import{i as Ds}from"./SearchMd-DvX2rzEB.js";import{i as Os}from"./Upload01-B-0o1yeU.js";import{u as Bs,c as Hs}from"./shell-layout-B5B3hmRp.js";import{n as wt}from"./LinkExternal01-CxEkPs1F.js";import{I as Ae}from"./integration-icon-BxZqCPgY.js";import{u as Ws}from"./use-virtual-mcp-DHileccV.js";import{a as Tt}from"./Users03-CA9cu5qb.js";import{a as ce}from"./Palette-C74Da44y.js";import{k as Ct}from"./use-navigate-to-agent-DL0_jMva.js";import{a as Us}from"./use-connection-NiFefepq.js";import{s as qs}from"./Stars02-D6zEAnUT.js";import{g as Vs}from"./use-mcp-prompts-BfYOND3X.js";import{c as Gs,b as Ks,d as Xs,a as Js,D as Qs}from"./dialog-Bug5LYvY.js";import{a as Ys,F as Zs,b as en,c as tn,d as sn,f as nn}from"./form-Bkkvnz-_.js";import{I as ln}from"./input-CAytkUdm.js";import{S as on}from"./spinner-C2ljLkNd.js";import{t as an}from"./ChevronDown-BD0G-h2k.js";const rn={openrouter:s=>{const e=s?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function $t(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(rn)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function It(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Mt(s,e){if(!e)return s;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,l=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:s.inputTokens+(e.inputTokens??0),outputTokens:s.outputTokens+(e.outputTokens??0),reasoningTokens:s.reasoningTokens+(e.reasoningTokens??0),totalTokens:s.totalTokens+(e.totalTokens??0),cost:s.cost+$t(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function $a(s){return s.reduce((e,t)=>Mt(e,t.metadata?.usage),It())}function cn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Ge(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Ke(s,e){if(!e)return s;const t=`${cn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function un(s,e){return Ke(s,e).replace(/[_-]/g," ").toLowerCase()}function dn(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Ye().min(1,"Required"):Ye();return rt(e)}function fn(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function mn(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:a,defaultValues:r}=s,o=H.useId();let i;if(e[0]!==t){const R=t?dn(t):rt({});i=Gt(R),e[0]=t,e[1]=i}else i=e[1];const c=i;let m;e[2]!==r||e[3]!==t?(m=t?fn(t,r):{},e[2]=r,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==c||e[6]!==m?(p={resolver:c,defaultValues:m,mode:"onChange"},e[5]=c,e[6]=m,e[7]=p):p=e[7];const u=Kt(p);let f;e[8]!==t?.arguments?(f=t?.arguments??[],e[8]=t?.arguments,e[9]=f):f=e[9];const x=f;let g;e[10]!==u||e[11]!==a||e[12]!==l?(g=async R=>{await a(R),l(null),u.reset()},e[10]=u,e[11]=a,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==u||e[15]!==l?(h=R=>{R||(u.reset(),l(null))},e[14]=u,e[15]=l,e[16]=h):h=e[16];const S=h;if(!t)return null;let y;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(y=t.title||un(t.name,Ge(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=y):y=e[20];let v;e[21]!==y?(v=n.jsx(Gs,{children:n.jsx("span",{className:"capitalize",children:y})}),e[21]=y,e[22]=v):v=e[22];let j;e[23]!==t.description?(j=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=j):j=e[24];let N;e[25]!==j||e[26]!==v?(N=n.jsxs(Ks,{children:[v,j]}),e[25]=j,e[26]=v,e[27]=N):N=e[27];let k;e[28]!==u||e[29]!==b?(k=R=>{R.stopPropagation(),u.handleSubmit(b)(R)},e[28]=u,e[29]=b,e[30]=k):k=e[30];let _;if(e[31]!==x||e[32]!==u.control||e[33]!==u.formState.isSubmitting){let R;e[35]!==u.control||e[36]!==u.formState.isSubmitting?(R=E=>n.jsx(Zs,{control:u.control,name:E.name,render:D=>{const{field:W}=D;return n.jsxs(en,{children:[n.jsxs(tn,{className:"text-xs",children:[E.name,E.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(sn,{children:n.jsx(ln,{...W,value:W.value??"",required:E.required,placeholder:E.description??"",className:"h-9",disabled:u.formState.isSubmitting})}),n.jsx(nn,{})]})}},E.name),e[35]=u.control,e[36]=u.formState.isSubmitting,e[37]=R):R=e[37],_=x.map(R),e[31]=x,e[32]=u.control,e[33]=u.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==S?(w=()=>S(!1),e[38]=S,e[39]=w):w=e[39];let T;e[40]!==u.formState.isSubmitting||e[41]!==w?(T=n.jsx(Se,{type:"button",variant:"ghost",onClick:w,disabled:u.formState.isSubmitting,children:"Cancel"}),e[40]=u.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==u.formState.isSubmitting?(I=u.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(on,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=u.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==u.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(Se,{type:"submit",form:o,disabled:u.formState.isSubmitting,children:I}),e[45]=u.formState.isSubmitting,e[46]=o,e[47]=I,e[48]=M):M=e[48];let C;e[49]!==T||e[50]!==M?(C=n.jsxs(Xs,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let A;e[52]!==o||e[53]!==k||e[54]!==_||e[55]!==C?(A=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:k,children:[_,C]}),e[52]=o,e[53]=k,e[54]=_,e[55]=C,e[56]=A):A=e[56];let L;e[57]!==u||e[58]!==A?(L=n.jsx(Ys,{...u,children:A}),e[57]=u,e[58]=A,e[59]=L):L=e[59];let F;e[60]!==N||e[61]!==L?(F=n.jsxs(Js,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,L]}),e[60]=N,e[61]=L,e[62]=F):F=e[62];let z;return e[63]!==S||e[64]!==F?(z=n.jsx(Qs,{open:!0,onOpenChange:S,children:F}),e[63]=S,e[64]=F,e[65]=z):z=e[65],z}function At(s){return s?s.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function re(s,e){return s==="output-error"||s==="output-denied"?"error":s==="approval-requested"?"approval":s==="input-streaming"||s==="input-available"||s==="output-available"&&e===!0?"loading":"idle"}function ve(s){if(s==null||typeof s!="object")return;const e=s;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return s}function pn(s){return s.storage.mention}function Ia(s,e,t){s.chain().focus().insertContentAt(e,[Lt(t),{type:"text",text:" "}]).run()}function Lt(s){return{type:"mention",attrs:s}}function xn(s){const e=$.c(19),{node:t,selected:l,view:a,editor:r,getPos:o}=s,{name:i,char:d,kind:c,id:m,args:p}=t.attrs,u=l&&a.editable,f=d==="@",x=a.editable&&d==="/"&&c!=="resource";let g;e[0]!==p||e[1]!==r||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==i?(g=_=>{if(!x)return;const T=pn(r)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:i,args:p??{},pos:I}))},e[0]=p,e[1]=r,e[2]=o,e[3]=m,e[4]=x,e[5]=i,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",S=f?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",y=u&&"outline-2 outline-blue-300 outline-offset-0",v=x&&"hover:brightness-95";let j;e[7]!==h||e[8]!==S||e[9]!==y||e[10]!==v?(j=V("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",S,y,v,"capitalize"),e[7]=h,e[8]=S,e[9]=y,e[10]=v,e[11]=j):j=e[11];let N;e[12]!==i?(N=i?At(i):"",e[12]=i,e[13]=N):N=e[13];let k;return e[14]!==d||e[15]!==b||e[16]!==j||e[17]!==N?(k=n.jsxs(gt,{onClick:b,className:j,children:[d,N]}),e[14]=d,e[15]=b,e[16]=j,e[17]=N,e[18]=k):k=e[18],k}const gn=pt.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},char:{default:"/",parseHTML:s=>s.getAttribute("data-char")||"/",renderHTML:s=>s.char?{"data-char":s.char}:{}},metadata:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:s=>s.metadata?{"data-metadata":JSON.stringify(s.metadata)}:{}},kind:{default:null,parseHTML:s=>s.getAttribute("data-kind")||null,renderHTML:s=>s.kind?{"data-kind":s.kind}:{}},args:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-args")||"null")}catch{return null}},renderHTML:s=>s.args?{"data-args":JSON.stringify(s.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"mention"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.char&&(t["data-char"]=s.attrs.char),s.attrs.metadata&&(t["data-metadata"]=JSON.stringify(s.attrs.metadata)),s.attrs.kind&&(t["data-kind"]=s.attrs.kind),s.attrs.args&&(t["data-args"]=JSON.stringify(s.attrs.args)),["span",{...e,...t}]},renderText({node:s}){const e=s.attrs.char??"@",t=s.attrs.name??"";return`${e}${t}`},addNodeView(){return xt(xn)}}),hn=/^mcp__[a-zA-Z0-9_-]+__/;function Rt(s){return s.replace(hn,"")}function Xe(s){const e=$.c(18),{id:t,part:l,copyable:a,extraActions:r,alwaysShowActions:o,animate:i}=s,d=a===void 0?!1:a,c=o===void 0?!1:o,m=i===void 0?!1:i,{handleCopy:p}=ht(),[u,f]=H.useState(!1);let x;e[0]!==p||e[1]!==t||e[2]!==l.text?(x=async()=>{Xt("chat_message_copied",{message_id:t,chars:l.text.length}),await p(l.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=p,e[1]=t,e[2]=l.text,e[3]=x):x=e[3];const g=x,b=d&&r,h=b||r;let S;e[4]!==m||e[5]!==t||e[6]!==l.text?(S=n.jsx(bt,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=S):S=e[7];let y;e[8]!==c||e[9]!==r||e[10]!==g||e[11]!==u||e[12]!==h||e[13]!==b?(y=h&&n.jsxs("div",{className:V("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",c?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[r,b&&r&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),b&&n.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:u?n.jsx(qe,{className:"size-4"}):n.jsx(dt,{className:"size-4"})})]}),e[8]=c,e[9]=r,e[10]=g,e[11]=u,e[12]=h,e[13]=b,e[14]=y):y=e[14];let v;return e[15]!==S||e[16]!==y?(v=n.jsxs("div",{className:"group/part relative",children:[S,y]}),e[15]=S,e[16]=y,e[17]=v):v=e[17],v}function Ma(s,e,t){s.chain().focus().insertContentAt(e,[bn(t),{type:"text",text:" "}]).run()}function bn(s){return{type:"file",attrs:s}}function yn(s){const e=$.c(17),{node:t,selected:l,view:a}=s,{name:r,mimeType:o,data:i}=t.attrs,d=l&&a.editable;let c;e[0]!==o?(c=o.startsWith("image/"),e[0]=o,e[1]=c):c=e[1];const m=c,p=d&&"outline-2 outline-blue-300 outline-offset-0";let u;e[2]!==p?(u=V("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",p),e[2]=p,e[3]=u):u=e[3];let f;e[4]!==r?(f=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:r})}),e[4]=r,e[5]=f):f=e[5];let x;e[6]!==i||e[7]!==m||e[8]!==o||e[9]!==r?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${i}`,alt:r,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:r}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=i,e[7]=m,e[8]=o,e[9]=r,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=n.jsxs(ge,{children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==u||e[15]!==g?(b=n.jsx(gt,{className:u,children:g}),e[14]=u,e[15]=g,e[16]=b):b=e[16],b}const jn=pt.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},mimeType:{default:null,parseHTML:s=>s.getAttribute("data-mime-type")||null,renderHTML:s=>s.mimeType?{"data-mime-type":s.mimeType}:{}},size:{default:0,parseHTML:s=>{const e=s.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:s=>s.size?{"data-size":String(s.size)}:{}},data:{default:null,parseHTML:s=>s.getAttribute("data-data")||null,renderHTML:s=>s.data?{"data-data":s.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"file"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.mimeType&&(t["data-mime-type"]=s.attrs.mimeType),s.attrs.size&&(t["data-size"]=String(s.attrs.size)),s.attrs.data&&(t["data-data"]=s.attrs.data),["span",{...e,...t}]},renderText({node:s}){return`[${s.attrs.name??""}]`},addNodeView(){return xt(yn)}}),fe=16,De=2.5,Oe=(fe-De)/2,ze=2*Math.PI*Oe;function vn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:a,outputTokens:r,cost:o}=t;if(!l&&!a&&!r)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(es,{size:12}),e[0]=i):i=e[0];let d;e[1]!==o||e[2]!==l?(d=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=d):d=e[3];let c;e[4]!==d?(c=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[i,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:d})]})}),e[4]=d,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let u;e[8]!==a?(u=a.toLocaleString(),e[8]=a,e[9]=u):u=e[9];let f;e[10]!==u?(f=n.jsx("span",{className:"text-right tabular-nums",children:u}),e[10]=u,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-muted",children:"out"}),e[12]=x):x=e[12];const g=r-(t.reasoningTokens??0);let b;e[13]!==g?(b=g.toLocaleString(),e[13]=g,e[14]=b):b=e[14];let h;e[15]!==b?(h=n.jsx("span",{className:"text-right tabular-nums",children:b}),e[15]=b,e[16]=h):h=e[16];let S;e[17]!==a||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(S=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:a>0?`${(t.cacheReadTokens/a*100).toFixed(0)}%`:"0%"})]}),e[17]=a,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=S):S=e[20];let y;e[21]!==o?(y=o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",o.toFixed(4)]})]}),e[21]=o,e[22]=y):y=e[22];let v;e[23]!==h||e[24]!==S||e[25]!==y||e[26]!==f?(v=n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[m,n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p,f,x,h,S,y]})]}),e[23]=h,e[24]=S,e[25]=y,e[26]=f,e[27]=v):v=e[27];let j;return e[28]!==v||e[29]!==c?(j=n.jsxs(ge,{children:[c,v]}),e[28]=v,e[29]=c,e[30]=j):j=e[30],j}function Nn(s){const e=$.c(19),{usage:t,duration:l}=s,a=l!=null&&l>0,r=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!a&&!r&&!o)return null;let i;e[0]!==l||e[1]!==a?(i=a?de(l/1e3):null,e[0]=l,e[1]=a,e[2]=i):i=e[2];const d=i;let c;e[3]!==l||e[4]!==d||e[5]!==t?(c=d&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:d})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),n.jsx("span",{className:"tabular-nums",children:de(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=d,e[5]=t,e[6]=c):c=e[6];let m;e[7]!==r||e[8]!==a||e[9]!==o?(m=a&&(r||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=r,e[8]=a,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==o||e[13]!==t?(p=(r||o)&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:r?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[n.jsx("span",{className:"opacity-60",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),n.jsx("span",{className:"opacity-60",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"think"}),n.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:(t?.inputTokens??0)>0?`${((t?.cacheReadTokens??0)/t.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=r,e[12]=o,e[13]=t,e[14]=p):p=e[14];let u;return e[15]!==c||e[16]!==m||e[17]!==p?(u=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,m,p]}),e[15]=c,e[16]=m,e[17]=p,e[18]=u):u=e[18],u}function Aa(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:a,onOpenContextPanel:r}=s,o=Math.min(l/a*100,100),i=ze-o/100*ze,d=t?.cost??0,c=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let u;e[2]!==d?(u=d>0?`, $${d.toFixed(2)}`:"",e[2]=d,e[3]=u):u=e[3];const f=`Context usage: ${p}%${u}`,x=r?"cursor-pointer":"cursor-default";let g;e[4]!==x?(g=V("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=g):g=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("circle",{cx:fe/2,cy:fe/2,r:Oe,fill:"none",stroke:"currentColor",strokeWidth:De,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let S;e[7]!==h?(S=V(h),e[7]=h,e[8]=S):S=e[8];let y;e[9]!==i||e[10]!==S?(y=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Oe,fill:"none",stroke:"currentColor",strokeWidth:De,strokeDasharray:ze,strokeDashoffset:i,strokeLinecap:"round",className:S})]}),e[9]=i,e[10]=S,e[11]=y):y=e[11];let v;e[12]!==o?(v=o.toFixed(0),e[12]=o,e[13]=v):v=e[13];let j;e[14]!==d?(j=d>0?` · $${d.toFixed(2)}`:"",e[14]=d,e[15]=j):j=e[15];let N;e[16]!==v||e[17]!==j?(N=n.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[v,"%",j]}),e[16]=v,e[17]=j,e[18]=N):N=e[18];let k;e[19]!==r||e[20]!==N||e[21]!==f||e[22]!==g||e[23]!==y?(k=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:r,"aria-label":f,className:g,children:[y,N]})}),e[19]=r,e[20]=N,e[21]=f,e[22]=g,e[23]=y,e[24]=k):k=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=_):_=e[25];let w;e[26]!==l?(w=l.toLocaleString(),e[26]=l,e[27]=w):w=e[27];let T;e[28]!==a?(T=a.toLocaleString(),e[28]=a,e[29]=T):T=e[29];let I;e[30]!==o?(I=o.toFixed(1),e[30]=o,e[31]=I):I=e[31];let M;e[32]!==w||e[33]!==T||e[34]!==I?(M=n.jsxs("span",{className:"text-right tabular-nums",children:[w," / ",T," (",I,"%)"]}),e[32]=w,e[33]=T,e[34]=I,e[35]=M):M=e[35];let C;e[36]!==d||e[37]!==c||e[38]!==m?(C=d>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",d.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=d,e[37]=c,e[38]=m,e[39]=C):C=e[39];let A;e[40]!==c||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(A=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:c>0?`${((t?.cacheReadTokens??0)/c*100).toFixed(0)}%`:"0%"})]}),e[40]=c,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=A):A=e[43];let L;e[44]!==M||e[45]!==C||e[46]!==A?(L=n.jsx(xe,{side:"top",className:"font-mono text-[11px]",children:n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[_,M,C,A]})}),e[44]=M,e[45]=C,e[46]=A,e[47]=L):L=e[47];let F;return e[48]!==k||e[49]!==L?(F=n.jsxs(ge,{children:[k,L]}),e[48]=k,e[49]=L,e[50]=F):F=e[50],F}function Sn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(bs,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function kn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(gs,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function _n(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(hs,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Et({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:a=500}){const[r,o]=H.useState(null),[i,d]=H.useState(!1),c=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!r)return;let p=r.parentElement;for(;p;){const u=window.getComputedStyle(p);if(u.overflowY==="auto"||u.overflowY==="scroll"||u.overflow==="auto"||u.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!r)return;const p=new IntersectionObserver(u=>{const f=u[0]?.isIntersecting??!1;d(f)},{root:s?.current??null,threshold:c,rootMargin:"0px"});return p.observe(r),()=>p.disconnect()},[r,c]),H.useEffect(()=>{if(!e||!i)return;const p=setInterval(m,a);return()=>clearInterval(p)},[e,i,a]),H.useEffect(()=>{!e||!i||m()},[e,i,...t]),{sentinelRef:o,isTracking:i}}function B(s){const e=$.c(53),{icon:t,title:l,usage:a,summary:r,state:o,detail:i,detailVariant:d,forceOpen:c,variant:m,trailing:p,iconDestructive:u,alwaysChevron:f,defaultOpen:x,children:g}=s,b=d===void 0?"code":d,h=m===void 0?"default":m,[S,y]=H.useState(x??!1),{handleCopy:v,copied:j}=ht(),N=o==="loading",k=o==="error";let _;e[0]!==i?(_=i&&i.trim(),e[0]=i,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(c??!1)||S,C=H.useRef(null),A=N&&M;let L;e[2]!==i?(L=[i],e[2]=i,e[3]=L):L=e[3];let F;e[4]!==A||e[5]!==L?(F={containerRef:C,enabled:A,contentDeps:L},e[4]=A,e[5]=L,e[6]=F):F=e[6];const{sentinelRef:z}=Et(F),R=c?void 0:y,E=!T,D=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=N&&"shimmer";let O;e[7]!==W||e[8]!==U||e[9]!==D?(O=V("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",D,W,U),e[7]=W,e[8]=U,e[9]=D,e[10]=O):O=e[10];const K=!T;let G;e[11]!==f||e[12]!==M||e[13]!==t||e[14]!==u||e[15]!==k||e[16]!==T?(G=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:f?n.jsx(Ze,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:V("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",u?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",T&&(M?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),T&&n.jsx("div",{className:V("absolute inset-0 flex items-center justify-center transition-opacity duration-150",M?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(Ze,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=f,e[12]=M,e[13]=t,e[14]=u,e[15]=k,e[16]=T,e[17]=G):G=e[17];const Y=k?"text-warning/80":"text-foreground";let Q;e[18]!==Y?(Q=V("shrink-0 text-[14px] font-normal",Y),e[18]=Y,e[19]=Q):Q=e[19];let te;e[20]!==Q||e[21]!==l?(te=n.jsx("span",{className:Q,children:l}),e[20]=Q,e[21]=l,e[22]=te):te=e[22];let P;e[23]!==r?(P=r?n.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:r})}):n.jsx("div",{className:"flex-1"}),e[23]=r,e[24]=P):P=e[24];let q;e[25]!==p?(q=p&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:p}),e[25]=p,e[26]=q):q=e[26];let X;e[27]!==a?(X=n.jsx(vn,{usage:a}),e[27]=a,e[28]=X):X=e[28];let J;e[29]!==O||e[30]!==K||e[31]!==G||e[32]!==te||e[33]!==P||e[34]!==q||e[35]!==X||e[36]!==E?(J=n.jsxs(kn,{disabled:E,className:O,"aria-disabled":K,children:[G,te,P,q,X]}),e[29]=O,e[30]=K,e[31]=G,e[32]=te,e[33]=P,e[34]=q,e[35]=X,e[36]=E,e[37]=J):J=e[37];let se;e[38]!==g||e[39]!==j||e[40]!==i||e[41]!==b||e[42]!==v||e[43]!==T||e[44]!==z?(se=T&&n.jsx(_n,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:g||(b==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsxs("div",{ref:C,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:[n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:i}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsxs("div",{ref:C,className:"flex flex-col max-h-48 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:i})}),n.jsx("button",{type:"button",onClick:()=>v(i),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:j?n.jsx(qe,{className:"size-3.5"}):n.jsx(dt,{className:"size-3.5"})})]}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=j,e[40]=i,e[41]=b,e[42]=v,e[43]=T,e[44]=z,e[45]=se):se=e[45];let ue;e[46]!==M||e[47]!==J||e[48]!==se||e[49]!==R?(ue=n.jsxs(Sn,{open:M,onOpenChange:R,className:"min-w-0",children:[J,se]}),e[46]=M,e[47]=J,e[48]=se,e[49]=R,e[50]=ue):ue=e[50];const oe=ue;if(I){let ae;return e[51]!==oe?(ae=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:oe}),e[51]=oe,e[52]=ae):ae=e[52],ae}return oe}function le(s){const e=$.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=de(t),e[0]=t,e[1]=l):l=e[1];let a;return e[2]!==l?(a=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=a):a=e[3],a}const zt=4;function Pt(s){const e=$.c(5),{count:t,noun:l,onClick:a}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ut,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=r):r=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==a?(o=n.jsxs("button",{type:"button",onClick:a,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",t," ",l,r]}),e[1]=t,e[2]=l,e[3]=a,e[4]=o):o=e[4],o}function wn(s){const e=$.c(24),{org:t}=he(),l=Jt(),a=Ts(),r=Ms();let o;e[0]!==r||e[1]!==s?(o=async g=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=(await r.call("COLLECTION_THREADS_GET",{id:s})).item?.metadata??{},y=(h.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);y.push({...g,expandedAt:new Date().toISOString()});const v={...h,expanded_tools:y};return await r.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:v}}),y},e[0]=r,e[1]=s,e[2]=o):o=e[2];let i,d,c;e[3]!==t||e[4]!==l||e[5]!==s?(i=async g=>{const b=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:b});const h=l.getQueryData(b),y=(h?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==g.toolName);return y.push({...g,expandedAt:new Date().toISOString()}),l.setQueryData(b,v=>v&&{...v,metadata:{...v.metadata??{},expanded_tools:y}}),{previous:h}},d=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},c=(g,b,h)=>{const S=me.ensureTask(t.id,s??"");h?.previous===void 0?l.removeQueries({queryKey:S,exact:!0}):l.setQueryData(S,h.previous),Fe.error(g instanceof Error?g.message:"Failed to expand tool")},e[3]=t,e[4]=l,e[5]=s,e[6]=i,e[7]=d,e[8]=c):(i=e[6],d=e[7],c=e[8]);let m;e[9]!==o||e[10]!==i||e[11]!==d||e[12]!==c?(m={mutationFn:o,onMutate:i,onSuccess:d,onError:c},e[9]=o,e[10]=i,e[11]=d,e[12]=c,e[13]=m):m=e[13];const p=Qt(m);let u;e[14]!==a||e[15]!==p||e[16]!==t||e[17]!==l||e[18]!==s?(u=g=>{if(!s||!a)return;const b=me.ensureTask(t.id,s),h=l.getQueryData(b),y=(h?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);y.push({...g,expandedAt:new Date().toISOString()});const v={...h?.metadata??{},expanded_tools:y};l.setQueryData(b,j=>j&&{...j,metadata:v}),a.patchThread({id:s,metadata:v}),p.mutate(g)},e[14]=a,e[15]=p,e[16]=t,e[17]=l,e[18]=s,e[19]=u):u=e[19];const f=u;let x;return e[20]!==f||e[21]!==p.isPending||e[22]!==p.mutate?(x={addOrReplace:p.mutate,addOrReplaceEager:f,isPending:p.isPending},e[20]=f,e[21]=p.isPending,e[22]=p.mutate,e[23]=x):x=e[23],x}function Tn(s,e,t,l){const{data:a,isLoading:r}=He({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await As({connectionId:e,orgId:t,orgSlug:l});try{const{tools:i}=await o.listTools(),d=Rt(s);return i.find(c=>c.name===d)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:a??void 0,isLoading:r}}const Cn={read:{icon:tt,label:"Read File"},write:{icon:Ps,label:"Write File"},edit:{icon:as,label:"Edit File"},grep:{icon:Ds,label:"Search Content"},glob:{icon:Fs,label:"Find Files"},bash:{icon:os,label:"Run Command"},read_tool_output:{icon:tt,label:"Read Tool Output"},read_resource:{icon:ls,label:"Read Resource"},read_prompt:{icon:kt,label:"Read Prompt"},enable_tool:{icon:zs,label:"Enable Tool"},open_in_agent:{icon:ns,label:"Open in Agent"},sandbox:{icon:ss,label:"Run Code"},copy_to_sandbox:{icon:_t,label:"Load File"},share_with_user:{icon:Os,label:"Share with User"},take_screenshot:{icon:Ne,label:"Take Screenshot"},scrape_url:{icon:Ie,label:"Scrape URL"},inspect_page:{icon:ts,label:"Inspect Page"}},$n="bash-sleep-start:";function In(s){const e=$n+s;try{const t=sessionStorage.getItem(e);if(t!==null){const a=Number.parseInt(t,10);if(Number.isFinite(a))return a}const l=Date.now();return sessionStorage.setItem(e,String(l)),l}catch{return Date.now()}}function Mn(s,e){const t=$.c(2);let l;t[0]!==s?(l=()=>In(s),t[0]=s,t[1]=l):l=t[1];const a=H.useState(l)[0];return e??a}function An(s){const e=Math.ceil(s/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),l=e%60;return l?`${t}m ${l}s`:`${t}m`}function Ln(s){const e=$.c(4),{toolCallId:t,durationMs:l,anchorMs:a}=s;ft(1e3);const o=Mn(t,a)+l-Date.now();let i;e[0]!==o?(i=o>0?`Waiting ${An(o)}`:"Wrapping up…",e[0]=o,e[1]=i):i=e[1];let d;return e[2]!==i?(d=n.jsx("span",{className:"tabular-nums",children:i}),e[2]=i,e[3]=d):d=e[3],d}const Rn={s:1e3,m:6e4,h:36e5,d:864e5};function En(s){const e=/(?:^|[\s;&|(])sleep((?:\s+[\d.]+[smhd]?)+)/g;let t=0,l=!1;for(const a of s.matchAll(e))for(const r of a[1].trim().split(/\s+/)){const o=/^([\d.]+)([smhd]?)$/.exec(r);if(!o)continue;const i=Number.parseFloat(o[1]);Number.isFinite(i)&&(t+=i*(Rn[o[2]||"s"]??1e3),l=!0)}return l?t:null}function Le(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ye(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}function Me(s){const e=ye(s);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const zn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function Pn(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
1
+ import{e as $,r as H,T as rt,I as Gt,H as Kt,j as n,B as Se,W as Ye,c as V,t as Xt,q as he,G as Jt,a as Qt,K as me,o as Fe,n as He,f as je,E as Yt,C as Zt,bB as We}from"./index-DjCrtoJM.js";import{$ as es,G as ts,B as ss,ac as ns,O as ls,N as os,M as as,a8 as it,ad as rs,ae as is,A as ct,af as ie,ag as cs,ah as us,ai as ds,b as fs}from"./agent-icon-DbC1U9Lv.js";import{t as Ue}from"./Stars01-DbI-YGmK.js";import{a as ut,t as ms,b as Ce,d as ps}from"./XCircle-Bz32In76.js";import{i as qe}from"./Check-CkY-NLLZ.js";import{i as Ze}from"./ChevronRight-BJRYs8bt.js";import{a as dt,s as xs}from"./Eye-Co-ItdFE.js";import{a as de,u as ft,t as mt,c as et}from"./use-clock-tick-DOOx6g7A.js";import{N as pt,R as xt,e as gt,C as gs,f as hs,g as bs,u as ys,i as js,d as vs}from"./scroll-area-D-xuBg8S.js";import{u as ht}from"./use-copy-CGrsfbTf.js";import{T as pe,a as xe,b as ge}from"./tooltip-MvXJgTec.js";import{M as bt,I as yt,F as Ns}from"./file-type-icon-ByhQy2rW.js";import{c as Ss}from"./content-blocks-o63cs2vh.js";import{g as jt,M as ks}from"./types-B5hLLDbz.js";import{g as _e,i as _s,d as Ve,a as ws}from"./chat-context-Dd9y-6Y-.js";import{l as Ts,f as Cs,m as $s,n as Is}from"./tab-id-Br9ttHTZ.js";import{u as Ms}from"./studio-tools-C1zamUp1.js";import{c as As,u as vt,b as Ls}from"./use-mcp-client-Wf5qUXFF.js";import{i as Nt}from"./AlertCircle-CNjNg2wb.js";import{s as Ie,t as St}from"./Star01-ChWAyIjY.js";import{s as Rs}from"./XClose-D4SdKRIc.js";import{n as kt}from"./ZapSquare-DdYqdyu4.js";import{n as _t,i as Es}from"./Globe01-BnLBFtky.js";import{b as zs,i as Ps,a as Ee}from"./Tool01-Nn7pl58k.js";import{a as tt,i as Fs}from"./ZoomOut-BP5vTMyD.js";import{i as Ne}from"./Monitor01-5IIvvy6H.js";import{i as Ds}from"./SearchMd-Dq0euRWv.js";import{i as Os}from"./Upload01-CyW8Wv9e.js";import{u as Bs,c as Hs}from"./shell-layout-jPbG1TxD.js";import{n as wt}from"./LinkExternal01-ZepkFy5p.js";import{I as Ae}from"./integration-icon-CYVpZTf5.js";import{u as Ws}from"./use-virtual-mcp-3Wk6GVmY.js";import{a as Tt}from"./Users03-Dc2Q2YCx.js";import{a as ce}from"./Palette-Cu3PTFf5.js";import{k as Ct}from"./use-navigate-to-agent-Cyv38GW6.js";import{a as Us}from"./use-connection-C7K5Qf-S.js";import{s as qs}from"./Stars02-WR3K9Daq.js";import{g as Vs}from"./use-mcp-prompts-C3LVS9Ph.js";import{c as Gs,b as Ks,d as Xs,a as Js,D as Qs}from"./dialog-B4Gk40Ec.js";import{a as Ys,F as Zs,b as en,c as tn,d as sn,f as nn}from"./form-DzqpARCW.js";import{I as ln}from"./input-odGTsdHi.js";import{S as on}from"./spinner-C_dp5faG.js";import{t as an}from"./ChevronDown-B8XrNXeE.js";const rn={openrouter:s=>{const e=s?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function $t(s){if(!s?.providerMetadata)return 0;for(const e of Object.values(rn)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function It(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Mt(s,e){if(!e)return s;const t=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,l=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:s.inputTokens+(e.inputTokens??0),outputTokens:s.outputTokens+(e.outputTokens??0),reasoningTokens:s.reasoningTokens+(e.reasoningTokens??0),totalTokens:s.totalTokens+(e.totalTokens??0),cost:s.cost+$t(e),cacheReadTokens:s.cacheReadTokens+t,cacheWriteTokens:s.cacheWriteTokens+l}}function $a(s){return s.reduce((e,t)=>Mt(e,t.metadata?.usage),It())}function cn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Ge(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Ke(s,e){if(!e)return s;const t=`${cn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function un(s,e){return Ke(s,e).replace(/[_-]/g," ").toLowerCase()}function dn(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Ye().min(1,"Required"):Ye();return rt(e)}function fn(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function mn(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:a,defaultValues:r}=s,o=H.useId();let i;if(e[0]!==t){const R=t?dn(t):rt({});i=Gt(R),e[0]=t,e[1]=i}else i=e[1];const c=i;let m;e[2]!==r||e[3]!==t?(m=t?fn(t,r):{},e[2]=r,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==c||e[6]!==m?(p={resolver:c,defaultValues:m,mode:"onChange"},e[5]=c,e[6]=m,e[7]=p):p=e[7];const u=Kt(p);let f;e[8]!==t?.arguments?(f=t?.arguments??[],e[8]=t?.arguments,e[9]=f):f=e[9];const x=f;let g;e[10]!==u||e[11]!==a||e[12]!==l?(g=async R=>{await a(R),l(null),u.reset()},e[10]=u,e[11]=a,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==u||e[15]!==l?(h=R=>{R||(u.reset(),l(null))},e[14]=u,e[15]=l,e[16]=h):h=e[16];const S=h;if(!t)return null;let y;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(y=t.title||un(t.name,Ge(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=y):y=e[20];let v;e[21]!==y?(v=n.jsx(Gs,{children:n.jsx("span",{className:"capitalize",children:y})}),e[21]=y,e[22]=v):v=e[22];let j;e[23]!==t.description?(j=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=j):j=e[24];let N;e[25]!==j||e[26]!==v?(N=n.jsxs(Ks,{children:[v,j]}),e[25]=j,e[26]=v,e[27]=N):N=e[27];let k;e[28]!==u||e[29]!==b?(k=R=>{R.stopPropagation(),u.handleSubmit(b)(R)},e[28]=u,e[29]=b,e[30]=k):k=e[30];let _;if(e[31]!==x||e[32]!==u.control||e[33]!==u.formState.isSubmitting){let R;e[35]!==u.control||e[36]!==u.formState.isSubmitting?(R=E=>n.jsx(Zs,{control:u.control,name:E.name,render:D=>{const{field:W}=D;return n.jsxs(en,{children:[n.jsxs(tn,{className:"text-xs",children:[E.name,E.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(sn,{children:n.jsx(ln,{...W,value:W.value??"",required:E.required,placeholder:E.description??"",className:"h-9",disabled:u.formState.isSubmitting})}),n.jsx(nn,{})]})}},E.name),e[35]=u.control,e[36]=u.formState.isSubmitting,e[37]=R):R=e[37],_=x.map(R),e[31]=x,e[32]=u.control,e[33]=u.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==S?(w=()=>S(!1),e[38]=S,e[39]=w):w=e[39];let T;e[40]!==u.formState.isSubmitting||e[41]!==w?(T=n.jsx(Se,{type:"button",variant:"ghost",onClick:w,disabled:u.formState.isSubmitting,children:"Cancel"}),e[40]=u.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==u.formState.isSubmitting?(I=u.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(on,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=u.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==u.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(Se,{type:"submit",form:o,disabled:u.formState.isSubmitting,children:I}),e[45]=u.formState.isSubmitting,e[46]=o,e[47]=I,e[48]=M):M=e[48];let C;e[49]!==T||e[50]!==M?(C=n.jsxs(Xs,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let A;e[52]!==o||e[53]!==k||e[54]!==_||e[55]!==C?(A=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:k,children:[_,C]}),e[52]=o,e[53]=k,e[54]=_,e[55]=C,e[56]=A):A=e[56];let L;e[57]!==u||e[58]!==A?(L=n.jsx(Ys,{...u,children:A}),e[57]=u,e[58]=A,e[59]=L):L=e[59];let F;e[60]!==N||e[61]!==L?(F=n.jsxs(Js,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,L]}),e[60]=N,e[61]=L,e[62]=F):F=e[62];let z;return e[63]!==S||e[64]!==F?(z=n.jsx(Qs,{open:!0,onOpenChange:S,children:F}),e[63]=S,e[64]=F,e[65]=z):z=e[65],z}function At(s){return s?s.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function re(s,e){return s==="output-error"||s==="output-denied"?"error":s==="approval-requested"?"approval":s==="input-streaming"||s==="input-available"||s==="output-available"&&e===!0?"loading":"idle"}function ve(s){if(s==null||typeof s!="object")return;const e=s;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return s}function pn(s){return s.storage.mention}function Ia(s,e,t){s.chain().focus().insertContentAt(e,[Lt(t),{type:"text",text:" "}]).run()}function Lt(s){return{type:"mention",attrs:s}}function xn(s){const e=$.c(19),{node:t,selected:l,view:a,editor:r,getPos:o}=s,{name:i,char:d,kind:c,id:m,args:p}=t.attrs,u=l&&a.editable,f=d==="@",x=a.editable&&d==="/"&&c!=="resource";let g;e[0]!==p||e[1]!==r||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==i?(g=_=>{if(!x)return;const T=pn(r)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:i,args:p??{},pos:I}))},e[0]=p,e[1]=r,e[2]=o,e[3]=m,e[4]=x,e[5]=i,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",S=f?"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300",y=u&&"outline-2 outline-blue-300 outline-offset-0",v=x&&"hover:brightness-95";let j;e[7]!==h||e[8]!==S||e[9]!==y||e[10]!==v?(j=V("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",S,y,v,"capitalize"),e[7]=h,e[8]=S,e[9]=y,e[10]=v,e[11]=j):j=e[11];let N;e[12]!==i?(N=i?At(i):"",e[12]=i,e[13]=N):N=e[13];let k;return e[14]!==d||e[15]!==b||e[16]!==j||e[17]!==N?(k=n.jsxs(gt,{onClick:b,className:j,children:[d,N]}),e[14]=d,e[15]=b,e[16]=j,e[17]=N,e[18]=k):k=e[18],k}const gn=pt.create({name:"mention",group:"inline",inline:!0,atom:!0,addStorage(){return{onEditChip:null}},addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},char:{default:"/",parseHTML:s=>s.getAttribute("data-char")||"/",renderHTML:s=>s.char?{"data-char":s.char}:{}},metadata:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-metadata")||"null")}catch{return null}},renderHTML:s=>s.metadata?{"data-metadata":JSON.stringify(s.metadata)}:{}},kind:{default:null,parseHTML:s=>s.getAttribute("data-kind")||null,renderHTML:s=>s.kind?{"data-kind":s.kind}:{}},args:{default:null,parseHTML:s=>{try{return JSON.parse(s.getAttribute("data-args")||"null")}catch{return null}},renderHTML:s=>s.args?{"data-args":JSON.stringify(s.args)}:{}}}},parseHTML(){return[{tag:'span[data-type="mention"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"mention"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.char&&(t["data-char"]=s.attrs.char),s.attrs.metadata&&(t["data-metadata"]=JSON.stringify(s.attrs.metadata)),s.attrs.kind&&(t["data-kind"]=s.attrs.kind),s.attrs.args&&(t["data-args"]=JSON.stringify(s.attrs.args)),["span",{...e,...t}]},renderText({node:s}){const e=s.attrs.char??"@",t=s.attrs.name??"";return`${e}${t}`},addNodeView(){return xt(xn)}}),hn=/^mcp__[a-zA-Z0-9_-]+__/;function Rt(s){return s.replace(hn,"")}function Xe(s){const e=$.c(18),{id:t,part:l,copyable:a,extraActions:r,alwaysShowActions:o,animate:i}=s,d=a===void 0?!1:a,c=o===void 0?!1:o,m=i===void 0?!1:i,{handleCopy:p}=ht(),[u,f]=H.useState(!1);let x;e[0]!==p||e[1]!==t||e[2]!==l.text?(x=async()=>{Xt("chat_message_copied",{message_id:t,chars:l.text.length}),await p(l.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=p,e[1]=t,e[2]=l.text,e[3]=x):x=e[3];const g=x,b=d&&r,h=b||r;let S;e[4]!==m||e[5]!==t||e[6]!==l.text?(S=n.jsx(bt,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=S):S=e[7];let y;e[8]!==c||e[9]!==r||e[10]!==g||e[11]!==u||e[12]!==h||e[13]!==b?(y=h&&n.jsxs("div",{className:V("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",c?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[r,b&&r&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),b&&n.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:u?n.jsx(qe,{className:"size-4"}):n.jsx(dt,{className:"size-4"})})]}),e[8]=c,e[9]=r,e[10]=g,e[11]=u,e[12]=h,e[13]=b,e[14]=y):y=e[14];let v;return e[15]!==S||e[16]!==y?(v=n.jsxs("div",{className:"group/part relative",children:[S,y]}),e[15]=S,e[16]=y,e[17]=v):v=e[17],v}function Ma(s,e,t){s.chain().focus().insertContentAt(e,[bn(t),{type:"text",text:" "}]).run()}function bn(s){return{type:"file",attrs:s}}function yn(s){const e=$.c(17),{node:t,selected:l,view:a}=s,{name:r,mimeType:o,data:i}=t.attrs,d=l&&a.editable;let c;e[0]!==o?(c=o.startsWith("image/"),e[0]=o,e[1]=c):c=e[1];const m=c,p=d&&"outline-2 outline-blue-300 outline-offset-0";let u;e[2]!==p?(u=V("px-1 py-1 rounded","inline-flex items-center gap-1","cursor-default select-none","text-xs font-light","bg-muted text-muted-foreground",p),e[2]=p,e[3]=u):u=e[3];let f;e[4]!==r?(f=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:r})}),e[4]=r,e[5]=f):f=e[5];let x;e[6]!==i||e[7]!==m||e[8]!==o||e[9]!==r?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${i}`,alt:r,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:r}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=i,e[7]=m,e[8]=o,e[9]=r,e[10]=x):x=e[10];let g;e[11]!==f||e[12]!==x?(g=n.jsxs(ge,{children:[f,x]}),e[11]=f,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==u||e[15]!==g?(b=n.jsx(gt,{className:u,children:g}),e[14]=u,e[15]=g,e[16]=b):b=e[16],b}const jn=pt.create({name:"file",group:"inline",inline:!0,atom:!0,addAttributes(){return{id:{default:null,parseHTML:s=>s.getAttribute("data-id")||null,renderHTML:s=>s.id?{"data-id":s.id}:{}},name:{default:null,parseHTML:s=>s.getAttribute("data-name")||null,renderHTML:s=>s.name?{"data-name":s.name}:{}},mimeType:{default:null,parseHTML:s=>s.getAttribute("data-mime-type")||null,renderHTML:s=>s.mimeType?{"data-mime-type":s.mimeType}:{}},size:{default:0,parseHTML:s=>{const e=s.getAttribute("data-size");return e?Number.parseInt(e,10):0},renderHTML:s=>s.size?{"data-size":String(s.size)}:{}},data:{default:null,parseHTML:s=>s.getAttribute("data-data")||null,renderHTML:s=>s.data?{"data-data":s.data}:{}}}},parseHTML(){return[{tag:'span[data-type="file"]'}]},renderHTML({node:s,HTMLAttributes:e}){const t={"data-type":"file"};return s.attrs.id&&(t["data-id"]=s.attrs.id),s.attrs.name&&(t["data-name"]=s.attrs.name),s.attrs.mimeType&&(t["data-mime-type"]=s.attrs.mimeType),s.attrs.size&&(t["data-size"]=String(s.attrs.size)),s.attrs.data&&(t["data-data"]=s.attrs.data),["span",{...e,...t}]},renderText({node:s}){return`[${s.attrs.name??""}]`},addNodeView(){return xt(yn)}}),fe=16,De=2.5,Oe=(fe-De)/2,ze=2*Math.PI*Oe;function vn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:a,outputTokens:r,cost:o}=t;if(!l&&!a&&!r)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(es,{size:12}),e[0]=i):i=e[0];let d;e[1]!==o||e[2]!==l?(d=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=d):d=e[3];let c;e[4]!==d?(c=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[i,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:d})]})}),e[4]=d,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let u;e[8]!==a?(u=a.toLocaleString(),e[8]=a,e[9]=u):u=e[9];let f;e[10]!==u?(f=n.jsx("span",{className:"text-right tabular-nums",children:u}),e[10]=u,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"text-muted",children:"out"}),e[12]=x):x=e[12];const g=r-(t.reasoningTokens??0);let b;e[13]!==g?(b=g.toLocaleString(),e[13]=g,e[14]=b):b=e[14];let h;e[15]!==b?(h=n.jsx("span",{className:"text-right tabular-nums",children:b}),e[15]=b,e[16]=h):h=e[16];let S;e[17]!==a||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(S=(t.cacheReadTokens>0||t.cacheWriteTokens>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:a>0?`${(t.cacheReadTokens/a*100).toFixed(0)}%`:"0%"})]}),e[17]=a,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=S):S=e[20];let y;e[21]!==o?(y=o>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",o.toFixed(4)]})]}),e[21]=o,e[22]=y):y=e[22];let v;e[23]!==h||e[24]!==S||e[25]!==y||e[26]!==f?(v=n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[m,n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p,f,x,h,S,y]})]}),e[23]=h,e[24]=S,e[25]=y,e[26]=f,e[27]=v):v=e[27];let j;return e[28]!==v||e[29]!==c?(j=n.jsxs(ge,{children:[c,v]}),e[28]=v,e[29]=c,e[30]=j):j=e[30],j}function Nn(s){const e=$.c(19),{usage:t,duration:l}=s,a=l!=null&&l>0,r=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!a&&!r&&!o)return null;let i;e[0]!==l||e[1]!==a?(i=a?de(l/1e3):null,e[0]=l,e[1]=a,e[2]=i):i=e[2];const d=i;let c;e[3]!==l||e[4]!==d||e[5]!==t?(c=d&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:d})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),n.jsx("span",{className:"tabular-nums",children:de(l/1e3)}),(t?.reasoningTokens??0)>0&&n.jsxs("span",{className:"ml-2 opacity-50",children:[t.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=l,e[4]=d,e[5]=t,e[6]=c):c=e[6];let m;e[7]!==r||e[8]!==a||e[9]!==o?(m=a&&(r||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=r,e[8]=a,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==o||e[13]!==t?(p=(r||o)&&n.jsxs(ge,{children:[n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:r?`$${t.cost.toFixed(4)}`:`${t.totalTokens.toLocaleString()} tok`})}),n.jsxs(xe,{side:"top",className:"font-mono text-[11px]",children:[n.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[n.jsx("span",{className:"opacity-60",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:(t.inputTokens??0).toLocaleString()}),n.jsx("span",{className:"opacity-60",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:((t.outputTokens??0)-(t?.reasoningTokens??0)).toLocaleString()}),(t?.reasoningTokens??0)>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"think"}),n.jsx("span",{className:"text-right tabular-nums",children:t.reasoningTokens.toLocaleString()})]}),((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"opacity-60",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:(t?.inputTokens??0)>0?`${((t?.cacheReadTokens??0)/t.inputTokens*100).toFixed(0)}%`:"0%"})]})]})]})]}),e[11]=r,e[12]=o,e[13]=t,e[14]=p):p=e[14];let u;return e[15]!==c||e[16]!==m||e[17]!==p?(u=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,m,p]}),e[15]=c,e[16]=m,e[17]=p,e[18]=u):u=e[18],u}function Aa(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:a,onOpenContextPanel:r}=s,o=Math.min(l/a*100,100),i=ze-o/100*ze,d=t?.cost??0,c=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let u;e[2]!==d?(u=d>0?`, $${d.toFixed(2)}`:"",e[2]=d,e[3]=u):u=e[3];const f=`Context usage: ${p}%${u}`,x=r?"cursor-pointer":"cursor-default";let g;e[4]!==x?(g=V("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",x),e[4]=x,e[5]=g):g=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("circle",{cx:fe/2,cy:fe/2,r:Oe,fill:"none",stroke:"currentColor",strokeWidth:De,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let S;e[7]!==h?(S=V(h),e[7]=h,e[8]=S):S=e[8];let y;e[9]!==i||e[10]!==S?(y=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Oe,fill:"none",stroke:"currentColor",strokeWidth:De,strokeDasharray:ze,strokeDashoffset:i,strokeLinecap:"round",className:S})]}),e[9]=i,e[10]=S,e[11]=y):y=e[11];let v;e[12]!==o?(v=o.toFixed(0),e[12]=o,e[13]=v):v=e[13];let j;e[14]!==d?(j=d>0?` · $${d.toFixed(2)}`:"",e[14]=d,e[15]=j):j=e[15];let N;e[16]!==v||e[17]!==j?(N=n.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[v,"%",j]}),e[16]=v,e[17]=j,e[18]=N):N=e[18];let k;e[19]!==r||e[20]!==N||e[21]!==f||e[22]!==g||e[23]!==y?(k=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:r,"aria-label":f,className:g,children:[y,N]})}),e[19]=r,e[20]=N,e[21]=f,e[22]=g,e[23]=y,e[24]=k):k=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("span",{className:"text-muted",children:"context"}),e[25]=_):_=e[25];let w;e[26]!==l?(w=l.toLocaleString(),e[26]=l,e[27]=w):w=e[27];let T;e[28]!==a?(T=a.toLocaleString(),e[28]=a,e[29]=T):T=e[29];let I;e[30]!==o?(I=o.toFixed(1),e[30]=o,e[31]=I):I=e[31];let M;e[32]!==w||e[33]!==T||e[34]!==I?(M=n.jsxs("span",{className:"text-right tabular-nums",children:[w," / ",T," (",I,"%)"]}),e[32]=w,e[33]=T,e[34]=I,e[35]=M):M=e[35];let C;e[36]!==d||e[37]!==c||e[38]!==m?(C=d>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",d.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=d,e[37]=c,e[38]=m,e[39]=C):C=e[39];let A;e[40]!==c||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(A=((t?.cacheReadTokens??0)>0||(t?.cacheWriteTokens??0)>0)&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cache hit"}),n.jsx("span",{className:"text-right tabular-nums",children:c>0?`${((t?.cacheReadTokens??0)/c*100).toFixed(0)}%`:"0%"})]}),e[40]=c,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=A):A=e[43];let L;e[44]!==M||e[45]!==C||e[46]!==A?(L=n.jsx(xe,{side:"top",className:"font-mono text-[11px]",children:n.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[_,M,C,A]})}),e[44]=M,e[45]=C,e[46]=A,e[47]=L):L=e[47];let F;return e[48]!==k||e[49]!==L?(F=n.jsxs(ge,{children:[k,L]}),e[48]=k,e[49]=L,e[50]=F):F=e[50],F}function Sn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(bs,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function kn(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(gs,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function _n(s){const e=$.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let l;return e[2]!==t?(l=n.jsx(hs,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Et({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:a=500}){const[r,o]=H.useState(null),[i,d]=H.useState(!1),c=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!r)return;let p=r.parentElement;for(;p;){const u=window.getComputedStyle(p);if(u.overflowY==="auto"||u.overflowY==="scroll"||u.overflow==="auto"||u.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!r)return;const p=new IntersectionObserver(u=>{const f=u[0]?.isIntersecting??!1;d(f)},{root:s?.current??null,threshold:c,rootMargin:"0px"});return p.observe(r),()=>p.disconnect()},[r,c]),H.useEffect(()=>{if(!e||!i)return;const p=setInterval(m,a);return()=>clearInterval(p)},[e,i,a]),H.useEffect(()=>{!e||!i||m()},[e,i,...t]),{sentinelRef:o,isTracking:i}}function B(s){const e=$.c(53),{icon:t,title:l,usage:a,summary:r,state:o,detail:i,detailVariant:d,forceOpen:c,variant:m,trailing:p,iconDestructive:u,alwaysChevron:f,defaultOpen:x,children:g}=s,b=d===void 0?"code":d,h=m===void 0?"default":m,[S,y]=H.useState(x??!1),{handleCopy:v,copied:j}=ht(),N=o==="loading",k=o==="error";let _;e[0]!==i?(_=i&&i.trim(),e[0]=i,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(c??!1)||S,C=H.useRef(null),A=N&&M;let L;e[2]!==i?(L=[i],e[2]=i,e[3]=L):L=e[3];let F;e[4]!==A||e[5]!==L?(F={containerRef:C,enabled:A,contentDeps:L},e[4]=A,e[5]=L,e[6]=F):F=e[6];const{sentinelRef:z}=Et(F),R=c?void 0:y,E=!T,D=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=N&&"shimmer";let O;e[7]!==W||e[8]!==U||e[9]!==D?(O=V("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",D,W,U),e[7]=W,e[8]=U,e[9]=D,e[10]=O):O=e[10];const K=!T;let G;e[11]!==f||e[12]!==M||e[13]!==t||e[14]!==u||e[15]!==k||e[16]!==T?(G=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:f?n.jsx(Ze,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:V("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",u?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",T&&(M?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),T&&n.jsx("div",{className:V("absolute inset-0 flex items-center justify-center transition-opacity duration-150",M?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:n.jsx(Ze,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=f,e[12]=M,e[13]=t,e[14]=u,e[15]=k,e[16]=T,e[17]=G):G=e[17];const Y=k?"text-warning/80":"text-foreground";let Q;e[18]!==Y?(Q=V("shrink-0 text-[14px] font-normal",Y),e[18]=Y,e[19]=Q):Q=e[19];let te;e[20]!==Q||e[21]!==l?(te=n.jsx("span",{className:Q,children:l}),e[20]=Q,e[21]=l,e[22]=te):te=e[22];let P;e[23]!==r?(P=r?n.jsx("span",{className:"min-w-0 flex-1 truncate",children:n.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:r})}):n.jsx("div",{className:"flex-1"}),e[23]=r,e[24]=P):P=e[24];let q;e[25]!==p?(q=p&&n.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:p}),e[25]=p,e[26]=q):q=e[26];let X;e[27]!==a?(X=n.jsx(vn,{usage:a}),e[27]=a,e[28]=X):X=e[28];let J;e[29]!==O||e[30]!==K||e[31]!==G||e[32]!==te||e[33]!==P||e[34]!==q||e[35]!==X||e[36]!==E?(J=n.jsxs(kn,{disabled:E,className:O,"aria-disabled":K,children:[G,te,P,q,X]}),e[29]=O,e[30]=K,e[31]=G,e[32]=te,e[33]=P,e[34]=q,e[35]=X,e[36]=E,e[37]=J):J=e[37];let se;e[38]!==g||e[39]!==j||e[40]!==i||e[41]!==b||e[42]!==v||e[43]!==T||e[44]!==z?(se=T&&n.jsx(_n,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:g||(b==="prose"?n.jsx("div",{className:"mt-1 mb-1",children:n.jsxs("div",{ref:C,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:[n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:i}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}):n.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:n.jsxs("div",{ref:C,className:"flex flex-col max-h-48 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:i})}),n.jsx("button",{type:"button",onClick:()=>v(i),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":"Copy",children:j?n.jsx(qe,{className:"size-3.5"}):n.jsx(dt,{className:"size-3.5"})})]}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=j,e[40]=i,e[41]=b,e[42]=v,e[43]=T,e[44]=z,e[45]=se):se=e[45];let ue;e[46]!==M||e[47]!==J||e[48]!==se||e[49]!==R?(ue=n.jsxs(Sn,{open:M,onOpenChange:R,className:"min-w-0",children:[J,se]}),e[46]=M,e[47]=J,e[48]=se,e[49]=R,e[50]=ue):ue=e[50];const oe=ue;if(I){let ae;return e[51]!==oe?(ae=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:oe}),e[51]=oe,e[52]=ae):ae=e[52],ae}return oe}function le(s){const e=$.c(4),{latency:t}=s;if(t==null||t<=0)return null;let l;e[0]!==t?(l=de(t),e[0]=t,e[1]=l):l=e[1];let a;return e[2]!==l?(a=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=a):a=e[3],a}const zt=4;function Pt(s){const e=$.c(5),{count:t,noun:l,onClick:a}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ut,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=r):r=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==a?(o=n.jsxs("button",{type:"button",onClick:a,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:["See all ",t," ",l,r]}),e[1]=t,e[2]=l,e[3]=a,e[4]=o):o=e[4],o}function wn(s){const e=$.c(24),{org:t}=he(),l=Jt(),a=Ts(),r=Ms();let o;e[0]!==r||e[1]!==s?(o=async g=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=(await r.call("COLLECTION_THREADS_GET",{id:s})).item?.metadata??{},y=(h.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);y.push({...g,expandedAt:new Date().toISOString()});const v={...h,expanded_tools:y};return await r.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:v}}),y},e[0]=r,e[1]=s,e[2]=o):o=e[2];let i,d,c;e[3]!==t||e[4]!==l||e[5]!==s?(i=async g=>{const b=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:b});const h=l.getQueryData(b),y=(h?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==g.toolName);return y.push({...g,expandedAt:new Date().toISOString()}),l.setQueryData(b,v=>v&&{...v,metadata:{...v.metadata??{},expanded_tools:y}}),{previous:h}},d=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},c=(g,b,h)=>{const S=me.ensureTask(t.id,s??"");h?.previous===void 0?l.removeQueries({queryKey:S,exact:!0}):l.setQueryData(S,h.previous),Fe.error(g instanceof Error?g.message:"Failed to expand tool")},e[3]=t,e[4]=l,e[5]=s,e[6]=i,e[7]=d,e[8]=c):(i=e[6],d=e[7],c=e[8]);let m;e[9]!==o||e[10]!==i||e[11]!==d||e[12]!==c?(m={mutationFn:o,onMutate:i,onSuccess:d,onError:c},e[9]=o,e[10]=i,e[11]=d,e[12]=c,e[13]=m):m=e[13];const p=Qt(m);let u;e[14]!==a||e[15]!==p||e[16]!==t||e[17]!==l||e[18]!==s?(u=g=>{if(!s||!a)return;const b=me.ensureTask(t.id,s),h=l.getQueryData(b),y=(h?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==g.toolName);y.push({...g,expandedAt:new Date().toISOString()});const v={...h?.metadata??{},expanded_tools:y};l.setQueryData(b,j=>j&&{...j,metadata:v}),a.patchThread({id:s,metadata:v}),p.mutate(g)},e[14]=a,e[15]=p,e[16]=t,e[17]=l,e[18]=s,e[19]=u):u=e[19];const f=u;let x;return e[20]!==f||e[21]!==p.isPending||e[22]!==p.mutate?(x={addOrReplace:p.mutate,addOrReplaceEager:f,isPending:p.isPending},e[20]=f,e[21]=p.isPending,e[22]=p.mutate,e[23]=x):x=e[23],x}function Tn(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function Cn(s,e,t,l){const{data:a,isLoading:r}=He({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await As({connectionId:e,orgId:t,orgSlug:l});try{const{tools:i}=await o.listTools(),d=Rt(s);return i.find(c=>c.name===d)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:a??void 0,isLoading:r}}const $n={read:{icon:tt,label:"Read File"},write:{icon:Ps,label:"Write File"},edit:{icon:as,label:"Edit File"},grep:{icon:Ds,label:"Search Content"},glob:{icon:Fs,label:"Find Files"},bash:{icon:os,label:"Run Command"},read_tool_output:{icon:tt,label:"Read Tool Output"},read_resource:{icon:ls,label:"Read Resource"},read_prompt:{icon:kt,label:"Read Prompt"},enable_tool:{icon:zs,label:"Enable Tool"},open_in_agent:{icon:ns,label:"Open in Agent"},sandbox:{icon:ss,label:"Run Code"},copy_to_sandbox:{icon:_t,label:"Load File"},share_with_user:{icon:Os,label:"Share with User"},take_screenshot:{icon:Ne,label:"Take Screenshot"},scrape_url:{icon:Ie,label:"Scrape URL"},inspect_page:{icon:ts,label:"Inspect Page"}},In="bash-sleep-start:";function Mn(s){const e=In+s;try{const t=sessionStorage.getItem(e);if(t!==null){const a=Number.parseInt(t,10);if(Number.isFinite(a))return a}const l=Date.now();return sessionStorage.setItem(e,String(l)),l}catch{return Date.now()}}function An(s,e){const t=$.c(2);let l;t[0]!==s?(l=()=>Mn(s),t[0]=s,t[1]=l):l=t[1];const a=H.useState(l)[0];return e??a}function Ln(s){const e=Math.ceil(s/1e3);if(e<60)return`${e}s`;const t=Math.floor(e/60),l=e%60;return l?`${t}m ${l}s`:`${t}m`}function Rn(s){const e=$.c(4),{toolCallId:t,durationMs:l,anchorMs:a}=s;ft(1e3);const o=An(t,a)+l-Date.now();let i;e[0]!==o?(i=o>0?`Waiting ${Ln(o)}`:"Wrapping up…",e[0]=o,e[1]=i):i=e[1];let d;return e[2]!==i?(d=n.jsx("span",{className:"tabular-nums",children:i}),e[2]=i,e[3]=d):d=e[3],d}const En={s:1e3,m:6e4,h:36e5,d:864e5};function zn(s){const e=/(?:^|[\s;&|(])sleep((?:\s+[\d.]+[smhd]?)+)/g;let t=0,l=!1;for(const a of s.matchAll(e))for(const r of a[1].trim().split(/\s+/)){const o=/^([\d.]+)([smhd]?)$/.exec(r);if(!o)continue;const i=Number.parseFloat(o[1]);Number.isFinite(i)&&(t+=i*(En[o[2]||"s"]??1e3),l=!0)}return l?t:null}function Le(s,e="An unknown error occurred"){return"errorText"in s&&typeof s.errorText=="string"?s.errorText:e}function ye(s){if(s==null)return"";try{return JSON.stringify(s)}catch{return"[Non-serializable value]"}}function Me(s){const e=ye(s);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}const Pn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function Fn(s){if(!s||typeof s!="object")return null;const e=s;if(!Array.isArray(e.parts))return null;const t=[];for(const l of e.parts)if(l.type==="text"&&typeof l.text=="string")t.push(l.text);else if(l.type==="reasoning")t.push(`## Reasoning
2
2
  ${l.text}`);else if(l.type==="source-url")t.push(`## Source URL
3
3
  ${l.url}`);else if(l.type==="source-document")t.push(`## Source Document
4
4
  ${l.title}`);else if(l.type==="file")t.push(`## File
5
- ${l.filename??l.url}`);else if(l.type!=="step-start"){if(zn(l)){const a=l.type.startsWith("tool-")?l.type.slice(5):l.toolName;if(l.state==="input-streaming")t.push(`## ${a}
5
+ ${l.filename??l.url}`);else if(l.type!=="step-start"){if(Pn(l)){const a=l.type.startsWith("tool-")?l.type.slice(5):l.toolName;if(l.state==="input-streaming")t.push(`## ${a}
6
6
  Input streaming...`);else if(l.state==="input-available"){const r=ye(l.input).slice(0,20);t.push(`## ${a}
7
7
  ### Input
8
8
  ${r||"[No input]"}...`)}else if(l.state==="approval-requested")t.push(`## ${a}
@@ -19,14 +19,14 @@ Error: Tool responded with an error`)}else if(l.state==="output-denied"){const r
19
19
  Input: ${r||"[No input]"}...
20
20
  Output: Tool execution was denied`)}}}return t.length>0?t.join(`
21
21
 
22
- `):null}function Fn(s){const e=s&&typeof s=="object"&&"created_at"in s?s.created_at:void 0;return typeof e=="string"||e instanceof Date?mt(e):null}function Dn(s){const e=s&&typeof s=="object"&&"timeout"in s?s.timeout:void 0;return Math.min(typeof e=="number"?e:3e4,12e4)}function $e(s){const e=$.c(7),{icon:t,label:l}=s;let a;e[0]!==t?(a=n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"flex items-center",children:t})}),e[0]=t,e[1]=a):a=e[1];let r;e[2]!==l?(r=n.jsx(xe,{side:"top",children:l}),e[2]=l,e[3]=r):r=e[3];let o;return e[4]!==a||e[5]!==r?(o=n.jsxs(ge,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=o):o=e[6],o}function On(s){const e=$.c(15),{annotations:t,toolMeta:l}=s;let a;e[0]!==l?(a=jt(l),e[0]=l,e[1]=a):a=e[1];const r=!!a;if(!t&&!r)return null;let o;e[2]!==r?(o=r&&n.jsx($e,{icon:n.jsx(it,{}),label:"Interactive"}),e[2]=r,e[3]=o):o=e[3];let i;e[4]!==t?.readOnlyHint?(i=t?.readOnlyHint&&n.jsx($e,{icon:n.jsx(xs,{}),label:"Read-only — no side effects"}),e[4]=t?.readOnlyHint,e[5]=i):i=e[5];let d;e[6]!==t?.destructiveHint?(d=t?.destructiveHint&&n.jsx($e,{icon:n.jsx(Nt,{}),label:"May modify or delete data"}),e[6]=t?.destructiveHint,e[7]=d):d=e[7];let c;e[8]!==t?.openWorldHint?(c=t?.openWorldHint&&n.jsx($e,{icon:n.jsx(Ie,{}),label:"Reaches outside this system"}),e[8]=t?.openWorldHint,e[9]=c):c=e[9];let m;return e[10]!==o||e[11]!==i||e[12]!==d||e[13]!==c?(m=n.jsxs(n.Fragment,{children:[o,i,d,c]}),e[10]=o,e[11]=i,e[12]=d,e[13]=c,e[14]=m):m=e[14],m}function Bn(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function Hn(s){return s<1?`${Math.round(s*1e3)}ms`:s<10?`${s.toFixed(1)}s`:`${Math.round(s)}s`}function Wn(s){const e=$.c(13),{latency:t,outputBytes:l}=s,a=typeof t=="number"&&t>0,r=typeof l=="number"&&l>=0;if(!a&&!r)return null;let o;e[0]!==a||e[1]!==t?(o=a&&n.jsx("span",{children:Hn(t)}),e[0]=a,e[1]=t,e[2]=o):o=e[2];let i;e[3]!==r||e[4]!==a?(i=a&&r&&n.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[3]=r,e[4]=a,e[5]=i):i=e[5];let d;e[6]!==r||e[7]!==l?(d=r&&n.jsx("span",{children:Bn(l)}),e[6]=r,e[7]=l,e[8]=d):d=e[8];let c;return e[9]!==o||e[10]!==i||e[11]!==d?(c=n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-mono tabular-nums text-muted-foreground/60 px-1 leading-none",children:[o,i,d]}),e[9]=o,e[10]=i,e[11]=d,e[12]=c):c=e[12],c}function Un(s,e,t){switch(s){case"input-streaming":case"input-available":return"Preparing...";case"approval-requested":return"Waiting for your approval";case"output-denied":return"Cancelled";case"output-error":return t??"Failed";case"output-available":{if(e==null)return"Done";if(typeof e=="string"){const l=e.trim();return l.length>100?l.slice(0,100)+"…":l}if(typeof e=="object"){for(const l of Object.keys(e)){const a=e[l];if(typeof a=="string"&&a.trim()){const r=a.trim();return r.length>100?r.slice(0,100)+"…":r}}return""}return String(e).slice(0,100)}default:return""}}function st(s){const e=$.c(74),{part:t,annotations:l,latency:a,outputBytes:r,isLastMessage:o,toolMeta:i}=s,d="toolName"in t&&typeof t.toolName=="string"?t.toolName:t.type==="dynamic-tool"?"Dynamic Tool":t.type.replace("tool-","")||"Tool",c=Rt(d),m=_e(),p=_s(),{org:u}=he(),{setChatOpen:f}=Bs(),x=Ve()?.taskId??null,{addOrReplaceEager:g}=wn(x),b=je(),h=i&&typeof i=="object"&&i!==null&&"connectionId"in i&&i.connectionId!=null&&i.connectionId!==""?String(i.connectionId):p?.selectedVirtualMcp?.id??null,{toolDef:S}=Tn(h?d:null,h,u.id,u.slug),y=S?._meta??i,v=Ge(y),j=Ke(c,v),N=Cn[j],k=S?.title??N?.label??At(j);let _;e[0]!==y?(_=jt(y),e[0]=y,e[1]=_):_=e[1];const w=_,T=!!w&&t.state==="output-available",I=h?`${h}:${d}`:null,M=!!l?.destructiveHint,C=T&&!!h&&!M&&!!x;let A;e[2]!==g||e[3]!==h||e[4]!==b||e[5]!==t||e[6]!==d?(A=()=>{if(!h)return;const Z="input"in t&&t.input&&typeof t.input=="object"?t.input:{};g({toolName:d,appId:h,args:Z}),b({to:".",search:ne=>({...ne,main:Cs(h,d)}),replace:!0})},e[2]=g,e[3]=h,e[4]=b,e[5]=t,e[6]=d,e[7]=A):A=e[7];const L=A;let F;e[8]!==C||e[9]!==L?(F=Z=>Z==="fullscreen"&&C?(L(),"fullscreen"):"inline",e[8]=C,e[9]=L,e[10]=F):F=e[10];const z=F;let R;e[11]!==m||e[12]!==f?(R=Z=>{const ne=Ss(Z.content);ne.content.length>0&&(f?.(!0),m?.sendMessage(ne))},e[11]=m,e[12]=f,e[13]=R):R=e[13];const E=R,D=t.state==="approval-requested"&&o===!1,W=t.state==="output-denied"||D,U=t.state==="output-available"&&typeof t.output=="object"&&t.output!=null&&"isError"in t.output&&t.output.isError===!0;let O;e[14]!==t.state?(O=re(t.state),e[14]=t.state,e[15]=O):O=e[15];const K=O,G=D||K==="approval"?"idle":U?"error":K;let Y,Q;if(e[16]!==G||e[17]!==U||e[18]!==D||e[19]!==t||e[20]!==j){Y=t.state==="output-error"?Le(t):void 0;const Z=j==="bash"&&G==="loading"&&t.input&&typeof t.input=="object"&&typeof t.input.command=="string"?t.input.command:null;let ne;e[23]!==Z?(ne=Z!==null?En(Z):null,e[23]=Z,e[24]=ne):ne=e[24];const ee=ne;let Te;e[25]!==t.input||e[26]!==ee?(Te=ee!==null?Math.min(ee,Dn(t.input)):null,e[25]=t.input,e[26]=ee,e[27]=Te):Te=e[27];const Qe=Te,Vt="toolCallId"in t?t.toolCallId:"";Q=Qe!==null?n.jsx(Ln,{toolCallId:Vt,durationMs:Qe,anchorMs:Fn(t)}):D?"Cancelled":U?"Failed":Un(t.state,t.output,Y),e[16]=G,e[17]=U,e[18]=D,e[19]=t,e[20]=j,e[21]=Y,e[22]=Q}else Y=e[21],Q=e[22];const te=Q;let P="";t.input!==void 0&&(P=`# Input
22
+ `):null}function Dn(s){const e=s&&typeof s=="object"&&"created_at"in s?s.created_at:void 0;return typeof e=="string"||e instanceof Date?mt(e):null}function On(s){const e=s&&typeof s=="object"&&"timeout"in s?s.timeout:void 0;return Math.min(typeof e=="number"?e:3e4,12e4)}function $e(s){const e=$.c(7),{icon:t,label:l}=s;let a;e[0]!==t?(a=n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"flex items-center",children:t})}),e[0]=t,e[1]=a):a=e[1];let r;e[2]!==l?(r=n.jsx(xe,{side:"top",children:l}),e[2]=l,e[3]=r):r=e[3];let o;return e[4]!==a||e[5]!==r?(o=n.jsxs(ge,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=o):o=e[6],o}function Bn(s){const e=$.c(15),{annotations:t,toolMeta:l}=s;let a;e[0]!==l?(a=jt(l),e[0]=l,e[1]=a):a=e[1];const r=!!a;if(!t&&!r)return null;let o;e[2]!==r?(o=r&&n.jsx($e,{icon:n.jsx(it,{}),label:"Interactive"}),e[2]=r,e[3]=o):o=e[3];let i;e[4]!==t?.readOnlyHint?(i=t?.readOnlyHint&&n.jsx($e,{icon:n.jsx(xs,{}),label:"Read-only — no side effects"}),e[4]=t?.readOnlyHint,e[5]=i):i=e[5];let d;e[6]!==t?.destructiveHint?(d=t?.destructiveHint&&n.jsx($e,{icon:n.jsx(Nt,{}),label:"May modify or delete data"}),e[6]=t?.destructiveHint,e[7]=d):d=e[7];let c;e[8]!==t?.openWorldHint?(c=t?.openWorldHint&&n.jsx($e,{icon:n.jsx(Ie,{}),label:"Reaches outside this system"}),e[8]=t?.openWorldHint,e[9]=c):c=e[9];let m;return e[10]!==o||e[11]!==i||e[12]!==d||e[13]!==c?(m=n.jsxs(n.Fragment,{children:[o,i,d,c]}),e[10]=o,e[11]=i,e[12]=d,e[13]=c,e[14]=m):m=e[14],m}function Hn(s){return s<1?`${Math.round(s*1e3)}ms`:s<10?`${s.toFixed(1)}s`:`${Math.round(s)}s`}function Wn(s){const e=$.c(13),{latency:t,outputBytes:l}=s,a=typeof t=="number"&&t>0,r=typeof l=="number"&&l>=0;if(!a&&!r)return null;let o;e[0]!==a||e[1]!==t?(o=a&&n.jsx("span",{children:Hn(t)}),e[0]=a,e[1]=t,e[2]=o):o=e[2];let i;e[3]!==r||e[4]!==a?(i=a&&r&&n.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[3]=r,e[4]=a,e[5]=i):i=e[5];let d;e[6]!==r||e[7]!==l?(d=r&&n.jsx("span",{children:Tn(l)}),e[6]=r,e[7]=l,e[8]=d):d=e[8];let c;return e[9]!==o||e[10]!==i||e[11]!==d?(c=n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-mono tabular-nums text-muted-foreground/60 px-1 leading-none",children:[o,i,d]}),e[9]=o,e[10]=i,e[11]=d,e[12]=c):c=e[12],c}function Un(s,e,t){switch(s){case"input-streaming":case"input-available":return"Preparing...";case"approval-requested":return"Waiting for your approval";case"output-denied":return"Cancelled";case"output-error":return t??"Failed";case"output-available":{if(e==null)return"Done";if(typeof e=="string"){const l=e.trim();return l.length>100?l.slice(0,100)+"…":l}if(typeof e=="object"){for(const l of Object.keys(e)){const a=e[l];if(typeof a=="string"&&a.trim()){const r=a.trim();return r.length>100?r.slice(0,100)+"…":r}}return""}return String(e).slice(0,100)}default:return""}}function st(s){const e=$.c(74),{part:t,annotations:l,latency:a,outputBytes:r,isLastMessage:o,toolMeta:i}=s,d="toolName"in t&&typeof t.toolName=="string"?t.toolName:t.type==="dynamic-tool"?"Dynamic Tool":t.type.replace("tool-","")||"Tool",c=Rt(d),m=_e(),p=_s(),{org:u}=he(),{setChatOpen:f}=Bs(),x=Ve()?.taskId??null,{addOrReplaceEager:g}=wn(x),b=je(),h=i&&typeof i=="object"&&i!==null&&"connectionId"in i&&i.connectionId!=null&&i.connectionId!==""?String(i.connectionId):p?.selectedVirtualMcp?.id??null,{toolDef:S}=Cn(h?d:null,h,u.id,u.slug),y=S?._meta??i,v=Ge(y),j=Ke(c,v),N=$n[j],k=S?.title??N?.label??At(j);let _;e[0]!==y?(_=jt(y),e[0]=y,e[1]=_):_=e[1];const w=_,T=!!w&&t.state==="output-available",I=h?`${h}:${d}`:null,M=!!l?.destructiveHint,C=T&&!!h&&!M&&!!x;let A;e[2]!==g||e[3]!==h||e[4]!==b||e[5]!==t||e[6]!==d?(A=()=>{if(!h)return;const Z="input"in t&&t.input&&typeof t.input=="object"?t.input:{};g({toolName:d,appId:h,args:Z}),b({to:".",search:ne=>({...ne,main:Cs(h,d)}),replace:!0})},e[2]=g,e[3]=h,e[4]=b,e[5]=t,e[6]=d,e[7]=A):A=e[7];const L=A;let F;e[8]!==C||e[9]!==L?(F=Z=>Z==="fullscreen"&&C?(L(),"fullscreen"):"inline",e[8]=C,e[9]=L,e[10]=F):F=e[10];const z=F;let R;e[11]!==m||e[12]!==f?(R=Z=>{const ne=Ss(Z.content);ne.content.length>0&&(f?.(!0),m?.sendMessage(ne))},e[11]=m,e[12]=f,e[13]=R):R=e[13];const E=R,D=t.state==="approval-requested"&&o===!1,W=t.state==="output-denied"||D,U=t.state==="output-available"&&typeof t.output=="object"&&t.output!=null&&"isError"in t.output&&t.output.isError===!0;let O;e[14]!==t.state?(O=re(t.state),e[14]=t.state,e[15]=O):O=e[15];const K=O,G=D||K==="approval"?"idle":U?"error":K;let Y,Q;if(e[16]!==G||e[17]!==U||e[18]!==D||e[19]!==t||e[20]!==j){Y=t.state==="output-error"?Le(t):void 0;const Z=j==="bash"&&G==="loading"&&t.input&&typeof t.input=="object"&&typeof t.input.command=="string"?t.input.command:null;let ne;e[23]!==Z?(ne=Z!==null?zn(Z):null,e[23]=Z,e[24]=ne):ne=e[24];const ee=ne;let Te;e[25]!==t.input||e[26]!==ee?(Te=ee!==null?Math.min(ee,On(t.input)):null,e[25]=t.input,e[26]=ee,e[27]=Te):Te=e[27];const Qe=Te,Vt="toolCallId"in t?t.toolCallId:"";Q=Qe!==null?n.jsx(Rn,{toolCallId:Vt,durationMs:Qe,anchorMs:Dn(t)}):D?"Cancelled":U?"Failed":Un(t.state,t.output,Y),e[16]=G,e[17]=U,e[18]=D,e[19]=t,e[20]=j,e[21]=Y,e[22]=Q}else Y=e[21],Q=e[22];const te=Q;let P="";t.input!==void 0&&(P=`# Input
23
23
  `+Me(t.input)),t.state==="output-error"?(P&&(P=P+`
24
24
 
25
25
  `),P=P+(`# Error
26
26
  `+(Y??""))):t.output!==void 0&&!T&&(P&&(P=P+`
27
27
 
28
28
  `),P=P+(`# Output
29
- `+Me(t.output)));let q;e:{if(W){let ee;e[28]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(Rs,{}),e[28]=ee):ee=e[28],q=ee;break e}if(T){let ee;e[29]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(it,{className:"size-4 text-muted-foreground"}),e[29]=ee):ee=e[29],q=ee;break e}const Z=N?.icon;if(Z){let ee;e[30]!==Z?(ee=n.jsx(Z,{className:"size-4 text-muted-foreground"}),e[30]=Z,e[31]=ee):ee=e[31],q=ee;break e}let ne;e[32]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(rs,{className:"size-4 text-muted-foreground"}),e[32]=ne):ne=e[32],q=ne}let X;e[33]!==l||e[34]!==i?(X=n.jsx(On,{annotations:l,toolMeta:i}),e[33]=l,e[34]=i,e[35]=X):X=e[35];let J;e[36]!==a||e[37]!==r?(J=n.jsx(Wn,{latency:a,outputBytes:r}),e[36]=a,e[37]=r,e[38]=J):J=e[38];let se;e[39]!==X||e[40]!==J?(se=n.jsxs(n.Fragment,{children:[X,J]}),e[39]=X,e[40]=J,e[41]=se):se=e[41];const ue=P||null;let oe;e[42]!==G||e[43]!==k||e[44]!==W||e[45]!==a||e[46]!==te||e[47]!==se||e[48]!==ue||e[49]!==q?(oe=n.jsx(B,{icon:q,iconDestructive:W,trailing:se,title:k,latency:a,summary:te,state:G,detail:ue}),e[42]=G,e[43]=k,e[44]=W,e[45]=a,e[46]=te,e[47]=se,e[48]=ue,e[49]=q,e[50]=oe):oe=e[50];let ae;e[51]!==C||e[52]!==L?(ae=C&&n.jsx("div",{className:"flex justify-end mt-1.5 mb-1",children:n.jsxs("button",{type:"button",onClick:L,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground rounded-md [@media(hover:hover)]:hover:bg-accent/50 [@media(hover:hover)]:hover:text-foreground transition-colors",children:[n.jsx(is,{className:"size-3.5"}),"Open in panel"]})}),e[51]=C,e[52]=L,e[53]=ae):ae=e[53];let be;e[54]!==C||e[55]!==p||e[56]!==h||e[57]!==k||e[58]!==E||e[59]!==z||e[60]!==T||e[61]!==y||e[62]!==u.id||e[63]!==u.slug||e[64]!==t.input||e[65]!==t.output||e[66]!==I||e[67]!==j||e[68]!==w?(be=T&&w&&h&&u?.id&&n.jsx(n.Fragment,{children:n.jsx(Yt,{fallback:Z=>{const{resetError:ne}=Z;return n.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-2.5 border border-dashed border-destructive/30 bg-destructive/5 rounded-lg",children:[n.jsx(Nt,{size:16,className:"shrink-0 text-destructive"}),n.jsxs("span",{className:"flex-1 text-xs text-destructive font-medium",children:["Failed to load"," ",n.jsx("span",{className:"font-mono",children:k})," app"]}),n.jsxs(Se,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5 shrink-0",onClick:ne,children:[n.jsx(Zt,{className:"size-3.5"}),"Retry"]})]})},children:n.jsx(H.Suspense,{fallback:n.jsx("div",{className:"mt-2 flex items-center justify-center h-12 border border-border/75 rounded-lg overflow-hidden p-3",children:n.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[n.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),n.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:n.jsx(Gn,{uiResourceUri:w,connectionId:h,orgId:u.id,orgSlug:u.slug,toolName:j,toolInput:t.input,toolResult:t.output,toolMeta:y,onMessage:E,onUpdateModelContext:I&&p?Z=>p.setAppContext(I,Z):void 0,onTeardown:I&&p?()=>p.clearAppContext(I):void 0,onRequestDisplayMode:C?z:void 0})})})}),e[54]=C,e[55]=p,e[56]=h,e[57]=k,e[58]=E,e[59]=z,e[60]=T,e[61]=y,e[62]=u.id,e[63]=u.slug,e[64]=t.input,e[65]=t.output,e[66]=I,e[67]=j,e[68]=w,e[69]=be):be=e[69];let we;return e[70]!==oe||e[71]!==ae||e[72]!==be?(we=n.jsxs("div",{children:[oe,ae,be]}),e[70]=oe,e[71]=ae,e[72]=be,e[73]=we):we=e[73],we}function Ft(s){return typeof s=="object"&&s!=null&&"type"in s&&s.type==="mcpToolCall"}function qn(s){if(s!=null)return Ft(s)?s.arguments??void 0:s}function Vn(s){if(s==null)return;if(Ft(s)&&s.result!=null)return s.result;if(typeof s=="object"&&"content"in s&&Array.isArray(s.content)){const t=s.content;if(t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"type"in t[0])return s}const e=typeof s=="string"?s:JSON.stringify(s);return{structuredContent:typeof s=="object"&&!Array.isArray(s)?s:void 0,content:[{type:"text",text:e}]}}function Gn(s){const e=$.c(27),{uiResourceUri:t,connectionId:l,orgId:a,orgSlug:r,toolName:o,toolInput:i,toolResult:d,toolMeta:c,onMessage:m,onUpdateModelContext:p,onTeardown:u,onRequestDisplayMode:f}=s;let x;e[0]!==l||e[1]!==a||e[2]!==r?(x={connectionId:l,orgId:a,orgSlug:r},e[0]=l,e[1]=a,e[2]=r,e[3]=x):x=e[3];const g=vt(x);let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b={type:"object"},e[4]=b):b=e[4];let h;e[5]!==c?(h=c!=null&&{_meta:c},e[5]=c,e[6]=h):h=e[6];let S;e[7]!==h||e[8]!==o?(S={name:o,inputSchema:b,...h},e[7]=h,e[8]=o,e[9]=S):S=e[9];const y=S;let v;e[10]!==y?(v={tool:y},e[10]=y,e[11]=v):v=e[11];let j;e[12]!==i?(j=qn(i),e[12]=i,e[13]=j):j=e[13];let N;e[14]!==d?(N=Vn(d),e[14]=d,e[15]=N):N=e[15];let k;return e[16]!==g||e[17]!==m||e[18]!==f||e[19]!==u||e[20]!==p||e[21]!==a||e[22]!==v||e[23]!==j||e[24]!==N||e[25]!==t?(k=n.jsx("div",{className:"mt-2 border border-border/75 rounded-lg overflow-hidden p-3",children:n.jsx(ks,{resourceURI:t,orgId:a,toolInfo:v,toolInput:j,toolResult:N,client:g,onMessage:m,onUpdateModelContext:p,onTeardown:u,onRequestDisplayMode:f})}),e[16]=g,e[17]=m,e[18]=f,e[19]=u,e[20]=p,e[21]=a,e[22]=v,e[23]=j,e[24]=N,e[25]=t,e[26]=k):k=e[26],k}const nt="mesh-storage://";function Re(s){return s.startsWith(nt)?s.slice(nt.length):null}function Dt(s,e){const t=Re(s);return t!==null?`/api/${e}/files/${t}`:s}function Kn(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;return l?{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:0,cacheReadTokens:0,cacheWriteTokens:0}:null}function Xn(s){const e=$.c(13),{uri:t,orgSlug:l}=s;let a;e[0]!==l||e[1]!==t?(a=Dt(t,l),e[0]=l,e[1]=t,e[2]=a):a=e[2];const r=a;let o;e[3]!==t?(o=Re(t)!==null?t.slice(t.lastIndexOf("/")+1):"reference",e[3]=t,e[4]=o):o=e[4];const i=o;let d;e[5]!==i?(d=n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"inline-flex items-center gap-1 px-1 py-0.5 rounded bg-muted text-muted-foreground text-xs cursor-default select-none",children:i})}),e[5]=i,e[6]=d):d=e[6];let c;e[7]!==i||e[8]!==r?(c=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:n.jsx("img",{src:r,alt:i,className:"max-w-full max-h-64 object-contain rounded"})}),e[7]=i,e[8]=r,e[9]=c):c=e[9];let m;return e[10]!==d||e[11]!==c?(m=n.jsxs(ge,{children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function Jn(s){const e=$.c(71),{part:t,latency:l}=s,a=We();let r;e[0]!==t.state?(r=re(t.state),e[0]=t.state,e[1]=r):r=e[1];const o=r,i=t.input,d=t.output,c=d?.images;let m;e[2]!==d?(m=Kn(d),e[2]=d,e[3]=m):m=e[3];const p=m,u=d?.model;let f,x,g,b,h,S,y,v,j,N,k,_;if(e[4]!==c||e[5]!==i||e[6]!==l||e[7]!==u||e[8]!==a||e[9]!==t||e[10]!==d||e[11]!==o||e[12]!==p){h=Symbol.for("react.early_return_sentinel");e:{const A=Array.isArray(i?.referenceImages)?i.referenceImages.filter(Qn):void 0;let L;e[25]!==l?(L=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[25]=l,e[26]=L):L=e[26];const F=L;if(o==="loading"){let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Ee,{size:14}),e[27]=z):z=e[27];let R;e[28]!==i?(R=i?.prompt?`"${i.prompt.slice(0,80)}…"`:void 0,e[28]=i,e[29]=R):R=e[29];let E;e[30]!==R?(E=n.jsx(B,{icon:z,title:"Generating image",summary:R,state:"loading"}),e[30]=R,e[31]=E):E=e[31],h=E;break e}if(o==="error"||!c||c.length===0){let z;e[32]!==t||e[33]!==o?(z=o==="error"?Le(t):void 0,e[32]=t,e[33]=o,e[34]=z):z=e[34];const R=z;let E="";i!==void 0&&(E=`# Input
29
+ `+Me(t.output)));let q;e:{if(W){let ee;e[28]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(Rs,{}),e[28]=ee):ee=e[28],q=ee;break e}if(T){let ee;e[29]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsx(it,{className:"size-4 text-muted-foreground"}),e[29]=ee):ee=e[29],q=ee;break e}const Z=N?.icon;if(Z){let ee;e[30]!==Z?(ee=n.jsx(Z,{className:"size-4 text-muted-foreground"}),e[30]=Z,e[31]=ee):ee=e[31],q=ee;break e}let ne;e[32]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(rs,{className:"size-4 text-muted-foreground"}),e[32]=ne):ne=e[32],q=ne}let X;e[33]!==l||e[34]!==i?(X=n.jsx(Bn,{annotations:l,toolMeta:i}),e[33]=l,e[34]=i,e[35]=X):X=e[35];let J;e[36]!==a||e[37]!==r?(J=n.jsx(Wn,{latency:a,outputBytes:r}),e[36]=a,e[37]=r,e[38]=J):J=e[38];let se;e[39]!==X||e[40]!==J?(se=n.jsxs(n.Fragment,{children:[X,J]}),e[39]=X,e[40]=J,e[41]=se):se=e[41];const ue=P||null;let oe;e[42]!==G||e[43]!==k||e[44]!==W||e[45]!==a||e[46]!==te||e[47]!==se||e[48]!==ue||e[49]!==q?(oe=n.jsx(B,{icon:q,iconDestructive:W,trailing:se,title:k,latency:a,summary:te,state:G,detail:ue}),e[42]=G,e[43]=k,e[44]=W,e[45]=a,e[46]=te,e[47]=se,e[48]=ue,e[49]=q,e[50]=oe):oe=e[50];let ae;e[51]!==C||e[52]!==L?(ae=C&&n.jsx("div",{className:"flex justify-end mt-1.5 mb-1",children:n.jsxs("button",{type:"button",onClick:L,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground rounded-md [@media(hover:hover)]:hover:bg-accent/50 [@media(hover:hover)]:hover:text-foreground transition-colors",children:[n.jsx(is,{className:"size-3.5"}),"Open in panel"]})}),e[51]=C,e[52]=L,e[53]=ae):ae=e[53];let be;e[54]!==C||e[55]!==p||e[56]!==h||e[57]!==k||e[58]!==E||e[59]!==z||e[60]!==T||e[61]!==y||e[62]!==u.id||e[63]!==u.slug||e[64]!==t.input||e[65]!==t.output||e[66]!==I||e[67]!==j||e[68]!==w?(be=T&&w&&h&&u?.id&&n.jsx(n.Fragment,{children:n.jsx(Yt,{fallback:Z=>{const{resetError:ne}=Z;return n.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-2.5 border border-dashed border-destructive/30 bg-destructive/5 rounded-lg",children:[n.jsx(Nt,{size:16,className:"shrink-0 text-destructive"}),n.jsxs("span",{className:"flex-1 text-xs text-destructive font-medium",children:["Failed to load"," ",n.jsx("span",{className:"font-mono",children:k})," app"]}),n.jsxs(Se,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5 shrink-0",onClick:ne,children:[n.jsx(Zt,{className:"size-3.5"}),"Retry"]})]})},children:n.jsx(H.Suspense,{fallback:n.jsx("div",{className:"mt-2 flex items-center justify-center h-12 border border-border/75 rounded-lg overflow-hidden p-3",children:n.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[n.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),n.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:n.jsx(Gn,{uiResourceUri:w,connectionId:h,orgId:u.id,orgSlug:u.slug,toolName:j,toolInput:t.input,toolResult:t.output,toolMeta:y,onMessage:E,onUpdateModelContext:I&&p?Z=>p.setAppContext(I,Z):void 0,onTeardown:I&&p?()=>p.clearAppContext(I):void 0,onRequestDisplayMode:C?z:void 0})})})}),e[54]=C,e[55]=p,e[56]=h,e[57]=k,e[58]=E,e[59]=z,e[60]=T,e[61]=y,e[62]=u.id,e[63]=u.slug,e[64]=t.input,e[65]=t.output,e[66]=I,e[67]=j,e[68]=w,e[69]=be):be=e[69];let we;return e[70]!==oe||e[71]!==ae||e[72]!==be?(we=n.jsxs("div",{children:[oe,ae,be]}),e[70]=oe,e[71]=ae,e[72]=be,e[73]=we):we=e[73],we}function Ft(s){return typeof s=="object"&&s!=null&&"type"in s&&s.type==="mcpToolCall"}function qn(s){if(s!=null)return Ft(s)?s.arguments??void 0:s}function Vn(s){if(s==null)return;if(Ft(s)&&s.result!=null)return s.result;if(typeof s=="object"&&"content"in s&&Array.isArray(s.content)){const t=s.content;if(t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"type"in t[0])return s}const e=typeof s=="string"?s:JSON.stringify(s);return{structuredContent:typeof s=="object"&&!Array.isArray(s)?s:void 0,content:[{type:"text",text:e}]}}function Gn(s){const e=$.c(27),{uiResourceUri:t,connectionId:l,orgId:a,orgSlug:r,toolName:o,toolInput:i,toolResult:d,toolMeta:c,onMessage:m,onUpdateModelContext:p,onTeardown:u,onRequestDisplayMode:f}=s;let x;e[0]!==l||e[1]!==a||e[2]!==r?(x={connectionId:l,orgId:a,orgSlug:r},e[0]=l,e[1]=a,e[2]=r,e[3]=x):x=e[3];const g=vt(x);let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b={type:"object"},e[4]=b):b=e[4];let h;e[5]!==c?(h=c!=null&&{_meta:c},e[5]=c,e[6]=h):h=e[6];let S;e[7]!==h||e[8]!==o?(S={name:o,inputSchema:b,...h},e[7]=h,e[8]=o,e[9]=S):S=e[9];const y=S;let v;e[10]!==y?(v={tool:y},e[10]=y,e[11]=v):v=e[11];let j;e[12]!==i?(j=qn(i),e[12]=i,e[13]=j):j=e[13];let N;e[14]!==d?(N=Vn(d),e[14]=d,e[15]=N):N=e[15];let k;return e[16]!==g||e[17]!==m||e[18]!==f||e[19]!==u||e[20]!==p||e[21]!==a||e[22]!==v||e[23]!==j||e[24]!==N||e[25]!==t?(k=n.jsx("div",{className:"mt-2 border border-border/75 rounded-lg overflow-hidden p-3",children:n.jsx(ks,{resourceURI:t,orgId:a,toolInfo:v,toolInput:j,toolResult:N,client:g,onMessage:m,onUpdateModelContext:p,onTeardown:u,onRequestDisplayMode:f})}),e[16]=g,e[17]=m,e[18]=f,e[19]=u,e[20]=p,e[21]=a,e[22]=v,e[23]=j,e[24]=N,e[25]=t,e[26]=k):k=e[26],k}const nt="mesh-storage://";function Re(s){return s.startsWith(nt)?s.slice(nt.length):null}function Dt(s,e){const t=Re(s);return t!==null?`/api/${e}/files/${t}`:s}function Kn(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;return l?{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:0,cacheReadTokens:0,cacheWriteTokens:0}:null}function Xn(s){const e=$.c(13),{uri:t,orgSlug:l}=s;let a;e[0]!==l||e[1]!==t?(a=Dt(t,l),e[0]=l,e[1]=t,e[2]=a):a=e[2];const r=a;let o;e[3]!==t?(o=Re(t)!==null?t.slice(t.lastIndexOf("/")+1):"reference",e[3]=t,e[4]=o):o=e[4];const i=o;let d;e[5]!==i?(d=n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"inline-flex items-center gap-1 px-1 py-0.5 rounded bg-muted text-muted-foreground text-xs cursor-default select-none",children:i})}),e[5]=i,e[6]=d):d=e[6];let c;e[7]!==i||e[8]!==r?(c=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:n.jsx("img",{src:r,alt:i,className:"max-w-full max-h-64 object-contain rounded"})}),e[7]=i,e[8]=r,e[9]=c):c=e[9];let m;return e[10]!==d||e[11]!==c?(m=n.jsxs(ge,{children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function Jn(s){const e=$.c(71),{part:t,latency:l}=s,a=We();let r;e[0]!==t.state?(r=re(t.state),e[0]=t.state,e[1]=r):r=e[1];const o=r,i=t.input,d=t.output,c=d?.images;let m;e[2]!==d?(m=Kn(d),e[2]=d,e[3]=m):m=e[3];const p=m,u=d?.model;let f,x,g,b,h,S,y,v,j,N,k,_;if(e[4]!==c||e[5]!==i||e[6]!==l||e[7]!==u||e[8]!==a||e[9]!==t||e[10]!==d||e[11]!==o||e[12]!==p){h=Symbol.for("react.early_return_sentinel");e:{const A=Array.isArray(i?.referenceImages)?i.referenceImages.filter(Qn):void 0;let L;e[25]!==l?(L=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[25]=l,e[26]=L):L=e[26];const F=L;if(o==="loading"){let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Ee,{size:14}),e[27]=z):z=e[27];let R;e[28]!==i?(R=i?.prompt?`"${i.prompt.slice(0,80)}…"`:void 0,e[28]=i,e[29]=R):R=e[29];let E;e[30]!==R?(E=n.jsx(B,{icon:z,title:"Generating image",summary:R,state:"loading"}),e[30]=R,e[31]=E):E=e[31],h=E;break e}if(o==="error"||!c||c.length===0){let z;e[32]!==t||e[33]!==o?(z=o==="error"?Le(t):void 0,e[32]=t,e[33]=o,e[34]=z):z=e[34];const R=z;let E="";i!==void 0&&(E=`# Input
30
30
  `+Me(i)),R?(E&&(E=E+`
31
31
 
32
32
  `),E=E+(`# Error
@@ -35,7 +35,7 @@ Output: Tool execution was denied`)}}}return t.length>0?t.join(`
35
35
  `),E=E+(`# Output
36
36
  `+Me(d)));let D;e[35]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(Ee,{size:14}),e[35]=D):D=e[35];const W=o==="error"?"Failed":"No images generated",U=o==="error"?"error":"idle",O=E||null;let K;e[36]!==F||e[37]!==W||e[38]!==U||e[39]!==O||e[40]!==p?(K=n.jsx(B,{icon:D,title:"Image generation",summary:W,state:U,usage:p,trailing:F,detail:O}),e[36]=F,e[37]=W,e[38]=U,e[39]=O,e[40]=p,e[41]=K):K=e[41],h=K;break e}b="flex flex-col gap-2",f=B,e[42]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ee,{size:14,className:"text-pink-500"}),e[42]=j):j=e[42],N="Generated image",k=u,_="idle",x=p,g=F,S="flex flex-col gap-1 pb-2 pl-6",e[43]!==i?(y=i?.prompt&&n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:i.prompt}),e[43]=i,e[44]=y):y=e[44],v=A&&A.length>0&&n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsx("span",{className:"text-[11px] text-muted-foreground/50",children:"references:"}),A.map((z,R)=>{const E=z.uri??z.url;return n.jsx(Xn,{uri:E,orgSlug:a.slug},R)})]})}e[4]=c,e[5]=i,e[6]=l,e[7]=u,e[8]=a,e[9]=t,e[10]=d,e[11]=o,e[12]=p,e[13]=f,e[14]=x,e[15]=g,e[16]=b,e[17]=h,e[18]=S,e[19]=y,e[20]=v,e[21]=j,e[22]=N,e[23]=k,e[24]=_}else f=e[13],x=e[14],g=e[15],b=e[16],h=e[17],S=e[18],y=e[19],v=e[20],j=e[21],N=e[22],k=e[23],_=e[24];if(h!==Symbol.for("react.early_return_sentinel"))return h;let w;e[45]!==S||e[46]!==y||e[47]!==v?(w=n.jsxs("div",{className:S,children:[y,v]}),e[45]=S,e[46]=y,e[47]=v,e[48]=w):w=e[48];let T;e[49]!==f||e[50]!==x||e[51]!==g||e[52]!==w||e[53]!==j||e[54]!==N||e[55]!==k||e[56]!==_?(T=n.jsx(f,{icon:j,title:N,summary:k,state:_,usage:x,trailing:g,children:w}),e[49]=f,e[50]=x,e[51]=g,e[52]=w,e[53]=j,e[54]=N,e[55]=k,e[56]=_,e[57]=T):T=e[57];let I;if(e[58]!==c||e[59]!==i?.prompt||e[60]!==a){let A;e[62]!==i?.prompt||e[63]!==a?(A=(L,F)=>{const z=L.uri??L.url;if(!z)return null;const R=Dt(z,a.slug);return n.jsx(yt,{src:R,alt:i?.prompt??"Generated image",children:n.jsx("img",{src:R,alt:i?.prompt??"Generated image",className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"})},F)},e[62]=i?.prompt,e[63]=a,e[64]=A):A=e[64],I=c.map(A),e[58]=c,e[59]=i?.prompt,e[60]=a,e[61]=I}else I=e[61];let M;e[65]!==I?(M=n.jsx("div",{className:"flex flex-wrap gap-2",children:I}),e[65]=I,e[66]=M):M=e[66];let C;return e[67]!==b||e[68]!==T||e[69]!==M?(C=n.jsxs("div",{className:b,children:[T,M]}),e[67]=b,e[68]=T,e[69]=M,e[70]=C):C=e[70],C}function Qn(s){return s.uri??s.url}function Yn(s,e){const t=Re(s);return t!==null?`/api/${e}/files/${t}`:s}function Zn(s){const e=$.c(26),{part:t,latency:l}=s,a=We(),r=re(t.state),o=t.input,i=t.output,d=i?.image?.uri,c=i?.url??o?.url;let m;e[0]!==l?(m=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[0]=l,e[1]=m):m=e[1];const p=m;if(r==="loading"){let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ne,{size:14}),e[2]=j):j=e[2];let N;return e[3]!==c?(N=n.jsx(B,{icon:j,title:"Taking screenshot",summary:c,state:"loading"}),e[3]=c,e[4]=N):N=e[4],N}if(r==="error"||i?.success===!1||!d){let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ne,{size:14}),e[5]=j):j=e[5];const N=i?.error??"Failed";let k;return e[6]!==p||e[7]!==N?(k=n.jsx(B,{icon:j,title:"Take screenshot",summary:N,state:"error",trailing:p}),e[6]=p,e[7]=N,e[8]=k):k=e[8],k}let u;e[9]!==a.slug||e[10]!==d?(u=Yn(d,a.slug),e[9]=a.slug,e[10]=d,e[11]=u):u=e[11];const f=u;let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ne,{size:14,className:"text-blue-500"}),e[12]=x):x=e[12];let g;e[13]!==p||e[14]!==c?(g=n.jsx(B,{icon:x,title:"Screenshot",summary:c,state:"idle",trailing:p}),e[13]=p,e[14]=c,e[15]=g):g=e[15];const b=c??"Screenshot",h=c??"Screenshot";let S;e[16]!==f||e[17]!==h?(S=n.jsx("img",{src:f,alt:h,className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"}),e[16]=f,e[17]=h,e[18]=S):S=e[18];let y;e[19]!==f||e[20]!==b||e[21]!==S?(y=n.jsx("div",{className:"flex flex-wrap gap-2",children:n.jsx(yt,{src:f,alt:b,children:S})}),e[19]=f,e[20]=b,e[21]=S,e[22]=y):y=e[22];let v;return e[23]!==g||e[24]!==y?(v=n.jsxs("div",{className:"flex flex-col gap-2",children:[g,y]}),e[23]=g,e[24]=y,e[25]=v):v=e[25],v}function el(s,e){const t=Re(s);return t!==null?`/api/${e}/files/${t}`:s}function tl(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;if(!l)return null;const a={providerMetadata:s.usage.providerMetadata};return{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:$t(a),cacheReadTokens:0,cacheWriteTokens:0}}function sl(s){try{return new URL(s).hostname.replace(/^www\./,"")}catch{return s}}function nl(s){try{return`${new URL(s).origin}/favicon.ico`}catch{return""}}function ll(s){const e=$.c(16),{citation:t,index:l}=s;let a;e[0]!==t.url?(a=sl(t.url),e[0]=t.url,e[1]=a):a=e[1];const r=a;let o;e[2]!==t.url?(o=nl(t.url),e[2]=t.url,e[3]=o):o=e[3];const i=o,d=t.title||r;let c;e[4]!==i?(c=n.jsx("img",{src:i,alt:"",className:"size-3.5 rounded-sm shrink-0",onError:ol}),e[4]=i,e[5]=c):c=e[5];let m;e[6]!==d?(m=n.jsx("span",{className:"truncate max-w-[180px]",children:d}),e[6]=d,e[7]=m):m=e[7];const p=l+1;let u;e[8]!==p?(u=n.jsxs("span",{className:"text-[10px] text-muted-foreground/50 tabular-nums shrink-0",children:["[",p,"]"]}),e[8]=p,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(wt,{size:10,className:"shrink-0 opacity-0 group-hover/src:opacity-100 transition-opacity"}),e[10]=f):f=e[10];let x;return e[11]!==t.url||e[12]!==c||e[13]!==m||e[14]!==u?(x=n.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group/src inline-flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:[c,m,u,f]}),e[11]=t.url,e[12]=c,e[13]=m,e[14]=u,e[15]=x):x=e[15],x}function ol(s){s.target.style.display="none"}function al(s,e){return s.replace(/\[(\d+)\]/g,(t,l)=>{const a=parseInt(l,10)-1,r=e[a];return r?`[\\[${l}\\]](${r.url})`:t})}const Pe=5;function rl(s){const e=$.c(12),{citations:t}=s,[l,a]=H.useState(!1),r=t.length>Pe;let o;e[0]!==t||e[1]!==l?(o=l?t:t.slice(0,Pe),e[0]=t,e[1]=l,e[2]=o):o=e[2];const i=o;let d;e[3]!==i?(d=i.map(cl),e[3]=i,e[4]=d):d=e[4];let c;e[5]!==t.length||e[6]!==l||e[7]!==r?(c=r&&n.jsx("button",{type:"button",onClick:()=>a(il),className:"inline-flex items-center rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:l?"show less":`+${t.length-Pe} more`}),e[5]=t.length,e[6]=l,e[7]=r,e[8]=c):c=e[8];let m;return e[9]!==d||e[10]!==c?(m=n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11],m}function il(s){return!s}function cl(s,e){return n.jsx(ll,{citation:s,index:e},s.url)}function ul(s){const e=$.c(51),{part:t,latency:l,streamingText:a}=s,r=We();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const i=o,d=t.input,c=t.output;let m,p,u;e[2]!==r||e[3]!==c?(m=c?.uri?el(c.uri,r.slug):void 0,u=He,p=me.webSearchBlob(m??""),e[2]=r,e[3]=c,e[4]=m,e[5]=p,e[6]=u):(m=e[4],p=e[5],u=e[6]);let f;e[7]!==m?(f=async()=>{const U=await fetch(m);if(!U.ok)throw new Error(`Failed to fetch: ${U.status}`);return U.text()},e[7]=m,e[8]=f):f=e[8];const x=!!m;let g;e[9]!==p||e[10]!==f||e[11]!==x?(g={queryKey:p,queryFn:f,enabled:x,staleTime:1/0},e[9]=p,e[10]=f,e[11]=x,e[12]=g):g=e[12];const{data:b}=u(g),h=i==="loading",S=i!=="loading"&&i!=="error",y=c?.citations;let v;e[13]!==c?(v=tl(c),e[13]=c,e[14]=v):v=e[14];const j=v,N=c?.content??b??a;let k;e[15]!==y||e[16]!==N?(k=N&&y?.length?al(N,y):N,e[15]=y,e[16]=N,e[17]=k):k=e[17];const _=k;let w;e[18]!==l?(w=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[18]=l,e[19]=w):w=e[19];const T=w;if(i==="error"){let U;e[20]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsx(Ie,{size:14}),e[20]=U):U=e[20];let O;return e[21]!==T||e[22]!==j?(O=n.jsx(B,{icon:U,title:"Web search",summary:"Failed",state:"error",usage:j,trailing:T}),e[21]=T,e[22]=j,e[23]=O):O=e[23],O}const I=h?"animate-pulse":"text-blue-500";let M;e[24]!==I?(M=V(I),e[24]=I,e[25]=M):M=e[25];let C;e[26]!==M?(C=n.jsx(Ie,{size:14,className:M}),e[26]=M,e[27]=C):C=e[27];const A=h?"Researching...":"Web search";let L;e[28]!==d||e[29]!==S||e[30]!==c?.model?(L=S?c?.model??d?.query?.slice(0,60):d?.query?`"${d.query.slice(0,80)}"`:void 0,e[28]=d,e[29]=S,e[30]=c?.model,e[31]=L):L=e[31];const F=h?"loading":"idle";let z;e[32]!==d?(z=d?.query&&n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:d.query}),e[32]=d,e[33]=z):z=e[33];let R;e[34]!==_||e[35]!==t.toolCallId?(R=_?n.jsx("div",{className:"max-h-96 overflow-y-auto overflow-x-hidden rounded-lg border border-border/40 bg-muted/20 px-4 py-3 min-w-0",children:n.jsx("div",{className:"prose prose-sm prose-neutral dark:prose-invert max-w-none text-[13px] leading-relaxed break-words",children:n.jsx(bt,{id:t.toolCallId,text:_})})}):n.jsx("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-4 py-3",children:n.jsxs("div",{className:"space-y-2 animate-pulse",children:[n.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-3/4"}),n.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-1/2"})]})}),e[34]=_,e[35]=t.toolCallId,e[36]=R):R=e[36];let E;e[37]!==y?(E=y&&y.length>0&&n.jsx(rl,{citations:y}),e[37]=y,e[38]=E):E=e[38];let D;e[39]!==z||e[40]!==R||e[41]!==E?(D=n.jsxs("div",{className:"pl-6 pb-3 flex flex-col gap-1 min-w-0",children:[z,R,E]}),e[39]=z,e[40]=R,e[41]=E,e[42]=D):D=e[42];let W;return e[43]!==T||e[44]!==C||e[45]!==A||e[46]!==L||e[47]!==F||e[48]!==D||e[49]!==j?(W=n.jsx(B,{icon:C,title:A,summary:L,state:F,usage:j,trailing:T,defaultOpen:!0,children:D}),e[43]=T,e[44]=C,e[45]=A,e[46]=L,e[47]=F,e[48]=D,e[49]=j,e[50]=W):W=e[50],W}function dl(s){const e=$.c(14),{part:t}=s;if(!t.state.startsWith("output-"))return null;let l;e[0]!==t.input?.prompt?(l=t.input?.prompt?.trim()||"Question",e[0]=t.input?.prompt,e[1]=l):l=e[1];const a=l,r=t.state==="output-error"||t.state==="output-denied",o=t.state==="output-denied";let i;e[2]!==o||e[3]!==t?(i=o?"Skipped":t.state==="output-error"?Le(t)??"Error":t.output?.response??"",e[2]=o,e[3]=t,e[4]=i):i=e[4];const d=i;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ms,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[5]=c):c=e[5];let m;e[6]!==a?(m=n.jsxs("div",{className:"flex items-start gap-2",children:[c,n.jsx("span",{className:"text-[14px] text-muted-foreground leading-snug",children:a})]}),e[6]=a,e[7]=m):m=e[7];let p;e[8]!==d||e[9]!==r?(p=d&&n.jsx("div",{className:"ml-6 pl-2 border-l border-border/50",children:n.jsx("span",{className:V("text-[14px] leading-snug",r?"text-muted-foreground/50 italic":"text-foreground/70"),children:d})}),e[8]=d,e[9]=r,e[10]=p):p=e[10];let u;return e[11]!==m||e[12]!==p?(u=n.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,p]}),e[11]=m,e[12]=p,e[13]=u):u=e[13],u}function fl(s){if(s&&typeof s=="object"&&!Array.isArray(s)){const e=s;if(typeof e.text=="string"||typeof e.error=="string"||typeof e.finishReason=="string"){if(typeof e.error=="string"&&e.error.length>0)return`Subtask failed: ${e.error}`;const l=typeof e.text=="string"?e.text.trim():"",a=e.finishReason==="length";return l?(a?`[Subtask hit step limit — partial result below; consider narrowing the task.]
37
37
 
38
- `:"")+l:a?"[Subtask hit step limit before producing a final report. The subagent did work but ran out of steps. Narrow the task or increase the budget.]":"Subtask completed (no output)."}}return Pn(s)}function Ot({part:s,subtaskMeta:e,latency:t}){const l=s.state==="input-streaming"||s.state==="input-available",a=s.state==="output-available"&&s.preliminary===!0,r=s.state==="output-available"&&!s.preliminary,o=s.state==="output-error",i=re(s.state,"preliminary"in s?s.preliminary:!1),d=i==="approval"?"idle":i,c=l?"Starting subtask...":a?"Subtask running...":r?"Subtask completed":o?"Subtask failed":"Subtask",m=s.input?.prompt??"",p=s.state==="approval-requested"?"Awaiting approval...":m.length>120?m.slice(0,120)+"…":m,x=(o?Le(s):fl(s.output))??(l||a?"":"No output available"),g=`# Task
38
+ `:"")+l:a?"[Subtask hit step limit before producing a final report. The subagent did work but ran out of steps. Narrow the task or increase the budget.]":"Subtask completed (no output)."}}return Fn(s)}function Ot({part:s,subtaskMeta:e,latency:t}){const l=s.state==="input-streaming"||s.state==="input-available",a=s.state==="output-available"&&s.preliminary===!0,r=s.state==="output-available"&&!s.preliminary,o=s.state==="output-error",i=re(s.state,"preliminary"in s?s.preliminary:!1),d=i==="approval"?"idle":i,c=l?"Starting subtask...":a?"Subtask running...":r?"Subtask completed":o?"Subtask failed":"Subtask",m=s.input?.prompt??"",p=s.state==="approval-requested"?"Awaiting approval...":m.length>120?m.slice(0,120)+"…":m,x=(o?Le(s):fl(s.output))??(l||a?"":"No output available"),g=`# Task
39
39
  ${s.input?.prompt??"No prompt provided"}
40
40
 
41
41
  # ${o?"Error":"Result"}
@@ -43,4 +43,4 @@ ${x}`;return{fallbackTitle:c,summary:p,usage:e?.usage,latency:t,detail:g,state:d
43
43
  `).trim().split(`
44
44
  `).filter(Boolean),v=a?y[y.length-1]??"":y[0]??"";c=!o&&v?v.length>100?v.slice(0,100)+"…":v:void 0,e[4]=o,e[5]=a,e[6]=l,e[7]=c}else c=e[7];const m=c;let p;if(e[8]!==o||e[9]!==l){const S=l.map(vo).join(`
45
45
 
46
- `);p=!o&&S.trim()?S:null,e[8]=o,e[9]=l,e[10]=p}else p=e[10];const u=p,f=!a&&t!=null?t/1e3:void 0;let x;e[11]!==a?(x=a?n.jsx(Ue,{className:"size-4"}):n.jsx(cs,{className:"size-4"}),e[11]=a,e[12]=x):x=e[12];const g=a?"Thinking...":d,b=a?"loading":"idle";let h;return e[13]!==u||e[14]!==f||e[15]!==m||e[16]!==x||e[17]!==g||e[18]!==b?(h=n.jsx(B,{icon:x,title:g,summary:m,detail:u,state:b,detailVariant:"prose",latency:f}),e[13]=u,e[14]=f,e[15]=m,e[16]=x,e[17]=g,e[18]=b,e[19]=h):h=e[19],h}function vo(s){return s.text??""}function No(s){return s.text??""}function So(s){return s.text?.includes("REDACTED")}const ko=3;function _o(s,e){let t=-1;for(let l=s.length-1;l>=0;l--){const a=s[l];if(a.kind==="part"&&e[a.index]?.type==="text"){t=l;break}}return t===-1?{collapsed:[],tail:s}:{collapsed:s.slice(0,t),tail:s.slice(t)}}function wo(s,e){let t=0,l=0;for(const a of s)if(a.kind==="reasoning-group")l++;else{const r=e[a.index]?.type;r==="text"?l++:(r==="dynamic-tool"||r?.startsWith("tool-"))&&r!=="tool-todo_write"&&r!=="tool-update_interests"&&t++}return{toolCalls:t,messages:l}}function To(s){const e=$.c(8),{toolCalls:t,messages:l}=s;let a;e[0]!==l||e[1]!==t?(a=t>0&&n.jsxs(n.Fragment,{children:[n.jsx(ps,{className:"size-3.5 shrink-0"}),n.jsxs("span",{children:[t," tool call",t===1?"":"s",l>0?",":""]})]}),e[0]=l,e[1]=t,e[2]=a):a=e[2];let r;e[3]!==l?(r=l>0&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{className:"size-3.5 shrink-0"}),n.jsxs("span",{children:[l," message",l===1?"":"s"]})]}),e[3]=l,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=n.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[a,r]}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Co(s){const e=$.c(28),{items:t,message:l,reasoningGroups:a,isReasoningActive:r,totalDuration:o,dataParts:i,isLoading:d,isLast:c}=s;let m;e[0]!==t||e[1]!==l.parts?(m=wo(t,l.parts),e[0]=t,e[1]=l.parts,e[2]=m):m=e[2];const{toolCalls:p,messages:u}=m;if(p===0&&u===0)return null;let f;e[3]!==u||e[4]!==p?(f=n.jsx(To,{toolCalls:p,messages:u}),e[3]=u,e[4]=p,e[5]=f):f=e[5];let x;if(e[6]!==i||e[7]!==c||e[8]!==d||e[9]!==r||e[10]!==t||e[11]!==l||e[12]!==a||e[13]!==o){let h;e[15]!==i||e[16]!==c||e[17]!==d||e[18]!==r||e[19]!==l||e[20]!==a||e[21]!==o?(h=(S,y)=>qt({item:S,renderIndex:y,message:l,reasoningGroups:a,isReasoningActive:r,totalDuration:o,dataParts:i,isLoading:d,isLast:c,isLastVisiblePart:!1}),e[15]=i,e[16]=c,e[17]=d,e[18]=r,e[19]=l,e[20]=a,e[21]=o,e[22]=h):h=e[22],x=t.map(h),e[6]=i,e[7]=c,e[8]=d,e[9]=r,e[10]=t,e[11]=l,e[12]=a,e[13]=o,e[14]=x}else x=e[14];let g;e[23]!==x?(g=n.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:x}),e[23]=x,e[24]=g):g=e[24];let b;return e[25]!==f||e[26]!==g?(b=n.jsx(B,{icon:null,alwaysChevron:!0,title:f,state:"idle",children:g}),e[25]=f,e[26]=g,e[27]=b):b=e[27],b}function qt({item:s,renderIndex:e,message:t,reasoningGroups:l,isReasoningActive:a,totalDuration:r,dataParts:o,isLoading:i,isLast:d,isLastVisiblePart:c,renderOrder:m}){if(s.kind==="reasoning-group"){const{group:x}=s,g=x===l[l.length-1],b=a&&g;if(!x.parts.some(y=>y.text?.trim())&&!b)return null;const S=l.length===1?r:null;return n.jsx(jo,{duration:S,parts:x.parts,isStreaming:b},`${t.id}-reasoning-${x.startIndex}`)}const p=t.parts[s.index],u=c||(m?m.findLastIndex(x=>x.kind==="part")===e:!1),f=u?Mt(It(),t.metadata?.usage):null;return n.jsx($o,{part:p,id:t.id,usageStats:u&&n.jsx(Nn,{usage:f,duration:r}),dataParts:o,isLoading:i,isLastMessage:d},`${t.id}-${s.index}`)}function $o(s){const e=$.c(121),{part:t,id:l,usageStats:a,dataParts:r,isLoading:o,isLastMessage:i}=s;let d;e[0]!==r.toolMetadata?(d=u=>r.toolMetadata.get(u),e[0]=r.toolMetadata,e[1]=d):d=e[1];const c=d;let m;e[2]!==r.toolSubtaskMetadata?(m=u=>r.toolSubtaskMetadata.get(u),e[2]=r.toolSubtaskMetadata,e[3]=m):m=e[3];const p=m;switch(t.type){case"dynamic-tool":{let u;e[4]!==c||e[5]!==t.toolCallId?(u=c(t.toolCallId)?.annotations,e[4]=c,e[5]=t.toolCallId,e[6]=u):u=e[6];let f;e[7]!==c||e[8]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[7]=c,e[8]=t.toolCallId,e[9]=f):f=e[9];let x;e[10]!==c||e[11]!==t.toolCallId?(x=c(t.toolCallId)?.outputBytes,e[10]=c,e[11]=t.toolCallId,e[12]=x):x=e[12];let g;e[13]!==c||e[14]!==t.toolCallId?(g=c(t.toolCallId)?._meta,e[13]=c,e[14]=t.toolCallId,e[15]=g):g=e[15];let b;return e[16]!==i||e[17]!==t||e[18]!==u||e[19]!==f||e[20]!==x||e[21]!==g?(b=n.jsx(st,{part:t,annotations:u,latency:f,outputBytes:x,isLastMessage:i,toolMeta:g}),e[16]=i,e[17]=t,e[18]=u,e[19]=f,e[20]=x,e[21]=g,e[22]=b):b=e[22],b}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let u;e[23]!==c||e[24]!==t.toolCallId?(u=c(t.toolCallId)?.latencySeconds,e[23]=c,e[24]=t.toolCallId,e[25]=u):u=e[25];let f;return e[26]!==t||e[27]!==u?(f=n.jsx(dl,{part:t,latency:u}),e[26]=t,e[27]=u,e[28]=f):f=e[28],f}case"tool-propose_plan":{let u;return e[29]!==t?(u=n.jsx(xl,{part:t}),e[29]=t,e[30]=u):u=e[30],u}case"tool-generate_image":{let u;e[31]!==c||e[32]!==t.toolCallId?(u=c(t.toolCallId)?.latencySeconds,e[31]=c,e[32]=t.toolCallId,e[33]=u):u=e[33];let f;return e[34]!==t||e[35]!==u?(f=n.jsx(Jn,{part:t,latency:u}),e[34]=t,e[35]=u,e[36]=f):f=e[36],f}case"tool-take_screenshot":{let u;e[37]!==c||e[38]!==t.toolCallId?(u=c(t.toolCallId)?.latencySeconds,e[37]=c,e[38]=t.toolCallId,e[39]=u):u=e[39];let f;return e[40]!==t||e[41]!==u?(f=n.jsx(Zn,{part:t,latency:u}),e[40]=t,e[41]=u,e[42]=f):f=e[42],f}case"tool-web_search":{let u;e[43]!==c||e[44]!==t.toolCallId?(u=c(t.toolCallId)?.latencySeconds,e[43]=c,e[44]=t.toolCallId,e[45]=u):u=e[45];let f;e[46]!==r.webSearchStreaming||e[47]!==t.toolCallId?(f=r.webSearchStreaming.get(t.toolCallId),e[46]=r.webSearchStreaming,e[47]=t.toolCallId,e[48]=f):f=e[48];let x;return e[49]!==t||e[50]!==u||e[51]!==f?(x=n.jsx(ul,{part:t,latency:u,streamingText:f}),e[49]=t,e[50]=u,e[51]=f,e[52]=x):x=e[52],x}case"tool-subtask":{let u;e[53]!==p||e[54]!==t.toolCallId?(u=p(t.toolCallId),e[53]=p,e[54]=t.toolCallId,e[55]=u):u=e[55];let f;e[56]!==c||e[57]!==t.toolCallId?(f=c(t.toolCallId)?.annotations,e[56]=c,e[57]=t.toolCallId,e[58]=f):f=e[58];let x;e[59]!==c||e[60]!==t.toolCallId?(x=c(t.toolCallId)?.latencySeconds,e[59]=c,e[60]=t.toolCallId,e[61]=x):x=e[61];let g;e[62]!==t||e[63]!==u||e[64]!==f||e[65]!==x?(g={part:t,subtaskMeta:u,annotations:f,latency:x},e[62]=t,e[63]=u,e[64]=f,e[65]=x,e[66]=g):g=e[66];const b=g;let h;return e[67]!==b?(h=n.jsx(H.Suspense,{fallback:n.jsx(ml,{...b}),children:n.jsx(pl,{...b})}),e[67]=b,e[68]=h):h=e[68],h}case"text":{const u=!!a&&!o,f=o&&i;let x;return e[69]!==l||e[70]!==t||e[71]!==u||e[72]!==f||e[73]!==a?(x=n.jsx(Xe,{id:l,part:t,extraActions:a,copyable:!0,alwaysShowActions:u,animate:f}),e[69]=l,e[70]=t,e[71]=u,e[72]=f,e[73]=a,e[74]=x):x=e[74],x}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const u=t;if(u.type==="tool-brand_context_setup"||u.type==="tool-BRAND_CONTEXT_EXTRACT"){let f;e[75]!==u.toolCallId||e[76]!==c?(f=c(u.toolCallId)?.latencySeconds,e[75]=u.toolCallId,e[76]=c,e[77]=f):f=e[77];let x;return e[78]!==u||e[79]!==f?(x=n.jsx(Tl,{part:u,latency:f}),e[78]=u,e[79]=f,e[80]=x):x=e[80],x}if(u.type==="tool-BRAND_CONTEXT_GET"){let f;e[81]!==u.toolCallId||e[82]!==c?(f=c(u.toolCallId)?.latencySeconds,e[81]=u.toolCallId,e[82]=c,e[83]=f):f=e[83];let x;return e[84]!==u||e[85]!==f?(x=n.jsx(Cl,{part:u,latency:f}),e[84]=u,e[85]=f,e[86]=x):x=e[86],x}if(u.type==="tool-BRAND_CONTEXT_LIST"){let f;e[87]!==u.toolCallId||e[88]!==c?(f=c(u.toolCallId)?.latencySeconds,e[87]=u.toolCallId,e[88]=c,e[89]=f):f=e[89];let x;return e[90]!==u||e[91]!==f?(x=n.jsx($l,{part:u,latency:f}),e[90]=u,e[91]=f,e[92]=x):x=e[92],x}if(u.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let f;e[93]!==u.toolCallId||e[94]!==c?(f=c(u.toolCallId)?.latencySeconds,e[93]=u.toolCallId,e[94]=c,e[95]=f):f=e[95];let x;return e[96]!==u||e[97]!==f?(x=n.jsx(El,{part:u,latency:f}),e[96]=u,e[97]=f,e[98]=x):x=e[98],x}if(u.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let f;e[99]!==u.toolCallId||e[100]!==c?(f=c(u.toolCallId)?.latencySeconds,e[99]=u.toolCallId,e[100]=c,e[101]=f):f=e[101];let x;return e[102]!==u||e[103]!==f?(x=n.jsx(Dl,{part:u,latency:f}),e[102]=u,e[103]=f,e[104]=x):x=e[104],x}if(u.type==="tool-COLLECTION_CONNECTIONS_LIST"){let f;e[105]!==u.toolCallId||e[106]!==c?(f=c(u.toolCallId)?.latencySeconds,e[105]=u.toolCallId,e[106]=c,e[107]=f):f=e[107];let x;return e[108]!==u||e[109]!==f?(x=n.jsx(Wl,{part:u,latency:f}),e[108]=u,e[109]=f,e[110]=x):x=e[110],x}if(u.type.startsWith("tool-")){const f=u.toolCallId;let x;e[111]!==r.toolMetadata||e[112]!==f?(x=r.toolMetadata.get(f),e[111]=r.toolMetadata,e[112]=f,e[113]=x):x=e[113];const g=x,b=g?.annotations,h=g?.latencySeconds,S=g?.outputBytes,y=g?._meta;let v;return e[114]!==u||e[115]!==i||e[116]!==b||e[117]!==h||e[118]!==S||e[119]!==y?(v=n.jsx(st,{part:u,annotations:b,latency:h,outputBytes:S,isLastMessage:i,toolMeta:y}),e[114]=u,e[115]=i,e[116]=b,e[117]=h,e[118]=S,e[119]=y,e[120]=v):v=e[120],v}if(u.type.startsWith("data-"))return null;throw new Error(`Unknown part type: ${u.type}`)}}}function Io(s){const e=$.c(2),{isRunInProgress:t}=s;if(t){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Ue,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),n.jsx("span",{className:"text-[14px] text-muted-foreground shimmer",children:"Resuming task..."})]})}),e[0]=a):a=e[0],a}let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"text-[14px] text-muted-foreground/60 py-2",children:"No response was generated"}),e[1]=l):l=e[1],l}function Mo(s){const e=$.c(7),{className:t,children:l}=s;let a;e[0]!==t?(a=V("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=a):a=e[1];let r;e[2]!==l?(r=n.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:n.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[14px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:l})}),e[2]=l,e[3]=r):r=e[3];let o;return e[4]!==a||e[5]!==r?(o=n.jsx("div",{className:a,children:r}),e[4]=a,e[5]=r,e[6]=o):o=e[6],o}function Ao(s){const e=$.c(42),{message:t,turnStartedAt:l,status:a,className:r,isLast:o}=s,i=o===void 0?!1:o,{isRunInProgress:d}=_e()??{},c=d===void 0?!1:d,m=Ve()?.taskId??null,p=a==="streaming",f=p||a==="submitted";let x;e[0]!==l?(x=mt(l),e[0]=l,e[1]=x):x=e[1];const g=x;let b;e[2]!==f?(b=()=>f?Date.now():null,e[2]=f,e[3]=b):b=e[3];const[h,S]=H.useState(b),[y,v]=H.useState(f);y!==f&&(v(f),S(f?Date.now():null));const j=g??h,N=t!==null&&t.parts.length>0,{reasoningGroups:k,renderOrder:_,dataParts:w}=uo(t),T=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,I=p&&T?.type==="reasoning";let M;if(e[4]!==t){const O=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,K=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;M=O!==null?K.getTime()-O.getTime():null,e[4]=t,e[5]=M}else M=e[5];const C=M;let A;e[6]!==i||e[7]!==t?(A=!i||!t||!t.parts.some(Ro),e[6]=i,e[7]=t,e[8]=A):A=e[8];const L=A;let F;e[9]!==N||e[10]!==f||e[11]!==L||e[12]!==t||e[13]!==_?(F=!f&&N&&L&&(()=>{let O=0;for(const K of _)if(K.kind==="part"){const G=t.parts[K.index]?.type;(G==="dynamic-tool"||G?.startsWith("tool-"))&&O++}return O>=ko})(),e[9]=N,e[10]=f,e[11]=L,e[12]=t,e[13]=_,e[14]=F):F=e[14];const z=F;let R,E,D;if(e[15]!==r||e[16]!==w||e[17]!==N||e[18]!==i||e[19]!==f||e[20]!==I||e[21]!==c||e[22]!==L||e[23]!==t||e[24]!==k||e[25]!==_||e[26]!==z||e[27]!==j||e[28]!==m||e[29]!==C){const{collapsed:O,tail:K}=z?_o(_,t.parts):{collapsed:[],tail:_};R=Mo,E=r,D=N?n.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[O.length>0&&n.jsx(Co,{items:O,message:t,reasoningGroups:k,isReasoningActive:I,totalDuration:C,dataParts:w,isLoading:f,isLast:i}),K.map((G,Y)=>{const Q=O.length+Y,te=K.findLastIndex(Lo)===Y;return qt({item:G,renderIndex:Q,message:t,reasoningGroups:k,isReasoningActive:I,totalDuration:C,dataParts:w,isLoading:f,isLast:i,isLastVisiblePart:te,renderOrder:_})}),m&&n.jsx(ro,{threadId:m,message:t}),i&&f&&j!==null&&n.jsx(ho,{startedAt:j}),i&&!f&&m&&n.jsxs(n.Fragment,{children:[n.jsx(Ql,{}),L&&n.jsx(Vl,{})]})]}):f?n.jsx(yo,{startedAt:j}):n.jsx(Io,{isRunInProgress:i&&c}),e[15]=r,e[16]=w,e[17]=N,e[18]=i,e[19]=f,e[20]=I,e[21]=c,e[22]=L,e[23]=t,e[24]=k,e[25]=_,e[26]=z,e[27]=j,e[28]=m,e[29]=C,e[30]=R,e[31]=E,e[32]=D}else R=e[30],E=e[31],D=e[32];let W;e[33]!==i||e[34]!==p||e[35]!==t?.parts?(W=i&&p&&n.jsx(Xl,{parts:t?.parts}),e[33]=i,e[34]=p,e[35]=t?.parts,e[36]=W):W=e[36];let U;return e[37]!==R||e[38]!==W||e[39]!==E||e[40]!==D?(U=n.jsxs(R,{className:E,children:[D,W]}),e[37]=R,e[38]=W,e[39]=E,e[40]=D,e[41]=U):U=e[41],U}function Lo(s){return s.kind==="part"}function Ro(s){const e=s.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=s.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function Eo(s){const e=$.c(21),{event:t}=s,[l,a]=H.useState(!1);let r;e[0]!==t.data?(r=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=r):r=e[1];const o=r;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>a(zo),e[2]=i):i=e[2];let d,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(fs,{className:"size-4 shrink-0 text-muted-foreground"}),c=n.jsx("span",{className:"font-medium",children:"Triggered by event"}),e[3]=d,e[4]=c):(d=e[3],c=e[4]);let m;e[5]!==t.type?(m=n.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[5]=t.type,e[6]=m):m=e[6];const p=l&&"rotate-180";let u;e[7]!==p?(u=V("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",p),e[7]=p,e[8]=u):u=e[8];let f;e[9]!==u?(f=n.jsx(an,{className:u}),e[9]=u,e[10]=f):f=e[10];let x;e[11]!==m||e[12]!==f?(x=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[d,c,m,f]}),e[11]=m,e[12]=f,e[13]=x):x=e[13];let g;e[14]!==t.source||e[15]!==l||e[16]!==o?(g=l&&n.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[n.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),n.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:o})]}),e[14]=t.source,e[15]=l,e[16]=o,e[17]=g):g=e[17];let b;return e[18]!==g||e[19]!==x?(b=n.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[x,g]}),e[18]=g,e[19]=x,e[20]=b):b=e[20],b}function zo(s){return!s}const Po=[js.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),gn,jn];function Fo(s){const e=$.c(5),{tiptapDoc:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=l):l=e[0];let a;e[1]!==t?(a={extensions:Po,content:t,editable:!1,editorProps:l},e[1]=t,e[2]=a):a=e[2];const r=ys(a);if(!r)return null;let o;return e[3]!==r?(o=n.jsx(vs,{editor:r,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=r,e[4]=o):o=e[4],o}function Do(s){const e=$.c(33),{message:t,className:l,onScrollToPair:a}=s,{id:r,parts:o,metadata:i}=t,[d,c]=H.useState(!1),[m,p]=H.useState(!1),u=H.useRef(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=C=>{C&&!u.current&&(u.current=!0,p(C.scrollHeight>C.clientHeight))},e[0]=f):f=e[0];const x=f;if(!o||o.length===0)return null;let g;e[1]!==a?(g=()=>{c(!0),a?.()},e[1]=a,e[2]=g):g=e[2];const b=g,h=i?.tiptapDoc;let S;e[3]!==l?(S=V("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",l),e[3]=l,e[4]=S):S=e[4];let y,v;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>c(!0),v=()=>c(!1),e[5]=y,e[6]=v):(y=e[5],v=e[6]);let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=j):j=e[7];let N;e[8]!==d||e[9]!==m?(N=V("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",d?"max-h-[50vh] overflow-auto opacity-100":V("max-h-[84px] overflow-hidden opacity-99",m&&"mask-b-from-1%")),e[8]=d,e[9]=m,e[10]=N):N=e[10];let k;if(e[11]!==r||e[12]!==o){let C;e[14]!==r?(C=(A,L)=>A.type==="data-trigger-event"?n.jsx(Eo,{event:A.data},`${r}-${L}`):null,e[14]=r,e[15]=C):C=e[15],k=o.map(C),e[11]=r,e[12]=o,e[13]=k}else k=e[13];let _;e[16]!==h||e[17]!==r||e[18]!==i||e[19]!==o?(_=h?n.jsx(Fo,{tiptapDoc:i.tiptapDoc}):o.map((C,A)=>C.type==="text"?o[A-1]?.type==="data-trigger-event"?null:n.jsx(Xe,{id:r,part:C},`${r}-${A}`):null),e[16]=h,e[17]=r,e[18]=i,e[19]=o,e[20]=_):_=e[20];let w;e[21]!==k||e[22]!==_?(w=n.jsxs("div",{className:"flex flex-col gap-2",children:[k,_]}),e[21]=k,e[22]=_,e[23]=w):w=e[23];let T;e[24]!==w||e[25]!==N?(T=n.jsx("div",{ref:x,className:N,children:w}),e[24]=w,e[25]=N,e[26]=T):T=e[26];let I;e[27]!==b||e[28]!==T?(I=n.jsxs("div",{tabIndex:0,onClick:b,onFocus:y,onBlur:v,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-[14px] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[j,T]}),e[27]=b,e[28]=T,e[29]=I):I=e[29];let M;return e[30]!==I||e[31]!==S?(M=n.jsx(n.Fragment,{children:n.jsx("div",{className:S,children:I})}),e[30]=I,e[31]=S,e[32]=M):M=e[32],M}function Ra(s){const e=[],t=s.filter(l=>l.role!=="system");for(let l=0;l<t.length;l++){const a=t[l];if(a)if(a.role==="user"){const r=t[l+1];r&&r.role==="assistant"?(e.push({user:a,assistant:r}),l++):e.push({user:a,assistant:null})}else a.role==="assistant"&&e.push({user:null,assistant:a})}return e}function Ea(s){const e=$.c(18),{pair:t,isLastPair:l,status:a}=s,r=H.useRef(null),o=H.useRef(!1);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{r.current&&r.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=i):i=e[0];const d=i;let c;e[1]!==l||e[2]!==a?(c=h=>{if(r.current=h,!l||!h||o.current)return;if(o.current=!0,a==="submitted"||a==="streaming"){h.scrollIntoView({behavior:"smooth",block:"start"});return}const S=h.closest("[data-chat-scroller]");S?S.scrollTop=S.scrollHeight:h.scrollIntoView({behavior:"instant",block:"start"})},e[1]=l,e[2]=a,e[3]=c):c=e[3];const m=c,p=!t.user&&"pt-8 sm:pt-6";let u;e[4]!==p?(u=V("flex flex-col pb-2 sm:pb-2",p),e[4]=p,e[5]=u):u=e[5];let f;e[6]!==t.user?(f=t.user&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),n.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:n.jsx(Do,{message:t.user,onScrollToPair:d})})]}),e[6]=t.user,e[7]=f):f=e[7];const x=t.user?.created_at??null;let g;e[8]!==l||e[9]!==t.assistant||e[10]!==a||e[11]!==x?(g=n.jsx(Ao,{message:t.assistant,turnStartedAt:x,status:a,isLast:l}),e[8]=l,e[9]=t.assistant,e[10]=a,e[11]=x,e[12]=g):g=e[12];let b;return e[13]!==m||e[14]!==u||e[15]!==f||e[16]!==g?(b=n.jsxs("div",{ref:m,className:u,children:[f,g]}),e[13]=m,e[14]=u,e[15]=f,e[16]=g,e[17]=b):b=e[17],b}export{Sn as C,jn as F,fo as G,Xe as M,lo as O,mn as P,Aa as S,no as a,kn as b,$a as c,_n as d,Lt as e,un as f,Ge as g,Rt as h,Ma as i,Ia as j,pn as k,gn as l,Ra as m,Ea as n,Ke as s,At as t,La as u};
46
+ `);p=!o&&S.trim()?S:null,e[8]=o,e[9]=l,e[10]=p}else p=e[10];const u=p,f=!a&&t!=null?t/1e3:void 0;let x;e[11]!==a?(x=a?n.jsx(Ue,{className:"size-4"}):n.jsx(cs,{className:"size-4"}),e[11]=a,e[12]=x):x=e[12];const g=a?"Thinking...":d,b=a?"loading":"idle";let h;return e[13]!==u||e[14]!==f||e[15]!==m||e[16]!==x||e[17]!==g||e[18]!==b?(h=n.jsx(B,{icon:x,title:g,summary:m,detail:u,state:b,detailVariant:"prose",latency:f}),e[13]=u,e[14]=f,e[15]=m,e[16]=x,e[17]=g,e[18]=b,e[19]=h):h=e[19],h}function vo(s){return s.text??""}function No(s){return s.text??""}function So(s){return s.text?.includes("REDACTED")}const ko=3;function _o(s,e){let t=-1;for(let l=s.length-1;l>=0;l--){const a=s[l];if(a.kind==="part"&&e[a.index]?.type==="text"){t=l;break}}return t===-1?{collapsed:[],tail:s}:{collapsed:s.slice(0,t),tail:s.slice(t)}}function wo(s,e){let t=0,l=0;for(const a of s)if(a.kind==="reasoning-group")l++;else{const r=e[a.index]?.type;r==="text"?l++:(r==="dynamic-tool"||r?.startsWith("tool-"))&&r!=="tool-todo_write"&&r!=="tool-update_interests"&&t++}return{toolCalls:t,messages:l}}function To(s){const e=$.c(8),{toolCalls:t,messages:l}=s;let a;e[0]!==l||e[1]!==t?(a=t>0&&n.jsxs(n.Fragment,{children:[n.jsx(ps,{className:"size-3.5 shrink-0"}),n.jsxs("span",{children:[t," tool call",t===1?"":"s",l>0?",":""]})]}),e[0]=l,e[1]=t,e[2]=a):a=e[2];let r;e[3]!==l?(r=l>0&&n.jsxs(n.Fragment,{children:[n.jsx(ds,{className:"size-3.5 shrink-0"}),n.jsxs("span",{children:[l," message",l===1?"":"s"]})]}),e[3]=l,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=n.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[a,r]}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function Co(s){const e=$.c(28),{items:t,message:l,reasoningGroups:a,isReasoningActive:r,totalDuration:o,dataParts:i,isLoading:d,isLast:c}=s;let m;e[0]!==t||e[1]!==l.parts?(m=wo(t,l.parts),e[0]=t,e[1]=l.parts,e[2]=m):m=e[2];const{toolCalls:p,messages:u}=m;if(p===0&&u===0)return null;let f;e[3]!==u||e[4]!==p?(f=n.jsx(To,{toolCalls:p,messages:u}),e[3]=u,e[4]=p,e[5]=f):f=e[5];let x;if(e[6]!==i||e[7]!==c||e[8]!==d||e[9]!==r||e[10]!==t||e[11]!==l||e[12]!==a||e[13]!==o){let h;e[15]!==i||e[16]!==c||e[17]!==d||e[18]!==r||e[19]!==l||e[20]!==a||e[21]!==o?(h=(S,y)=>qt({item:S,renderIndex:y,message:l,reasoningGroups:a,isReasoningActive:r,totalDuration:o,dataParts:i,isLoading:d,isLast:c,isLastVisiblePart:!1}),e[15]=i,e[16]=c,e[17]=d,e[18]=r,e[19]=l,e[20]=a,e[21]=o,e[22]=h):h=e[22],x=t.map(h),e[6]=i,e[7]=c,e[8]=d,e[9]=r,e[10]=t,e[11]=l,e[12]=a,e[13]=o,e[14]=x}else x=e[14];let g;e[23]!==x?(g=n.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:x}),e[23]=x,e[24]=g):g=e[24];let b;return e[25]!==f||e[26]!==g?(b=n.jsx(B,{icon:null,alwaysChevron:!0,title:f,state:"idle",children:g}),e[25]=f,e[26]=g,e[27]=b):b=e[27],b}function qt({item:s,renderIndex:e,message:t,reasoningGroups:l,isReasoningActive:a,totalDuration:r,dataParts:o,isLoading:i,isLast:d,isLastVisiblePart:c,renderOrder:m}){if(s.kind==="reasoning-group"){const{group:x}=s,g=x===l[l.length-1],b=a&&g;if(!x.parts.some(y=>y.text?.trim())&&!b)return null;const S=l.length===1?r:null;return n.jsx(jo,{duration:S,parts:x.parts,isStreaming:b},`${t.id}-reasoning-${x.startIndex}`)}const p=t.parts[s.index],u=c||(m?m.findLastIndex(x=>x.kind==="part")===e:!1),f=u?Mt(It(),t.metadata?.usage):null;return n.jsx($o,{part:p,id:t.id,usageStats:u&&n.jsx(Nn,{usage:f,duration:r}),dataParts:o,isLoading:i,isLastMessage:d},`${t.id}-${s.index}`)}function $o(s){const e=$.c(121),{part:t,id:l,usageStats:a,dataParts:r,isLoading:o,isLastMessage:i}=s;let d;e[0]!==r.toolMetadata?(d=u=>r.toolMetadata.get(u),e[0]=r.toolMetadata,e[1]=d):d=e[1];const c=d;let m;e[2]!==r.toolSubtaskMetadata?(m=u=>r.toolSubtaskMetadata.get(u),e[2]=r.toolSubtaskMetadata,e[3]=m):m=e[3];const p=m;switch(t.type){case"dynamic-tool":{let u;e[4]!==c||e[5]!==t.toolCallId?(u=c(t.toolCallId)?.annotations,e[4]=c,e[5]=t.toolCallId,e[6]=u):u=e[6];let f;e[7]!==c||e[8]!==t.toolCallId?(f=c(t.toolCallId)?.latencySeconds,e[7]=c,e[8]=t.toolCallId,e[9]=f):f=e[9];let x;e[10]!==c||e[11]!==t.toolCallId?(x=c(t.toolCallId)?.outputBytes,e[10]=c,e[11]=t.toolCallId,e[12]=x):x=e[12];let g;e[13]!==c||e[14]!==t.toolCallId?(g=c(t.toolCallId)?._meta,e[13]=c,e[14]=t.toolCallId,e[15]=g):g=e[15];let b;return e[16]!==i||e[17]!==t||e[18]!==u||e[19]!==f||e[20]!==x||e[21]!==g?(b=n.jsx(st,{part:t,annotations:u,latency:f,outputBytes:x,isLastMessage:i,toolMeta:g}),e[16]=i,e[17]=t,e[18]=u,e[19]=f,e[20]=x,e[21]=g,e[22]=b):b=e[22],b}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let u;e[23]!==c||e[24]!==t.toolCallId?(u=c(t.toolCallId)?.latencySeconds,e[23]=c,e[24]=t.toolCallId,e[25]=u):u=e[25];let f;return e[26]!==t||e[27]!==u?(f=n.jsx(dl,{part:t,latency:u}),e[26]=t,e[27]=u,e[28]=f):f=e[28],f}case"tool-propose_plan":{let u;return e[29]!==t?(u=n.jsx(xl,{part:t}),e[29]=t,e[30]=u):u=e[30],u}case"tool-generate_image":{let u;e[31]!==c||e[32]!==t.toolCallId?(u=c(t.toolCallId)?.latencySeconds,e[31]=c,e[32]=t.toolCallId,e[33]=u):u=e[33];let f;return e[34]!==t||e[35]!==u?(f=n.jsx(Jn,{part:t,latency:u}),e[34]=t,e[35]=u,e[36]=f):f=e[36],f}case"tool-take_screenshot":{let u;e[37]!==c||e[38]!==t.toolCallId?(u=c(t.toolCallId)?.latencySeconds,e[37]=c,e[38]=t.toolCallId,e[39]=u):u=e[39];let f;return e[40]!==t||e[41]!==u?(f=n.jsx(Zn,{part:t,latency:u}),e[40]=t,e[41]=u,e[42]=f):f=e[42],f}case"tool-web_search":{let u;e[43]!==c||e[44]!==t.toolCallId?(u=c(t.toolCallId)?.latencySeconds,e[43]=c,e[44]=t.toolCallId,e[45]=u):u=e[45];let f;e[46]!==r.webSearchStreaming||e[47]!==t.toolCallId?(f=r.webSearchStreaming.get(t.toolCallId),e[46]=r.webSearchStreaming,e[47]=t.toolCallId,e[48]=f):f=e[48];let x;return e[49]!==t||e[50]!==u||e[51]!==f?(x=n.jsx(ul,{part:t,latency:u,streamingText:f}),e[49]=t,e[50]=u,e[51]=f,e[52]=x):x=e[52],x}case"tool-subtask":{let u;e[53]!==p||e[54]!==t.toolCallId?(u=p(t.toolCallId),e[53]=p,e[54]=t.toolCallId,e[55]=u):u=e[55];let f;e[56]!==c||e[57]!==t.toolCallId?(f=c(t.toolCallId)?.annotations,e[56]=c,e[57]=t.toolCallId,e[58]=f):f=e[58];let x;e[59]!==c||e[60]!==t.toolCallId?(x=c(t.toolCallId)?.latencySeconds,e[59]=c,e[60]=t.toolCallId,e[61]=x):x=e[61];let g;e[62]!==t||e[63]!==u||e[64]!==f||e[65]!==x?(g={part:t,subtaskMeta:u,annotations:f,latency:x},e[62]=t,e[63]=u,e[64]=f,e[65]=x,e[66]=g):g=e[66];const b=g;let h;return e[67]!==b?(h=n.jsx(H.Suspense,{fallback:n.jsx(ml,{...b}),children:n.jsx(pl,{...b})}),e[67]=b,e[68]=h):h=e[68],h}case"text":{const u=!!a&&!o,f=o&&i;let x;return e[69]!==l||e[70]!==t||e[71]!==u||e[72]!==f||e[73]!==a?(x=n.jsx(Xe,{id:l,part:t,extraActions:a,copyable:!0,alwaysShowActions:u,animate:f}),e[69]=l,e[70]=t,e[71]=u,e[72]=f,e[73]=a,e[74]=x):x=e[74],x}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const u=t;if(u.type==="tool-brand_context_setup"||u.type==="tool-BRAND_CONTEXT_EXTRACT"){let f;e[75]!==u.toolCallId||e[76]!==c?(f=c(u.toolCallId)?.latencySeconds,e[75]=u.toolCallId,e[76]=c,e[77]=f):f=e[77];let x;return e[78]!==u||e[79]!==f?(x=n.jsx(Tl,{part:u,latency:f}),e[78]=u,e[79]=f,e[80]=x):x=e[80],x}if(u.type==="tool-BRAND_CONTEXT_GET"){let f;e[81]!==u.toolCallId||e[82]!==c?(f=c(u.toolCallId)?.latencySeconds,e[81]=u.toolCallId,e[82]=c,e[83]=f):f=e[83];let x;return e[84]!==u||e[85]!==f?(x=n.jsx(Cl,{part:u,latency:f}),e[84]=u,e[85]=f,e[86]=x):x=e[86],x}if(u.type==="tool-BRAND_CONTEXT_LIST"){let f;e[87]!==u.toolCallId||e[88]!==c?(f=c(u.toolCallId)?.latencySeconds,e[87]=u.toolCallId,e[88]=c,e[89]=f):f=e[89];let x;return e[90]!==u||e[91]!==f?(x=n.jsx($l,{part:u,latency:f}),e[90]=u,e[91]=f,e[92]=x):x=e[92],x}if(u.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let f;e[93]!==u.toolCallId||e[94]!==c?(f=c(u.toolCallId)?.latencySeconds,e[93]=u.toolCallId,e[94]=c,e[95]=f):f=e[95];let x;return e[96]!==u||e[97]!==f?(x=n.jsx(El,{part:u,latency:f}),e[96]=u,e[97]=f,e[98]=x):x=e[98],x}if(u.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let f;e[99]!==u.toolCallId||e[100]!==c?(f=c(u.toolCallId)?.latencySeconds,e[99]=u.toolCallId,e[100]=c,e[101]=f):f=e[101];let x;return e[102]!==u||e[103]!==f?(x=n.jsx(Dl,{part:u,latency:f}),e[102]=u,e[103]=f,e[104]=x):x=e[104],x}if(u.type==="tool-COLLECTION_CONNECTIONS_LIST"){let f;e[105]!==u.toolCallId||e[106]!==c?(f=c(u.toolCallId)?.latencySeconds,e[105]=u.toolCallId,e[106]=c,e[107]=f):f=e[107];let x;return e[108]!==u||e[109]!==f?(x=n.jsx(Wl,{part:u,latency:f}),e[108]=u,e[109]=f,e[110]=x):x=e[110],x}if(u.type.startsWith("tool-")){const f=u.toolCallId;let x;e[111]!==r.toolMetadata||e[112]!==f?(x=r.toolMetadata.get(f),e[111]=r.toolMetadata,e[112]=f,e[113]=x):x=e[113];const g=x,b=g?.annotations,h=g?.latencySeconds,S=g?.outputBytes,y=g?._meta;let v;return e[114]!==u||e[115]!==i||e[116]!==b||e[117]!==h||e[118]!==S||e[119]!==y?(v=n.jsx(st,{part:u,annotations:b,latency:h,outputBytes:S,isLastMessage:i,toolMeta:y}),e[114]=u,e[115]=i,e[116]=b,e[117]=h,e[118]=S,e[119]=y,e[120]=v):v=e[120],v}if(u.type.startsWith("data-"))return null;throw new Error(`Unknown part type: ${u.type}`)}}}function Io(s){const e=$.c(2),{isRunInProgress:t}=s;if(t){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Ue,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),n.jsx("span",{className:"text-[14px] text-muted-foreground shimmer",children:"Resuming task..."})]})}),e[0]=a):a=e[0],a}let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"text-[14px] text-muted-foreground/60 py-2",children:"No response was generated"}),e[1]=l):l=e[1],l}function Mo(s){const e=$.c(7),{className:t,children:l}=s;let a;e[0]!==t?(a=V("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=a):a=e[1];let r;e[2]!==l?(r=n.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:n.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[14px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:l})}),e[2]=l,e[3]=r):r=e[3];let o;return e[4]!==a||e[5]!==r?(o=n.jsx("div",{className:a,children:r}),e[4]=a,e[5]=r,e[6]=o):o=e[6],o}function Ao(s){const e=$.c(42),{message:t,turnStartedAt:l,status:a,className:r,isLast:o}=s,i=o===void 0?!1:o,{isRunInProgress:d}=_e()??{},c=d===void 0?!1:d,m=Ve()?.taskId??null,p=a==="streaming",f=p||a==="submitted";let x;e[0]!==l?(x=mt(l),e[0]=l,e[1]=x):x=e[1];const g=x;let b;e[2]!==f?(b=()=>f?Date.now():null,e[2]=f,e[3]=b):b=e[3];const[h,S]=H.useState(b),[y,v]=H.useState(f);y!==f&&(v(f),S(f?Date.now():null));const j=g??h,N=t!==null&&t.parts.length>0,{reasoningGroups:k,renderOrder:_,dataParts:w}=uo(t),T=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,I=p&&T?.type==="reasoning";let M;if(e[4]!==t){const O=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,K=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;M=O!==null?K.getTime()-O.getTime():null,e[4]=t,e[5]=M}else M=e[5];const C=M;let A;e[6]!==i||e[7]!==t?(A=!i||!t||!t.parts.some(Ro),e[6]=i,e[7]=t,e[8]=A):A=e[8];const L=A;let F;e[9]!==N||e[10]!==f||e[11]!==L||e[12]!==t||e[13]!==_?(F=!f&&N&&L&&(()=>{let O=0;for(const K of _)if(K.kind==="part"){const G=t.parts[K.index]?.type;(G==="dynamic-tool"||G?.startsWith("tool-"))&&O++}return O>=ko})(),e[9]=N,e[10]=f,e[11]=L,e[12]=t,e[13]=_,e[14]=F):F=e[14];const z=F;let R,E,D;if(e[15]!==r||e[16]!==w||e[17]!==N||e[18]!==i||e[19]!==f||e[20]!==I||e[21]!==c||e[22]!==L||e[23]!==t||e[24]!==k||e[25]!==_||e[26]!==z||e[27]!==j||e[28]!==m||e[29]!==C){const{collapsed:O,tail:K}=z?_o(_,t.parts):{collapsed:[],tail:_};R=Mo,E=r,D=N?n.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[O.length>0&&n.jsx(Co,{items:O,message:t,reasoningGroups:k,isReasoningActive:I,totalDuration:C,dataParts:w,isLoading:f,isLast:i}),K.map((G,Y)=>{const Q=O.length+Y,te=K.findLastIndex(Lo)===Y;return qt({item:G,renderIndex:Q,message:t,reasoningGroups:k,isReasoningActive:I,totalDuration:C,dataParts:w,isLoading:f,isLast:i,isLastVisiblePart:te,renderOrder:_})}),m&&n.jsx(ro,{threadId:m,message:t}),i&&f&&j!==null&&n.jsx(ho,{startedAt:j}),i&&!f&&m&&n.jsxs(n.Fragment,{children:[n.jsx(Ql,{}),L&&n.jsx(Vl,{})]})]}):f?n.jsx(yo,{startedAt:j}):n.jsx(Io,{isRunInProgress:i&&c}),e[15]=r,e[16]=w,e[17]=N,e[18]=i,e[19]=f,e[20]=I,e[21]=c,e[22]=L,e[23]=t,e[24]=k,e[25]=_,e[26]=z,e[27]=j,e[28]=m,e[29]=C,e[30]=R,e[31]=E,e[32]=D}else R=e[30],E=e[31],D=e[32];let W;e[33]!==i||e[34]!==p||e[35]!==t?.parts?(W=i&&p&&n.jsx(Xl,{parts:t?.parts}),e[33]=i,e[34]=p,e[35]=t?.parts,e[36]=W):W=e[36];let U;return e[37]!==R||e[38]!==W||e[39]!==E||e[40]!==D?(U=n.jsxs(R,{className:E,children:[D,W]}),e[37]=R,e[38]=W,e[39]=E,e[40]=D,e[41]=U):U=e[41],U}function Lo(s){return s.kind==="part"}function Ro(s){const e=s.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=s.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function Eo(s){const e=$.c(21),{event:t}=s,[l,a]=H.useState(!1);let r;e[0]!==t.data?(r=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=r):r=e[1];const o=r;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>a(zo),e[2]=i):i=e[2];let d,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(fs,{className:"size-4 shrink-0 text-muted-foreground"}),c=n.jsx("span",{className:"font-medium",children:"Triggered by event"}),e[3]=d,e[4]=c):(d=e[3],c=e[4]);let m;e[5]!==t.type?(m=n.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[5]=t.type,e[6]=m):m=e[6];const p=l&&"rotate-180";let u;e[7]!==p?(u=V("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",p),e[7]=p,e[8]=u):u=e[8];let f;e[9]!==u?(f=n.jsx(an,{className:u}),e[9]=u,e[10]=f):f=e[10];let x;e[11]!==m||e[12]!==f?(x=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[d,c,m,f]}),e[11]=m,e[12]=f,e[13]=x):x=e[13];let g;e[14]!==t.source||e[15]!==l||e[16]!==o?(g=l&&n.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[n.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),n.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:o})]}),e[14]=t.source,e[15]=l,e[16]=o,e[17]=g):g=e[17];let b;return e[18]!==g||e[19]!==x?(b=n.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[x,g]}),e[18]=g,e[19]=x,e[20]=b):b=e[20],b}function zo(s){return!s}const Po=[js.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),gn,jn];function Fo(s){const e=$.c(5),{tiptapDoc:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=l):l=e[0];let a;e[1]!==t?(a={extensions:Po,content:t,editable:!1,editorProps:l},e[1]=t,e[2]=a):a=e[2];const r=ys(a);if(!r)return null;let o;return e[3]!==r?(o=n.jsx(vs,{editor:r,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=r,e[4]=o):o=e[4],o}function Do(s){const e=$.c(33),{message:t,className:l,onScrollToPair:a}=s,{id:r,parts:o,metadata:i}=t,[d,c]=H.useState(!1),[m,p]=H.useState(!1),u=H.useRef(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=C=>{C&&!u.current&&(u.current=!0,p(C.scrollHeight>C.clientHeight))},e[0]=f):f=e[0];const x=f;if(!o||o.length===0)return null;let g;e[1]!==a?(g=()=>{c(!0),a?.()},e[1]=a,e[2]=g):g=e[2];const b=g,h=i?.tiptapDoc;let S;e[3]!==l?(S=V("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",l),e[3]=l,e[4]=S):S=e[4];let y,v;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>c(!0),v=()=>c(!1),e[5]=y,e[6]=v):(y=e[5],v=e[6]);let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=j):j=e[7];let N;e[8]!==d||e[9]!==m?(N=V("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",d?"max-h-[50vh] overflow-auto opacity-100":V("max-h-[84px] overflow-hidden opacity-99",m&&"mask-b-from-1%")),e[8]=d,e[9]=m,e[10]=N):N=e[10];let k;if(e[11]!==r||e[12]!==o){let C;e[14]!==r?(C=(A,L)=>A.type==="data-trigger-event"?n.jsx(Eo,{event:A.data},`${r}-${L}`):null,e[14]=r,e[15]=C):C=e[15],k=o.map(C),e[11]=r,e[12]=o,e[13]=k}else k=e[13];let _;e[16]!==h||e[17]!==r||e[18]!==i||e[19]!==o?(_=h?n.jsx(Fo,{tiptapDoc:i.tiptapDoc}):o.map((C,A)=>C.type==="text"?o[A-1]?.type==="data-trigger-event"?null:n.jsx(Xe,{id:r,part:C},`${r}-${A}`):null),e[16]=h,e[17]=r,e[18]=i,e[19]=o,e[20]=_):_=e[20];let w;e[21]!==k||e[22]!==_?(w=n.jsxs("div",{className:"flex flex-col gap-2",children:[k,_]}),e[21]=k,e[22]=_,e[23]=w):w=e[23];let T;e[24]!==w||e[25]!==N?(T=n.jsx("div",{ref:x,className:N,children:w}),e[24]=w,e[25]=N,e[26]=T):T=e[26];let I;e[27]!==b||e[28]!==T?(I=n.jsxs("div",{tabIndex:0,onClick:b,onFocus:y,onBlur:v,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-[14px] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[j,T]}),e[27]=b,e[28]=T,e[29]=I):I=e[29];let M;return e[30]!==I||e[31]!==S?(M=n.jsx(n.Fragment,{children:n.jsx("div",{className:S,children:I})}),e[30]=I,e[31]=S,e[32]=M):M=e[32],M}function Ra(s){const e=[],t=s.filter(l=>l.role!=="system");for(let l=0;l<t.length;l++){const a=t[l];if(a)if(a.role==="user"){const r=t[l+1];r&&r.role==="assistant"?(e.push({user:a,assistant:r}),l++):e.push({user:a,assistant:null})}else a.role==="assistant"&&e.push({user:null,assistant:a})}return e}function Ea(s){const e=$.c(18),{pair:t,isLastPair:l,status:a}=s,r=H.useRef(null),o=H.useRef(!1);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{r.current&&r.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=i):i=e[0];const d=i;let c;e[1]!==l||e[2]!==a?(c=h=>{if(r.current=h,!l||!h||o.current)return;if(o.current=!0,a==="submitted"||a==="streaming"){h.scrollIntoView({behavior:"smooth",block:"start"});return}const S=h.closest("[data-chat-scroller]");S?S.scrollTop=S.scrollHeight:h.scrollIntoView({behavior:"instant",block:"start"})},e[1]=l,e[2]=a,e[3]=c):c=e[3];const m=c,p=!t.user&&"pt-8 sm:pt-6";let u;e[4]!==p?(u=V("flex flex-col pb-2 sm:pb-2",p),e[4]=p,e[5]=u):u=e[5];let f;e[6]!==t.user?(f=t.user&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),n.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:n.jsx(Do,{message:t.user,onScrollToPair:d})})]}),e[6]=t.user,e[7]=f):f=e[7];const x=t.user?.created_at??null;let g;e[8]!==l||e[9]!==t.assistant||e[10]!==a||e[11]!==x?(g=n.jsx(Ao,{message:t.assistant,turnStartedAt:x,status:a,isLast:l}),e[8]=l,e[9]=t.assistant,e[10]=a,e[11]=x,e[12]=g):g=e[12];let b;return e[13]!==m||e[14]!==u||e[15]!==f||e[16]!==g?(b=n.jsxs("div",{ref:m,className:u,children:[f,g]}),e[13]=m,e[14]=u,e[15]=f,e[16]=g,e[17]=b):b=e[17],b}export{Sn as C,jn as F,fo as G,Xe as M,lo as O,mn as P,Aa as S,no as a,kn as b,$a as c,_n as d,Lt as e,un as f,Ge as g,Rt as h,Ma as i,Ia as j,pn as k,gn as l,Ra as m,Ea as n,Tn as o,Ke as s,At as t,La as u};
@@ -1 +1 @@
1
- import{e as o,j as t,dz as n}from"./index-BjoOIgbb.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
1
+ import{e as o,j as t,dz as n}from"./index-DjCrtoJM.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
@@ -1 +1 @@
1
- import{e as S,j as s,r as w,dz as y}from"./index-BjoOIgbb.js";import{i as R}from"./Check-DCDpfG7m.js";import{t as _}from"./ChevronDown-BD0G-h2k.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:z}=x,[r,N]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||N(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>N(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==z||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{z(t.id),N(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=z,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function $(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{$ as default};
1
+ import{e as S,j as s,r as w,dz as y}from"./index-DjCrtoJM.js";import{i as R}from"./Check-CkY-NLLZ.js";import{t as _}from"./ChevronDown-B8XrNXeE.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:z}=x,[r,N]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||N(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>N(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==z||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{z(t.id),N(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=z,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function $(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{$ as default};
@@ -1 +1 @@
1
- import{r as F,e as V,j as s,q as W,f as X,g as Z,d as ee,b as te,K as ne,n as se,O as ie,l as oe,B as le}from"./index-BjoOIgbb.js";import{u as re}from"./use-connection-NiFefepq.js";import{j as ae}from"./use-mcp-client-B46VYAN_.js";import{u as ce}from"./studio-tools-DfxdEEgB.js";import{a as ue}from"./Settings02-Cqwfv4FN.js";import{P as B}from"./index-M8U0QO9V.js";const de=F.createContext(null);function K(i){const e=V.c(3),{value:C,children:m}=i,t=C;let o;return e[0]!==m||e[1]!==t?(o=s.jsx(de.Provider,{value:t,children:m}),e[0]=m,e[1]=t,e[2]=o):o=e[2],o}F.createContext(null);function me(i){return{id:i.id,title:i.title,icon:i.icon,description:i.description,app_name:i.app_name,app_id:i.app_id,tools:i.tools,metadata:i.metadata}}function Pe(i){const e=V.c(57),{bindingName:C,renderEmptyState:m}=i,{org:t,project:o}=W(),M=X();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={strict:!1},e[0]=j):j=e[0];const{org:T,taskId:k,pluginId:f}=Z(j);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={strict:!1},e[1]=v):v=e[1];const w=ee(v).virtualmcpid;let P;e[2]!==C?(P={binding:C},e[2]=C,e[3]=P):P=e[3];const R=re(P),{data:g}=te.useSession(),G=ce();let x;e[4]!==f||e[5]!==o.id?(x=ne.projectPluginConfig(o.id??"",f),e[4]=f,e[5]=o.id,e[6]=x):x=e[6];let p;e[7]!==f||e[8]!==o.id||e[9]!==G?(p=async()=>await G.call("VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:o.id,pluginId:f}),e[7]=f,e[8]=o.id,e[9]=G,e[10]=p):p=e[10];const O=!!o.id&&!!f;let _;e[11]!==x||e[12]!==p||e[13]!==O?(_={queryKey:x,queryFn:p,enabled:O},e[11]=x,e[12]=p,e[13]=O,e[14]=_):_=e[14];const{data:A,isLoading:D}=se(_),z=A?.config?.connectionId,h=z?R.find(n=>n.id===z):null,I=ae({connectionId:h?.id,orgId:t.id,orgSlug:t.slug});let y;e[15]!==g?(y=g?.user?{user:{id:g.user.id,name:g.user.name,email:g.user.email,image:g.user.image}}:null,e[15]=g,e[16]=y):y=e[16];const a=y;let b;e[17]!==t.id||e[18]!==t.name||e[19]!==t.slug?(b={id:t.id,slug:t.slug,name:t.name},e[17]=t.id,e[18]=t.name,e[19]=t.slug,e[20]=b):b=e[20];const c=b;if(D){let n;return e[21]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(oe,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[21]=n):n=e[21],n}if(R.length===0){let n;e[22]!==c||e[23]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[22]=c,e[23]=a,e[24]=n):n=e[24];const u=n;let r;e[25]!==m?(r=m(),e[25]=m,e[26]=r):r=e[26];let l;e[27]!==r?(l=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r}),e[27]=r,e[28]=l):l=e[28];let d;return e[29]!==u||e[30]!==l?(d=s.jsx(K,{value:u,children:l}),e[29]=u,e[30]=l,e[31]=d):d=e[31],d}if(!h){let n;e[32]!==c||e[33]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[32]=c,e[33]=a,e[34]=n):n=e[34];const u=n;let r;e[35]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(ue,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[35]=r):r=e[35];let l;e[36]!==M||e[37]!==t.slug||e[38]!==T||e[39]!==o.id||e[40]!==k||e[41]!==w?(l=s.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[r,s.jsx(le,{onClick:()=>{const Y=T??t.slug,H=w??o.id??"",J=k??crypto.randomUUID();M({to:"/$org/$taskId",params:{org:Y,taskId:J},search:{virtualmcpid:H,main:"settings"}})},children:"Go to Project Settings"})]}),e[36]=M,e[37]=t.slug,e[38]=T,e[39]=o.id,e[40]=k,e[41]=w,e[42]=l):l=e[42];let d;return e[43]!==u||e[44]!==l?(d=s.jsx(K,{value:u,children:l}),e[43]=u,e[44]=l,e[45]=d):d=e[45],d}const Q=h.id,q=me(h);let N;e[46]!==I?(N=(n,u)=>I?I.callTool({name:n,arguments:u}).then(fe):Promise.reject(new Error("MCP client is not available")),e[46]=I,e[47]=N):N=e[47];const U=N;let S;e[48]!==h||e[49]!==c||e[50]!==a||e[51]!==q||e[52]!==U?(S={connectionId:Q,connection:q,toolCaller:U,org:c,session:a},e[48]=h,e[49]=c,e[50]=a,e[51]=q,e[52]=U,e[53]=S):S=e[53];const $=S;let E;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(B,{children:s.jsx(B.Content,{children:s.jsx(ie,{})})}),e[54]=E):E=e[54];let L;return e[55]!==$?(L=s.jsx(K,{value:$,children:E}),e[55]=$,e[56]=L):L=e[56],L}function fe(i){return i.structuredContent??i}export{Pe as P};
1
+ import{r as F,e as V,j as s,q as W,f as X,g as Z,d as ee,b as te,K as ne,n as se,O as ie,l as oe,B as le}from"./index-DjCrtoJM.js";import{u as re}from"./use-connection-C7K5Qf-S.js";import{j as ae}from"./use-mcp-client-Wf5qUXFF.js";import{u as ce}from"./studio-tools-C1zamUp1.js";import{a as ue}from"./Settings02-B_z2JeIq.js";import{P as B}from"./index-D7vPwljU.js";const de=F.createContext(null);function K(i){const e=V.c(3),{value:C,children:m}=i,t=C;let o;return e[0]!==m||e[1]!==t?(o=s.jsx(de.Provider,{value:t,children:m}),e[0]=m,e[1]=t,e[2]=o):o=e[2],o}F.createContext(null);function me(i){return{id:i.id,title:i.title,icon:i.icon,description:i.description,app_name:i.app_name,app_id:i.app_id,tools:i.tools,metadata:i.metadata}}function Pe(i){const e=V.c(57),{bindingName:C,renderEmptyState:m}=i,{org:t,project:o}=W(),M=X();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={strict:!1},e[0]=j):j=e[0];const{org:T,taskId:k,pluginId:f}=Z(j);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v={strict:!1},e[1]=v):v=e[1];const w=ee(v).virtualmcpid;let P;e[2]!==C?(P={binding:C},e[2]=C,e[3]=P):P=e[3];const R=re(P),{data:g}=te.useSession(),G=ce();let x;e[4]!==f||e[5]!==o.id?(x=ne.projectPluginConfig(o.id??"",f),e[4]=f,e[5]=o.id,e[6]=x):x=e[6];let p;e[7]!==f||e[8]!==o.id||e[9]!==G?(p=async()=>await G.call("VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:o.id,pluginId:f}),e[7]=f,e[8]=o.id,e[9]=G,e[10]=p):p=e[10];const O=!!o.id&&!!f;let _;e[11]!==x||e[12]!==p||e[13]!==O?(_={queryKey:x,queryFn:p,enabled:O},e[11]=x,e[12]=p,e[13]=O,e[14]=_):_=e[14];const{data:A,isLoading:D}=se(_),z=A?.config?.connectionId,h=z?R.find(n=>n.id===z):null,I=ae({connectionId:h?.id,orgId:t.id,orgSlug:t.slug});let y;e[15]!==g?(y=g?.user?{user:{id:g.user.id,name:g.user.name,email:g.user.email,image:g.user.image}}:null,e[15]=g,e[16]=y):y=e[16];const a=y;let b;e[17]!==t.id||e[18]!==t.name||e[19]!==t.slug?(b={id:t.id,slug:t.slug,name:t.name},e[17]=t.id,e[18]=t.name,e[19]=t.slug,e[20]=b):b=e[20];const c=b;if(D){let n;return e[21]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(oe,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[21]=n):n=e[21],n}if(R.length===0){let n;e[22]!==c||e[23]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[22]=c,e[23]=a,e[24]=n):n=e[24];const u=n;let r;e[25]!==m?(r=m(),e[25]=m,e[26]=r):r=e[26];let l;e[27]!==r?(l=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r}),e[27]=r,e[28]=l):l=e[28];let d;return e[29]!==u||e[30]!==l?(d=s.jsx(K,{value:u,children:l}),e[29]=u,e[30]=l,e[31]=d):d=e[31],d}if(!h){let n;e[32]!==c||e[33]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[32]=c,e[33]=a,e[34]=n):n=e[34];const u=n;let r;e[35]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(ue,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[35]=r):r=e[35];let l;e[36]!==M||e[37]!==t.slug||e[38]!==T||e[39]!==o.id||e[40]!==k||e[41]!==w?(l=s.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[r,s.jsx(le,{onClick:()=>{const Y=T??t.slug,H=w??o.id??"",J=k??crypto.randomUUID();M({to:"/$org/$taskId",params:{org:Y,taskId:J},search:{virtualmcpid:H,main:"settings"}})},children:"Go to Project Settings"})]}),e[36]=M,e[37]=t.slug,e[38]=T,e[39]=o.id,e[40]=k,e[41]=w,e[42]=l):l=e[42];let d;return e[43]!==u||e[44]!==l?(d=s.jsx(K,{value:u,children:l}),e[43]=u,e[44]=l,e[45]=d):d=e[45],d}const Q=h.id,q=me(h);let N;e[46]!==I?(N=(n,u)=>I?I.callTool({name:n,arguments:u}).then(fe):Promise.reject(new Error("MCP client is not available")),e[46]=I,e[47]=N):N=e[47];const U=N;let S;e[48]!==h||e[49]!==c||e[50]!==a||e[51]!==q||e[52]!==U?(S={connectionId:Q,connection:q,toolCaller:U,org:c,session:a},e[48]=h,e[49]=c,e[50]=a,e[51]=q,e[52]=U,e[53]=S):S=e[53];const $=S;let E;e[54]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(B,{children:s.jsx(B.Content,{children:s.jsx(ie,{})})}),e[54]=E):E=e[54];let L;return e[55]!==$?(L=s.jsx(K,{value:$,children:E}),e[55]=$,e[56]=L):L=e[56],L}function fe(i){return i.structuredContent??i}export{Pe as P};
@@ -1 +1 @@
1
- import{r as i,bh as $,j as c,dl as L,bi as z,bx as A,a7 as _,a8 as g,dm as b,bk as w,dn as G,dp as j,du as H,dv as K,ag as q,dw as U,dx as V,dy as W,dq as Z,dr as B,dt as J,e as R,c as Q}from"./index-BjoOIgbb.js";var m="Popover",[E]=q(m,[j]),P=j(),[X,u]=E(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:z(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(y,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});S.displayName=y;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(w,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(w,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),C=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(B,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=T;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=S,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};
1
+ import{r as i,bh as $,j as c,dl as L,bi as z,bx as A,a7 as _,a8 as g,dm as b,bk as w,dn as G,dp as j,du as H,dv as K,ag as q,dw as U,dx as V,dy as W,dq as Z,dr as B,dt as J,e as R,c as Q}from"./index-DjCrtoJM.js";var m="Popover",[E]=q(m,[j]),P=j(),[X,u]=E(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:z(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(y,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});S.displayName=y;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(w,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(w,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),C=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(B,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=T;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=S,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};