decocms 3.26.1 → 3.26.3

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 (269) hide show
  1. package/dist/client/assets/{AlertCircle-BDfUS-lh.js → AlertCircle-DTxB9pUH.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-8daK_Mrm.js → ArrowUpRight-zXKZw2Xb.js} +1 -1
  3. package/dist/client/assets/{Check-C9-fsV6-.js → Check-CTLrORIv.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-B_rVd_l8.js → CheckCircle-BUQijftD.js} +1 -1
  5. package/dist/client/assets/{ChevronDown--2U1gfXf.js → ChevronDown-CE2QQfze.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-TttN4toV.js → ChevronLeft-Cu7s4gqK.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-BVEygGVH.js → ChevronRight-VGojeAFz.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-C-xaVM7d.js → ChevronUp-4IXM99ti.js} +1 -1
  9. package/dist/client/assets/{Container-Bso4WS0x.js → Container-BoFlhIZL.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-Q3F6UWC_.js → DotsVertical--R-pmXe3.js} +1 -1
  11. package/dist/client/assets/{Eye-CKz6zS_m.js → Eye-pMhw6sUG.js} +1 -1
  12. package/dist/client/assets/{FilterLines-SKQT-eWL.js → FilterLines-Bz8yyibx.js} +1 -1
  13. package/dist/client/assets/{Globe01-iupU5eqh.js → Globe01-Cp3X_WfB.js} +1 -1
  14. package/dist/client/assets/{HardDrive-DpuvbJvr.js → HardDrive-BH54c3De.js} +1 -1
  15. package/dist/client/assets/{Key01-6eW9IRFT.js → Key01-CfBifHqv.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-BkxKKkMX.js → LayoutLeft-DhbihSgJ.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-BXhdtlT7.js → LinkExternal01-BGLjTHSM.js} +1 -1
  18. package/dist/client/assets/{Monitor01-DUICZH5i.js → Monitor01-Djh_XBKr.js} +1 -1
  19. package/dist/client/assets/{Palette-CS36Icvl.js → Palette-PH8MXuP9.js} +1 -1
  20. package/dist/client/assets/{Play-CbbqvWPd.js → Play-C4oLlMWL.js} +1 -1
  21. package/dist/client/assets/{Plus-CSNkL1o7.js → Plus-BX4ueqQS.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-Dncu-kYd.js → RefreshCcw01-Duj7NlwB.js} +1 -1
  23. package/dist/client/assets/{SearchMd-B-q2EsGW.js → SearchMd-CL91MHi_.js} +1 -1
  24. package/dist/client/assets/{Settings02-CdJ0CKrL.js → Settings02-DWXKmfg4.js} +1 -1
  25. package/dist/client/assets/{Shield01-Crgp73nV.js → Shield01-5PYVS020.js} +1 -1
  26. package/dist/client/assets/{Star01-CN33xE6w.js → Star01-E49TkgRa.js} +1 -1
  27. package/dist/client/assets/{Stars01-BXO9Nc4-.js → Stars01-NNVgYP83.js} +1 -1
  28. package/dist/client/assets/{Stars02-B4CoQ82E.js → Stars02-BVMEIcco.js} +1 -1
  29. package/dist/client/assets/{Sun-CEzPQTAJ.js → Sun-CC_Mb8Zc.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BI_yHGXL.js → SwitchHorizontal01-Fq29tGDx.js} +1 -1
  31. package/dist/client/assets/{Tool01-R6WyaXsu.js → Tool01-B2YQjPAa.js} +1 -1
  32. package/dist/client/assets/{Trash01-C3pnsiws.js → Trash01-XqCtMZQT.js} +1 -1
  33. package/dist/client/assets/{Upload01-BHsRhr7X.js → Upload01-CTIKtpO3.js} +1 -1
  34. package/dist/client/assets/{User01-JuGE_kA7.js → User01-Cz-IdAgQ.js} +1 -1
  35. package/dist/client/assets/{Users01-BVUwP6xk.js → Users01-D7P0o8Z_.js} +1 -1
  36. package/dist/client/assets/{Users03-Bek4Ag3W.js → Users03-DUZwXij4.js} +1 -1
  37. package/dist/client/assets/{X-BdwzFded.js → X-8xcHoVBj.js} +1 -1
  38. package/dist/client/assets/{XCircle-D_3MYOn4.js → XCircle-CGgdji5f.js} +1 -1
  39. package/dist/client/assets/{XClose-Da5LgJSi.js → XClose-CxCjUb2p.js} +1 -1
  40. package/dist/client/assets/{Zap-DHBAOmqP.js → Zap-DLFeSSQ0.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-CP91cLS8.js → ZapSquare-C2mTTgos.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-CaG3Pd1Z.js → ZoomOut-CR6ja8eb.js} +1 -1
  43. package/dist/client/assets/{access-gate-AjUY-gkn.js → access-gate-3WvSXWjg.js} +1 -1
  44. package/dist/client/assets/{accordion-JZC0q2Q6.js → accordion-DBEoJ6NR.js} +1 -1
  45. package/dist/client/assets/add-section-modal-B-90MHzy.js +1 -0
  46. package/dist/client/assets/agent-capabilities-CeRZY0ao.js +3 -0
  47. package/dist/client/assets/{agent-icon-DAPplz1A.js → agent-icon-DyzI2_Id.js} +1 -1
  48. package/dist/client/assets/agent-icons-CkjHTgLo.js +4 -0
  49. package/dist/client/assets/{agents-list-Cqp5uusD.js → agents-list-DNeWvyP9.js} +1 -1
  50. package/dist/client/assets/ai-providers-DAK2efaH.js +1 -0
  51. package/dist/client/assets/{alert-C04qeSRO.js → alert-BHgS7nAN.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-Q8M8ngFf.js → alert-dialog-tg3D4mnu.js} +1 -1
  53. package/dist/client/assets/app-editor-WcogQO88.js +1 -0
  54. package/dist/client/assets/{auth-catchall-BbuGVKd9.js → auth-catchall-BOC0nYtA.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-sY7FyVQz.js → auth-split-layout-VA3PSXMI.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BRsSmcOA.js → automation-list-row-SEcTO2sW.js} +1 -1
  57. package/dist/client/assets/automation-runs-S95csAA4.js +1 -0
  58. package/dist/client/assets/{automations-zDSrpko2.js → automations-Ce44y56V.js} +1 -1
  59. package/dist/client/assets/{avatar-BqNGZrFg.js → avatar-DK3a4hPp.js} +1 -1
  60. package/dist/client/assets/{badge-BBLSXFe0.js → badge-SRsZ13Ha.js} +1 -1
  61. package/dist/client/assets/brand-context-CHR40nnF.js +1 -0
  62. package/dist/client/assets/buckets-7WU_Biyf.js +1 -0
  63. package/dist/client/assets/{calendar-CfY7gp-n.js → calendar-CC1tf37S.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-CjE005FF.js → capability-load-error-C5tUHDdB.js} +1 -1
  65. package/dist/client/assets/{card-D41ULrnf.js → card-BU_YNBo4.js} +1 -1
  66. package/dist/client/assets/chat-context-Moe82J6D.js +20 -0
  67. package/dist/client/assets/{checkbox-CBmcFqoh.js → checkbox-CGo4P_LC.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BcBQhgvD.js → cli-auth-success-D15RP8BC.js} +1 -1
  69. package/dist/client/assets/collection-detail-CiMl4FG7.js +1 -0
  70. package/dist/client/assets/{collection-display-button-BNfKMIgL.js → collection-display-button-M_1xgyCf.js} +1 -1
  71. package/dist/client/assets/{collection-search-CDLcWLfd.js → collection-search-CfzW8Ljz.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-DrTvLn6R.js → collection-table-wrapper-B4EgEmky.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CbZbTMYY.js → collection-tabs-BxpcEAFc.js} +1 -1
  74. package/dist/client/assets/{collections-BxDJ4z3g.js → collections-BthqN0MR.js} +1 -1
  75. package/dist/client/assets/{command-B8qtKAnE.js → command-D_uV9Uyw.js} +1 -1
  76. package/dist/client/assets/connect-desktop-dialog-BSZmVMpV.js +1 -0
  77. package/dist/client/assets/{connection-card-CSsbMtfE.js → connection-card-CMo6aDgc.js} +1 -1
  78. package/dist/client/assets/connection-detail-Mimew6o2.js +1 -0
  79. package/dist/client/assets/{connection-form-helpers-BonOFyzw.js → connection-form-helpers-D7eAIFli.js} +1 -1
  80. package/dist/client/assets/connections-C3EDxDCA.js +1 -0
  81. package/dist/client/assets/{decopilot-sse-pool-BHhoQKaF.js → decopilot-sse-pool-8oQl4q0c.js} +1 -1
  82. package/dist/client/assets/{dialog-Cwf6uY_y.js → dialog-DSHkVmzb.js} +1 -1
  83. package/dist/client/assets/domain-settings-BOHvvqIE.js +1 -0
  84. package/dist/client/assets/{drawer-CF0b7Dg3.js → drawer-BCmqLnLy.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-UGlYpK18.js → dropdown-menu-DFCaJxA8.js} +1 -1
  86. package/dist/client/assets/dynamic-plugin-layout-D3tgFtHQ.js +1 -0
  87. package/dist/client/assets/{empty-state-CoXt5rYF.js → empty-state-CVOhfUW7.js} +1 -1
  88. package/dist/client/assets/{empty-state-h_qXtgbw.js → empty-state-DqgO6Psg.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-BKeaLULt.js → extract-connection-data-B52LuKdR.js} +1 -1
  90. package/dist/client/assets/{features-u4e9ViPZ.js → features-Dsrgvggp.js} +1 -1
  91. package/dist/client/assets/file-explorer-CAiKkVp8.js +2 -0
  92. package/dist/client/assets/{file-type-icon-7TqtrpuQ.js → file-type-icon-ThJaLePn.js} +1 -1
  93. package/dist/client/assets/{files-C9p4yssc.js → files-BwgPol6-.js} +1 -1
  94. package/dist/client/assets/{form-Bbpyf2N_.js → form-DngzP8fb.js} +1 -1
  95. package/dist/client/assets/general-D61AQybp.js +1 -0
  96. package/dist/client/assets/{generate-id-BHe5yw90.js → generate-id-CDzcbt9l.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-CVG2zsbh.js → github-repo-picker-Dy1vUJSU.js} +1 -1
  98. package/dist/client/assets/{header-tab-button-t5WNjrVG.js → header-tab-button-YP4v_sFN.js} +1 -1
  99. package/dist/client/assets/{hover-card-Azyk5Kxa.js → hover-card-CK_HvQcf.js} +1 -1
  100. package/dist/client/assets/image-field-pfu57PP0.js +1 -0
  101. package/dist/client/assets/{index-CAs8iq4o.js → index-2EH0OR7k.js} +1 -1
  102. package/dist/client/assets/{index-sqqDCA0K.js → index-5lPKE0PI.js} +1 -1
  103. package/dist/client/assets/{index-DJTEqPXf.js → index-BepaMXhR.js} +1 -1
  104. package/dist/client/assets/index-CIBQMZc3.js +310 -0
  105. package/dist/client/assets/index-D7h1Qkk4.js +1 -0
  106. package/dist/client/assets/{index-CiRQNPVt.js → index-DLy_MgNO.js} +3 -3
  107. package/dist/client/assets/{index-Co-NpkaC.js → index-DdnG6T0z.js} +1 -1
  108. package/dist/client/assets/{index-skFG1_ns.js → index-Df6ljz6n.js} +1 -1
  109. package/dist/client/assets/{index-DcI1sEv_.js → index-Dj1voR4t.js} +1 -1
  110. package/dist/client/assets/{index-CwyiLbkO.js → index-DqC0vS4o.js} +1 -1
  111. package/dist/client/assets/index-Dy_atLRy.js +1 -0
  112. package/dist/client/assets/{index-DCeOX6CY.js → index-G1Ev5Inf.js} +1 -1
  113. package/dist/client/assets/{index-DbpajCnQ.js → index-LDNFPs7X.js} +5 -5
  114. package/dist/client/assets/{index-Dci2MWs9.js → index-hMTvGWUn.js} +1 -1
  115. package/dist/client/assets/{index-f0X8ef8k.js → index-hwXZ3lhJ.js} +1 -1
  116. package/dist/client/assets/{index-redirect-D6d28r6b.js → index-redirect-BkbiWtap.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-BND7fiNU.js → infiniteQueryObserver-CJIUgHAf.js} +1 -1
  118. package/dist/client/assets/{input-D3E6n6la.js → input-CTpSARTD.js} +1 -1
  119. package/dist/client/assets/{integration-icon-vaGvNHHz.js → integration-icon-BpF3qWll.js} +1 -1
  120. package/dist/client/assets/{label-DLUhXNk7.js → label-Dh8yif55.js} +1 -1
  121. package/dist/client/assets/{layout-PdamBSR0.js → layout-D7xM_FMD.js} +1 -1
  122. package/dist/client/assets/{login-CX7WJC_U.js → login-BsYL8EoQ.js} +1 -1
  123. package/dist/client/assets/members-D3KerYs6.js +3 -0
  124. package/dist/client/assets/{monaco-editor-Bgzj9gt4.js → monaco-editor-47G-YgBx.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-DOXVZiRZ.js → monitoring-stats-row-DLPVsavd.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-Cfp_JeoH.js → oauth-callback-DPmGsVIH.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-DOmF-VOd.js → oauth-callback-ai-provider-B2SdgtVf.js} +1 -1
  128. package/dist/client/assets/{onboarding-C4KH1uOA.js → onboarding-CUnTn08b.js} +1 -1
  129. package/dist/client/assets/{org-install-CrBGOT0T.js → org-install-D55Hf-Ci.js} +1 -1
  130. package/dist/client/assets/{org-layout-BCdmD1Ye.js → org-layout-D1CUrdu0.js} +1 -1
  131. package/dist/client/assets/org-plugin-layout-C_lutJvY.js +1 -0
  132. package/dist/client/assets/{page-seo-form-qANN0Bj1.js → page-seo-form-CDMGSBfI.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-D9mMBTfk.js +1 -0
  134. package/dist/client/assets/pair-C8e4qd_P.js +39 -0
  135. package/dist/client/assets/{plugin-empty-state-CrO1kZyK.js → plugin-empty-state-DOz60yXL.js} +1 -1
  136. package/dist/client/assets/{plugin-header-DTTyXwvF.js → plugin-header-dSexLn5d.js} +1 -1
  137. package/dist/client/assets/plugin-layout-DeJC8Je1.js +1 -0
  138. package/dist/client/assets/{popover-C1MgHMHU.js → popover-BTf4Nz5d.js} +1 -1
  139. package/dist/client/assets/{post-editor-aLUVDKW-.js → post-editor-DqMVZSkF.js} +1 -1
  140. package/dist/client/assets/{primitives-BBsQqWkR.js → primitives-C5R0vRG0.js} +1 -1
  141. package/dist/client/assets/{profile-CjQ0lj2q.js → profile-D24Mm1Bo.js} +1 -1
  142. package/dist/client/assets/project-app-view-Bww_ZnyA.js +1 -0
  143. package/dist/client/assets/record-editor-dyb9Ijad.js +1 -0
  144. package/dist/client/assets/registry-BnciKKiV.js +2 -0
  145. package/dist/client/assets/registry-layout-BTGZh3rH.js +27 -0
  146. package/dist/client/assets/{require-capability-vzDtNqMc.js → require-capability-VkdqqQVh.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-BE5eceMw.js → required-auth-layout-B_Qr5rQD.js} +1 -1
  148. package/dist/client/assets/{reset-password-8Qbe0fKB.js → reset-password-EasI5IT7.js} +1 -1
  149. package/dist/client/assets/{resizable-CrMJy22o.js → resizable-psD7TWaW.js} +1 -1
  150. package/dist/client/assets/{roles-BRTHcf_Y.js → roles-DcdBU5wW.js} +1 -1
  151. package/dist/client/assets/save-referenced-block-H29Sz2fU.js +1 -0
  152. package/dist/client/assets/{save-status-BZf4M3tc.js → save-status-BBtiR3n4.js} +1 -1
  153. package/dist/client/assets/{schema-form-DNuUk0WJ.js → schema-form-CQrr8C2Q.js} +1 -1
  154. package/dist/client/assets/{scroll-area-verb-Y8E.js → scroll-area-EinmnR6o.js} +1 -1
  155. package/dist/client/assets/{search-input-CZKc9XZR.js → search-input-IQT_u5qN.js} +1 -1
  156. package/dist/client/assets/secrets-CvkPaEJL.js +1 -0
  157. package/dist/client/assets/{sections-editor-CysGozit.js → sections-editor-4lprX9C-.js} +1 -1
  158. package/dist/client/assets/{select-BMX9jvQG.js → select-Dz1PdScB.js} +1 -1
  159. package/dist/client/assets/{select-model-BB2-8k_v.js → select-model-azh5-bst.js} +1 -1
  160. package/dist/client/assets/seo-editor-Bhb2HHgZ.js +1 -0
  161. package/dist/client/assets/{settings-layout-EdgjO8iZ.js → settings-layout-DXfn8mRu.js} +1 -1
  162. package/dist/client/assets/{settings-section-CQW36fJV.js → settings-section-DqhmLe6Q.js} +1 -1
  163. package/dist/client/assets/{sheet-Utq51ofH.js → sheet-CtgWE_6O.js} +1 -1
  164. package/dist/client/assets/{shell-controls-CXM2LvTp.js → shell-controls-D5kseyts.js} +1 -1
  165. package/dist/client/assets/{shell-layout-3b4NfWya.js → shell-layout-CWL5imKS.js} +1 -1
  166. package/dist/client/assets/shell-route-loading-Co6LGu_q.js +1 -0
  167. package/dist/client/assets/{sidebar-BBqRosV0.js → sidebar-DRcLUASh.js} +1 -1
  168. package/dist/client/assets/{skeleton-dQOYuNlQ.js → skeleton-BH3hvPuC.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-D7AgS_lX.js → sortable.esm-Bv55LbH0.js} +1 -1
  170. package/dist/client/assets/{spinner-_hqWpG0c.js → spinner-B_3Siejz.js} +1 -1
  171. package/dist/client/assets/sso-0oMpJ4kh.js +1 -0
  172. package/dist/client/assets/{store-BIRCadh0.js → store-BVB26WGO.js} +1 -1
  173. package/dist/client/assets/store-registry-CO_g7WZl.js +2 -0
  174. package/dist/client/assets/studio-tools-BxKekKsO.js +1 -0
  175. package/dist/client/assets/{switch-CTAzWsjZ.js → switch-DH2AgpKj.js} +1 -1
  176. package/dist/client/assets/{tab-id-C7unjelb.js → tab-id-xylxHxk-.js} +2 -2
  177. package/dist/client/assets/{table-BuLHtfTA.js → table-BF0TGzWk.js} +1 -1
  178. package/dist/client/assets/{tabs-DVd_y6YL.js → tabs-zn3_c2X4.js} +1 -1
  179. package/dist/client/assets/{task-status-5oHTrkjV.js → task-status-CcBiqoc9.js} +1 -1
  180. package/dist/client/assets/{textarea-D1h5iq3D.js → textarea--0YfTbVD.js} +1 -1
  181. package/dist/client/assets/{toggle-group-vA7ktrP-.js → toggle-group-CzCtoT44.js} +1 -1
  182. package/dist/client/assets/{toolbar-D3G0G9U8.js → toolbar-GqBUNMmA.js} +1 -1
  183. package/dist/client/assets/{tools-list-BL4u8QMN.js → tools-list-6mOdBofe.js} +1 -1
  184. package/dist/client/assets/{tooltip-C47QSg8i.js → tooltip-DUvSyhJC.js} +1 -1
  185. package/dist/client/assets/{types-Df_Z2FUK.js → types-DA4RGvyb.js} +1 -1
  186. package/dist/client/assets/use-ai-providers-D2lIJSNP.js +1 -0
  187. package/dist/client/assets/{use-automations-B9mdkXiu.js → use-automations-DBfmwk1I.js} +1 -1
  188. package/dist/client/assets/{use-capability-1uxC8-oZ.js → use-capability-B4Fg7dX0.js} +1 -1
  189. package/dist/client/assets/{use-collections-B1Mg9Y32.js → use-collections-CmHxKkjG.js} +1 -1
  190. package/dist/client/assets/{use-connection-DpxWBF4Y.js → use-connection-DBknh1_S.js} +1 -1
  191. package/dist/client/assets/{use-copy-B_uLjrw6.js → use-copy-Cwl7g8AE.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-BBxov1Li.js → use-create-virtual-mcp-C1TsXsHi.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-DDZnxori.js → use-debounced-autosave-Bxr0aFzV.js} +1 -1
  194. package/dist/client/assets/use-delete-connection-R6nqWnGZ.js +1 -0
  195. package/dist/client/assets/use-file-configs-DWXPP8uC.js +1 -0
  196. package/dist/client/assets/{use-infinite-scroll-D8iZFAEQ.js → use-infinite-scroll-SoMG-nf0.js} +1 -1
  197. package/dist/client/assets/{use-list-state-BkETzhj1.js → use-list-state-RN4viRCb.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-D0A6RZFw.js → use-mcp-client-FbAC4-Un.js} +2 -2
  199. package/dist/client/assets/{use-mcp-prompts-BuV5LRNr.js → use-mcp-prompts-yCzBJuZf.js} +1 -1
  200. package/dist/client/assets/{use-mcp-tools-BTzw-W77.js → use-mcp-tools-CxFt6L0J.js} +1 -1
  201. package/dist/client/assets/{use-members-DDVaE5yQ.js → use-members-B2ko1Eht.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-Drh7z3D_.js → use-navigate-to-agent-Bg4INoCb.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-BlGBETGB.js → use-org-auth-client-D0Et-q9V.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-nq4qWMpD.js → use-org-sso-Ba3MjbPK.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-i1o2TOl8.js → use-organization-roles-jFwocdK5.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-PADdytdf.js → use-organization-settings-Bdk0M31t.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-C0VEE_YX.js → use-registry-connections-DkTd3pip.js} +1 -1
  208. package/dist/client/assets/use-secrets-B3XtAhqh.js +1 -0
  209. package/dist/client/assets/{use-status-sounds-DR8WA3PU.js → use-status-sounds-Bi-eGoxq.js} +1 -1
  210. package/dist/client/assets/{use-view-mode-BpduDYTq.js → use-view-mode-CVu0jG_s.js} +1 -1
  211. package/dist/client/assets/{use-virtual-mcp-DciRKx1X.js → use-virtual-mcp-CL360k9_.js} +1 -1
  212. package/dist/client/assets/useInfiniteQuery-68Zg22Ld.js +1 -0
  213. package/dist/client/assets/{useRouterState-BXwm4DCl.js → useRouterState-CBsQY2cY.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-C32oPBV5.js +1 -0
  215. package/dist/client/assets/user-ce-n8AzQ.js +1 -0
  216. package/dist/client/assets/{view-mode-toggle-B-ZBNJWV.js → view-mode-toggle-DPvhvCSl.js} +1 -1
  217. package/dist/client/assets/workflow-DEw4Tgx1.js +1 -0
  218. package/dist/client/assets/workflow-detail-DPYK3MGg.js +1 -0
  219. package/dist/client/index.html +1 -1
  220. package/dist/server/cli.js +382 -378
  221. package/dist/server/migrate.js +98 -94
  222. package/dist/server/server.js +244 -244
  223. package/package.json +1 -1
  224. package/dist/client/assets/add-section-modal-B5en9ngD.js +0 -1
  225. package/dist/client/assets/agent-capabilities-gx2lqG9R.js +0 -3
  226. package/dist/client/assets/agent-icons-Dk-aO0GI.js +0 -4
  227. package/dist/client/assets/ai-providers-DLs4iaPF.js +0 -1
  228. package/dist/client/assets/app-editor-CNA09iLR.js +0 -1
  229. package/dist/client/assets/automation-runs-gdpRnoA6.js +0 -1
  230. package/dist/client/assets/brand-context-Be4M-ZZ_.js +0 -1
  231. package/dist/client/assets/buckets-D-k7xX4_.js +0 -1
  232. package/dist/client/assets/chat-context-BFmJRDzy.js +0 -20
  233. package/dist/client/assets/collection-detail-kkp2noDH.js +0 -1
  234. package/dist/client/assets/connect-desktop-dialog-CDUh5Otr.js +0 -1
  235. package/dist/client/assets/connection-detail-E_AC0EPN.js +0 -1
  236. package/dist/client/assets/connections-Ca9YMoFm.js +0 -1
  237. package/dist/client/assets/domain-settings-oLlPZ4Z3.js +0 -1
  238. package/dist/client/assets/dynamic-plugin-layout-V_3blVro.js +0 -1
  239. package/dist/client/assets/file-explorer-BHKOSo2p.js +0 -2
  240. package/dist/client/assets/general-DqO6G3WI.js +0 -1
  241. package/dist/client/assets/image-field-CXkzTwa7.js +0 -1
  242. package/dist/client/assets/index-B_tO_wVS.js +0 -1
  243. package/dist/client/assets/index-Bjie-Vum.js +0 -1
  244. package/dist/client/assets/index-DkWynf6r.js +0 -310
  245. package/dist/client/assets/members-Bw9vSm5N.js +0 -3
  246. package/dist/client/assets/org-plugin-layout-shv3-lWc.js +0 -1
  247. package/dist/client/assets/page-seo-sheet-D4wNk0RY.js +0 -1
  248. package/dist/client/assets/pair-CpEuUIpQ.js +0 -39
  249. package/dist/client/assets/plugin-layout-CXygrV9H.js +0 -1
  250. package/dist/client/assets/project-app-view-Br1j175t.js +0 -1
  251. package/dist/client/assets/record-editor-QHa9iaw5.js +0 -1
  252. package/dist/client/assets/registry-BkLh6mX8.js +0 -2
  253. package/dist/client/assets/registry-layout-CHn-aQtX.js +0 -27
  254. package/dist/client/assets/save-referenced-block-CBTtXYiM.js +0 -1
  255. package/dist/client/assets/secrets-ScbIQJha.js +0 -1
  256. package/dist/client/assets/seo-editor-gLS5nwCw.js +0 -1
  257. package/dist/client/assets/shell-route-loading-DSfyT3dO.js +0 -1
  258. package/dist/client/assets/sso-Cg_UsaPg.js +0 -1
  259. package/dist/client/assets/store-registry-Duulq-Qg.js +0 -2
  260. package/dist/client/assets/unwrap-tool-result-BYXdCQMg.js +0 -1
  261. package/dist/client/assets/use-ai-providers-Bwbur0GT.js +0 -1
  262. package/dist/client/assets/use-delete-connection-eQCNxdaR.js +0 -1
  263. package/dist/client/assets/use-file-configs-o-LP0Blk.js +0 -1
  264. package/dist/client/assets/use-secrets-DZDUsUGC.js +0 -1
  265. package/dist/client/assets/useInfiniteQuery-C1jLiRqA.js +0 -1
  266. package/dist/client/assets/useSuspenseInfiniteQuery-CHLM-3cW.js +0 -1
  267. package/dist/client/assets/user-DaO6RYsc.js +0 -1
  268. package/dist/client/assets/workflow-C3zNP9N8.js +0 -1
  269. package/dist/client/assets/workflow-detail-CFwJ5L9v.js +0 -1
@@ -1,3 +0,0 @@
1
- import{W as $t,r as ce,q as me,G as ze,b as zt,H as Dt,a as pe,t as fe,o as G,K as ie,j as s,B as Pe,e as J,s as kt,n as Nt,c as $e,l as Ze,E as Ft}from"./index-CiRQNPVt.js";import{C as Ot}from"./collection-display-button-BNfKMIgL.js";import{S as Lt}from"./search-input-CZKc9XZR.js";import{P as Me}from"./index-Dci2MWs9.js";import{C as qt}from"./collection-table-wrapper-DrTvLn6R.js";import{E as He}from"./empty-state-CoXt5rYF.js";import{D as Bt,i as Kt,a as Vt,b as Ut,c as Qt,d as Gt}from"./dialog-Cwf6uY_y.js";import{a as Jt,F as ot,b as rt,c as Ht,d as ct,f as mt}from"./form-Bbpyf2N_.js";import{d as Xe,S as et,a as tt,b as st,c as nt}from"./select-BMX9jvQG.js";import{T as Wt}from"./textarea-D1h5iq3D.js";import{u as at}from"./use-org-auth-client-BlGBETGB.js";import{u as Tt}from"./use-organization-roles-i1o2TOl8.js";import{u as Yt}from"./use-members-DDVaE5yQ.js";import{S as Zt,u as Xt}from"./use-mcp-client-D0A6RZFw.js";import{T as es,a as ts,c as ss,b as ns}from"./tooltip-C47QSg8i.js";import{a as dt,e as ut,g as ft,b as ht,c as gt,d as pt,f as xt,A as bt}from"./alert-dialog-Q8M8ngFf.js";import{A as Be}from"./avatar-BqNGZrFg.js";import{B as Ve}from"./badge-BBLSXFe0.js";import{C as jt}from"./card-D41ULrnf.js";import{D as It,a as At,b as Et,e as is,f as as,g as ls,c as it,d as os}from"./dropdown-menu-UGlYpK18.js";import{i as Mt}from"./DotsVertical-Q3F6UWC_.js";import{i as rs}from"./Key01-6eW9IRFT.js";import{i as cs}from"./Shield01-Crgp73nV.js";import{a as ms}from"./SwitchHorizontal01-BI_yHGXL.js";import{s as ds}from"./Trash01-C3pnsiws.js";import{s as Pt}from"./XClose-Da5LgJSi.js";import{C as vt}from"./checkbox-CBmcFqoh.js";import{a as We,e as Ye,f as Ct,C as us,d as fs,b as hs,c as gs}from"./command-B8qtKAnE.js";import{b as ps,P as xs,a as bs}from"./popover-C1MgHMHU.js";import{t as js}from"./ChevronDown--2U1gfXf.js";import{s as vs}from"./Plus-CSNkL1o7.js";import{R as Cs}from"./require-capability-vzDtNqMc.js";import"./Check-C9-fsV6-.js";import"./view-mode-toggle-B-ZBNJWV.js";import"./SearchMd-B-q2EsGW.js";import"./sidebar-BBqRosV0.js";import"./LayoutLeft-BkxKKkMX.js";import"./sheet-Utq51ofH.js";import"./X-BdwzFded.js";import"./table-BuLHtfTA.js";import"./label-DLUhXNk7.js";import"./ChevronUp-C-xaVM7d.js";import"./User01-JuGE_kA7.js";import"./ChevronRight-BVEygGVH.js";import"./index-DJTEqPXf.js";import"./use-capability-1uxC8-oZ.js";import"./access-gate-AjUY-gkn.js";import"./capability-load-error-CjE005FF.js";const ys=$t().email("Invalid email address");function Ss(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function ws({trigger:t}){const[e,n]=ce.useState(!1),{locator:a}=me(),l=at(),i=ze(),{data:o}=zt.useSession(),r=o?.user?.email,{roles:g,isLoading:x}=Tt(),j=g.filter(m=>m.role!=="owner"),p=Dt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=p.watch("emailsText"),E=p.watch("role"),v=Ss(b).filter(m=>{const c=ys.safeParse(m).success,f=!r||m!==r.toLowerCase();return c&&f}),N=pe({mutationFn:async({emails:m,role:c})=>{if(!c)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await l.organization.inviteMember({email:w,role:c});if(A.error)throw new Error(A.error.message);return A.data})),I=f.filter(w=>w.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return f},onSuccess:(m,{emails:c,role:f})=>{fe("member_invited",{count:c.length,role:f}),i.invalidateQueries({queryKey:ie.members(a)}),i.invalidateQueries({queryKey:ie.invitations(a)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:c,role:f})=>{fe("member_invite_failed",{count:c.length,role:f,error:m instanceof Error?m.message:String(m)}),G.error(m instanceof Error?m.message:"Failed to invite members")}}),y=m=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!m.role){G.error("Please select a role");return}N.mutate({emails:v,role:m.role})},z=v.length>0&&!!E;return s.jsxs(Bt,{open:e,onOpenChange:n,children:[s.jsx(Kt,{asChild:!0,children:t}),s.jsxs(Vt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Qt,{children:"Invite members"})}),s.jsx(Jt,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(ot,{control:p.control,name:"emailsText",render:({field:m})=>s.jsxs(rt,{children:[s.jsx(Ht,{children:"Email addresses"}),s.jsx(ct,{children:s.jsx(Wt,{...m,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
2
- e.g. user1@example.com, user2@example.com
3
- or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(mt,{})]})}),s.jsx(ot,{control:p.control,name:"role",render:({field:m})=>s.jsxs(rt,{children:[s.jsx(ct,{children:s.jsxs(Xe,{value:m.value,onValueChange:m.onChange,disabled:N.isPending||x,children:[s.jsx(et,{className:"w-full",children:s.jsx(tt,{placeholder:"Select a role"})}),s.jsx(st,{children:j.map(c=>{const f=[];return c.isBuiltin||(c.allowsAllStaticPermissions?f.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&f.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?f.push("All connections"):c.connectionCount&&c.connectionCount>0&&f.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?f.push("all tools"):c.toolCount&&c.toolCount>0&&f.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsx(nt,{value:c.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&f.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:f.join(", ")})]})},c.role)})})]})}),s.jsx(mt,{})]})}),s.jsxs(Gt,{children:[s.jsx(Pe,{variant:"outline",onClick:()=>{p.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:N.isPending,children:"Cancel"}),s.jsx(Pe,{type:"submit",disabled:N.isPending||!z,children:N.isPending?"Inviting...":`Invite ${v.length||0} Member${v.length!==1?"s":""}`})]})]})})]})]})}function Ns(){const t=J.c(10),{org:e,locator:n}=me();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Zt,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const l=Xt(a);let i;t[3]!==n?(i=ie.invitations(n),t[3]=n,t[4]=i):i=t[4];let o;t[5]!==l?(o=async()=>{const g=await l.callTool({name:"ORGANIZATION_GET",arguments:{}});return(g.structuredContent??g)?.invitations??[]},t[5]=l,t[6]=o):o=t[6];let r;return t[7]!==i||t[8]!==o?(r={queryKey:i,queryFn:o},t[7]=i,t[8]=o,t[9]=r):r=t[9],kt(r)}function Ts(){const t=J.c(10),{locator:e}=me(),n=at(),a=ze();let l;t[0]!==n?(l=async x=>{const j=await n.organization.cancelInvitation({invitationId:x});if(j?.error)throw new Error(j.error.message);return j.data},t[0]=n,t[1]=l):l=t[1];let i;t[2]!==e||t[3]!==a?(i=()=>{a.invalidateQueries({queryKey:ie.invitations(e)}),G.success("Invitation cancelled")},t[2]=e,t[3]=a,t[4]=i):i=t[4];let o;t[5]!==l||t[6]!==i?(o={mutationFn:l,onSuccess:i,onError:Is},t[5]=l,t[6]=i,t[7]=o):o=t[7];const r=pe(o);let g;return t[8]!==r?(g={cancel:r},t[8]=r,t[9]=g):g=t[9],g}function Is(t){G.error(t instanceof Error?t.message:"Failed to cancel invitation")}class As extends Error{constructor(e,n){super(e),this.status=n,this.name="StudioToolError"}status}async function Es(t,e,n){const a=await fetch(`/api/${encodeURIComponent(t)}/tools/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n??{})});if(!a.ok){let l=`${e} failed (${a.status})`;try{const i=await a.json();i?.error&&(l=i.error)}catch{}throw new As(l,a.status)}return await a.json()}function Ue(){const t=J.c(5),{org:e}=me(),n=e.slug;let a;t[0]!==n?(a=(i,o)=>Es(n,i,o),t[0]=n,t[1]=a):a=t[1];let l;return t[2]!==n||t[3]!==a?(l={orgSlug:n,call:a},t[2]=n,t[3]=a,t[4]=l):l=t[4],l}function Ms(){const t=J.c(7),{locator:e}=me(),n=Ue();let a;t[0]!==e?(a=ie.tags(e),t[0]=e,t[1]=a):a=t[1];let l;t[2]!==n?(l=async()=>{const{tags:o}=await n.call("TAGS_LIST",{});return o},t[2]=n,t[3]=l):l=t[3];let i;return t[4]!==a||t[5]!==l?(i={queryKey:a,queryFn:l,staleTime:3e4},t[4]=a,t[5]=l,t[6]=i):i=t[6],Nt(i)}function Ps(){const t=J.c(8),e=ze(),{locator:n}=me(),a=Ue();let l;t[0]!==a?(l=async r=>{const{tag:g}=await a.call("TAGS_CREATE",{name:r});return g},t[0]=a,t[1]=l):l=t[1];let i;t[2]!==n||t[3]!==e?(i=()=>{e.invalidateQueries({queryKey:ie.tags(n)})},t[2]=n,t[3]=e,t[4]=i):i=t[4];let o;return t[5]!==l||t[6]!==i?(o={mutationFn:l,onSuccess:i,onError:_s},t[5]=l,t[6]=i,t[7]=o):o=t[7],pe(o)}function _s(t){G.error(t instanceof Error?t.message:"Failed to create tag")}function Rs(t){const e=J.c(10),{locator:n}=me(),a=Ue();let l;e[0]!==n||e[1]!==t?(l=ie.memberTags(n,t),e[0]=n,e[1]=t,e[2]=l):l=e[2];let i;e[3]!==t||e[4]!==a?(i=async()=>{const{tags:g}=await a.call("MEMBER_TAGS_GET",{memberId:t});return g},e[3]=t,e[4]=a,e[5]=i):i=e[5];const o=!!t;let r;return e[6]!==l||e[7]!==i||e[8]!==o?(r={queryKey:l,queryFn:i,staleTime:3e4,enabled:o},e[6]=l,e[7]=i,e[8]=o,e[9]=r):r=e[9],Nt(r)}function $s(){const t=J.c(8),e=ze(),{locator:n}=me(),a=Ue();let l;t[0]!==a?(l=async r=>{const{memberId:g,tagIds:x}=r;return await a.call("MEMBER_TAGS_SET",{memberId:g,tagIds:x})},t[0]=a,t[1]=l):l=t[1];let i;t[2]!==n||t[3]!==e?(i=(r,g)=>{e.invalidateQueries({queryKey:ie.memberTags(n,g.memberId)})},t[2]=n,t[3]=e,t[4]=i):i=t[4];let o;return t[5]!==l||t[6]!==i?(o={mutationFn:l,onSuccess:i,onError:zs},t[5]=l,t[6]=i,t[7]=o):o=t[7],pe(o)}function zs(t){G.error(t instanceof Error?t.message:"Failed to update member tags")}function _t(t){const e=J.c(44),{memberId:n,className:a,disabled:l,placeholder:i,maxDisplay:o}=t,r=l===void 0?!1:l,g=i===void 0?"Add tags...":i,x=o===void 0?2:o,[j,p]=ce.useState(!1),[b,E]=ce.useState(""),{data:R,isLoading:v}=Ms(),N=R===void 0?[]:R,{data:y,isLoading:z}=Rs(n),m=y===void 0?[]:y,c=Ps(),f=$s(),I=v||z,w=m.map(ks);let A;e[0]!==b?(A=S=>S.name.toLowerCase().includes(b.toLowerCase()),e[0]=b,e[1]=A):A=e[1];const $=N.filter(A);let T;e[2]!==b?(T=S=>S.name.toLowerCase()===b.toLowerCase(),e[2]=b,e[3]=T):T=e[3];const K=N.find(T),M=b.trim()&&!K,k=async S=>{const ge=w.includes(S.id)?w.filter(je=>je!==S.id):[...w,S.id];await f.mutateAsync({memberId:n,tagIds:ge})},P=async()=>{if(!b.trim())return;const S=await c.mutateAsync(b.trim());await f.mutateAsync({memberId:n,tagIds:[...w,S.id]}),E("")},d=async S=>{const ne=w.filter(ge=>ge!==S);await f.mutateAsync({memberId:n,tagIds:ne})},C=c.isPending||f.isPending,L=xs;let D;e[4]!==j?(D=()=>p(!j),e[4]=j,e[5]=D):D=e[5];let F;e[6]!==a?(F=$e("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",a),e[6]=a,e[7]=F):F=e[7];const V=r||I,O=I?s.jsx(Ze,{size:14,className:"animate-spin text-muted-foreground"}):m.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[m.slice(0,x).map(Ds),m.length>x&&s.jsxs(Ve,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",m.length-x]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:g});let U;e[8]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(js,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=U):U=e[8];let q;e[9]!==V||e[10]!==O||e[11]!==D||e[12]!==F?(q=s.jsx(bs,{asChild:!0,children:s.jsxs(Pe,{variant:"ghost",size:"sm",onClick:D,className:F,disabled:V,children:[O,U]})}),e[9]=V,e[10]=O,e[11]=D,e[12]=F,e[13]=q):q=e[13];const Q=ps,H="w-56 p-0",W="start";let Y;e[14]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>p(!1),e[14]=Y):Y=e[14];const ae=hs,xe=!1;let Z;e[15]!==b?(Z=s.jsx(gs,{placeholder:"Search or create...",value:b,onValueChange:E,className:"h-9"}),e[15]=b,e[16]=Z):Z=e[16];const le=fs,de=m.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(We,{heading:"Selected",children:m.map(S=>s.jsx(Ye,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(vt,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]}),s.jsx("button",{onClick:ne=>{ne.stopPropagation(),d(S.id)},className:"opacity-50 hover:opacity-100",disabled:C,children:s.jsx(Pt,{size:14})})]})},S.id))}),s.jsx(Ct,{})]}),_e=We,be="Available",Re=$.length===0&&!M&&s.jsx(us,{children:"No tags found."}),he=$.filter(S=>!w.includes(S.id)).map(S=>s.jsx(Ye,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(vt,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]})},S.id));let oe;e[17]!==_e||e[18]!==Re||e[19]!==he?(oe=s.jsxs(_e,{heading:be,children:[Re,he]}),e[17]=_e,e[18]=Re,e[19]=he,e[20]=oe):oe=e[20];let re;e[21]!==P||e[22]!==C||e[23]!==b||e[24]!==M?(re=M&&s.jsxs(s.Fragment,{children:[s.jsx(Ct,{}),s.jsx(We,{children:s.jsx(Ye,{onSelect:P,className:"cursor-pointer",disabled:C,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[C?s.jsx(Ze,{size:14,className:"animate-spin"}):s.jsx(vs,{size:14}),s.jsxs("span",{children:['Create "',b.trim(),'"']})]})})})]}),e[21]=P,e[22]=C,e[23]=b,e[24]=M,e[25]=re):re=e[25];let X;e[26]!==le||e[27]!==de||e[28]!==oe||e[29]!==re?(X=s.jsxs(le,{children:[de,oe,re]}),e[26]=le,e[27]=de,e[28]=oe,e[29]=re,e[30]=X):X=e[30];let ee;e[31]!==ae||e[32]!==Z||e[33]!==X?(ee=s.jsxs(ae,{shouldFilter:xe,children:[Z,X]}),e[31]=ae,e[32]=Z,e[33]=X,e[34]=ee):ee=e[34];let te;e[35]!==Q||e[36]!==Y||e[37]!==ee?(te=s.jsx(Q,{className:H,align:W,onEscapeKeyDown:Y,children:ee}),e[35]=Q,e[36]=Y,e[37]=ee,e[38]=te):te=e[38];let se;return e[39]!==L||e[40]!==j||e[41]!==q||e[42]!==te?(se=s.jsxs(L,{open:j,onOpenChange:p,children:[q,te]}),e[39]=L,e[40]=j,e[41]=q,e[42]=te,e[43]=se):se=e[43],se}function Ds(t){return s.jsx(Ve,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function ks(t){return t.id}const yt=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],Fs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ke(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Os(t){const e=new Map;for(const[n,a]of Object.entries(Fs))e.set(n,a);for(let n=0;n<t.length;n++){const a=t[n];a&&!e.has(a.role)&&e.set(a.role,yt[n%yt.length]??"bg-neutral-400")}return e}function Ls(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function qe(t){const e=J.c(79),{role:n,memberId:a,isOwner:l,roleColorMap:i,selectableRoles:o,onRoleChange:r,size:g,className:x}=t,j=g===void 0?"xs":g;let p,b,E,R,v,N,y,z,m,c,f;if(e[0]!==x||e[1]!==l||e[2]!==a||e[3]!==r||e[4]!==n||e[5]!==i||e[6]!==o||e[7]!==j){f=Symbol.for("react.early_return_sentinel");e:{const P=i.get(n)??"bg-neutral-400";if(l){let d;e[19]!==a||e[20]!==r?(d=H=>r(a,H),e[19]=a,e[20]=r,e[21]=d):d=e[21];let C;e[22]!==n?(C=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=C):C=e[23];const L=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:$e("size-2 rounded-full shrink-0",P)}),C]});let D;e[24]!==L?(D=s.jsx(tt,{children:L}),e[24]=L,e[25]=D):D=e[25];let F;e[26]!==x||e[27]!==j||e[28]!==D?(F=s.jsx(et,{size:j,className:x,children:D}),e[26]=x,e[27]=j,e[28]=D,e[29]=F):F=e[29];let V;if(e[30]!==i||e[31]!==o){let H;e[33]!==i?(H=W=>{const Y=i.get(W.role)??"bg-neutral-400";return s.jsx(nt,{value:W.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",Y)}),s.jsx("span",{className:"capitalize",children:W.label})]})},W.role)},e[33]=i,e[34]=H):H=e[34],V=o.map(H),e[30]=i,e[31]=o,e[32]=V}else V=e[32];let O;e[35]!==V?(O=s.jsx(st,{children:V}),e[35]=V,e[36]=O):O=e[36];let U;e[37]!==l||e[38]!==n||e[39]!==d||e[40]!==F||e[41]!==O?(U=s.jsx(es,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(Xe,{value:n,onValueChange:d,disabled:l,children:[F,O]})})}),e[37]=l,e[38]=n,e[39]=d,e[40]=F,e[41]=O,e[42]=U):U=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(ts,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=q):q=e[43];let Q;e[44]!==U?(Q=s.jsx(ss,{children:s.jsxs(ns,{children:[U,q]})}),e[44]=U,e[45]=Q):Q=e[45],f=Q;break e}E=Xe,z=n,e[46]!==a||e[47]!==r?(m=d=>r(a,d),e[46]=a,e[47]=r,e[48]=m):m=e[48],c=l,b=et,N=j,y=x,p=tt,v="flex items-center gap-2 min-w-0",R=$e("size-2 rounded-full shrink-0",P)}e[0]=x,e[1]=l,e[2]=a,e[3]=r,e[4]=n,e[5]=i,e[6]=o,e[7]=j,e[8]=p,e[9]=b,e[10]=E,e[11]=R,e[12]=v,e[13]=N,e[14]=y,e[15]=z,e[16]=m,e[17]=c,e[18]=f}else p=e[8],b=e[9],E=e[10],R=e[11],v=e[12],N=e[13],y=e[14],z=e[15],m=e[16],c=e[17],f=e[18];if(f!==Symbol.for("react.early_return_sentinel"))return f;let I;e[49]!==R?(I=s.jsx("div",{className:R}),e[49]=R,e[50]=I):I=e[50];let w;e[51]!==n?(w=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let A;e[53]!==I||e[54]!==w||e[55]!==v?(A=s.jsxs("div",{className:v,children:[I,w]}),e[53]=I,e[54]=w,e[55]=v,e[56]=A):A=e[56];let $;e[57]!==p||e[58]!==A?($=s.jsx(p,{children:A}),e[57]=p,e[58]=A,e[59]=$):$=e[59];let T;e[60]!==b||e[61]!==$||e[62]!==N||e[63]!==y?(T=s.jsx(b,{size:N,className:y,children:$}),e[60]=b,e[61]=$,e[62]=N,e[63]=y,e[64]=T):T=e[64];let K;if(e[65]!==i||e[66]!==o){let P;e[68]!==i?(P=d=>{const C=i.get(d.role)??"bg-neutral-400";return s.jsx(nt,{value:d.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",C)}),s.jsx("span",{className:"capitalize",children:d.label})]})},d.role)},e[68]=i,e[69]=P):P=e[69],K=o.map(P),e[65]=i,e[66]=o,e[67]=K}else K=e[67];let M;e[70]!==K?(M=s.jsx(st,{children:K}),e[70]=K,e[71]=M):M=e[71];let k;return e[72]!==E||e[73]!==T||e[74]!==M||e[75]!==z||e[76]!==m||e[77]!==c?(k=s.jsxs(E,{value:z,onValueChange:m,disabled:c,children:[T,M]}),e[72]=E,e[73]=T,e[74]=M,e[75]=z,e[76]=m,e[77]=c,e[78]=k):k=e[78],k}function St(t){const e=J.c(51),{member:n,roles:a,onChangeRole:l,onRemove:i,isUpdating:o}=t,r=o===void 0?!1:o,g=n.role==="owner";let x,j,p,b,E,R,v,N,y;if(e[0]!==g||e[1]!==r||e[2]!==n.id||e[3]!==n.role||e[4]!==l||e[5]!==a){let T;e[15]!==n.role?(T=d=>d.role!==n.role&&d.role!=="owner",e[15]=n.role,e[16]=T):T=e[16];const K=a.filter(T);b=It;let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Mt,{size:20}),e[17]=M):M=e[17],e[18]!==g?(y=s.jsx(At,{asChild:!0,children:s.jsx(Pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:g,onClick:Bs,children:M})}),e[18]=g,e[19]=y):y=e[19],p=Et,v="end",N=qs,j=is;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ms,{size:16}),e[20]=k):k=e[20],e[21]!==r?(R=s.jsxs(as,{disabled:r,children:[k,"Change Role"]}),e[21]=r,e[22]=R):R=e[22],x=ls;let P;e[23]!==r||e[24]!==n.id||e[25]!==l?(P=d=>{const C=[];return d.isBuiltin||(d.allowsAllStaticPermissions?C.push("Full org access"):d.staticPermissionCount&&d.staticPermissionCount>0&&C.push(`${d.staticPermissionCount} org perm${d.staticPermissionCount!==1?"s":""}`),d.allowsAllConnections?C.push("All connections"):d.connectionCount&&d.connectionCount>0&&C.push(`${d.connectionCount} connection${d.connectionCount!==1?"s":""}`),(d.connectionCount!==0||d.allowsAllConnections)&&(d.allowsAllTools?C.push("all tools"):d.toolCount&&d.toolCount>0&&C.push(`${d.toolCount} tool${d.toolCount!==1?"s":""}`))),s.jsxs(it,{onClick:L=>{L.stopPropagation(),l(n.id,d.role)},disabled:r,children:[d.isBuiltin?s.jsx(cs,{size:16}):s.jsx(rs,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:d.label}),!d.isBuiltin&&C.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:C.join(", ")})]})]},d.role)},e[23]=r,e[24]=n.id,e[25]=l,e[26]=P):P=e[26],E=K.map(P),e[0]=g,e[1]=r,e[2]=n.id,e[3]=n.role,e[4]=l,e[5]=a,e[6]=x,e[7]=j,e[8]=p,e[9]=b,e[10]=E,e[11]=R,e[12]=v,e[13]=N,e[14]=y}else x=e[6],j=e[7],p=e[8],b=e[9],E=e[10],R=e[11],v=e[12],N=e[13],y=e[14];let z;e[27]!==x||e[28]!==E?(z=s.jsx(x,{children:E}),e[27]=x,e[28]=E,e[29]=z):z=e[29];let m;e[30]!==j||e[31]!==R||e[32]!==z?(m=s.jsxs(j,{children:[R,z]}),e[30]=j,e[31]=R,e[32]=z,e[33]=m):m=e[33];let c;e[34]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(os,{}),e[34]=c):c=e[34];let f;e[35]!==n.id||e[36]!==i?(f=T=>{T.stopPropagation(),i(n.id)},e[35]=n.id,e[36]=i,e[37]=f):f=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ds,{size:16}),e[38]=I):I=e[38];let w;e[39]!==f?(w=s.jsxs(it,{variant:"destructive",onClick:f,children:[I,"Remove Member"]}),e[39]=f,e[40]=w):w=e[40];let A;e[41]!==p||e[42]!==w||e[43]!==v||e[44]!==N||e[45]!==m?(A=s.jsxs(p,{align:v,onClick:N,children:[m,c,w]}),e[41]=p,e[42]=w,e[43]=v,e[44]=N,e[45]=m,e[46]=A):A=e[46];let $;return e[47]!==b||e[48]!==A||e[49]!==y?($=s.jsxs(b,{children:[y,A]}),e[47]=b,e[48]=A,e[49]=y,e[50]=$):$=e[50],$}function qs(t){return t.stopPropagation()}function Bs(t){return t.stopPropagation()}function wt(t){const e=J.c(8),{invitationId:n,onCancel:a,isCancelling:l}=t,i=l===void 0?!1:l;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(At,{asChild:!0,children:s.jsx(Pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Vs,children:s.jsx(Mt,{size:20})})}),e[0]=o):o=e[0];let r;e[1]!==n||e[2]!==a?(r=j=>{j.stopPropagation(),a(n)},e[1]=n,e[2]=a,e[3]=r):r=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Pt,{size:16}),e[4]=g):g=e[4];let x;return e[5]!==i||e[6]!==r?(x=s.jsxs(It,{children:[o,s.jsx(Et,{align:"end",onClick:Ks,children:s.jsxs(it,{variant:"destructive",onClick:r,disabled:i,children:[g,"Cancel Invitation"]})})]}),e[5]=i,e[6]=r,e[7]=x):x=e[7],x}function Ks(t){return t.stopPropagation()}function Vs(t){return t.stopPropagation()}function Us(){const t=J.c(101),{data:e}=Yt(),{data:n}=Ns(),a=Ts(),l=ze(),{locator:i}=me(),o=at(),[r,g]=ce.useState(null),[x,j]=ce.useState(null),[p,b]=ce.useState(""),[E,R]=ce.useState("table"),[v,N]=ce.useState("member"),[y,z]=ce.useState("asc"),m=e?.data?.members;let c;t[0]!==v?(c=u=>{v===u?z(sn):(N(u),z("asc"))},t[0]=v,t[1]=c):c=t[1];const f=c;let I=m??[],w=n??[];if(p){const u=p.toLowerCase();I=I.filter(h=>h.user?.name?.toLowerCase().includes(u)||h.user?.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u)),w=w.filter(h=>h.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u))}if(v&&y){let u;t[2]!==y||t[3]!==v?(u=(h,_)=>{let B,ue;e:switch(v){case"member":{B=h.user?.name||"",ue=_.user?.name||"";break e}case"role":{B=h.role||"",ue=_.role||"";break e}case"joined":{B=h.createdAt?typeof h.createdAt=="string"?h.createdAt:h.createdAt.toISOString():"",ue=_.createdAt?typeof _.createdAt=="string"?_.createdAt:_.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?B.localeCompare(ue):ue.localeCompare(B)},t[2]=y,t[3]=v,t[4]=u):u=t[4],I=[...I].sort(u)}const A=I;let $;t[5]!==o?($=async u=>{const h=await o.organization.removeMember({memberIdOrEmail:u});if(h?.error)throw new Error(h.error.message)},t[5]=o,t[6]=$):$=t[6];let T;t[7]!==i||t[8]!==l?(T=()=>{fe("member_removed"),l.invalidateQueries({queryKey:ie.members(i)}),G.success("Member has been removed from the organization"),g(null)},t[7]=i,t[8]=l,t[9]=T):T=t[9];let K;t[10]!==$||t[11]!==T?(K={mutationFn:$,onSuccess:T,onError:tn},t[10]=$,t[11]=T,t[12]=K):K=t[12];const M=pe(K);let k;t[13]!==o?(k=async u=>{const{memberId:h,role:_}=u,B=await o.organization.updateMemberRole({memberId:h,role:[_]});if(B?.error)throw new Error(B.error.message)},t[13]=o,t[14]=k):k=t[14];let P;t[15]!==i||t[16]!==l?(P=(u,h)=>{fe("member_role_updated",{new_role:h.role}),l.invalidateQueries({queryKey:ie.members(i)}),G.success("Member's role has been updated")},t[15]=i,t[16]=l,t[17]=P):P=t[17];let d;t[18]!==k||t[19]!==P?(d={mutationFn:k,onSuccess:P,onError:en},t[18]=k,t[19]=P,t[20]=d):d=t[20];const C=pe(d);let L;t[21]!==o?(L=async u=>{const{invitationId:h,role:_,email:B}=u,ue=await o.organization.cancelInvitation({invitationId:h});if(ue?.error)throw new Error(ue.error.message);const lt=await o.organization.inviteMember({email:B,role:_});if(lt?.error)throw new Error(lt.error.message)},t[21]=o,t[22]=L):L=t[22];let D;t[23]!==i||t[24]!==l?(D=(u,h)=>{fe("invitation_role_updated",{new_role:h.role}),l.invalidateQueries({queryKey:ie.invitations(i)}),G.success("Invitation role has been updated")},t[23]=i,t[24]=l,t[25]=D):D=t[25];let F;t[26]!==L||t[27]!==D?(F={mutationFn:L,onSuccess:D,onError:Xs},t[26]=L,t[27]=D,t[28]=F):F=t[28];const V=pe(F),{roles:O,customRoles:U}=Tt();let q;t[29]!==U?(q=Os(U),t[29]=U,t[30]=q):q=t[30];const Q=q;let H;t[31]!==O?(H=O.filter(Zs),t[31]=O,t[32]=H):H=t[32];const W=H;let Y;t[33]===Symbol.for("react.memo_cache_sentinel")?(Y={id:"member",header:"Member",render:Ys,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=Y):Y=t[33];let ae;t[34]!==Q||t[35]!==W||t[36]!==V||t[37]!==C?(ae={id:"role",header:"Role",render:u=>u.type==="member"?s.jsx(qe,{role:u.data.role,memberId:u.data.id,isOwner:u.data.role==="owner",roleColorMap:Q,selectableRoles:W,onRoleChange:(h,_)=>C.mutate({memberId:h,role:_}),className:"w-36"}):s.jsx(qe,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:Q,selectableRoles:W,onRoleChange:(h,_)=>V.mutate({invitationId:h,role:_,email:u.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=Q,t[35]=W,t[36]=V,t[37]=C,t[38]=ae):ae=t[38];let xe,Z;t[39]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"tags",header:"Tags",render:Ws,cellClassName:"w-40 shrink-0"},Z={id:"joined",header:"Joined",render:Hs,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=xe,t[40]=Z):(xe=t[39],Z=t[40]);let le;t[41]!==a.cancel.isPending||t[42]!==O||t[43]!==C?(le={id:"actions",header:"",render:u=>u.type==="member"?s.jsx(St,{member:u.data,roles:O,onChangeRole:(h,_)=>C.mutate({memberId:h,role:_}),onRemove:g,isUpdating:C.isPending}):s.jsx(wt,{invitationId:u.data.id,onCancel:j,isCancelling:a.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=a.cancel.isPending,t[42]=O,t[43]=C,t[44]=le):le=t[44];let de;t[45]!==ae||t[46]!==le?(de=[Y,ae,xe,Z,le],t[45]=ae,t[46]=le,t[47]=de):de=t[47];const _e=de;let be;t[48]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ws,{trigger:s.jsx(Pe,{children:"Invite Member"})})}),t[48]=be):be=t[48];const Re=be,he=[...A.map(Js),...w.filter(Gs).map(Qs)],oe=Me,re=!!x;let X;t[49]===Symbol.for("react.memo_cache_sentinel")?(X=()=>j(null),t[49]=X):X=t[49];let ee;t[50]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsxs(ht,{children:[s.jsx(gt,{children:"Cancel Invitation"}),s.jsx(pt,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=ee):ee=t[50];let te;t[51]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(xt,{children:"Keep Invitation"}),t[51]=te):te=t[51];let se;t[52]!==a.cancel||t[53]!==x?(se=()=>{x&&(a.cancel.mutate(x),j(null))},t[52]=a.cancel,t[53]=x,t[54]=se):se=t[54];let S;t[55]!==a.cancel.isPending||t[56]!==se?(S=s.jsxs(dt,{children:[ee,s.jsxs(ut,{children:[te,s.jsx(ft,{onClick:se,disabled:a.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=a.cancel.isPending,t[56]=se,t[57]=S):S=t[57];let ne;t[58]!==re||t[59]!==S?(ne=s.jsx(bt,{open:re,onOpenChange:X,children:S}),t[58]=re,t[59]=S,t[60]=ne):ne=t[60];const ge=!!r;let je;t[61]===Symbol.for("react.memo_cache_sentinel")?(je=()=>g(null),t[61]=je):je=t[61];let De;t[62]===Symbol.for("react.memo_cache_sentinel")?(De=s.jsxs(ht,{children:[s.jsx(gt,{children:"Remove Member"}),s.jsx(pt,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=De):De=t[62];let ke;t[63]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(xt,{children:"Cancel"}),t[63]=ke):ke=t[63];let ve;t[64]!==r||t[65]!==M?(ve=()=>r&&M.mutate(r),t[64]=r,t[65]=M,t[66]=ve):ve=t[66];let Ce;t[67]!==M.isPending||t[68]!==ve?(Ce=s.jsxs(dt,{children:[De,s.jsxs(ut,{children:[ke,s.jsx(ft,{onClick:ve,disabled:M.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=M.isPending,t[68]=ve,t[69]=Ce):Ce=t[69];let ye;t[70]!==ge||t[71]!==Ce?(ye=s.jsx(bt,{open:ge,onOpenChange:je,children:Ce}),t[70]=ge,t[71]=Ce,t[72]=ye):ye=t[72];const Qe=Me,Ge=Me,Rt="flex flex-col gap-6";let Se;t[73]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(Me.Title,{children:"Members"}),t[73]=Se):Se=t[73];let Fe;t[74]===Symbol.for("react.memo_cache_sentinel")?(Fe=u=>{u.key==="Escape"&&(b(""),u.target.blur())},t[74]=Fe):Fe=t[74];let we;t[75]!==p?(we=s.jsx(Lt,{value:p,onChange:b,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:Fe}),t[75]=p,t[76]=we):we=t[76];let Oe;t[77]===Symbol.for("react.memo_cache_sentinel")?(Oe=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[77]=Oe):Oe=t[77];let Ne;t[78]!==f||t[79]!==y||t[80]!==v||t[81]!==E?(Ne=s.jsx(Ot,{viewMode:E,onViewModeChange:R,sortKey:v,sortDirection:y,onSort:f,sortOptions:Oe}),t[78]=f,t[79]=y,t[80]=v,t[81]=E,t[82]=Ne):Ne=t[82];let Te;t[83]!==we||t[84]!==Ne?(Te=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[we,Ne]}),Re]}),t[83]=we,t[84]=Ne,t[85]=Te):Te=t[85];const Je=E==="cards"?s.jsx("div",{children:he.length===0?s.jsx(He,{title:"No members found",description:p?`No members match "${p}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:he.map(u=>{if(u.type==="invitation")return s.jsxs(jt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(wt,{invitationId:u.data.id,onCancel:j,isCancelling:a.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Be,{fallback:Ke(u.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:u.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ve,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(qe,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:Q,selectableRoles:W,onRoleChange:(_,B)=>V.mutate({invitationId:_,role:B,email:u.data.email}),className:"w-fit"})]})]})]},`inv-${u.data.id}`);const h=u.data;return s.jsxs(jt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(St,{member:h,roles:O,onChangeRole:(_,B)=>C.mutate({memberId:_,role:B}),onRemove:g,isUpdating:C.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Be,{url:h.user?.image??void 0,fallback:Ke(h.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:h.user?.email}),s.jsx(qe,{role:h.role,memberId:h.id,isOwner:h.role==="owner",roleColorMap:Q,selectableRoles:W,onRoleChange:(_,B)=>C.mutate({memberId:_,role:B}),className:"w-fit"}),s.jsx(_t,{memberId:h.id,maxDisplay:3})]})]})]},h.id)})})}):s.jsx(qt,{columns:_e,data:he,isLoading:!1,sortKey:v,sortDirection:y,onSort:f,emptyState:p?s.jsx(He,{title:"No members found",description:`No members match "${p}"`}):s.jsx(He,{title:"No members found",description:"Invite members to get started."})});let Ie;t[86]!==Se||t[87]!==Te||t[88]!==Je?(Ie=s.jsxs("div",{className:Rt,children:[Se,Te,Je]}),t[86]=Se,t[87]=Te,t[88]=Je,t[89]=Ie):Ie=t[89];let Ae;t[90]!==Ge.Body||t[91]!==Ie?(Ae=s.jsx(Ge.Body,{children:Ie}),t[90]=Ge.Body,t[91]=Ie,t[92]=Ae):Ae=t[92];let Ee;t[93]!==Qe.Content||t[94]!==Ae?(Ee=s.jsx(Qe.Content,{children:Ae}),t[93]=Qe.Content,t[94]=Ae,t[95]=Ee):Ee=t[95];let Le;return t[96]!==oe||t[97]!==ne||t[98]!==ye||t[99]!==Ee?(Le=s.jsxs(oe,{children:[ne,ye,Ee]}),t[96]=oe,t[97]=ne,t[98]=ye,t[99]=Ee,t[100]=Le):Le=t[100],Le}function Qs(t){return{type:"invitation",data:t}}function Gs(t){return t.status==="pending"}function Js(t){return{type:"member",data:t}}function Hs(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ls(t.data.createdAt):"N/A"}):s.jsx(Ve,{variant:"outline",children:"Pending"})}function Ws(t){return t.type==="member"?s.jsx(_t,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Ys(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Be,{url:t.data.user?.image??void 0,fallback:Ke(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Be,{fallback:Ke(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Zs(t){return t.role!=="owner"}function Xs(t,e){fe("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update invitation role")}function en(t,e){fe("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update role")}function tn(t){fe("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to remove member")}function sn(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function nn(){const t=J.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Me,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ft,{fallback:e,children:s.jsx(ce.Suspense,{fallback:s.jsx(Me,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ze,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Us,{})})}),t[1]=n):n=t[1],n}function Xn(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Cs,{capability:"members:manage",area:"members",children:s.jsx(nn,{})}),t[0]=e):e=t[0],e}export{Xn as default};
@@ -1 +0,0 @@
1
- import{e as f,g as p,cm as x,j as r,r as c,l as u}from"./index-CiRQNPVt.js";import{P as g}from"./plugin-layout-CXygrV9H.js";import"./use-connection-DpxWBF4Y.js";import"./use-collections-B1Mg9Y32.js";import"./use-mcp-client-D0A6RZFw.js";import"./Settings02-CdJ0CKrL.js";import"./index-Dci2MWs9.js";import"./sidebar-BBqRosV0.js";import"./LayoutLeft-BkxKKkMX.js";import"./tooltip-C47QSg8i.js";import"./sheet-Utq51ofH.js";import"./X-BdwzFded.js";function $(){const e=f.c(13);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/plugins/$pluginId"},e[0]=i):i=e[0];const{pluginId:s}=p(i);let l;e[1]!==s?(l=x.find(n=>n.id===s),e[1]=s,e[2]=l):l=e[2];const t=l;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=n):n=e[3];let d;return e[4]!==t.bindingName||e[5]!==t.renderEmptyState||e[6]!==t.renderHeader?(d=r.jsx(c.Suspense,{fallback:n,children:r.jsx(g,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState})}),e[4]=t.bindingName,e[5]=t.renderEmptyState,e[6]=t.renderHeader,e[7]=d):d=e[7],d}const m=t?.LayoutComponent;if(!m){let n;return e[8]!==s?(n=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:['Plugin "',s,'" not found']})}),e[8]=s,e[9]=n):n=e[9],n}let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx(u,{size:32,className:"animate-spin text-muted-foreground mb-4"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[10]=a):a=e[10];let o;return e[11]!==m?(o=r.jsx(c.Suspense,{fallback:a,children:r.jsx(m,{})}),e[11]=m,e[12]=o):o=e[12],o}export{$ as default};
@@ -1 +0,0 @@
1
- import{e as it,r as E,j as e,l as rt}from"./index-CiRQNPVt.js";import{S as mt,d as pt,a as st,b as at}from"./sheet-Utq51ofH.js";import{S as nt}from"./scroll-area-verb-Y8E.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-qANN0Bj1.js";import{m as xt}from"./index-DkWynf6r.js";import"./X-BdwzFded.js";import"./select-BMX9jvQG.js";import"./tooltip-C47QSg8i.js";import"./Check-C9-fsV6-.js";import"./ChevronDown--2U1gfXf.js";import"./ChevronUp-C-xaVM7d.js";import"./label-DLUhXNk7.js";import"./switch-CTAzWsjZ.js";import"./schema-form-DNuUk0WJ.js";import"./agent-icon-DAPplz1A.js";import"./AlertCircle-BDfUS-lh.js";import"./Tool01-R6WyaXsu.js";import"./SwitchHorizontal01-BI_yHGXL.js";import"./RefreshCcw01-Dncu-kYd.js";import"./XCircle-D_3MYOn4.js";import"./ArrowUpRight-8daK_Mrm.js";import"./ZapSquare-CP91cLS8.js";import"./Users03-Bek4Ag3W.js";import"./CheckCircle-B_rVd_l8.js";import"./ChevronLeft-TttN4toV.js";import"./ChevronRight-BVEygGVH.js";import"./DotsVertical-Q3F6UWC_.js";import"./Container-Bso4WS0x.js";import"./Eye-CKz6zS_m.js";import"./ZoomOut-CaG3Pd1Z.js";import"./Globe01-iupU5eqh.js";import"./FilterLines-SKQT-eWL.js";import"./Star01-CN33xE6w.js";import"./Palette-CS36Icvl.js";import"./HardDrive-DpuvbJvr.js";import"./Stars02-B4CoQ82E.js";import"./Key01-6eW9IRFT.js";import"./LayoutLeft-BkxKKkMX.js";import"./LinkExternal01-BXhdtlT7.js";import"./Monitor01-DUICZH5i.js";import"./Sun-CEzPQTAJ.js";import"./Play-CbbqvWPd.js";import"./Plus-CSNkL1o7.js";import"./SearchMd-B-q2EsGW.js";import"./Settings02-CdJ0CKrL.js";import"./Shield01-Crgp73nV.js";import"./Stars01-BXO9Nc4-.js";import"./Trash01-C3pnsiws.js";import"./Upload01-BHsRhr7X.js";import"./User01-JuGE_kA7.js";import"./Users01-BVUwP6xk.js";import"./XClose-Da5LgJSi.js";import"./Zap-DHBAOmqP.js";import"./calendar-CfY7gp-n.js";import"./input-D3E6n6la.js";import"./popover-C1MgHMHU.js";import"./textarea-D1h5iq3D.js";import"./dropdown-menu-UGlYpK18.js";import"./image-field-CXkzTwa7.js";import"./dialog-Cwf6uY_y.js";import"./skeleton-dQOYuNlQ.js";import"./tabs-DVd_y6YL.js";import"./use-file-configs-o-LP0Blk.js";import"./use-mcp-client-D0A6RZFw.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./useInfiniteQuery-C1jLiRqA.js";import"./infiniteQueryObserver-BND7fiNU.js";import"./agent-capabilities-gx2lqG9R.js";import"./chat-context-BFmJRDzy.js";import"./tab-id-C7unjelb.js";import"./decopilot-sse-pool-BHhoQKaF.js";import"./create-sse-subscription-BS5983N4.js";import"./use-virtual-mcp-DciRKx1X.js";import"./use-collections-B1Mg9Y32.js";import"./use-ai-providers-Bwbur0GT.js";import"./use-organization-settings-PADdytdf.js";import"./pair-CpEuUIpQ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B_uLjrw6.js";import"./file-type-icon-7TqtrpuQ.js";import"./content-blocks-o63cs2vh.js";import"./types-Df_Z2FUK.js";import"./shell-layout-3b4NfWya.js";import"./avatar-BqNGZrFg.js";import"./required-auth-layout-BE5eceMw.js";import"./useRouterState-BXwm4DCl.js";import"./use-org-sso-nq4qWMpD.js";import"./integration-icon-vaGvNHHz.js";import"./use-navigate-to-agent-Drh7z3D_.js";import"./use-connection-DpxWBF4Y.js";import"./use-mcp-prompts-BuV5LRNr.js";import"./form-Bbpyf2N_.js";import"./spinner-_hqWpG0c.js";import"./drawer-CF0b7Dg3.js";import"./collection-search-CDLcWLfd.js";import"./toggle-group-vA7ktrP-.js";import"./connect-desktop-dialog-CDUh5Otr.js";import"./agent-icons-Dk-aO0GI.js";import"./checkbox-CBmcFqoh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CQW36fJV.js";import"./card-D41ULrnf.js";import"./command-B8qtKAnE.js";import"./index-DJTEqPXf.js";import"./sortable.esm-D7AgS_lX.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CSsbMtfE.js";import"./use-registry-connections-C0VEE_YX.js";import"./extract-connection-data-BKeaLULt.js";import"./generate-id-BHe5yw90.js";import"./collections-BxDJ4z3g.js";import"./collection-tabs-CbZbTMYY.js";import"./badge-BBLSXFe0.js";import"./connection-form-helpers-BonOFyzw.js";import"./use-infinite-scroll-D8iZFAEQ.js";import"./useSuspenseInfiniteQuery-CHLM-3cW.js";import"./index-Co-NpkaC.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DSfyT3dO.js";import"./sidebar-BBqRosV0.js";import"./toolbar-D3G0G9U8.js";import"./use-create-virtual-mcp-BBxov1Li.js";import"./github-repo-picker-CVG2zsbh.js";import"./use-mcp-tools-BTzw-W77.js";import"./alert-dialog-Q8M8ngFf.js";import"./index-sqqDCA0K.js";import"./use-org-auth-client-BlGBETGB.js";import"./hover-card-Azyk5Kxa.js";import"./task-status-5oHTrkjV.js";import"./use-status-sounds-DR8WA3PU.js";import"./empty-state-CoXt5rYF.js";import"./resizable-CrMJy22o.js";import"./use-capability-1uxC8-oZ.js";import"./header-tab-button-t5WNjrVG.js";import"./index-f0X8ef8k.js";import"./user-DaO6RYsc.js";import"./tools-list-BL4u8QMN.js";import"./use-debounced-autosave-DDZnxori.js";import"./index-Dci2MWs9.js";import"./search-input-CZKc9XZR.js";import"./use-secrets-DZDUsUGC.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-JZC0q2Q6.js";import"./view-mode-toggle-B-ZBNJWV.js";import"./select-model-BB2-8k_v.js";import"./use-automations-B9mdkXiu.js";import"./monaco-editor-Bgzj9gt4.js";import"./automation-runs-gdpRnoA6.js";import"./table-BuLHtfTA.js";import"./use-members-DDVaE5yQ.js";import"./automation-list-row-BRsSmcOA.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,39 +0,0 @@
1
- import{e as $,r as H,T as at,I as Ht,H as Bt,j as n,B as ke,W as Xe,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-CiRQNPVt.js";import{_ as Kt,F as Jt,z as Xt,ab as Qt,N as Yt,M as Zt,L as es,a7 as rt,ac as ts,ad as ss,A as it,ae as ie,af as ns,ag as ls,ah as os,b as as}from"./agent-icon-DAPplz1A.js";import{t as He}from"./Stars01-BXO9Nc4-.js";import{a as ct,t as rs,b as we,d as is}from"./XCircle-D_3MYOn4.js";import{i as Be}from"./Check-C9-fsV6-.js";import{i as Qe}from"./ChevronRight-BVEygGVH.js";import{a as ut,s as cs}from"./Eye-CKz6zS_m.js";import{a as de,c as Ye,t as us}from"./format-time-Cy7tTmZp.js";import{N as dt,R as ft,e as mt,C as ds,f as fs,g as ms,u as ps,i as xs,d as gs}from"./scroll-area-verb-Y8E.js";import{u as pt}from"./use-copy-B_uLjrw6.js";import{T as pe,a as xe,b as ge}from"./tooltip-C47QSg8i.js";import{M as xt,I as gt,F as hs}from"./file-type-icon-7TqtrpuQ.js";import{c as bs}from"./content-blocks-o63cs2vh.js";import{g as ht,M as ys}from"./types-Df_Z2FUK.js";import{f as $e,i as js,d as We,a as vs}from"./chat-context-BFmJRDzy.js";import{S as Ns,u as Ue,c as ks,b as Ss}from"./use-mcp-client-D0A6RZFw.js";import{n as _s,f as ws,o as Ts,q as Cs}from"./tab-id-C7unjelb.js";import{i as bt}from"./AlertCircle-BDfUS-lh.js";import{s as Ce,t as yt}from"./Star01-CN33xE6w.js";import{s as $s}from"./XClose-Da5LgJSi.js";import{n as jt}from"./ZapSquare-CP91cLS8.js";import{n as vt,i as Is}from"./Globe01-iupU5eqh.js";import{b as Ms,i as Ls,a as Le}from"./Tool01-R6WyaXsu.js";import{i as Ze,a as Rs}from"./ZoomOut-CaG3Pd1Z.js";import{i as Ne}from"./Monitor01-DUICZH5i.js";import{i as As}from"./SearchMd-B-q2EsGW.js";import{i as zs}from"./Upload01-BHsRhr7X.js";import{u as Ps,c as Es}from"./shell-layout-3b4NfWya.js";import{n as Nt}from"./LinkExternal01-BXhdtlT7.js";import{I as Ie}from"./integration-icon-vaGvNHHz.js";import{u as Fs}from"./use-virtual-mcp-DciRKx1X.js";import{a as kt}from"./Users03-Bek4Ag3W.js";import{a as ce}from"./Palette-CS36Icvl.js";import{k as St}from"./use-navigate-to-agent-Drh7z3D_.js";import{a as Os}from"./use-connection-DpxWBF4Y.js";import{s as Ds}from"./Stars02-B4CoQ82E.js";import{g as Hs}from"./use-mcp-prompts-BuV5LRNr.js";import{c as Bs,b as Ws,d as Us,a as qs,D as Vs}from"./dialog-Cwf6uY_y.js";import{a as Gs,F as Ks,b as Js,c as Xs,d as Qs,f as Ys}from"./form-Bbpyf2N_.js";import{I as Zs}from"./input-D3E6n6la.js";import{S as en}from"./spinner-_hqWpG0c.js";import{t as tn}from"./ChevronDown--2U1gfXf.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 ma(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 qe(s){if(s&&typeof s=="object"&&"gatewayClientId"in s&&typeof s.gatewayClientId=="string")return s.gatewayClientId}function Ve(s,e){if(!e)return s;const t=`${nn(e)}_`;return s.startsWith(t)?s.slice(t.length):s}function ln(s,e){return Ve(s,e).replace(/[_-]/g," ").toLowerCase()}function on(s){const e={};for(const t of s.arguments??[])e[t.name]=t.required?Xe().min(1,"Required"):Xe();return at(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=H.useId();let u;if(e[0]!==t){const A=t?on(t):at({});u=Ht(A),e[0]=t,e[1]=u}else u=e[1];const c=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]!==c||e[6]!==m?(p={resolver:c,defaultValues:m,mode:"onChange"},e[5]=c,e[6]=m,e[7]=p):p=e[7];const i=Bt(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]!==i||e[11]!==r||e[12]!==l?(g=async A=>{await r(A),l(null),i.reset()},e[10]=i,e[11]=r,e[12]=l,e[13]=g):g=e[13];const b=g;let h;e[14]!==i||e[15]!==l?(h=A=>{A||(i.reset(),l(null))},e[14]=i,e[15]=l,e[16]=h):h=e[16];const N=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,qe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=y):y=e[20];let k;e[21]!==y?(k=n.jsx(Bs,{children:n.jsx("span",{className:"capitalize",children:y})}),e[21]=y,e[22]=k):k=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 v;e[25]!==j||e[26]!==k?(v=n.jsxs(Ws,{children:[k,j]}),e[25]=j,e[26]=k,e[27]=v):v=e[27];let S;e[28]!==i||e[29]!==b?(S=A=>{A.stopPropagation(),i.handleSubmit(b)(A)},e[28]=i,e[29]=b,e[30]=S):S=e[30];let _;if(e[31]!==x||e[32]!==i.control||e[33]!==i.formState.isSubmitting){let A;e[35]!==i.control||e[36]!==i.formState.isSubmitting?(A=P=>n.jsx(Ks,{control:i.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:i.formState.isSubmitting})}),n.jsx(Ys,{})]})}},P.name),e[35]=i.control,e[36]=i.formState.isSubmitting,e[37]=A):A=e[37],_=x.map(A),e[31]=x,e[32]=i.control,e[33]=i.formState.isSubmitting,e[34]=_}else _=e[34];let w;e[38]!==N?(w=()=>N(!1),e[38]=N,e[39]=w):w=e[39];let T;e[40]!==i.formState.isSubmitting||e[41]!==w?(T=n.jsx(ke,{type:"button",variant:"ghost",onClick:w,disabled:i.formState.isSubmitting,children:"Cancel"}),e[40]=i.formState.isSubmitting,e[41]=w,e[42]=T):T=e[42];let I;e[43]!==i.formState.isSubmitting?(I=i.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(en,{size:"xs"}),"Loading..."]}):"Use prompt",e[43]=i.formState.isSubmitting,e[44]=I):I=e[44];let M;e[45]!==i.formState.isSubmitting||e[46]!==o||e[47]!==I?(M=n.jsx(ke,{type:"submit",form:o,disabled:i.formState.isSubmitting,children:I}),e[45]=i.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]!==i||e[58]!==L?(R=n.jsx(Gs,{...i,children:L}),e[57]=i,e[58]=L,e[59]=R):R=e[59];let F;e[60]!==v||e[61]!==R?(F=n.jsxs(qs,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[v,R]}),e[60]=v,e[61]=R,e[62]=F):F=e[62];let z;return e[63]!==N||e[64]!==F?(z=n.jsx(Vs,{open:!0,onOpenChange:N,children:F}),e[63]=N,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 pa(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:c,id:m,args:p}=t.attrs,i=l&&r.editable,d=f==="@",x=r.editable&&f==="/"&&c!=="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",N=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=i&&"outline-2 outline-blue-300 outline-offset-0",k=x&&"hover:brightness-95";let j;e[7]!==h||e[8]!==N||e[9]!==y||e[10]!==k?(j=V("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",N,y,k,"capitalize"),e[7]=h,e[8]=N,e[9]=y,e[10]=k,e[11]=j):j=e[11];let v;e[12]!==u?(v=u?Ct(u):"",e[12]=u,e[13]=v):v=e[13];let S;return e[14]!==f||e[15]!==b||e[16]!==j||e[17]!==v?(S=n.jsxs(mt,{onClick:b,className:j,children:[f,v]}),e[14]=f,e[15]=b,e[16]=j,e[17]=v,e[18]=S):S=e[18],S}const dn=dt.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 ft(un)}}),fn=/^mcp__[a-zA-Z0-9_-]+__/;function It(s){return s.replace(fn,"")}function Ge(s){const e=$.c(18),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o,animate:u}=s,f=r===void 0?!1:r,c=o===void 0?!1:o,m=u===void 0?!1:u,{handleCopy:p}=pt(),[i,d]=H.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 N;e[4]!==m||e[5]!==t||e[6]!==l.text?(N=n.jsx(xt,{id:t,text:l.text,animate:m}),e[4]=m,e[5]=t,e[6]=l.text,e[7]=N):N=e[7];let y;e[8]!==c||e[9]!==a||e[10]!==g||e[11]!==i||e[12]!==h||e[13]!==b?(y=h&&n.jsxs("div",{className:V("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",c?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[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:i?n.jsx(Be,{className:"size-4"}):n.jsx(ut,{className:"size-4"})})]}),e[8]=c,e[9]=a,e[10]=g,e[11]=i,e[12]=h,e[13]=b,e[14]=y):y=e[14];let k;return e[15]!==N||e[16]!==y?(k=n.jsxs("div",{className:"group/part relative",children:[N,y]}),e[15]=N,e[16]=y,e[17]=k):k=e[17],k}function xa(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 c;e[0]!==o?(c=o.startsWith("image/"),e[0]=o,e[1]=c):c=e[1];const m=c,p=f&&"outline-2 outline-blue-300 outline-offset-0";let i;e[2]!==p?(i=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]=i):i=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]!==i||e[15]!==g?(b=n.jsx(mt,{className:i,children:g}),e[14]=i,e[15]=g,e[16]=b):b=e[16],b}const xn=dt.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 ft(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 c;e[4]!==f?(c=n.jsx(pe,{asChild:!0,children:n.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[u,n.jsx("span",{className:"text-sm font-mono tabular-nums",children:f})]})}),e[4]=f,e[5]=c):c=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{className:"text-muted",children:"in"}),e[7]=p):p=e[7];let i;e[8]!==r?(i=r.toLocaleString(),e[8]=r,e[9]=i):i=e[9];let d;e[10]!==i?(d=n.jsx("span",{className:"text-right tabular-nums",children:i}),e[10]=i,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 N;e[17]!==r||e[18]!==t.cacheReadTokens||e[19]!==t.cacheWriteTokens?(N=(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]=N):N=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 k;e[23]!==h||e[24]!==N||e[25]!==y||e[26]!==d?(k=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,N,y]})]}),e[23]=h,e[24]=N,e[25]=y,e[26]=d,e[27]=k):k=e[27];let j;return e[28]!==k||e[29]!==c?(j=n.jsxs(ge,{children:[c,k]}),e[28]=k,e[29]=c,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 c;e[3]!==l||e[4]!==f||e[5]!==t?(c=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]=c):c=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 i;return e[15]!==c||e[16]!==m||e[17]!==p?(i=n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,m,p]}),e[15]=c,e[16]=m,e[17]=p,e[18]=i):i=e[18],i}function ga(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,c=t?.inputTokens??0,m=t?.outputTokens??0;let p;e[0]!==o?(p=o.toFixed(0),e[0]=o,e[1]=p):p=e[1];let i;e[2]!==f?(i=f>0?`, $${f.toFixed(2)}`:"",e[2]=f,e[3]=i):i=e[3];const d=`Context usage: ${p}%${i}`,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 N;e[7]!==h?(N=V(h),e[7]=h,e[8]=N):N=e[8];let y;e[9]!==u||e[10]!==N?(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:N})]}),e[9]=u,e[10]=N,e[11]=y):y=e[11];let k;e[12]!==o?(k=o.toFixed(0),e[12]=o,e[13]=k):k=e[13];let j;e[14]!==f?(j=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,e[15]=j):j=e[15];let v;e[16]!==k||e[17]!==j?(v=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:[k,"%",j]}),e[16]=k,e[17]=j,e[18]=v):v=e[18];let S;e[19]!==a||e[20]!==v||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,v]})}),e[19]=a,e[20]=v,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]!==c||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:c.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]=c,e[38]=m,e[39]=C):C=e[39];let L;e[40]!==c||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:c>0?`${((t?.cacheReadTokens??0)/c*100).toFixed(0)}%`:"0%"})]}),e[40]=c,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]=H.useState(null),[u,f]=H.useState(!1),c=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 i=window.getComputedStyle(p);if(i.overflowY==="auto"||i.overflowY==="scroll"||i.overflow==="auto"||i.overflow==="scroll"){p.scrollTop=p.scrollHeight;return}p=p.parentElement}};return H.useEffect(()=>{if(!a)return;const p=new IntersectionObserver(i=>{const d=i[0]?.isIntersecting??!1;f(d)},{root:s?.current??null,threshold:c,rootMargin:"0px"});return p.observe(a),()=>p.disconnect()},[a,c]),H.useEffect(()=>{if(!e||!u)return;const p=setInterval(m,r);return()=>clearInterval(p)},[e,u,r]),H.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:c,variant:m,trailing:p,iconDestructive:i,alwaysChevron:d,defaultOpen:x,children:g}=s,b=f===void 0?"code":f,h=m===void 0?"default":m,[N,y]=H.useState(x??!1),{handleCopy:k,copied:j}=pt(),v=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=(c??!1)||N,C=H.useRef(null),L=v&&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=c?void 0:y,P=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",W=!T&&"cursor-default",U=v&&"shimmer";let B;e[7]!==W||e[8]!==U||e[9]!==O?(B=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]=B):B=e[10];const Y=!T;let K;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==i||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(Qe,{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",i?"[&>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(Qe,{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]=i,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]!==B||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:B,"aria-disabled":Y,children:[K,Z,E,q,G]}),e[29]=B,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]!==k||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:()=>k(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(Be,{className:"size-3.5"}):n.jsx(ut,{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]=k,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(ct,{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(27),{org:t}=he(),l=Ut(),r=_s();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:Ns,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const o=Ue(a);let u;e[3]!==o||e[4]!==s?(u=async b=>{if(!s)throw new Error("useTaskExpandedTools: no task in context");const h=await o.callTool({name:"COLLECTION_THREADS_GET",arguments:{id:s}}),y=(h.structuredContent??h).item?.metadata??{},j=(y.expanded_tools??[]).filter(S=>S.toolName!==b.toolName);j.push({...b,expandedAt:new Date().toISOString()});const v={...y,expanded_tools:j};return await o.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:s,data:{metadata:v}}}),j},e[3]=o,e[4]=s,e[5]=u):u=e[5];let f,c,m;e[6]!==t.id||e[7]!==l||e[8]!==s?(f=async b=>{const h=me.ensureTask(t.id,s??"");await l.cancelQueries({queryKey:h});const N=l.getQueryData(h),k=(N?.metadata?.expanded_tools??[]).filter(j=>j.toolName!==b.toolName);return k.push({...b,expandedAt:new Date().toISOString()}),l.setQueryData(h,j=>j&&{...j,metadata:{...j.metadata??{},expanded_tools:k}}),{previous:N}},c=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},m=(b,h,N)=>{const y=me.ensureTask(t.id,s??"");N?.previous===void 0?l.removeQueries({queryKey:y,exact:!0}):l.setQueryData(y,N.previous),ze.error(b instanceof Error?b.message:"Failed to expand tool")},e[6]=t.id,e[7]=l,e[8]=s,e[9]=f,e[10]=c,e[11]=m):(f=e[9],c=e[10],m=e[11]);let p;e[12]!==u||e[13]!==f||e[14]!==c||e[15]!==m?(p={mutationFn:u,onMutate:f,onSuccess:c,onError:m},e[12]=u,e[13]=f,e[14]=c,e[15]=m,e[16]=p):p=e[16];const i=qt(p);let d;e[17]!==r||e[18]!==i||e[19]!==t.id||e[20]!==l||e[21]!==s?(d=b=>{if(!s||!r)return;const h=me.ensureTask(t.id,s),N=l.getQueryData(h),k=(N?.metadata?.expanded_tools??[]).filter(v=>v.toolName!==b.toolName);k.push({...b,expandedAt:new Date().toISOString()});const j={...N?.metadata??{},expanded_tools:k};l.setQueryData(h,v=>v&&{...v,metadata:j}),r.patchThread({id:s,metadata:j}),i.mutate(b)},e[17]=r,e[18]=i,e[19]=t.id,e[20]=l,e[21]=s,e[22]=d):d=e[22];const x=d;let g;return e[23]!==x||e[24]!==i.isPending||e[25]!==i.mutate?(g={addOrReplace:i.mutate,addOrReplaceEager:x,isPending:i.isPending},e[23]=x,e[24]=i.isPending,e[25]=i.mutate,e[26]=g):g=e[26],g}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 ks({connectionId:e,orgId:t,orgSlug:l});try{const{tools:u}=await o.listTools(),f=It(s);return u.find(c=>c.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:Ze,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:Ze,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 Ke(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
- ${l.text}`);else if(l.type==="source-url")t.push(`## Source URL
3
- ${l.url}`);else if(l.type==="source-document")t.push(`## Source Document
4
- ${l.title}`);else if(l.type==="file")t.push(`## File
5
- ${l.filename??l.url}`);else if(l.type!=="step-start"){if(Sn(l)){const r=l.type.startsWith("tool-")?l.type.slice(5):l.toolName;if(l.state==="input-streaming")t.push(`## ${r}
6
- Input streaming...`);else if(l.state==="input-available"){const a=ye(l.input).slice(0,20);t.push(`## ${r}
7
- ### Input
8
- ${a||"[No input]"}...`)}else if(l.state==="approval-requested")t.push(`## ${r}
9
- Approval requested...`);else if(l.state==="approval-responded")t.push(`## ${r}
10
- Approval responded...`);else if(l.state==="output-available"){const a=ye(l.input).slice(0,40),o=ye(l.output).slice(0,40);t.push(l.output!=null?`## ${r}
11
- Input: ${a||"[No input]"}...
12
- Output: ${o||"[No output]"}...`:`## ${r}
13
- Input: ${a||"[No input]"}...
14
- Output: Tool responded with no output`)}else if(l.state==="output-error"){const a=ye(l.input).slice(0,40);t.push(l.errorText?`## ${r}
15
- Input: ${a||"[No input]"}...
16
- Error: ${l.errorText}`:`## ${r}
17
- Input: ${a||"[No input]"}...
18
- Error: Tool responded with an error`)}else if(l.state==="output-denied"){const a=ye(l.input).slice(0,40);t.push(`## ${r}
19
- Input: ${a||"[No input]"}...
20
- Output: Tool execution was denied`)}}}return t.length>0?t.join(`
21
-
22
- `):null}function et(s){const e=ye(s);if(e===""||e==="[Non-serializable value]")return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function Te(s){const e=$.c(7),{icon:t,label:l}=s;let r;e[0]!==t?(r=n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"flex items-center",children:t})}),e[0]=t,e[1]=r):r=e[1];let a;e[2]!==l?(a=n.jsx(xe,{side:"top",children:l}),e[2]=l,e[3]=a):a=e[3];let o;return e[4]!==r||e[5]!==a?(o=n.jsxs(ge,{children:[r,a]}),e[4]=r,e[5]=a,e[6]=o):o=e[6],o}function wn(s){const e=$.c(15),{annotations:t,toolMeta:l}=s;let r;e[0]!==l?(r=ht(l),e[0]=l,e[1]=r):r=e[1];const a=!!r;if(!t&&!a)return null;let o;e[2]!==a?(o=a&&n.jsx(Te,{icon:n.jsx(rt,{}),label:"Interactive"}),e[2]=a,e[3]=o):o=e[3];let u;e[4]!==t?.readOnlyHint?(u=t?.readOnlyHint&&n.jsx(Te,{icon:n.jsx(cs,{}),label:"Read-only — no side effects"}),e[4]=t?.readOnlyHint,e[5]=u):u=e[5];let f;e[6]!==t?.destructiveHint?(f=t?.destructiveHint&&n.jsx(Te,{icon:n.jsx(bt,{}),label:"May modify or delete data"}),e[6]=t?.destructiveHint,e[7]=f):f=e[7];let c;e[8]!==t?.openWorldHint?(c=t?.openWorldHint&&n.jsx(Te,{icon:n.jsx(Ce,{}),label:"Reaches outside this system"}),e[8]=t?.openWorldHint,e[9]=c):c=e[9];let m;return e[10]!==o||e[11]!==u||e[12]!==f||e[13]!==c?(m=n.jsxs(n.Fragment,{children:[o,u,f,c]}),e[10]=o,e[11]=u,e[12]=f,e[13]=c,e[14]=m):m=e[14],m}function Tn(s){if(s<1024)return`${s} B`;if(s<1024*1024){const t=s/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}const e=s/(1024*1024);return e<10?`${e.toFixed(1)} MB`:`${Math.round(e)} MB`}function Cn(s){return s<1?`${Math.round(s*1e3)}ms`:s<10?`${s.toFixed(1)}s`:`${Math.round(s)}s`}function $n(s){const e=$.c(13),{latency:t,outputBytes:l}=s,r=typeof t=="number"&&t>0,a=typeof l=="number"&&l>=0;if(!r&&!a)return null;let o;e[0]!==r||e[1]!==t?(o=r&&n.jsx("span",{children:Cn(t)}),e[0]=r,e[1]=t,e[2]=o):o=e[2];let u;e[3]!==a||e[4]!==r?(u=r&&a&&n.jsx("span",{className:"text-muted-foreground/30",children:"·"}),e[3]=a,e[4]=r,e[5]=u):u=e[5];let f;e[6]!==a||e[7]!==l?(f=a&&n.jsx("span",{children:Tn(l)}),e[6]=a,e[7]=l,e[8]=f):f=e[8];let c;return e[9]!==o||e[10]!==u||e[11]!==f?(c=n.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-mono tabular-nums text-muted-foreground/60 px-1 leading-none",children:[o,u,f]}),e[9]=o,e[10]=u,e[11]=f,e[12]=c):c=e[12],c}function In(s,e,t){switch(s){case"input-streaming":case"input-available":return"Preparing...";case"approval-requested":return"Waiting for your approval";case"output-denied":return"Cancelled";case"output-error":return t??"Failed";case"output-available":{if(e==null)return"Done";if(typeof e=="string"){const l=e.trim();return l.length>100?l.slice(0,100)+"…":l}if(typeof e=="object"){for(const l of Object.keys(e)){const r=e[l];if(typeof r=="string"&&r.trim()){const a=r.trim();return a.length>100?a.slice(0,100)+"…":a}}return""}return String(e).slice(0,100)}default:return""}}function tt(s){const e=$.c(67),{part:t,annotations:l,latency:r,outputBytes:a,isLastMessage:o,toolMeta:u}=s,f="toolName"in t&&typeof t.toolName=="string"?t.toolName:t.type==="dynamic-tool"?"Dynamic Tool":t.type.replace("tool-","")||"Tool",c=It(f),m=$e(),p=js(),{org:i}=he(),{setChatOpen:d}=Ps(),x=We()?.taskId??null,{addOrReplaceEager:g}=vn(x),b=je(),h=u&&typeof u=="object"&&u!==null&&"connectionId"in u&&u.connectionId!=null&&u.connectionId!==""?String(u.connectionId):p?.selectedVirtualMcp?.id??null,{toolDef:N}=Nn(h?f:null,h,i.id,i.slug),y=N?._meta??u,k=qe(y),j=Ve(c,k),v=kn[j],S=N?.title??v?.label??Ct(j);let _;e[0]!==y?(_=ht(y),e[0]=y,e[1]=_):_=e[1];const w=_,T=!!w&&t.state==="output-available",I=h?`${h}:${f}`:null,M=!!l?.destructiveHint,C=T&&!!h&&!M&&!!x;let L;e[2]!==g||e[3]!==h||e[4]!==b||e[5]!==t||e[6]!==f?(L=()=>{if(!h)return;const se="input"in t&&t.input&&typeof t.input=="object"?t.input:{};g({toolName:f,appId:h,args:se}),b({to:".",search:ae=>({...ae,main:ws(h,f)}),replace:!0})},e[2]=g,e[3]=h,e[4]=b,e[5]=t,e[6]=f,e[7]=L):L=e[7];const R=L;let F;e[8]!==C||e[9]!==R?(F=se=>se==="fullscreen"&&C?(R(),"fullscreen"):"inline",e[8]=C,e[9]=R,e[10]=F):F=e[10];const z=F;let A;e[11]!==m||e[12]!==d?(A=se=>{const ae=bs(se.content);ae.content.length>0&&(d?.(!0),m?.sendMessage(ae))},e[11]=m,e[12]=d,e[13]=A):A=e[13];const P=A,O=t.state==="approval-requested"&&o===!1,W=t.state==="output-denied"||O,U=t.state==="output-available"&&typeof t.output=="object"&&t.output!=null&&"isError"in t.output&&t.output.isError===!0;let B;e[14]!==t.state?(B=re(t.state),e[14]=t.state,e[15]=B):B=e[15];const Y=B,K=O||Y==="approval"?"idle":U?"error":Y;let Q,X;e[16]!==U||e[17]!==O||e[18]!==t?(Q=t.state==="output-error"?Ke(t):void 0,X=O?"Cancelled":U?"Failed":In(t.state,t.output,Q),e[16]=U,e[17]=O,e[18]=t,e[19]=Q,e[20]=X):(Q=e[19],X=e[20]);const Z=X;let E="";t.input!==void 0&&(E=`# Input
23
- `+et(t.input)),t.state==="output-error"?(E&&(E=E+`
24
-
25
- `),E=E+(`# Error
26
- `+(Q??""))):t.output!==void 0&&!T&&(E&&(E=E+`
27
-
28
- `),E=E+(`# Output
29
- `+et(t.output)));let q;e:{if(W){let ne;e[21]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx($s,{}),e[21]=ne):ne=e[21],q=ne;break e}if(T){let ne;e[22]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(rt,{className:"size-4 text-muted-foreground"}),e[22]=ne):ne=e[22],q=ne;break e}const se=v?.icon;if(se){let ne;e[23]!==se?(ne=n.jsx(se,{className:"size-4 text-muted-foreground"}),e[23]=se,e[24]=ne):ne=e[24],q=ne;break e}let ae;e[25]===Symbol.for("react.memo_cache_sentinel")?(ae=n.jsx(ts,{className:"size-4 text-muted-foreground"}),e[25]=ae):ae=e[25],q=ae}let G;e[26]!==l||e[27]!==u?(G=n.jsx(wn,{annotations:l,toolMeta:u}),e[26]=l,e[27]=u,e[28]=G):G=e[28];let J;e[29]!==r||e[30]!==a?(J=n.jsx($n,{latency:r,outputBytes:a}),e[29]=r,e[30]=a,e[31]=J):J=e[31];let ee;e[32]!==G||e[33]!==J?(ee=n.jsxs(n.Fragment,{children:[G,J]}),e[32]=G,e[33]=J,e[34]=ee):ee=e[34];const ue=E||null;let le;e[35]!==K||e[36]!==S||e[37]!==W||e[38]!==r||e[39]!==Z||e[40]!==ee||e[41]!==ue||e[42]!==q?(le=n.jsx(D,{icon:q,iconDestructive:W,trailing:ee,title:S,latency:r,summary:Z,state:K,detail:ue}),e[35]=K,e[36]=S,e[37]=W,e[38]=r,e[39]=Z,e[40]=ee,e[41]=ue,e[42]=q,e[43]=le):le=e[43];let oe;e[44]!==C||e[45]!==R?(oe=C&&n.jsx("div",{className:"flex justify-end mt-1.5 mb-1",children:n.jsxs("button",{type:"button",onClick:R,className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground rounded-md [@media(hover:hover)]:hover:bg-accent/50 [@media(hover:hover)]:hover:text-foreground transition-colors",children:[n.jsx(ss,{className:"size-3.5"}),"Open in panel"]})}),e[44]=C,e[45]=R,e[46]=oe):oe=e[46];let be;e[47]!==C||e[48]!==p||e[49]!==h||e[50]!==S||e[51]!==P||e[52]!==z||e[53]!==T||e[54]!==y||e[55]!==i.id||e[56]!==i.slug||e[57]!==t.input||e[58]!==t.output||e[59]!==I||e[60]!==j||e[61]!==w?(be=T&&w&&h&&i?.id&&n.jsx(n.Fragment,{children:n.jsx(Vt,{fallback:se=>{const{resetError:ae}=se;return n.jsxs("div",{className:"mt-2 flex items-center gap-2 px-3 py-2.5 border border-dashed border-destructive/30 bg-destructive/5 rounded-lg",children:[n.jsx(bt,{size:16,className:"shrink-0 text-destructive"}),n.jsxs("span",{className:"flex-1 text-xs text-destructive font-medium",children:["Failed to load"," ",n.jsx("span",{className:"font-mono",children:S})," app"]}),n.jsxs(ke,{size:"sm",variant:"outline",className:"h-7 text-xs gap-1.5 shrink-0",onClick:ae,children:[n.jsx(Gt,{className:"size-3.5"}),"Retry"]})]})},children:n.jsx(H.Suspense,{fallback:n.jsx("div",{className:"mt-2 flex items-center justify-center h-12 border border-border/75 rounded-lg overflow-hidden p-3",children:n.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[n.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),n.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:n.jsx(Rn,{uiResourceUri:w,connectionId:h,orgId:i.id,orgSlug:i.slug,toolName:j,toolInput:t.input,toolResult:t.output,toolMeta:y,onMessage:P,onUpdateModelContext:I&&p?se=>p.setAppContext(I,se):void 0,onTeardown:I&&p?()=>p.clearAppContext(I):void 0,onRequestDisplayMode:C?z:void 0})})})}),e[47]=C,e[48]=p,e[49]=h,e[50]=S,e[51]=P,e[52]=z,e[53]=T,e[54]=y,e[55]=i.id,e[56]=i.slug,e[57]=t.input,e[58]=t.output,e[59]=I,e[60]=j,e[61]=w,e[62]=be):be=e[62];let _e;return e[63]!==le||e[64]!==oe||e[65]!==be?(_e=n.jsxs("div",{children:[le,oe,be]}),e[63]=le,e[64]=oe,e[65]=be,e[66]=_e):_e=e[66],_e}function At(s){return typeof s=="object"&&s!=null&&"type"in s&&s.type==="mcpToolCall"}function Mn(s){if(s!=null)return At(s)?s.arguments??void 0:s}function Ln(s){if(s==null)return;if(At(s)&&s.result!=null)return s.result;if(typeof s=="object"&&"content"in s&&Array.isArray(s.content)){const t=s.content;if(t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"type"in t[0])return s}const e=typeof s=="string"?s:JSON.stringify(s);return{structuredContent:typeof s=="object"&&!Array.isArray(s)?s:void 0,content:[{type:"text",text:e}]}}function Rn(s){const e=$.c(27),{uiResourceUri:t,connectionId:l,orgId:r,orgSlug:a,toolName:o,toolInput:u,toolResult:f,toolMeta:c,onMessage:m,onUpdateModelContext:p,onTeardown:i,onRequestDisplayMode:d}=s;let x;e[0]!==l||e[1]!==r||e[2]!==a?(x={connectionId:l,orgId:r,orgSlug:a},e[0]=l,e[1]=r,e[2]=a,e[3]=x):x=e[3];const g=Ue(x);let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b={type:"object"},e[4]=b):b=e[4];let h;e[5]!==c?(h=c!=null&&{_meta:c},e[5]=c,e[6]=h):h=e[6];let N;e[7]!==h||e[8]!==o?(N={name:o,inputSchema:b,...h},e[7]=h,e[8]=o,e[9]=N):N=e[9];const y=N;let k;e[10]!==y?(k={tool:y},e[10]=y,e[11]=k):k=e[11];let j;e[12]!==u?(j=Mn(u),e[12]=u,e[13]=j):j=e[13];let v;e[14]!==f?(v=Ln(f),e[14]=f,e[15]=v):v=e[15];let S;return e[16]!==g||e[17]!==m||e[18]!==d||e[19]!==i||e[20]!==p||e[21]!==r||e[22]!==k||e[23]!==j||e[24]!==v||e[25]!==t?(S=n.jsx("div",{className:"mt-2 border border-border/75 rounded-lg overflow-hidden p-3",children:n.jsx(ys,{resourceURI:t,orgId:r,toolInfo:k,toolInput:j,toolResult:v,client:g,onMessage:m,onUpdateModelContext:p,onTeardown:i,onRequestDisplayMode:d})}),e[16]=g,e[17]=m,e[18]=d,e[19]=i,e[20]=p,e[21]=r,e[22]=k,e[23]=j,e[24]=v,e[25]=t,e[26]=S):S=e[26],S}const st="mesh-storage://";function Me(s){return s.startsWith(st)?s.slice(st.length):null}function zt(s,e){const t=Me(s);return t!==null?`/api/${e}/files/${t}`:s}function An(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;return l?{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:0,cacheReadTokens:0,cacheWriteTokens:0}:null}function zn(s){const e=$.c(13),{uri:t,orgSlug:l}=s;let r;e[0]!==l||e[1]!==t?(r=zt(t,l),e[0]=l,e[1]=t,e[2]=r):r=e[2];const a=r;let o;e[3]!==t?(o=Me(t)!==null?t.slice(t.lastIndexOf("/")+1):"reference",e[3]=t,e[4]=o):o=e[4];const u=o;let f;e[5]!==u?(f=n.jsx(pe,{asChild:!0,children:n.jsx("span",{className:"inline-flex items-center gap-1 px-1 py-0.5 rounded bg-muted text-muted-foreground text-xs cursor-default select-none",children:u})}),e[5]=u,e[6]=f):f=e[6];let c;e[7]!==u||e[8]!==a?(c=n.jsx(xe,{side:"top",className:"max-w-sm p-1.5",children:n.jsx("img",{src:a,alt:u,className:"max-w-full max-h-64 object-contain rounded"})}),e[7]=u,e[8]=a,e[9]=c):c=e[9];let m;return e[10]!==f||e[11]!==c?(m=n.jsxs(ge,{children:[f,c]}),e[10]=f,e[11]=c,e[12]=m):m=e[12],m}function Pn(s){const e=$.c(65),{part:t,latency:l}=s,r=De();let a;e[0]!==t.state?(a=re(t.state),e[0]=t.state,e[1]=a):a=e[1];const o=a,u=t.input,f=t.output,c=f?.images;let m;e[2]!==f?(m=An(f),e[2]=f,e[3]=m):m=e[3];const p=m,i=f?.model;let d,x,g,b,h,N,y,k,j,v,S,_;if(e[4]!==c||e[5]!==u||e[6]!==l||e[7]!==i||e[8]!==r||e[9]!==o||e[10]!==p){h=Symbol.for("react.early_return_sentinel");e:{const L=Array.isArray(u?.referenceImages)?u.referenceImages.filter(En):void 0;let R;e[23]!==l?(R=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[23]=l,e[24]=R):R=e[24];const F=R;if(o==="loading"){let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Le,{size:14}),e[25]=z):z=e[25];let A;e[26]!==u?(A=u?.prompt?`"${u.prompt.slice(0,80)}…"`:void 0,e[26]=u,e[27]=A):A=e[27];let P;e[28]!==A?(P=n.jsx(D,{icon:z,title:"Generating image",summary:A,state:"loading"}),e[28]=A,e[29]=P):P=e[29],h=P;break e}if(o==="error"||!c||c.length===0){let z;e[30]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Le,{size:14}),e[30]=z):z=e[30];const A=o==="error"?"Failed":"No images generated",P=o==="error"?"error":"idle";let O;e[31]!==F||e[32]!==A||e[33]!==P||e[34]!==p?(O=n.jsx(D,{icon:z,title:"Image generation",summary:A,state:P,usage:p,trailing:F}),e[31]=F,e[32]=A,e[33]=P,e[34]=p,e[35]=O):O=e[35],h=O;break e}b="flex flex-col gap-2",d=D,e[36]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Le,{size:14,className:"text-pink-500"}),e[36]=j):j=e[36],v="Generated image",S=i,_="idle",x=p,g=F,N="flex flex-col gap-1 pb-2 pl-6",e[37]!==u?(y=u?.prompt&&n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:u.prompt}),e[37]=u,e[38]=y):y=e[38],k=L&&L.length>0&&n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.jsx("span",{className:"text-[11px] text-muted-foreground/50",children:"references:"}),L.map((z,A)=>{const P=z.uri??z.url;return n.jsx(zn,{uri:P,orgSlug:r.slug},A)})]})}e[4]=c,e[5]=u,e[6]=l,e[7]=i,e[8]=r,e[9]=o,e[10]=p,e[11]=d,e[12]=x,e[13]=g,e[14]=b,e[15]=h,e[16]=N,e[17]=y,e[18]=k,e[19]=j,e[20]=v,e[21]=S,e[22]=_}else d=e[11],x=e[12],g=e[13],b=e[14],h=e[15],N=e[16],y=e[17],k=e[18],j=e[19],v=e[20],S=e[21],_=e[22];if(h!==Symbol.for("react.early_return_sentinel"))return h;let w;e[39]!==N||e[40]!==y||e[41]!==k?(w=n.jsxs("div",{className:N,children:[y,k]}),e[39]=N,e[40]=y,e[41]=k,e[42]=w):w=e[42];let T;e[43]!==d||e[44]!==x||e[45]!==g||e[46]!==w||e[47]!==j||e[48]!==v||e[49]!==S||e[50]!==_?(T=n.jsx(d,{icon:j,title:v,summary:S,state:_,usage:x,trailing:g,children:w}),e[43]=d,e[44]=x,e[45]=g,e[46]=w,e[47]=j,e[48]=v,e[49]=S,e[50]=_,e[51]=T):T=e[51];let I;if(e[52]!==c||e[53]!==u?.prompt||e[54]!==r){let L;e[56]!==u?.prompt||e[57]!==r?(L=(R,F)=>{const z=R.uri??R.url;if(!z)return null;const A=zt(z,r.slug);return n.jsx(gt,{src:A,alt:u?.prompt??"Generated image",children:n.jsx("img",{src:A,alt:u?.prompt??"Generated image",className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"})},F)},e[56]=u?.prompt,e[57]=r,e[58]=L):L=e[58],I=c.map(L),e[52]=c,e[53]=u?.prompt,e[54]=r,e[55]=I}else I=e[55];let M;e[59]!==I?(M=n.jsx("div",{className:"flex flex-wrap gap-2",children:I}),e[59]=I,e[60]=M):M=e[60];let C;return e[61]!==b||e[62]!==T||e[63]!==M?(C=n.jsxs("div",{className:b,children:[T,M]}),e[61]=b,e[62]=T,e[63]=M,e[64]=C):C=e[64],C}function En(s){return s.uri??s.url}function Fn(s,e){const t=Me(s);return t!==null?`/api/${e}/files/${t}`:s}function On(s){const e=$.c(26),{part:t,latency:l}=s,r=De(),a=re(t.state),o=t.input,u=t.output,f=u?.image?.uri,c=u?.url??o?.url;let m;e[0]!==l?(m=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[0]=l,e[1]=m):m=e[1];const p=m;if(a==="loading"){let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ne,{size:14}),e[2]=j):j=e[2];let v;return e[3]!==c?(v=n.jsx(D,{icon:j,title:"Taking screenshot",summary:c,state:"loading"}),e[3]=c,e[4]=v):v=e[4],v}if(a==="error"||u?.success===!1||!f){let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(Ne,{size:14}),e[5]=j):j=e[5];const v=u?.error??"Failed";let S;return e[6]!==p||e[7]!==v?(S=n.jsx(D,{icon:j,title:"Take screenshot",summary:v,state:"error",trailing:p}),e[6]=p,e[7]=v,e[8]=S):S=e[8],S}let i;e[9]!==r.slug||e[10]!==f?(i=Fn(f,r.slug),e[9]=r.slug,e[10]=f,e[11]=i):i=e[11];const d=i;let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ne,{size:14,className:"text-blue-500"}),e[12]=x):x=e[12];let g;e[13]!==p||e[14]!==c?(g=n.jsx(D,{icon:x,title:"Screenshot",summary:c,state:"idle",trailing:p}),e[13]=p,e[14]=c,e[15]=g):g=e[15];const b=c??"Screenshot",h=c??"Screenshot";let N;e[16]!==d||e[17]!==h?(N=n.jsx("img",{src:d,alt:h,className:"max-w-sm max-h-80 object-contain rounded-lg border border-border hover:border-foreground/20 transition-colors"}),e[16]=d,e[17]=h,e[18]=N):N=e[18];let y;e[19]!==d||e[20]!==b||e[21]!==N?(y=n.jsx("div",{className:"flex flex-wrap gap-2",children:n.jsx(gt,{src:d,alt:b,children:N})}),e[19]=d,e[20]=b,e[21]=N,e[22]=y):y=e[22];let k;return e[23]!==g||e[24]!==y?(k=n.jsxs("div",{className:"flex flex-col gap-2",children:[g,y]}),e[23]=g,e[24]=y,e[25]=k):k=e[25],k}function Dn(s,e){const t=Me(s);return t!==null?`/api/${e}/files/${t}`:s}function Hn(s){if(!s?.usage)return null;const e=s.usage.inputTokens??0,t=s.usage.outputTokens??0,l=e+t;if(!l)return null;const r={providerMetadata:s.usage.providerMetadata};return{inputTokens:e,outputTokens:t,reasoningTokens:0,totalTokens:l,cost:_t(r),cacheReadTokens:0,cacheWriteTokens:0}}function Bn(s){try{return new URL(s).hostname.replace(/^www\./,"")}catch{return s}}function Wn(s){try{return`${new URL(s).origin}/favicon.ico`}catch{return""}}function Un(s){const e=$.c(16),{citation:t,index:l}=s;let r;e[0]!==t.url?(r=Bn(t.url),e[0]=t.url,e[1]=r):r=e[1];const a=r;let o;e[2]!==t.url?(o=Wn(t.url),e[2]=t.url,e[3]=o):o=e[3];const u=o,f=t.title||a;let c;e[4]!==u?(c=n.jsx("img",{src:u,alt:"",className:"size-3.5 rounded-sm shrink-0",onError:qn}),e[4]=u,e[5]=c):c=e[5];let m;e[6]!==f?(m=n.jsx("span",{className:"truncate max-w-[180px]",children:f}),e[6]=f,e[7]=m):m=e[7];const p=l+1;let i;e[8]!==p?(i=n.jsxs("span",{className:"text-[10px] text-muted-foreground/50 tabular-nums shrink-0",children:["[",p,"]"]}),e[8]=p,e[9]=i):i=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Nt,{size:10,className:"shrink-0 opacity-0 group-hover/src:opacity-100 transition-opacity"}),e[10]=d):d=e[10];let x;return e[11]!==t.url||e[12]!==c||e[13]!==m||e[14]!==i?(x=n.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group/src inline-flex items-center gap-1.5 rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:[c,m,i,d]}),e[11]=t.url,e[12]=c,e[13]=m,e[14]=i,e[15]=x):x=e[15],x}function qn(s){s.target.style.display="none"}function Vn(s,e){return s.replace(/\[(\d+)\]/g,(t,l)=>{const r=parseInt(l,10)-1,a=e[r];return a?`[\\[${l}\\]](${a.url})`:t})}const Ae=5;function Gn(s){const e=$.c(12),{citations:t}=s,[l,r]=H.useState(!1),a=t.length>Ae;let o;e[0]!==t||e[1]!==l?(o=l?t:t.slice(0,Ae),e[0]=t,e[1]=l,e[2]=o):o=e[2];const u=o;let f;e[3]!==u?(f=u.map(Jn),e[3]=u,e[4]=f):f=e[4];let c;e[5]!==t.length||e[6]!==l||e[7]!==a?(c=a&&n.jsx("button",{type:"button",onClick:()=>r(Kn),className:"inline-flex items-center rounded-md border border-border/50 bg-muted/30 px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted/60 hover:border-border hover:text-foreground",children:l?"show less":`+${t.length-Ae} more`}),e[5]=t.length,e[6]=l,e[7]=a,e[8]=c):c=e[8];let m;return e[9]!==f||e[10]!==c?(m=n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[f,c]}),e[9]=f,e[10]=c,e[11]=m):m=e[11],m}function Kn(s){return!s}function Jn(s,e){return n.jsx(Un,{citation:s,index:e},s.url)}function Xn(s){const e=$.c(51),{part:t,latency:l,streamingText:r}=s,a=De();let o;e[0]!==t.state?(o=re(t.state),e[0]=t.state,e[1]=o):o=e[1];const u=o,f=t.input,c=t.output;let m,p,i;e[2]!==a||e[3]!==c?(m=c?.uri?Dn(c.uri,a.slug):void 0,i=Oe,p=me.webSearchBlob(m??""),e[2]=a,e[3]=c,e[4]=m,e[5]=p,e[6]=i):(m=e[4],p=e[5],i=e[6]);let d;e[7]!==m?(d=async()=>{const U=await fetch(m);if(!U.ok)throw new Error(`Failed to fetch: ${U.status}`);return U.text()},e[7]=m,e[8]=d):d=e[8];const x=!!m;let g;e[9]!==p||e[10]!==d||e[11]!==x?(g={queryKey:p,queryFn:d,enabled:x,staleTime:1/0},e[9]=p,e[10]=d,e[11]=x,e[12]=g):g=e[12];const{data:b}=i(g),h=u==="loading",N=u!=="loading"&&u!=="error",y=c?.citations;let k;e[13]!==c?(k=Hn(c),e[13]=c,e[14]=k):k=e[14];const j=k,v=c?.content??b??r;let S;e[15]!==y||e[16]!==v?(S=v&&y?.length?Vn(v,y):v,e[15]=y,e[16]=v,e[17]=S):S=e[17];const _=S;let w;e[18]!==l?(w=l!=null&&l>0?n.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground/60",children:de(l)}):null,e[18]=l,e[19]=w):w=e[19];const T=w;if(u==="error"){let U;e[20]===Symbol.for("react.memo_cache_sentinel")?(U=n.jsx(Ce,{size:14}),e[20]=U):U=e[20];let B;return e[21]!==T||e[22]!==j?(B=n.jsx(D,{icon:U,title:"Web search",summary:"Failed",state:"error",usage:j,trailing:T}),e[21]=T,e[22]=j,e[23]=B):B=e[23],B}const I=h?"animate-pulse":"text-blue-500";let M;e[24]!==I?(M=V(I),e[24]=I,e[25]=M):M=e[25];let C;e[26]!==M?(C=n.jsx(Ce,{size:14,className:M}),e[26]=M,e[27]=C):C=e[27];const L=h?"Researching...":"Web search";let R;e[28]!==f||e[29]!==N||e[30]!==c?.model?(R=N?c?.model??f?.query?.slice(0,60):f?.query?`"${f.query.slice(0,80)}"`:void 0,e[28]=f,e[29]=N,e[30]=c?.model,e[31]=R):R=e[31];const F=h?"loading":"idle";let z;e[32]!==f?(z=f?.query&&n.jsx("p",{className:"text-xs text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:f.query}),e[32]=f,e[33]=z):z=e[33];let A;e[34]!==_||e[35]!==t.toolCallId?(A=_?n.jsx("div",{className:"max-h-96 overflow-y-auto overflow-x-hidden rounded-lg border border-border/40 bg-muted/20 px-4 py-3 min-w-0",children:n.jsx("div",{className:"prose prose-sm prose-neutral dark:prose-invert max-w-none text-[13px] leading-relaxed break-words",children:n.jsx(xt,{id:t.toolCallId,text:_})})}):n.jsx("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-4 py-3",children:n.jsxs("div",{className:"space-y-2 animate-pulse",children:[n.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-3/4"}),n.jsx("div",{className:"h-3 rounded bg-muted-foreground/10 w-1/2"})]})}),e[34]=_,e[35]=t.toolCallId,e[36]=A):A=e[36];let P;e[37]!==y?(P=y&&y.length>0&&n.jsx(Gn,{citations:y}),e[37]=y,e[38]=P):P=e[38];let O;e[39]!==z||e[40]!==A||e[41]!==P?(O=n.jsxs("div",{className:"pl-6 pb-3 flex flex-col gap-1 min-w-0",children:[z,A,P]}),e[39]=z,e[40]=A,e[41]=P,e[42]=O):O=e[42];let W;return e[43]!==T||e[44]!==C||e[45]!==L||e[46]!==R||e[47]!==F||e[48]!==O||e[49]!==j?(W=n.jsx(D,{icon:C,title:L,summary:R,state:F,usage:j,trailing:T,defaultOpen:!0,children:O}),e[43]=T,e[44]=C,e[45]=L,e[46]=R,e[47]=F,e[48]=O,e[49]=j,e[50]=W):W=e[50],W}function Qn(s){const e=$.c(14),{part:t}=s;if(!t.state.startsWith("output-"))return null;let l;e[0]!==t.input?.prompt?(l=t.input?.prompt?.trim()||"Question",e[0]=t.input?.prompt,e[1]=l):l=e[1];const r=l,a=t.state==="output-error"||t.state==="output-denied",o=t.state==="output-denied";let u;e[2]!==o||e[3]!==t?(u=o?"Skipped":t.state==="output-error"?Ke(t)??"Error":t.output?.response??"",e[2]=o,e[3]=t,e[4]=u):u=e[4];const f=u;let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(rs,{className:"size-4 text-muted-foreground/50 shrink-0 mt-0.5"}),e[5]=c):c=e[5];let m;e[6]!==r?(m=n.jsxs("div",{className:"flex items-start gap-2",children:[c,n.jsx("span",{className:"text-[14px] text-muted-foreground leading-snug",children:r})]}),e[6]=r,e[7]=m):m=e[7];let p;e[8]!==f||e[9]!==a?(p=f&&n.jsx("div",{className:"ml-6 pl-2 border-l border-border/50",children:n.jsx("span",{className:V("text-[14px] leading-snug",a?"text-muted-foreground/50 italic":"text-foreground/70"),children:f})}),e[8]=f,e[9]=a,e[10]=p):p=e[10];let i;return e[11]!==m||e[12]!==p?(i=n.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,p]}),e[11]=m,e[12]=p,e[13]=i):i=e[13],i}function Yn(s){if(s&&typeof s=="object"&&!Array.isArray(s)){const e=s;if(typeof e.text=="string"||typeof e.error=="string"||typeof e.finishReason=="string"){if(typeof e.error=="string"&&e.error.length>0)return`Subtask failed: ${e.error}`;const l=typeof e.text=="string"?e.text.trim():"",r=e.finishReason==="length";return l?(r?`[Subtask hit step limit — partial result below; consider narrowing the task.]
30
-
31
- `:"")+l:r?"[Subtask hit step limit before producing a final report. The subagent did work but ran out of steps. Narrow the task or increase the budget.]":"Subtask completed (no output)."}}return _n(s)}function Pt({part:s,subtaskMeta:e,latency:t}){const l=s.state==="input-streaming"||s.state==="input-available",r=s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-available"&&!s.preliminary,o=s.state==="output-error",u=re(s.state,"preliminary"in s?s.preliminary:!1),f=u==="approval"?"idle":u,c=l?"Starting subtask...":r?"Subtask running...":a?"Subtask completed":o?"Subtask failed":"Subtask",m=s.input?.prompt??"",p=s.state==="approval-requested"?"Awaiting approval...":m.length>120?m.slice(0,120)+"…":m,x=(o?Ke(s):Yn(s.output))??(l||r?"":"No output available"),g=`# Task
32
- ${s.input?.prompt??"No prompt provided"}
33
-
34
- # ${o?"Error":"Result"}
35
- ${x}`;return{fallbackTitle:c,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 c;e[4]!==o||e[5]!==u?(c=n.jsx(Ie,{icon:o,name:u,size:"2xs",className:"rounded-xs",fallbackIcon:f}),e[4]=o,e[5]=u,e[6]=c):c=e[6];const m=a?.title??l;let p;return e[7]!==r||e[8]!==c||e[9]!==m?(p=n.jsx(D,{icon:c,title:m,...r}),e[7]=r,e[8]=c,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(Be,{size:12}),"Approved"]}),e[2]=a,e[3]=f):f=e[3];let c;e[4]!==a||e[5]!==t.state?(c=!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]=c):c=e[6];let m;e[7]!==f||e[8]!==c?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,u,f,c]}),e[7]=f,e[8]=c,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 i;e[11]!==l?(i=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(Ge,{id:"plan-content",part:{type:"text",text:l}})})]}),e[11]=l,e[12]=i):i=e[12];let d;return e[13]!==m||e[14]!==i?(d=n.jsxs("div",{className:"my-1.5 flex flex-col gap-1",children:[m,i]}),e[13]=m,e[14]=i,e[15]=d):d=e[15],d}const Je={primary:"Primary",secondary:"Secondary",accent:"Accent",background:"Background",foreground:"Foreground"};function sl(s){return s.startsWith("http")?s:`https://${s}`}function nt(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 c;return e[12]!==r||e[13]!==f?(c=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]=c):c=e[14],c}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:`${Je[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:c,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 i=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]!==c?(h=r&&n.jsxs("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-foreground truncate",children:[r,c&&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]=c,e[13]=h):h=e[13];let N;e[14]!==a?(N=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]=N):N=e[15];let y;e[16]!==h||e[17]!==N?(y=n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h,N]}),e[16]=h,e[17]=N,e[18]=y):y=e[18];let k;e[19]!==b||e[20]!==y?(k=n.jsxs("div",{className:"flex items-center gap-4",children:[b,y]}),e[19]=b,e[20]=y,e[21]=k):k=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 v;e[24]!==i?(v=i.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(nt,{children:"Colors"}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-3",children:i.map(ul)})]}),e[24]=i,e[25]=v):v=e[25];let S;e[26]!==x?(S=x.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(nt,{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]!==v||e[29]!==S||e[30]!==k||e[31]!==j?(_=n.jsxs("div",{className:"p-5 flex flex-col gap-6",children:[k,j,v,S]}),e[28]=v,e[29]=S,e[30]=k,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:Je[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 c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ce,{className:"text-fuchsia-500"}),e[11]=c):c=e[11];const m=o?.name?`Brand set: ${o.name}`:"Brand context set",p=o?.domain;let i;e[12]!==l?(i=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[12]=l,e[13]=i):i=e[13];let d;e[14]!==m||e[15]!==p||e[16]!==i?(d=n.jsx(D,{icon:c,title:m,summary:p,state:"idle",trailing:i}),e[14]=m,e[15]=p,e[16]=i,e[17]=d):d=e[17];const x=o?.logo,g=o?.favicon,b=o?.name,h=o?.domain,N=o?.overview,y=o?.colors,k=o?.fonts;let j;e[18]!==h||e[19]!==N||e[20]!==y||e[21]!==k||e[22]!==x||e[23]!==g||e[24]!==b?(j=n.jsx(Ft,{logo:x,favicon:g,name:b,domain:h,overview:N,colors:y,fonts:k}),e[18]=h,e[19]=N,e[20]=y,e[21]=k,e[22]=x,e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;return e[26]!==j||e[27]!==d?(v=n.jsxs(n.Fragment,{children:[d,j]}),e[26]=j,e[27]=d,e[28]=v):v=e[28],v}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 c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ce,{className:"text-fuchsia-500"}),e[8]=c):c=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 i;e[11]!==o.domain||e[12]!==m||e[13]!==p?(i=n.jsx(D,{icon:c,title:m,summary:o.domain,state:"idle",trailing:p}),e[11]=o.domain,e[12]=m,e[13]=p,e[14]=i):i=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]!==i||e[25]!==d?(x=n.jsxs(n.Fragment,{children:[i,d]}),e[24]=i,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,c;if(e[2]!==l||e[3]!==t.output||e[4]!==a){c=Symbol.for("react.early_return_sentinel");e:{const i=ve(t.output),d=Array.isArray(i?.items)?i.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],c=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 k;e[11]!==l?(k=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[11]=l,e[12]=k):k=e[12];let j;e[13]!==k?(j=n.jsx(D,{icon:y,title:"Couldn't load brands",state:"error",trailing:k}),e[13]=k,e[14]=j):j=e[14],c=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 k;e[16]!==l?(k=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[16]=l,e[17]=k):k=e[17];let j;e[18]!==k?(j=n.jsx(D,{icon:y,title:"No brands yet",summary:"The organization hasn't set up any brand context.",state:"idle",trailing:k}),e[18]=k,e[19]=j):j=e[19],c=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 N;e[21]!==l?(N=l!=null&&l>0?n.jsx(te,{latency:l}):void 0,e[21]=l,e[22]=N):N=e[22],e[23]!==h||e[24]!==N?(f=n.jsx(D,{icon:b,title:h,state:"idle",trailing:N}),e[23]=h,e[24]=N,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]=c}else o=e[5],u=e[6],f=e[7],c=e[8];if(c!==Symbol.for("react.early_return_sentinel"))return c;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:`${Je[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,c,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?(c=V("flex items-center justify-end -space-x-2",a),e[7]=a,e[8]=c):c=e[8];let x;e[9]!==u?(x=g=>n.jsx(H.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]=c,e[6]=m}else f=e[4],c=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 i;return e[14]!==c||e[15]!==m||e[16]!==p?(i=n.jsxs("div",{className:c,children:[m,p]}),e[14]=c,e[15]=m,e[16]=p,e[17]=i):i=e[17],i}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. ",lt=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=H.useRef(null),u=H.useRef(null),f=H.useRef(null),c=H.useRef(null),m=H.useRef(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{lt?.matches||(m.current=o.current?.getBoundingClientRect()??null,o.current&&(o.current.style.willChange="transform"))},e[0]=p):p=e[0];const i=p;let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=E=>{if(lt?.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"),c.current&&(c.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"),c.current&&(c.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,N,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}N=(h.connections??[]).map(Nl)}e[11]=l,e[12]=t.output,e[13]=h,e[14]=N,e[15]=y}else h=e[13],N=e[14],y=e[15];if(y!==Symbol.for("react.early_return_sentinel"))return y;const k=N;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 v=`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]!==v||e[23]!==S?(_=n.jsx(D,{icon:j,title:v,state:"idle",trailing:S}),e[22]=v,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:c,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(it,{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]!==k?(W=k.length>0&&n.jsx(H.Suspense,{fallback:n.jsx(Se.Fallback,{iconSize:"xs",maxVisibleIcons:3,totalCount:k.length}),children:n.jsx(Se,{connectionIds:k,iconSize:"xs",maxVisibleIcons:3,className:"flex items-center justify-start -space-x-1"})}),e[45]=k,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 B;e[49]!==h.id||e[50]!==r?(B=()=>r(h.id),e[49]=h.id,e[50]=r,e[51]=B):B=e[51];const Y=`See agent: ${h.title}`;let K;e[52]!==B||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:B,"aria-label":Y,children:"See agent"})}),e[52]=B,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:i,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(it,{icon:t.icon,name:t.title,size:"sm"}),e[7]=t.icon,e[8]=t.title,e[9]=f):f=e[9];let c;e[10]!==t.title?(c=n.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.title}),e[10]=t.title,e[11]=c):c=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]!==c||e[15]!==m?(p=n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[c,m]}),e[14]=c,e[15]=m,e[16]=p):p=e[16];let i;e[17]!==o?(i=o.length>0&&n.jsx(H.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]=i):i=e[18];let d;return e[19]!==u||e[20]!==f||e[21]!==p||e[22]!==i?(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,i]}),e[19]=u,e[20]=f,e[21]=p,e[22]=i,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,c,m,p,i,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(c=Array.isArray(h?.items)?h.items:[],u==="loading"){let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(ie,{className:"animate-pulse"}),title:"Loading agents",state:"loading"}),e[12]=v):v=e[12],d=v;break e}if(u==="approval"){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(ie,{}),title:"List agents",state:"idle"}),e[13]=v):v=e[13],d=v;break e}if(u==="error"){let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(ie,{}),e[14]=v):v=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:v,title:S,state:"error",trailing:_}),e[17]=S,e[18]=_,e[19]=w):w=e[19],d=w;break e}if(c.length===0){let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(ie,{}),e[20]=v):v=e[20];let S;e[21]!==l?(S=n.jsx(D,{icon:v,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 N=c.slice(0,Lt);f=c.length-N.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 k=c.length===1?"1 agent":`${c.length} agents`;let j;e[24]!==l?(j=n.jsx(te,{latency:l}),e[24]=l,e[25]=j):j=e[25],e[26]!==k||e[27]!==j?(i=n.jsx(D,{icon:y,title:k,state:"idle",trailing:j}),e[26]=k,e[27]=j,e[28]=i):i=e[28],m="mt-2 flex flex-col gap-1.5",p=N.map(wl)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=c,e[8]=m,e[9]=p,e[10]=i,e[11]=d}else f=e[6],c=e[7],m=e[8],p=e[9],i=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[29]!==f||e[30]!==c||e[31]!==r||e[32]!==a?(x=f>0&&n.jsx(Rt,{count:c.length,noun:"agents",onClick:()=>r({to:"/$org/settings/agents",params:{org:a.slug}})}),e[29]=f,e[30]=c,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]!==i||e[39]!==g?(b=n.jsxs(n.Fragment,{children:[i,g]}),e[38]=i,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 c;e[4]!==t.icon||e[5]!==t.title?(c=n.jsx(Ie,{icon:t.icon,name:t.title,size:"sm"}),e[4]=t.icon,e[5]=t.title,e[6]=c):c=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 i;e[11]!==m||e[12]!==p?(i=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]=i):i=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]!==c||e[24]!==i||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:[c,i,g,b]}),e[20]=u,e[21]=b,e[22]=f,e[23]=c,e[24]=i,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,c,m,p,i,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(c=(Array.isArray(h?.items)?h.items:[]).filter(Ml),u==="loading"||u==="approval"){let v;e[12]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(D,{icon:n.jsx(we,{className:"animate-pulse"}),title:"Loading connections",state:"loading"}),e[12]=v):v=e[12],d=v;break e}if(u==="error"){let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(we,{}),e[13]=v):v=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:v,title:S,state:"error",trailing:_}),e[16]=S,e[17]=_,e[18]=w):w=e[18],d=w;break e}if(c.length===0){let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(we,{}),e[19]=v):v=e[19];let S;e[20]!==l?(S=n.jsx(D,{icon:v,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 N=c.slice(0,Lt);f=c.length-N.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 k=c.length===1?"1 connection":`${c.length} connections`;let j;e[23]!==l?(j=n.jsx(te,{latency:l}),e[23]=l,e[24]=j):j=e[24],e[25]!==k||e[26]!==j?(i=n.jsx(D,{icon:y,title:k,state:"idle",trailing:j}),e[25]=k,e[26]=j,e[27]=i):i=e[27],m="mt-2 flex flex-col gap-1.5",p=N.map(Il)}e[2]=l,e[3]=t.output,e[4]=t.state,e[5]=u,e[6]=f,e[7]=c,e[8]=m,e[9]=p,e[10]=i,e[11]=d}else f=e[6],c=e[7],m=e[8],p=e[9],i=e[10],d=e[11];if(d!==Symbol.for("react.early_return_sentinel"))return d;let x;e[28]!==f||e[29]!==c||e[30]!==r||e[31]!==a?(x=f>0&&n.jsx(Rt,{count:c.length,noun:"connections",onClick:()=>r({to:"/$org/settings/connections",params:{org:a.slug}})}),e[28]=f,e[29]=c,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]!==i||e[38]!==g?(b=n.jsxs(n.Fragment,{children:[i,g]}),e[37]=i,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 c;s[0]!==a.id||s[1]!==a.slug||s[2]!==f?(c={connectionId:f,orgId:a.id,orgSlug:a.slug},s[0]=a.id,s[1]=a.slug,s[2]=f,s[3]=c):c=s[3];const m=Ue(c),[p,i]=H.useState(null);if(!o||l||!Ss(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 Hs(m,C.name,L);await t({type:"doc",content:[{type:"paragraph",content:[$t({id:C.name,name:Ve(C.name,qe(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 N;s[12]!==g._meta||s[13]!==g.arguments||s[14]!==g.description||s[15]!==g.promptName||s[16]!==g.title||s[17]!==h?(N=()=>{const C={name:g.promptName,title:g.title,description:g.description,arguments:g.arguments,_meta:g._meta};if(C.arguments&&C.arguments.length>0){i(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]=N):N=s[18];const y=N;let k,j;s[19]===Symbol.for("react.memo_cache_sentinel")?(k=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]=k,s[20]=j):(k=s[19],j=s[20]);let v;s[21]!==g.title?(v=n.jsx("span",{className:"truncate",children:g.title}),s[21]=g.title,s[22]=v):v=s[22];let S;s[23]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(ct,{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]!==v?(_=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:[k,j,v,S]}),s[24]=y,s[25]=v,s[26]=_):_=s[26];let w;s[27]===Symbol.for("react.memo_cache_sentinel")?(w=C=>i(C),s[27]=w):w=s[27];let T;s[28]!==p||s[29]!==h?(T=async C=>{const L=p;i(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 c=`deck:${f.path}`;e.has(c)||e.set(c,{tabId:Ts(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 c="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 i;s[4]!==p?(i=n.jsx("div",{className:c,children:p}),s[4]=p,s[5]=i):i=s[5];let d;return s[6]!==f||s[7]!==i?(d=n.jsxs("div",{className:u,children:[f,i]}),s[6]=f,s[7]=i,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 ha(){const s=$.c(2),e=$e()?.messages??[];let t;return s[0]!==e?(t=e.some(Hl),s[0]=e,s[1]=t):t=s[1],t}function Hl(s){return s.parts?.some(Bl)}function Bl(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:Cs(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 c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(vt,{className:"size-3.5"}),e[8]=c):c=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:c}),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 i;return e[15]!==o||e[16]!==u||e[17]!==m||e[18]!==p?(i=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]=i):i=e[19],i}function ot(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?ot(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(ot(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(i=>r.has(i.filename));if(f.length===0)return null;const c="flex flex-col gap-1.5 py-2",m=f.map(Kl);let p;return e[2]!==m?(p=n.jsx("div",{className:c,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 c=s.parts[f];if(Jl(c)){u||(u={parts:[],startIndex:f},e.push(u)),u.parts.push(c),t.add(f);continue}if(u=null,c.type==="data-tool-metadata"&&"id"in c&&"data"in c){const m=c.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(c.id,p);continue}if(c.type==="data-tool-subtask-metadata"&&"id"in c){r.set(c.id,c.data);continue}if(c.type==="data-web-search"&&"id"in c&&"data"in c){const m=c.id,p=c.data;a.set(m,p.text??"");continue}}}const o=[];if(s){let u=[],f=[];const c=new Set,m=()=>{for(const p of u)c.has(p)||(c.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 i=s.parts[p];if(i.type==="step-start"){m();continue}if(t.has(p)){const d=e.find(x=>x.startIndex===p);d&&u.push(d);continue}i.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=()=>Ye(t,Date.now()),e[0]=t,e[1]=l):l=e[1];const[r,a]=H.useState(l);let o,u;e[2]!==t?(o=()=>{const p=setInterval(()=>a(Ye(t,Date.now())),100);return()=>clearInterval(p)},u=[t],e[2]=t,e[3]=o,e[4]=u):(o=e[3],u=e[4]),H.useEffect(o,u);const f=r/1e3;let c;e[5]!==f?(c=de(f),e[5]=f,e[6]=c):c=e[6];let m;return e[7]!==c?(m=n.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:c}),e[7]=c,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]=H.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(He,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},to=1200;function so(){const s=$.c(7),[e,t]=H.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]),H.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 c;if(e[4]!==o||e[5]!==r||e[6]!==l){const y=l.map(ao).join(`
36
- `).trim().split(`
37
- `).filter(Boolean),k=r?y[y.length-1]??"":y[0]??"";c=!o&&k?k.length>100?k.slice(0,100)+"…":k:void 0,e[4]=o,e[5]=r,e[6]=l,e[7]=c}else c=e[7];const m=c;let p;if(e[8]!==o||e[9]!==l){const N=l.map(oo).join(`
38
-
39
- `);p=!o&&N.trim()?N:null,e[8]=o,e[9]=l,e[10]=p}else p=e[10];const i=p,d=!r&&t!=null?t/1e3:void 0;let x;e[11]!==r?(x=r?n.jsx(He,{className:"size-4"}):n.jsx(ls,{className:"size-4"}),e[11]=r,e[12]=x):x=e[12];const g=r?"Thinking...":f,b=r?"loading":"idle";let h;return e[13]!==i||e[14]!==d||e[15]!==m||e[16]!==x||e[17]!==g||e[18]!==b?(h=n.jsx(D,{icon:x,title:g,summary:m,detail:i,state:b,detailVariant:"prose",latency:d}),e[13]=i,e[14]=d,e[15]=m,e[16]=x,e[17]=g,e[18]=b,e[19]=h):h=e[19],h}function oo(s){return s.text??""}function ao(s){return s.text??""}function ro(s){return s.text?.includes("REDACTED")}const io=3;function co(s,e){let t=-1;for(let l=s.length-1;l>=0;l--){const r=s[l];if(r.kind==="part"&&e[r.index]?.type==="text"){t=l;break}}return t===-1?{collapsed:[],tail:s}:{collapsed:s.slice(0,t),tail:s.slice(t)}}function uo(s,e){let t=0,l=0;for(const r of s)if(r.kind==="reasoning-group")l++;else{const a=e[r.index]?.type;a==="text"?l++:(a==="dynamic-tool"||a?.startsWith("tool-"))&&a!=="tool-todo_write"&&a!=="tool-update_interests"&&t++}return{toolCalls:t,messages:l}}function fo(s){const e=$.c(8),{toolCalls:t,messages:l}=s;let r;e[0]!==l||e[1]!==t?(r=t>0&&n.jsxs(n.Fragment,{children:[n.jsx(is,{className:"size-3.5 shrink-0"}),n.jsxs("span",{children:[t," tool call",t===1?"":"s",l>0?",":""]})]}),e[0]=l,e[1]=t,e[2]=r):r=e[2];let a;e[3]!==l?(a=l>0&&n.jsxs(n.Fragment,{children:[n.jsx(os,{className:"size-3.5 shrink-0"}),n.jsxs("span",{children:[l," message",l===1?"":"s"]})]}),e[3]=l,e[4]=a):a=e[4];let o;return e[5]!==r||e[6]!==a?(o=n.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[r,a]}),e[5]=r,e[6]=a,e[7]=o):o=e[7],o}function mo(s){const e=$.c(28),{items:t,message:l,reasoningGroups:r,isReasoningActive:a,totalDuration:o,dataParts:u,isLoading:f,isLast:c}=s;let m;e[0]!==t||e[1]!==l.parts?(m=uo(t,l.parts),e[0]=t,e[1]=l.parts,e[2]=m):m=e[2];const{toolCalls:p,messages:i}=m;if(p===0&&i===0)return null;let d;e[3]!==i||e[4]!==p?(d=n.jsx(fo,{toolCalls:p,messages:i}),e[3]=i,e[4]=p,e[5]=d):d=e[5];let x;if(e[6]!==u||e[7]!==c||e[8]!==f||e[9]!==a||e[10]!==t||e[11]!==l||e[12]!==r||e[13]!==o){let h;e[15]!==u||e[16]!==c||e[17]!==f||e[18]!==a||e[19]!==l||e[20]!==r||e[21]!==o?(h=(N,y)=>Dt({item:N,renderIndex:y,message:l,reasoningGroups:r,isReasoningActive:a,totalDuration:o,dataParts:u,isLoading:f,isLast:c,isLastVisiblePart:!1}),e[15]=u,e[16]=c,e[17]=f,e[18]=a,e[19]=l,e[20]=r,e[21]=o,e[22]=h):h=e[22],x=t.map(h),e[6]=u,e[7]=c,e[8]=f,e[9]=a,e[10]=t,e[11]=l,e[12]=r,e[13]=o,e[14]=x}else x=e[14];let g;e[23]!==x?(g=n.jsx("div",{className:"flex flex-col gap-3 sm:gap-2 pt-1",children:x}),e[23]=x,e[24]=g):g=e[24];let b;return e[25]!==d||e[26]!==g?(b=n.jsx(D,{icon:null,alwaysChevron:!0,title:d,state:"idle",children:g}),e[25]=d,e[26]=g,e[27]=b):b=e[27],b}function Dt({item:s,renderIndex:e,message:t,reasoningGroups:l,isReasoningActive:r,totalDuration:a,dataParts:o,isLoading:u,isLast:f,isLastVisiblePart:c,renderOrder:m}){if(s.kind==="reasoning-group"){const{group:x}=s,g=x===l[l.length-1],b=r&&g;if(!x.parts.some(y=>y.text?.trim())&&!b)return null;const N=l.length===1?a:null;return n.jsx(lo,{duration:N,parts:x.parts,isStreaming:b},`${t.id}-reasoning-${x.startIndex}`)}const p=t.parts[s.index],i=c||(m?m.findLastIndex(x=>x.kind==="part")===e:!1),d=i?Tt(wt(),t.metadata?.usage):null;return n.jsx(po,{part:p,id:t.id,usageStats:i&&n.jsx(hn,{usage:d,duration:a}),dataParts:o,isLoading:u,isLastMessage:f},`${t.id}-${s.index}`)}function po(s){const e=$.c(121),{part:t,id:l,usageStats:r,dataParts:a,isLoading:o,isLastMessage:u}=s;let f;e[0]!==a.toolMetadata?(f=i=>a.toolMetadata.get(i),e[0]=a.toolMetadata,e[1]=f):f=e[1];const c=f;let m;e[2]!==a.toolSubtaskMetadata?(m=i=>a.toolSubtaskMetadata.get(i),e[2]=a.toolSubtaskMetadata,e[3]=m):m=e[3];const p=m;switch(t.type){case"dynamic-tool":{let i;e[4]!==c||e[5]!==t.toolCallId?(i=c(t.toolCallId)?.annotations,e[4]=c,e[5]=t.toolCallId,e[6]=i):i=e[6];let d;e[7]!==c||e[8]!==t.toolCallId?(d=c(t.toolCallId)?.latencySeconds,e[7]=c,e[8]=t.toolCallId,e[9]=d):d=e[9];let x;e[10]!==c||e[11]!==t.toolCallId?(x=c(t.toolCallId)?.outputBytes,e[10]=c,e[11]=t.toolCallId,e[12]=x):x=e[12];let g;e[13]!==c||e[14]!==t.toolCallId?(g=c(t.toolCallId)?._meta,e[13]=c,e[14]=t.toolCallId,e[15]=g):g=e[15];let b;return e[16]!==u||e[17]!==t||e[18]!==i||e[19]!==d||e[20]!==x||e[21]!==g?(b=n.jsx(tt,{part:t,annotations:i,latency:d,outputBytes:x,isLastMessage:u,toolMeta:g}),e[16]=u,e[17]=t,e[18]=i,e[19]=d,e[20]=x,e[21]=g,e[22]=b):b=e[22],b}case"tool-todo_write":return null;case"tool-update_interests":return null;case"tool-user_ask":{let i;e[23]!==c||e[24]!==t.toolCallId?(i=c(t.toolCallId)?.latencySeconds,e[23]=c,e[24]=t.toolCallId,e[25]=i):i=e[25];let d;return e[26]!==t||e[27]!==i?(d=n.jsx(Qn,{part:t,latency:i}),e[26]=t,e[27]=i,e[28]=d):d=e[28],d}case"tool-propose_plan":{let i;return e[29]!==t?(i=n.jsx(tl,{part:t}),e[29]=t,e[30]=i):i=e[30],i}case"tool-generate_image":{let i;e[31]!==c||e[32]!==t.toolCallId?(i=c(t.toolCallId)?.latencySeconds,e[31]=c,e[32]=t.toolCallId,e[33]=i):i=e[33];let d;return e[34]!==t||e[35]!==i?(d=n.jsx(Pn,{part:t,latency:i}),e[34]=t,e[35]=i,e[36]=d):d=e[36],d}case"tool-take_screenshot":{let i;e[37]!==c||e[38]!==t.toolCallId?(i=c(t.toolCallId)?.latencySeconds,e[37]=c,e[38]=t.toolCallId,e[39]=i):i=e[39];let d;return e[40]!==t||e[41]!==i?(d=n.jsx(On,{part:t,latency:i}),e[40]=t,e[41]=i,e[42]=d):d=e[42],d}case"tool-web_search":{let i;e[43]!==c||e[44]!==t.toolCallId?(i=c(t.toolCallId)?.latencySeconds,e[43]=c,e[44]=t.toolCallId,e[45]=i):i=e[45];let d;e[46]!==a.webSearchStreaming||e[47]!==t.toolCallId?(d=a.webSearchStreaming.get(t.toolCallId),e[46]=a.webSearchStreaming,e[47]=t.toolCallId,e[48]=d):d=e[48];let x;return e[49]!==t||e[50]!==i||e[51]!==d?(x=n.jsx(Xn,{part:t,latency:i,streamingText:d}),e[49]=t,e[50]=i,e[51]=d,e[52]=x):x=e[52],x}case"tool-subtask":{let i;e[53]!==p||e[54]!==t.toolCallId?(i=p(t.toolCallId),e[53]=p,e[54]=t.toolCallId,e[55]=i):i=e[55];let d;e[56]!==c||e[57]!==t.toolCallId?(d=c(t.toolCallId)?.annotations,e[56]=c,e[57]=t.toolCallId,e[58]=d):d=e[58];let x;e[59]!==c||e[60]!==t.toolCallId?(x=c(t.toolCallId)?.latencySeconds,e[59]=c,e[60]=t.toolCallId,e[61]=x):x=e[61];let g;e[62]!==t||e[63]!==i||e[64]!==d||e[65]!==x?(g={part:t,subtaskMeta:i,annotations:d,latency:x},e[62]=t,e[63]=i,e[64]=d,e[65]=x,e[66]=g):g=e[66];const b=g;let h;return e[67]!==b?(h=n.jsx(H.Suspense,{fallback:n.jsx(Zn,{...b}),children:n.jsx(el,{...b})}),e[67]=b,e[68]=h):h=e[68],h}case"text":{const i=!!r&&!o,d=o&&u;let x;return e[69]!==l||e[70]!==t||e[71]!==i||e[72]!==d||e[73]!==r?(x=n.jsx(Ge,{id:l,part:t,extraActions:r,copyable:!0,alwaysShowActions:i,animate:d}),e[69]=l,e[70]=t,e[71]=i,e[72]=d,e[73]=r,e[74]=x):x=e[74],x}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;case"data-tool-metadata":case"data-tool-subtask-metadata":case"data-generate-image":case"data-web-search":return null;default:{const i=t;if(i.type==="tool-brand_context_setup"||i.type==="tool-BRAND_CONTEXT_EXTRACT"){let d;e[75]!==i.toolCallId||e[76]!==c?(d=c(i.toolCallId)?.latencySeconds,e[75]=i.toolCallId,e[76]=c,e[77]=d):d=e[77];let x;return e[78]!==i||e[79]!==d?(x=n.jsx(ml,{part:i,latency:d}),e[78]=i,e[79]=d,e[80]=x):x=e[80],x}if(i.type==="tool-BRAND_CONTEXT_GET"){let d;e[81]!==i.toolCallId||e[82]!==c?(d=c(i.toolCallId)?.latencySeconds,e[81]=i.toolCallId,e[82]=c,e[83]=d):d=e[83];let x;return e[84]!==i||e[85]!==d?(x=n.jsx(pl,{part:i,latency:d}),e[84]=i,e[85]=d,e[86]=x):x=e[86],x}if(i.type==="tool-BRAND_CONTEXT_LIST"){let d;e[87]!==i.toolCallId||e[88]!==c?(d=c(i.toolCallId)?.latencySeconds,e[87]=i.toolCallId,e[88]=c,e[89]=d):d=e[89];let x;return e[90]!==i||e[91]!==d?(x=n.jsx(xl,{part:i,latency:d}),e[90]=i,e[91]=d,e[92]=x):x=e[92],x}if(i.type==="tool-COLLECTION_VIRTUAL_MCP_CREATE"){let d;e[93]!==i.toolCallId||e[94]!==c?(d=c(i.toolCallId)?.latencySeconds,e[93]=i.toolCallId,e[94]=c,e[95]=d):d=e[95];let x;return e[96]!==i||e[97]!==d?(x=n.jsx(vl,{part:i,latency:d}),e[96]=i,e[97]=d,e[98]=x):x=e[98],x}if(i.type==="tool-COLLECTION_VIRTUAL_MCP_LIST"){let d;e[99]!==i.toolCallId||e[100]!==c?(d=c(i.toolCallId)?.latencySeconds,e[99]=i.toolCallId,e[100]=c,e[101]=d):d=e[101];let x;return e[102]!==i||e[103]!==d?(x=n.jsx(_l,{part:i,latency:d}),e[102]=i,e[103]=d,e[104]=x):x=e[104],x}if(i.type==="tool-COLLECTION_CONNECTIONS_LIST"){let d;e[105]!==i.toolCallId||e[106]!==c?(d=c(i.toolCallId)?.latencySeconds,e[105]=i.toolCallId,e[106]=c,e[107]=d):d=e[107];let x;return e[108]!==i||e[109]!==d?(x=n.jsx($l,{part:i,latency:d}),e[108]=i,e[109]=d,e[110]=x):x=e[110],x}if(i.type.startsWith("tool-")){const d=i.toolCallId;let x;e[111]!==a.toolMetadata||e[112]!==d?(x=a.toolMetadata.get(d),e[111]=a.toolMetadata,e[112]=d,e[113]=x):x=e[113];const g=x,b=g?.annotations,h=g?.latencySeconds,N=g?.outputBytes,y=g?._meta;let k;return e[114]!==i||e[115]!==u||e[116]!==b||e[117]!==h||e[118]!==N||e[119]!==y?(k=n.jsx(tt,{part:i,annotations:b,latency:h,outputBytes:N,isLastMessage:u,toolMeta:y}),e[114]=i,e[115]=u,e[116]=b,e[117]=h,e[118]=N,e[119]=y,e[120]=k):k=e[120],k}if(i.type.startsWith("data-"))return null;throw new Error(`Unknown part type: ${i.type}`)}}}function xo(s){const e=$.c(2),{isRunInProgress:t}=s;if(t){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(He,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),n.jsx("span",{className:"text-[14px] text-muted-foreground shimmer",children:"Resuming task..."})]})}),e[0]=r):r=e[0],r}let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"text-[14px] text-muted-foreground/60 py-2",children:"No response was generated"}),e[1]=l):l=e[1],l}function go(s){const e=$.c(7),{className:t,children:l}=s;let r;e[0]!==t?(r=V("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",t),e[0]=t,e[1]=r):r=e[1];let a;e[2]!==l?(a=n.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:n.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[14px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:l})}),e[2]=l,e[3]=a):a=e[3];let o;return e[4]!==r||e[5]!==a?(o=n.jsx("div",{className:r,children:a}),e[4]=r,e[5]=a,e[6]=o):o=e[6],o}function ho(s){const e=$.c(42),{message:t,turnStartedAt:l,status:r,className:a,isLast:o}=s,u=o===void 0?!1:o,{isRunInProgress:f}=$e()??{},c=f===void 0?!1:f,m=We()?.taskId??null,p=r==="streaming",d=p||r==="submitted";let x;e[0]!==l?(x=us(l),e[0]=l,e[1]=x):x=e[1];const g=x;let b;e[2]!==d?(b=()=>d?Date.now():null,e[2]=d,e[3]=b):b=e[3];const[h,N]=H.useState(b),[y,k]=H.useState(d);y!==d&&(k(d),N(d?Date.now():null));const j=g??h,v=t!==null&&t.parts.length>0,{reasoningGroups:S,renderOrder:_,dataParts:w}=Xl(t),T=t&&t.parts.length>0?t.parts[t.parts.length-1]:null,I=p&&T?.type==="reasoning";let M;if(e[4]!==t){const B=t?.metadata?.reasoning_start_at?new Date(t.metadata.reasoning_start_at):null,Y=t?.metadata?.reasoning_end_at?new Date(t.metadata.reasoning_end_at):new Date;M=B!==null?Y.getTime()-B.getTime():null,e[4]=t,e[5]=M}else M=e[5];const C=M;let L;e[6]!==u||e[7]!==t?(L=!u||!t||!t.parts.some(yo),e[6]=u,e[7]=t,e[8]=L):L=e[8];const R=L;let F;e[9]!==v||e[10]!==d||e[11]!==R||e[12]!==t||e[13]!==_?(F=!d&&v&&R&&(()=>{let B=0;for(const Y of _)if(Y.kind==="part"){const K=t.parts[Y.index]?.type;(K==="dynamic-tool"||K?.startsWith("tool-"))&&B++}return B>=io})(),e[9]=v,e[10]=d,e[11]=R,e[12]=t,e[13]=_,e[14]=F):F=e[14];const z=F;let A,P,O;if(e[15]!==a||e[16]!==w||e[17]!==v||e[18]!==u||e[19]!==d||e[20]!==I||e[21]!==c||e[22]!==R||e[23]!==t||e[24]!==S||e[25]!==_||e[26]!==z||e[27]!==j||e[28]!==m||e[29]!==C){const{collapsed:B,tail:Y}=z?co(_,t.parts):{collapsed:[],tail:_};A=go,P=a,O=v?n.jsxs("div",{className:"flex flex-col gap-3 sm:gap-2",children:[B.length>0&&n.jsx(mo,{items:B,message:t,reasoningGroups:S,isReasoningActive:I,totalDuration:C,dataParts:w,isLoading:d,isLast:u}),Y.map((K,Q)=>{const X=B.length+Q,Z=Y.findLastIndex(bo)===Q;return Dt({item:K,renderIndex:X,message:t,reasoningGroups:S,isReasoningActive:I,totalDuration:C,dataParts:w,isLoading:d,isLast:u,isLastVisiblePart:Z,renderOrder:_})}),m&&n.jsx(Gl,{threadId:m,message:t}),u&&d&&j!==null&&n.jsx(no,{startedAt:j}),u&&!d&&m&&n.jsxs(n.Fragment,{children:[n.jsx(El,{}),R&&n.jsx(Ll,{})]})]}):d?n.jsx(so,{}):n.jsx(xo,{isRunInProgress:u&&c}),e[15]=a,e[16]=w,e[17]=v,e[18]=u,e[19]=d,e[20]=I,e[21]=c,e[22]=R,e[23]=t,e[24]=S,e[25]=_,e[26]=z,e[27]=j,e[28]=m,e[29]=C,e[30]=A,e[31]=P,e[32]=O}else A=e[30],P=e[31],O=e[32];let W;e[33]!==u||e[34]!==p||e[35]!==t?.parts?(W=u&&p&&n.jsx(zl,{parts:t?.parts}),e[33]=u,e[34]=p,e[35]=t?.parts,e[36]=W):W=e[36];let U;return e[37]!==A||e[38]!==W||e[39]!==P||e[40]!==O?(U=n.jsxs(A,{className:P,children:[O,W]}),e[37]=A,e[38]=W,e[39]=P,e[40]=O,e[41]=U):U=e[41],U}function bo(s){return s.kind==="part"}function yo(s){const e=s.type;if(e!=="dynamic-tool"&&!e?.startsWith("tool-"))return!1;const t=s.state;return t==="input-streaming"||t==="input-available"||t==="approval-requested"}function jo(s){const e=$.c(21),{event:t}=s,[l,r]=H.useState(!1);let a;e[0]!==t.data?(a=JSON.stringify(t.data,null,2),e[0]=t.data,e[1]=a):a=e[1];const o=a;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>r(vo),e[2]=u):u=e[2];let f,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(as,{className:"size-4 shrink-0 text-muted-foreground"}),c=n.jsx("span",{className:"font-medium",children:"Triggered by event"}),e[3]=f,e[4]=c):(f=e[3],c=e[4]);let m;e[5]!==t.type?(m=n.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:t.type}),e[5]=t.type,e[6]=m):m=e[6];const p=l&&"rotate-180";let i;e[7]!==p?(i=V("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",p),e[7]=p,e[8]=i):i=e[8];let d;e[9]!==i?(d=n.jsx(tn,{className:i}),e[9]=i,e[10]=d):d=e[10];let x;e[11]!==m||e[12]!==d?(x=n.jsxs("button",{type:"button",onClick:u,className:"flex w-full items-center gap-2 px-3 py-2 text-sm cursor-pointer",children:[f,c,m,d]}),e[11]=m,e[12]=d,e[13]=x):x=e[13];let g;e[14]!==t.source||e[15]!==l||e[16]!==o?(g=l&&n.jsxs("div",{className:"border-t border-border/60 px-3 py-2",children:[n.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:t.source}),n.jsx("pre",{className:"overflow-auto whitespace-pre-wrap break-words text-xs text-foreground",children:o})]}),e[14]=t.source,e[15]=l,e[16]=o,e[17]=g):g=e[17];let b;return e[18]!==g||e[19]!==x?(b=n.jsxs("div",{className:"rounded-lg border border-border/60 bg-background overflow-hidden text-left",children:[x,g]}),e[18]=g,e[19]=x,e[20]=b):b=e[20],b}function vo(s){return!s}const No=[xs.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1}),dn,xn];function ko(s){const e=$.c(5),{tiptapDoc:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={attributes:{class:"prose prose-sm max-w-none focus:outline-none"}},e[0]=l):l=e[0];let r;e[1]!==t?(r={extensions:No,content:t,editable:!1,editorProps:l},e[1]=t,e[2]=r):r=e[2];const a=ps(r);if(!a)return null;let o;return e[3]!==a?(o=n.jsx(gs,{editor:a,className:"[&_.ProseMirror]:outline-none [&_.ProseMirror]:cursor-text"}),e[3]=a,e[4]=o):o=e[4],o}function So(s){const e=$.c(33),{message:t,className:l,onScrollToPair:r}=s,{id:a,parts:o,metadata:u}=t,[f,c]=H.useState(!1),[m,p]=H.useState(!1),i=H.useRef(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=C=>{C&&!i.current&&(i.current=!0,p(C.scrollHeight>C.clientHeight))},e[0]=d):d=e[0];const x=d;if(!o||o.length===0)return null;let g;e[1]!==r?(g=()=>{c(!0),r?.()},e[1]=r,e[2]=g):g=e[2];const b=g,h=u?.tiptapDoc;let N;e[3]!==l?(N=V("message-block w-full min-w-0 relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",l),e[3]=l,e[4]=N):N=e[4];let y,k;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>c(!0),k=()=>c(!1),e[5]=y,e[6]=k):(y=e[5],k=e[6]);let j;e[7]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("div",{className:"absolute inset-0 bg-muted/75 rounded-lg pointer-events-none"}),e[7]=j):j=e[7];let v;e[8]!==f||e[9]!==m?(v=V("z-10 px-4 py-2 flex-1 transition-[max-height,opacity] duration-300 ease-out",f?"max-h-[50vh] overflow-auto opacity-100":V("max-h-[84px] overflow-hidden opacity-99",m&&"mask-b-from-1%")),e[8]=f,e[9]=m,e[10]=v):v=e[10];let S;if(e[11]!==a||e[12]!==o){let C;e[14]!==a?(C=(L,R)=>L.type==="data-trigger-event"?n.jsx(jo,{event:L.data},`${a}-${R}`):null,e[14]=a,e[15]=C):C=e[15],S=o.map(C),e[11]=a,e[12]=o,e[13]=S}else S=e[13];let _;e[16]!==h||e[17]!==a||e[18]!==u||e[19]!==o?(_=h?n.jsx(ko,{tiptapDoc:u.tiptapDoc}):o.map((C,L)=>C.type==="text"?o[L-1]?.type==="data-trigger-event"?null:n.jsx(Ge,{id:a,part:C},`${a}-${L}`):null),e[16]=h,e[17]=a,e[18]=u,e[19]=o,e[20]=_):_=e[20];let w;e[21]!==S||e[22]!==_?(w=n.jsxs("div",{className:"flex flex-col gap-2",children:[S,_]}),e[21]=S,e[22]=_,e[23]=w):w=e[23];let T;e[24]!==w||e[25]!==v?(T=n.jsx("div",{ref:x,className:v,children:w}),e[24]=w,e[25]=v,e[26]=T):T=e[26];let I;e[27]!==b||e[28]!==T?(I=n.jsxs("div",{tabIndex:0,onClick:b,onFocus:y,onBlur:k,className:"w-full border border-border/60 min-w-0 shadow-xs rounded-lg text-[14px] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[j,T]}),e[27]=b,e[28]=T,e[29]=I):I=e[29];let M;return e[30]!==I||e[31]!==N?(M=n.jsx(n.Fragment,{children:n.jsx("div",{className:N,children:I})}),e[30]=I,e[31]=N,e[32]=M):M=e[32],M}function ba(s){const e=[],t=s.filter(l=>l.role!=="system");for(let l=0;l<t.length;l++){const r=t[l];if(r)if(r.role==="user"){const a=t[l+1];a&&a.role==="assistant"?(e.push({user:r,assistant:a}),l++):e.push({user:r,assistant:null})}else r.role==="assistant"&&e.push({user:null,assistant:r})}return e}function ya(s){const e=$.c(18),{pair:t,isLastPair:l,status:r}=s,a=H.useRef(null),o=H.useRef(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a.current&&a.current.scrollIntoView({behavior:"smooth",block:"start"})},e[0]=u):u=e[0];const f=u;let c;e[1]!==l||e[2]!==r?(c=h=>{if(a.current=h,!l||!h||o.current)return;if(o.current=!0,r==="submitted"||r==="streaming"){h.scrollIntoView({behavior:"smooth",block:"start"});return}const N=h.closest("[data-chat-scroller]");N?N.scrollTop=N.scrollHeight:h.scrollIntoView({behavior:"instant",block:"start"})},e[1]=l,e[2]=r,e[3]=c):c=e[3];const m=c,p=!t.user&&"pt-8 sm:pt-6";let i;e[4]!==p?(i=V("flex flex-col pb-2 sm:pb-2",p),e[4]=p,e[5]=i):i=e[5];let d;e[6]!==t.user?(d=t.user&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"sticky top-0 z-50 w-full h-4 bg-background"}),n.jsx("div",{className:"sticky mb-8 sm:mb-6 top-4 z-50",children:n.jsx(So,{message:t.user,onScrollToPair:f})})]}),e[6]=t.user,e[7]=d):d=e[7];const x=t.user?.created_at??null;let g;e[8]!==l||e[9]!==t.assistant||e[10]!==r||e[11]!==x?(g=n.jsx(ho,{message:t.assistant,turnStartedAt:x,status:r,isLast:l}),e[8]=l,e[9]=t.assistant,e[10]=r,e[11]=x,e[12]=g):g=e[12];let b;return e[13]!==m||e[14]!==i||e[15]!==d||e[16]!==g?(b=n.jsxs("div",{ref:m,className:i,children:[d,g]}),e[13]=m,e[14]=i,e[15]=d,e[16]=g,e[17]=b):b=e[17],b}export{bn as C,xn as F,Yl as G,Ge as M,Ul as O,rn as P,ga as S,Wl as a,yn as b,ma as c,jn as d,$t as e,ln as f,qe as g,It as h,xa as i,pa as j,cn as k,dn as l,ba as m,ya as n,Ve as s,Ct as t,ha as u};
@@ -1 +0,0 @@
1
- import{r as B,e as D,j as s,q as X,f as Z,g as ee,d as te,b as ne,K as se,n as ie,O as le,l as oe,B as re}from"./index-CiRQNPVt.js";import{u as ae}from"./use-connection-DpxWBF4Y.js";import{S as ce,u as ue,j as de}from"./use-mcp-client-D0A6RZFw.js";import{a as me}from"./Settings02-CdJ0CKrL.js";import{P as z}from"./index-Dci2MWs9.js";const ge=B.createContext(null);function F(i){const e=D.c(3),{value:h,children:m}=i,t=h;let l;return e[0]!==m||e[1]!==t?(l=s.jsx(ge.Provider,{value:t,children:m}),e[0]=m,e[1]=t,e[2]=l):l=e[2],l}B.createContext(null);function fe(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 _e(i){const e=D.c(60),{bindingName:h,renderEmptyState:m}=i,{org:t,project:l}=X(),T=Z();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={strict:!1},e[0]=j):j=e[0];const{org:k,taskId:w,pluginId:g}=ee(j);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I={strict:!1},e[1]=I):I=e[1];const G=te(I).virtualmcpid;let P;e[2]!==h?(P={binding:h},e[2]=h,e[3]=P):P=e[3];const K=ae(P),{data:f}=ne.useSession();let _;e[4]!==t.id||e[5]!==t.slug?(_={connectionId:ce,orgId:t.id,orgSlug:t.slug},e[4]=t.id,e[5]=t.slug,e[6]=_):_=e[6];const O=ue(_);let x;e[7]!==g||e[8]!==l.id?(x=se.projectPluginConfig(l.id??"",g),e[7]=g,e[8]=l.id,e[9]=x):x=e[9];let p;e[10]!==g||e[11]!==l.id||e[12]!==O?(p=async()=>{const n=await O.callTool({name:"VIRTUAL_MCP_PLUGIN_CONFIG_GET",arguments:{virtualMcpId:l.id,pluginId:g}});return n.structuredContent??n},e[10]=g,e[11]=l.id,e[12]=O,e[13]=p):p=e[13];const q=!!l.id&&!!g;let v;e[14]!==x||e[15]!==p||e[16]!==q?(v={queryKey:x,queryFn:p,enabled:q},e[14]=x,e[15]=p,e[16]=q,e[17]=v):v=e[17];const{data:V,isLoading:Q}=ie(v),R=V?.config?.connectionId,C=R?K.find(n=>n.id===R):null,y=de({connectionId:C?.id,orgId:t.id,orgSlug:t.slug});let S;e[18]!==f?(S=f?.user?{user:{id:f.user.id,name:f.user.name,email:f.user.email,image:f.user.image}}:null,e[18]=f,e[19]=S):S=e[19];const a=S;let b;e[20]!==t.id||e[21]!==t.name||e[22]!==t.slug?(b={id:t.id,slug:t.slug,name:t.name},e[20]=t.id,e[21]=t.name,e[22]=t.slug,e[23]=b):b=e[23];const c=b;if(Q){let n;return e[24]===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[24]=n):n=e[24],n}if(K.length===0){let n;e[25]!==c||e[26]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[25]=c,e[26]=a,e[27]=n):n=e[27];const u=n;let r;e[28]!==m?(r=m(),e[28]=m,e[29]=r):r=e[29];let o;e[30]!==r?(o=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r}),e[30]=r,e[31]=o):o=e[31];let d;return e[32]!==u||e[33]!==o?(d=s.jsx(F,{value:u,children:o}),e[32]=u,e[33]=o,e[34]=d):d=e[34],d}if(!C){let n;e[35]!==c||e[36]!==a?(n={connectionId:null,connection:null,toolCaller:null,org:c,session:a},e[35]=c,e[36]=a,e[37]=n):n=e[37];const u=n;let r;e[38]===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(me,{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[38]=r):r=e[38];let o;e[39]!==T||e[40]!==t.slug||e[41]!==k||e[42]!==l.id||e[43]!==w||e[44]!==G?(o=s.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[r,s.jsx(re,{onClick:()=>{const H=k??t.slug,J=G??l.id??"",W=w??crypto.randomUUID();T({to:"/$org/$taskId",params:{org:H,taskId:W},search:{virtualmcpid:J,main:"settings"}})},children:"Go to Project Settings"})]}),e[39]=T,e[40]=t.slug,e[41]=k,e[42]=l.id,e[43]=w,e[44]=G,e[45]=o):o=e[45];let d;return e[46]!==u||e[47]!==o?(d=s.jsx(F,{value:u,children:o}),e[46]=u,e[47]=o,e[48]=d):d=e[48],d}const Y=C.id,U=fe(C);let N;e[49]!==y?(N=(n,u)=>y?y.callTool({name:n,arguments:u}).then(xe):Promise.reject(new Error("MCP client is not available")),e[49]=y,e[50]=N):N=e[50];const $=N;let E;e[51]!==C||e[52]!==c||e[53]!==a||e[54]!==U||e[55]!==$?(E={connectionId:Y,connection:U,toolCaller:$,org:c,session:a},e[51]=C,e[52]=c,e[53]=a,e[54]=U,e[55]=$,e[56]=E):E=e[56];const A=E;let L;e[57]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(z,{children:s.jsx(z.Content,{children:s.jsx(le,{})})}),e[57]=L):L=e[57];let M;return e[58]!==A?(M=s.jsx(F,{value:A,children:L}),e[58]=A,e[59]=M):M=e[59],M}function xe(i){return i.structuredContent??i}export{_e as P};
@@ -1 +0,0 @@
1
- import{e as H,q as $,j}from"./index-CiRQNPVt.js";import{h as q,g as O,s as b}from"./pair-CpEuUIpQ.js";import{u as v}from"./use-mcp-client-D0A6RZFw.js";import{a as L,c as B}from"./use-mcp-tools-BTzw-W77.js";import{c as Y}from"./content-blocks-o63cs2vh.js";import{g as k,M as G,a as E}from"./types-Df_Z2FUK.js";import{a as V,c as z}from"./chat-context-BFmJRDzy.js";import{u as F}from"./shell-layout-3b4NfWya.js";import"./agent-icon-DAPplz1A.js";import"./AlertCircle-BDfUS-lh.js";import"./Tool01-R6WyaXsu.js";import"./SwitchHorizontal01-BI_yHGXL.js";import"./RefreshCcw01-Dncu-kYd.js";import"./XCircle-D_3MYOn4.js";import"./ArrowUpRight-8daK_Mrm.js";import"./ZapSquare-CP91cLS8.js";import"./Users03-Bek4Ag3W.js";import"./CheckCircle-B_rVd_l8.js";import"./Check-C9-fsV6-.js";import"./ChevronDown--2U1gfXf.js";import"./ChevronLeft-TttN4toV.js";import"./ChevronRight-BVEygGVH.js";import"./ChevronUp-C-xaVM7d.js";import"./DotsVertical-Q3F6UWC_.js";import"./Container-Bso4WS0x.js";import"./Eye-CKz6zS_m.js";import"./ZoomOut-CaG3Pd1Z.js";import"./Globe01-iupU5eqh.js";import"./FilterLines-SKQT-eWL.js";import"./Star01-CN33xE6w.js";import"./Palette-CS36Icvl.js";import"./HardDrive-DpuvbJvr.js";import"./Stars02-B4CoQ82E.js";import"./Key01-6eW9IRFT.js";import"./LayoutLeft-BkxKKkMX.js";import"./LinkExternal01-BXhdtlT7.js";import"./Monitor01-DUICZH5i.js";import"./Sun-CEzPQTAJ.js";import"./Play-CbbqvWPd.js";import"./Plus-CSNkL1o7.js";import"./SearchMd-B-q2EsGW.js";import"./Settings02-CdJ0CKrL.js";import"./Shield01-Crgp73nV.js";import"./Stars01-BXO9Nc4-.js";import"./Trash01-C3pnsiws.js";import"./Upload01-BHsRhr7X.js";import"./User01-JuGE_kA7.js";import"./Users01-BVUwP6xk.js";import"./XClose-Da5LgJSi.js";import"./X-BdwzFded.js";import"./Zap-DHBAOmqP.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-verb-Y8E.js";import"./select-BMX9jvQG.js";import"./tooltip-C47QSg8i.js";import"./use-copy-B_uLjrw6.js";import"./file-type-icon-7TqtrpuQ.js";import"./dialog-Cwf6uY_y.js";import"./tab-id-C7unjelb.js";import"./decopilot-sse-pool-BHhoQKaF.js";import"./create-sse-subscription-BS5983N4.js";import"./integration-icon-vaGvNHHz.js";import"./use-virtual-mcp-DciRKx1X.js";import"./use-collections-B1Mg9Y32.js";import"./use-navigate-to-agent-Drh7z3D_.js";import"./use-connection-DpxWBF4Y.js";import"./use-mcp-prompts-BuV5LRNr.js";import"./form-Bbpyf2N_.js";import"./label-DLUhXNk7.js";import"./input-D3E6n6la.js";import"./spinner-_hqWpG0c.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-Bwbur0GT.js";import"./use-organization-settings-PADdytdf.js";import"./avatar-BqNGZrFg.js";import"./required-auth-layout-BE5eceMw.js";import"./useRouterState-BXwm4DCl.js";import"./use-org-sso-nq4qWMpD.js";const J={};function K(S){const t=H.c(37),{client:r,resourceURI:g,tool:e,connectionId:s,orgId:a,args:c}=S,{sendMessage:u}=V(),{setAppContext:d,clearAppContext:o}=z(),{setChatOpen:f,openTab:m}=F(),p=`${s}:${e.name}`;let l;t[0]!==m?(l=h=>h==="inline"?(m("0"),"inline"):"fullscreen",t[0]=m,t[1]=l):l=t[1];const i=l,n=c??J;let T;t[2]!==r||t[3]!==e.name||t[4]!==n?(T={client:r,toolName:e.name,toolArguments:n},t[2]=r,t[3]=e.name,t[4]=n,t[5]=T):T=t[5];const{data:x}=B(T);let R;if(t[6]!==e._meta||t[7]!==e.name){const h=O(e._meta);R=b(e.name,h),t[6]=e._meta,t[7]=e.name,t[8]=R}else R=t[8];const U=R;let I;t[9]!==e.inputSchema?(I=e.inputSchema??{type:"object"},t[9]=e.inputSchema,t[10]=I):I=t[10];let N;t[11]!==U||t[12]!==I||t[13]!==e?(N={...e,name:U,inputSchema:I},t[11]=U,t[12]=I,t[13]=e,t[14]=N):N=t[14];const y=N;let _;t[15]!==u||t[16]!==f?(_=h=>{const w=Y(h.content);w.content.length>0&&(f(!0),u({tiptapDoc:w}))},t[15]=u,t[16]=f,t[17]=_):_=t[17];const D=_;let C;t[18]!==y?(C={tool:y},t[18]=y,t[19]=C):C=t[19];let M;t[20]!==d||t[21]!==p?(M=h=>d(p,h),t[20]=d,t[21]=p,t[22]=M):M=t[22];let P;t[23]!==o||t[24]!==p?(P=()=>o(p),t[23]=o,t[24]=p,t[25]=P):P=t[25];let A;return t[26]!==r||t[27]!==D||t[28]!==i||t[29]!==a||t[30]!==g||t[31]!==C||t[32]!==M||t[33]!==P||t[34]!==n||t[35]!==x?(A=j.jsx(G,{resourceURI:g,orgId:a,toolInfo:C,toolInput:n,toolResult:x,displayMode:"fullscreen",minHeight:E.fullscreen.minHeight,maxHeight:E.fullscreen.maxHeight,client:r,onMessage:D,onUpdateModelContext:M,onTeardown:P,onRequestDisplayMode:i,className:"h-full"}),t[26]=r,t[27]=D,t[28]=i,t[29]=a,t[30]=g,t[31]=C,t[32]=M,t[33]=P,t[34]=n,t[35]=x,t[36]=A):A=t[36],A}function Pe(S){const t=H.c(20),{connectionId:r,toolName:g,args:e}=S,{org:s}=$();let a;t[0]!==r||t[1]!==s.id||t[2]!==s.slug?(a={connectionId:r,orgId:s.id,orgSlug:s.slug},t[0]=r,t[1]=s.id,t[2]=s.slug,t[3]=a):a=t[3];const c=v(a);let u;t[4]!==c?(u={client:c},t[4]=c,t[5]=u):u=t[5];const{data:d}=L(u);let o,f,m;t[6]!==g||t[7]!==d.tools?(o=q(decodeURIComponent(g)),m=d.tools.find(i=>i.name===o)??d.tools.find(i=>{const n=O(i._meta);if(!n)return!1;if(b(i.name,n)===o)return!0;const x=b(o,n);return x!==o&&i.name===x}),f=m?._meta?k(m._meta):void 0,t[6]=g,t[7]=d.tools,t[8]=o,t[9]=f,t[10]=m):(o=t[8],f=t[9],m=t[10]);const p=f;if(!m||!p){let i;return t[11]!==o?(i=j.jsx("div",{className:"flex items-center justify-center h-full w-full",children:j.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',o,'" not found or has no UI']})}),t[11]=o,t[12]=i):i=t[12],i}let l;return t[13]!==e||t[14]!==c||t[15]!==r||t[16]!==s.id||t[17]!==p||t[18]!==m?(l=j.jsx(K,{client:c,resourceURI:p,tool:m,connectionId:r,orgId:s.id,args:e}),t[13]=e,t[14]=c,t[15]=r,t[16]=s.id,t[17]=p,t[18]=m,t[19]=l):l=t[19],l}export{Pe as AppViewContent};
@@ -1 +0,0 @@
1
- import{e as C,j as r}from"./index-CiRQNPVt.js";import{I as F}from"./input-D3E6n6la.js";import{L as T}from"./label-DLUhXNk7.js";import{T as L}from"./textarea-D1h5iq3D.js";import{I as A}from"./image-field-CXkzTwa7.js";import{ae as R,af as D,ah as J}from"./index-DkWynf6r.js";import{u as K,s as S}from"./primitives-BBsQqWkR.js";import{S as M}from"./save-status-BZf4M3tc.js";import"./Tool01-R6WyaXsu.js";import"./Trash01-C3pnsiws.js";import"./Upload01-BHsRhr7X.js";import"./AlertCircle-BDfUS-lh.js";import"./Check-C9-fsV6-.js";import"./Eye-CKz6zS_m.js";import"./DotsVertical-Q3F6UWC_.js";import"./agent-icon-DAPplz1A.js";import"./SwitchHorizontal01-BI_yHGXL.js";import"./RefreshCcw01-Dncu-kYd.js";import"./XCircle-D_3MYOn4.js";import"./ArrowUpRight-8daK_Mrm.js";import"./ZapSquare-CP91cLS8.js";import"./Users03-Bek4Ag3W.js";import"./CheckCircle-B_rVd_l8.js";import"./ChevronDown--2U1gfXf.js";import"./ChevronLeft-TttN4toV.js";import"./ChevronRight-BVEygGVH.js";import"./ChevronUp-C-xaVM7d.js";import"./Container-Bso4WS0x.js";import"./ZoomOut-CaG3Pd1Z.js";import"./Globe01-iupU5eqh.js";import"./FilterLines-SKQT-eWL.js";import"./Star01-CN33xE6w.js";import"./Palette-CS36Icvl.js";import"./HardDrive-DpuvbJvr.js";import"./Stars02-B4CoQ82E.js";import"./Key01-6eW9IRFT.js";import"./LayoutLeft-BkxKKkMX.js";import"./LinkExternal01-BXhdtlT7.js";import"./Monitor01-DUICZH5i.js";import"./Sun-CEzPQTAJ.js";import"./Play-CbbqvWPd.js";import"./Plus-CSNkL1o7.js";import"./SearchMd-B-q2EsGW.js";import"./Settings02-CdJ0CKrL.js";import"./Shield01-Crgp73nV.js";import"./Stars01-BXO9Nc4-.js";import"./User01-JuGE_kA7.js";import"./Users01-BVUwP6xk.js";import"./XClose-Da5LgJSi.js";import"./X-BdwzFded.js";import"./Zap-DHBAOmqP.js";import"./dialog-Cwf6uY_y.js";import"./dropdown-menu-UGlYpK18.js";import"./skeleton-dQOYuNlQ.js";import"./tabs-DVd_y6YL.js";import"./use-file-configs-o-LP0Blk.js";import"./use-mcp-client-D0A6RZFw.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./useInfiniteQuery-C1jLiRqA.js";import"./infiniteQueryObserver-BND7fiNU.js";import"./agent-capabilities-gx2lqG9R.js";import"./chat-context-BFmJRDzy.js";import"./tab-id-C7unjelb.js";import"./decopilot-sse-pool-BHhoQKaF.js";import"./create-sse-subscription-BS5983N4.js";import"./use-virtual-mcp-DciRKx1X.js";import"./use-collections-B1Mg9Y32.js";import"./use-ai-providers-Bwbur0GT.js";import"./use-organization-settings-PADdytdf.js";import"./pair-CpEuUIpQ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-verb-Y8E.js";import"./select-BMX9jvQG.js";import"./tooltip-C47QSg8i.js";import"./use-copy-B_uLjrw6.js";import"./file-type-icon-7TqtrpuQ.js";import"./content-blocks-o63cs2vh.js";import"./types-Df_Z2FUK.js";import"./shell-layout-3b4NfWya.js";import"./avatar-BqNGZrFg.js";import"./required-auth-layout-BE5eceMw.js";import"./useRouterState-BXwm4DCl.js";import"./use-org-sso-nq4qWMpD.js";import"./integration-icon-vaGvNHHz.js";import"./use-navigate-to-agent-Drh7z3D_.js";import"./use-connection-DpxWBF4Y.js";import"./use-mcp-prompts-BuV5LRNr.js";import"./form-Bbpyf2N_.js";import"./spinner-_hqWpG0c.js";import"./drawer-CF0b7Dg3.js";import"./collection-search-CDLcWLfd.js";import"./toggle-group-vA7ktrP-.js";import"./connect-desktop-dialog-CDUh5Otr.js";import"./agent-icons-Dk-aO0GI.js";import"./checkbox-CBmcFqoh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-CQW36fJV.js";import"./card-D41ULrnf.js";import"./popover-C1MgHMHU.js";import"./command-B8qtKAnE.js";import"./index-DJTEqPXf.js";import"./sortable.esm-D7AgS_lX.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CSsbMtfE.js";import"./use-registry-connections-C0VEE_YX.js";import"./extract-connection-data-BKeaLULt.js";import"./generate-id-BHe5yw90.js";import"./collections-BxDJ4z3g.js";import"./collection-tabs-CbZbTMYY.js";import"./badge-BBLSXFe0.js";import"./connection-form-helpers-BonOFyzw.js";import"./use-infinite-scroll-D8iZFAEQ.js";import"./useSuspenseInfiniteQuery-CHLM-3cW.js";import"./index-Co-NpkaC.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DSfyT3dO.js";import"./sidebar-BBqRosV0.js";import"./sheet-Utq51ofH.js";import"./toolbar-D3G0G9U8.js";import"./use-create-virtual-mcp-BBxov1Li.js";import"./github-repo-picker-CVG2zsbh.js";import"./use-mcp-tools-BTzw-W77.js";import"./alert-dialog-Q8M8ngFf.js";import"./index-sqqDCA0K.js";import"./use-org-auth-client-BlGBETGB.js";import"./hover-card-Azyk5Kxa.js";import"./task-status-5oHTrkjV.js";import"./use-status-sounds-DR8WA3PU.js";import"./empty-state-CoXt5rYF.js";import"./resizable-CrMJy22o.js";import"./use-capability-1uxC8-oZ.js";import"./header-tab-button-t5WNjrVG.js";import"./index-f0X8ef8k.js";import"./user-DaO6RYsc.js";import"./tools-list-BL4u8QMN.js";import"./switch-CTAzWsjZ.js";import"./use-debounced-autosave-DDZnxori.js";import"./index-Dci2MWs9.js";import"./search-input-CZKc9XZR.js";import"./use-secrets-DZDUsUGC.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-JZC0q2Q6.js";import"./view-mode-toggle-B-ZBNJWV.js";import"./select-model-BB2-8k_v.js";import"./use-automations-B9mdkXiu.js";import"./monaco-editor-Bgzj9gt4.js";import"./automation-runs-gdpRnoA6.js";import"./table-BuLHtfTA.js";import"./use-members-DDVaE5yQ.js";import"./automation-list-row-BRsSmcOA.js";const $={authors:[{key:"name",label:"Name",widget:"text"},{key:"email",label:"Email",widget:"text",placeholder:"author@example.com"},{key:"jobTitle",label:"Job title",widget:"text"},{key:"company",label:"Company",widget:"text"},{key:"avatar",label:"Avatar",widget:"image"}],categories:[{key:"name",label:"Name",widget:"text"},{key:"slug",label:"Slug",widget:"text",placeholder:"my-category"}]},q={authors:"Author",categories:"Category"};function Tr(P){const t=C.c(34),{orgSlug:v,virtualMcpId:j,branch:f,kind:p,blockKey:y,block:w}=P;let u;t[0]!==f||t[1]!==v||t[2]!==j?(u={orgSlug:v,virtualMcpId:j,branch:f},t[0]=f,t[1]=v,t[2]=j,t[3]=u):u=t[3];const m=R(u);let d;t[4]!==w||t[5]!==p?(d=D(w,p),t[4]=w,t[5]=p,t[6]=d):d=t[6];const B=d;let h;t[7]!==y||t[8]!==p||t[9]!==m?(h=e=>{m.mutate({blockKey:y,data:J(y,p,e)})},t[7]=y,t[8]=p,t[9]=m,t[10]=h):h=t[10];const[i,E]=K(B,h);let k;t[11]!==i||t[12]!==E?(k=(e,o)=>E({...i,[e]:o}),t[11]=i,t[12]=E,t[13]=k):k=t[13];const a=k,N=q[p];let s;t[14]!==N?(s=r.jsx("span",{className:"text-sm font-medium",children:N}),t[14]=N,t[15]=s):s=t[15];let l;t[16]!==m.isError||t[17]!==m.isPending?(l=r.jsx(M,{isPending:m.isPending,isError:m.isError}),t[16]=m.isError,t[17]=m.isPending,t[18]=l):l=t[18];let n;t[19]!==s||t[20]!==l?(n=r.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[s,l]}),t[19]=s,t[20]=l,t[21]=n):n=t[21];const I=$[p];let c;if(t[22]!==i||t[23]!==a||t[24]!==I){let e;t[26]!==i||t[27]!==a?(e=o=>r.jsx("div",{className:"space-y-2",children:o.widget==="image"?r.jsx(A,{schema:{type:"string",format:"image-uri",title:o.label},value:i[o.key],onChange:x=>a(o.key,x),path:o.key,label:o.label}):r.jsxs(r.Fragment,{children:[r.jsx(T,{htmlFor:o.key,children:o.label}),o.widget==="textarea"?r.jsx(L,{id:o.key,value:S(i[o.key]),onChange:x=>a(o.key,x.target.value),rows:3}):r.jsx(F,{id:o.key,value:S(i[o.key]),placeholder:o.placeholder,onChange:x=>a(o.key,x.target.value),className:"h-10"})]})},o.key),t[26]=i,t[27]=a,t[28]=e):e=t[28],c=I.map(e),t[22]=i,t[23]=a,t[24]=I,t[25]=c}else c=t[25];let g;t[29]!==c?(g=r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto px-6 py-6",children:r.jsx("div",{className:"mx-auto max-w-xl space-y-6",children:c})}),t[29]=c,t[30]=g):g=t[30];let b;return t[31]!==g||t[32]!==n?(b=r.jsxs("div",{className:"flex h-full flex-col",children:[n,g]}),t[31]=g,t[32]=n,t[33]=b):b=t[33],b}export{Tr as RecordEditor};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-CHn-aQtX.js","assets/index-CiRQNPVt.js","assets/index-CZJ35dl3.css","assets/XCircle-D_3MYOn4.js","assets/CheckCircle-B_rVd_l8.js","assets/Container-Bso4WS0x.js","assets/Settings02-CdJ0CKrL.js","assets/use-mcp-client-D0A6RZFw.js","assets/useInfiniteQuery-C1jLiRqA.js","assets/infiniteQueryObserver-BND7fiNU.js","assets/badge-BBLSXFe0.js","assets/input-D3E6n6la.js","assets/dropdown-menu-UGlYpK18.js","assets/Check-C9-fsV6-.js","assets/ChevronRight-BVEygGVH.js","assets/DotsVertical-Q3F6UWC_.js","assets/table-BuLHtfTA.js","assets/toggle-group-vA7ktrP-.js","assets/use-view-mode-BpduDYTq.js","assets/tooltip-C47QSg8i.js","assets/FilterLines-SKQT-eWL.js","assets/Globe01-iupU5eqh.js","assets/SearchMd-B-q2EsGW.js","assets/dialog-Cwf6uY_y.js","assets/X-BdwzFded.js","assets/AlertCircle-BDfUS-lh.js","assets/Upload01-BHsRhr7X.js","assets/alert-dialog-Q8M8ngFf.js","assets/card-D41ULrnf.js","assets/Trash01-C3pnsiws.js","assets/label-DLUhXNk7.js","assets/select-BMX9jvQG.js","assets/ChevronDown--2U1gfXf.js","assets/ChevronUp-C-xaVM7d.js","assets/switch-CTAzWsjZ.js","assets/textarea-D1h5iq3D.js","assets/RefreshCcw01-Dncu-kYd.js","assets/checkbox-CBmcFqoh.js","assets/Eye-CKz6zS_m.js","assets/LinkExternal01-BXhdtlT7.js","assets/use-copy-B_uLjrw6.js","assets/Key01-6eW9IRFT.js","assets/Plus-CSNkL1o7.js","assets/Play-CbbqvWPd.js"])))=>i.map(i=>d[i]);
2
- import{e as i,j as e,r as s,l as a,_ as o}from"./index-CiRQNPVt.js";import{R as l}from"./require-capability-vzDtNqMc.js";import"./use-capability-1uxC8-oZ.js";import"./access-gate-AjUY-gkn.js";import"./capability-load-error-CjE005FF.js";const m=s.lazy(()=>o(()=>import("./registry-layout-CHn-aQtX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43])));function f(){const r=i.c(1);let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(l,{capability:"registry:manage",area:"the registry",children:e.jsx(s.Suspense,{fallback:e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx(a,{size:20,className:"animate-spin text-muted-foreground"})}),children:e.jsx(m,{})})}),r[0]=t):t=r[0],t}export{f as default};