decocms 3.28.0 → 3.28.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 (234) hide show
  1. package/dist/client/assets/{AlertCircle-DU7uZY8J.js → AlertCircle-De-QnqNt.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DEY-b6kE.js → ArrowUpRight-B0GfNpsw.js} +1 -1
  3. package/dist/client/assets/{Check-Bk-n4rKs.js → Check-DHmAQH53.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-i_SCh8HK.js → CheckCircle-DKSRB9Xd.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-D_SiD52e.js → ChevronDown-CN6qoGcG.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-CJxMMdOC.js → ChevronLeft-HFx1Uufy.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DRFF6KW4.js → ChevronRight-BJSYQUmF.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-f28rZEwl.js → ChevronUp-CTGwFzLw.js} +1 -1
  9. package/dist/client/assets/{Container-DxRK5lMe.js → Container-DZBZNA8Y.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BD0Jlzeq.js → DotsVertical-jUGLCiy5.js} +1 -1
  11. package/dist/client/assets/{Eye-BR5jFpci.js → Eye-CGoLCmzu.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DqLLGuqf.js → FilterLines-DYSfUppO.js} +1 -1
  13. package/dist/client/assets/{Globe01-CNB6Mpsd.js → Globe01--hrfRyvA.js} +1 -1
  14. package/dist/client/assets/{HardDrive-p4TajzWn.js → HardDrive-yKlUP3QG.js} +1 -1
  15. package/dist/client/assets/{Key01-DSBXnSBm.js → Key01-DqH2W8Qa.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-XknICfD_.js → LayoutLeft-CLZVvVLM.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-DtQPZgan.js → LinkExternal01-CaYoYL1Y.js} +1 -1
  18. package/dist/client/assets/{Monitor01-B2xyeevM.js → Monitor01-BRL4_dKI.js} +1 -1
  19. package/dist/client/assets/{Palette-BbNQF7ac.js → Palette-B9PbEO6t.js} +1 -1
  20. package/dist/client/assets/{Play-TWKPwhCM.js → Play-Btpg8EpH.js} +1 -1
  21. package/dist/client/assets/{Plus-DXSb81sc.js → Plus-Cv0T2Pov.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-CR2Fhw_7.js → RefreshCcw01-CcpA4rje.js} +1 -1
  23. package/dist/client/assets/{SearchMd-AWrKGzzG.js → SearchMd-BP9M1g2N.js} +1 -1
  24. package/dist/client/assets/{Settings02-C46G6WCc.js → Settings02-BMRrFVdB.js} +1 -1
  25. package/dist/client/assets/{Shield01-CX_dkwPt.js → Shield01-rOhEAWZ1.js} +1 -1
  26. package/dist/client/assets/{Star01-Bj8KnWg6.js → Star01-BjpgI7im.js} +1 -1
  27. package/dist/client/assets/{Stars01-EZHZaPSP.js → Stars01-yuWjNyMF.js} +1 -1
  28. package/dist/client/assets/{Stars02-C_A7q-Eh.js → Stars02-Cv3Kyp_N.js} +1 -1
  29. package/dist/client/assets/{Sun-DXzJdR2z.js → Sun-C0I4hv8e.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-D6F_mKYx.js → SwitchHorizontal01-CLZ8VEjC.js} +1 -1
  31. package/dist/client/assets/{Tool01-CE1enLWz.js → Tool01-DPPRaW86.js} +1 -1
  32. package/dist/client/assets/{Trash01-D8gQFcOn.js → Trash01-s7FZsfBC.js} +1 -1
  33. package/dist/client/assets/{Upload01-Br3xRIzS.js → Upload01-xUCMslnL.js} +1 -1
  34. package/dist/client/assets/{User01-D6Gs71XK.js → User01-BsF0RS3z.js} +1 -1
  35. package/dist/client/assets/{Users01-Bb-aDnk6.js → Users01-D-iBSVXa.js} +1 -1
  36. package/dist/client/assets/{Users03-CTeoWFzj.js → Users03-CKUicuTa.js} +1 -1
  37. package/dist/client/assets/{X-Bf_z2Leo.js → X-CMYaHMo4.js} +1 -1
  38. package/dist/client/assets/{XCircle-UQit86MX.js → XCircle-BdbzgmP6.js} +1 -1
  39. package/dist/client/assets/{XClose-Bgoke-N6.js → XClose-N2P2hiYb.js} +1 -1
  40. package/dist/client/assets/{Zap-TkrtxiYp.js → Zap-gqEvk94k.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-H66QOKYB.js → ZapSquare-AN7R7mTa.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-Cx-hi9HP.js → ZoomOut-Xe1itnU7.js} +1 -1
  43. package/dist/client/assets/{access-gate-lvdpuHDY.js → access-gate-Dx320Euv.js} +1 -1
  44. package/dist/client/assets/{accordion-SKOJ-KFj.js → accordion-BIWbMpHu.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-TR_K3MgP.js → add-section-modal-e667gRvo.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-Dfyq2uGy.js → agent-capabilities-Deuuzqbm.js} +1 -1
  47. package/dist/client/assets/{agent-icon-OWcPDEQ2.js → agent-icon-D1ySfhKA.js} +1 -1
  48. package/dist/client/assets/{agent-icons-cDvwhRBa.js → agent-icons-DpDt_xvu.js} +1 -1
  49. package/dist/client/assets/{agents-list-CQR5Pn0v.js → agents-list-DXTuElJ5.js} +1 -1
  50. package/dist/client/assets/{ai-providers-DaCH_i9C.js → ai-providers-CHLGgXkW.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-BqyMBnmX.js → alert-dialog-CBzhgusU.js} +1 -1
  52. package/dist/client/assets/{alert-B23mwX-o.js → alert-zJcnZqHG.js} +1 -1
  53. package/dist/client/assets/app-editor-DqV_IRWA.js +1 -0
  54. package/dist/client/assets/{auth-catchall-9EV3406W.js → auth-catchall-GeRmeWq3.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-DLW_QQ-W.js → auth-split-layout-B_vpA1VO.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BwkKTT5_.js → automation-list-row-7qb4yrwv.js} +1 -1
  57. package/dist/client/assets/{automation-runs-CZtduC0L.js → automation-runs-BcknuTTv.js} +1 -1
  58. package/dist/client/assets/{automations-BICbKbA1.js → automations-K7jo5bzv.js} +1 -1
  59. package/dist/client/assets/{avatar-BzNw5Uju.js → avatar-AI83PqVE.js} +1 -1
  60. package/dist/client/assets/{badge-B2p1Cov_.js → badge-CikIA9ZK.js} +1 -1
  61. package/dist/client/assets/{brand-context-DZXUjVgo.js → brand-context-BwVwErVn.js} +1 -1
  62. package/dist/client/assets/{buckets-5mIo-vQP.js → buckets-DUsKq9i-.js} +1 -1
  63. package/dist/client/assets/{calendar-CNvaxbzF.js → calendar-DZmZKFmb.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DiOZh0BR.js → capability-load-error-Db8x02Oo.js} +1 -1
  65. package/dist/client/assets/{card-Cm77QeIs.js → card-DmbfBYZU.js} +1 -1
  66. package/dist/client/assets/{chat-context-hSR2djUS.js → chat-context-BOn4WPpq.js} +6 -6
  67. package/dist/client/assets/{checkbox-B-8BZy2m.js → checkbox-Cwl_z5GL.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-C_SoVu4q.js → cli-auth-success--vqcpMzi.js} +1 -1
  69. package/dist/client/assets/{collection-detail-BiXcw8MS.js → collection-detail-BnmgQ1CE.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-ID_MOaLN.js → collection-display-button-0uuG9Zva.js} +1 -1
  71. package/dist/client/assets/{collection-search-BAFbwDkO.js → collection-search-B-CX-Cb7.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-CV-yXvS9.js → collection-table-wrapper-DI5q4GEY.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CrxbRblh.js → collection-tabs-CdfD34L4.js} +1 -1
  74. package/dist/client/assets/{collections-BI_JGQp4.js → collections-CXYJ8MVZ.js} +1 -1
  75. package/dist/client/assets/{command-OYpJfVPX.js → command-BHuAtd3n.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-DCdLrvVO.js → connect-desktop-dialog-DRFjva34.js} +1 -1
  77. package/dist/client/assets/{connection-card-BMnV5fMv.js → connection-card-DEvkcpmQ.js} +1 -1
  78. package/dist/client/assets/{connection-detail-DEj4qBsZ.js → connection-detail-CWd-Y8iP.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-DnPdxsfv.js → connection-form-helpers-BxYEqmM8.js} +1 -1
  80. package/dist/client/assets/{connections-DSD_MevM.js → connections-BtPFfd05.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-E7Sw2N0h.js → decopilot-sse-pool-Bj1W2y0B.js} +1 -1
  82. package/dist/client/assets/{dialog-C6QaYxl0.js → dialog-IkiImd7I.js} +1 -1
  83. package/dist/client/assets/{domain-settings-BQ528-l5.js → domain-settings-B-px7BiX.js} +1 -1
  84. package/dist/client/assets/{drawer-vaHtyblX.js → drawer-DO_U_Bhd.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-Imbn90PR.js → dropdown-menu-C-Cxaez8.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-6a9zWAcg.js → dynamic-plugin-layout-DHOlocDg.js} +1 -1
  87. package/dist/client/assets/{empty-state-BcYDemrG.js → empty-state-CzxH8T9l.js} +1 -1
  88. package/dist/client/assets/{empty-state-DiL0zFYg.js → empty-state-o52Hq4fy.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-A3fQ5XNQ.js → extract-connection-data-Uz57CpVC.js} +1 -1
  90. package/dist/client/assets/{features-D5bvFK6H.js → features-DfTRf5eR.js} +1 -1
  91. package/dist/client/assets/{file-explorer-dtc6EQ2u.js → file-explorer-Wed6GBRH.js} +1 -1
  92. package/dist/client/assets/{file-type-icon-DlkWBYHv.js → file-type-icon-BYSeb5A3.js} +1 -1
  93. package/dist/client/assets/{files-OPskzPlL.js → files-PguEGaiI.js} +1 -1
  94. package/dist/client/assets/{form-9w_l2sE8.js → form-ChQh_wIn.js} +1 -1
  95. package/dist/client/assets/{general-lhm5elhX.js → general-BoF0bKER.js} +1 -1
  96. package/dist/client/assets/{generate-id-D-Z8lvmk.js → generate-id-BrtbvnKY.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-Dv4KJl0O.js → github-repo-picker-13FobS0K.js} +1 -1
  98. package/dist/client/assets/header-tab-button-Qu1eh6fb.js +5 -0
  99. package/dist/client/assets/{hover-card-BI6ysAg8.js → hover-card-5iaAH0_M.js} +1 -1
  100. package/dist/client/assets/{image-field-CcseK2kZ.js → image-field-C3Pv1Di2.js} +1 -1
  101. package/dist/client/assets/{index-duBgFwwx.js → index-BxF-LrkW.js} +1 -1
  102. package/dist/client/assets/{index-D7Ym_-5D.js → index-BxgO4x6f.js} +1 -1
  103. package/dist/client/assets/{index-Dm_1qSI1.js → index-C5R8l9NR.js} +1 -1
  104. package/dist/client/assets/{index-66izpaHD.js → index-CbGPcWEH.js} +1 -1
  105. package/dist/client/assets/{index-DbgXBP8O.js → index-Ctxajzpe.js} +1 -1
  106. package/dist/client/assets/{index-DkHi5sno.js → index-CwSpOXRj.js} +1 -1
  107. package/dist/client/assets/{index-mc4bQjv-.js → index-CweEMiqH.js} +1 -1
  108. package/dist/client/assets/{index-b-VAmZ9T.js → index-CwnBaaeQ.js} +25 -25
  109. package/dist/client/assets/{index-BmS_uKXZ.js → index-D0sk3sYa.js} +1 -1
  110. package/dist/client/assets/{index-Bi8_oF4i.js → index-DFp-rnQf.js} +1 -1
  111. package/dist/client/assets/{index-CEsEADMd.js → index-Dcfw-W2O.js} +1 -1
  112. package/dist/client/assets/{index-DBqH3_Tr.js → index-Dlc4tDxO.js} +3 -3
  113. package/dist/client/assets/{index-CZV4OD7q.js → index-Kzj6xvOo.js} +1 -1
  114. package/dist/client/assets/{index-DCdT8576.js → index-NNvehl9i.js} +1 -1
  115. package/dist/client/assets/{index-g0ii0jyc.js → index-YyegPZ6_.js} +1 -1
  116. package/dist/client/assets/{index-redirect-Cik9CpVs.js → index-redirect-BRsZDGI9.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-DFtHCFaz.js → infiniteQueryObserver-D4Z6Hq7s.js} +1 -1
  118. package/dist/client/assets/{input-Cuzo-zTy.js → input-CDaarCl_.js} +1 -1
  119. package/dist/client/assets/{integration-icon-C1XpJ7QJ.js → integration-icon-DylMdkB7.js} +1 -1
  120. package/dist/client/assets/{label-CcXzfa1l.js → label-CmtFIrH6.js} +1 -1
  121. package/dist/client/assets/{layout-BJtn7s4t.js → layout-Czl8yfyb.js} +1 -1
  122. package/dist/client/assets/{login-Jhcl5D4A.js → login-CZ304Hwe.js} +1 -1
  123. package/dist/client/assets/{members-DANjql1K.js → members-DldCeEf4.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-CSoW9X1e.js → monaco-editor--8410HRL.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-BGCHrDPH.js → monitoring-stats-row-p2QkpslG.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-BlNYkvOU.js → oauth-callback-BjKMJUNm.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-DH8djC-I.js → oauth-callback-ai-provider--EBMOSLZ.js} +1 -1
  128. package/dist/client/assets/{onboarding-CYkPWfyZ.js → onboarding-Dujhc2aN.js} +1 -1
  129. package/dist/client/assets/{org-install-DgsgwzFi.js → org-install-BRL26TWn.js} +1 -1
  130. package/dist/client/assets/{org-layout-CkFNhLrh.js → org-layout-7aQLDDnY.js} +1 -1
  131. package/dist/client/assets/{org-plugin-layout-BXdjOse3.js → org-plugin-layout-Ch8ukpQt.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-DgwMXCLr.js → page-seo-form-Cz5Nib_0.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-CcoAXMMc.js +1 -0
  134. package/dist/client/assets/{pair-D-dPw7Vh.js → pair-BfYvjacw.js} +2 -2
  135. package/dist/client/assets/{plugin-empty-state-CeRXXOD9.js → plugin-empty-state-Bafs814S.js} +1 -1
  136. package/dist/client/assets/{plugin-header-DZqxJKiL.js → plugin-header-CzH_o1AA.js} +1 -1
  137. package/dist/client/assets/{plugin-layout-CGOJQMJE.js → plugin-layout-BrlPuAvi.js} +1 -1
  138. package/dist/client/assets/{popover-Cg9khto7.js → popover-DaxAVDXR.js} +1 -1
  139. package/dist/client/assets/{post-editor-DeTikwJT.js → post-editor-DZv3v9vs.js} +1 -1
  140. package/dist/client/assets/{primitives-B8qUvq34.js → primitives-C2FB52ts.js} +1 -1
  141. package/dist/client/assets/{profile-DcLK_GvV.js → profile-Ch1PMZ--.js} +1 -1
  142. package/dist/client/assets/project-app-view-CNkoTSGZ.js +1 -0
  143. package/dist/client/assets/record-editor-B2xsglRQ.js +1 -0
  144. package/dist/client/assets/registry-BD5AwdfO.js +2 -0
  145. package/dist/client/assets/{registry-layout-CeQDBbI0.js → registry-layout-D5296RDd.js} +1 -1
  146. package/dist/client/assets/{require-capability-LsMjGzeH.js → require-capability-D8n6HrEr.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-A79U5RVL.js → required-auth-layout-q1UX5iFV.js} +1 -1
  148. package/dist/client/assets/{reset-password-v1OfhuM4.js → reset-password-BUp5wXvt.js} +1 -1
  149. package/dist/client/assets/{resizable-DxL9OiT-.js → resizable-B_wg5OKG.js} +1 -1
  150. package/dist/client/assets/{roles-DrAidx6u.js → roles-CFjXltMh.js} +1 -1
  151. package/dist/client/assets/save-referenced-block-C-C4ro26.js +1 -0
  152. package/dist/client/assets/{save-status-BPgyONO2.js → save-status-CJhEsrLH.js} +1 -1
  153. package/dist/client/assets/{schema-form-CIsE9rP6.js → schema-form-D_d0W0_5.js} +1 -1
  154. package/dist/client/assets/{scroll-area-DOSO9pu3.js → scroll-area-CifcP4Wg.js} +1 -1
  155. package/dist/client/assets/{search-input-fUp8LGk1.js → search-input-eml2HEUh.js} +1 -1
  156. package/dist/client/assets/{secrets-BBpvMqxV.js → secrets-DnWBimzu.js} +1 -1
  157. package/dist/client/assets/{sections-editor-BUSId1Zm.js → sections-editor-GEeJkb9Q.js} +1 -1
  158. package/dist/client/assets/{select-O-homC7-.js → select-Dz7DPkoH.js} +1 -1
  159. package/dist/client/assets/{select-model-C2bxkMXw.js → select-model-B6KC9bZ9.js} +1 -1
  160. package/dist/client/assets/{seo-editor-COYKOkSM.js → seo-editor-yjW-SMAL.js} +1 -1
  161. package/dist/client/assets/{settings-layout-DzAPFM8g.js → settings-layout-Cvw0dTbU.js} +1 -1
  162. package/dist/client/assets/{settings-section-bWEtm5yt.js → settings-section-BkfPlxIX.js} +1 -1
  163. package/dist/client/assets/{sheet-BvtvfFAl.js → sheet-C2OErkZR.js} +1 -1
  164. package/dist/client/assets/{shell-controls-JCdbPD3N.js → shell-controls-CgyBrm6l.js} +1 -1
  165. package/dist/client/assets/{shell-layout-Bhb76vPi.js → shell-layout-D-4Zna-j.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-mUaMt2AK.js → shell-route-loading-D7iIgnMy.js} +1 -1
  167. package/dist/client/assets/{sidebar-qjaU6R6F.js → sidebar-BT1O99E-.js} +1 -1
  168. package/dist/client/assets/{skeleton-Bs6B9g7A.js → skeleton-bErIIEAe.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-CyfFdOo4.js → sortable.esm-D_73qywG.js} +1 -1
  170. package/dist/client/assets/{spinner-CODSjjQl.js → spinner-DUmur8qx.js} +1 -1
  171. package/dist/client/assets/{sso-ETVhKmcD.js → sso-jmWB0IlU.js} +1 -1
  172. package/dist/client/assets/{store-BWJ3fbUY.js → store-CPLW6WOq.js} +1 -1
  173. package/dist/client/assets/store-registry-BUknjkUH.js +2 -0
  174. package/dist/client/assets/{studio-tools-hfOcm94T.js → studio-tools-B-zlmqyw.js} +1 -1
  175. package/dist/client/assets/{switch-B76FjS24.js → switch-CRVfQAZr.js} +1 -1
  176. package/dist/client/assets/{tab-id-DJcQxSw_.js → tab-id-By_JW--7.js} +2 -2
  177. package/dist/client/assets/{table-DychmbHa.js → table-70fRVfwQ.js} +1 -1
  178. package/dist/client/assets/{tabs-5VCr7Lmg.js → tabs-_yym-ubf.js} +1 -1
  179. package/dist/client/assets/{task-status-BrHrBwF0.js → task-status-B3M1uY2i.js} +1 -1
  180. package/dist/client/assets/{textarea-Oxf83X-s.js → textarea-BhyLj2Dp.js} +1 -1
  181. package/dist/client/assets/{toggle-group-B_flmDPF.js → toggle-group-BYYoZiYB.js} +1 -1
  182. package/dist/client/assets/{toolbar-8WByzcnO.js → toolbar-BQgYgute.js} +1 -1
  183. package/dist/client/assets/{tools-list-dYx9Si__.js → tools-list-Bib10JJv.js} +1 -1
  184. package/dist/client/assets/{tooltip-B7sOnQkv.js → tooltip-D0rD3x8T.js} +1 -1
  185. package/dist/client/assets/{types-DBP54icS.js → types-Bt2jh4HB.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-CSnlplZs.js → use-ai-providers-BL6EQsm8.js} +1 -1
  187. package/dist/client/assets/{use-automations-Ds0WDnWO.js → use-automations-jCgcI_Hn.js} +1 -1
  188. package/dist/client/assets/{use-capability-CPfyR7lg.js → use-capability-DqPX2R7m.js} +1 -1
  189. package/dist/client/assets/{use-collections-cYI0oKE6.js → use-collections-CH3Uvmj5.js} +1 -1
  190. package/dist/client/assets/{use-connection-lmAzDQtG.js → use-connection-BGpjiuJJ.js} +1 -1
  191. package/dist/client/assets/{use-copy-BZu-B9lH.js → use-copy-DHiMTnai.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-Bkzx6tcI.js → use-create-virtual-mcp-8G8o89BT.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-CyyIp3oB.js → use-debounced-autosave-BnF-F24h.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-2QDp_tYR.js → use-delete-connection-DSxSiAyt.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-BY47ZlQU.js → use-file-configs-CDby3RwC.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-bWgRjm8B.js → use-infinite-scroll-BlDyJWAa.js} +1 -1
  197. package/dist/client/assets/{use-list-state-Dq7vira_.js → use-list-state-nfg3Cb56.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-BgKdABiW.js → use-mcp-client-BoOtVD9g.js} +1 -1
  199. package/dist/client/assets/{use-mcp-prompts-D52UL8AH.js → use-mcp-prompts-CYbN8Yyl.js} +1 -1
  200. package/dist/client/assets/{use-mcp-tools-DVLWn59S.js → use-mcp-tools-DlzThqmJ.js} +1 -1
  201. package/dist/client/assets/{use-members-BY2IDfpw.js → use-members-BLEStPtC.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-B96HLz_j.js → use-navigate-to-agent-_X_kAEcz.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-CdNQL1J3.js → use-org-auth-client-ziK5gAU8.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-ChCwS_VA.js → use-org-sso-BCRYycoj.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-BPVtkwsY.js → use-organization-roles-zr9qa8BU.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-Dpet9l_V.js → use-organization-settings-BQtNgLEs.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-XCi4lRb-.js → use-registry-connections-CPtcwe6P.js} +1 -1
  208. package/dist/client/assets/{use-secrets-BqVTqitm.js → use-secrets-wimlaYjN.js} +1 -1
  209. package/dist/client/assets/{use-status-sounds-CwFju7iN.js → use-status-sounds-CZU7jLXq.js} +1 -1
  210. package/dist/client/assets/{use-view-mode-B5hNsOGq.js → use-view-mode-BJ_FnvkJ.js} +1 -1
  211. package/dist/client/assets/{use-virtual-mcp-FBTL02d0.js → use-virtual-mcp-_FyR-EfH.js} +1 -1
  212. package/dist/client/assets/useInfiniteQuery-Dzg2BCY9.js +1 -0
  213. package/dist/client/assets/{useRouterState--dWmVQ9c.js → useRouterState-CfhsEB7J.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-D3ys-EbO.js +1 -0
  215. package/dist/client/assets/{user-Cg2LA8Mh.js → user-CXZKnlfK.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-DVxKMSOa.js → view-mode-toggle-BO9qiFWG.js} +1 -1
  217. package/dist/client/assets/{workflow-t9WsYZ9Y.js → workflow-CA6KPd9J.js} +1 -1
  218. package/dist/client/assets/workflow-detail-DzevlE_t.js +1 -0
  219. package/dist/client/index.html +1 -1
  220. package/dist/server/cli.js +421 -513
  221. package/dist/server/migrate.js +98 -98
  222. package/dist/server/server.js +282 -282
  223. package/package.json +1 -1
  224. package/dist/client/assets/app-editor-DcKlfdHo.js +0 -1
  225. package/dist/client/assets/header-tab-button-2U6O3giw.js +0 -5
  226. package/dist/client/assets/page-seo-sheet-B2dnrk9E.js +0 -1
  227. package/dist/client/assets/project-app-view-CUDu3MEL.js +0 -1
  228. package/dist/client/assets/record-editor-Bqbny3n8.js +0 -1
  229. package/dist/client/assets/registry-CT-bGrYc.js +0 -2
  230. package/dist/client/assets/save-referenced-block-6TdaXn38.js +0 -1
  231. package/dist/client/assets/store-registry-BQiuioAM.js +0 -2
  232. package/dist/client/assets/useInfiniteQuery-DMW4zCm0.js +0 -1
  233. package/dist/client/assets/useSuspenseInfiniteQuery-tnhNRWqB.js +0 -1
  234. package/dist/client/assets/workflow-detail-BgLcBn-p.js +0 -1
@@ -1 +1 @@
1
- import{e as L,G as te,K as U,j as a,r as G,c as ne}from"./index-DBqH3_Tr.js";import{i as oe,m as M,a2 as se,a3 as re,W as ie,e as le}from"./index-b-VAmZ9T.js";import{L as Y}from"./label-CcXzfa1l.js";import{S as $}from"./switch-B76FjS24.js";import{a as ce,S as ae}from"./schema-form-CIsE9rP6.js";import{c as ue,S as fe,a as pe,b as de,d as ye}from"./select-O-homC7-.js";const me="website/sections/Rendering/Lazy.tsx";function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function N(t){if(!K(t))return!1;const e=t.__resolveType;return typeof e=="string"&&oe(e)}function k(t){return t!=null}function w(t){if(t==null)return t;if(N(t)){const e=t.section;return e==null?null:K(e)?e:{}}return K(t)?t:void 0}function z(t,e){return t===null?null:N(e)?{...e,section:t}:t}function he(t){return{__resolveType:t}}function Se(t,e){if(!k(e))return null;if(t){const n=w(e)??{};return{__resolveType:me,section:n}}return N(e)?w(e)??null:K(e)?e:null}const ge="General";function O(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function Q(t,e){return t===C?ge:e}function W(t){const e=re(t),n=new Set,o=[];for(const s of e)O(s.resolveType)&&(ie(s.resolveType)||n.has(s.resolveType)||(n.add(s.resolveType),o.push({resolveType:s.resolveType,title:Q(s.resolveType,s.title),description:s.description})));return o}function V(t){const e=se(t),n=M(e,t),o=W(n?.properties?.seo);return o.length>0?o:ve(t)}function ve(t){const e=t.manifest?.blocks??{},n=[];for(const[o,s]of Object.entries(e))if(o.includes("sections"))for(const r of Object.keys(s)){if(!O(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Q(r,i)})}return n}function Z(t){const e=V(t),n=e.find(o=>o.resolveType===C);return n?n.resolveType:e[0]?.resolveType??C}function q(t,e){const n=e.__resolveType;if(typeof n=="string"){const o=M(n,t),s=W(o?.properties?.seo);if(s.length>0)return s}return V(t)}function be(t,e){const n=q(t,e),o=n.find(s=>s.resolveType===C);return o?o.resolveType:n[0]?.resolveType??Z(t)}function Te(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:Z(t)}function xe(t,e,n){const o=n.__resolveType;return typeof o=="string"&&O(o)?o:be(t,e)}const _e=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]),C="website/sections/Seo/SeoV2.tsx",Re=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function F(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ee(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function je(t,e){for(const[n,o]of Object.entries(t)){if(!F(o))continue;const s=o,r=s.__resolveType;if(typeof r=="string"&&_e.has(r))continue;const i=s.seo;if(F(i)){const c=i;if(Ee(c))return{blockKey:n,kind:"nested",seoData:c,blockData:s,seoResolveType:e?xe(e,s,c):typeof c.__resolveType=="string"&&O(c.__resolveType)?c.__resolveType:C}}}for(const[n,o]of Object.entries(t)){if(!F(o))continue;const s=o;if(typeof s.__resolveType=="string"&&O(s.__resolveType))return{blockKey:n,kind:"block",seoData:s,blockData:s,seoResolveType:s.__resolveType}}return null}function De(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function qe(t,e,n){if(e.kind==="site"){const l=je(t,n);return l?{blockKey:l.blockKey,seoData:l.seoData,seoResolveType:l.seoResolveType,siteKind:l.kind,seoTypeOptions:n?q(n,l.blockData):void 0,build:d=>De(l,d)}:null}const o=t[e.pageKey];if(!F(o))return null;const s=o,r=s.seo,i=w(r),c=i&&F(i)?i:void 0;return{blockKey:e.pageKey,seoData:c,rawSeoData:r,seoResolveType:n?Te(n,c):typeof c?.__resolveType=="string"?c.__resolveType:C,seoTypeOptions:n?V(n):void 0,build:l=>({...s,seo:l===null?null:z(l,r)})}}function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ce(t,e,n,o){if(t.kind==="page"){if(!I(n))return null;const s=n.seo!==void 0?n.seo:e.rawSeoData;return{...n,seo:o===null?null:z(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function He(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function Je(t){const e=L.c(23),{orgSlug:n,virtualMcpId:o,branch:s,target:r,resolved:i,onSaved:c}=t,l=te(),d=`${n}/${o}/${s}`;let y;e[0]!==s||e[1]!==n||e[2]!==o?(y={orgSlug:n,virtualMcpId:o,branch:s},e[0]=s,e[1]=n,e[2]=o,e[3]=y):y=e[3];let p;e[4]!==c?(p={onSaved:c},e[4]=c,e[5]=p):p=e[5];const{save:f,flush:S,isPending:m}=le(y,p);let h;e[6]!==d||e[7]!==l||e[8]!==i||e[9]!==f||e[10]!==r?(h=E=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return Ce(r,i,b,E)})},e[6]=d,e[7]=l,e[8]=i,e[9]=f,e[10]=r,e[11]=h):h=e[11];const g=h;let v;e[12]!==d||e[13]!==l||e[14]!==i||e[15]!==f||e[16]!==r?(v=E=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:E}:null})},e[12]=d,e[13]=l,e[14]=i,e[15]=f,e[16]=r,e[17]=v):v=e[17];const R=v;let x;return e[18]!==S||e[19]!==m||e[20]!==R||e[21]!==g?(x={persistSeo:g,persistRawSeo:R,flush:S,isPending:m},e[18]=S,e[19]=m,e[20]=R,e[21]=g,e[22]=x):x=e[22],x}const Pe="https://deco.cx/docs/en/performance/edge-async-render";function Oe(t){const e=L.c(16),{rawSeo:n,onEnableChange:o,onAsyncRenderChange:s,children:r}=t;let i;e[0]!==n?(i=k(n),e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]!==n?(l=N(n),e[2]=n,e[3]=l):l=e[3];const d=l;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Y,{htmlFor:"seo-enable",className:"text-sm font-medium",children:"Enable SEO"}),e[4]=y):y=e[4];let p;e[5]!==c||e[6]!==o?(p=a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,a.jsx($,{id:"seo-enable",checked:c,onCheckedChange:o})]}),e[5]=c,e[6]=o,e[7]=p):p=e[7];let f;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==s?(f=c&&a.jsxs(a.Fragment,{children:[r,a.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Async render"}),a.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",a.jsx("a",{href:Pe,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"documentation"}),"."]})]}),a.jsx($,{id:"seo-async-render",checked:d,onCheckedChange:s,className:"shrink-0"})]})]}),e[8]=d,e[9]=r,e[10]=c,e[11]=s,e[12]=f):f=e[12];let S;return e[13]!==p||e[14]!==f?(S=a.jsxs("div",{className:"space-y-4",children:[p,f]}),e[13]=p,e[14]=f,e[15]=S):S=e[15],S}const B=["type","title","description","canonical","favicon","image","themeColor"],Le=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],Fe=["jsonLD","title","description","noIndexing","configJsonLD"];function H(t){return t===C||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":"full"}function Ke(t){switch(t){case"general":return B;case"pdp":return Le;case"plp":return Fe;default:return null}}function J(t,e){const n=Ke(H(e));if(!n||!t.properties)return t;const o={};for(const s of n){const r=t.properties[s];r&&(o[s]=r)}return{...t,properties:o}}function ke(){return B.filter(t=>t!=="type")}function Ne(t){return t.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).trim()}function Ae(t,e){return t[e]===void 0}function $e(t){const e=L.c(13),{schema:n,value:o,onChange:s,siteDefaultSeo:r,formResetKey:i}=t,l=J(n,C).properties??{},d=ke();let y;e[0]!==r?(y=!!r&&Object.keys(r).length>0,e[0]=r,e[1]=y):y=e[1];const p=y,[f,S]=G.useState(i);let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m={},e[2]=m):m=e[2];const[h,g]=G.useState(m);f!==i&&(S(i),g({}));let v;e[3]!==h||e[4]!==o?(v=u=>h[u]!==void 0?h[u]:Ae(o,u),e[3]=h,e[4]=o,e[5]=v):v=e[5];const R=v;let x;e[6]!==s||e[7]!==r||e[8]!==o?(x=(u,T)=>{g(D=>({...D,[u]:T}));const j={...o};if(T)delete j[u];else{const D=r?.[u];j[u]=D??(u==="type"?"website":"")}s(j)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const E=x,P="min-w-0 space-y-6",b=B.map(u=>{const T=l[u];if(!T)return null;const j=p&&d.includes(u),D=j&&R(u),X=D?r?.[u]??o[u]:o[u],ee=T.title??Ne(u);return a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:ne(D&&"pointer-events-none opacity-60"),children:ce({schema:T,value:X,onChange:A=>{D||s({...o,[u]:A})},path:u,label:ee,breadcrumbPath:[],onBreadcrumbChange:we})}),j&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>E(u,A)}),a.jsx(Y,{htmlFor:`seo-use-default-${u}`,className:"text-xs font-normal text-muted-foreground",children:"Use default"})]})]},u)});let _;return e[10]!==i||e[11]!==b?(_=a.jsx("div",{className:P,children:b},i),e[10]=i,e[11]=b,e[12]=_):_=e[12],_}function we(){}function Ie(t){const e=L.c(18),{schema:n,resolveType:o,value:s,formResetKey:r,onChange:i,onBreadcrumbChange:c,siteDefaultSeo:l}=t;if(H(o)==="general"){let h;e[0]!==i?(h=v=>i(v),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==r||e[3]!==n||e[4]!==l||e[5]!==h||e[6]!==s?(g=a.jsx($e,{schema:n,value:s,onChange:h,siteDefaultSeo:l,formResetKey:r}),e[2]=r,e[3]=n,e[4]=l,e[5]=h,e[6]=s,e[7]=g):g=e[7],g}let y;e[8]!==o||e[9]!==n?(y=J(n,o),e[8]=o,e[9]=n,e[10]=y):y=e[10];const p=y;let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[11]=f):f=e[11];const S=c??Ye;let m;return e[12]!==p||e[13]!==r||e[14]!==i||e[15]!==S||e[16]!==s?(m=a.jsx(ae,{schema:p,value:s,onChange:i,basePath:"",breadcrumbPath:f,onBreadcrumbChange:S},r),e[12]=p,e[13]=r,e[14]=i,e[15]=S,e[16]=s,e[17]=m):m=e[17],m}function Ye(){}function Ve(t){const e=L.c(10),{options:n,value:o,onChange:s}=t;if(n.length<=1)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Y,{className:"text-xs text-muted-foreground",children:"SEO type"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(fe,{className:"w-full",children:a.jsx(pe,{placeholder:"Select SEO type"})}),e[1]=i):i=e[1];let c;e[2]!==n?(c=n.filter(Ue).map(Be),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==c?(l=a.jsx(de,{children:c}),e[4]=c,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l||e[8]!==o?(d=a.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[r,a.jsxs(ye,{value:o,onValueChange:s,children:[i,l]})]}),e[6]=s,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}function Be(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Ue(t){return t.resolveType.length>0}function Xe(t){const e=L.c(33),{rawSeo:n,innerSeo:o,defaultResolveType:s,seoSchema:r,activeResolveType:i,seoTypeOptions:c,formResetKey:l,siteDefaultSeo:d,onBreadcrumbChange:y,onPersistRaw:p,onInnerChange:f,onClearForm:S,onBumpFormKey:m,beforeFields:h}=t;let g;e[0]!==s||e[1]!==m||e[2]!==S||e[3]!==p?(g=T=>{if(T){const j=he(s);p(j),S(),m();return}p(null),S(),m()},e[0]=s,e[1]=m,e[2]=S,e[3]=p,e[4]=g):g=e[4];const v=g;let R;e[5]!==p||e[6]!==n?(R=T=>{const j=Se(T,n);p(j)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let E;e[8]!==m||e[9]!==f?(E=T=>{f({__resolveType:T}),m()},e[8]=m,e[9]=f,e[10]=E):E=e[10];const P=E;let b;e[11]!==i||e[12]!==P||e[13]!==n||e[14]!==r||e[15]!==c?(b=k(n)&&r&&i&&c&&c.length>0&&a.jsx(Ve,{options:c,value:i,onChange:P}),e[11]=i,e[12]=P,e[13]=n,e[14]=r,e[15]=c,e[16]=b):b=e[16];let _;e[17]!==i||e[18]!==l||e[19]!==o||e[20]!==y||e[21]!==f||e[22]!==n||e[23]!==r||e[24]!==d?(_=k(n)&&r&&i&&a.jsx(Ie,{schema:r,resolveType:i,value:o,formResetKey:l,onChange:T=>f(T),onBreadcrumbChange:y,siteDefaultSeo:d}),e[17]=i,e[18]=l,e[19]=o,e[20]=y,e[21]=f,e[22]=n,e[23]=r,e[24]=d,e[25]=_):_=e[25];let u;return e[26]!==h||e[27]!==x||e[28]!==v||e[29]!==n||e[30]!==b||e[31]!==_?(u=a.jsxs(Oe,{rawSeo:n,onEnableChange:v,onAsyncRenderChange:x,children:[h,b,_]}),e[26]=h,e[27]=x,e[28]=v,e[29]=n,e[30]=b,e[31]=_,e[32]=u):u=e[32],u}export{Xe as P,Ie as S,He as a,Ce as b,Je as c,Z as d,je as f,k as i,qe as r,w as u};
1
+ import{e as L,G as te,K as U,j as a,r as G,c as ne}from"./index-Dlc4tDxO.js";import{i as oe,m as M,a2 as se,a3 as re,W as ie,e as le}from"./index-CwnBaaeQ.js";import{L as Y}from"./label-CmtFIrH6.js";import{S as $}from"./switch-CRVfQAZr.js";import{a as ce,S as ae}from"./schema-form-D_d0W0_5.js";import{c as ue,S as fe,a as pe,b as de,d as ye}from"./select-Dz7DPkoH.js";const me="website/sections/Rendering/Lazy.tsx";function K(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function N(t){if(!K(t))return!1;const e=t.__resolveType;return typeof e=="string"&&oe(e)}function k(t){return t!=null}function w(t){if(t==null)return t;if(N(t)){const e=t.section;return e==null?null:K(e)?e:{}}return K(t)?t:void 0}function z(t,e){return t===null?null:N(e)?{...e,section:t}:t}function he(t){return{__resolveType:t}}function Se(t,e){if(!k(e))return null;if(t){const n=w(e)??{};return{__resolveType:me,section:n}}return N(e)?w(e)??null:K(e)?e:null}const ge="General";function O(t){return/\/Seo(V\d+)?\.tsx$/i.test(t)||t.includes("/sections/Seo")}function Q(t,e){return t===C?ge:e}function W(t){const e=re(t),n=new Set,o=[];for(const s of e)O(s.resolveType)&&(ie(s.resolveType)||n.has(s.resolveType)||(n.add(s.resolveType),o.push({resolveType:s.resolveType,title:Q(s.resolveType,s.title),description:s.description})));return o}function V(t){const e=se(t),n=M(e,t),o=W(n?.properties?.seo);return o.length>0?o:ve(t)}function ve(t){const e=t.manifest?.blocks??{},n=[];for(const[o,s]of Object.entries(e))if(o.includes("sections"))for(const r of Object.keys(s)){if(!O(r))continue;const i=r.split("/").pop()?.replace(/\.tsx?$/,"")??r;n.push({resolveType:r,title:Q(r,i)})}return n}function Z(t){const e=V(t),n=e.find(o=>o.resolveType===C);return n?n.resolveType:e[0]?.resolveType??C}function q(t,e){const n=e.__resolveType;if(typeof n=="string"){const o=M(n,t),s=W(o?.properties?.seo);if(s.length>0)return s}return V(t)}function be(t,e){const n=q(t,e),o=n.find(s=>s.resolveType===C);return o?o.resolveType:n[0]?.resolveType??Z(t)}function Te(t,e){const n=e?.__resolveType;return typeof n=="string"&&n.length>0?n:Z(t)}function xe(t,e,n){const o=n.__resolveType;return typeof o=="string"&&O(o)?o:be(t,e)}const _e=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]),C="website/sections/Seo/SeoV2.tsx",Re=["title","titleTemplate","description","descriptionTemplate","image","favicon","type","noIndexing"];function F(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ee(t){return typeof t.__resolveType=="string"&&O(t.__resolveType)?!0:Re.some(e=>e in t)}function je(t,e){for(const[n,o]of Object.entries(t)){if(!F(o))continue;const s=o,r=s.__resolveType;if(typeof r=="string"&&_e.has(r))continue;const i=s.seo;if(F(i)){const c=i;if(Ee(c))return{blockKey:n,kind:"nested",seoData:c,blockData:s,seoResolveType:e?xe(e,s,c):typeof c.__resolveType=="string"&&O(c.__resolveType)?c.__resolveType:C}}}for(const[n,o]of Object.entries(t)){if(!F(o))continue;const s=o;if(typeof s.__resolveType=="string"&&O(s.__resolveType))return{blockKey:n,kind:"block",seoData:s,blockData:s,seoResolveType:s.__resolveType}}return null}function De(t,e){return t.kind==="block"?e:{...t.blockData,seo:e}}function qe(t,e,n){if(e.kind==="site"){const l=je(t,n);return l?{blockKey:l.blockKey,seoData:l.seoData,seoResolveType:l.seoResolveType,siteKind:l.kind,seoTypeOptions:n?q(n,l.blockData):void 0,build:d=>De(l,d)}:null}const o=t[e.pageKey];if(!F(o))return null;const s=o,r=s.seo,i=w(r),c=i&&F(i)?i:void 0;return{blockKey:e.pageKey,seoData:c,rawSeoData:r,seoResolveType:n?Te(n,c):typeof c?.__resolveType=="string"?c.__resolveType:C,seoTypeOptions:n?V(n):void 0,build:l=>({...s,seo:l===null?null:z(l,r)})}}function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ce(t,e,n,o){if(t.kind==="page"){if(!I(n))return null;const s=n.seo!==void 0?n.seo:e.rawSeoData;return{...n,seo:o===null?null:z(o,s)}}return I(n)?e.siteKind==="block"?o:{...n,seo:o}:null}function He(t,e){const n=t.__resolveType;return typeof n=="string"&&n.length>0?n:e.seoResolveType}function Je(t){const e=L.c(23),{orgSlug:n,virtualMcpId:o,branch:s,target:r,resolved:i,onSaved:c}=t,l=te(),d=`${n}/${o}/${s}`;let y;e[0]!==s||e[1]!==n||e[2]!==o?(y={orgSlug:n,virtualMcpId:o,branch:s},e[0]=s,e[1]=n,e[2]=o,e[3]=y):y=e[3];let p;e[4]!==c?(p={onSaved:c},e[4]=c,e[5]=p):p=e[5];const{save:f,flush:S,isPending:m}=le(y,p);let h;e[6]!==d||e[7]!==l||e[8]!==i||e[9]!==f||e[10]!==r?(h=E=>{i&&f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return Ce(r,i,b,E)})},e[6]=d,e[7]=l,e[8]=i,e[9]=f,e[10]=r,e[11]=h):h=e[11];const g=h;let v;e[12]!==d||e[13]!==l||e[14]!==i||e[15]!==f||e[16]!==r?(v=E=>{!i||r.kind!=="page"||f(i.blockKey,()=>{const b=l.getQueryData(U.decofile(d))?.[i.blockKey];return I(b)?{...b,seo:E}:null})},e[12]=d,e[13]=l,e[14]=i,e[15]=f,e[16]=r,e[17]=v):v=e[17];const R=v;let x;return e[18]!==S||e[19]!==m||e[20]!==R||e[21]!==g?(x={persistSeo:g,persistRawSeo:R,flush:S,isPending:m},e[18]=S,e[19]=m,e[20]=R,e[21]=g,e[22]=x):x=e[22],x}const Pe="https://deco.cx/docs/en/performance/edge-async-render";function Oe(t){const e=L.c(16),{rawSeo:n,onEnableChange:o,onAsyncRenderChange:s,children:r}=t;let i;e[0]!==n?(i=k(n),e[0]=n,e[1]=i):i=e[1];const c=i;let l;e[2]!==n?(l=N(n),e[2]=n,e[3]=l):l=e[3];const d=l;let y;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Y,{htmlFor:"seo-enable",className:"text-sm font-medium",children:"Enable SEO"}),e[4]=y):y=e[4];let p;e[5]!==c||e[6]!==o?(p=a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y,a.jsx($,{id:"seo-enable",checked:c,onCheckedChange:o})]}),e[5]=c,e[6]=o,e[7]=p):p=e[7];let f;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==s?(f=c&&a.jsxs(a.Fragment,{children:[r,a.jsxs("div",{className:"flex items-start justify-between gap-3 border-t pt-4",children:[a.jsxs("div",{className:"min-w-0 space-y-1",children:[a.jsx("p",{className:"text-sm font-medium",children:"Async render"}),a.jsxs("p",{className:"text-xs leading-normal text-muted-foreground",children:["Render SEO asynchronously with edge caching. Learn more in our"," ",a.jsx("a",{href:Pe,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline-offset-4 hover:underline",children:"documentation"}),"."]})]}),a.jsx($,{id:"seo-async-render",checked:d,onCheckedChange:s,className:"shrink-0"})]})]}),e[8]=d,e[9]=r,e[10]=c,e[11]=s,e[12]=f):f=e[12];let S;return e[13]!==p||e[14]!==f?(S=a.jsxs("div",{className:"space-y-4",children:[p,f]}),e[13]=p,e[14]=f,e[15]=S):S=e[15],S}const B=["type","title","description","canonical","favicon","image","themeColor"],Le=["jsonLD","omitVariants","title","description","noIndexing","ignoreStructuredData"],Fe=["jsonLD","title","description","noIndexing","configJsonLD"];function H(t){return t===C||/\/Seo\/SeoV2\.tsx$/i.test(t)?"general":/\/Seo\/SeoPDP/i.test(t)?"pdp":/\/Seo\/SeoPLP/i.test(t)?"plp":"full"}function Ke(t){switch(t){case"general":return B;case"pdp":return Le;case"plp":return Fe;default:return null}}function J(t,e){const n=Ke(H(e));if(!n||!t.properties)return t;const o={};for(const s of n){const r=t.properties[s];r&&(o[s]=r)}return{...t,properties:o}}function ke(){return B.filter(t=>t!=="type")}function Ne(t){return t.replace(/([A-Z])/g," $1").replace(/^./,e=>e.toUpperCase()).trim()}function Ae(t,e){return t[e]===void 0}function $e(t){const e=L.c(13),{schema:n,value:o,onChange:s,siteDefaultSeo:r,formResetKey:i}=t,l=J(n,C).properties??{},d=ke();let y;e[0]!==r?(y=!!r&&Object.keys(r).length>0,e[0]=r,e[1]=y):y=e[1];const p=y,[f,S]=G.useState(i);let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m={},e[2]=m):m=e[2];const[h,g]=G.useState(m);f!==i&&(S(i),g({}));let v;e[3]!==h||e[4]!==o?(v=u=>h[u]!==void 0?h[u]:Ae(o,u),e[3]=h,e[4]=o,e[5]=v):v=e[5];const R=v;let x;e[6]!==s||e[7]!==r||e[8]!==o?(x=(u,T)=>{g(D=>({...D,[u]:T}));const j={...o};if(T)delete j[u];else{const D=r?.[u];j[u]=D??(u==="type"?"website":"")}s(j)},e[6]=s,e[7]=r,e[8]=o,e[9]=x):x=e[9];const E=x,P="min-w-0 space-y-6",b=B.map(u=>{const T=l[u];if(!T)return null;const j=p&&d.includes(u),D=j&&R(u),X=D?r?.[u]??o[u]:o[u],ee=T.title??Ne(u);return a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:ne(D&&"pointer-events-none opacity-60"),children:ce({schema:T,value:X,onChange:A=>{D||s({...o,[u]:A})},path:u,label:ee,breadcrumbPath:[],onBreadcrumbChange:we})}),j&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($,{id:`seo-use-default-${u}`,checked:D,onCheckedChange:A=>E(u,A)}),a.jsx(Y,{htmlFor:`seo-use-default-${u}`,className:"text-xs font-normal text-muted-foreground",children:"Use default"})]})]},u)});let _;return e[10]!==i||e[11]!==b?(_=a.jsx("div",{className:P,children:b},i),e[10]=i,e[11]=b,e[12]=_):_=e[12],_}function we(){}function Ie(t){const e=L.c(18),{schema:n,resolveType:o,value:s,formResetKey:r,onChange:i,onBreadcrumbChange:c,siteDefaultSeo:l}=t;if(H(o)==="general"){let h;e[0]!==i?(h=v=>i(v),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==r||e[3]!==n||e[4]!==l||e[5]!==h||e[6]!==s?(g=a.jsx($e,{schema:n,value:s,onChange:h,siteDefaultSeo:l,formResetKey:r}),e[2]=r,e[3]=n,e[4]=l,e[5]=h,e[6]=s,e[7]=g):g=e[7],g}let y;e[8]!==o||e[9]!==n?(y=J(n,o),e[8]=o,e[9]=n,e[10]=y):y=e[10];const p=y;let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[11]=f):f=e[11];const S=c??Ye;let m;return e[12]!==p||e[13]!==r||e[14]!==i||e[15]!==S||e[16]!==s?(m=a.jsx(ae,{schema:p,value:s,onChange:i,basePath:"",breadcrumbPath:f,onBreadcrumbChange:S},r),e[12]=p,e[13]=r,e[14]=i,e[15]=S,e[16]=s,e[17]=m):m=e[17],m}function Ye(){}function Ve(t){const e=L.c(10),{options:n,value:o,onChange:s}=t;if(n.length<=1)return null;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Y,{className:"text-xs text-muted-foreground",children:"SEO type"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(fe,{className:"w-full",children:a.jsx(pe,{placeholder:"Select SEO type"})}),e[1]=i):i=e[1];let c;e[2]!==n?(c=n.filter(Ue).map(Be),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==c?(l=a.jsx(de,{children:c}),e[4]=c,e[5]=l):l=e[5];let d;return e[6]!==s||e[7]!==l||e[8]!==o?(d=a.jsxs("div",{className:"mb-4 flex flex-col gap-1.5",children:[r,a.jsxs(ye,{value:o,onValueChange:s,children:[i,l]})]}),e[6]=s,e[7]=l,e[8]=o,e[9]=d):d=e[9],d}function Be(t){return a.jsx(ue,{value:t.resolveType,children:t.title},t.resolveType)}function Ue(t){return t.resolveType.length>0}function Xe(t){const e=L.c(33),{rawSeo:n,innerSeo:o,defaultResolveType:s,seoSchema:r,activeResolveType:i,seoTypeOptions:c,formResetKey:l,siteDefaultSeo:d,onBreadcrumbChange:y,onPersistRaw:p,onInnerChange:f,onClearForm:S,onBumpFormKey:m,beforeFields:h}=t;let g;e[0]!==s||e[1]!==m||e[2]!==S||e[3]!==p?(g=T=>{if(T){const j=he(s);p(j),S(),m();return}p(null),S(),m()},e[0]=s,e[1]=m,e[2]=S,e[3]=p,e[4]=g):g=e[4];const v=g;let R;e[5]!==p||e[6]!==n?(R=T=>{const j=Se(T,n);p(j)},e[5]=p,e[6]=n,e[7]=R):R=e[7];const x=R;let E;e[8]!==m||e[9]!==f?(E=T=>{f({__resolveType:T}),m()},e[8]=m,e[9]=f,e[10]=E):E=e[10];const P=E;let b;e[11]!==i||e[12]!==P||e[13]!==n||e[14]!==r||e[15]!==c?(b=k(n)&&r&&i&&c&&c.length>0&&a.jsx(Ve,{options:c,value:i,onChange:P}),e[11]=i,e[12]=P,e[13]=n,e[14]=r,e[15]=c,e[16]=b):b=e[16];let _;e[17]!==i||e[18]!==l||e[19]!==o||e[20]!==y||e[21]!==f||e[22]!==n||e[23]!==r||e[24]!==d?(_=k(n)&&r&&i&&a.jsx(Ie,{schema:r,resolveType:i,value:o,formResetKey:l,onChange:T=>f(T),onBreadcrumbChange:y,siteDefaultSeo:d}),e[17]=i,e[18]=l,e[19]=o,e[20]=y,e[21]=f,e[22]=n,e[23]=r,e[24]=d,e[25]=_):_=e[25];let u;return e[26]!==h||e[27]!==x||e[28]!==v||e[29]!==n||e[30]!==b||e[31]!==_?(u=a.jsxs(Oe,{rawSeo:n,onEnableChange:v,onAsyncRenderChange:x,children:[h,b,_]}),e[26]=h,e[27]=x,e[28]=v,e[29]=n,e[30]=b,e[31]=_,e[32]=u):u=e[32],u}export{Xe as P,Ie as S,He as a,Ce as b,Je as c,Z as d,je as f,k as i,qe as r,w as u};
@@ -0,0 +1 @@
1
+ import{e as it,r as E,j as e,l as rt}from"./index-Dlc4tDxO.js";import{S as mt,d as pt,a as st,b as at}from"./sheet-C2OErkZR.js";import{S as nt}from"./scroll-area-CifcP4Wg.js";import{r as lt,c as ct,u as dt,a as St,i as ft,f as ut,d as vt,P as ht,S as gt}from"./page-seo-form-Cz5Nib_0.js";import{m as xt}from"./index-CwnBaaeQ.js";import"./X-CMYaHMo4.js";import"./select-Dz7DPkoH.js";import"./tooltip-D0rD3x8T.js";import"./Check-DHmAQH53.js";import"./ChevronDown-CN6qoGcG.js";import"./ChevronUp-CTGwFzLw.js";import"./label-CmtFIrH6.js";import"./switch-CRVfQAZr.js";import"./schema-form-D_d0W0_5.js";import"./agent-icon-D1ySfhKA.js";import"./AlertCircle-De-QnqNt.js";import"./Tool01-DPPRaW86.js";import"./SwitchHorizontal01-CLZ8VEjC.js";import"./RefreshCcw01-CcpA4rje.js";import"./XCircle-BdbzgmP6.js";import"./ArrowUpRight-B0GfNpsw.js";import"./ZapSquare-AN7R7mTa.js";import"./Users03-CKUicuTa.js";import"./CheckCircle-DKSRB9Xd.js";import"./ChevronLeft-HFx1Uufy.js";import"./ChevronRight-BJSYQUmF.js";import"./DotsVertical-jUGLCiy5.js";import"./Container-DZBZNA8Y.js";import"./Eye-CGoLCmzu.js";import"./ZoomOut-Xe1itnU7.js";import"./Globe01--hrfRyvA.js";import"./FilterLines-DYSfUppO.js";import"./Star01-BjpgI7im.js";import"./Palette-B9PbEO6t.js";import"./HardDrive-yKlUP3QG.js";import"./Stars02-Cv3Kyp_N.js";import"./Key01-DqH2W8Qa.js";import"./LayoutLeft-CLZVvVLM.js";import"./LinkExternal01-CaYoYL1Y.js";import"./Monitor01-BRL4_dKI.js";import"./Sun-C0I4hv8e.js";import"./Play-Btpg8EpH.js";import"./Plus-Cv0T2Pov.js";import"./SearchMd-BP9M1g2N.js";import"./Settings02-BMRrFVdB.js";import"./Shield01-rOhEAWZ1.js";import"./Stars01-yuWjNyMF.js";import"./Trash01-s7FZsfBC.js";import"./Upload01-xUCMslnL.js";import"./User01-BsF0RS3z.js";import"./Users01-D-iBSVXa.js";import"./XClose-N2P2hiYb.js";import"./Zap-gqEvk94k.js";import"./calendar-DZmZKFmb.js";import"./input-CDaarCl_.js";import"./popover-DaxAVDXR.js";import"./textarea-BhyLj2Dp.js";import"./dropdown-menu-C-Cxaez8.js";import"./image-field-C3Pv1Di2.js";import"./dialog-IkiImd7I.js";import"./skeleton-bErIIEAe.js";import"./tabs-_yym-ubf.js";import"./use-file-configs-CDby3RwC.js";import"./studio-tools-B-zlmqyw.js";import"./useInfiniteQuery-Dzg2BCY9.js";import"./infiniteQueryObserver-D4Z6Hq7s.js";import"./agent-capabilities-Deuuzqbm.js";import"./chat-context-BOn4WPpq.js";import"./tab-id-By_JW--7.js";import"./use-mcp-client-BoOtVD9g.js";import"./decopilot-sse-pool-Bj1W2y0B.js";import"./create-sse-subscription-BS5983N4.js";import"./use-virtual-mcp-_FyR-EfH.js";import"./use-collections-CH3Uvmj5.js";import"./use-ai-providers-BL6EQsm8.js";import"./use-organization-settings-BQtNgLEs.js";import"./pair-BfYvjacw.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DHiMTnai.js";import"./file-type-icon-BYSeb5A3.js";import"./content-blocks-o63cs2vh.js";import"./types-Bt2jh4HB.js";import"./shell-layout-D-4Zna-j.js";import"./avatar-AI83PqVE.js";import"./required-auth-layout-q1UX5iFV.js";import"./useRouterState-CfhsEB7J.js";import"./use-org-sso-BCRYycoj.js";import"./integration-icon-DylMdkB7.js";import"./use-navigate-to-agent-_X_kAEcz.js";import"./use-connection-BGpjiuJJ.js";import"./use-mcp-prompts-CYbN8Yyl.js";import"./form-ChQh_wIn.js";import"./spinner-DUmur8qx.js";import"./drawer-DO_U_Bhd.js";import"./collection-search-B-CX-Cb7.js";import"./toggle-group-BYYoZiYB.js";import"./connect-desktop-dialog-DRFjva34.js";import"./agent-icons-DpDt_xvu.js";import"./checkbox-Cwl_z5GL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BkfPlxIX.js";import"./card-DmbfBYZU.js";import"./command-BHuAtd3n.js";import"./index-C5R8l9NR.js";import"./sortable.esm-D_73qywG.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DEvkcpmQ.js";import"./use-registry-connections-CPtcwe6P.js";import"./extract-connection-data-Uz57CpVC.js";import"./generate-id-BrtbvnKY.js";import"./collections-CXYJ8MVZ.js";import"./collection-tabs-CdfD34L4.js";import"./badge-CikIA9ZK.js";import"./connection-form-helpers-BxYEqmM8.js";import"./use-infinite-scroll-BlDyJWAa.js";import"./useSuspenseInfiniteQuery-D3ys-EbO.js";import"./index-DFp-rnQf.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-D7iIgnMy.js";import"./sidebar-BT1O99E-.js";import"./toolbar-BQgYgute.js";import"./use-create-virtual-mcp-8G8o89BT.js";import"./github-repo-picker-13FobS0K.js";import"./use-mcp-tools-DlzThqmJ.js";import"./alert-dialog-CBzhgusU.js";import"./index-CweEMiqH.js";import"./use-org-auth-client-ziK5gAU8.js";import"./hover-card-5iaAH0_M.js";import"./task-status-B3M1uY2i.js";import"./use-status-sounds-CZU7jLXq.js";import"./empty-state-o52Hq4fy.js";import"./resizable-B_wg5OKG.js";import"./use-capability-DqPX2R7m.js";import"./header-tab-button-Qu1eh6fb.js";import"./index-Dcfw-W2O.js";import"./user-CXZKnlfK.js";import"./tools-list-Bib10JJv.js";import"./use-debounced-autosave-BnF-F24h.js";import"./index-NNvehl9i.js";import"./search-input-eml2HEUh.js";import"./use-secrets-wimlaYjN.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-BIWbMpHu.js";import"./view-mode-toggle-BO9qiFWG.js";import"./select-model-B6KC9bZ9.js";import"./use-automations-jCgcI_Hn.js";import"./monaco-editor--8410HRL.js";import"./automation-runs-BcknuTTv.js";import"./table-70fRVfwQ.js";import"./use-members-BLEStPtC.js";import"./automation-list-row-7qb4yrwv.js";function Si(u){const t=it.c(46),{open:N,onOpenChange:P,orgSlug:Q,virtualMcpId:U,branch:W,decofile:G,meta:s,target:m,onSaved:X}=u,o=lt(G,m,s),k=m.kind==="site"?"site":m.pageKey,[Y,Z]=E.useState(k),[tt,i]=E.useState(null),[J,g]=E.useState(void 0),[x,y]=E.useState(0);Y!==k&&(Z(k),i(null),g(void 0),y(wt));const{persistSeo:a,persistRawSeo:I,flush:K,isPending:D}=ct({orgSlug:Q,virtualMcpId:U,branch:W,target:m,resolved:o,onSaved:X}),w=m.kind==="page",ot=w?o?.rawSeoData:void 0,v=J!==void 0?J:ot,et=w?dt(v)??void 0:void 0,h=tt??et??o?.seoData??{},p=o?St(h,o):null,n=p&&(!w||ft(v))?xt(p,s):null,_=m.kind==="page"?ut(G,s)?.seoData??void 0:void 0;let j;t[0]!==s?(j=vt(s),t[0]=s,t[1]=j):j=t[1];const M=j;let R;t[2]!==a||t[3]!==o||t[4]!==i?(R=r=>{if(!o)return;const L=r;i(L),a(L)},t[2]=a,t[3]=o,t[4]=i,t[5]=R):R=t[5];const V=R;let F;t[6]!==K||t[7]!==P?(F=r=>{r||K(),P(r)},t[6]=K,t[7]=P,t[8]=F):F=t[8];const z=F,A=m.kind==="site"?"Site SEO":"Page SEO",T=w&&o,B=m.kind==="site"&&o&&n,H=m.kind==="site"?"No site-level SEO block found.":o?"SEO schema not found for this page.":"Could not load page SEO.";let C;t[9]!==i?(C=()=>i(null),t[9]=i,t[10]=C):C=t[10];const $=C;let O;t[11]!==y?(O=()=>y(yt),t[11]=y,t[12]=O):O=t[12];const q=O;let l;t[13]!==A?(l=e.jsx(mt,{className:"text-sm font-semibold",children:A}),t[13]=A,t[14]=l):l=t[14];let c;t[15]!==D?(c=D&&e.jsx(rt,{size:14,className:"animate-spin text-muted-foreground"}),t[15]=D,t[16]=c):c=t[16];let d;t[17]!==l||t[18]!==c?(d=e.jsxs(pt,{className:"px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[l,c]}),t[17]=l,t[18]=c,t[19]=d):d=t[19];let S;t[20]!==p||t[21]!==q||t[22]!==$||t[23]!==M||t[24]!==v||t[25]!==h||t[26]!==H||t[27]!==x||t[28]!==V||t[29]!==I||t[30]!==a||t[31]!==o||t[32]!==n||t[33]!==i||t[34]!==g||t[35]!==T||t[36]!==B||t[37]!==_?(S=!o||!T&&!B?e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:H}):e.jsx(nt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"mx-auto max-w-sm",children:T?e.jsx(ht,{rawSeo:v,innerSeo:h,defaultResolveType:M,seoSchema:n,activeResolveType:p,seoTypeOptions:o.seoTypeOptions,formResetKey:x,siteDefaultSeo:_,onPersistRaw:r=>{g(r),I(r)},onInnerChange:r=>{i(r),a(r)},onClearForm:$,onBumpFormKey:q}):n&&p&&e.jsx(gt,{schema:n,resolveType:p,value:h,formResetKey:x,onChange:V})})})}),t[20]=p,t[21]=q,t[22]=$,t[23]=M,t[24]=v,t[25]=h,t[26]=H,t[27]=x,t[28]=V,t[29]=I,t[30]=a,t[31]=o,t[32]=n,t[33]=i,t[34]=g,t[35]=T,t[36]=B,t[37]=_,t[38]=S):S=t[38];let f;t[39]!==d||t[40]!==S?(f=e.jsxs(st,{side:"right",className:"w-[400px] sm:max-w-[440px] p-0 gap-0",children:[d,S]}),t[39]=d,t[40]=S,t[41]=f):f=t[41];let b;return t[42]!==z||t[43]!==N||t[44]!==f?(b=e.jsx(at,{open:N,onOpenChange:z,children:f}),t[42]=z,t[43]=N,t[44]=f,t[45]=b):b=t[45],b}function yt(u){return u+1}function wt(u){return u+1}export{Si as SeoSheet};
@@ -1,4 +1,4 @@
1
- import{e as $,r as B,T as ot,I as Bt,H as Ht,j as n,B as ke,W as Je,c as V,t as Wt,q as he,G as Ut,a as qt,K as me,o as ze,n as Oe,f as je,E as Vt,C as Gt,bB as De}from"./index-DBqH3_Tr.js";import{$ as Kt,G as Jt,B as Xt,ac as Qt,O as Yt,N as Zt,M as es,a8 as at,ad as ts,ae as ss,A as rt,af as ie,ag as ns,ah as ls,ai as os,b as as}from"./agent-icon-OWcPDEQ2.js";import{t as Be}from"./Stars01-EZHZaPSP.js";import{a as it,t as rs,b as we,d as is}from"./XCircle-UQit86MX.js";import{i as He}from"./Check-Bk-n4rKs.js";import{i as Xe}from"./ChevronRight-DRFF6KW4.js";import{a as ct,s as cs}from"./Eye-BR5jFpci.js";import{a as de,c as Qe,t as us}from"./format-time-Cy7tTmZp.js";import{N as ut,R as dt,e as ft,C as ds,f as fs,g as ms,u as ps,i as xs,d as gs}from"./scroll-area-DOSO9pu3.js";import{u as mt}from"./use-copy-BZu-B9lH.js";import{T as pe,a as xe,b as ge}from"./tooltip-B7sOnQkv.js";import{M as pt,I as xt,F as hs}from"./file-type-icon-DlkWBYHv.js";import{c as bs}from"./content-blocks-o63cs2vh.js";import{g as gt,M as ys}from"./types-DBP54icS.js";import{f as $e,i as js,d as We,a as vs}from"./chat-context-hSR2djUS.js";import{m as Ns,f as ks,n as Ss,o as _s}from"./tab-id-DJcQxSw_.js";import{u as ws}from"./studio-tools-hfOcm94T.js";import{c as Ts,u as ht,b as Cs}from"./use-mcp-client-BgKdABiW.js";import{i as bt}from"./AlertCircle-DU7uZY8J.js";import{s as Ce,t as yt}from"./Star01-Bj8KnWg6.js";import{s as $s}from"./XClose-Bgoke-N6.js";import{n as jt}from"./ZapSquare-H66QOKYB.js";import{n as vt,i as Is}from"./Globe01-CNB6Mpsd.js";import{b as Ms,i as Ls,a as Le}from"./Tool01-CE1enLWz.js";import{a as Ye,i as Rs}from"./ZoomOut-Cx-hi9HP.js";import{i as Ne}from"./Monitor01-B2xyeevM.js";import{i as As}from"./SearchMd-AWrKGzzG.js";import{i as zs}from"./Upload01-Br3xRIzS.js";import{u as Ps,c as Es}from"./shell-layout-Bhb76vPi.js";import{n as Nt}from"./LinkExternal01-DtQPZgan.js";import{I as Ie}from"./integration-icon-C1XpJ7QJ.js";import{u as Fs}from"./use-virtual-mcp-FBTL02d0.js";import{a as kt}from"./Users03-CTeoWFzj.js";import{a as ce}from"./Palette-BbNQF7ac.js";import{k as St}from"./use-navigate-to-agent-B96HLz_j.js";import{a as Os}from"./use-connection-lmAzDQtG.js";import{s as Ds}from"./Stars02-C_A7q-Eh.js";import{g as Bs}from"./use-mcp-prompts-D52UL8AH.js";import{c as Hs,b as Ws,d as Us,a as qs,D as Vs}from"./dialog-C6QaYxl0.js";import{a as Gs,F as Ks,b as Js,c as Xs,d as Qs,f as Ys}from"./form-9w_l2sE8.js";import{I as Zs}from"./input-Cuzo-zTy.js";import{S as en}from"./spinner-CODSjjQl.js";import{t as tn}from"./ChevronDown-D_SiD52e.js";const sn={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(sn)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function wt(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Tt(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 pa(s){return s.reduce((e,t)=>Tt(e,t.metadata?.usage),wt())}function nn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Ue(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function qe(s,e){if(!e)return s;const t=`${nn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function ln(s,e){return qe(s,e).replace(/[_-]/g," ").toLowerCase()}function on(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Je().min(1,"Required"):Je();return ot(e)}function an(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function rn(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:r,defaultValues:a}=s,o=B.useId();let u;if(e[0]!==t){const A=t?on(t):ot({});u=Bt(A),e[0]=t,e[1]=u}else u=e[1];const i=u;let m;e[2]!==a||e[3]!==t?(m=t?an(t,a):{},e[2]=a,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==i||e[6]!==m?(p={resolver:i,defaultValues:m,mode:"onChange"},e[5]=i,e[6]=m,e[7]=p):p=e[7];const c=Ht(p);let d;e[8]!==t?.arguments?(d=t?.arguments??[],e[8]=t?.arguments,e[9]=d):d=e[9];const x=d;let g;e[10]!==c||e[11]!==r||e[12]!==l?(g=async A=>{await r(A),l(null),c.reset()},e[10]=c,e[11]=r,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==c||e[15]!==l?(h=A=>{A||(c.reset(),l(null))},e[14]=c,e[15]=l,e[16]=h):h=e[16];const k=h;if(!t)return null;let y;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(y=t.title||ln(t.name,Ue(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(Hs,{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(Ws,{children:[v,j]}),e[25]=j,e[26]=v,e[27]=N):N=e[27];let S;e[28]!==c||e[29]!==b?(S=A=>{A.stopPropagation(),c.handleSubmit(b)(A)},e[28]=c,e[29]=b,e[30]=S):S=e[30];let _;if(e[31]!==x||e[32]!==c.control||e[33]!==c.formState.isSubmitting){let A;e[35]!==c.control||e[36]!==c.formState.isSubmitting?(A=P=>n.jsx(Ks,{control:c.control,name:P.name,render:O=>{const{field:W}=O;return n.jsxs(Js,{children:[n.jsxs(Xs,{className:"text-xs",children:[P.name,P.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(Qs,{children:n.jsx(Zs,{...W,value:W.value??"",required:P.required,placeholder:P.description??"",className:"h-9",disabled:c.formState.isSubmitting})}),n.jsx(Ys,{})]})}},P.name),e[35]=c.control,e[36]=c.formState.isSubmitting,e[37]=A):A=e[37],_=x.map(A),e[31]=x,e[32]=c.control,e[33]=c.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==k?(w=()=>k(!1),e[38]=k,e[39]=w):w=e[39];let T;e[40]!==c.formState.isSubmitting||e[41]!==w?(T=n.jsx(ke,{type:"button",variant:"ghost",onClick:w,disabled:c.formState.isSubmitting,children:"Cancel"}),e[40]=c.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==c.formState.isSubmitting?(I=c.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(en,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=c.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==c.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(ke,{type:"submit",form:o,disabled:c.formState.isSubmitting,children:I}),e[45]=c.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(Us,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let L;e[52]!==o||e[53]!==S||e[54]!==_||e[55]!==C?(L=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[_,C]}),e[52]=o,e[53]=S,e[54]=_,e[55]=C,e[56]=L):L=e[56];let R;e[57]!==c||e[58]!==L?(R=n.jsx(Gs,{...c,children:L}),e[57]=c,e[58]=L,e[59]=R):R=e[59];let F;e[60]!==N||e[61]!==R?(F=n.jsxs(qs,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,R]}),e[60]=N,e[61]=R,e[62]=F):F=e[62];let z;return e[63]!==k||e[64]!==F?(z=n.jsx(Vs,{open:!0,onOpenChange:k,children:F}),e[63]=k,e[64]=F,e[65]=z):z=e[65],z}function Ct(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 cn(s){return s.storage.mention}function xa(s,e,t){s.chain().focus().insertContentAt(e,[$t(t),{type:"text",text:" "}]).run()}function $t(s){return{type:"mention",attrs:s}}function un(s){const e=$.c(19),{node:t,selected:l,view:r,editor:a,getPos:o}=s,{name:u,char:f,kind:i,id:m,args:p}=t.attrs,c=l&&r.editable,d=f==="@",x=r.editable&&f==="/"&&i!=="resource";let g;e[0]!==p||e[1]!==a||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==u?(g=_=>{if(!x)return;const T=cn(a)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:u,args:p??{},pos:I}))},e[0]=p,e[1]=a,e[2]=o,e[3]=m,e[4]=x,e[5]=u,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",k=d?"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=c&&"outline-2 outline-blue-300 outline-offset-0",v=x&&"hover:brightness-95";let j;e[7]!==h||e[8]!==k||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",k,y,v,"capitalize"),e[7]=h,e[8]=k,e[9]=y,e[10]=v,e[11]=j):j=e[11];let N;e[12]!==u?(N=u?Ct(u):"",e[12]=u,e[13]=N):N=e[13];let S;return e[14]!==f||e[15]!==b||e[16]!==j||e[17]!==N?(S=n.jsxs(ft,{onClick:b,className:j,children:[f,N]}),e[14]=f,e[15]=b,e[16]=j,e[17]=N,e[18]=S):S=e[18],S}const dn=ut.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 dt(un)}}),fn=/^mcp__[a-zA-Z0-9_-]+__/;function It(s){return s.replace(fn,"")}function Ve(s){const e=$.c(18),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o,animate:u}=s,f=r===void 0?!1:r,i=o===void 0?!1:o,m=u===void 0?!1:u,{handleCopy:p}=mt(),[c,d]=B.useState(!1);let x;e[0]!==p||e[1]!==t||e[2]!==l.text?(x=async()=>{Wt("chat_message_copied",{message_id:t,chars:l.text.length}),await p(l.text),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=p,e[1]=t,e[2]=l.text,e[3]=x):x=e[3];const g=x,b=f&&a,h=b||a;let k;e[4]!==m||e[5]!==t||e[6]!==l.text?(k=n.jsx(pt,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=k):k=e[7];let y;e[8]!==i||e[9]!==a||e[10]!==g||e[11]!==c||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",i?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,b&&a&&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:c?n.jsx(He,{className:"size-4"}):n.jsx(ct,{className:"size-4"})})]}),e[8]=i,e[9]=a,e[10]=g,e[11]=c,e[12]=h,e[13]=b,e[14]=y):y=e[14];let v;return e[15]!==k||e[16]!==y?(v=n.jsxs("div",{className:"group/part relative",children:[k,y]}),e[15]=k,e[16]=y,e[17]=v):v=e[17],v}function ga(s,e,t){s.chain().focus().insertContentAt(e,[mn(t),{type:"text",text:" "}]).run()}function mn(s){return{type:"file",attrs:s}}function pn(s){const e=$.c(17),{node:t,selected:l,view:r}=s,{name:a,mimeType:o,data:u}=t.attrs,f=l&&r.editable;let i;e[0]!==o?(i=o.startsWith("image/"),e[0]=o,e[1]=i):i=e[1];const m=i,p=f&&"outline-2 outline-blue-300 outline-offset-0";let c;e[2]!==p?(c=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]=c):c=e[3];let d;e[4]!==a?(d=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:a})}),e[4]=a,e[5]=d):d=e[5];let x;e[6]!==u||e[7]!==m||e[8]!==o||e[9]!==a?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${u}`,alt:a,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:a}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=u,e[7]=m,e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==d||e[12]!==x?(g=n.jsxs(ge,{children:[d,x]}),e[11]=d,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==c||e[15]!==g?(b=n.jsx(ft,{className:c,children:g}),e[14]=c,e[15]=g,e[16]=b):b=e[16],b}const xn=ut.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 dt(pn)}}),fe=16,Pe=2.5,Ee=(fe-Pe)/2,Re=2*Math.PI*Ee;function gn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:r,outputTokens:a,cost:o}=t;if(!l&&!r&&!a)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Kt,{size:12}),e[0]=u):u=e[0];let f;e[1]!==o||e[2]!==l?(f=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=f):f=e[3];let i;e[4]!==f?(i=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:[u,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:f})]})}),e[4]=f,e[5]=i):i=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 c;e[8]!==r?(c=r.toLocaleString(),e[8]=r,e[9]=c):c=e[9];let d;e[10]!==c?(d=n.jsx("span",{className:"text-right tabular-nums",children:c}),e[10]=c,e[11]=d):d=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=a-(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 k;e[17]!==r||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(k=(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:r>0?`${(t.cacheReadTokens/r*100).toFixed(0)}%`:"0%"})]}),e[17]=r,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=k):k=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]!==k||e[25]!==y||e[26]!==d?(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,d,x,h,k,y]})]}),e[23]=h,e[24]=k,e[25]=y,e[26]=d,e[27]=v):v=e[27];let j;return e[28]!==v||e[29]!==i?(j=n.jsxs(ge,{children:[i,v]}),e[28]=v,e[29]=i,e[30]=j):j=e[30],j}function hn(s){const e=$.c(19),{usage:t,duration:l}=s,r=l!=null&&l>0,a=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!r&&!a&&!o)return null;let u;e[0]!==l||e[1]!==r?(u=r?de(l/1e3):null,e[0]=l,e[1]=r,e[2]=u):u=e[2];const f=u;let i;e[3]!==l||e[4]!==f||e[5]!==t?(i=f&&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:f})}),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]=f,e[5]=t,e[6]=i):i=e[6];let m;e[7]!==a||e[8]!==r||e[9]!==o?(m=r&&(a||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=a,e[8]=r,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==a||e[12]!==o||e[13]!==t?(p=(a||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:a?`$${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]=a,e[12]=o,e[13]=t,e[14]=p):p=e[14];let c;return e[15]!==i||e[16]!==m||e[17]!==p?(c=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[i,m,p]}),e[15]=i,e[16]=m,e[17]=p,e[18]=c):c=e[18],c}function ha(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:r,onOpenContextPanel:a}=s,o=Math.min(l/r*100,100),u=Re-o/100*Re,f=t?.cost??0,i=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 c;e[2]!==f?(c=f>0?`, $${f.toFixed(2)}`:"",e[2]=f,e[3]=c):c=e[3];const d=`Context usage: ${p}%${c}`,x=a?"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:Ee,fill:"none",stroke:"currentColor",strokeWidth:Pe,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let k;e[7]!==h?(k=V(h),e[7]=h,e[8]=k):k=e[8];let y;e[9]!==u||e[10]!==k?(y=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Ee,fill:"none",stroke:"currentColor",strokeWidth:Pe,strokeDasharray:Re,strokeDashoffset:u,strokeLinecap:"round",className:k})]}),e[9]=u,e[10]=k,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]!==f?(j=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,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 S;e[19]!==a||e[20]!==N||e[21]!==d||e[22]!==g||e[23]!==y?(S=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":d,className:g,children:[y,N]})}),e[19]=a,e[20]=N,e[21]=d,e[22]=g,e[23]=y,e[24]=S):S=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]!==r?(T=r.toLocaleString(),e[28]=r,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]!==f||e[37]!==i||e[38]!==m?(C=f>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",f.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:i.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=f,e[37]=i,e[38]=m,e[39]=C):C=e[39];let L;e[40]!==i||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(L=((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:i>0?`${((t?.cacheReadTokens??0)/i*100).toFixed(0)}%`:"0%"})]}),e[40]=i,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=L):L=e[43];let R;e[44]!==M||e[45]!==C||e[46]!==L?(R=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,L]})}),e[44]=M,e[45]=C,e[46]=L,e[47]=R):R=e[47];let F;return e[48]!==S||e[49]!==R?(F=n.jsxs(ge,{children:[S,R]}),e[48]=S,e[49]=R,e[50]=F):F=e[50],F}function bn(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(ms,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function yn(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(ds,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function jn(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(fs,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Mt({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:r=500}){const[a,o]=B.useState(null),[u,f]=B.useState(!1),i=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!a)return;let p=a.parentElement;for(;p;){const c=window.getComputedStyle(p);if(c.overflowY==="auto"||c.overflowY==="scroll"||c.overflow==="auto"||c.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return B.useEffect(()=>{if(!a)return;const p=new IntersectionObserver(c=>{const d=c[0]?.isIntersecting??!1;f(d)},{root:s?.current??null,threshold:i,rootMargin:"0px"});return p.observe(a),()=>p.disconnect()},[a,i]),B.useEffect(()=>{if(!e||!u)return;const p=setInterval(m,r);return()=>clearInterval(p)},[e,u,r]),B.useEffect(()=>{!e||!u||m()},[e,u,...t]),{sentinelRef:o,isTracking:u}}function D(s){const e=$.c(53),{icon:t,title:l,usage:r,summary:a,state:o,detail:u,detailVariant:f,forceOpen:i,variant:m,trailing:p,iconDestructive:c,alwaysChevron:d,defaultOpen:x,children:g}=s,b=f===void 0?"code":f,h=m===void 0?"default":m,[k,y]=B.useState(x??!1),{handleCopy:v,copied:j}=mt(),N=o==="loading",S=o==="error";let _;e[0]!==u?(_=u&&u.trim(),e[0]=u,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(i??!1)||k,C=B.useRef(null),L=N&&M;let R;e[2]!==u?(R=[u],e[2]=u,e[3]=R):R=e[3];let F;e[4]!==L||e[5]!==R?(F={containerRef:C,enabled:L,contentDeps:R},e[4]=L,e[5]=R,e[6]=F):F=e[6];const{sentinelRef:z}=Mt(F),A=i?void 0:y,P=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=N&&"shimmer";let H;e[7]!==W||e[8]!==U||e[9]!==O?(H=V("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",O,W,U),e[7]=W,e[8]=U,e[9]=O,e[10]=H):H=e[10];const Y=!T;let K;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==c||e[15]!==S||e[16]!==T?(K=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?n.jsx(Xe,{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",c?"[&>svg]:text-destructive/70":S?"[&>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(Xe,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=d,e[12]=M,e[13]=t,e[14]=c,e[15]=S,e[16]=T,e[17]=K):K=e[17];const Q=S?"text-warning/80":"text-foreground";let X;e[18]!==Q?(X=V("shrink-0 text-[14px] font-normal",Q),e[18]=Q,e[19]=X):X=e[19];let Z;e[20]!==X||e[21]!==l?(Z=n.jsx("span",{className:X,children:l}),e[20]=X,e[21]=l,e[22]=Z):Z=e[22];let E;e[23]!==a?(E=a?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:a})}):n.jsx("div",{className:"flex-1"}),e[23]=a,e[24]=E):E=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 G;e[27]!==r?(G=n.jsx(gn,{usage:r}),e[27]=r,e[28]=G):G=e[28];let J;e[29]!==H||e[30]!==Y||e[31]!==K||e[32]!==Z||e[33]!==E||e[34]!==q||e[35]!==G||e[36]!==P?(J=n.jsxs(yn,{disabled:P,className:H,"aria-disabled":Y,children:[K,Z,E,q,G]}),e[29]=H,e[30]=Y,e[31]=K,e[32]=Z,e[33]=E,e[34]=q,e[35]=G,e[36]=P,e[37]=J):J=e[37];let ee;e[38]!==g||e[39]!==j||e[40]!==u||e[41]!==b||e[42]!==v||e[43]!==T||e[44]!==z?(ee=T&&n.jsx(jn,{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:u}),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:u})}),n.jsx("button",{type:"button",onClick:()=>v(u),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(He,{className:"size-3.5"}):n.jsx(ct,{className:"size-3.5"})})]}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=j,e[40]=u,e[41]=b,e[42]=v,e[43]=T,e[44]=z,e[45]=ee):ee=e[45];let ue;e[46]!==M||e[47]!==J||e[48]!==ee||e[49]!==A?(ue=n.jsxs(bn,{open:M,onOpenChange:A,className:"min-w-0",children:[J,ee]}),e[46]=M,e[47]=J,e[48]=ee,e[49]=A,e[50]=ue):ue=e[50];const le=ue;if(I){let oe;return e[51]!==le?(oe=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:le}),e[51]=le,e[52]=oe):oe=e[52],oe}return le}function te(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 r;return e[2]!==l?(r=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=r):r=e[3],r}const Lt=4;function Rt(s){const e=$.c(5),{count:t,noun:l,onClick:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(it,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=a):a=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==r?(o=n.jsxs("button",{type:"button",onClick:r,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,a]}),e[1]=t,e[2]=l,e[3]=r,e[4]=o):o=e[4],o}function vn(s){const e=$.c(24),{org:t}=he(),l=Ut(),r=Ns(),a=ws();let o;e[0]!==a||e[1]!==s?(o=async g=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=(await a.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 a.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:v}}),y},e[0]=a,e[1]=s,e[2]=o):o=e[2];let u,f,i;e[3]!==t||e[4]!==l||e[5]!==s?(u=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}},f=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},i=(g,b,h)=>{const k=me.ensureTask(t.id,s??"");h?.previous===void 0?l.removeQueries({queryKey:k,exact:!0}):l.setQueryData(k,h.previous),ze.error(g instanceof Error?g.message:"Failed to expand tool")},e[3]=t,e[4]=l,e[5]=s,e[6]=u,e[7]=f,e[8]=i):(u=e[6],f=e[7],i=e[8]);let m;e[9]!==o||e[10]!==u||e[11]!==f||e[12]!==i?(m={mutationFn:o,onMutate:u,onSuccess:f,onError:i},e[9]=o,e[10]=u,e[11]=f,e[12]=i,e[13]=m):m=e[13];const p=qt(m);let c;e[14]!==r||e[15]!==p||e[16]!==t||e[17]!==l||e[18]!==s?(c=g=>{if(!s||!r)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}),r.patchThread({id:s,metadata:v}),p.mutate(g)},e[14]=r,e[15]=p,e[16]=t,e[17]=l,e[18]=s,e[19]=c):c=e[19];const d=c;let x;return e[20]!==d||e[21]!==p.isPending||e[22]!==p.mutate?(x={addOrReplace:p.mutate,addOrReplaceEager:d,isPending:p.isPending},e[20]=d,e[21]=p.isPending,e[22]=p.mutate,e[23]=x):x=e[23],x}function Nn(s,e,t,l){const{data:r,isLoading:a}=Oe({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await Ts({connectionId:e,orgId:t,orgSlug:l});try{const{tools:u}=await o.listTools(),f=It(s);return u.find(i=>i.name===f)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:r??void 0,isLoading:a}}const kn={read:{icon:Ye,label:"Read File"},write:{icon:Ls,label:"Write File"},edit:{icon:es,label:"Edit File"},grep:{icon:As,label:"Search Content"},glob:{icon:Rs,label:"Find Files"},bash:{icon:Zt,label:"Run Command"},read_tool_output:{icon:Ye,label:"Read Tool Output"},read_resource:{icon:Yt,label:"Read Resource"},read_prompt:{icon:jt,label:"Read Prompt"},enable_tool:{icon:Ms,label:"Enable Tool"},open_in_agent:{icon:Qt,label:"Open in Agent"},sandbox:{icon:Xt,label:"Run Code"},copy_to_sandbox:{icon:vt,label:"Load File"},share_with_user:{icon:zs,label:"Share with User"},take_screenshot:{icon:Ne,label:"Take Screenshot"},scrape_url:{icon:Ce,label:"Scrape URL"},inspect_page:{icon:Jt,label:"Inspect Page"}};function Ge(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]"}}const Sn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function _n(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 B,T as ot,I as Bt,H as Ht,j as n,B as ke,W as Je,c as V,t as Wt,q as he,G as Ut,a as qt,K as me,o as ze,n as Oe,f as je,E as Vt,C as Gt,bB as De}from"./index-Dlc4tDxO.js";import{$ as Kt,G as Jt,B as Xt,ac as Qt,O as Yt,N as Zt,M as es,a8 as at,ad as ts,ae as ss,A as rt,af as ie,ag as ns,ah as ls,ai as os,b as as}from"./agent-icon-D1ySfhKA.js";import{t as Be}from"./Stars01-yuWjNyMF.js";import{a as it,t as rs,b as we,d as is}from"./XCircle-BdbzgmP6.js";import{i as He}from"./Check-DHmAQH53.js";import{i as Xe}from"./ChevronRight-BJSYQUmF.js";import{a as ct,s as cs}from"./Eye-CGoLCmzu.js";import{a as de,c as Qe,t as us}from"./format-time-Cy7tTmZp.js";import{N as ut,R as dt,e as ft,C as ds,f as fs,g as ms,u as ps,i as xs,d as gs}from"./scroll-area-CifcP4Wg.js";import{u as mt}from"./use-copy-DHiMTnai.js";import{T as pe,a as xe,b as ge}from"./tooltip-D0rD3x8T.js";import{M as pt,I as xt,F as hs}from"./file-type-icon-BYSeb5A3.js";import{c as bs}from"./content-blocks-o63cs2vh.js";import{g as gt,M as ys}from"./types-Bt2jh4HB.js";import{g as $e,i as js,d as We,a as vs}from"./chat-context-BOn4WPpq.js";import{l as Ns,f as ks,m as Ss,n as _s}from"./tab-id-By_JW--7.js";import{u as ws}from"./studio-tools-B-zlmqyw.js";import{c as Ts,u as ht,b as Cs}from"./use-mcp-client-BoOtVD9g.js";import{i as bt}from"./AlertCircle-De-QnqNt.js";import{s as Ce,t as yt}from"./Star01-BjpgI7im.js";import{s as $s}from"./XClose-N2P2hiYb.js";import{n as jt}from"./ZapSquare-AN7R7mTa.js";import{n as vt,i as Is}from"./Globe01--hrfRyvA.js";import{b as Ms,i as Ls,a as Le}from"./Tool01-DPPRaW86.js";import{a as Ye,i as Rs}from"./ZoomOut-Xe1itnU7.js";import{i as Ne}from"./Monitor01-BRL4_dKI.js";import{i as As}from"./SearchMd-BP9M1g2N.js";import{i as zs}from"./Upload01-xUCMslnL.js";import{u as Ps,c as Es}from"./shell-layout-D-4Zna-j.js";import{n as Nt}from"./LinkExternal01-CaYoYL1Y.js";import{I as Ie}from"./integration-icon-DylMdkB7.js";import{u as Fs}from"./use-virtual-mcp-_FyR-EfH.js";import{a as kt}from"./Users03-CKUicuTa.js";import{a as ce}from"./Palette-B9PbEO6t.js";import{k as St}from"./use-navigate-to-agent-_X_kAEcz.js";import{a as Os}from"./use-connection-BGpjiuJJ.js";import{s as Ds}from"./Stars02-Cv3Kyp_N.js";import{g as Bs}from"./use-mcp-prompts-CYbN8Yyl.js";import{c as Hs,b as Ws,d as Us,a as qs,D as Vs}from"./dialog-IkiImd7I.js";import{a as Gs,F as Ks,b as Js,c as Xs,d as Qs,f as Ys}from"./form-ChQh_wIn.js";import{I as Zs}from"./input-CDaarCl_.js";import{S as en}from"./spinner-DUmur8qx.js";import{t as tn}from"./ChevronDown-CN6qoGcG.js";const sn={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(sn)){const t=e(s.providerMetadata);if(t!==null)return t}return 0}function wt(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Tt(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 pa(s){return s.reduce((e,t)=>Tt(e,t.metadata?.usage),wt())}function nn(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function Ue(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function qe(s,e){if(!e)return s;const t=`${nn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function ln(s,e){return qe(s,e).replace(/[_-]/g," ").toLowerCase()}function on(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Je().min(1,"Required"):Je();return ot(e)}function an(s,e){const t={};for(const l of s.arguments??[])t[l.name]=e?.[l.name]??"";return t}function rn(s){const e=$.c(66),{prompt:t,setPrompt:l,onSubmit:r,defaultValues:a}=s,o=B.useId();let u;if(e[0]!==t){const A=t?on(t):ot({});u=Bt(A),e[0]=t,e[1]=u}else u=e[1];const i=u;let m;e[2]!==a||e[3]!==t?(m=t?an(t,a):{},e[2]=a,e[3]=t,e[4]=m):m=e[4];let p;e[5]!==i||e[6]!==m?(p={resolver:i,defaultValues:m,mode:"onChange"},e[5]=i,e[6]=m,e[7]=p):p=e[7];const c=Ht(p);let d;e[8]!==t?.arguments?(d=t?.arguments??[],e[8]=t?.arguments,e[9]=d):d=e[9];const x=d;let g;e[10]!==c||e[11]!==r||e[12]!==l?(g=async A=>{await r(A),l(null),c.reset()},e[10]=c,e[11]=r,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==c||e[15]!==l?(h=A=>{A||(c.reset(),l(null))},e[14]=c,e[15]=l,e[16]=h):h=e[16];const k=h;if(!t)return null;let y;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(y=t.title||ln(t.name,Ue(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(Hs,{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(Ws,{children:[v,j]}),e[25]=j,e[26]=v,e[27]=N):N=e[27];let S;e[28]!==c||e[29]!==b?(S=A=>{A.stopPropagation(),c.handleSubmit(b)(A)},e[28]=c,e[29]=b,e[30]=S):S=e[30];let _;if(e[31]!==x||e[32]!==c.control||e[33]!==c.formState.isSubmitting){let A;e[35]!==c.control||e[36]!==c.formState.isSubmitting?(A=P=>n.jsx(Ks,{control:c.control,name:P.name,render:O=>{const{field:W}=O;return n.jsxs(Js,{children:[n.jsxs(Xs,{className:"text-xs",children:[P.name,P.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(Qs,{children:n.jsx(Zs,{...W,value:W.value??"",required:P.required,placeholder:P.description??"",className:"h-9",disabled:c.formState.isSubmitting})}),n.jsx(Ys,{})]})}},P.name),e[35]=c.control,e[36]=c.formState.isSubmitting,e[37]=A):A=e[37],_=x.map(A),e[31]=x,e[32]=c.control,e[33]=c.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==k?(w=()=>k(!1),e[38]=k,e[39]=w):w=e[39];let T;e[40]!==c.formState.isSubmitting||e[41]!==w?(T=n.jsx(ke,{type:"button",variant:"ghost",onClick:w,disabled:c.formState.isSubmitting,children:"Cancel"}),e[40]=c.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==c.formState.isSubmitting?(I=c.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(en,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=c.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==c.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(ke,{type:"submit",form:o,disabled:c.formState.isSubmitting,children:I}),e[45]=c.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(Us,{children:[T,M]}),e[49]=T,e[50]=M,e[51]=C):C=e[51];let L;e[52]!==o||e[53]!==S||e[54]!==_||e[55]!==C?(L=n.jsxs("form",{id:o,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[_,C]}),e[52]=o,e[53]=S,e[54]=_,e[55]=C,e[56]=L):L=e[56];let R;e[57]!==c||e[58]!==L?(R=n.jsx(Gs,{...c,children:L}),e[57]=c,e[58]=L,e[59]=R):R=e[59];let F;e[60]!==N||e[61]!==R?(F=n.jsxs(qs,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[N,R]}),e[60]=N,e[61]=R,e[62]=F):F=e[62];let z;return e[63]!==k||e[64]!==F?(z=n.jsx(Vs,{open:!0,onOpenChange:k,children:F}),e[63]=k,e[64]=F,e[65]=z):z=e[65],z}function Ct(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 cn(s){return s.storage.mention}function xa(s,e,t){s.chain().focus().insertContentAt(e,[$t(t),{type:"text",text:" "}]).run()}function $t(s){return{type:"mention",attrs:s}}function un(s){const e=$.c(19),{node:t,selected:l,view:r,editor:a,getPos:o}=s,{name:u,char:f,kind:i,id:m,args:p}=t.attrs,c=l&&r.editable,d=f==="@",x=r.editable&&f==="/"&&i!=="resource";let g;e[0]!==p||e[1]!==a||e[2]!==o||e[3]!==m||e[4]!==x||e[5]!==u?(g=_=>{if(!x)return;const T=cn(a)?.onEditChip;if(!T||typeof o!="function")return;const I=o();typeof I=="number"&&(_.preventDefault(),_.stopPropagation(),T({promptId:m,promptName:u,args:p??{},pos:I}))},e[0]=p,e[1]=a,e[2]=o,e[3]=m,e[4]=x,e[5]=u,e[6]=g):g=e[6];const b=g,h=x?"cursor-pointer":"cursor-default",k=d?"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=c&&"outline-2 outline-blue-300 outline-offset-0",v=x&&"hover:brightness-95";let j;e[7]!==h||e[8]!==k||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",k,y,v,"capitalize"),e[7]=h,e[8]=k,e[9]=y,e[10]=v,e[11]=j):j=e[11];let N;e[12]!==u?(N=u?Ct(u):"",e[12]=u,e[13]=N):N=e[13];let S;return e[14]!==f||e[15]!==b||e[16]!==j||e[17]!==N?(S=n.jsxs(ft,{onClick:b,className:j,children:[f,N]}),e[14]=f,e[15]=b,e[16]=j,e[17]=N,e[18]=S):S=e[18],S}const dn=ut.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 dt(un)}}),fn=/^mcp__[a-zA-Z0-9_-]+__/;function It(s){return s.replace(fn,"")}function Ve(s){const e=$.c(18),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o,animate:u}=s,f=r===void 0?!1:r,i=o===void 0?!1:o,m=u===void 0?!1:u,{handleCopy:p}=mt(),[c,d]=B.useState(!1);let x;e[0]!==p||e[1]!==t||e[2]!==l.text?(x=async()=>{Wt("chat_message_copied",{message_id:t,chars:l.text.length}),await p(l.text),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=p,e[1]=t,e[2]=l.text,e[3]=x):x=e[3];const g=x,b=f&&a,h=b||a;let k;e[4]!==m||e[5]!==t||e[6]!==l.text?(k=n.jsx(pt,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=k):k=e[7];let y;e[8]!==i||e[9]!==a||e[10]!==g||e[11]!==c||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",i?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,b&&a&&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:c?n.jsx(He,{className:"size-4"}):n.jsx(ct,{className:"size-4"})})]}),e[8]=i,e[9]=a,e[10]=g,e[11]=c,e[12]=h,e[13]=b,e[14]=y):y=e[14];let v;return e[15]!==k||e[16]!==y?(v=n.jsxs("div",{className:"group/part relative",children:[k,y]}),e[15]=k,e[16]=y,e[17]=v):v=e[17],v}function ga(s,e,t){s.chain().focus().insertContentAt(e,[mn(t),{type:"text",text:" "}]).run()}function mn(s){return{type:"file",attrs:s}}function pn(s){const e=$.c(17),{node:t,selected:l,view:r}=s,{name:a,mimeType:o,data:u}=t.attrs,f=l&&r.editable;let i;e[0]!==o?(i=o.startsWith("image/"),e[0]=o,e[1]=i):i=e[1];const m=i,p=f&&"outline-2 outline-blue-300 outline-offset-0";let c;e[2]!==p?(c=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]=c):c=e[3];let d;e[4]!==a?(d=n.jsx(pe,{asChild:!0,children:n.jsx("span",{children:a})}),e[4]=a,e[5]=d):d=e[5];let x;e[6]!==u||e[7]!==m||e[8]!==o||e[9]!==a?(x=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:m?n.jsx("img",{src:`data:${o};base64,${u}`,alt:a,className:"max-w-full max-h-64 object-contain rounded"}):n.jsxs("div",{className:"text-xs",children:[n.jsx("div",{className:"font-medium",children:a}),n.jsx("div",{className:"text-muted-foreground mt-1",children:o})]})}),e[6]=u,e[7]=m,e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==d||e[12]!==x?(g=n.jsxs(ge,{children:[d,x]}),e[11]=d,e[12]=x,e[13]=g):g=e[13];let b;return e[14]!==c||e[15]!==g?(b=n.jsx(ft,{className:c,children:g}),e[14]=c,e[15]=g,e[16]=b):b=e[16],b}const xn=ut.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 dt(pn)}}),fe=16,Pe=2.5,Ee=(fe-Pe)/2,Re=2*Math.PI*Ee;function gn(s){const e=$.c(31),{usage:t}=s;if(!t)return null;const{totalTokens:l,inputTokens:r,outputTokens:a,cost:o}=t;if(!l&&!r&&!a)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Kt,{size:12}),e[0]=u):u=e[0];let f;e[1]!==o||e[2]!==l?(f=o>0?`$${o.toFixed(4)}`:l.toLocaleString(),e[1]=o,e[2]=l,e[3]=f):f=e[3];let i;e[4]!==f?(i=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:[u,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:f})]})}),e[4]=f,e[5]=i):i=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 c;e[8]!==r?(c=r.toLocaleString(),e[8]=r,e[9]=c):c=e[9];let d;e[10]!==c?(d=n.jsx("span",{className:"text-right tabular-nums",children:c}),e[10]=c,e[11]=d):d=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=a-(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 k;e[17]!==r||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(k=(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:r>0?`${(t.cacheReadTokens/r*100).toFixed(0)}%`:"0%"})]}),e[17]=r,e[18]=t.cacheReadTokens,e[19]=t.cacheWriteTokens,e[20]=k):k=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]!==k||e[25]!==y||e[26]!==d?(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,d,x,h,k,y]})]}),e[23]=h,e[24]=k,e[25]=y,e[26]=d,e[27]=v):v=e[27];let j;return e[28]!==v||e[29]!==i?(j=n.jsxs(ge,{children:[i,v]}),e[28]=v,e[29]=i,e[30]=j):j=e[30],j}function hn(s){const e=$.c(19),{usage:t,duration:l}=s,r=l!=null&&l>0,a=t!=null&&(t.cost??0)>0,o=t!=null&&(t.totalTokens??0)>0;if(!r&&!a&&!o)return null;let u;e[0]!==l||e[1]!==r?(u=r?de(l/1e3):null,e[0]=l,e[1]=r,e[2]=u):u=e[2];const f=u;let i;e[3]!==l||e[4]!==f||e[5]!==t?(i=f&&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:f})}),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]=f,e[5]=t,e[6]=i):i=e[6];let m;e[7]!==a||e[8]!==r||e[9]!==o?(m=r&&(a||o)&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=a,e[8]=r,e[9]=o,e[10]=m):m=e[10];let p;e[11]!==a||e[12]!==o||e[13]!==t?(p=(a||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:a?`$${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]=a,e[12]=o,e[13]=t,e[14]=p):p=e[14];let c;return e[15]!==i||e[16]!==m||e[17]!==p?(c=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[i,m,p]}),e[15]=i,e[16]=m,e[17]=p,e[18]=c):c=e[18],c}function ha(s){const e=$.c(51),{usage:t,totalTokens:l,contextWindow:r,onOpenContextPanel:a}=s,o=Math.min(l/r*100,100),u=Re-o/100*Re,f=t?.cost??0,i=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 c;e[2]!==f?(c=f>0?`, $${f.toFixed(2)}`:"",e[2]=f,e[3]=c):c=e[3];const d=`Context usage: ${p}%${c}`,x=a?"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:Ee,fill:"none",stroke:"currentColor",strokeWidth:Pe,className:"opacity-15"}),e[6]=b):b=e[6];const h=o>90?"text-destructive":o>70?"text-warning":"text-muted-foreground";let k;e[7]!==h?(k=V(h),e[7]=h,e[8]=k):k=e[8];let y;e[9]!==u||e[10]!==k?(y=n.jsxs("svg",{width:fe,height:fe,className:"-rotate-90",children:[b,n.jsx("circle",{cx:fe/2,cy:fe/2,r:Ee,fill:"none",stroke:"currentColor",strokeWidth:Pe,strokeDasharray:Re,strokeDashoffset:u,strokeLinecap:"round",className:k})]}),e[9]=u,e[10]=k,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]!==f?(j=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,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 S;e[19]!==a||e[20]!==N||e[21]!==d||e[22]!==g||e[23]!==y?(S=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":d,className:g,children:[y,N]})}),e[19]=a,e[20]=N,e[21]=d,e[22]=g,e[23]=y,e[24]=S):S=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]!==r?(T=r.toLocaleString(),e[28]=r,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]!==f||e[37]!==i||e[38]!==m?(C=f>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted",children:"cost"}),n.jsxs("span",{className:"text-right tabular-nums",children:["$",f.toFixed(4)]}),n.jsx("span",{className:"text-muted",children:"in"}),n.jsx("span",{className:"text-right tabular-nums",children:i.toLocaleString()}),n.jsx("span",{className:"text-muted",children:"out"}),n.jsx("span",{className:"text-right tabular-nums",children:m.toLocaleString()})]}),e[36]=f,e[37]=i,e[38]=m,e[39]=C):C=e[39];let L;e[40]!==i||e[41]!==t?.cacheReadTokens||e[42]!==t?.cacheWriteTokens?(L=((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:i>0?`${((t?.cacheReadTokens??0)/i*100).toFixed(0)}%`:"0%"})]}),e[40]=i,e[41]=t?.cacheReadTokens,e[42]=t?.cacheWriteTokens,e[43]=L):L=e[43];let R;e[44]!==M||e[45]!==C||e[46]!==L?(R=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,L]})}),e[44]=M,e[45]=C,e[46]=L,e[47]=R):R=e[47];let F;return e[48]!==S||e[49]!==R?(F=n.jsxs(ge,{children:[S,R]}),e[48]=S,e[49]=R,e[50]=F):F=e[50],F}function bn(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(ms,{"data-slot":"collapsible",...t}),e[2]=t,e[3]=l):l=e[3],l}function yn(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(ds,{"data-slot":"collapsible-trigger",...t}),e[2]=t,e[3]=l):l=e[3],l}function jn(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(fs,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}function Mt({containerRef:s,enabled:e,contentDeps:t=[],threshold:l,intervalMs:r=500}){const[a,o]=B.useState(null),[u,f]=B.useState(!1),i=l??(s?.95:.1),m=()=>{if(s?.current){s.current.scrollTop=s.current.scrollHeight;return}if(!a)return;let p=a.parentElement;for(;p;){const c=window.getComputedStyle(p);if(c.overflowY==="auto"||c.overflowY==="scroll"||c.overflow==="auto"||c.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return B.useEffect(()=>{if(!a)return;const p=new IntersectionObserver(c=>{const d=c[0]?.isIntersecting??!1;f(d)},{root:s?.current??null,threshold:i,rootMargin:"0px"});return p.observe(a),()=>p.disconnect()},[a,i]),B.useEffect(()=>{if(!e||!u)return;const p=setInterval(m,r);return()=>clearInterval(p)},[e,u,r]),B.useEffect(()=>{!e||!u||m()},[e,u,...t]),{sentinelRef:o,isTracking:u}}function D(s){const e=$.c(53),{icon:t,title:l,usage:r,summary:a,state:o,detail:u,detailVariant:f,forceOpen:i,variant:m,trailing:p,iconDestructive:c,alwaysChevron:d,defaultOpen:x,children:g}=s,b=f===void 0?"code":f,h=m===void 0?"default":m,[k,y]=B.useState(x??!1),{handleCopy:v,copied:j}=mt(),N=o==="loading",S=o==="error";let _;e[0]!==u?(_=u&&u.trim(),e[0]=u,e[1]=_):_=e[1];const T=!!_||!!g,I=h==="subtask",M=(i??!1)||k,C=B.useRef(null),L=N&&M;let R;e[2]!==u?(R=[u],e[2]=u,e[3]=R):R=e[3];let F;e[4]!==L||e[5]!==R?(F={containerRef:C,enabled:L,contentDeps:R},e[4]=L,e[5]=R,e[6]=F):F=e[6];const{sentinelRef:z}=Mt(F),A=i?void 0:y,P=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=N&&"shimmer";let H;e[7]!==W||e[8]!==U||e[9]!==O?(H=V("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",O,W,U),e[7]=W,e[8]=U,e[9]=O,e[10]=H):H=e[10];const Y=!T;let K;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==c||e[15]!==S||e[16]!==T?(K=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?n.jsx(Xe,{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",c?"[&>svg]:text-destructive/70":S?"[&>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(Xe,{className:V("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")})})]})}),e[11]=d,e[12]=M,e[13]=t,e[14]=c,e[15]=S,e[16]=T,e[17]=K):K=e[17];const Q=S?"text-warning/80":"text-foreground";let X;e[18]!==Q?(X=V("shrink-0 text-[14px] font-normal",Q),e[18]=Q,e[19]=X):X=e[19];let Z;e[20]!==X||e[21]!==l?(Z=n.jsx("span",{className:X,children:l}),e[20]=X,e[21]=l,e[22]=Z):Z=e[22];let E;e[23]!==a?(E=a?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:a})}):n.jsx("div",{className:"flex-1"}),e[23]=a,e[24]=E):E=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 G;e[27]!==r?(G=n.jsx(gn,{usage:r}),e[27]=r,e[28]=G):G=e[28];let J;e[29]!==H||e[30]!==Y||e[31]!==K||e[32]!==Z||e[33]!==E||e[34]!==q||e[35]!==G||e[36]!==P?(J=n.jsxs(yn,{disabled:P,className:H,"aria-disabled":Y,children:[K,Z,E,q,G]}),e[29]=H,e[30]=Y,e[31]=K,e[32]=Z,e[33]=E,e[34]=q,e[35]=G,e[36]=P,e[37]=J):J=e[37];let ee;e[38]!==g||e[39]!==j||e[40]!==u||e[41]!==b||e[42]!==v||e[43]!==T||e[44]!==z?(ee=T&&n.jsx(jn,{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:u}),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:u})}),n.jsx("button",{type:"button",onClick:()=>v(u),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(He,{className:"size-3.5"}):n.jsx(ct,{className:"size-3.5"})})]}),n.jsx("div",{ref:z,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=j,e[40]=u,e[41]=b,e[42]=v,e[43]=T,e[44]=z,e[45]=ee):ee=e[45];let ue;e[46]!==M||e[47]!==J||e[48]!==ee||e[49]!==A?(ue=n.jsxs(bn,{open:M,onOpenChange:A,className:"min-w-0",children:[J,ee]}),e[46]=M,e[47]=J,e[48]=ee,e[49]=A,e[50]=ue):ue=e[50];const le=ue;if(I){let oe;return e[51]!==le?(oe=n.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:le}),e[51]=le,e[52]=oe):oe=e[52],oe}return le}function te(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 r;return e[2]!==l?(r=n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:l}),e[2]=l,e[3]=r):r=e[3],r}const Lt=4;function Rt(s){const e=$.c(5),{count:t,noun:l,onClick:r}=s;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(it,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[0]=a):a=e[0];let o;return e[1]!==t||e[2]!==l||e[3]!==r?(o=n.jsxs("button",{type:"button",onClick:r,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,a]}),e[1]=t,e[2]=l,e[3]=r,e[4]=o):o=e[4],o}function vn(s){const e=$.c(24),{org:t}=he(),l=Ut(),r=Ns(),a=ws();let o;e[0]!==a||e[1]!==s?(o=async g=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=(await a.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 a.call("COLLECTION_THREADS_UPDATE",{id:s,data:{metadata:v}}),y},e[0]=a,e[1]=s,e[2]=o):o=e[2];let u,f,i;e[3]!==t||e[4]!==l||e[5]!==s?(u=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}},f=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},i=(g,b,h)=>{const k=me.ensureTask(t.id,s??"");h?.previous===void 0?l.removeQueries({queryKey:k,exact:!0}):l.setQueryData(k,h.previous),ze.error(g instanceof Error?g.message:"Failed to expand tool")},e[3]=t,e[4]=l,e[5]=s,e[6]=u,e[7]=f,e[8]=i):(u=e[6],f=e[7],i=e[8]);let m;e[9]!==o||e[10]!==u||e[11]!==f||e[12]!==i?(m={mutationFn:o,onMutate:u,onSuccess:f,onError:i},e[9]=o,e[10]=u,e[11]=f,e[12]=i,e[13]=m):m=e[13];const p=qt(m);let c;e[14]!==r||e[15]!==p||e[16]!==t||e[17]!==l||e[18]!==s?(c=g=>{if(!s||!r)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}),r.patchThread({id:s,metadata:v}),p.mutate(g)},e[14]=r,e[15]=p,e[16]=t,e[17]=l,e[18]=s,e[19]=c):c=e[19];const d=c;let x;return e[20]!==d||e[21]!==p.isPending||e[22]!==p.mutate?(x={addOrReplace:p.mutate,addOrReplaceEager:d,isPending:p.isPending},e[20]=d,e[21]=p.isPending,e[22]=p.mutate,e[23]=x):x=e[23],x}function Nn(s,e,t,l){const{data:r,isLoading:a}=Oe({queryKey:me.toolDefinitionLookup(e,t,s),queryFn:async()=>{if(!s||!e)return null;const o=await Ts({connectionId:e,orgId:t,orgSlug:l});try{const{tools:u}=await o.listTools(),f=It(s);return u.find(i=>i.name===f)??null}finally{await o.close().catch(()=>{})}},enabled:!!s&&!!e,staleTime:6e4,gcTime:3e5,retry:!1});return{toolDef:r??void 0,isLoading:a}}const kn={read:{icon:Ye,label:"Read File"},write:{icon:Ls,label:"Write File"},edit:{icon:es,label:"Edit File"},grep:{icon:As,label:"Search Content"},glob:{icon:Rs,label:"Find Files"},bash:{icon:Zt,label:"Run Command"},read_tool_output:{icon:Ye,label:"Read Tool Output"},read_resource:{icon:Yt,label:"Read Resource"},read_prompt:{icon:jt,label:"Read Prompt"},enable_tool:{icon:Ms,label:"Enable Tool"},open_in_agent:{icon:Qt,label:"Open in Agent"},sandbox:{icon:Xt,label:"Run Code"},copy_to_sandbox:{icon:vt,label:"Load File"},share_with_user:{icon:zs,label:"Share with User"},take_screenshot:{icon:Ne,label:"Take Screenshot"},scrape_url:{icon:Ce,label:"Scrape URL"},inspect_page:{icon:Jt,label:"Inspect Page"}};function Ge(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]"}}const Sn=s=>s.type==="dynamic-tool"||s.type.startsWith("tool-");function _n(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
@@ -32,7 +32,7 @@ Output: Tool execution was denied`)}}}return t.length>0?t.join(`
32
32
  ${s.input?.prompt??"No prompt provided"}
