decocms 3.4.1 → 3.5.0

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 (229) hide show
  1. package/dist/client/assets/{AlertCircle-Bc3r3AGq.js → AlertCircle-PL6o_BFM.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DfEIENBd.js → ArrowUpRight-D0PaRtUX.js} +1 -1
  3. package/dist/client/assets/{Check--VLhXi5l.js → Check-7lFZ8X77.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-7xc6-R3M.js → CheckCircle-Bjdxpj1j.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-66ErjaPf.js → ChevronDown-DBeUwQYn.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-DyW6EtsM.js → ChevronLeft-CPLLwlIr.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-C87PRbBa.js → ChevronRight-BVo14pyp.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-BuPeXu8C.js → ChevronUp-XvIiv-NV.js} +1 -1
  9. package/dist/client/assets/{Container-cZo3l6OX.js → Container-BoahFo7F.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CQgc8nSx.js → DotsVertical-ntZiwo0t.js} +1 -1
  11. package/dist/client/assets/{Eye-DHHjYDbX.js → Eye-DkuHnUAW.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CWR_eJ7z.js → FilterLines-DgBfCVyf.js} +1 -1
  13. package/dist/client/assets/{Globe01-B10jCcNH.js → Globe01-CcGroxBm.js} +1 -1
  14. package/dist/client/assets/{HardDrive-7KMC69UH.js → HardDrive-C4j857Fq.js} +1 -1
  15. package/dist/client/assets/{Key01-CTKRB2Cd.js → Key01-o0EwVLiR.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-SQH1HcmI.js → LayoutLeft-CD_Gf1ZP.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-CjT-4hM8.js → LinkExternal01-BrUoXKJY.js} +1 -1
  18. package/dist/client/assets/{Monitor01-svtG00ql.js → Monitor01-D61B3ma3.js} +1 -1
  19. package/dist/client/assets/{Palette-CA_16qMN.js → Palette-CrqqEUcE.js} +1 -1
  20. package/dist/client/assets/{Play-CrdarOgl.js → Play-UJPgqc1U.js} +1 -1
  21. package/dist/client/assets/{Plus-C9icoBmX.js → Plus-Tnr53r7A.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-D1tvoH2_.js → RefreshCcw01-Cv0pFCb4.js} +1 -1
  23. package/dist/client/assets/{SearchMd-Di6_vvQ1.js → SearchMd-UxzEV07r.js} +1 -1
  24. package/dist/client/assets/{Settings02-BylJiOHK.js → Settings02-DhqQsm8K.js} +1 -1
  25. package/dist/client/assets/{Shield01-CDSs18-B.js → Shield01-DpLC5M3q.js} +1 -1
  26. package/dist/client/assets/{Star01-D1DEXGAi.js → Star01-sX328yCS.js} +1 -1
  27. package/dist/client/assets/{Stars01-UWs0NZ30.js → Stars01-Dv9c4Cee.js} +1 -1
  28. package/dist/client/assets/{Stars02-CXAcgX2g.js → Stars02-f0XE-eqW.js} +1 -1
  29. package/dist/client/assets/{Sun-CCiXRotp.js → Sun-PyN_Wt4r.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BU3C5ze8.js → SwitchHorizontal01-B9vZRv9t.js} +1 -1
  31. package/dist/client/assets/{Tool01-BMk00CcA.js → Tool01-yp4kJRUu.js} +1 -1
  32. package/dist/client/assets/{Trash01-MTKniuxn.js → Trash01-CZeQBZf_.js} +1 -1
  33. package/dist/client/assets/{Upload01-DsrMMWgf.js → Upload01-SHM-fhC7.js} +1 -1
  34. package/dist/client/assets/{User01-DShN8gQ-.js → User01-DW9hMolk.js} +1 -1
  35. package/dist/client/assets/{Users01-Bvh39Ydu.js → Users01-D2wb7idE.js} +1 -1
  36. package/dist/client/assets/{Users03--pQkY_Pm.js → Users03-DbJl-FlT.js} +1 -1
  37. package/dist/client/assets/{X-D-FyhysP.js → X-BH0VE8jB.js} +1 -1
  38. package/dist/client/assets/{XCircle-Pgrh_mFJ.js → XCircle-DLzFRLwJ.js} +1 -1
  39. package/dist/client/assets/{XClose-CXixB7oH.js → XClose-DNgFZbzC.js} +1 -1
  40. package/dist/client/assets/{Zap-BcF-Iz_3.js → Zap-DplWtEq0.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-BH297b52.js → ZapSquare-xDebNl-H.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-qupe1GUj.js → ZoomOut-CrlW2TUB.js} +1 -1
  43. package/dist/client/assets/{access-gate-b8qBeVwB.js → access-gate-BwTL-vjj.js} +1 -1
  44. package/dist/client/assets/{accordion-bX483Ztz.js → accordion-BTEQZzrz.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-wMptfoHV.js → add-section-modal-DACQp29A.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-ADaK_qqp.js → agent-capabilities-BPmYbqGN.js} +1 -1
  47. package/dist/client/assets/{agent-icon-6l7Nwe2K.js → agent-icon-BzrzSnAz.js} +1 -1
  48. package/dist/client/assets/{agent-icons-BDS9BBHh.js → agent-icons-Cd0vLj6N.js} +1 -1
  49. package/dist/client/assets/{agents-list-BdFiPs3r.js → agents-list-C6qqAI5_.js} +1 -1
  50. package/dist/client/assets/{ai-providers-lM-GGoBl.js → ai-providers-kZI6pudu.js} +1 -1
  51. package/dist/client/assets/{alert-Ta86Z4_L.js → alert-CHelH7PN.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-_2G9ccD7.js → alert-dialog-D0lyxgq7.js} +1 -1
  53. package/dist/client/assets/app-editor-BEzuyKZz.js +1 -0
  54. package/dist/client/assets/{auth-catchall-BdHpJwKo.js → auth-catchall-eEEVSQiw.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-DVUC3dWq.js → auth-split-layout-J4nbOqGk.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BNHDxEG_.js → automation-list-row-qYSYtkIF.js} +1 -1
  57. package/dist/client/assets/{automation-runs-BbNb5m5Z.js → automation-runs-C4iv4rJG.js} +1 -1
  58. package/dist/client/assets/{automations-ChMgB7Hm.js → automations-BBsp-bnq.js} +1 -1
  59. package/dist/client/assets/{avatar-KTqg6Pir.js → avatar-dR7ViKE5.js} +1 -1
  60. package/dist/client/assets/{badge-jK5_JNPO.js → badge-REAPd24g.js} +1 -1
  61. package/dist/client/assets/{brand-context-D1YLW65X.js → brand-context-DKgMKp8i.js} +1 -1
  62. package/dist/client/assets/{buckets-CZodJDYe.js → buckets-CAG2foTd.js} +1 -1
  63. package/dist/client/assets/{calendar-DFy-BKZq.js → calendar-C4DQ4fqJ.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DUP-Lw9V.js → capability-load-error-BiSiPTFT.js} +1 -1
  65. package/dist/client/assets/{card-Ce7y-Nqu.js → card-DjJMgfjm.js} +1 -1
  66. package/dist/client/assets/{chat-context-CpKbwwmM.js → chat-context-dBrooU1v.js} +1 -1
  67. package/dist/client/assets/{checkbox-MO2_GITU.js → checkbox-DLgoLQSR.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-XZzsr92m.js → cli-auth-success-Cf1STb5K.js} +1 -1
  69. package/dist/client/assets/{collection-detail-Bv6I7A_k.js → collection-detail-BGZmeA1k.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-DzXqmtbd.js → collection-display-button-DLtr23Rv.js} +1 -1
  71. package/dist/client/assets/{collection-search-CPYfTi84.js → collection-search-DYrAflR5.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-DgzLrzuP.js → collection-table-wrapper-BZmV-NZH.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CIsqNrxU.js → collection-tabs-Y_drDohR.js} +1 -1
  74. package/dist/client/assets/{collections-B-PXiD2Y.js → collections-UXWGkaFt.js} +1 -1
  75. package/dist/client/assets/{command-BHmAxNRB.js → command-VnXMa00z.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-BQZD1I8n.js → connect-desktop-dialog-VMfxWtQ-.js} +1 -1
  77. package/dist/client/assets/{connection-card-BHzG8ppu.js → connection-card-DK49rHkZ.js} +1 -1
  78. package/dist/client/assets/{connection-detail-BlmixFGl.js → connection-detail-DzUm5yVg.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-CgKn2eM9.js → connection-form-helpers-BSgnmPKP.js} +1 -1
  80. package/dist/client/assets/{connections-D5zy3mYf.js → connections-Bh992QKN.js} +1 -1
  81. package/dist/client/assets/{constants-DI_u-hVk.js → constants-B521j7ay.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DPWhf2bX.js → decopilot-sse-pool-D4rmdWQS.js} +1 -1
  83. package/dist/client/assets/{dialog-Bt3zXcK6.js → dialog-DqPItn-g.js} +1 -1
  84. package/dist/client/assets/{domain-settings-CZnFXOwr.js → domain-settings-BXCL_xbf.js} +1 -1
  85. package/dist/client/assets/{drawer-DeHC5s3g.js → drawer-CPIIyCcW.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-SwrAlbwN.js → dropdown-menu-2uydtPAy.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-WDrQTfck.js → dynamic-plugin-layout-RNpkQxgu.js} +1 -1
  88. package/dist/client/assets/{empty-state-DlCayRAK.js → empty-state-BLunjf1m.js} +1 -1
  89. package/dist/client/assets/{empty-state-BJFB-AwN.js → empty-state-DLBfWl6Y.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-CrMYEI5i.js → extract-connection-data-aP9VrOhv.js} +1 -1
  91. package/dist/client/assets/{features-BgkDxOlu.js → features-CA4znDNw.js} +1 -1
  92. package/dist/client/assets/{file-explorer-DrueRu5k.js → file-explorer-aonQXi96.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-BHF_Ovux.js → file-type-icon-CqbDePIX.js} +1 -1
  94. package/dist/client/assets/{files-BCcd3t2S.js → files-d-57Qs8I.js} +1 -1
  95. package/dist/client/assets/{form-8jBGaVW7.js → form-BIWGXIbK.js} +1 -1
  96. package/dist/client/assets/{general-BJkPBrz3.js → general-CXp3pwbL.js} +1 -1
  97. package/dist/client/assets/{generate-id-Bfx7nOJH.js → generate-id-CdwRTiX7.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-F4vLHgJ-.js → github-repo-picker-Bu6oV3t1.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-DCSg63Wl.js → header-tab-button-Btqu8vce.js} +1 -1
  100. package/dist/client/assets/{hover-card-DcJvwauT.js → hover-card-reOs8OTf.js} +1 -1
  101. package/dist/client/assets/{image-field-cind3dwC.js → image-field-DoQO0nqy.js} +1 -1
  102. package/dist/client/assets/{index-C1kxS2Io.js → index-2xBvfJLJ.js} +1 -1
  103. package/dist/client/assets/{index-ChzbgMa2.js → index-BIMoUWYp.js} +1 -1
  104. package/dist/client/assets/{index-BzoFvbIH.js → index-BYSwFuRs.js} +1 -1
  105. package/dist/client/assets/{index-DlcvFOU2.js → index-C1MLUCFq.js} +1 -1
  106. package/dist/client/assets/{index-C_oSBqFD.js → index-C4HbvW_W.js} +3 -3
  107. package/dist/client/assets/{index-C3tcbzRj.js → index-CM0AvljI.js} +1 -1
  108. package/dist/client/assets/{index-DQj7btfC.js → index-CgoPiptB.js} +1 -1
  109. package/dist/client/assets/{index-Bac2tQWh.js → index-CuEl7ZCd.js} +1 -1
  110. package/dist/client/assets/{index-CfGIr4vM.js → index-D8H8ytWG.js} +23 -23
  111. package/dist/client/assets/{index-BrIVZCzt.js → index-DElKj3LD.js} +1 -1
  112. package/dist/client/assets/{index-C0t_9xyr.js → index-DVHW5IXE.js} +1 -1
  113. package/dist/client/assets/{index-DML39Lt-.js → index-FhXRIQKJ.js} +1 -1
  114. package/dist/client/assets/{index-DEWYXjIf.js → index-WNtnEHJ2.js} +1 -1
  115. package/dist/client/assets/{index-BIANv7ur.js → index-_FSABeX9.js} +1 -1
  116. package/dist/client/assets/{index-redirect-KnAJlqvx.js → index-redirect-3tS7mNzU.js} +1 -1
  117. package/dist/client/assets/{index-d7-A3CDs.js → index-xesYw4pg.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-w8EJyyrI.js → infiniteQueryObserver-IbMlOZg5.js} +1 -1
  119. package/dist/client/assets/{input-Ct22kLSY.js → input-B5k-Hbp3.js} +1 -1
  120. package/dist/client/assets/{integration-icon-CNf7sZ5b.js → integration-icon-C7p8BtkI.js} +1 -1
  121. package/dist/client/assets/{label-CvDTa89d.js → label-BvvzAAWu.js} +1 -1
  122. package/dist/client/assets/{layout-Dkxj2bFg.js → layout-BMq59AVz.js} +1 -1
  123. package/dist/client/assets/{login-Dv6Rz1bY.js → login-BIU3L6eK.js} +1 -1
  124. package/dist/client/assets/{members-BQXsk1m4.js → members-DGFZlZSL.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-DR4yoUjc.js → monaco-editor-ByT33GfF.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-Co70p3-n.js → monitoring-stats-row-VdVj1bTz.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-CQPHoHy-.js → oauth-callback-C1JOUQQn.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-BJeYyFlX.js → oauth-callback-ai-provider-CUbQRMCQ.js} +1 -1
  129. package/dist/client/assets/{onboarding-CzNreyu4.js → onboarding-CY5W5FNv.js} +1 -1
  130. package/dist/client/assets/{org-install-aZxuYxoI.js → org-install-DLtxfbHw.js} +1 -1
  131. package/dist/client/assets/{org-layout-CR6iFjC9.js → org-layout-BqXWDd1-.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-Ah6P36_M.js → org-plugin-layout-CbMQy1Lw.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-BzX1ts5p.js → page-seo-form-BmCl6Xlh.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-Ced60-cr.js +1 -0
  135. package/dist/client/assets/{pair--AN1yq4g.js → pair-Bhj3cOFh.js} +2 -2
  136. package/dist/client/assets/{plugin-empty-state-CIZ1bBrP.js → plugin-empty-state-dJCoaDDO.js} +1 -1
  137. package/dist/client/assets/{plugin-header-CExvgCKI.js → plugin-header-BmoMpOXz.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-DS-orBC-.js → plugin-layout-BR81jn44.js} +1 -1
  139. package/dist/client/assets/{popover-DXn7orE4.js → popover-CFPzrMHB.js} +1 -1
  140. package/dist/client/assets/{post-editor-bszZQHpg.js → post-editor-GGFyFznW.js} +1 -1
  141. package/dist/client/assets/{primitives-CIXky-Gt.js → primitives-DYqJBFCL.js} +1 -1
  142. package/dist/client/assets/{profile-CZWeJMEP.js → profile-Cfmj1cf7.js} +1 -1
  143. package/dist/client/assets/project-app-view-eVezvxZo.js +1 -0
  144. package/dist/client/assets/record-editor-52XgVwcw.js +1 -0
  145. package/dist/client/assets/registry-CiIpQiyq.js +2 -0
  146. package/dist/client/assets/{registry-layout-DjFUi3yC.js → registry-layout-BIYEFhu4.js} +1 -1
  147. package/dist/client/assets/{require-capability-DDbNSPG5.js → require-capability-OYQug4J7.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-Bpv6G5uE.js → required-auth-layout-Bcp4IxxD.js} +1 -1
  149. package/dist/client/assets/{reset-password-D1T0PiTj.js → reset-password-suzhQWSU.js} +1 -1
  150. package/dist/client/assets/{resizable-Bi3jkg9o.js → resizable-IfVaIg_U.js} +1 -1
  151. package/dist/client/assets/{roles-BBWw8puD.js → roles-BPJBENaC.js} +1 -1
  152. package/dist/client/assets/{save-status-PzXq6KUK.js → save-status-BxvWi0ix.js} +1 -1
  153. package/dist/client/assets/{schema-form-CM7pfylQ.js → schema-form-DbvvSf_B.js} +1 -1
  154. package/dist/client/assets/{scroll-area-BNzrPnq5.js → scroll-area-DYzEAvWY.js} +1 -1
  155. package/dist/client/assets/{search-input-C76EA-t6.js → search-input-BMW004dV.js} +1 -1
  156. package/dist/client/assets/{secrets-DMEa7GIW.js → secrets-Bv4krrbm.js} +1 -1
  157. package/dist/client/assets/{sections-editor--GuZPQzC.js → sections-editor-tHHOdLOL.js} +1 -1
  158. package/dist/client/assets/{select-D_4UU9rK.js → select-DPygLpWH.js} +1 -1
  159. package/dist/client/assets/{select-model-cV_VUU8G.js → select-model-BS2yzBPq.js} +1 -1
  160. package/dist/client/assets/{seo-editor-fhccoPNR.js → seo-editor-CCPmPYRi.js} +1 -1
  161. package/dist/client/assets/{settings-layout-DH37q17x.js → settings-layout-BV_kMffR.js} +1 -1
  162. package/dist/client/assets/{settings-section-DsXtuKDY.js → settings-section-C7gs1p6F.js} +1 -1
  163. package/dist/client/assets/{sheet-D01YX9h0.js → sheet-D9aXq4ta.js} +1 -1
  164. package/dist/client/assets/{shell-controls-CNVI6ZJJ.js → shell-controls-C56-Ps3x.js} +1 -1
  165. package/dist/client/assets/{shell-layout-xPMsY5hC.js → shell-layout-tWuhPjHz.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-jPQ9XajT.js → shell-route-loading-Cy1LF1Kf.js} +1 -1
  167. package/dist/client/assets/{sidebar-CJNdWlwy.js → sidebar-DB4iKQD5.js} +1 -1
  168. package/dist/client/assets/{skeleton-DEf5lpEA.js → skeleton-DH0H1fU3.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-KhkNVCRe.js → sortable.esm-BKA03RQh.js} +1 -1
  170. package/dist/client/assets/{spinner-srK7FwNe.js → spinner-C0Im7y7X.js} +1 -1
  171. package/dist/client/assets/{sso-BLXKmxlD.js → sso-BYfRBv2e.js} +1 -1
  172. package/dist/client/assets/{store-DydXTg6V.js → store-Cyr13yyM.js} +1 -1
  173. package/dist/client/assets/store-registry-DIjY8LQB.js +2 -0
  174. package/dist/client/assets/{switch-Cbu6JSI9.js → switch-BGtkcqu8.js} +1 -1
  175. package/dist/client/assets/{tab-id-CbYpEVAZ.js → tab-id-B1KAdtlk.js} +1 -1
  176. package/dist/client/assets/{table-dr9K2jWM.js → table-B34ZqNGn.js} +1 -1
  177. package/dist/client/assets/{tabs-CJU0nxr6.js → tabs-52tGcLiU.js} +1 -1
  178. package/dist/client/assets/{task-status-Dyf8qaxz.js → task-status-Dq99ypn5.js} +1 -1
  179. package/dist/client/assets/{textarea-BquesfD_.js → textarea-BnccT-U9.js} +1 -1
  180. package/dist/client/assets/{toggle-group-m3q7pubc.js → toggle-group-E6TPCKmI.js} +1 -1
  181. package/dist/client/assets/{toolbar-Bkxu3n7s.js → toolbar-B-Xmvyb0.js} +1 -1
  182. package/dist/client/assets/{tools-list-CG_BLK1j.js → tools-list-CZ0YST_J.js} +1 -1
  183. package/dist/client/assets/{tooltip-Bm-whGHF.js → tooltip-DgiqborV.js} +1 -1
  184. package/dist/client/assets/{types-Bkz2p_os.js → types-DP-Q3z5y.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-B82V9Np8.js → use-ai-providers-B_aWh-J8.js} +1 -1
  186. package/dist/client/assets/{use-automations-B5qTxkL8.js → use-automations-CQqGzVrP.js} +1 -1
  187. package/dist/client/assets/{use-capability-DpFGw1TU.js → use-capability-CzlbJT0x.js} +1 -1
  188. package/dist/client/assets/{use-collections-iUV-5kFm.js → use-collections-CFs8myDl.js} +1 -1
  189. package/dist/client/assets/{use-connection-DTKE65yR.js → use-connection-DjURtMK5.js} +1 -1
  190. package/dist/client/assets/{use-copy-Dr7XRETN.js → use-copy-CKGAQPRW.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-DlMteKXP.js → use-create-virtual-mcp-GqhamUF-.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-DFapff8c.js → use-debounced-autosave-iWsKgUnH.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-CU96IyMZ.js → use-delete-connection-CjdkJ1LG.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-C8ipJXZL.js → use-file-configs-DD5bg8yH.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-KU0QCoEE.js → use-infinite-scroll-Bo7I5Z4-.js} +1 -1
  196. package/dist/client/assets/{use-list-state-DtwRJx6R.js → use-list-state-BxpSC3kw.js} +1 -1
  197. package/dist/client/assets/{use-mcp-prompts-aLA3FcF_.js → use-mcp-prompts-BNFsBgD1.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-CK1DUQVb.js → use-mcp-tools-DCbS4kMk.js} +1 -1
  199. package/dist/client/assets/{use-members-C9apz-8a.js → use-members-DZ4oSOx-.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-DRRtr51U.js → use-navigate-to-agent-DwD_R1XG.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-CI8XyYuM.js → use-org-auth-client-v3u1LDk5.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-CYBgAyDV.js → use-org-sso-Ck4B3T6D.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-C5ABG30J.js → use-organization-roles-BIilFNn5.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-B4ywx3QZ.js → use-organization-settings-difToZl3.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-B-c9LId-.js → use-registry-connections-KEGYdtt_.js} +1 -1
  206. package/dist/client/assets/{use-secrets-D3irvtLI.js → use-secrets-DHcsXoUs.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-BEbMXd3N.js → use-status-sounds-CPmXHEGX.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-Jd_CE1Mx.js → use-view-mode-Bq2h-mAH.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-DsdNWb58.js → use-virtual-mcp-By6PZUzg.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-BkurBcOt.js +1 -0
  211. package/dist/client/assets/{useRouterState-CU2GqlKv.js → useRouterState-BBlCl4XE.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-C21DKA3_.js +1 -0
  213. package/dist/client/assets/{user-sLZtiN2i.js → user-CBbH_JeB.js} +1 -1
  214. package/dist/client/assets/{view-mode-toggle-DSmCr2tD.js → view-mode-toggle-B0_LJI8Z.js} +1 -1
  215. package/dist/client/assets/{workflow-BK9KKo6T.js → workflow-Ce5v7OlY.js} +1 -1
  216. package/dist/client/assets/workflow-detail-CMT7JAKv.js +1 -0
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +15 -9
  219. package/dist/server/server.js +7 -5
  220. package/package.json +1 -1
  221. package/dist/client/assets/app-editor-BJ_HJXFs.js +0 -1
  222. package/dist/client/assets/page-seo-sheet-v7xZnlYi.js +0 -1
  223. package/dist/client/assets/project-app-view-DJMvDwFa.js +0 -1
  224. package/dist/client/assets/record-editor-C5KWfSLg.js +0 -1
  225. package/dist/client/assets/registry-CX2hi2E3.js +0 -2
  226. package/dist/client/assets/store-registry-BJqdtxTv.js +0 -2
  227. package/dist/client/assets/useInfiniteQuery-DrZL_IGs.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-CN1mQR7i.js +0 -1
  229. package/dist/client/assets/workflow-detail-DzASvQVR.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as H,e as $,R as at,H as Dt,G as Ht,j as n,B as ke,U as Xe,c as q,t as Bt,q as he,F as Ut,a as Wt,K as me,o as ze,n as Oe,f as je,E as qt,z as Vt,bu as De}from"./index-C_oSBqFD.js";import{Y as Gt,D as Kt,x as Jt,a9 as Xt,L as Qt,K as Yt,J as Zt,a5 as rt,aa as es,ab as ts,A as it,ac as ie,ad as ss,ae as ns,af as ls,b as os}from"./agent-icon-6l7Nwe2K.js";import{t as He}from"./Stars01-UWs0NZ30.js";import{a as ct,t as as,b as we,d as rs}from"./XCircle-Pgrh_mFJ.js";import{i as Be}from"./Check--VLhXi5l.js";import{i as Qe}from"./ChevronRight-C87PRbBa.js";import{a as ut,s as is}from"./Eye-DHHjYDbX.js";import{a as de,c as Ye,t as cs}from"./format-time-Cy7tTmZp.js";import{N as dt,R as ft,e as mt,C as us,f as ds,g as fs,u as ms,i as ps,d as xs}from"./scroll-area-BNzrPnq5.js";import{u as pt}from"./use-copy-Dr7XRETN.js";import{T as pe,a as xe,b as ge}from"./tooltip-Bm-whGHF.js";import{M as xt,I as gt,F as gs}from"./file-type-icon-BHF_Ovux.js";import{c as hs}from"./content-blocks-o63cs2vh.js";import{g as ht,M as bs}from"./types-Bkz2p_os.js";import{f as $e,i as ys,d as Ue,a as js}from"./chat-context-CpKbwwmM.js";import{S as vs,u as We,c as Ns,b as ks}from"./constants-DI_u-hVk.js";import{n as Ss,f as _s,o as ws,q as Ts}from"./tab-id-CbYpEVAZ.js";import{i as bt}from"./AlertCircle-Bc3r3AGq.js";import{s as Ce,t as yt}from"./Star01-D1DEXGAi.js";import{s as Cs}from"./XClose-CXixB7oH.js";import{n as jt}from"./ZapSquare-BH297b52.js";import{n as vt,i as $s}from"./Globe01-B10jCcNH.js";import{b as Is,i as Ms,a as Le}from"./Tool01-BMk00CcA.js";import{i as Ze,a as Ls}from"./ZoomOut-qupe1GUj.js";import{i as Ne}from"./Monitor01-svtG00ql.js";import{i as Rs}from"./SearchMd-Di6_vvQ1.js";import{i as As}from"./Upload01-DsrMMWgf.js";import{u as zs,c as Ps}from"./shell-layout-xPMsY5hC.js";import{n as Nt}from"./LinkExternal01-CjT-4hM8.js";import{I as Ie}from"./integration-icon-CNf7sZ5b.js";import{u as Es}from"./use-virtual-mcp-DsdNWb58.js";import{a as kt}from"./Users03--pQkY_Pm.js";import{a as ce}from"./Palette-CA_16qMN.js";import{k as St}from"./use-navigate-to-agent-DRRtr51U.js";import{a as Fs}from"./use-connection-DTKE65yR.js";import{s as Os}from"./Stars02-CXAcgX2g.js";import{g as Ds}from"./use-mcp-prompts-aLA3FcF_.js";import{c as Hs,b as Bs,d as Us,a as Ws,D as qs}from"./dialog-Bt3zXcK6.js";import{a as Vs,F as Gs,b as Ks,c as Js,d as Xs,f as Qs}from"./form-8jBGaVW7.js";import{I as Ys}from"./input-Ct22kLSY.js";import{S as Zs}from"./spinner-srK7FwNe.js";import{t as en}from"./ChevronDown-66ErjaPf.js";const tn={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(tn)){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 fa(s){return s.reduce((e,t)=>Tt(e,t.metadata?.usage),wt())}function sn({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 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=Dt(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=Ht(p);let d;e[8]!==t?.arguments?(d=t?.arguments??[],e[8]=t?.arguments,e[9]=d):d=e[9];const x=d;let g;e[10]!==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 j;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(j=t.title||ln(t.name,qe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=j):j=e[20];let k;e[21]!==j?(k=n.jsx(Hs,{children:n.jsx("span",{className:"capitalize",children:j})}),e[21]=j,e[22]=k):k=e[22];let y;e[23]!==t.description?(y=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==k?(v=n.jsxs(Bs,{children:[k,y]}),e[25]=y,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=z=>n.jsx(Gs,{control:i.control,name:z.name,render:O=>{const{field:U}=O;return n.jsxs(Ks,{children:[n.jsxs(Js,{className:"text-xs",children:[z.name,z.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(Xs,{children:n.jsx(Ys,{...U,value:U.value??"",required:z.required,placeholder:z.description??"",className:"h-9",disabled:i.formState.isSubmitting})}),n.jsx(Qs,{})]})}},z.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(Zs,{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(Vs,{...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(Ws,{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 P;return e[63]!==N||e[64]!==F?(P=n.jsx(qs,{open:!0,onOpenChange:N,children:F}),e[63]=N,e[64]=F,e[65]=P):P=e[65],P}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 ma(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",j=i&&"outline-2 outline-blue-300 outline-offset-0",k=x&&"hover:brightness-95";let y;e[7]!==h||e[8]!==N||e[9]!==j||e[10]!==k?(y=q("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",N,j,k,"capitalize"),e[7]=h,e[8]=N,e[9]=j,e[10]=k,e[11]=y):y=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]!==y||e[17]!==v?(S=n.jsxs(mt,{onClick:b,className:y,children:[f,v]}),e[14]=f,e[15]=b,e[16]=y,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(17),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o}=s,u=r===void 0?!1:r,f=o===void 0?!1:o,{handleCopy:c}=pt(),[m,p]=H.useState(!1);let i;e[0]!==c||e[1]!==t||e[2]!==l.text?(i=async()=>{Bt("chat_message_copied",{message_id:t,chars:l.text.length}),await c(l.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=c,e[1]=t,e[2]=l.text,e[3]=i):i=e[3];const d=i,x=u&&a,g=x||a;let b;e[4]!==t||e[5]!==l.text?(b=n.jsx(xt,{id:t,text:l.text}),e[4]=t,e[5]=l.text,e[6]=b):b=e[6];let h;e[7]!==f||e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==g||e[12]!==x?(h=g&&n.jsxs("div",{className:q("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",f?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,x&&a&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),x&&n.jsx("button",{type:"button",onClick:d,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:m?n.jsx(Be,{className:"size-4"}):n.jsx(ut,{className:"size-4"})})]}),e[7]=f,e[8]=a,e[9]=d,e[10]=m,e[11]=g,e[12]=x,e[13]=h):h=e[13];let N;return e[14]!==b||e[15]!==h?(N=n.jsxs("div",{className:"group/part relative",children:[b,h]}),e[14]=b,e[15]=h,e[16]=N):N=e[16],N}function pa(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=q("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(Gt,{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 j;e[21]!==o?(j=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]=j):j=e[22];let k;e[23]!==h||e[24]!==N||e[25]!==j||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,j]})]}),e[23]=h,e[24]=N,e[25]=j,e[26]=d,e[27]=k):k=e[27];let y;return e[28]!==k||e[29]!==c?(y=n.jsxs(ge,{children:[c,k]}),e[28]=k,e[29]=c,e[30]=y):y=e[30],y}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 xa(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=q("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=q(h),e[7]=h,e[8]=N):N=e[8];let j;e[9]!==u||e[10]!==N?(j=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]=j):j=e[11];let k;e[12]!==o?(k=o.toFixed(0),e[12]=o,e[13]=k):k=e[13];let y;e[14]!==f?(y=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,e[15]=y):y=e[15];let v;e[16]!==k||e[17]!==y?(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,"%",y]}),e[16]=k,e[17]=y,e[18]=v):v=e[18];let S;e[19]!==a||e[20]!==v||e[21]!==d||e[22]!==g||e[23]!==j?(S=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":d,className:g,children:[j,v]})}),e[19]=a,e[20]=v,e[21]=d,e[22]=g,e[23]=j,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(fs,{"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(us,{"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(ds,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}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,j]=H.useState(x??!1),{handleCopy:k,copied:y}=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:P}=sn(F),A=c?void 0:j,z=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",U=!T&&"cursor-default",W=v&&"shimmer";let V;e[7]!==U||e[8]!==W||e[9]!==O?(V=q("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",O,U,W),e[7]=U,e[8]=W,e[9]=O,e[10]=V):V=e[10];const ne=!T;let X;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==i||e[15]!==S||e[16]!==T?(X=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?n.jsx(Qe,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:q("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:q("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:q("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]=X):X=e[17];const Q=S?"text-warning/80":"text-foreground";let J;e[18]!==Q?(J=q("shrink-0 text-[14px] font-normal",Q),e[18]=Q,e[19]=J):J=e[19];let ee;e[20]!==J||e[21]!==l?(ee=n.jsx("span",{className:J,children:l}),e[20]=J,e[21]=l,e[22]=ee):ee=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 B;e[25]!==p?(B=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]=B):B=e[26];let G;e[27]!==r?(G=n.jsx(gn,{usage:r}),e[27]=r,e[28]=G):G=e[28];let K;e[29]!==V||e[30]!==ne||e[31]!==X||e[32]!==ee||e[33]!==E||e[34]!==B||e[35]!==G||e[36]!==z?(K=n.jsxs(yn,{disabled:z,className:V,"aria-disabled":ne,children:[X,ee,E,B,G]}),e[29]=V,e[30]=ne,e[31]=X,e[32]=ee,e[33]=E,e[34]=B,e[35]=G,e[36]=z,e[37]=K):K=e[37];let Y;e[38]!==g||e[39]!==y||e[40]!==u||e[41]!==b||e[42]!==k||e[43]!==T||e[44]!==P?(Y=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:P,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:y?n.jsx(Be,{className:"size-3.5"}):n.jsx(ut,{className:"size-3.5"})})]}),n.jsx("div",{ref:P,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=y,e[40]=u,e[41]=b,e[42]=k,e[43]=T,e[44]=P,e[45]=Y):Y=e[45];let ue;e[46]!==M||e[47]!==K||e[48]!==Y||e[49]!==A?(ue=n.jsxs(bn,{open:M,onOpenChange:A,className:"min-w-0",children:[K,Y]}),e[46]=M,e[47]=K,e[48]=Y,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 Z(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 Mt=4;function Lt(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=Ss();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:vs,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const o=We(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}}),j=(h.structuredContent??h).item?.metadata??{},y=(j.expanded_tools??[]).filter(S=>S.toolName!==b.toolName);y.push({...b,expandedAt:new Date().toISOString()});const v={...j,expanded_tools:y};return await o.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:s,data:{metadata:v}}}),y},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(y=>y.toolName!==b.toolName);return k.push({...b,expandedAt:new Date().toISOString()}),l.setQueryData(h,y=>y&&{...y,metadata:{...y.metadata??{},expanded_tools:k}}),{previous:N}},c=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},m=(b,h,N)=>{const j=me.ensureTask(t.id,s??"");N?.previous===void 0?l.removeQueries({queryKey:j,exact:!0}):l.setQueryData(j,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=Wt(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 y={...N?.metadata??{},expanded_tools:k};l.setQueryData(h,v=>v&&{...v,metadata:y}),r.patchThread({id:s,metadata:y}),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 Ns({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:Ms,label:"Write File"},edit:{icon:Zt,label:"Edit File"},grep:{icon:Rs,label:"Search Content"},glob:{icon:Ls,label:"Find Files"},bash:{icon:Yt,label:"Run Command"},read_tool_output:{icon:Ze,label:"Read Tool Output"},read_resource:{icon:Qt,label:"Read Resource"},read_prompt:{icon:jt,label:"Read Prompt"},enable_tool:{icon:Is,label:"Enable Tool"},open_in_agent:{icon:Xt,label:"Open in Agent"},sandbox:{icon:Jt,label:"Run Code"},copy_to_sandbox:{icon:vt,label:"Load File"},share_with_user:{icon:As,label:"Share with User"},take_screenshot:{icon:Ne,label:"Take Screenshot"},scrape_url:{icon:Ce,label:"Scrape URL"},inspect_page:{icon:Kt,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
1
+ import{r as H,e as $,R as at,H as Dt,G as Ht,j as n,B as ke,U as Xe,c as q,t as Bt,q as he,F as Ut,a as Wt,K as me,o as ze,n as Oe,f as je,E as qt,z as Vt,bu as De}from"./index-C4HbvW_W.js";import{Y as Gt,D as Kt,x as Jt,a9 as Xt,L as Qt,K as Yt,J as Zt,a5 as rt,aa as es,ab as ts,A as it,ac as ie,ad as ss,ae as ns,af as ls,b as os}from"./agent-icon-BzrzSnAz.js";import{t as He}from"./Stars01-Dv9c4Cee.js";import{a as ct,t as as,b as we,d as rs}from"./XCircle-DLzFRLwJ.js";import{i as Be}from"./Check-7lFZ8X77.js";import{i as Qe}from"./ChevronRight-BVo14pyp.js";import{a as ut,s as is}from"./Eye-DkuHnUAW.js";import{a as de,c as Ye,t as cs}from"./format-time-Cy7tTmZp.js";import{N as dt,R as ft,e as mt,C as us,f as ds,g as fs,u as ms,i as ps,d as xs}from"./scroll-area-DYzEAvWY.js";import{u as pt}from"./use-copy-CKGAQPRW.js";import{T as pe,a as xe,b as ge}from"./tooltip-DgiqborV.js";import{M as xt,I as gt,F as gs}from"./file-type-icon-CqbDePIX.js";import{c as hs}from"./content-blocks-o63cs2vh.js";import{g as ht,M as bs}from"./types-DP-Q3z5y.js";import{f as $e,i as ys,d as Ue,a as js}from"./chat-context-dBrooU1v.js";import{S as vs,u as We,c as Ns,b as ks}from"./constants-B521j7ay.js";import{n as Ss,f as _s,o as ws,q as Ts}from"./tab-id-B1KAdtlk.js";import{i as bt}from"./AlertCircle-PL6o_BFM.js";import{s as Ce,t as yt}from"./Star01-sX328yCS.js";import{s as Cs}from"./XClose-DNgFZbzC.js";import{n as jt}from"./ZapSquare-xDebNl-H.js";import{n as vt,i as $s}from"./Globe01-CcGroxBm.js";import{b as Is,i as Ms,a as Le}from"./Tool01-yp4kJRUu.js";import{i as Ze,a as Ls}from"./ZoomOut-CrlW2TUB.js";import{i as Ne}from"./Monitor01-D61B3ma3.js";import{i as Rs}from"./SearchMd-UxzEV07r.js";import{i as As}from"./Upload01-SHM-fhC7.js";import{u as zs,c as Ps}from"./shell-layout-tWuhPjHz.js";import{n as Nt}from"./LinkExternal01-BrUoXKJY.js";import{I as Ie}from"./integration-icon-C7p8BtkI.js";import{u as Es}from"./use-virtual-mcp-By6PZUzg.js";import{a as kt}from"./Users03-DbJl-FlT.js";import{a as ce}from"./Palette-CrqqEUcE.js";import{k as St}from"./use-navigate-to-agent-DwD_R1XG.js";import{a as Fs}from"./use-connection-DjURtMK5.js";import{s as Os}from"./Stars02-f0XE-eqW.js";import{g as Ds}from"./use-mcp-prompts-BNFsBgD1.js";import{c as Hs,b as Bs,d as Us,a as Ws,D as qs}from"./dialog-DqPItn-g.js";import{a as Vs,F as Gs,b as Ks,c as Js,d as Xs,f as Qs}from"./form-BIWGXIbK.js";import{I as Ys}from"./input-B5k-Hbp3.js";import{S as Zs}from"./spinner-C0Im7y7X.js";import{t as en}from"./ChevronDown-DBeUwQYn.js";const tn={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(tn)){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 fa(s){return s.reduce((e,t)=>Tt(e,t.metadata?.usage),wt())}function sn({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 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=Dt(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=Ht(p);let d;e[8]!==t?.arguments?(d=t?.arguments??[],e[8]=t?.arguments,e[9]=d):d=e[9];const x=d;let g;e[10]!==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 j;e[17]!==t._meta||e[18]!==t.name||e[19]!==t.title?(j=t.title||ln(t.name,qe(t._meta)),e[17]=t._meta,e[18]=t.name,e[19]=t.title,e[20]=j):j=e[20];let k;e[21]!==j?(k=n.jsx(Hs,{children:n.jsx("span",{className:"capitalize",children:j})}),e[21]=j,e[22]=k):k=e[22];let y;e[23]!==t.description?(y=t.description&&n.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),e[23]=t.description,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==k?(v=n.jsxs(Bs,{children:[k,y]}),e[25]=y,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=z=>n.jsx(Gs,{control:i.control,name:z.name,render:O=>{const{field:U}=O;return n.jsxs(Ks,{children:[n.jsxs(Js,{className:"text-xs",children:[z.name,z.required?null:n.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),n.jsx(Xs,{children:n.jsx(Ys,{...U,value:U.value??"",required:z.required,placeholder:z.description??"",className:"h-9",disabled:i.formState.isSubmitting})}),n.jsx(Qs,{})]})}},z.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(Zs,{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(Vs,{...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(Ws,{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 P;return e[63]!==N||e[64]!==F?(P=n.jsx(qs,{open:!0,onOpenChange:N,children:F}),e[63]=N,e[64]=F,e[65]=P):P=e[65],P}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 ma(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",j=i&&"outline-2 outline-blue-300 outline-offset-0",k=x&&"hover:brightness-95";let y;e[7]!==h||e[8]!==N||e[9]!==j||e[10]!==k?(y=q("px-1 py-1 rounded","inline-flex items-center gap-1",h,"select-none","text-xs font-light",N,j,k,"capitalize"),e[7]=h,e[8]=N,e[9]=j,e[10]=k,e[11]=y):y=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]!==y||e[17]!==v?(S=n.jsxs(mt,{onClick:b,className:y,children:[f,v]}),e[14]=f,e[15]=b,e[16]=y,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(17),{id:t,part:l,copyable:r,extraActions:a,alwaysShowActions:o}=s,u=r===void 0?!1:r,f=o===void 0?!1:o,{handleCopy:c}=pt(),[m,p]=H.useState(!1);let i;e[0]!==c||e[1]!==t||e[2]!==l.text?(i=async()=>{Bt("chat_message_copied",{message_id:t,chars:l.text.length}),await c(l.text),p(!0),setTimeout(()=>p(!1),2e3)},e[0]=c,e[1]=t,e[2]=l.text,e[3]=i):i=e[3];const d=i,x=u&&a,g=x||a;let b;e[4]!==t||e[5]!==l.text?(b=n.jsx(xt,{id:t,text:l.text}),e[4]=t,e[5]=l.text,e[6]=b):b=e[6];let h;e[7]!==f||e[8]!==a||e[9]!==d||e[10]!==m||e[11]!==g||e[12]!==x?(h=g&&n.jsxs("div",{className:q("flex w-full items-center gap-2 text-sm text-muted-foreground transition-all duration-200 mt-1 py-1",f?"opacity-100":"opacity-0 pointer-events-none group-hover/part:opacity-100 group-hover/part:pointer-events-auto"),children:[a,x&&a&&n.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),x&&n.jsx("button",{type:"button",onClick:d,className:"text-muted-foreground [@media(hover:hover)]:hover:text-foreground transition-colors active:scale-[0.97]","aria-label":"Copy message",children:m?n.jsx(Be,{className:"size-4"}):n.jsx(ut,{className:"size-4"})})]}),e[7]=f,e[8]=a,e[9]=d,e[10]=m,e[11]=g,e[12]=x,e[13]=h):h=e[13];let N;return e[14]!==b||e[15]!==h?(N=n.jsxs("div",{className:"group/part relative",children:[b,h]}),e[14]=b,e[15]=h,e[16]=N):N=e[16],N}function pa(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=q("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(Gt,{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 j;e[21]!==o?(j=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]=j):j=e[22];let k;e[23]!==h||e[24]!==N||e[25]!==j||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,j]})]}),e[23]=h,e[24]=N,e[25]=j,e[26]=d,e[27]=k):k=e[27];let y;return e[28]!==k||e[29]!==c?(y=n.jsxs(ge,{children:[c,k]}),e[28]=k,e[29]=c,e[30]=y):y=e[30],y}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 xa(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=q("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=q(h),e[7]=h,e[8]=N):N=e[8];let j;e[9]!==u||e[10]!==N?(j=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]=j):j=e[11];let k;e[12]!==o?(k=o.toFixed(0),e[12]=o,e[13]=k):k=e[13];let y;e[14]!==f?(y=f>0?` · $${f.toFixed(2)}`:"",e[14]=f,e[15]=y):y=e[15];let v;e[16]!==k||e[17]!==y?(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,"%",y]}),e[16]=k,e[17]=y,e[18]=v):v=e[18];let S;e[19]!==a||e[20]!==v||e[21]!==d||e[22]!==g||e[23]!==j?(S=n.jsx(pe,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:a,"aria-label":d,className:g,children:[j,v]})}),e[19]=a,e[20]=v,e[21]=d,e[22]=g,e[23]=j,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(fs,{"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(us,{"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(ds,{"data-slot":"collapsible-content",...t}),e[2]=t,e[3]=l):l=e[3],l}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,j]=H.useState(x??!1),{handleCopy:k,copied:y}=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:P}=sn(F),A=c?void 0:j,z=!T,O=T&&"[@media(hover:hover)]:hover:bg-accent/30",U=!T&&"cursor-default",W=v&&"shimmer";let V;e[7]!==U||e[8]!==W||e[9]!==O?(V=q("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",O,U,W),e[7]=U,e[8]=W,e[9]=O,e[10]=V):V=e[10];const ne=!T;let X;e[11]!==d||e[12]!==M||e[13]!==t||e[14]!==i||e[15]!==S||e[16]!==T?(X=n.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?n.jsx(Qe,{className:q("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",M&&"rotate-90")}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:q("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:q("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:q("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]=X):X=e[17];const Q=S?"text-warning/80":"text-foreground";let J;e[18]!==Q?(J=q("shrink-0 text-[14px] font-normal",Q),e[18]=Q,e[19]=J):J=e[19];let ee;e[20]!==J||e[21]!==l?(ee=n.jsx("span",{className:J,children:l}),e[20]=J,e[21]=l,e[22]=ee):ee=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 B;e[25]!==p?(B=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]=B):B=e[26];let G;e[27]!==r?(G=n.jsx(gn,{usage:r}),e[27]=r,e[28]=G):G=e[28];let K;e[29]!==V||e[30]!==ne||e[31]!==X||e[32]!==ee||e[33]!==E||e[34]!==B||e[35]!==G||e[36]!==z?(K=n.jsxs(yn,{disabled:z,className:V,"aria-disabled":ne,children:[X,ee,E,B,G]}),e[29]=V,e[30]=ne,e[31]=X,e[32]=ee,e[33]=E,e[34]=B,e[35]=G,e[36]=z,e[37]=K):K=e[37];let Y;e[38]!==g||e[39]!==y||e[40]!==u||e[41]!==b||e[42]!==k||e[43]!==T||e[44]!==P?(Y=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:P,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:y?n.jsx(Be,{className:"size-3.5"}):n.jsx(ut,{className:"size-3.5"})})]}),n.jsx("div",{ref:P,className:"h-0 shrink-0"})]})}))}),e[38]=g,e[39]=y,e[40]=u,e[41]=b,e[42]=k,e[43]=T,e[44]=P,e[45]=Y):Y=e[45];let ue;e[46]!==M||e[47]!==K||e[48]!==Y||e[49]!==A?(ue=n.jsxs(bn,{open:M,onOpenChange:A,className:"min-w-0",children:[K,Y]}),e[46]=M,e[47]=K,e[48]=Y,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 Z(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 Mt=4;function Lt(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=Ss();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:vs,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const o=We(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}}),j=(h.structuredContent??h).item?.metadata??{},y=(j.expanded_tools??[]).filter(S=>S.toolName!==b.toolName);y.push({...b,expandedAt:new Date().toISOString()});const v={...j,expanded_tools:y};return await o.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:s,data:{metadata:v}}}),y},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(y=>y.toolName!==b.toolName);return k.push({...b,expandedAt:new Date().toISOString()}),l.setQueryData(h,y=>y&&{...y,metadata:{...y.metadata??{},expanded_tools:k}}),{previous:N}},c=()=>{l.invalidateQueries({queryKey:me.ensureTask(t.id,s??"")})},m=(b,h,N)=>{const j=me.ensureTask(t.id,s??"");N?.previous===void 0?l.removeQueries({queryKey:j,exact:!0}):l.setQueryData(j,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=Wt(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 y={...N?.metadata??{},expanded_tools:k};l.setQueryData(h,v=>v&&{...v,metadata:y}),r.patchThread({id:s,metadata:y}),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 Ns({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:Ms,label:"Write File"},edit:{icon:Zt,label:"Edit File"},grep:{icon:Rs,label:"Search Content"},glob:{icon:Ls,label:"Find Files"},bash:{icon:Yt,label:"Run Command"},read_tool_output:{icon:Ze,label:"Read Tool Output"},read_resource:{icon:Qt,label:"Read Resource"},read_prompt:{icon:jt,label:"Read Prompt"},enable_tool:{icon:Is,label:"Enable Tool"},open_in_agent:{icon:Xt,label:"Open in Agent"},sandbox:{icon:Jt,label:"Run Code"},copy_to_sandbox:{icon:vt,label:"Load File"},share_with_user:{icon:As,label:"Share with User"},take_screenshot:{icon:Ne,label:"Take Screenshot"},scrape_url:{icon:Ce,label:"Scrape URL"},inspect_page:{icon:Kt,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
2
  ${l.text}`);else if(l.type==="source-url")t.push(`## Source URL
3
3
  ${l.url}`);else if(l.type==="source-document")t.push(`## Source Document
4
4
  ${l.title}`);else if(l.type==="file")t.push(`## File
@@ -32,7 +32,7 @@ Output: Tool execution was denied`)}}}return t.length>0?t.join(`
32
32
  ${s.input?.prompt??"No prompt provided"}
33
33
 
34
34
  # ${o?"Error":"Result"}
35
- ${x}`;return{fallbackTitle:c,summary:p,usage:e?.usage,latency:t,detail:g,state:f}}function Zn(s){const e=$.c(7),t=zt(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=zt(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=Es(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 Pt(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 Et(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(Pt,{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 j;e[16]!==h||e[17]!==N?(j=n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h,N]}),e[16]=h,e[17]=N,e[18]=j):j=e[18];let k;e[19]!==b||e[20]!==j?(k=n.jsxs("div",{className:"flex items-center gap-4",children:[b,j]}),e[19]=b,e[20]=j,e[21]=k):k=e[21];let y;e[22]!==o?(y=o&&n.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:o}),e[22]=o,e[23]=y):y=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]!==y?(_=n.jsxs("div",{className:"p-5 flex flex-col gap-6",children:[k,y,v,S]}),e[28]=v,e[29]=S,e[30]=k,e[31]=y,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(Z,{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(Z,{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,j=o?.colors,k=o?.fonts;let y;e[18]!==h||e[19]!==N||e[20]!==j||e[21]!==k||e[22]!==x||e[23]!==g||e[24]!==b?(y=n.jsx(Et,{logo:x,favicon:g,name:b,domain:h,overview:N,colors:j,fonts:k}),e[18]=h,e[19]=N,e[20]=j,e[21]=k,e[22]=x,e[23]=g,e[24]=b,e[25]=y):y=e[25];let v;return e[26]!==y||e[27]!==d?(v=n.jsxs(n.Fragment,{children:[d,y]}),e[26]=y,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(Z,{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(Z,{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(Et,{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 j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brands",state:"loading"}),e[9]=j):j=e[9],c=j;break e}if(g){let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ce,{}),e[10]=j):j=e[10];let k;e[11]!==l?(k=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[11]=l,e[12]=k):k=e[12];let y;e[13]!==k?(y=n.jsx(D,{icon:j,title:"Couldn't load brands",state:"error",trailing:k}),e[13]=k,e[14]=y):y=e[14],c=y;break e}if(d.length===0){let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ce,{}),e[15]=j):j=e[15];let k;e[16]!==l?(k=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[16]=l,e[17]=k):k=e[17];let y;e[18]!==k?(y=n.jsx(D,{icon:j,title:"No brands yet",summary:"The organization hasn't set up any brand context.",state:"idle",trailing:k}),e[18]=k,e[19]=y):y=e[19],c=y;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(Z,{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(Pt,{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=Fs(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:q(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=q("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:q("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:q(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:q(r,"rounded bg-muted animate-pulse")})},f)),o&&n.jsx("div",{className:q("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",a),children:n.jsx("div",{className:q(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 B=m.current,G=o.current;if(!B||!G)return;const K=(E.clientX-B.left)/B.width*100,Y=(E.clientY-B.top)/B.height*100;G.style.transform=`perspective(800px) rotateY(${(K-50)*.05}deg) rotateX(${(Y-50)*-.05}deg)`,u.current&&(u.current.style.opacity="1",u.current.style.transform=`translate(${(K-50)*.15}px, ${(Y-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 B=t.state==="output-denied"?"Agent creation cancelled":"Couldn't create agent";let G;e[6]!==l?(G=n.jsx(Z,{latency:l}),e[6]=l,e[7]=G):G=e[7];let K;return e[8]!==B||e[9]!==G?(K=n.jsx(D,{icon:E,title:B,state:"error",trailing:G}),e[8]=B,e[9]=G,e[10]=K):K=e[10],K}let h,N,j;if(e[11]!==l||e[12]!==t.output){j=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 B;e[17]!==l?(B=n.jsx(D,{icon:E,title:"Agent created",state:"idle",trailing:n.jsx(Z,{latency:l})}),e[17]=l,e[18]=B):B=e[18],j=B;break e}N=(h.connections??[]).map(Nl)}e[11]=l,e[12]=t.output,e[13]=h,e[14]=N,e[15]=j}else h=e[13],N=e[14],j=e[15];if(j!==Symbol.for("react.early_return_sentinel"))return j;const k=N;let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ie,{className:"text-emerald-500"}),e[19]=y):y=e[19];const v=`Agent created: ${h.title}`;let S;e[20]!==l?(S=n.jsx(Z,{latency:l}),e[20]=l,e[21]=S):S=e[21];let _;e[22]!==v||e[23]!==S?(_=n.jsx(D,{icon:y,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 P;e[35]!==h.title?(P=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]=P):P=e[36];let A;e[37]!==F||e[38]!==P?(A=n.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[F,P]}),e[37]=F,e[38]=P,e[39]=A):A=e[39];let z;e[40]!==h.description?(z=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]=z):z=e[41];let O;e[42]!==A||e[43]!==z?(O=n.jsxs("div",{className:"relative",children:[A,z]}),e[42]=A,e[43]=z,e[44]=O):O=e[44];let U;e[45]!==k?(U=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]=U):U=e[46];let W;e[47]!==U?(W=n.jsx("div",{className:"flex-1 min-w-0",children:U}),e[47]=U,e[48]=W):W=e[48];let V;e[49]!==h.id||e[50]!==r?(V=()=>r(h.id),e[49]=h.id,e[50]=r,e[51]=V):V=e[51];const ne=`See agent: ${h.title}`;let X;e[52]!==V||e[53]!==ne?(X=n.jsx("div",{className:"flex items-center gap-2 shrink-0",children:n.jsx(ke,{size:"sm",className:"h-7",onClick:V,"aria-label":ne,children:"See agent"})}),e[52]=V,e[53]=ne,e[54]=X):X=e[54];let Q;e[55]!==W||e[56]!==X?(Q=n.jsxs("div",{className:"relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1",children:[W,X]}),e[55]=W,e[56]=X,e[57]=Q):Q=e[57];let J;e[58]!==O||e[59]!==Q?(J=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]=J):J=e[60];let ee;return e[61]!==J||e[62]!==_?(ee=n.jsxs(n.Fragment,{children:[_,J]}),e[61]=J,e[62]=_,e[63]=ee):ee=e[63],ee}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(Z,{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(Z,{latency:l})}),e[21]=l,e[22]=S):S=e[22],d=S;break e}const N=c.slice(0,Mt);f=c.length-N.length;let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ie,{className:"text-emerald-500"}),e[23]=j):j=e[23];const k=c.length===1?"1 agent":`${c.length} agents`;let y;e[24]!==l?(y=n.jsx(Z,{latency:l}),e[24]=l,e[25]=y):y=e[25],e[26]!==k||e[27]!==y?(i=n.jsx(D,{icon:j,title:k,state:"idle",trailing:y}),e[26]=k,e[27]=y,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(Lt,{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=q("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(Z,{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(Z,{latency:l})}),e[20]=l,e[21]=S):S=e[21],d=S;break e}const N=c.slice(0,Mt);f=c.length-N.length;let j;e[22]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(we,{className:"text-emerald-500"}),e[22]=j):j=e[22];const k=c.length===1?"1 connection":`${c.length} connections`;let y;e[23]!==l?(y=n.jsx(Z,{latency:l}),e[23]=l,e[24]=y):y=e[24],e[25]!==k||e[26]!==y?(i=n.jsx(D,{icon:j,title:k,state:"idle",trailing:y}),e[25]=k,e[26]=y,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(Lt,{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=Ue(),{sendMessage:t,isStreaming:l,messages:r}=js(),{org:a}=he(),o=e?.virtualMcpId,{prompts:u}=Ps(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=We(c),[p,i]=H.useState(null);if(!o||l||!ks(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 Ds(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 j=N;let k,y;s[19]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Os,{size:12,className:"shrink-0 text-purple-500"}),y=n.jsx("span",{className:"font-medium text-foreground/80",children:"Next:"}),s[19]=k,s[20]=y):(k=s[19],y=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]!==j||s[25]!==v?(_=n.jsxs("button",{type:"button",onClick:j,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,y,v,S]}),s[24]=j,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=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:ws(f.path),label:f.name||f.path,kind:"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 Pl(){const s=$.c(9),e=je(),t=$e()?.messages??[],l=zl(t);if(l.length===0)return null;const r=l.some(Fl),a=l.some(El),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($s,{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 El(s){return s.kind==="page"}function Fl(s){return s.kind==="deck"}async function Ol(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 ga(){const s=$.c(2),e=$e()?.messages??[];let t;return s[0]!==e?(t=e.some(Dl),s[0]=e,s[1]=t):t=s[1],t}function Dl(s){return s.parts?.some(Hl)}function Hl(s){const e=s;return(e.type==="tool-share_with_user"||e.type==="tool-bash"||e.type==="tool-write")&&e.state==="output-available"}function Bl(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=()=>Ol(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:Ts(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(gs,{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 Wl=/(^|\/)output\//;function ql(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&&Wl.test(r)&&e.add(ot(r))}}}return e}function Vl(s){const e=$.c(4),{threadId:t,message:l}=s,r=ql(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}=Bl(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(Gl);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 Gl(s){return n.jsx(Ul,{file:s},s.key)}function Kl(s){return s.type==="reasoning"}function Jl(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(Kl(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 Xl(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 Ft=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Ql(){const s=$.c(5),[e]=H.useState(Yl);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=Ft.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 Yl(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Ft.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}const Zl={planning:{icon:n.jsx(ss,{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"}},eo=1200;function to(){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")},eo);return()=>{clearTimeout(f)}},r=[],s[0]=l,s[1]=r):(l=s[0],r=s[1]),H.useEffect(l,r);const a=Zl[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 so(s){const e=$.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ql,{}),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(Xl,{since:t})]}),e[1]=t,e[2]=r):r=e[2],r}function no(s){const e=$.c(20),{duration:t,parts:l,isStreaming:r}=s;let a;e[0]!==l?(a=l.every(ao),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 j=l.map(oo).join(`
35
+ ${x}`;return{fallbackTitle:c,summary:p,usage:e?.usage,latency:t,detail:g,state:f}}function Zn(s){const e=$.c(7),t=zt(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=zt(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=Es(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 Pt(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 Et(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(Pt,{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 j;e[16]!==h||e[17]!==N?(j=n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h,N]}),e[16]=h,e[17]=N,e[18]=j):j=e[18];let k;e[19]!==b||e[20]!==j?(k=n.jsxs("div",{className:"flex items-center gap-4",children:[b,j]}),e[19]=b,e[20]=j,e[21]=k):k=e[21];let y;e[22]!==o?(y=o&&n.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:o}),e[22]=o,e[23]=y):y=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]!==y?(_=n.jsxs("div",{className:"p-5 flex flex-col gap-6",children:[k,y,v,S]}),e[28]=v,e[29]=S,e[30]=k,e[31]=y,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(Z,{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(Z,{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,j=o?.colors,k=o?.fonts;let y;e[18]!==h||e[19]!==N||e[20]!==j||e[21]!==k||e[22]!==x||e[23]!==g||e[24]!==b?(y=n.jsx(Et,{logo:x,favicon:g,name:b,domain:h,overview:N,colors:j,fonts:k}),e[18]=h,e[19]=N,e[20]=j,e[21]=k,e[22]=x,e[23]=g,e[24]=b,e[25]=y):y=e[25];let v;return e[26]!==y||e[27]!==d?(v=n.jsxs(n.Fragment,{children:[d,y]}),e[26]=y,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(Z,{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(Z,{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(Et,{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 j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(D,{icon:n.jsx(ce,{className:"animate-pulse"}),title:"Loading brands",state:"loading"}),e[9]=j):j=e[9],c=j;break e}if(g){let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ce,{}),e[10]=j):j=e[10];let k;e[11]!==l?(k=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[11]=l,e[12]=k):k=e[12];let y;e[13]!==k?(y=n.jsx(D,{icon:j,title:"Couldn't load brands",state:"error",trailing:k}),e[13]=k,e[14]=y):y=e[14],c=y;break e}if(d.length===0){let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ce,{}),e[15]=j):j=e[15];let k;e[16]!==l?(k=l!=null&&l>0?n.jsx(Z,{latency:l}):void 0,e[16]=l,e[17]=k):k=e[17];let y;e[18]!==k?(y=n.jsx(D,{icon:j,title:"No brands yet",summary:"The organization hasn't set up any brand context.",state:"idle",trailing:k}),e[18]=k,e[19]=y):y=e[19],c=y;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(Z,{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(Pt,{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=Fs(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:q(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=q("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:q("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:q(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:q(r,"rounded bg-muted animate-pulse")})},f)),o&&n.jsx("div",{className:q("shrink-0 bg-background ring-1 ring-background border border-border rounded-lg flex items-center justify-center",a),children:n.jsx("div",{className:q(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 B=m.current,G=o.current;if(!B||!G)return;const K=(E.clientX-B.left)/B.width*100,Y=(E.clientY-B.top)/B.height*100;G.style.transform=`perspective(800px) rotateY(${(K-50)*.05}deg) rotateX(${(Y-50)*-.05}deg)`,u.current&&(u.current.style.opacity="1",u.current.style.transform=`translate(${(K-50)*.15}px, ${(Y-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 B=t.state==="output-denied"?"Agent creation cancelled":"Couldn't create agent";let G;e[6]!==l?(G=n.jsx(Z,{latency:l}),e[6]=l,e[7]=G):G=e[7];let K;return e[8]!==B||e[9]!==G?(K=n.jsx(D,{icon:E,title:B,state:"error",trailing:G}),e[8]=B,e[9]=G,e[10]=K):K=e[10],K}let h,N,j;if(e[11]!==l||e[12]!==t.output){j=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 B;e[17]!==l?(B=n.jsx(D,{icon:E,title:"Agent created",state:"idle",trailing:n.jsx(Z,{latency:l})}),e[17]=l,e[18]=B):B=e[18],j=B;break e}N=(h.connections??[]).map(Nl)}e[11]=l,e[12]=t.output,e[13]=h,e[14]=N,e[15]=j}else h=e[13],N=e[14],j=e[15];if(j!==Symbol.for("react.early_return_sentinel"))return j;const k=N;let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ie,{className:"text-emerald-500"}),e[19]=y):y=e[19];const v=`Agent created: ${h.title}`;let S;e[20]!==l?(S=n.jsx(Z,{latency:l}),e[20]=l,e[21]=S):S=e[21];let _;e[22]!==v||e[23]!==S?(_=n.jsx(D,{icon:y,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 P;e[35]!==h.title?(P=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]=P):P=e[36];let A;e[37]!==F||e[38]!==P?(A=n.jsxs("div",{className:"flex items-center gap-2.5 p-2",children:[F,P]}),e[37]=F,e[38]=P,e[39]=A):A=e[39];let z;e[40]!==h.description?(z=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]=z):z=e[41];let O;e[42]!==A||e[43]!==z?(O=n.jsxs("div",{className:"relative",children:[A,z]}),e[42]=A,e[43]=z,e[44]=O):O=e[44];let U;e[45]!==k?(U=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]=U):U=e[46];let W;e[47]!==U?(W=n.jsx("div",{className:"flex-1 min-w-0",children:U}),e[47]=U,e[48]=W):W=e[48];let V;e[49]!==h.id||e[50]!==r?(V=()=>r(h.id),e[49]=h.id,e[50]=r,e[51]=V):V=e[51];const ne=`See agent: ${h.title}`;let X;e[52]!==V||e[53]!==ne?(X=n.jsx("div",{className:"flex items-center gap-2 shrink-0",children:n.jsx(ke,{size:"sm",className:"h-7",onClick:V,"aria-label":ne,children:"See agent"})}),e[52]=V,e[53]=ne,e[54]=X):X=e[54];let Q;e[55]!==W||e[56]!==X?(Q=n.jsxs("div",{className:"relative z-[3] flex items-center gap-2.5 px-2 pt-6 pb-1",children:[W,X]}),e[55]=W,e[56]=X,e[57]=Q):Q=e[57];let J;e[58]!==O||e[59]!==Q?(J=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]=J):J=e[60];let ee;return e[61]!==J||e[62]!==_?(ee=n.jsxs(n.Fragment,{children:[_,J]}),e[61]=J,e[62]=_,e[63]=ee):ee=e[63],ee}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(Z,{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(Z,{latency:l})}),e[21]=l,e[22]=S):S=e[22],d=S;break e}const N=c.slice(0,Mt);f=c.length-N.length;let j;e[23]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ie,{className:"text-emerald-500"}),e[23]=j):j=e[23];const k=c.length===1?"1 agent":`${c.length} agents`;let y;e[24]!==l?(y=n.jsx(Z,{latency:l}),e[24]=l,e[25]=y):y=e[25],e[26]!==k||e[27]!==y?(i=n.jsx(D,{icon:j,title:k,state:"idle",trailing:y}),e[26]=k,e[27]=y,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(Lt,{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=q("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(Z,{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(Z,{latency:l})}),e[20]=l,e[21]=S):S=e[21],d=S;break e}const N=c.slice(0,Mt);f=c.length-N.length;let j;e[22]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(we,{className:"text-emerald-500"}),e[22]=j):j=e[22];const k=c.length===1?"1 connection":`${c.length} connections`;let y;e[23]!==l?(y=n.jsx(Z,{latency:l}),e[23]=l,e[24]=y):y=e[24],e[25]!==k||e[26]!==y?(i=n.jsx(D,{icon:j,title:k,state:"idle",trailing:y}),e[25]=k,e[26]=y,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(Lt,{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=Ue(),{sendMessage:t,isStreaming:l,messages:r}=js(),{org:a}=he(),o=e?.virtualMcpId,{prompts:u}=Ps(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=We(c),[p,i]=H.useState(null);if(!o||l||!ks(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 Ds(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 j=N;let k,y;s[19]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(Os,{size:12,className:"shrink-0 text-purple-500"}),y=n.jsx("span",{className:"font-medium text-foreground/80",children:"Next:"}),s[19]=k,s[20]=y):(k=s[19],y=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]!==j||s[25]!==v?(_=n.jsxs("button",{type:"button",onClick:j,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,y,v,S]}),s[24]=j,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=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:ws(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 Pl(){const s=$.c(9),e=je(),t=$e()?.messages??[],l=zl(t);if(l.length===0)return null;const r=l.some(Fl),a=l.some(El),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($s,{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 El(s){return s.kind==="page"}function Fl(s){return s.kind==="deck"}async function Ol(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 ga(){const s=$.c(2),e=$e()?.messages??[];let t;return s[0]!==e?(t=e.some(Dl),s[0]=e,s[1]=t):t=s[1],t}function Dl(s){return s.parts?.some(Hl)}function Hl(s){const e=s;return(e.type==="tool-share_with_user"||e.type==="tool-bash"||e.type==="tool-write")&&e.state==="output-available"}function Bl(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=()=>Ol(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:Ts(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(gs,{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 Wl=/(^|\/)output\//;function ql(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&&Wl.test(r)&&e.add(ot(r))}}}return e}function Vl(s){const e=$.c(4),{threadId:t,message:l}=s,r=ql(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}=Bl(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(Gl);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 Gl(s){return n.jsx(Ul,{file:s},s.key)}function Kl(s){return s.type==="reasoning"}function Jl(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(Kl(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 Xl(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 Ft=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function Ql(){const s=$.c(5),[e]=H.useState(Yl);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=Ft.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 Yl(){const s=`var(--chart-${Math.ceil(Math.random()*5)})`;return Ft.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":s)}const Zl={planning:{icon:n.jsx(ss,{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"}},eo=1200;function to(){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")},eo);return()=>{clearTimeout(f)}},r=[],s[0]=l,s[1]=r):(l=s[0],r=s[1]),H.useEffect(l,r);const a=Zl[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 so(s){const e=$.c(3),{startedAt:t}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Ql,{}),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(Xl,{since:t})]}),e[1]=t,e[2]=r):r=e[2],r}function no(s){const e=$.c(20),{duration:t,parts:l,isStreaming:r}=s;let a;e[0]!==l?(a=l.every(ao),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 j=l.map(oo).join(`
36
36
  `).trim().split(`
37
37
  `).filter(Boolean),k=r?j[j.length-1]??"":j[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(lo).join(`
38
38
 
@@ -1 +1 @@
1
- import{e as o,j as t,dn as n}from"./index-C_oSBqFD.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
1
+ import{e as o,j as t,dn as n}from"./index-C4HbvW_W.js";function a(){const s=o.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),s[0]=e):e=s[0],e}export{a as default};
@@ -1 +1 @@
1
- import{e as S,j as s,r as w,dn as y}from"./index-C_oSBqFD.js";import{i as R}from"./Check--VLhXi5l.js";import{t as _}from"./ChevronDown-66ErjaPf.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function $(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{$ as default};
1
+ import{e as S,j as s,r as w,dn as y}from"./index-C4HbvW_W.js";import{i as R}from"./Check-7lFZ8X77.js";import{t as _}from"./ChevronDown-DBeUwQYn.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function $(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{$ as default};
@@ -1 +1 @@
1
- import{r as 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-C_oSBqFD.js";import{u as ae}from"./use-connection-DTKE65yR.js";import{S as ce,u as ue,j as de}from"./constants-DI_u-hVk.js";import{a as me}from"./Settings02-BylJiOHK.js";import{P as z}from"./index-C1kxS2Io.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
+ 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-C4HbvW_W.js";import{u as ae}from"./use-connection-DjURtMK5.js";import{S as ce,u as ue,j as de}from"./constants-B521j7ay.js";import{a as me}from"./Settings02-DhqQsm8K.js";import{P as z}from"./index-2xBvfJLJ.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 +1 @@
1
- import{r as i,bc as $,j as c,da as L,bd as z,bq as A,a6 as _,a7 as g,db as b,bf as j,dc as G,dd as w,di as H,dj as K,af as q,dk as U,dl as V,dm as W,de as Z,df as B,dh as J,e as R,c as Q}from"./index-C_oSBqFD.js";var m="Popover",[E]=q(m,[w]),P=w(),[X,u]=E(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:z(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(S,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),C=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(B,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=T;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};
1
+ import{r as i,bc as $,j as c,da as L,bd as z,bq as A,a6 as _,a7 as g,db as b,bf as j,dc as G,dd as w,di as H,dj as K,af as q,dk as U,dl as V,dm as W,de as Z,df as B,dh as J,e as R,c as Q}from"./index-C4HbvW_W.js";var m="Popover",[E]=q(m,[w]),P=w(),[X,u]=E(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[d,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:z(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(S,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=u(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=O;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=u(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return H(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(k,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,d=p.button===2||l;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=u(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(k,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),k=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:h,...x}=t,f=u(v,o),C=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(B,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=u(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=T;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=y,le=D,de=M;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let d;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(d=c.jsx(le,{children:c.jsx(de,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=d):d=e[11],d}export{fe as P,ve as a,ge as b};