33
33
 
34
34
  # ${o?"Error":"Result"}
35
- ${x}`;return{fallbackTitle:i,summary:p,usage:e?.usage,latency:t,detail:g,state:f}}function Zn(s){const e=$.c(7),t=Pt(s);let l,r;e[0]!==t?({fallbackTitle:l,...r}=t,e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ie,{icon:void 0,name:"Subtask",size:"2xs",className:"rounded-xs",fallbackIcon:n.jsx(kt,{})}),e[3]=a):a=e[3];let o;return e[4]!==l||e[5]!==r?(o=n.jsx(D,{icon:a,title:l,...r}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o}function el(s){const e=$.c(11),t=Pt(s);let l,r;e[0]!==t?({fallbackTitle:l,...r}=t,e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]);const a=Fs(s.part.input?.agent_id),o=a?.icon,u=a?.title??"Subtask";let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(kt,{}),e[3]=f):f=e[3];let i;e[4]!==o||e[5]!==u?(i=n.jsx(Ie,{icon:o,name:u,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[4]=o,e[5]=u,e[6]=i):i=e[6];const m=a?.title??l;let p;return e[7]!==r||e[8]!==i||e[9]!==m?(p=n.jsx(D,{icon:i,title:m,...r}),e[7]=r,e[8]=i,e[9]=m,e[10]=p):p=e[10],p}function tl(s){const e=$.c(16),{part:t}=s;if(!t.state.startsWith("output-"))return null;const l=t.input?.plan??"",a=t.output?.approved===!0;let o,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(jt,{className:"size-4 text-purple-500 shrink-0"}),u=n.jsx("span",{className:"text-[14px] font-medium text-foreground/80",children:"Implementation Plan"}),e[0]=o,e[1]=u):(o=e[0],u=e[1]);let f;e[2]!==a?(f=a&&n.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 bg-green-500/10 px-1.5 py-0.5 rounded-md",children:[n.jsx(He,{size:12}),"Approved"]}),e[2]=a,e[3]=f):f=e[3];let i;e[4]!==a||e[5]!==t.state?(i=!a&&t.state==="output-available"&&n.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:"Rejected"}),e[4]=a,e[5]=t.state,e[6]=i):i=e[6];let m;e[7]!==f||e[8]!==i?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,u,f,i]}),e[7]=f,e[8]=i,e[9]=m):m=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"View plan"}),e[10]=p):p=e[10];let c;e[11]!==l?(c=n.jsxs("details",{className:"ml-6",children:[p,n.jsx("div",{className:"mt-1 pl-2 border-l-2 border-purple-500/30 prose prose-sm max-w-none text-sm",children:n.jsx(Ve,{id:"plan-content",part:{type:"text",text:l}})})]}),e[11]=l,e[12]=c):c=e[12];let d;return e[13]!==m||e[14]!==c?(d=n.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,c]}),e[13]=m,e[14]=c,e[15]=d):d=e[15],d}const Ke={primary:"Primary",secondary:"Secondary",accent:"Accent",background:"Background",foreground:"Foreground"};function sl(s){return s.startsWith("http")?s:`https://${s}`}function st(s){const e=$.c(2),{children:t}=s;let l;return e[0]!==t?(l=n.jsx("span",{className:"text-sm font-medium text-foreground",children:t}),e[0]=t,e[1]=l):l=e[1],l}function nl(s){const e=$.c(12),{name:t,value:l}=s;let r;e[0]!==l?(r=n.jsx("span",{className:"size-7 shrink-0 rounded-md border border-border",style:{backgroundColor:l},"aria-hidden":!0}),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==t?(a=n.jsx("span",{className:"text-sm text-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==l?(o=n.jsx("span",{className:"text-xs font-mono tabular-nums text-muted-foreground",children:l}),e[4]=l,e[5]=o):o=e[5];let u;e[6]!==a||e[7]!==o?(u=n.jsxs("div",{className:"flex flex-col leading-tight min-w-0",children:[a,o]}),e[6]=a,e[7]=o,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==u?(f=n.jsxs("div",{className:"flex items-center gap-2.5",children:[r,u]}),e[9]=r,e[10]=u,e[11]=f):f=e[11],f}function ll(s){const e=$.c(15),{role:t,family:l}=s;let r;e[0]!==l?(r=n.jsx("span",{className:"text-2xl font-medium leading-none text-foreground shrink-0",style:{fontFamily:l},"aria-hidden":!0,children:"Aa"}),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==t?(a=n.jsx("span",{className:"text-xs text-muted-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==l?(o={fontFamily:l},e[4]=l,e[5]=o):o=e[5];let u;e[6]!==l||e[7]!==o?(u=n.jsx("span",{className:"text-sm text-foreground",style:o,children:l}),e[6]=l,e[7]=o,e[8]=u):u=e[8];let f;e[9]!==a||e[10]!==u?(f=n.jsxs("div",{className:"flex flex-col leading-tight",children:[a,u]}),e[9]=a,e[10]=u,e[11]=f):f=e[11];let i;return e[12]!==r||e[13]!==f?(i=n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted px-4 py-3",children:[r,f]}),e[12]=r,e[13]=f,e[14]=i):i=e[14],i}function ol(s){const e=$.c(3),{logo:t,favicon:l,name:r}=s,a=t??l;if(!a)return null;const o=r?`${r} logo`:"";let u;return e[0]!==a||e[1]!==o?(u=n.jsx("img",{src:a,alt:o,className:"size-16 shrink-0 rounded-lg border border-border bg-background object-contain p-2",onError:al}),e[0]=a,e[1]=o,e[2]=u):u=e[2],u}function al(s){s.target.style.display="none"}function Et(s){const e=$.c(4),{colors:t}=s;let l;e[0]!==t?(l=Object.entries(t).filter(il),e[0]=t,e[1]=l):l=e[1];const r=l;if(r.length===0)return null;let a;return e[2]!==r?(a=n.jsx("div",{className:"flex h-1.5",children:r.map(rl)}),e[2]=r,e[3]=a):a=e[3],a}function rl(s){const[e,t]=s;return n.jsx("span",{className:"flex-1",style:{backgroundColor:t},title:`${Ke[e]}: ${t}`,"aria-hidden":!0},e)}function il(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function Ft(s){const e=$.c(36),{logo:t,favicon:l,name:r,domain:a,overview:o,colors:u,fonts:f,showDefaultBadge:i,isDefault:m}=s;let p;e[0]!==u?(p=u?Object.entries(u).filter(fl):[],e[0]=u,e[1]=p):p=e[1];const c=p;let d;e[2]!==f?(d=f?Object.entries(f).filter(dl):[],e[2]=f,e[3]=d):d=e[3];const x=d;let g;e[4]!==u?(g=u&&n.jsx(Et,{colors:u}),e[4]=u,e[5]=g):g=e[5];let b;e[6]!==l||e[7]!==t||e[8]!==r?(b=n.jsx(ol,{logo:t,favicon:l,name:r}),e[6]=l,e[7]=t,e[8]=r,e[9]=b):b=e[9];let h;e[10]!==m||e[11]!==r||e[12]!==i?(h=r&&n.jsxs("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-foreground truncate",children:[r,i&&m&&n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[n.jsx(yt,{className:"size-3 text-amber-500"}),"default"]})]}),e[10]=m,e[11]=r,e[12]=i,e[13]=h):h=e[13];let k;e[14]!==a?(k=a&&n.jsxs("a",{href:sl(a),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a,n.jsx(Nt,{className:"size-3 shrink-0"})]}),e[14]=a,e[15]=k):k=e[15];let y;e[16]!==h||e[17]!==k?(y=n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h,k]}),e[16]=h,e[17]=k,e[18]=y):y=e[18];let v;e[19]!==b||e[20]!==y?(v=n.jsxs("div",{className:"flex items-center gap-4",children:[b,y]}),e[19]=b,e[20]=y,e[21]=v):v=e[21];let j;e[22]!==o?(j=o&&n.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:o}),e[22]=o,e[23]=j):j=e[23];let N;e[24]!==c?(N=c.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(st,{children:"Colors"}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3",children:c.map(ul)})]}),e[24]=c,e[25]=N):N=e[25];let S;e[26]!==x?(S=x.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(st,{children:"Typography"}),n.jsx("div",{className:"flex flex-wrap gap-2.5",children:x.map(cl)})]}),e[26]=x,e[27]=S):S=e[27];let _;e[28]!==N||e[29]!==S||e[30]!==v||e[31]!==j?(_=n.jsxs("div",{className:"p-5 flex flex-col gap-6",children:[v,j,N,S]}),e[28]=N,e[29]=S,e[30]=v,e[31]=j,e[32]=_):_=e[32];let w;return e[33]!==_||e[34]!==g?(w=n.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden border border-border",children:[g,_]}),e[33]=_,e[34]=g,e[35]=w):w=e[35],w}function cl(s){const[e,t]=s;return n.jsx(ll,{role:e,family:t},e)}function ul(s){const[e,t]=s;return n.jsx(nl,{name:Ke[e],value:t},e)}function dl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function fl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function ml(s){const e=$.c(29),{part:t,latency:l}=s,r=re(t.state);let a;e[0]!==t.output?(a=ve(t.output),e[0]=t.output,e[1]=a):a=e[1];const o=a,u=r==="loading",f=r==="error"||o&&o.success===!1;if(u){const S=t.input;let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ce,{className:"animate-pulse"}),e[2]=_):_=e[2];const w=S?.domain?`from ${S.domain}`:void 0;let T;return e[3]!==w?(T=n.jsx(D,{icon:_,title:"Extracting brand",summary:w,state:"loading",defaultOpen:!0}),e[3]=w,e[4]=T):T=e[4],T}if(f){let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ce,{}),e[5]=S):S=e[5];const _=o?.error??"Unknown error";let w;e[6]!==l?(w=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[6]=l,e[7]=w):w=e[7];let T;return e[8]!==_||e[9]!==w?(T=n.jsx(D,{icon:S,title:"Brand extraction failed",summary:_,state:"error",trailing:w}),e[8]=_,e[9]=w,e[10]=T):T=e[10],T}let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ce,{className:"text-fuchsia-500"}),e[11]=i):i=e[11];const m=o?.name?`Brand set: ${o.name}`:"Brand context set",p=o?.domain;let c;e[12]!==l?(c=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[12]=l,e[13]=c):c=e[13];let d;e[14]!==m||e[15]!==p||e[16]!==c?(d=n.jsx(D,{icon:i,title:m,summary:p,state:"idle",trailing:c}),e[14]=m,e[15]=p,e[16]=c,e[17]=d):d=e[17];const x=o?.logo,g=o?.favicon,b=o?.name,h=o?.domain,k=o?.overview,y=o?.colors,v=o?.fonts;let j;e[18]!==h||e[19]!==k||e[20]!==y||e[21]!==v||e[22]!==x||e[23]!==g||e[24]!==b?(j=n.jsx(Ft,{logo:x,favicon:g,name:b,domain:h,overview:k,colors:y,fonts:v}),e[18]=h,e[19]=k,e[20]=y,e[21]=v,e[22]=x,e[23]=g,e[24]=b,e[25]=j):j=e[25];let N;return e[26]!==j||e[27]!==d?(N=n.jsxs(n.Fragment,{children:[d,j]}),e[26]=j,e[27]=d,e[28]=N):N=e[28],N}function pl(s){const e=$.c(27),{part:t,latency:l}=s,r=re(t.state);let a;e[0]!==t.output?(a=ve(t.output),e[0]=t.output,e[1]=a):a=e[1];const o=a,u=r==="loading",f=r==="error"||o&&o.success===!1;if(u){let g;return e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brand",state:"loading"}),e[2]=g):g=e[2],g}if(f||!o){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ce,{}),e[3]=g):g=e[3];let b;e[4]!==l?(b=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[4]=l,e[5]=b):b=e[5];let h;return e[6]!==b?(h=n.jsx(D,{icon:g,title:"Couldn't load brand",state:"error",trailing:b}),e[6]=b,e[7]=h):h=e[7],h}let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ce,{className:"text-fuchsia-500"}),e[8]=i):i=e[8];const m=o.name?`Brand · ${o.name}`:"Brand";let p;e[9]!==l?(p=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[9]=l,e[10]=p):p=e[10];let c;e[11]!==o.domain||e[12]!==m||e[13]!==p?(c=n.jsx(D,{icon:i,title:m,summary:o.domain,state:"idle",trailing:p}),e[11]=o.domain,e[12]=m,e[13]=p,e[14]=c):c=e[14];let d;e[15]!==o.colors||e[16]!==o.domain||e[17]!==o.favicon||e[18]!==o.fonts||e[19]!==o.isDefault||e[20]!==o.logo||e[21]!==o.name||e[22]!==o.overview?(d=n.jsx(Ft,{logo:o.logo,favicon:o.favicon,name:o.name,domain:o.domain,overview:o.overview,colors:o.colors,fonts:o.fonts,showDefaultBadge:!0,isDefault:o.isDefault}),e[15]=o.colors,e[16]=o.domain,e[17]=o.favicon,e[18]=o.fonts,e[19]=o.isDefault,e[20]=o.logo,e[21]=o.name,e[22]=o.overview,e[23]=d):d=e[23];let x;return e[24]!==c||e[25]!==d?(x=n.jsxs(n.Fragment,{children:[c,d]}),e[24]=c,e[25]=d,e[26]=x):x=e[26],x}function xl(s){const e=$.c(32),{part:t,latency:l}=s;let r;e[0]!==t.state?(r=re(t.state),e[0]=t.state,e[1]=r):r=e[1];const a=r;let o,u,f,i;if(e[2]!==l||e[3]!==t.output||e[4]!==a){i=Symbol.for("react.early_return_sentinel");e:{const c=ve(t.output),d=Array.isArray(c?.items)?c.items:[],x=a==="loading",g=a==="error";if(x){let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brands",state:"loading"}),e[9]=y):y=e[9],i=y;break e}if(g){let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ce,{}),e[10]=y):y=e[10];let v;e[11]!==l?(v=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[11]=l,e[12]=v):v=e[12];let j;e[13]!==v?(j=n.jsx(D,{icon:y,title:"Couldn't load brands",state:"error",trailing:v}),e[13]=v,e[14]=j):j=e[14],i=j;break e}if(d.length===0){let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ce,{}),e[15]=y):y=e[15];let v;e[16]!==l?(v=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[16]=l,e[17]=v):v=e[17];let j;e[18]!==v?(j=n.jsx(D,{icon:y,title:"No brands yet",summary:"The organization hasn't set up any brand context.",state:"idle",trailing:v}),e[18]=v,e[19]=j):j=e[19],i=j;break e}let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(ce,{className:"text-fuchsia-500"}),e[20]=b):b=e[20];const h=d.length===1?"1 brand":`${d.length} brands`;let k;e[21]!==l?(k=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[21]=l,e[22]=k):k=e[22],e[23]!==h||e[24]!==k?(f=n.jsx(D,{icon:b,title:h,state:"idle",trailing:k}),e[23]=h,e[24]=k,e[25]=f):f=e[25],o="mt-2 flex flex-col gap-1.5",u=d.map(gl)}e[2]=l,e[3]=t.output,e[4]=a,e[5]=o,e[6]=u,e[7]=f,e[8]=i}else o=e[5],u=e[6],f=e[7],i=e[8];if(i!==Symbol.for("react.early_return_sentinel"))return i;let m;e[26]!==o||e[27]!==u?(m=n.jsx("div",{className:o,children:u}),e[26]=o,e[27]=u,e[28]=m):m=e[28];let p;return e[29]!==f||e[30]!==m?(p=n.jsxs(n.Fragment,{children:[f,m]}),e[29]=f,e[30]=m,e[31]=p):p=e[31],p}function gl(s){const e=s.colors?Object.entries(s.colors).filter(yl):[];return n.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[s.colors&&n.jsx(Et,{colors:s.colors}),n.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[(s.logo||s.favicon)&&n.jsx("img",{src:s.logo??s.favicon??void 0,alt:"",className:"size-8 shrink-0 rounded-md border border-border bg-background object-contain p-0.5",onError:bl}),n.jsxs("div",{className:"flex flex-col leading-tight min-w-0 flex-1",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground truncate",children:[s.name??"Untitled",s.isDefault&&n.jsx(yt,{className:"size-3 text-amber-500 shrink-0"})]}),s.domain&&n.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:s.domain})]}),e.length>0&&n.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:e.slice(0,5).map(hl)})]})]},s.id??`${s.name}-${s.domain}`)}function hl(s){const[e,t]=s;return n.jsx("span",{className:"size-3 rounded-full border border-border",style:{backgroundColor:t},title:`${Ke[e]}: ${t}`,"aria-hidden":!0},e)}function bl(s){s.target.style.display="none"}function yl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function Fe(s){const e=$.c(4),{connection_id:t,iconSize:l}=s,r=l===void 0?"xs":l,a=Os(t);if(!a)return null;let o;return e[0]!==a.icon||e[1]!==a.title||e[2]!==r?(o=n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx(Ie,{icon:a.icon,name:a.title,size:r})}),e[0]=a.icon,e[1]=a.title,e[2]=r,e[3]=o):o=e[3],o}Fe.Fallback=function({iconSize:e="xs"}){const t=e==="sm"?"size-6":"size-5";return n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx("div",{className:V(t,"rounded bg-muted animate-pulse")})})};function Se(s){const e=$.c(18),{connectionIds:t,maxVisibleIcons:l,iconSize:r,className:a}=s,o=l===void 0?2:l,u=r===void 0?"xs":r;if(t.length===0)return null;let f,i,m;if(e[0]!==a||e[1]!==t||e[2]!==u||e[3]!==o){const d=t.slice(0,o);f=t.length-o,e[7]!==a?(i=V("flex items-center justify-end -space-x-2",a),e[7]=a,e[8]=i):i=e[8];let x;e[9]!==u?(x=g=>n.jsx(B.Suspense,{fallback:n.jsx(Fe.Fallback,{iconSize:u}),children:n.jsx(Fe,{connection_id:g,iconSize:u})},g),e[9]=u,e[10]=x):x=e[10],m=d.map(x),e[0]=a,e[1]=t,e[2]=u,e[3]=o,e[4]=f,e[5]=i,e[6]=m}else f=e[4],i=e[5],m=e[6];let p;e[11]!==u||e[12]!==f?(p=f>0&&n.jsx("div",{className:V("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",u==="sm"?"size-8":"size-6"),children:n.jsxs("span",{className:V(u==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${f} more`,children:["+",f]})}),e[11]=u,e[12]=f,e[13]=p):p=e[13];let c;return e[14]!==i||e[15]!==m||e[16]!==p?(c=n.jsxs("div",{className:i,children:[m,p]}),e[14]=i,e[15]=m,e[16]=p,e[17]=c):c=e[17],c}Se.Fallback=function({maxVisibleIcons:e=2,totalCount:t,iconSize:l="xs"}){const r=l==="sm"?"size-6":"size-5",a=l==="sm"?"size-8":"size-6",o=t!==void 0&&t>e;return n.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((u,f)=>n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx("div",{className:V(r,"rounded bg-muted animate-pulse")})},f)),o&&n.jsx("div",{className:V("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",a),children:n.jsx("div",{className:V(l==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const jl="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",nt=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function vl(s){const e=$.c(64),{part:t,latency:l}=s,r=St(),a=re(t.state),o=B.useRef(null),u=B.useRef(null),f=B.useRef(null),i=B.useRef(null),m=B.useRef(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{nt?.matches||(m.current=o.current?.getBoundingClientRect()??null,o.current&&(o.current.style.willChange="transform"))},e[0]=p):p=e[0];const c=p;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=E=>{if(nt?.matches)return;const q=m.current,G=o.current;if(!q||!G)return;const J=(E.clientX-q.left)/q.width*100,ee=(E.clientY-q.top)/q.height*100;G.style.transform=`perspective(800px) rotateY(${(J-50)*.05}deg) rotateX(${(ee-50)*-.05}deg)`,u.current&&(u.current.style.opacity="1",u.current.style.transform=`translate(${(J-50)*.15}px, ${(ee-50)*.15}px)`),f.current&&(f.current.style.opacity="0.45"),i.current&&(i.current.style.opacity="0.45")},e[1]=d):d=e[1];const x=d;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{const E=o.current;E&&(E.style.transform="none",E.style.willChange="auto"),u.current&&(u.current.style.opacity="0.4",u.current.style.transform="translate(0, 0)"),f.current&&(f.current.style.opacity="0.3"),i.current&&(i.current.style.opacity="0.3"),m.current=null},e[2]=g):g=e[2];const b=g;if(a==="loading"){let E;return e[3]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Creating agent",state:"loading",defaultOpen:!0}),e[3]=E):E=e[3],E}if(a==="approval"){let E;return e[4]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(D,{icon:n.jsx(ie,{}),title:"Create agent",state:"idle"}),e[4]=E):E=e[4],E}if(a==="error"){let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(ie,{}),e[5]=E):E=e[5];const q=t.state==="output-denied"?"Agent creation cancelled":"Couldn't create agent";let G;e[6]!==l?(G=n.jsx(te,{latency:l}),e[6]=l,e[7]=G):G=e[7];let J;return e[8]!==q||e[9]!==G?(J=n.jsx(D,{icon:E,title:q,state:"error",trailing:G}),e[8]=q,e[9]=G,e[10]=J):J=e[10],J}let h,k,y;if(e[11]!==l||e[12]!==t.output){y=Symbol.for("react.early_return_sentinel");e:{if(h=ve(t.output)?.item,!h?.id||!h?.title){let E;e[16]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(ie,{}),e[16]=E):E=e[16];let q;e[17]!==l?(q=n.jsx(D,{icon:E,title:"Agent created",state:"idle",trailing:n.jsx(te,{latency:l})}),e[17]=l,e[18]=q):q=e[18],y=q;break e}k=(h.connections??[]).map(Nl)}e[11]=l,e[12]=t.output,e[13]=h,e[14]=k,e[15]=y}else h=e[13],k=e[14],y=e[15];if(y!==Symbol.for("react.early_return_sentinel"))return y;const v=k;let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ie,{className:"text-emerald-500"}),e[19]=j):j=e[19];const N=`Agent created: ${h.title}`;let S;e[20]!==l?(S=n.jsx(te,{latency:l}),e[20]=l,e[21]=S):S=e[21];let _;e[22]!==N||e[23]!==S?(_=n.jsx(D,{icon:j,title:N,state:"idle",trailing:S}),e[22]=N,e[23]=S,e[24]=_):_=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w={transition:"transform 0.3s ease-out"},e[25]=w):w=e[25];let T;e[26]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("div",{ref:u,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[26]=T):T=e[26];let I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I={textAlign:"justify",wordBreak:"break-all"},e[27]=I):I=e[27];let M,C;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:I,"aria-hidden":"true",children:jl.repeat(6)}),C=n.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[28]=M,e[29]=C):(M=e[28],C=e[29]);let L;e[30]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("img",{ref:f,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[30]=L):L=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("img",{ref:i,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[31]=R):R=e[31];let F;e[32]!==h.icon||e[33]!==h.title?(F=n.jsx(rt,{icon:h.icon,name:h.title,size:"md"}),e[32]=h.icon,e[33]=h.title,e[34]=F):F=e[34];let z;e[35]!==h.title?(z=n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:h.title})}),e[35]=h.title,e[36]=z):z=e[36];let A;e[37]!==F||e[38]!==z?(A=n.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[F,z]}),e[37]=F,e[38]=z,e[39]=A):A=e[39];let P;e[40]!==h.description?(P=h.description&&n.jsx("div",{className:"px-2 pt-1 pr-16",children:n.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:h.description})}),e[40]=h.description,e[41]=P):P=e[41];let O;e[42]!==A||e[43]!==P?(O=n.jsxs("div",{className:"relative",children:[A,P]}),e[42]=A,e[43]=P,e[44]=O):O=e[44];let W;e[45]!==v?(W=v.length>0&&n.jsx(B.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:v.length}),children:n.jsx(Se,{connectionIds:v,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})}),e[45]=v,e[46]=W):W=e[46];let U;e[47]!==W?(U=n.jsx("div",{className:"flex-1 min-w-0",children:W}),e[47]=W,e[48]=U):U=e[48];let H;e[49]!==h.id||e[50]!==r?(H=()=>r(h.id),e[49]=h.id,e[50]=r,e[51]=H):H=e[51];const Y=`See agent: ${h.title}`;let K;e[52]!==H||e[53]!==Y?(K=n.jsx("div",{className:"flex items-center gap-2 shrink-0",children:n.jsx(ke,{size:"sm",className:"h-7",onClick:H,"aria-label":Y,children:"See agent"})}),e[52]=H,e[53]=Y,e[54]=K):K=e[54];let Q;e[55]!==U||e[56]!==K?(Q=n.jsxs("div",{className:"relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1",children:[U,K]}),e[55]=U,e[56]=K,e[57]=Q):Q=e[57];let X;e[58]!==O||e[59]!==Q?(X=n.jsx("div",{className:"mt-2 overflow-hidden rounded-xl border-[0.5px] border-border bg-card p-2.5",children:n.jsxs("div",{ref:o,className:"relative overflow-hidden rounded-lg bg-accent/25 p-2",style:w,onMouseEnter:c,onMouseMove:x,onMouseLeave:b,children:[T,M,C,L,R,O,Q]})}),e[58]=O,e[59]=Q,e[60]=X):X=e[60];let Z;return e[61]!==X||e[62]!==_?(Z=n.jsxs(n.Fragment,{children:[_,X]}),e[61]=X,e[62]=_,e[63]=Z):Z=e[63],Z}function Nl(s){return s.connection_id}function kl(s){const e=$.c(24),{agent:t}=s,l=St();if(!t.id)return null;let r;e[0]!==t.connections?(r=t.connections??[],e[0]=t.connections,e[1]=r):r=e[1];let a;e[2]!==r?(a=r.map(Sl),e[2]=r,e[3]=a):a=e[3];const o=a;let u;e[4]!==t.id||e[5]!==l?(u=()=>l(t.id),e[4]=t.id,e[5]=l,e[6]=u):u=e[6];let f;e[7]!==t.icon||e[8]!==t.title?(f=n.jsx(rt,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=f):f=e[9];let i;e[10]!==t.title?(i=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=i):i=e[11];let m;e[12]!==t.description?(m=t.description&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[12]=t.description,e[13]=m):m=e[13];let p;e[14]!==i||e[15]!==m?(p=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[i,m]}),e[14]=i,e[15]=m,e[16]=p):p=e[16];let c;e[17]!==o?(c=o.length>0&&n.jsx(B.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:o.length}),children:n.jsx(Se,{connectionIds:o,iconSize:"xs",maxVisibleIcons:3})}),e[17]=o,e[18]=c):c=e[18];let d;return e[19]!==u||e[20]!==f||e[21]!==p||e[22]!==c?(d=n.jsxs("button",{type:"button",onClick:u,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[f,p,c]}),e[19]=u,e[20]=f,e[21]=p,e[22]=c,e[23]=d):d=e[23],d}function Sl(s){return s.connection_id}function _l(s){const e=$.c(41),{part:t,latency:l}=s,r=je(),{org:a}=he();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o;let f,i,m,p,c,d;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==u){d=Symbol.for("react.early_return_sentinel");e:{const h=ve(t.output);if(i=Array.isArray(h?.items)?h.items:[],u==="loading"){let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Loading agents",state:"loading"}),e[12]=N):N=e[12],d=N;break e}if(u==="approval"){let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(D,{icon:n.jsx(ie,{}),title:"List agents",state:"idle"}),e[13]=N):N=e[13],d=N;break e}if(u==="error"){let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(ie,{}),e[14]=N):N=e[14];const S=t.state==="output-denied"?"Agent list unavailable":"Couldn't load agents";let _;e[15]!==l?(_=n.jsx(te,{latency:l}),e[15]=l,e[16]=_):_=e[16];let w;e[17]!==S||e[18]!==_?(w=n.jsx(D,{icon:N,title:S,state:"error",trailing:_}),e[17]=S,e[18]=_,e[19]=w):w=e[19],d=w;break e}if(i.length===0){let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(ie,{}),e[20]=N):N=e[20];let S;e[21]!==l?(S=n.jsx(D,{icon:N,title:"No agents yet",summary:"This organization hasn't created any agents.",state:"idle",trailing:n.jsx(te,{latency:l})}),e[21]=l,e[22]=S):S=e[22],d=S;break e}const k=i.slice(0,Lt);f=i.length-k.length;let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ie,{className:"text-emerald-500"}),e[23]=y):y=e[23];const v=i.length===1?"1 agent":`${i.length} agents`;let j;e[24]!==l?(j=n.jsx(te,{latency:l}),e[24]=l,e[25]=j):j=e[25],e[26]!==v||e[27]!==j?(c=n.jsx(D,{icon:y,title:v,state:"idle",trailing:j}),e[26]=v,e[27]=j,e[28]=c):c=e[28],m="mt-2 flex flex-col gap-1.5",p=k.map(wl)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=i,e[8]=m,e[9]=p,e[10]=c,e[11]=d}else f=e[6],i=e[7],m=e[8],p=e[9],c=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[29]!==f||e[30]!==i||e[31]!==r||e[32]!==a?(x=f>0&&n.jsx(Rt,{count:i.length,noun:"agents",onClick:()=>r({to:"/$org/settings/agents",params:{org:a.slug}})}),e[29]=f,e[30]=i,e[31]=r,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==m||e[35]!==p||e[36]!==x?(g=n.jsxs("div",{className:m,children:[p,x]}),e[34]=m,e[35]=p,e[36]=x,e[37]=g):g=e[37];let b;return e[38]!==c||e[39]!==g?(b=n.jsxs(n.Fragment,{children:[c,g]}),e[38]=c,e[39]=g,e[40]=b):b=e[40],b}function wl(s){return n.jsx(kl,{agent:s},s.id)}const Tl={active:"bg-emerald-500",inactive:"bg-muted-foreground",error:"bg-destructive"};function Cl(s){const e=$.c(27),{connection:t}=s,l=je(),{org:r}=he(),a=t.slug,o=t.description||t.app_name,u=!a||void 0;let f;e[0]!==l||e[1]!==r||e[2]!==a?(f=()=>a&&l({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:a}}),e[0]=l,e[1]=r,e[2]=a,e[3]=f):f=e[3];let i;e[4]!==t.icon||e[5]!==t.title?(i=n.jsx(Ie,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=i):i=e[6];let m;e[7]!==t.title?(m=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[7]=t.title,e[8]=m):m=e[8];let p;e[9]!==o?(p=o&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:o}),e[9]=o,e[10]=p):p=e[10];let c;e[11]!==m||e[12]!==p?(c=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[m,p]}),e[11]=m,e[12]=p,e[13]=c):c=e[13];const d=Tl[t.status]??"bg-muted-foreground";let x;e[14]!==d?(x=V("size-2 shrink-0 rounded-full",d),e[14]=d,e[15]=x):x=e[15];let g;e[16]!==x?(g=n.jsx("span",{className:x,"aria-hidden":"true"}),e[16]=x,e[17]=g):g=e[17];let b;e[18]!==t.status?(b=n.jsx("span",{className:"sr-only",children:t.status}),e[18]=t.status,e[19]=b):b=e[19];let h;return e[20]!==u||e[21]!==b||e[22]!==f||e[23]!==i||e[24]!==c||e[25]!==g?(h=n.jsxs("button",{type:"button","aria-disabled":u,onClick:f,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[i,c,g,b]}),e[20]=u,e[21]=b,e[22]=f,e[23]=i,e[24]=c,e[25]=g,e[26]=h):h=e[26],h}function $l(s){const e=$.c(40),{part:t,latency:l}=s,r=je(),{org:a}=he();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o;let f,i,m,p,c,d;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==u){d=Symbol.for("react.early_return_sentinel");e:{const h=ve(t.output);if(i=(Array.isArray(h?.items)?h.items:[]).filter(Ml),u==="loading"||u==="approval"){let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(D,{icon:n.jsx(we,{className:"animate-pulse"}),title:"Loading connections",state:"loading"}),e[12]=N):N=e[12],d=N;break e}if(u==="error"){let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(we,{}),e[13]=N):N=e[13];const S=t.state==="output-denied"?"Connection list unavailable":"Couldn't load connections";let _;e[14]!==l?(_=n.jsx(te,{latency:l}),e[14]=l,e[15]=_):_=e[15];let w;e[16]!==S||e[17]!==_?(w=n.jsx(D,{icon:N,title:S,state:"error",trailing:_}),e[16]=S,e[17]=_,e[18]=w):w=e[18],d=w;break e}if(i.length===0){let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(we,{}),e[19]=N):N=e[19];let S;e[20]!==l?(S=n.jsx(D,{icon:N,title:"No connections yet",summary:"This organization hasn't connected any MCPs.",state:"idle",trailing:n.jsx(te,{latency:l})}),e[20]=l,e[21]=S):S=e[21],d=S;break e}const k=i.slice(0,Lt);f=i.length-k.length;let y;e[22]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(we,{className:"text-emerald-500"}),e[22]=y):y=e[22];const v=i.length===1?"1 connection":`${i.length} connections`;let j;e[23]!==l?(j=n.jsx(te,{latency:l}),e[23]=l,e[24]=j):j=e[24],e[25]!==v||e[26]!==j?(c=n.jsx(D,{icon:y,title:v,state:"idle",trailing:j}),e[25]=v,e[26]=j,e[27]=c):c=e[27],m="mt-2 flex flex-col gap-1.5",p=k.map(Il)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=i,e[8]=m,e[9]=p,e[10]=c,e[11]=d}else f=e[6],i=e[7],m=e[8],p=e[9],c=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[28]!==f||e[29]!==i||e[30]!==r||e[31]!==a?(x=f>0&&n.jsx(Rt,{count:i.length,noun:"connections",onClick:()=>r({to:"/$org/settings/connections",params:{org:a.slug}})}),e[28]=f,e[29]=i,e[30]=r,e[31]=a,e[32]=x):x=e[32];let g;e[33]!==m||e[34]!==p||e[35]!==x?(g=n.jsxs("div",{className:m,children:[p,x]}),e[33]=m,e[34]=p,e[35]=x,e[36]=g):g=e[36];let b;return e[37]!==c||e[38]!==g?(b=n.jsxs(n.Fragment,{children:[c,g]}),e[37]=c,e[38]=g,e[39]=b):b=e[39],b}function Il(s){return n.jsx(Cl,{connection:s},s.id)}function Ml(s){return s.connection_type!=="VIRTUAL"}function Ll(){const s=$.c(37),e=We(),{sendMessage:t,isStreaming:l,messages:r}=vs(),{org:a}=he(),o=e?.virtualMcpId,{prompts:u}=Es(a.slug),f=o??null;let i;s[0]!==a.id||s[1]!==a.slug||s[2]!==f?(i={connectionId:f,orgId:a.id,orgSlug:a.slug},s[0]=a.id,s[1]=a.slug,s[2]=f,s[3]=i):i=s[3];const m=ht(i),[p,c]=B.useState(null);if(!o||l||!Cs(o)||!r.some(Rl))return null;let x;if(s[4]!==u||s[5]!==o){let C;s[7]!==o?(C=L=>L.agentId===o&&L.promptName,s[7]=o,s[8]=C):C=s[8],x=u.find(C),s[4]=u,s[5]=o,s[6]=x}else x=s[6];const g=x;if(!g)return null;let b;s[9]!==m||s[10]!==t?(b=async(C,L)=>{if(!m){ze.error("MCP client not available");return}try{const R=await Bs(m,C.name,L);await t({type:"doc",content:[{type:"paragraph",content:[$t({id:C.name,name:qe(C.name,Ue(C._meta)),metadata:R.messages,char:"/",kind:"prompt",args:L}),{type:"text",text:" "}]}]})}catch(R){console.error("[next-action-chip] failed",R),ze.error("Failed to load prompt. Please try again.")}},s[9]=m,s[10]=t,s[11]=b):b=s[11];const h=b;let k;s[12]!==g._meta||s[13]!==g.arguments||s[14]!==g.description||s[15]!==g.promptName||s[16]!==g.title||s[17]!==h?(k=()=>{const C={name:g.promptName,title:g.title,description:g.description,arguments:g.arguments,_meta:g._meta};if(C.arguments&&C.arguments.length>0){c(C);return}h(C)},s[12]=g._meta,s[13]=g.arguments,s[14]=g.description,s[15]=g.promptName,s[16]=g.title,s[17]=h,s[18]=k):k=s[18];const y=k;let v,j;s[19]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ds,{size:12,className:"shrink-0 text-purple-500"}),j=n.jsx("span",{className:"font-medium text-foreground/80",children:"Next:"}),s[19]=v,s[20]=j):(v=s[19],j=s[20]);let N;s[21]!==g.title?(N=n.jsx("span",{className:"truncate",children:g.title}),s[21]=g.title,s[22]=N):N=s[22];let S;s[23]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(it,{size:12,className:"shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),s[23]=S):S=s[23];let _;s[24]!==y||s[25]!==N?(_=n.jsxs("button",{type:"button",onClick:y,className:"group mt-3 flex items-center gap-2 self-start rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:border-border hover:bg-accent/40 hover:text-foreground",children:[v,j,N,S]}),s[24]=y,s[25]=N,s[26]=_):_=s[26];let w;s[27]===Symbol.for("react.memo_cache_sentinel")?(w=C=>c(C),s[27]=w):w=s[27];let T;s[28]!==p||s[29]!==h?(T=async C=>{const L=p;c(null),L&&await h(L,C)},s[28]=p,s[29]=h,s[30]=T):T=s[30];let I;s[31]!==p||s[32]!==T?(I=n.jsx(rn,{prompt:p,setPrompt:w,onSubmit:T}),s[31]=p,s[32]=T,s[33]=I):I=s[33];let M;return s[34]!==I||s[35]!==_?(M=n.jsxs(n.Fragment,{children:[_,I]}),s[34]=I,s[35]=_,s[36]=M):M=s[36],M}function Rl(s){return s.role==="user"||s.parts.some(Al)}function Al(s){return s.type==="tool-user_ask"&&s.state==="output-available"}function zl(s){const e=$.c(5),{parts:t}=s,l=t?.length,r=t?.[t.length-1];let a;e[0]!==r||e[1]!==l?(a={enabled:!0,contentDeps:[l,r]},e[0]=r,e[1]=l,e[2]=a):a=e[2];const{sentinelRef:o}=Mt(a);let u;return e[3]!==o?(u=n.jsx("div",{ref:o,className:"h-0"}),e[3]=o,e[4]=u):u=e[4],u}function Pl(s){const e=new Map;for(let t=s.length-1;t>=0;t--){const l=s[t]?.parts;if(l)for(const r of l){const a=r;if(a.type==="data-deck-updated"){const f=a.data;if(!f?.path)continue;const i=`deck:${f.path}`;e.has(i)||e.set(i,{tabId:Ss(f.path),label:f.name||f.path,kind:f.kind==="page"?"page":"deck"});continue}if(a.type!=="tool-edit"&&a.type!=="tool-write"||a.state!=="output-available")continue;const o=a.output?.htmlPreview;if(!o?.slug)continue;const u=`page:${o.slug}`;e.has(u)||e.set(u,{tabId:`web-page:${o.slug}`,label:o.slug,kind:"page"})}}return Array.from(e.values())}function El(){const s=$.c(9),e=je(),t=$e()?.messages??[],l=Pl(t);if(l.length===0)return null;const r=l.some(Ol),a=l.some(Fl),o=r?a?"Slides & pages in this chat":"Slides in this chat":"Pages in this chat",u="flex flex-col gap-1.5 py-2";let f;s[0]!==o?(f=n.jsx("div",{className:"text-[12px] text-muted-foreground/70 uppercase tracking-wide",children:o}),s[0]=o,s[1]=f):f=s[1];const i="flex flex-wrap gap-2";let m;s[2]!==e?(m=x=>n.jsxs("button",{type:"button",onClick:()=>e({to:".",search:g=>({...g,main:x.tabId}),replace:!0}),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-muted/30 hover:bg-muted/60 text-[13px] transition-colors",children:[x.kind==="deck"?n.jsx(Ne,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Is,{className:"size-3.5 shrink-0 text-muted-foreground"}),n.jsx("span",{className:"font-medium text-foreground",children:x.label})]},x.tabId),s[2]=e,s[3]=m):m=s[3];const p=l.map(m);let c;s[4]!==p?(c=n.jsx("div",{className:i,children:p}),s[4]=p,s[5]=c):c=s[5];let d;return s[6]!==f||s[7]!==c?(d=n.jsxs("div",{className:u,children:[f,c]}),s[6]=f,s[7]=c,s[8]=d):d=s[8],d}function Fl(s){return s.kind==="page"}function Ol(s){return s.kind==="deck"}async function Dl(s,e){const t=await fetch(`/api/${e}/threads/${encodeURIComponent(s)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function ba(){const s=$.c(2),e=$e()?.messages??[];let t;return s[0]!==e?(t=e.some(Bl),s[0]=e,s[1]=t):t=s[1],t}function Bl(s){return s.parts?.some(Hl)}function Hl(s){const e=s;return(e.type==="tool-share_with_user"||e.type==="tool-bash"||e.type==="tool-write")&&e.state==="output-available"}function Wl(s,e){const t=$.c(9),{org:l}=he();let r;t[0]!==s?(r=me.threadOutputs(s??""),t[0]=s,t[1]=r):r=t[1];let a;t[2]!==l||t[3]!==s?(a=()=>Dl(s??"",l.slug),t[2]=l,t[3]=s,t[4]=a):a=t[4];const o=!!s&&(e?.enabled??!0);let u;return t[5]!==r||t[6]!==a||t[7]!==o?(u={queryKey:r,queryFn:a,enabled:o,staleTime:0},t[5]=r,t[6]=a,t[7]=o,t[8]=u):u=t[8],Oe(u)}function Ul(s){const e=$.c(20),{file:t}=s,l=je();let r;e[0]!==t.key||e[1]!==l?(r=()=>l({to:".",search:d=>({...d,main:_s(t.key)}),replace:!0}),e[0]=t.key,e[1]=l,e[2]=r):r=e[2];const a=r;let o;e[3]!==t.filename?(o=n.jsx(hs,{filename:t.filename,className:"h-5 w-4 shrink-0"}),e[3]=t.filename,e[4]=o):o=e[4];let u;e[5]!==t.filename||e[6]!==a?(u=n.jsx("button",{type:"button",onClick:a,className:"min-w-0 flex-1 truncate text-left text-[13px] font-medium text-foreground hover:underline",title:t.filename,children:t.filename}),e[5]=t.filename,e[6]=a,e[7]=u):u=e[7];const f=`Download ${t.filename}`;let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vt,{className:"size-3.5"}),e[8]=i):i=e[8];let m;e[9]!==t.downloadUrl||e[10]!==t.filename||e[11]!==f?(m=n.jsx("a",{href:t.downloadUrl,download:t.filename,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block",title:"Download","aria-label":f,children:i}),e[9]=t.downloadUrl,e[10]=t.filename,e[11]=f,e[12]=m):m=e[12];let p;e[13]!==a?(p=n.jsx(ke,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:a,children:"Open"}),e[13]=a,e[14]=p):p=e[14];let c;return e[15]!==o||e[16]!==u||e[17]!==m||e[18]!==p?(c=n.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[o,u,m,p]}),e[15]=o,e[16]=u,e[17]=m,e[18]=p,e[19]=c):c=e[19],c}function lt(s){return s.split("/").pop()??s}const ql=/(^|\/)output\//;function Vl(s){const e=new Set;for(const t of s.parts??[]){const l=t;if(l.state==="output-available"){if(l.type==="tool-share_with_user"){const r=l.output?.filename??l.input?.name??(l.input?.source?lt(l.input.source):null);r&&e.add(r)}else if(l.type==="tool-write"){const r=l.input?.path;r&&ql.test(r)&&e.add(lt(r))}}}return e}function Gl(s){const e=$.c(4),{threadId:t,message:l}=s,r=Vl(l),a=r.size>0;let o;e[0]!==a?(o={enabled:a},e[0]=a,e[1]=o):o=e[1];const{data:u}=Wl(t,o);if(r.size===0)return null;const f=(u??[]).filter(c=>r.has(c.filename));if(f.length===0)return null;const i="flex flex-col gap-1.5 py-2",m=f.map(Kl);let p;return e[2]!==m?(p=n.jsx("div",{className:i,children:m}),e[2]=m,e[3]=p):p=e[3],p}function Kl(s){return n.jsx(Ul,{file:s},s.key)}function Jl(s){return s.type==="reasoning"}function Xl(s){const e=[],t=new Set,l=new Map,r=new Map,a=new Map;if(s){let u=null;for(let f=0;f<s.parts.length;f++){const i=s.parts[f];if(Jl(i)){u||(u={parts:[],startIndex:f},e.push(u)),u.parts.push(i),t.add(f);continue}if(u=null,i.type==="data-tool-metadata"&&"id"in i&&"data"in i){const m=i.data,p={};m.annotations&&(p.annotations=m.annotations),typeof m.latencyMs=="number"&&Number.isFinite(m.latencyMs)&&(p.latencySeconds=m.latencyMs/1e3),typeof m.outputBytes=="number"&&Number.isFinite(m.outputBytes)&&m.outputBytes>=0&&(p.outputBytes=m.outputBytes),m._meta&&typeof m._meta=="object"&&(p._meta=m._meta),l.set(i.id,p);continue}if(i.type==="data-tool-subtask-metadata"&&"id"in i){r.set(i.id,i.data);continue}if(i.type==="data-web-search"&&"id"in i&&"data"in i){const m=i.id,p=i.data;a.set(m,p.text??"");continue}}}const o=[];if(s){let u=[],f=[];const i=new Set,m=()=>{for(const p of u)i.has(p)||(i.add(p),o.push({kind:"reasoning-group",group:p}));for(const p of f)o.push({kind:"part",index:p.index});u=[],f=[]};for(let p=0;p<s.parts.length;p++){const c=s.parts[p];if(c.type==="step-start"){m();continue}if(t.has(p)){const d=e.find(x=>x.startIndex===p);d&&u.push(d);continue}c.type.startsWith("data-")||f.push({index:p})}m()}return{reasoningGroups:e,renderOrder:o,dataParts:{toolMetadata:l,toolSubtaskMetadata:r,webSearchStreaming:a}}}function Ql(s){const e=$.c(9),{since:t}=s;let l;e[0]!==t?(l=()=>Qe(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[r,a]=B.useState(l);let o,u;e[2]!==t?(o=()=>{const p=setInterval(()=>a(Qe(t,Date.now())),100);return()=>clearInterval(p)},u=[t],e[2]=t,e[3]=o,e[4]=u):(o=e[3],u=e[4]),B.useEffect(o,u);const f=r/1e3;let i;e[5]!==f?(i=de(f),e[5]=f,e[6]=i):i=e[6];let m;return e[7]!==i?(m=n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:i}),e[7]=i,e[8]=m):m=e[8],m}const Ot=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Yl(){const s=$.c(5),[e]=B.useState(Zl);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},s[0]=t):t=s[0];let l;s[1]!==e?(l=Ot.map((a,o)=>{const{delay:u}=a;return n.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[o],animation:"grid-ripple 1s ease infinite",animationDelay:`${u}ms`}},o)}),s[1]=e,s[2]=l):l=s[2];let r;return s[3]!==l?(r=n.jsx("div",{className:"grid",style:t,children:l}),s[3]=l,s[4]=r):r=s[4],r}function Zl(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Ot.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}const eo={planning:{icon:n.jsx(ns,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:n.jsx(Be,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},to=1200;function so(){const s=$.c(7),[e,t]=B.useState("planning");let l,r;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{const f=setTimeout(()=>{t("thinking")},to);return()=>{clearTimeout(f)}},r=[],s[0]=l,s[1]=r):(l=s[0],r=s[1]),B.useEffect(l,r);const a=eo[e];let o;s[2]!==a.label?(o=n.jsxs("span",{className:"text-[14px] text-muted-foreground shimmer",children:[a.label,"..."]}),s[2]=a.label,s[3]=o):o=s[3];let u;return s[4]!==a.icon||s[5]!==o?(u=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:[a.icon,o]})}),s[4]=a.icon,s[5]=o,s[6]=u):u=s[6],u}function no(s){const e=$.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Yl,{}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=n.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[l,n.jsx(Ql,{since:t})]}),e[1]=t,e[2]=r):r=e[2],r}function lo(s){const e=$.c(20),{duration:t,parts:l,isStreaming:r}=s;let a;e[0]!==l?(a=l.every(ro),e[0]=l,e[1]=a):a=e[1];const o=a;let u;e[2]!==t?(u=t&&t/1e3>1?`Thought for ${de(t/1e3)}`:"Thought",e[2]=t,e[3]=u):u=e[3];const f=u;let i;if(e[4]!==o||e[5]!==r||e[6]!==l){const y=l.map(ao).join(`
35
+ ${x}`;return{fallbackTitle:i,summary:p,usage:e?.usage,latency:t,detail:g,state:f}}function Zn(s){const e=$.c(7),t=Pt(s);let l,r;e[0]!==t?({fallbackTitle:l,...r}=t,e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ie,{icon:void 0,name:"Subtask",size:"2xs",className:"rounded-xs",fallbackIcon:n.jsx(kt,{})}),e[3]=a):a=e[3];let o;return e[4]!==l||e[5]!==r?(o=n.jsx(D,{icon:a,title:l,...r}),e[4]=l,e[5]=r,e[6]=o):o=e[6],o}function el(s){const e=$.c(11),t=Pt(s);let l,r;e[0]!==t?({fallbackTitle:l,...r}=t,e[0]=t,e[1]=l,e[2]=r):(l=e[1],r=e[2]);const a=Fs(s.part.input?.agent_id),o=a?.icon,u=a?.title??"Subtask";let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(kt,{}),e[3]=f):f=e[3];let i;e[4]!==o||e[5]!==u?(i=n.jsx(Ie,{icon:o,name:u,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[4]=o,e[5]=u,e[6]=i):i=e[6];const m=a?.title??l;let p;return e[7]!==r||e[8]!==i||e[9]!==m?(p=n.jsx(D,{icon:i,title:m,...r}),e[7]=r,e[8]=i,e[9]=m,e[10]=p):p=e[10],p}function tl(s){const e=$.c(16),{part:t}=s;if(!t.state.startsWith("output-"))return null;const l=t.input?.plan??"",a=t.output?.approved===!0;let o,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(jt,{className:"size-4 text-purple-500 shrink-0"}),u=n.jsx("span",{className:"text-[14px] font-medium text-foreground/80",children:"Implementation Plan"}),e[0]=o,e[1]=u):(o=e[0],u=e[1]);let f;e[2]!==a?(f=a&&n.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-600 bg-green-500/10 px-1.5 py-0.5 rounded-md",children:[n.jsx(He,{size:12}),"Approved"]}),e[2]=a,e[3]=f):f=e[3];let i;e[4]!==a||e[5]!==t.state?(i=!a&&t.state==="output-available"&&n.jsx("span",{className:"text-xs text-muted-foreground/70 italic",children:"Rejected"}),e[4]=a,e[5]=t.state,e[6]=i):i=e[6];let m;e[7]!==f||e[8]!==i?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,u,f,i]}),e[7]=f,e[8]=i,e[9]=m):m=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"View plan"}),e[10]=p):p=e[10];let c;e[11]!==l?(c=n.jsxs("details",{className:"ml-6",children:[p,n.jsx("div",{className:"mt-1 pl-2 border-l-2 border-purple-500/30 prose prose-sm max-w-none text-sm",children:n.jsx(Ve,{id:"plan-content",part:{type:"text",text:l}})})]}),e[11]=l,e[12]=c):c=e[12];let d;return e[13]!==m||e[14]!==c?(d=n.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,c]}),e[13]=m,e[14]=c,e[15]=d):d=e[15],d}const Ke={primary:"Primary",secondary:"Secondary",accent:"Accent",background:"Background",foreground:"Foreground"};function sl(s){return s.startsWith("http")?s:`https://${s}`}function st(s){const e=$.c(2),{children:t}=s;let l;return e[0]!==t?(l=n.jsx("span",{className:"text-sm font-medium text-foreground",children:t}),e[0]=t,e[1]=l):l=e[1],l}function nl(s){const e=$.c(12),{name:t,value:l}=s;let r;e[0]!==l?(r=n.jsx("span",{className:"size-7 shrink-0 rounded-md border border-border",style:{backgroundColor:l},"aria-hidden":!0}),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==t?(a=n.jsx("span",{className:"text-sm text-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==l?(o=n.jsx("span",{className:"text-xs font-mono tabular-nums text-muted-foreground",children:l}),e[4]=l,e[5]=o):o=e[5];let u;e[6]!==a||e[7]!==o?(u=n.jsxs("div",{className:"flex flex-col leading-tight min-w-0",children:[a,o]}),e[6]=a,e[7]=o,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==u?(f=n.jsxs("div",{className:"flex items-center gap-2.5",children:[r,u]}),e[9]=r,e[10]=u,e[11]=f):f=e[11],f}function ll(s){const e=$.c(15),{role:t,family:l}=s;let r;e[0]!==l?(r=n.jsx("span",{className:"text-2xl font-medium leading-none text-foreground shrink-0",style:{fontFamily:l},"aria-hidden":!0,children:"Aa"}),e[0]=l,e[1]=r):r=e[1];let a;e[2]!==t?(a=n.jsx("span",{className:"text-xs text-muted-foreground",children:t}),e[2]=t,e[3]=a):a=e[3];let o;e[4]!==l?(o={fontFamily:l},e[4]=l,e[5]=o):o=e[5];let u;e[6]!==l||e[7]!==o?(u=n.jsx("span",{className:"text-sm text-foreground",style:o,children:l}),e[6]=l,e[7]=o,e[8]=u):u=e[8];let f;e[9]!==a||e[10]!==u?(f=n.jsxs("div",{className:"flex flex-col leading-tight",children:[a,u]}),e[9]=a,e[10]=u,e[11]=f):f=e[11];let i;return e[12]!==r||e[13]!==f?(i=n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-muted px-4 py-3",children:[r,f]}),e[12]=r,e[13]=f,e[14]=i):i=e[14],i}function ol(s){const e=$.c(3),{logo:t,favicon:l,name:r}=s,a=t??l;if(!a)return null;const o=r?`${r} logo`:"";let u;return e[0]!==a||e[1]!==o?(u=n.jsx("img",{src:a,alt:o,className:"size-16 shrink-0 rounded-lg border border-border bg-background object-contain p-2",onError:al}),e[0]=a,e[1]=o,e[2]=u):u=e[2],u}function al(s){s.target.style.display="none"}function Et(s){const e=$.c(4),{colors:t}=s;let l;e[0]!==t?(l=Object.entries(t).filter(il),e[0]=t,e[1]=l):l=e[1];const r=l;if(r.length===0)return null;let a;return e[2]!==r?(a=n.jsx("div",{className:"flex h-1.5",children:r.map(rl)}),e[2]=r,e[3]=a):a=e[3],a}function rl(s){const[e,t]=s;return n.jsx("span",{className:"flex-1",style:{backgroundColor:t},title:`${Ke[e]}: ${t}`,"aria-hidden":!0},e)}function il(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function Ft(s){const e=$.c(36),{logo:t,favicon:l,name:r,domain:a,overview:o,colors:u,fonts:f,showDefaultBadge:i,isDefault:m}=s;let p;e[0]!==u?(p=u?Object.entries(u).filter(fl):[],e[0]=u,e[1]=p):p=e[1];const c=p;let d;e[2]!==f?(d=f?Object.entries(f).filter(dl):[],e[2]=f,e[3]=d):d=e[3];const x=d;let g;e[4]!==u?(g=u&&n.jsx(Et,{colors:u}),e[4]=u,e[5]=g):g=e[5];let b;e[6]!==l||e[7]!==t||e[8]!==r?(b=n.jsx(ol,{logo:t,favicon:l,name:r}),e[6]=l,e[7]=t,e[8]=r,e[9]=b):b=e[9];let h;e[10]!==m||e[11]!==r||e[12]!==i?(h=r&&n.jsxs("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-foreground truncate",children:[r,i&&m&&n.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[n.jsx(yt,{className:"size-3 text-amber-500"}),"default"]})]}),e[10]=m,e[11]=r,e[12]=i,e[13]=h):h=e[13];let k;e[14]!==a?(k=a&&n.jsxs("a",{href:sl(a),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[a,n.jsx(Nt,{className:"size-3 shrink-0"})]}),e[14]=a,e[15]=k):k=e[15];let y;e[16]!==h||e[17]!==k?(y=n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h,k]}),e[16]=h,e[17]=k,e[18]=y):y=e[18];let v;e[19]!==b||e[20]!==y?(v=n.jsxs("div",{className:"flex items-center gap-4",children:[b,y]}),e[19]=b,e[20]=y,e[21]=v):v=e[21];let j;e[22]!==o?(j=o&&n.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:o}),e[22]=o,e[23]=j):j=e[23];let N;e[24]!==c?(N=c.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(st,{children:"Colors"}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3",children:c.map(ul)})]}),e[24]=c,e[25]=N):N=e[25];let S;e[26]!==x?(S=x.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(st,{children:"Typography"}),n.jsx("div",{className:"flex flex-wrap gap-2.5",children:x.map(cl)})]}),e[26]=x,e[27]=S):S=e[27];let _;e[28]!==N||e[29]!==S||e[30]!==v||e[31]!==j?(_=n.jsxs("div",{className:"p-5 flex flex-col gap-6",children:[v,j,N,S]}),e[28]=N,e[29]=S,e[30]=v,e[31]=j,e[32]=_):_=e[32];let w;return e[33]!==_||e[34]!==g?(w=n.jsxs("div",{className:"mt-2 rounded-lg overflow-hidden border border-border",children:[g,_]}),e[33]=_,e[34]=g,e[35]=w):w=e[35],w}function cl(s){const[e,t]=s;return n.jsx(ll,{role:e,family:t},e)}function ul(s){const[e,t]=s;return n.jsx(nl,{name:Ke[e],value:t},e)}function dl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function fl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function ml(s){const e=$.c(29),{part:t,latency:l}=s,r=re(t.state);let a;e[0]!==t.output?(a=ve(t.output),e[0]=t.output,e[1]=a):a=e[1];const o=a,u=r==="loading",f=r==="error"||o&&o.success===!1;if(u){const S=t.input;let _;e[2]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(ce,{className:"animate-pulse"}),e[2]=_):_=e[2];const w=S?.domain?`from ${S.domain}`:void 0;let T;return e[3]!==w?(T=n.jsx(D,{icon:_,title:"Extracting brand",summary:w,state:"loading",defaultOpen:!0}),e[3]=w,e[4]=T):T=e[4],T}if(f){let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ce,{}),e[5]=S):S=e[5];const _=o?.error??"Unknown error";let w;e[6]!==l?(w=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[6]=l,e[7]=w):w=e[7];let T;return e[8]!==_||e[9]!==w?(T=n.jsx(D,{icon:S,title:"Brand extraction failed",summary:_,state:"error",trailing:w}),e[8]=_,e[9]=w,e[10]=T):T=e[10],T}let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ce,{className:"text-fuchsia-500"}),e[11]=i):i=e[11];const m=o?.name?`Brand set: ${o.name}`:"Brand context set",p=o?.domain;let c;e[12]!==l?(c=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[12]=l,e[13]=c):c=e[13];let d;e[14]!==m||e[15]!==p||e[16]!==c?(d=n.jsx(D,{icon:i,title:m,summary:p,state:"idle",trailing:c}),e[14]=m,e[15]=p,e[16]=c,e[17]=d):d=e[17];const x=o?.logo,g=o?.favicon,b=o?.name,h=o?.domain,k=o?.overview,y=o?.colors,v=o?.fonts;let j;e[18]!==h||e[19]!==k||e[20]!==y||e[21]!==v||e[22]!==x||e[23]!==g||e[24]!==b?(j=n.jsx(Ft,{logo:x,favicon:g,name:b,domain:h,overview:k,colors:y,fonts:v}),e[18]=h,e[19]=k,e[20]=y,e[21]=v,e[22]=x,e[23]=g,e[24]=b,e[25]=j):j=e[25];let N;return e[26]!==j||e[27]!==d?(N=n.jsxs(n.Fragment,{children:[d,j]}),e[26]=j,e[27]=d,e[28]=N):N=e[28],N}function pl(s){const e=$.c(27),{part:t,latency:l}=s,r=re(t.state);let a;e[0]!==t.output?(a=ve(t.output),e[0]=t.output,e[1]=a):a=e[1];const o=a,u=r==="loading",f=r==="error"||o&&o.success===!1;if(u){let g;return e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brand",state:"loading"}),e[2]=g):g=e[2],g}if(f||!o){let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ce,{}),e[3]=g):g=e[3];let b;e[4]!==l?(b=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[4]=l,e[5]=b):b=e[5];let h;return e[6]!==b?(h=n.jsx(D,{icon:g,title:"Couldn't load brand",state:"error",trailing:b}),e[6]=b,e[7]=h):h=e[7],h}let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ce,{className:"text-fuchsia-500"}),e[8]=i):i=e[8];const m=o.name?`Brand · ${o.name}`:"Brand";let p;e[9]!==l?(p=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[9]=l,e[10]=p):p=e[10];let c;e[11]!==o.domain||e[12]!==m||e[13]!==p?(c=n.jsx(D,{icon:i,title:m,summary:o.domain,state:"idle",trailing:p}),e[11]=o.domain,e[12]=m,e[13]=p,e[14]=c):c=e[14];let d;e[15]!==o.colors||e[16]!==o.domain||e[17]!==o.favicon||e[18]!==o.fonts||e[19]!==o.isDefault||e[20]!==o.logo||e[21]!==o.name||e[22]!==o.overview?(d=n.jsx(Ft,{logo:o.logo,favicon:o.favicon,name:o.name,domain:o.domain,overview:o.overview,colors:o.colors,fonts:o.fonts,showDefaultBadge:!0,isDefault:o.isDefault}),e[15]=o.colors,e[16]=o.domain,e[17]=o.favicon,e[18]=o.fonts,e[19]=o.isDefault,e[20]=o.logo,e[21]=o.name,e[22]=o.overview,e[23]=d):d=e[23];let x;return e[24]!==c||e[25]!==d?(x=n.jsxs(n.Fragment,{children:[c,d]}),e[24]=c,e[25]=d,e[26]=x):x=e[26],x}function xl(s){const e=$.c(32),{part:t,latency:l}=s;let r;e[0]!==t.state?(r=re(t.state),e[0]=t.state,e[1]=r):r=e[1];const a=r;let o,u,f,i;if(e[2]!==l||e[3]!==t.output||e[4]!==a){i=Symbol.for("react.early_return_sentinel");e:{const c=ve(t.output),d=Array.isArray(c?.items)?c.items:[],x=a==="loading",g=a==="error";if(x){let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brands",state:"loading"}),e[9]=y):y=e[9],i=y;break e}if(g){let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ce,{}),e[10]=y):y=e[10];let v;e[11]!==l?(v=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[11]=l,e[12]=v):v=e[12];let j;e[13]!==v?(j=n.jsx(D,{icon:y,title:"Couldn't load brands",state:"error",trailing:v}),e[13]=v,e[14]=j):j=e[14],i=j;break e}if(d.length===0){let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ce,{}),e[15]=y):y=e[15];let v;e[16]!==l?(v=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[16]=l,e[17]=v):v=e[17];let j;e[18]!==v?(j=n.jsx(D,{icon:y,title:"No brands yet",summary:"The organization hasn't set up any brand context.",state:"idle",trailing:v}),e[18]=v,e[19]=j):j=e[19],i=j;break e}let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(ce,{className:"text-fuchsia-500"}),e[20]=b):b=e[20];const h=d.length===1?"1 brand":`${d.length} brands`;let k;e[21]!==l?(k=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[21]=l,e[22]=k):k=e[22],e[23]!==h||e[24]!==k?(f=n.jsx(D,{icon:b,title:h,state:"idle",trailing:k}),e[23]=h,e[24]=k,e[25]=f):f=e[25],o="mt-2 flex flex-col gap-1.5",u=d.map(gl)}e[2]=l,e[3]=t.output,e[4]=a,e[5]=o,e[6]=u,e[7]=f,e[8]=i}else o=e[5],u=e[6],f=e[7],i=e[8];if(i!==Symbol.for("react.early_return_sentinel"))return i;let m;e[26]!==o||e[27]!==u?(m=n.jsx("div",{className:o,children:u}),e[26]=o,e[27]=u,e[28]=m):m=e[28];let p;return e[29]!==f||e[30]!==m?(p=n.jsxs(n.Fragment,{children:[f,m]}),e[29]=f,e[30]=m,e[31]=p):p=e[31],p}function gl(s){const e=s.colors?Object.entries(s.colors).filter(yl):[];return n.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[s.colors&&n.jsx(Et,{colors:s.colors}),n.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[(s.logo||s.favicon)&&n.jsx("img",{src:s.logo??s.favicon??void 0,alt:"",className:"size-8 shrink-0 rounded-md border border-border bg-background object-contain p-0.5",onError:bl}),n.jsxs("div",{className:"flex flex-col leading-tight min-w-0 flex-1",children:[n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-foreground truncate",children:[s.name??"Untitled",s.isDefault&&n.jsx(yt,{className:"size-3 text-amber-500 shrink-0"})]}),s.domain&&n.jsx("span",{className:"text-[11px] text-muted-foreground truncate",children:s.domain})]}),e.length>0&&n.jsx("div",{className:"flex items-center gap-0.5 shrink-0",children:e.slice(0,5).map(hl)})]})]},s.id??`${s.name}-${s.domain}`)}function hl(s){const[e,t]=s;return n.jsx("span",{className:"size-3 rounded-full border border-border",style:{backgroundColor:t},title:`${Ke[e]}: ${t}`,"aria-hidden":!0},e)}function bl(s){s.target.style.display="none"}function yl(s){const[,e]=s;return typeof e=="string"&&e.trim().length>0}function Fe(s){const e=$.c(4),{connection_id:t,iconSize:l}=s,r=l===void 0?"xs":l,a=Os(t);if(!a)return null;let o;return e[0]!==a.icon||e[1]!==a.title||e[2]!==r?(o=n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx(Ie,{icon:a.icon,name:a.title,size:r})}),e[0]=a.icon,e[1]=a.title,e[2]=r,e[3]=o):o=e[3],o}Fe.Fallback=function({iconSize:e="xs"}){const t=e==="sm"?"size-6":"size-5";return n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx("div",{className:V(t,"rounded bg-muted animate-pulse")})})};function Se(s){const e=$.c(18),{connectionIds:t,maxVisibleIcons:l,iconSize:r,className:a}=s,o=l===void 0?2:l,u=r===void 0?"xs":r;if(t.length===0)return null;let f,i,m;if(e[0]!==a||e[1]!==t||e[2]!==u||e[3]!==o){const d=t.slice(0,o);f=t.length-o,e[7]!==a?(i=V("flex items-center justify-end -space-x-2",a),e[7]=a,e[8]=i):i=e[8];let x;e[9]!==u?(x=g=>n.jsx(B.Suspense,{fallback:n.jsx(Fe.Fallback,{iconSize:u}),children:n.jsx(Fe,{connection_id:g,iconSize:u})},g),e[9]=u,e[10]=x):x=e[10],m=d.map(x),e[0]=a,e[1]=t,e[2]=u,e[3]=o,e[4]=f,e[5]=i,e[6]=m}else f=e[4],i=e[5],m=e[6];let p;e[11]!==u||e[12]!==f?(p=f>0&&n.jsx("div",{className:V("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",u==="sm"?"size-8":"size-6"),children:n.jsxs("span",{className:V(u==="sm"?"text-sm":"text-xs","font-medium text-muted-foreground"),"aria-label":`and ${f} more`,children:["+",f]})}),e[11]=u,e[12]=f,e[13]=p):p=e[13];let c;return e[14]!==i||e[15]!==m||e[16]!==p?(c=n.jsxs("div",{className:i,children:[m,p]}),e[14]=i,e[15]=m,e[16]=p,e[17]=c):c=e[17],c}Se.Fallback=function({maxVisibleIcons:e=2,totalCount:t,iconSize:l="xs"}){const r=l==="sm"?"size-6":"size-5",a=l==="sm"?"size-8":"size-6",o=t!==void 0&&t>e;return n.jsxs("div",{className:"flex items-center -space-x-2",children:[Array.from({length:e}).map((u,f)=>n.jsx("div",{className:"shrink-0 bg-background ring-1 ring-background rounded-lg",children:n.jsx("div",{className:V(r,"rounded bg-muted animate-pulse")})},f)),o&&n.jsx("div",{className:V("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",a),children:n.jsx("div",{className:V(l==="sm"?"h-3.5 w-5":"h-3 w-4","rounded bg-muted animate-pulse")})})]})};const jl="This document certifies that the bearer agent has been granted authorized access to the tools and capabilities described herein. The agent is permitted to operate within the scope defined by its instructions and shall act in accordance with the constraints set forth by the issuing organization. This credential remains valid for the duration of the agent's active status. Unauthorized modification of this agent's permissions or scope is prohibited. The issuing authority reserves the right to revoke access at any time. All actions performed by this agent are subject to audit and review by the organization administrator. ",nt=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function vl(s){const e=$.c(64),{part:t,latency:l}=s,r=St(),a=re(t.state),o=B.useRef(null),u=B.useRef(null),f=B.useRef(null),i=B.useRef(null),m=B.useRef(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{nt?.matches||(m.current=o.current?.getBoundingClientRect()??null,o.current&&(o.current.style.willChange="transform"))},e[0]=p):p=e[0];const c=p;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=E=>{if(nt?.matches)return;const q=m.current,G=o.current;if(!q||!G)return;const J=(E.clientX-q.left)/q.width*100,ee=(E.clientY-q.top)/q.height*100;G.style.transform=`perspective(800px) rotateY(${(J-50)*.05}deg) rotateX(${(ee-50)*-.05}deg)`,u.current&&(u.current.style.opacity="1",u.current.style.transform=`translate(${(J-50)*.15}px, ${(ee-50)*.15}px)`),f.current&&(f.current.style.opacity="0.45"),i.current&&(i.current.style.opacity="0.45")},e[1]=d):d=e[1];const x=d;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{const E=o.current;E&&(E.style.transform="none",E.style.willChange="auto"),u.current&&(u.current.style.opacity="0.4",u.current.style.transform="translate(0, 0)"),f.current&&(f.current.style.opacity="0.3"),i.current&&(i.current.style.opacity="0.3"),m.current=null},e[2]=g):g=e[2];const b=g;if(a==="loading"){let E;return e[3]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Creating agent",state:"loading",defaultOpen:!0}),e[3]=E):E=e[3],E}if(a==="approval"){let E;return e[4]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(D,{icon:n.jsx(ie,{}),title:"Create agent",state:"idle"}),e[4]=E):E=e[4],E}if(a==="error"){let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(ie,{}),e[5]=E):E=e[5];const q=t.state==="output-denied"?"Agent creation cancelled":"Couldn't create agent";let G;e[6]!==l?(G=n.jsx(te,{latency:l}),e[6]=l,e[7]=G):G=e[7];let J;return e[8]!==q||e[9]!==G?(J=n.jsx(D,{icon:E,title:q,state:"error",trailing:G}),e[8]=q,e[9]=G,e[10]=J):J=e[10],J}let h,k,y;if(e[11]!==l||e[12]!==t.output){y=Symbol.for("react.early_return_sentinel");e:{if(h=ve(t.output)?.item,!h?.id||!h?.title){let E;e[16]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(ie,{}),e[16]=E):E=e[16];let q;e[17]!==l?(q=n.jsx(D,{icon:E,title:"Agent created",state:"idle",trailing:n.jsx(te,{latency:l})}),e[17]=l,e[18]=q):q=e[18],y=q;break e}k=(h.connections??[]).map(Nl)}e[11]=l,e[12]=t.output,e[13]=h,e[14]=k,e[15]=y}else h=e[13],k=e[14],y=e[15];if(y!==Symbol.for("react.early_return_sentinel"))return y;const v=k;let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ie,{className:"text-emerald-500"}),e[19]=j):j=e[19];const N=`Agent created: ${h.title}`;let S;e[20]!==l?(S=n.jsx(te,{latency:l}),e[20]=l,e[21]=S):S=e[21];let _;e[22]!==N||e[23]!==S?(_=n.jsx(D,{icon:j,title:N,state:"idle",trailing:S}),e[22]=N,e[23]=S,e[24]=_):_=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w={transition:"transform 0.3s ease-out"},e[25]=w):w=e[25];let T;e[26]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("div",{ref:u,className:"pointer-events-none absolute inset-[-20%] z-[1] select-none rounded-lg",style:{background:"linear-gradient(135deg, hsla(280, 60%, 80%, 0.35) 0%, transparent 35%), linear-gradient(315deg, hsla(190, 70%, 80%, 0.35) 0%, transparent 35%), linear-gradient(225deg, hsla(140, 55%, 80%, 0.3) 0%, transparent 30%), linear-gradient(45deg, hsla(320, 55%, 82%, 0.3) 0%, transparent 30%)",opacity:.4,transition:"opacity 0.3s ease, transform 0.3s ease-out"},"aria-hidden":"true"}),e[26]=T):T=e[26];let I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I={textAlign:"justify",wordBreak:"break-all"},e[27]=I):I=e[27];let M,C;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=n.jsx("p",{className:"pointer-events-none absolute inset-0 z-[1] select-none overflow-hidden text-[6px] font-light leading-[1.5] tracking-[0.06px] text-background opacity-50 mix-blend-overlay",style:I,"aria-hidden":"true",children:jl.repeat(6)}),C=n.jsx("img",{src:"/stamp.svg",alt:"",className:"pointer-events-none absolute -right-10 -top-10 size-[140px] opacity-50 select-none","aria-hidden":"true"}),e[28]=M,e[29]=C):(M=e[28],C=e[29]);let L;e[30]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("img",{ref:f,src:"/left-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 left-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[30]=L):L=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=n.jsx("img",{ref:i,src:"/right-guilloche.png",alt:"",className:"pointer-events-none absolute inset-y-0 right-0 h-full w-auto select-none z-[1] mix-blend-overlay",style:{opacity:.3,transition:"opacity 0.3s ease"},"aria-hidden":"true"}),e[31]=R):R=e[31];let F;e[32]!==h.icon||e[33]!==h.title?(F=n.jsx(rt,{icon:h.icon,name:h.title,size:"md"}),e[32]=h.icon,e[33]=h.title,e[34]=F):F=e[34];let z;e[35]!==h.title?(z=n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:h.title})}),e[35]=h.title,e[36]=z):z=e[36];let A;e[37]!==F||e[38]!==z?(A=n.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[F,z]}),e[37]=F,e[38]=z,e[39]=A):A=e[39];let P;e[40]!==h.description?(P=h.description&&n.jsx("div",{className:"px-2 pt-1 pr-16",children:n.jsx("p",{className:"text-sm leading-snug text-muted-foreground line-clamp-2",children:h.description})}),e[40]=h.description,e[41]=P):P=e[41];let O;e[42]!==A||e[43]!==P?(O=n.jsxs("div",{className:"relative",children:[A,P]}),e[42]=A,e[43]=P,e[44]=O):O=e[44];let W;e[45]!==v?(W=v.length>0&&n.jsx(B.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:v.length}),children:n.jsx(Se,{connectionIds:v,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})}),e[45]=v,e[46]=W):W=e[46];let U;e[47]!==W?(U=n.jsx("div",{className:"flex-1 min-w-0",children:W}),e[47]=W,e[48]=U):U=e[48];let H;e[49]!==h.id||e[50]!==r?(H=()=>r(h.id),e[49]=h.id,e[50]=r,e[51]=H):H=e[51];const Y=`See agent: ${h.title}`;let K;e[52]!==H||e[53]!==Y?(K=n.jsx("div",{className:"flex items-center gap-2 shrink-0",children:n.jsx(ke,{size:"sm",className:"h-7",onClick:H,"aria-label":Y,children:"See agent"})}),e[52]=H,e[53]=Y,e[54]=K):K=e[54];let Q;e[55]!==U||e[56]!==K?(Q=n.jsxs("div",{className:"relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1",children:[U,K]}),e[55]=U,e[56]=K,e[57]=Q):Q=e[57];let X;e[58]!==O||e[59]!==Q?(X=n.jsx("div",{className:"mt-2 overflow-hidden rounded-xl border-[0.5px] border-border bg-card p-2.5",children:n.jsxs("div",{ref:o,className:"relative overflow-hidden rounded-lg bg-accent/25 p-2",style:w,onMouseEnter:c,onMouseMove:x,onMouseLeave:b,children:[T,M,C,L,R,O,Q]})}),e[58]=O,e[59]=Q,e[60]=X):X=e[60];let Z;return e[61]!==X||e[62]!==_?(Z=n.jsxs(n.Fragment,{children:[_,X]}),e[61]=X,e[62]=_,e[63]=Z):Z=e[63],Z}function Nl(s){return s.connection_id}function kl(s){const e=$.c(24),{agent:t}=s,l=St();if(!t.id)return null;let r;e[0]!==t.connections?(r=t.connections??[],e[0]=t.connections,e[1]=r):r=e[1];let a;e[2]!==r?(a=r.map(Sl),e[2]=r,e[3]=a):a=e[3];const o=a;let u;e[4]!==t.id||e[5]!==l?(u=()=>l(t.id),e[4]=t.id,e[5]=l,e[6]=u):u=e[6];let f;e[7]!==t.icon||e[8]!==t.title?(f=n.jsx(rt,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=f):f=e[9];let i;e[10]!==t.title?(i=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=i):i=e[11];let m;e[12]!==t.description?(m=t.description&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[12]=t.description,e[13]=m):m=e[13];let p;e[14]!==i||e[15]!==m?(p=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[i,m]}),e[14]=i,e[15]=m,e[16]=p):p=e[16];let c;e[17]!==o?(c=o.length>0&&n.jsx(B.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:o.length}),children:n.jsx(Se,{connectionIds:o,iconSize:"xs",maxVisibleIcons:3})}),e[17]=o,e[18]=c):c=e[18];let d;return e[19]!==u||e[20]!==f||e[21]!==p||e[22]!==c?(d=n.jsxs("button",{type:"button",onClick:u,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[f,p,c]}),e[19]=u,e[20]=f,e[21]=p,e[22]=c,e[23]=d):d=e[23],d}function Sl(s){return s.connection_id}function _l(s){const e=$.c(41),{part:t,latency:l}=s,r=je(),{org:a}=he();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o;let f,i,m,p,c,d;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==u){d=Symbol.for("react.early_return_sentinel");e:{const h=ve(t.output);if(i=Array.isArray(h?.items)?h.items:[],u==="loading"){let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Loading agents",state:"loading"}),e[12]=N):N=e[12],d=N;break e}if(u==="approval"){let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(D,{icon:n.jsx(ie,{}),title:"List agents",state:"idle"}),e[13]=N):N=e[13],d=N;break e}if(u==="error"){let N;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(ie,{}),e[14]=N):N=e[14];const S=t.state==="output-denied"?"Agent list unavailable":"Couldn't load agents";let _;e[15]!==l?(_=n.jsx(te,{latency:l}),e[15]=l,e[16]=_):_=e[16];let w;e[17]!==S||e[18]!==_?(w=n.jsx(D,{icon:N,title:S,state:"error",trailing:_}),e[17]=S,e[18]=_,e[19]=w):w=e[19],d=w;break e}if(i.length===0){let N;e[20]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(ie,{}),e[20]=N):N=e[20];let S;e[21]!==l?(S=n.jsx(D,{icon:N,title:"No agents yet",summary:"This organization hasn't created any agents.",state:"idle",trailing:n.jsx(te,{latency:l})}),e[21]=l,e[22]=S):S=e[22],d=S;break e}const k=i.slice(0,Lt);f=i.length-k.length;let y;e[23]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ie,{className:"text-emerald-500"}),e[23]=y):y=e[23];const v=i.length===1?"1 agent":`${i.length} agents`;let j;e[24]!==l?(j=n.jsx(te,{latency:l}),e[24]=l,e[25]=j):j=e[25],e[26]!==v||e[27]!==j?(c=n.jsx(D,{icon:y,title:v,state:"idle",trailing:j}),e[26]=v,e[27]=j,e[28]=c):c=e[28],m="mt-2 flex flex-col gap-1.5",p=k.map(wl)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=i,e[8]=m,e[9]=p,e[10]=c,e[11]=d}else f=e[6],i=e[7],m=e[8],p=e[9],c=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[29]!==f||e[30]!==i||e[31]!==r||e[32]!==a?(x=f>0&&n.jsx(Rt,{count:i.length,noun:"agents",onClick:()=>r({to:"/$org/settings/agents",params:{org:a.slug}})}),e[29]=f,e[30]=i,e[31]=r,e[32]=a,e[33]=x):x=e[33];let g;e[34]!==m||e[35]!==p||e[36]!==x?(g=n.jsxs("div",{className:m,children:[p,x]}),e[34]=m,e[35]=p,e[36]=x,e[37]=g):g=e[37];let b;return e[38]!==c||e[39]!==g?(b=n.jsxs(n.Fragment,{children:[c,g]}),e[38]=c,e[39]=g,e[40]=b):b=e[40],b}function wl(s){return n.jsx(kl,{agent:s},s.id)}const Tl={active:"bg-emerald-500",inactive:"bg-muted-foreground",error:"bg-destructive"};function Cl(s){const e=$.c(27),{connection:t}=s,l=je(),{org:r}=he(),a=t.slug,o=t.description||t.app_name,u=!a||void 0;let f;e[0]!==l||e[1]!==r||e[2]!==a?(f=()=>a&&l({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:a}}),e[0]=l,e[1]=r,e[2]=a,e[3]=f):f=e[3];let i;e[4]!==t.icon||e[5]!==t.title?(i=n.jsx(Ie,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=i):i=e[6];let m;e[7]!==t.title?(m=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[7]=t.title,e[8]=m):m=e[8];let p;e[9]!==o?(p=o&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:o}),e[9]=o,e[10]=p):p=e[10];let c;e[11]!==m||e[12]!==p?(c=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[m,p]}),e[11]=m,e[12]=p,e[13]=c):c=e[13];const d=Tl[t.status]??"bg-muted-foreground";let x;e[14]!==d?(x=V("size-2 shrink-0 rounded-full",d),e[14]=d,e[15]=x):x=e[15];let g;e[16]!==x?(g=n.jsx("span",{className:x,"aria-hidden":"true"}),e[16]=x,e[17]=g):g=e[17];let b;e[18]!==t.status?(b=n.jsx("span",{className:"sr-only",children:t.status}),e[18]=t.status,e[19]=b):b=e[19];let h;return e[20]!==u||e[21]!==b||e[22]!==f||e[23]!==i||e[24]!==c||e[25]!==g?(h=n.jsxs("button",{type:"button","aria-disabled":u,onClick:f,className:"group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer aria-disabled:cursor-default aria-disabled:hover:bg-card",children:[i,c,g,b]}),e[20]=u,e[21]=b,e[22]=f,e[23]=i,e[24]=c,e[25]=g,e[26]=h):h=e[26],h}function $l(s){const e=$.c(40),{part:t,latency:l}=s,r=je(),{org:a}=he();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o;let f,i,m,p,c,d;if(e[2]!==l||e[3]!==t.output||e[4]!==t.state||e[5]!==u){d=Symbol.for("react.early_return_sentinel");e:{const h=ve(t.output);if(i=(Array.isArray(h?.items)?h.items:[]).filter(Ml),u==="loading"||u==="approval"){let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(D,{icon:n.jsx(we,{className:"animate-pulse"}),title:"Loading connections",state:"loading"}),e[12]=N):N=e[12],d=N;break e}if(u==="error"){let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(we,{}),e[13]=N):N=e[13];const S=t.state==="output-denied"?"Connection list unavailable":"Couldn't load connections";let _;e[14]!==l?(_=n.jsx(te,{latency:l}),e[14]=l,e[15]=_):_=e[15];let w;e[16]!==S||e[17]!==_?(w=n.jsx(D,{icon:N,title:S,state:"error",trailing:_}),e[16]=S,e[17]=_,e[18]=w):w=e[18],d=w;break e}if(i.length===0){let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(we,{}),e[19]=N):N=e[19];let S;e[20]!==l?(S=n.jsx(D,{icon:N,title:"No connections yet",summary:"This organization hasn't connected any MCPs.",state:"idle",trailing:n.jsx(te,{latency:l})}),e[20]=l,e[21]=S):S=e[21],d=S;break e}const k=i.slice(0,Lt);f=i.length-k.length;let y;e[22]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(we,{className:"text-emerald-500"}),e[22]=y):y=e[22];const v=i.length===1?"1 connection":`${i.length} connections`;let j;e[23]!==l?(j=n.jsx(te,{latency:l}),e[23]=l,e[24]=j):j=e[24],e[25]!==v||e[26]!==j?(c=n.jsx(D,{icon:y,title:v,state:"idle",trailing:j}),e[25]=v,e[26]=j,e[27]=c):c=e[27],m="mt-2 flex flex-col gap-1.5",p=k.map(Il)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=i,e[8]=m,e[9]=p,e[10]=c,e[11]=d}else f=e[6],i=e[7],m=e[8],p=e[9],c=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[28]!==f||e[29]!==i||e[30]!==r||e[31]!==a?(x=f>0&&n.jsx(Rt,{count:i.length,noun:"connections",onClick:()=>r({to:"/$org/settings/connections",params:{org:a.slug}})}),e[28]=f,e[29]=i,e[30]=r,e[31]=a,e[32]=x):x=e[32];let g;e[33]!==m||e[34]!==p||e[35]!==x?(g=n.jsxs("div",{className:m,children:[p,x]}),e[33]=m,e[34]=p,e[35]=x,e[36]=g):g=e[36];let b;return e[37]!==c||e[38]!==g?(b=n.jsxs(n.Fragment,{children:[c,g]}),e[37]=c,e[38]=g,e[39]=b):b=e[39],b}function Il(s){return n.jsx(Cl,{connection:s},s.id)}function Ml(s){return s.connection_type!=="VIRTUAL"}function Ll(){const s=$.c(37),e=We(),{sendMessage:t,isStreaming:l,messages:r}=vs(),{org:a}=he(),o=e?.virtualMcpId,{prompts:u}=Es(a.slug),f=o??null;let i;s[0]!==a.id||s[1]!==a.slug||s[2]!==f?(i={connectionId:f,orgId:a.id,orgSlug:a.slug},s[0]=a.id,s[1]=a.slug,s[2]=f,s[3]=i):i=s[3];const m=ht(i),[p,c]=B.useState(null);if(!o||l||!Cs(o)||!r.some(Rl))return null;let x;if(s[4]!==u||s[5]!==o){let C;s[7]!==o?(C=L=>L.agentId===o&&L.promptName,s[7]=o,s[8]=C):C=s[8],x=u.find(C),s[4]=u,s[5]=o,s[6]=x}else x=s[6];const g=x;if(!g)return null;let b;s[9]!==m||s[10]!==t?(b=async(C,L)=>{if(!m){ze.error("MCP client not available");return}try{const R=await Bs(m,C.name,L);await t({type:"doc",content:[{type:"paragraph",content:[$t({id:C.name,name:qe(C.name,Ue(C._meta)),metadata:R.messages,char:"/",kind:"prompt",args:L}),{type:"text",text:" "}]}]})}catch(R){console.error("[next-action-chip] failed",R),ze.error("Failed to load prompt. Please try again.")}},s[9]=m,s[10]=t,s[11]=b):b=s[11];const h=b;let k;s[12]!==g._meta||s[13]!==g.arguments||s[14]!==g.description||s[15]!==g.promptName||s[16]!==g.title||s[17]!==h?(k=()=>{const C={name:g.promptName,title:g.title,description:g.description,arguments:g.arguments,_meta:g._meta};if(C.arguments&&C.arguments.length>0){c(C);return}h(C)},s[12]=g._meta,s[13]=g.arguments,s[14]=g.description,s[15]=g.promptName,s[16]=g.title,s[17]=h,s[18]=k):k=s[18];const y=k;let v,j;s[19]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ds,{size:12,className:"shrink-0 text-purple-500"}),j=n.jsx("span",{className:"font-medium text-foreground/80",children:"Next:"}),s[19]=v,s[20]=j):(v=s[19],j=s[20]);let N;s[21]!==g.title?(N=n.jsx("span",{className:"truncate",children:g.title}),s[21]=g.title,s[22]=N):N=s[22];let S;s[23]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(it,{size:12,className:"shrink-0 transition-transform duration-150 group-hover:translate-x-0.5"}),s[23]=S):S=s[23];let _;s[24]!==y||s[25]!==N?(_=n.jsxs("button",{type:"button",onClick:y,className:"group mt-3 flex items-center gap-2 self-start rounded-full border border-border bg-background px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:border-border hover:bg-accent/40 hover:text-foreground",children:[v,j,N,S]}),s[24]=y,s[25]=N,s[26]=_):_=s[26];let w;s[27]===Symbol.for("react.memo_cache_sentinel")?(w=C=>c(C),s[27]=w):w=s[27];let T;s[28]!==p||s[29]!==h?(T=async C=>{const L=p;c(null),L&&await h(L,C)},s[28]=p,s[29]=h,s[30]=T):T=s[30];let I;s[31]!==p||s[32]!==T?(I=n.jsx(rn,{prompt:p,setPrompt:w,onSubmit:T}),s[31]=p,s[32]=T,s[33]=I):I=s[33];let M;return s[34]!==I||s[35]!==_?(M=n.jsxs(n.Fragment,{children:[_,I]}),s[34]=I,s[35]=_,s[36]=M):M=s[36],M}function Rl(s){return s.role==="user"||s.parts.some(Al)}function Al(s){return s.type==="tool-user_ask"&&s.state==="output-available"}function zl(s){const e=$.c(5),{parts:t}=s,l=t?.length,r=t?.[t.length-1];let a;e[0]!==r||e[1]!==l?(a={enabled:!0,contentDeps:[l,r]},e[0]=r,e[1]=l,e[2]=a):a=e[2];const{sentinelRef:o}=Mt(a);let u;return e[3]!==o?(u=n.jsx("div",{ref:o,className:"h-0"}),e[3]=o,e[4]=u):u=e[4],u}function Pl(s){const e=new Map;for(let t=s.length-1;t>=0;t--){const l=s[t]?.parts;if(l)for(const r of l){const a=r;if(a.type!=="data-deck-updated")continue;const o=a.data;if(!o?.path)continue;const u=`deck:${o.path}`;e.has(u)||e.set(u,{tabId:Ss(o.path),label:o.name||o.path,kind:o.kind==="page"?"page":"deck"})}}return Array.from(e.values())}function El(){const s=$.c(9),e=je(),t=$e()?.messages??[],l=Pl(t);if(l.length===0)return null;const r=l.some(Ol),a=l.some(Fl),o=r?a?"Slides & pages in this chat":"Slides in this chat":"Pages in this chat",u="flex flex-col gap-1.5 py-2";let f;s[0]!==o?(f=n.jsx("div",{className:"text-[12px] text-muted-foreground/70 uppercase tracking-wide",children:o}),s[0]=o,s[1]=f):f=s[1];const i="flex flex-wrap gap-2";let m;s[2]!==e?(m=x=>n.jsxs("button",{type:"button",onClick:()=>e({to:".",search:g=>({...g,main:x.tabId}),replace:!0}),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-muted/30 hover:bg-muted/60 text-[13px] transition-colors",children:[x.kind==="deck"?n.jsx(Ne,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Is,{className:"size-3.5 shrink-0 text-muted-foreground"}),n.jsx("span",{className:"font-medium text-foreground",children:x.label})]},x.tabId),s[2]=e,s[3]=m):m=s[3];const p=l.map(m);let c;s[4]!==p?(c=n.jsx("div",{className:i,children:p}),s[4]=p,s[5]=c):c=s[5];let d;return s[6]!==f||s[7]!==c?(d=n.jsxs("div",{className:u,children:[f,c]}),s[6]=f,s[7]=c,s[8]=d):d=s[8],d}function Fl(s){return s.kind==="page"}function Ol(s){return s.kind==="deck"}async function Dl(s,e){const t=await fetch(`/api/${e}/threads/${encodeURIComponent(s)}/outputs`,{credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch thread outputs: ${t.status}`);return(await t.json()).objects??[]}function ba(){const s=$.c(2),e=$e()?.messages??[];let t;return s[0]!==e?(t=e.some(Bl),s[0]=e,s[1]=t):t=s[1],t}function Bl(s){return s.parts?.some(Hl)}function Hl(s){const e=s;return(e.type==="tool-share_with_user"||e.type==="tool-bash"||e.type==="tool-write")&&e.state==="output-available"}function Wl(s,e){const t=$.c(9),{org:l}=he();let r;t[0]!==s?(r=me.threadOutputs(s??""),t[0]=s,t[1]=r):r=t[1];let a;t[2]!==l||t[3]!==s?(a=()=>Dl(s??"",l.slug),t[2]=l,t[3]=s,t[4]=a):a=t[4];const o=!!s&&(e?.enabled??!0);let u;return t[5]!==r||t[6]!==a||t[7]!==o?(u={queryKey:r,queryFn:a,enabled:o,staleTime:0},t[5]=r,t[6]=a,t[7]=o,t[8]=u):u=t[8],Oe(u)}function Ul(s){const e=$.c(20),{file:t}=s,l=je();let r;e[0]!==t.key||e[1]!==l?(r=()=>l({to:".",search:d=>({...d,main:_s(t.key)}),replace:!0}),e[0]=t.key,e[1]=l,e[2]=r):r=e[2];const a=r;let o;e[3]!==t.filename?(o=n.jsx(hs,{filename:t.filename,className:"h-5 w-4 shrink-0"}),e[3]=t.filename,e[4]=o):o=e[4];let u;e[5]!==t.filename||e[6]!==a?(u=n.jsx("button",{type:"button",onClick:a,className:"min-w-0 flex-1 truncate text-left text-[13px] font-medium text-foreground hover:underline",title:t.filename,children:t.filename}),e[5]=t.filename,e[6]=a,e[7]=u):u=e[7];const f=`Download ${t.filename}`;let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vt,{className:"size-3.5"}),e[8]=i):i=e[8];let m;e[9]!==t.downloadUrl||e[10]!==t.filename||e[11]!==f?(m=n.jsx("a",{href:t.downloadUrl,download:t.filename,className:"hidden shrink-0 text-muted-foreground hover:text-foreground group-hover:block",title:"Download","aria-label":f,children:i}),e[9]=t.downloadUrl,e[10]=t.filename,e[11]=f,e[12]=m):m=e[12];let p;e[13]!==a?(p=n.jsx(ke,{variant:"outline",size:"sm",className:"h-7 shrink-0 px-2.5 text-xs",onClick:a,children:"Open"}),e[13]=a,e[14]=p):p=e[14];let c;return e[15]!==o||e[16]!==u||e[17]!==m||e[18]!==p?(c=n.jsxs("div",{className:"group flex items-center gap-2 rounded-lg border border-border bg-background px-3 py-2",children:[o,u,m,p]}),e[15]=o,e[16]=u,e[17]=m,e[18]=p,e[19]=c):c=e[19],c}function lt(s){return s.split("/").pop()??s}const ql=/(^|\/)output\//;function Vl(s){const e=new Set;for(const t of s.parts??[]){const l=t;if(l.state==="output-available"){if(l.type==="tool-share_with_user"){const r=l.output?.filename??l.input?.name??(l.input?.source?lt(l.input.source):null);r&&e.add(r)}else if(l.type==="tool-write"){const r=l.input?.path;r&&ql.test(r)&&e.add(lt(r))}}}return e}function Gl(s){const e=$.c(4),{threadId:t,message:l}=s,r=Vl(l),a=r.size>0;let o;e[0]!==a?(o={enabled:a},e[0]=a,e[1]=o):o=e[1];const{data:u}=Wl(t,o);if(r.size===0)return null;const f=(u??[]).filter(c=>r.has(c.filename));if(f.length===0)return null;const i="flex flex-col gap-1.5 py-2",m=f.map(Kl);let p;return e[2]!==m?(p=n.jsx("div",{className:i,children:m}),e[2]=m,e[3]=p):p=e[3],p}function Kl(s){return n.jsx(Ul,{file:s},s.key)}function Jl(s){return s.type==="reasoning"}function Xl(s){const e=[],t=new Set,l=new Map,r=new Map,a=new Map;if(s){let u=null;for(let f=0;f<s.parts.length;f++){const i=s.parts[f];if(Jl(i)){u||(u={parts:[],startIndex:f},e.push(u)),u.parts.push(i),t.add(f);continue}if(u=null,i.type==="data-tool-metadata"&&"id"in i&&"data"in i){const m=i.data,p={};m.annotations&&(p.annotations=m.annotations),typeof m.latencyMs=="number"&&Number.isFinite(m.latencyMs)&&(p.latencySeconds=m.latencyMs/1e3),typeof m.outputBytes=="number"&&Number.isFinite(m.outputBytes)&&m.outputBytes>=0&&(p.outputBytes=m.outputBytes),m._meta&&typeof m._meta=="object"&&(p._meta=m._meta),l.set(i.id,p);continue}if(i.type==="data-tool-subtask-metadata"&&"id"in i){r.set(i.id,i.data);continue}if(i.type==="data-web-search"&&"id"in i&&"data"in i){const m=i.id,p=i.data;a.set(m,p.text??"");continue}}}const o=[];if(s){let u=[],f=[];const i=new Set,m=()=>{for(const p of u)i.has(p)||(i.add(p),o.push({kind:"reasoning-group",group:p}));for(const p of f)o.push({kind:"part",index:p.index});u=[],f=[]};for(let p=0;p<s.parts.length;p++){const c=s.parts[p];if(c.type==="step-start"){m();continue}if(t.has(p)){const d=e.find(x=>x.startIndex===p);d&&u.push(d);continue}c.type.startsWith("data-")||f.push({index:p})}m()}return{reasoningGroups:e,renderOrder:o,dataParts:{toolMetadata:l,toolSubtaskMetadata:r,webSearchStreaming:a}}}function Ql(s){const e=$.c(9),{since:t}=s;let l;e[0]!==t?(l=()=>Qe(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[r,a]=B.useState(l);let o,u;e[2]!==t?(o=()=>{const p=setInterval(()=>a(Qe(t,Date.now())),100);return()=>clearInterval(p)},u=[t],e[2]=t,e[3]=o,e[4]=u):(o=e[3],u=e[4]),B.useEffect(o,u);const f=r/1e3;let i;e[5]!==f?(i=de(f),e[5]=f,e[6]=i):i=e[6];let m;return e[7]!==i?(m=n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:i}),e[7]=i,e[8]=m):m=e[8],m}const Ot=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Yl(){const s=$.c(5),[e]=B.useState(Zl);let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},s[0]=t):t=s[0];let l;s[1]!==e?(l=Ot.map((a,o)=>{const{delay:u}=a;return n.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[o],animation:"grid-ripple 1s ease infinite",animationDelay:`${u}ms`}},o)}),s[1]=e,s[2]=l):l=s[2];let r;return s[3]!==l?(r=n.jsx("div",{className:"grid",style:t,children:l}),s[3]=l,s[4]=r):r=s[4],r}function Zl(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Ot.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}const eo={planning:{icon:n.jsx(ns,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:n.jsx(Be,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},to=1200;function so(){const s=$.c(7),[e,t]=B.useState("planning");let l,r;s[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{const f=setTimeout(()=>{t("thinking")},to);return()=>{clearTimeout(f)}},r=[],s[0]=l,s[1]=r):(l=s[0],r=s[1]),B.useEffect(l,r);const a=eo[e];let o;s[2]!==a.label?(o=n.jsxs("span",{className:"text-[14px] text-muted-foreground shimmer",children:[a.label,"..."]}),s[2]=a.label,s[3]=o):o=s[3];let u;return s[4]!==a.icon||s[5]!==o?(u=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:[a.icon,o]})}),s[4]=a.icon,s[5]=o,s[6]=u):u=s[6],u}function no(s){const e=$.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Yl,{}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=n.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[l,n.jsx(Ql,{since:t})]}),e[1]=t,e[2]=r):r=e[2],r}function lo(s){const e=$.c(20),{duration:t,parts:l,isStreaming:r}=s;let a;e[0]!==l?(a=l.every(ro),e[0]=l,e[1]=a):a=e[1];const o=a;let u;e[2]!==t?(u=t&&t/1e3>1?`Thought for ${de(t/1e3)}`:"Thought",e[2]=t,e[3]=u):u=e[3];const f=u;let i;if(e[4]!==o||e[5]!==r||e[6]!==l){const y=l.map(ao).join(`
36
36
  `).trim().split(`
37
37
  `).filter(Boolean),v=r?y[y.length-1]??"":y[0]??"";i=!o&&v?v.length>100?v.slice(0,100)+"…":v:void 0,e[4]=o,e[5]=r,e[6]=l,e[7]=i}else i=e[7];const m=i;let p;if(e[8]!==o||e[9]!==l){const k=l.map(oo).join(`
38
38
 
@@ -1 +1 @@
1
- import{e as o,j as t,dz as n}from"./index-DBqH3_Tr.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-Dlc4tDxO.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-DBqH3_Tr.js";import{i as R}from"./Check-Bk-n4rKs.js";import{t as _}from"./ChevronDown-D_SiD52e.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-Dlc4tDxO.js";import{i as R}from"./Check-DHmAQH53.js";import{t as _}from"./ChevronDown-CN6qoGcG.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-DBqH3_Tr.js";import{u as re}from"./use-connection-lmAzDQtG.js";import{j as ae}from"./use-mcp-client-BgKdABiW.js";import{u as ce}from"./studio-tools-hfOcm94T.js";import{a as ue}from"./Settings02-C46G6WCc.js";import{P as B}from"./index-DCdT8576.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-Dlc4tDxO.js";import{u as re}from"./use-connection-BGpjiuJJ.js";import{j as ae}from"./use-mcp-client-BoOtVD9g.js";import{u as ce}from"./studio-tools-B-zlmqyw.js";import{a as ue}from"./Settings02-BMRrFVdB.js";import{P as B}from"./index-NNvehl9i.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};