decocms 4.30.2 → 4.30.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/client/assets/{AlertCircle-DnAYXfMU.js → AlertCircle-DahgYBAW.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-TtNUPTQB.js → ArrowUpRight-DFvdnwNr.js} +1 -1
  3. package/dist/client/assets/{Check-BvrjRK-f.js → Check-g-NnDeM7.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-C6nWvFHV.js → CheckCircle-Cb5Jbg2t.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DYHTINZW.js → ChevronDown-CQf5r-0t.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-Bl9YVPs6.js → ChevronRight-BzUdHMwK.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-B18hle8l.js → ChevronUp-8lp9PAbT.js} +1 -1
  8. package/dist/client/assets/{Circle-DPVk1czd.js → Circle-C2Tx9gws.js} +1 -1
  9. package/dist/client/assets/{Copy01-CrUgsJcD.js → Copy01-q2tZkjT4.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BndxtaEo.js → DotsVertical-Fs6hrY9l.js} +1 -1
  11. package/dist/client/assets/{Eye-ClTWumnI.js → Eye-C5-fhZcB.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CTf9rlZx.js → FilterLines-Dorw2Z-z.js} +1 -1
  13. package/dist/client/assets/{Globe01-BoyjWYdB.js → Globe01-Bin8wesr.js} +1 -1
  14. package/dist/client/assets/{Globe04-Cu0R3oaF.js → Globe04-DBhgUNpj.js} +1 -1
  15. package/dist/client/assets/{HardDrive-PM-PT0eV.js → HardDrive-iJnKVXq3.js} +1 -1
  16. package/dist/client/assets/{Key01-7XhjBNK3.js → Key01-C6YLNaPI.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-DfWu_TMe.js → LayoutLeft-BtyrGENa.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-C1Hc9Rj3.js → LinkExternal01-CGvkWc_L.js} +1 -1
  19. package/dist/client/assets/{List-BSXYor2Z.js → List-BwGozbNv.js} +1 -1
  20. package/dist/client/assets/{Loading02-ye_m_QAK.js → Loading02-CspLF2F0.js} +1 -1
  21. package/dist/client/assets/{Monitor01-CWCFfYgZ.js → Monitor01-BWuNG8O1.js} +1 -1
  22. package/dist/client/assets/{Palette-DpDs-Lap.js → Palette-DSmqzbCU.js} +1 -1
  23. package/dist/client/assets/{Play-lmf5c9Jo.js → Play-IThg_ZW4.js} +1 -1
  24. package/dist/client/assets/{Plus-DK37ytOg.js → Plus-BtlyhCvw.js} +1 -1
  25. package/dist/client/assets/{SearchLg-ox88sikc.js → SearchLg-C6-jg5ay.js} +1 -1
  26. package/dist/client/assets/{SearchMd-DbAiVRZR.js → SearchMd-DQPYNWst.js} +1 -1
  27. package/dist/client/assets/{Settings02-N3uovfLI.js → Settings02-DMsX-AbA.js} +1 -1
  28. package/dist/client/assets/{Shield01-CGCJBA4k.js → Shield01-wI6Ku8QP.js} +1 -1
  29. package/dist/client/assets/{Star01-CVz_7GBv.js → Star01-CPrulluL.js} +1 -1
  30. package/dist/client/assets/{Stars01-D6zQVCEN.js → Stars01-0PPh4bxa.js} +1 -1
  31. package/dist/client/assets/{Stars02-CxeSSA7g.js → Stars02-De8VF47I.js} +1 -1
  32. package/dist/client/assets/{Sun-e9bFqj0N.js → Sun-i1Uh6gT7.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-CTmNw19f.js → SwitchHorizontal01-CYAijPcz.js} +1 -1
  34. package/dist/client/assets/{Tool01-Do_IYkhs.js → Tool01-D-4KEBn9.js} +1 -1
  35. package/dist/client/assets/{Trash01-DPHj7EPF.js → Trash01-CcpK6AE5.js} +1 -1
  36. package/dist/client/assets/{Upload01-H4u3fcTc.js → Upload01-CV5XE_H-.js} +1 -1
  37. package/dist/client/assets/{User01-GIEDPABY.js → User01-UnD8sXXC.js} +1 -1
  38. package/dist/client/assets/{Users01-hbEK4T_M.js → Users01-D9OMjKlD.js} +1 -1
  39. package/dist/client/assets/{Users03-BjPo5EJz.js → Users03-0vBMlaHT.js} +1 -1
  40. package/dist/client/assets/{X-B11_-bWv.js → X-CF1SImWI.js} +1 -1
  41. package/dist/client/assets/{XCircle-DhEfH4xa.js → XCircle-DinyVT9K.js} +1 -1
  42. package/dist/client/assets/{XClose-7c8y3nr7.js → XClose-Bxhu78Fb.js} +1 -1
  43. package/dist/client/assets/{Zap-C6zrTK7v.js → Zap-07K1SyLr.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-D9UGTwX8.js → ZapSquare-V3ed5UhP.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-COjlHAto.js → ZoomOut-CS9L-ywb.js} +1 -1
  46. package/dist/client/assets/{access-gate-cQiB1PTp.js → access-gate-sOMdTn1N.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-CzTGC6D4.js → add-section-modal-ScvkCHGT.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-DGJfVNFQ.js → agent-capabilities-BDsdarxp.js} +1 -1
  49. package/dist/client/assets/{agent-icon-Cg17MSXd.js → agent-icon-DZ_0evWF.js} +1 -1
  50. package/dist/client/assets/{agents-list-DtJ5AwUc.js → agents-list-BhRlrNCO.js} +1 -1
  51. package/dist/client/assets/{ai-providers-zedfjYwR.js → ai-providers-BEIul-dP.js} +1 -1
  52. package/dist/client/assets/{alert-CH-ji8jT.js → alert-BQRsMGOB.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-DCVvUTHg.js → alert-dialog-1uk4XW0i.js} +1 -1
  54. package/dist/client/assets/{app-editor-CcSesL6B.js → app-editor-BaEEpWyZ.js} +1 -1
  55. package/dist/client/assets/{auth-D3gb8a1G.js → auth-9NoVZgB6.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-OeWX2Rae.js → auth-catchall-LsHDtBHa.js} +1 -1
  57. package/dist/client/assets/{auth-entry-DO2h9Nld.js → auth-entry-CIfDT0zB.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-Dhzw613v.js → auth-split-layout--1bSlVCz.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-D74XVxJq.js → authenticate-and-persist-oauth-iB_3ma16.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-DESlAeXT.js → automation-list-row-422-OwHD.js} +1 -1
  61. package/dist/client/assets/{automation-runs-W3FykFwC.js → automation-runs-28NQZMHr.js} +1 -1
  62. package/dist/client/assets/{automations-BPCmHVJZ.js → automations-BKCoRJMk.js} +1 -1
  63. package/dist/client/assets/{autosend-Ci7tspr4.js → autosend-4FyzrbIb.js} +1 -1
  64. package/dist/client/assets/{avatar-pA-6XVGw.js → avatar-D_h7Zjsw.js} +1 -1
  65. package/dist/client/assets/{badge-9NVu_VdI.js → badge-DXC7bKKl.js} +1 -1
  66. package/dist/client/assets/{block-document-D1IvbVsR.js → block-document-BsPbSNiI.js} +1 -1
  67. package/dist/client/assets/{brand-context-Cfpp64p-.js → brand-context-CpnAGTiZ.js} +1 -1
  68. package/dist/client/assets/{breadcrumb-CyK1O4L9.js → breadcrumb-BwIaP-rJ.js} +1 -1
  69. package/dist/client/assets/{buckets-DrIzuaKD.js → buckets-DHZN8xYR.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-fFPPHHPj.js → bulk-category-panel-BwiCRDcU.js} +1 -1
  71. package/dist/client/assets/{calendar-DN0gI0pg.js → calendar-bPGbJoTG.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DJ112fpN.js → capability-load-error-BXHBgQBK.js} +1 -1
  73. package/dist/client/assets/{card-z0DIgOE_.js → card-Cwa4ZL2D.js} +1 -1
  74. package/dist/client/assets/{category-editor-8gyBAsEs.js → category-editor-DuOHJglh.js} +1 -1
  75. package/dist/client/assets/{chat-context-BD7KZRIw.js → chat-context-C_WNvxNI.js} +1 -1
  76. package/dist/client/assets/{checkbox-BD6yTuo9.js → checkbox-CHVHNKgG.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-4WAUWGOy.js → cli-auth-success-CMX_2NEu.js} +1 -1
  78. package/dist/client/assets/{collection-detail-Cw5VsLUF.js → collection-detail-Pr7XoaFH.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-_LfG8OU8.js → collection-display-button-vb-Fzdbo.js} +1 -1
  80. package/dist/client/assets/{collection-search-IlxdiWIS.js → collection-search-BXhrJ3CT.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-Cm4IDZta.js → collection-table-wrapper-D595XFT7.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-B4OrNtqt.js → collection-tabs-BbxGuA_q.js} +1 -1
  83. package/dist/client/assets/{command-B5VkuRkm.js → command-B_ZTQl7x.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-Cjz_0OMT.js → commerce-onboarding-tM0opXnY.js} +1 -1
  85. package/dist/client/assets/{connect-desktop-dialog-Dl5P-KpW.js → connect-desktop-dialog-D2NDgQpd.js} +1 -1
  86. package/dist/client/assets/{connection-card-BkLSl9Um.js → connection-card-BAKQiVMF.js} +1 -1
  87. package/dist/client/assets/{connection-detail-C2gEsKL9.js → connection-detail-v_0Xhfc7.js} +1 -1
  88. package/dist/client/assets/{connection-form-helpers-BPxpL3kZ.js → connection-form-helpers-DrDDHd82.js} +1 -1
  89. package/dist/client/assets/{connections-pkPDtQ8_.js → connections-DqW0w_mP.js} +1 -1
  90. package/dist/client/assets/{decopilot-sse-pool-mwjxYiq3.js → decopilot-sse-pool-n-O90qSn.js} +1 -1
  91. package/dist/client/assets/{dialog-1Eqcgb9h.js → dialog-D9ySvI1O.js} +1 -1
  92. package/dist/client/assets/{domain-settings-Dohjkz1h.js → domain-settings-DIaD8BEa.js} +1 -1
  93. package/dist/client/assets/{drawer-DgApXJiu.js → drawer-Blh4Dutf.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-DQljEt7c.js → dropdown-menu-B44reSZZ.js} +1 -1
  95. package/dist/client/assets/{empty-state-Ds7boKzG.js → empty-state-zdXkwwb2.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-BjQiSug0.js → extract-connection-data-CGzSQ9wP.js} +1 -1
  97. package/dist/client/assets/{file-explorer-BsT5nmcT.js → file-explorer-DHxP1fFK.js} +1 -1
  98. package/dist/client/assets/{file-type-icon-DFmN-X_v.js → file-type-icon-4Nl8k_Im.js} +1 -1
  99. package/dist/client/assets/{files-3UKz8-rY.js → files-BjLse1kM.js} +1 -1
  100. package/dist/client/assets/{form-uObUvJsx.js → form-BBc7G1M6.js} +1 -1
  101. package/dist/client/assets/{general-BRqph6Dj.js → general-CjP0j72O.js} +1 -1
  102. package/dist/client/assets/{github-repo-picker--Ek5Q2kM.js → github-repo-picker-CNnbOcMn.js} +1 -1
  103. package/dist/client/assets/{hooks-D0_F2fuV.js → hooks-n5BHrfUo.js} +1 -1
  104. package/dist/client/assets/{index-CsCCWNU9.js → index-BD5wcfs8.js} +5 -5
  105. package/dist/client/assets/{index-DLj7x7R3.js → index-BlGYFht5.js} +1 -1
  106. package/dist/client/assets/{index-BvSoUF3k.js → index-CIP_LsWw.js} +1 -1
  107. package/dist/client/assets/{index-D49TFDgG.js → index-CMNTlOrD.js} +1 -1
  108. package/dist/client/assets/{index-BhkyjzCF.js → index-Cm-rxw52.js} +1 -1
  109. package/dist/client/assets/{index-CRGi0rZP.js → index-DC_IvZxa.js} +1 -1
  110. package/dist/client/assets/{index-BiNiHAi9.js → index-DEki5BO4.js} +1 -1
  111. package/dist/client/assets/{index-HXlkJk8d.js → index-DKbAUtwh.js} +1 -1
  112. package/dist/client/assets/{index-BYp7Ofgs.js → index-DMN_Rked.js} +3 -3
  113. package/dist/client/assets/{index-DV-YI8KM.js → index-Df_CG2vv.js} +1 -1
  114. package/dist/client/assets/{index-7MM5fVQo.js → index-DkKZoD-8.js} +1 -1
  115. package/dist/client/assets/{index-BDPw5_B7.js → index-Dl1-ehCT.js} +1 -1
  116. package/dist/client/assets/{index-B4fQG-zs.js → index-DvkpXDsz.js} +1 -1
  117. package/dist/client/assets/{index-redirect-D_z5S11g.js → index-redirect-FeJ2X6MU.js} +1 -1
  118. package/dist/client/assets/{index-R9eJcMBA.js → index-sLJskMXr.js} +1 -1
  119. package/dist/client/assets/{input-C7dZO9ym.js → input-C9Uf8Uy-.js} +1 -1
  120. package/dist/client/assets/{integration-icon-FGiS_d1C.js → integration-icon-BaD8axF8.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-D1ExdVDs.js → invite-member-dialog-Dj0RpUB1.js} +1 -1
  122. package/dist/client/assets/{label-C1WcZg4i.js → label-CX8Gr6s6.js} +1 -1
  123. package/dist/client/assets/{login-DXbx_t2u.js → login-C-Jx8ijJ.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-D_BuxJo5.js → mcp-oauth-KLMYE_3J.js} +1 -1
  125. package/dist/client/assets/{members-ClFgHkOh.js → members-Ch9YFiYG.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-bcLWH9Yf.js → monaco-editor-Lf5x2wuL.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-DQjdFov1.js → monitoring-stats-row-B7A-k6Rm.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-BONoAGnw.js → oauth-callback-Bb6Y5V1l.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-D2kGA20A.js → oauth-callback-ai-provider-Bih51YTD.js} +1 -1
  130. package/dist/client/assets/{onboarding-OfWimmEv.js → onboarding-Ccuma9Sa.js} +1 -1
  131. package/dist/client/assets/{org-install-CDsn26MI.js → org-install-DH2CieG1.js} +1 -1
  132. package/dist/client/assets/{org-layout-C9pMQN-q.js → org-layout-C4BYumWE.js} +1 -1
  133. package/dist/client/assets/{organization-choice-S7ZXrRI1.js → organization-choice-cTd76Ds7.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-DVuWK58d.js → page-seo-form-DONj3S3U.js} +1 -1
  135. package/dist/client/assets/page-seo-sheet-CgcrydvS.js +1 -0
  136. package/dist/client/assets/{popover-CxakTUJX.js → popover-Clng0ZJV.js} +1 -1
  137. package/dist/client/assets/{post-editor-CuGlxxiD.js → post-editor-DPFw7r4n.js} +1 -1
  138. package/dist/client/assets/{primitives-DWMNMXxf.js → primitives-7ig3TufE.js} +1 -1
  139. package/dist/client/assets/{profile-B08zyo9T.js → profile-BjA3az8V.js} +1 -1
  140. package/dist/client/assets/project-app-view-DBZD-Qym.js +1 -0
  141. package/dist/client/assets/record-editor-DHRDltSK.js +1 -0
  142. package/dist/client/assets/registry-01-W3Aa9.js +2 -0
  143. package/dist/client/assets/{registry-layout-DEUUoxVX.js → registry-layout-CwieFTo1.js} +1 -1
  144. package/dist/client/assets/{require-capability-u4HmBddy.js → require-capability-Dz-TkNmC.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-DQ3D6qQS.js → required-auth-layout-C5onwtB3.js} +1 -1
  146. package/dist/client/assets/{reset-password-D5KmVqoe.js → reset-password-DepK2Ogb.js} +1 -1
  147. package/dist/client/assets/{roles-B9y6HK7U.js → roles-yR2QgssN.js} +1 -1
  148. package/dist/client/assets/{search-input-D8kV8LpY.js → search-input-BgqQi3du.js} +1 -1
  149. package/dist/client/assets/{secrets-BY6FPIEt.js → secrets-DK-onjdR.js} +1 -1
  150. package/dist/client/assets/{sections-editor-CQqC2IMh.js → sections-editor-DGY4iPe6.js} +1 -1
  151. package/dist/client/assets/{select-G_YqOyoi.js → select-CU_eaLJy.js} +1 -1
  152. package/dist/client/assets/{select-model-CaCFe0Qm.js → select-model-CegIeG2I.js} +1 -1
  153. package/dist/client/assets/{seo-editor-CC4KlJFc.js → seo-editor-DXpmdTqh.js} +1 -1
  154. package/dist/client/assets/{settings-layout-DdC76rT-.js → settings-layout-DIUGx7Fc.js} +1 -1
  155. package/dist/client/assets/{settings-section-CLbCpPyp.js → settings-section-DTRw4Lx4.js} +1 -1
  156. package/dist/client/assets/{shell-controls-xp5svzIV.js → shell-controls-BB9FzKsa.js} +1 -1
  157. package/dist/client/assets/{shell-layout-CmMDmGXk.js → shell-layout-CKq6i_Cc.js} +1 -1
  158. package/dist/client/assets/{sidebar-DXJheAJA.js → sidebar-Bm-lvNcY.js} +1 -1
  159. package/dist/client/assets/{skeleton-BAea7AlB.js → skeleton-iuUYNmRM.js} +1 -1
  160. package/dist/client/assets/{sso-C7I92c6D.js → sso-FL7oX4BE.js} +1 -1
  161. package/dist/client/assets/{store-DIivY7IJ.js → store-CbSS93YX.js} +1 -1
  162. package/dist/client/assets/store-registry-BReyAGYP.js +2 -0
  163. package/dist/client/assets/{studio-tools-D970x90m.js → studio-tools-DLBcGC5U.js} +1 -1
  164. package/dist/client/assets/{switch-D3WvQAp5.js → switch-Dv6pNFWB.js} +1 -1
  165. package/dist/client/assets/{table-UT3NTBNO.js → table-B_K6Dy2F.js} +1 -1
  166. package/dist/client/assets/{tabs-GPhk4mCA.js → tabs-CCguba9W.js} +1 -1
  167. package/dist/client/assets/{textarea-ChqR5uQR.js → textarea-86Nn-Itu.js} +1 -1
  168. package/dist/client/assets/{toggle-group-ClZzbpdF.js → toggle-group-YEkw_wl3.js} +1 -1
  169. package/dist/client/assets/{toolbar-CBZulNRe.js → toolbar-T6dr23V8.js} +1 -1
  170. package/dist/client/assets/{toolbar-icon-button-CJQiVcrq.js → toolbar-icon-button-DhF-X-CG.js} +1 -1
  171. package/dist/client/assets/{tools-list-BwElXZDI.js → tools-list-BTupwjwJ.js} +1 -1
  172. package/dist/client/assets/{tooltip-DB1pbaN7.js → tooltip-BtYF7_zM.js} +1 -1
  173. package/dist/client/assets/{types-Br8gG1Yy.js → types-ZaWOw8Xn.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-KkX2eDSF.js → use-ai-providers-BLynx6Ck.js} +1 -1
  175. package/dist/client/assets/{use-automations-CooMtuVY.js → use-automations-DuPrsuIU.js} +1 -1
  176. package/dist/client/assets/{use-capability-BszFKA4z.js → use-capability-BQ5RzXpb.js} +1 -1
  177. package/dist/client/assets/{use-clock-tick-a4_ohCGI.js → use-clock-tick-y2lakzVG.js} +1 -1
  178. package/dist/client/assets/{use-collections-CQ-DHlk8.js → use-collections-Dv4e_gOh.js} +1 -1
  179. package/dist/client/assets/{use-connection-BL3pH0HU.js → use-connection-8sLV5h2D.js} +1 -1
  180. package/dist/client/assets/{use-copy-U1o477e9.js → use-copy-Ca6XviiN.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-CEL5Dbuw.js → use-create-virtual-mcp-RM6d0n-i.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-CVjYZQZj.js → use-debounced-autosave-PWeVcBMR.js} +1 -1
  183. package/dist/client/assets/{use-debounced-value-Dkp5tW5n.js → use-debounced-value-9umdfO4B.js} +1 -1
  184. package/dist/client/assets/{use-decopilot-events-FMOjcbHA.js → use-decopilot-events-Cpu2mHNY.js} +1 -1
  185. package/dist/client/assets/{use-delete-connection-3BD9aAiH.js → use-delete-connection-ohPjdFuI.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-S4PxYtlV.js → use-file-configs-j6by6JXU.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-CI-YzSP5.js → use-infinite-scroll-gDwS_J3l.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-BfcPQxf6.js → use-join-requests-Bc2dFPsV.js} +1 -1
  189. package/dist/client/assets/{use-mcp-client-DNdH0vv7.js → use-mcp-client-BuOlOrnj.js} +1 -1
  190. package/dist/client/assets/{use-mcp-prompts-XEjrzief.js → use-mcp-prompts-BNk9zZ-n.js} +1 -1
  191. package/dist/client/assets/{use-mcp-tools-Bi-2En16.js → use-mcp-tools-B7-zbrlB.js} +1 -1
  192. package/dist/client/assets/{use-members-D2Jf8y76.js → use-members-HyblaoTb.js} +1 -1
  193. package/dist/client/assets/{use-mobile-DMdcKVFD.js → use-mobile-Bnptpe5B.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-cynSQiRw.js → use-navigate-to-agent-DJjFVL6R.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-DXczVSBm.js → use-org-auth-client-CYcM54fk.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-B7dq-Mnj.js → use-org-sso-BkGwCpOF.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-BAuTLcqM.js → use-organization-roles-DZnqIOJB.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-1kZ641DK.js → use-organization-settings-Bx5d1sfW.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-B0FZfkFl.js → use-registry-connections-BJqsXkBj.js} +1 -1
  200. package/dist/client/assets/{use-secrets-CjQdbEZR.js → use-secrets-D5ie7Wv8.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-Csi7Mi_Q.js → use-status-sounds-CEPc4gvL.js} +1 -1
  202. package/dist/client/assets/{use-view-mode-BbI5V31J.js → use-view-mode-BkON0u_7.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-DHTVzUmN.js → use-virtual-mcp-CS2IAHte.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-Cq4F2whY.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-H5GMfaUD.js +1 -0
  206. package/dist/client/assets/{variant-calendar-CwMegenq.js → variant-calendar-Wc24LqCc.js} +1 -1
  207. package/dist/client/assets/{view-mode-toggle-sTfLeCKf.js → view-mode-toggle-Bw3fpszL.js} +1 -1
  208. package/dist/client/index.html +1 -1
  209. package/dist/server/cli.js +1 -1
  210. package/dist/server/server.js +1 -1
  211. package/package.json +1 -1
  212. package/dist/client/assets/page-seo-sheet-BPUAn1gD.js +0 -1
  213. package/dist/client/assets/project-app-view-gIjSglNc.js +0 -1
  214. package/dist/client/assets/record-editor-DXrOuKcs.js +0 -1
  215. package/dist/client/assets/registry-Dpup9jP-.js +0 -2
  216. package/dist/client/assets/store-registry-CVneYPwx.js +0 -2
  217. package/dist/client/assets/useInfiniteQuery-DDDNbQaX.js +0 -1
  218. package/dist/client/assets/useSuspenseInfiniteQuery-DPMsxGPA.js +0 -1
@@ -1 +1 @@
1
- import{r as h}from"./index-BYp7Ofgs.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
1
+ import{r as h}from"./index-DMN_Rked.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
@@ -1 +1 @@
1
- import{c as u,Z as d,r as f,j as l,a8 as g,N as x}from"./index-BYp7Ofgs.js";import{a as h}from"./constants-B72Xmt_K.js";import{a as j}from"./hooks-D0_F2fuV.js";import{f as I}from"./reusable-new-chat-qqWu133U.js";import"./use-mcp-client-DNdH0vv7.js";import"./auth-D3gb8a1G.js";import"./decopilot-sse-pool-mwjxYiq3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function y(){const t=u.c(9),{org:s}=d(),r=h(s.id).id,{threads:m,status:c}=j(),[p]=f.useState(R);if(c.kind==="loading"){let a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(g,{}),t[0]=a):a=t[0],a}const n=I(m,r)?.id??p;let e;t[1]!==s.slug||t[2]!==n?(e={org:s.slug,taskId:n},t[1]=s.slug,t[2]=n,t[3]=e):e=t[3];let o;t[4]!==r?(o={virtualmcpid:r},t[4]=r,t[5]=o):o=t[5];let i;return t[6]!==e||t[7]!==o?(i=l.jsx(x,{to:"/$org/$taskId",params:e,search:o,replace:!0}),t[6]=e,t[7]=o,t[8]=i):i=t[8],i}function R(){return crypto.randomUUID()}export{y as default};
1
+ import{c as u,Z as d,r as f,j as l,a8 as g,N as x}from"./index-DMN_Rked.js";import{a as h}from"./constants-B72Xmt_K.js";import{a as j}from"./hooks-n5BHrfUo.js";import{f as I}from"./reusable-new-chat-qqWu133U.js";import"./use-mcp-client-BuOlOrnj.js";import"./auth-9NoVZgB6.js";import"./decopilot-sse-pool-n-O90qSn.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function y(){const t=u.c(9),{org:s}=d(),r=h(s.id).id,{threads:m,status:c}=j(),[p]=f.useState(R);if(c.kind==="loading"){let a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(g,{}),t[0]=a):a=t[0],a}const n=I(m,r)?.id??p;let e;t[1]!==s.slug||t[2]!==n?(e={org:s.slug,taskId:n},t[1]=s.slug,t[2]=n,t[3]=e):e=t[3];let o;t[4]!==r?(o={virtualmcpid:r},t[4]=r,t[5]=o):o=t[5];let i;return t[6]!==e||t[7]!==o?(i=l.jsx(x,{to:"/$org/$taskId",params:e,search:o,replace:!0}),t[6]=e,t[7]=o,t[8]=i):i=t[8],i}function R(){return crypto.randomUUID()}export{y as default};
@@ -1 +1 @@
1
- import{r as s,aQ as F,aO as B,j as d,b5 as q,aL as x,aP as E,b3 as K,aR as C,b4 as P,b6 as T,aN as _,bE as U,bD as V}from"./index-BYp7Ofgs.js";var I="Radio",[z,w]=_(I),[H,Q]=z(I),k=s.forwardRef((a,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:t,value:l="on",onCheck:f,form:R,...v}=a,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:t,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":t?"":void 0,disabled:t,value:l,...v,ref:i,onClick:C(a.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:t,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var g="RadioIndicator",G=s.forwardRef((a,c)=>{const{__scopeRadio:o,forceMount:n,...e}=a,r=Q(g,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var W="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:a,control:c,checked:o,bubbles:n=!0,...e},r)=>{const t=s.useRef(null),l=E(t,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=t.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=W;function A(a){return a?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=_(y,[P,w]),N=P(),j=w(),[J,Z]=Y(y),D=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:t=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=a,i=N(o),u=F(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(J,{scope:o,name:n,required:t,disabled:l,value:b,onValueChange:h,children:d.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":t,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=a,r=Z(M,o),t=r.disabled||n,l=N(o),f=j(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{X.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!t,active:p,children:d.jsx(k,{disabled:t,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",L=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,...n}=a,e=j(o);return d.jsx(G,{...e,...n,ref:c})});L.displayName=$;var oe=D,re=O,ae=L;export{re as I,oe as R,ae as a};
1
+ import{r as s,aQ as F,aO as B,j as d,b5 as q,aL as x,aP as E,b3 as K,aR as C,b4 as P,b6 as T,aN as _,bE as U,bD as V}from"./index-DMN_Rked.js";var I="Radio",[z,w]=_(I),[H,Q]=z(I),k=s.forwardRef((a,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:t,value:l="on",onCheck:f,form:R,...v}=a,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:t,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":t?"":void 0,disabled:t,value:l,...v,ref:i,onClick:C(a.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:t,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var g="RadioIndicator",G=s.forwardRef((a,c)=>{const{__scopeRadio:o,forceMount:n,...e}=a,r=Q(g,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var W="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:a,control:c,checked:o,bubbles:n=!0,...e},r)=>{const t=s.useRef(null),l=E(t,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=t.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=W;function A(a){return a?"checked":"unchecked"}var X=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[Y]=_(y,[P,w]),N=P(),j=w(),[J,Z]=Y(y),D=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:t=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=a,i=N(o),u=F(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(J,{scope:o,name:n,required:t,disabled:l,value:b,onValueChange:h,children:d.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":t,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=a,r=Z(M,o),t=r.disabled||n,l=N(o),f=j(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{X.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!t,active:p,children:d.jsx(k,{disabled:t,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",L=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,...n}=a,e=j(o);return d.jsx(G,{...e,...n,ref:c})});L.displayName=$;var oe=D,re=O,ae=L;export{re as I,oe as R,ae as a};
@@ -1 +1 @@
1
- import{c as g,e as p,j as s,i as u,N as a}from"./index-BYp7Ofgs.js";import{a as x}from"./use-capability-BszFKA4z.js";import{C as j}from"./capability-load-error-DJ112fpN.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
1
+ import{c as g,e as p,j as s,i as u,N as a}from"./index-DMN_Rked.js";import{a as x}from"./use-capability-BQ5RzXpb.js";import{C as j}from"./capability-load-error-BXHBgQBK.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
@@ -1 +1 @@
1
- import{c as $,j as s,Y as He,r as L,Z as se,b as le,l as B,M as me,_ as Ns,$ as ws,a as ge,a0 as Cs,a1 as ks,t as te,a2 as As,a3 as Is,p as $s,u as Ue,a4 as vt,K as zs,k as Ts,a5 as Ms,i as Gt,e as at,P as Wt,G as Os,H as Ps,I as Ds,J as Es,d as Fs,B as Ze,a6 as Rs,T as Ls,U as Bs,a7 as Hs,X as Us,a8 as Gs}from"./index-BYp7Ofgs.js";import{u as ye,S as ct,a as dt,b as ue,c as J,d as q,e as qt,f as Kt,g as Ws,h as qs,i as et,j as Ks,k as Vs,l as Xs}from"./sidebar-DXJheAJA.js";import{u as mt}from"./use-mobile-DMdcKVFD.js";import{n as Qs}from"./Loading02-ye_m_QAK.js";import{u as Ys}from"./use-organization-settings-1kZ641DK.js";import{S as oe}from"./skeleton-BAea7AlB.js";import{i as Vt}from"./LayoutLeft-DfWu_TMe.js";import{T as je}from"./toolbar-icon-button-CJQiVcrq.js";import{P as Ge,a as ze,b as We}from"./popover-CxakTUJX.js";import{D as Xt,a as Qt,b as Yt}from"./drawer-DgApXJiu.js";import{A as Re}from"./avatar-pA-6XVGw.js";import{a as fe,b as he,c as tt,T as pe}from"./tooltip-DB1pbaN7.js";import{a as yt}from"./Copy01-CrUgsJcD.js";import{n as Js,i as Zs}from"./Globe01-BoyjWYdB.js";import{i as en}from"./ZoomOut-COjlHAto.js";import{i as tn,a as sn}from"./ZapSquare-D9UGTwX8.js";import{i as st}from"./Monitor01-CWCFfYgZ.js";import{n as nn,a as rn}from"./Sun-e9bFqj0N.js";import{a as ut}from"./Settings02-N3uovfLI.js";import{i as on}from"./Shield01-CGCJBA4k.js";import{a as ln}from"./Users03-BjPo5EJz.js";import{a as St,b as _t,c as an,d as cn,A as ve,e as Nt,i as dn,s as mn,f as un}from"./agent-icon-Cg17MSXd.js";import"./index-7MM5fVQo.js";import{D as fn,a as hn,b as pn,c as wt,d as xn}from"./dropdown-menu-DQljEt7c.js";import{i as ft}from"./Check-BvrjRK-f.js";import{s as $e}from"./Plus-DK37ytOg.js";import{u as gn}from"./use-connection-BL3pH0HU.js";import{u as Jt}from"./use-mcp-client-DNdH0vv7.js";import{u as ht,a as qe}from"./use-virtual-mcp-DHTVzUmN.js";import{i as Zt,S as es,a as Le,b as bn}from"./constants-B72Xmt_K.js";import{G as jn,g as nt,i as vn,a as it}from"./github-repo-picker--Ek5Q2kM.js";import{u as yn,S as ts,a as Sn,g as _n,b as Nn,c as wn}from"./use-navigate-to-agent-cynSQiRw.js";import{I as Cn}from"./invite-member-dialog-D1ExdVDs.js";import{u as kn,A as An,g as In,a as $n}from"./agent-capabilities-DGJfVNFQ.js";import{u as zn,v as Tn,C as Ct}from"./connect-desktop-dialog-Dl5P-KpW.js";import{i as Mn}from"./FilterLines-CTf9rlZx.js";import{T as On,a as Pn}from"./toggle-group-ClZzbpdF.js";import{u as Dn,a as pt,b as ss,T as En}from"./hooks-D0_F2fuV.js";import{u as xt,r as Fn}from"./shell-layout-CmMDmGXk.js";import{c as Rn,a as Ln,b as Bn,d as Hn,e as Un}from"./dialog-1Eqcgb9h.js";import{C as Gn,a as Wn,b as qn,c as Kn,d as Vn}from"./command-B5VkuRkm.js";import{u as ns}from"./studio-tools-D970x90m.js";import{i as is}from"./Zap-C6zrTK7v.js";import{S as rs,M as Xn}from"./shell-controls-xp5svzIV.js";import{n as Qn}from"./Stars02-CxeSSA7g.js";import{g as Yn,u as Jn,S as Zn}from"./use-clock-tick-a4_ohCGI.js";import{f as ei}from"./format-time-Cy7tTmZp.js";import{t as gt}from"./ChevronDown-DYHTINZW.js";import{i as ti}from"./ChevronRight-Bl9YVPs6.js";import{S as si,C as ni}from"./chat-context-BD7KZRIw.js";import{B as kt,a as ii,b as ri}from"./breadcrumb-CyK1O4L9.js";import{i as os}from"./SearchMd-DbAiVRZR.js";import{s as oi}from"./XClose-7c8y3nr7.js";import{A as li,a as ai,b as ci,c as di,d as mi,e as ui,f as fi}from"./alert-dialog-DCVvUTHg.js";import{F as hi,a as pi,b as xi,c as gi,d as bi,f as ji,e as vi}from"./form-uObUvJsx.js";import{I as yi}from"./input-C7dZO9ym.js";import{f as Si}from"./reusable-new-chat-qqWu133U.js";import{T as ee}from"./toolbar-CBZulNRe.js";import"./X-B11_-bWv.js";import"./User01-GIEDPABY.js";import"./AlertCircle-DnAYXfMU.js";import"./Tool01-Do_IYkhs.js";import"./SwitchHorizontal01-CTmNw19f.js";import"./XCircle-DhEfH4xa.js";import"./ArrowUpRight-TtNUPTQB.js";import"./CheckCircle-C6nWvFHV.js";import"./ChevronUp-B18hle8l.js";import"./Circle-DPVk1czd.js";import"./DotsVertical-BndxtaEo.js";import"./Eye-ClTWumnI.js";import"./Star01-CVz_7GBv.js";import"./Globe04-Cu0R3oaF.js";import"./HardDrive-PM-PT0eV.js";import"./Key01-7XhjBNK3.js";import"./LinkExternal01-C1Hc9Rj3.js";import"./List-BSXYor2Z.js";import"./Palette-DpDs-Lap.js";import"./Play-lmf5c9Jo.js";import"./SearchLg-ox88sikc.js";import"./Stars01-D6zQVCEN.js";import"./Trash01-DPHj7EPF.js";import"./Upload01-H4u3fcTc.js";import"./Users01-hbEK4T_M.js";import"./use-collections-CQ-DHlk8.js";import"./auth-D3gb8a1G.js";import"./checkbox-BD6yTuo9.js";import"./collection-search-IlxdiWIS.js";import"./use-debounced-value-Dkp5tW5n.js";import"./authenticate-and-persist-oauth-D74XVxJq.js";import"./mcp-oauth-D_BuxJo5.js";import"./use-mcp-tools-Bi-2En16.js";import"./extract-connection-data-BjQiSug0.js";import"./github-installations-DzN1UQ4x.js";import"./select-G_YqOyoi.js";import"./textarea-ChqR5uQR.js";import"./use-org-auth-client-DXczVSBm.js";import"./use-organization-roles-BAuTLcqM.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BkLSl9Um.js";import"./use-registry-connections-B0FZfkFl.js";import"./useInfiniteQuery-DDDNbQaX.js";import"./use-infinite-scroll-CI-YzSP5.js";import"./card-z0DIgOE_.js";import"./integration-icon-FGiS_d1C.js";import"./collection-tabs-B4OrNtqt.js";import"./badge-9NVu_VdI.js";import"./connection-form-helpers-BPxpL3kZ.js";import"./useSuspenseInfiniteQuery-DPMsxGPA.js";import"./use-ai-providers-KkX2eDSF.js";import"./decopilot-sse-pool-mwjxYiq3.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-DQ3D6qQS.js";import"./autosend-Ci7tspr4.js";import"./tab-id-yjGvxWDL.js";import"./use-org-sso-B7dq-Mnj.js";import"./index-CRGi0rZP.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-FMOjcbHA.js";import"./label-C1WcZg4i.js";function _i(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:i}=t,{state:r,isMobile:o}=ye();if(o||r==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let d;return e[2]!==i||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:i,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=i,e[3]=n,e[4]=d):d=e[4],d}const bt=240,Ni=400,wi="sidebar.width";function Te(t){return Math.max(bt,Math.min(Ni,t))}function Ci(){const t=$.c(11),[e,n]=He(wi,ki),i=L.useRef(null);let r;t[0]!==n||t[1]!==e?(r=m=>{m.preventDefault();const u=m.clientX,f=Te(e),x=i.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),h=x?Array.from(x.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const g of h)g.style.transition="none";const b=g=>{const j=Te(f+(g.clientX-u));x?.style.setProperty("--sidebar-width",`${j}px`)},p=g=>{const j=Te(f+(g.clientX-u));n(j);for(const y of h)y.style.transition="";window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",b),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=r):r=t[2];const o=r;let l;t[3]!==n?(l=()=>{n(bt)},t[3]=n,t[4]=l):l=t[4];const a=l;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==o||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:i,onStartResize:o,resetWidth:a},t[7]=o,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function ki(t){return typeof t=="number"?Te(t):bt}function ls(){const t=$.c(8),{org:e}=se(),n=le(),i=Ys();let r;if(t[0]!==n||t[1]!==e||t[2]!==i){if(r=[],i){let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Qs,{className:"size-4!"}),t[4]=o):o=t[4];let l;t[5]!==n||t[6]!==e?(l={type:"items",items:[{key:"board",label:"Board",icon:o,onClick:()=>n({to:"/$org/board",params:{org:e.slug}})}]},t[5]=n,t[6]=e,t[7]=l):l=t[7],r.push(l)}t[0]=n,t[1]=e,t[2]=i,t[3]=r}else r=t[3];return r}function as(t){const e=$.c(3),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=i):i=e[0];let r;return e[1]!==n?(r=s.jsxs(ct,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[i,s.jsx(dt,{children:s.jsx(ue,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=r):r=e[2],r}function cs(t){const e=$.c(18),{item:n}=t,{isMobile:i,setOpenMobile:r}=ye();let o;e[0]!==i||e[1]!==n||e[2]!==r?(o=()=>{me("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:i}),n.onClick?.(),i&&r(!1)},e[0]=i,e[1]=n,e[2]=r,e[3]=o):o=e[3];const l=o,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=B(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(q,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Ai(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let o;e[2]!==n.group.items?(o=n.group.items.map($i),e[2]=n.group.items,e[3]=o):o=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==o?(l=s.jsx(as,{label:i,defaultExpanded:r,children:o}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=o,e[7]=l):l=e[7],l}case"items":{let i;e[8]!==n.items?(i=n.items.map(Ii),e[8]=n.items,e[9]=i):i=e[9];let r;return e[10]!==i?(r=s.jsx(ct,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(dt,{children:s.jsx(ue,{className:"gap-1.5",children:i})})}),e[10]=i,e[11]=r):r=e[11],r}case"custom":return n.content}}function Ii(t){return s.jsx(cs,{item:t},t.key)}function $i(t){return s.jsx(cs,{item:t},t.key)}function zi(t){const e=$.c(14),{sections:n,footer:i,additionalContent:r,variant:o,contentClassName:l}=t,a=o===void 0?"sidebar":o;let d;e[0]!==l?(d=B("flex flex-col flex-1 px-2 pb-2 gap-0.5",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(Ti),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==r?(m=r&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:r}),e[4]=r,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Kt,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==i||e[11]!==u||e[12]!==a?(f=s.jsxs(Ws,{variant:a,children:[u,i]}),e[10]=i,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Ti(t,e){return s.jsx(Ai,{section:t},e)}function ds(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ds.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(oe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Mi(t){const e=$.c(16),{onToggle:n,className:i}=t,o=Ns().logo??ws,l=typeof o=="string"?o:o.light,a=typeof o=="string"?o:o.dark;let d;e[0]!==i?(d=B("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",i),e[0]=i,e[1]=d):d=e[1];let c;e[2]!==l?(c=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=c):c=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Vt,{size:16}),e[9]=f):f=e[9];let x;e[10]!==n?(x=s.jsx(je,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=x):x=e[11];let h;return e[12]!==d||e[13]!==u||e[14]!==x?(h=s.jsxs(qs,{className:d,children:[u,x]}),e[12]=d,e[13]=u,e[14]=x,e[15]=h):h=e[15],h}function At(t){const e=$.c(18),{item:n,onClose:i}=t,r=n.isActive&&"z-10";let o;e[0]!==r?(o=B(r),e[0]=r,e[1]=o):o=e[1];let l;e[2]!==n||e[3]!==i?(l=()=>{n.onClick?.(),i()},e[2]=n,e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==d?(c=s.jsxs(J,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==o||e[16]!==c?(m=s.jsx(q,{className:o,children:c}),e[15]=o,e[16]=c,e[17]=m):m=e[17],m}function Oi(t){const e=$.c(18),{section:n,onClose:i}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(qt,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let l;if(e[2]!==i||e[3]!==n.group.items){let d;e[5]!==i?(d=c=>s.jsx(At,{item:c,onClose:i},c.key),e[5]=i,e[6]=d):d=e[6],l=n.group.items.map(d),e[2]=i,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(as,{label:r,defaultExpanded:o,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==i||e[12]!==n.items){let l;e[14]!==i?(l=a=>s.jsx(At,{item:a,onClose:i},a.key),e[14]=i,e[15]=l):l=e[15],r=n.items.map(l),e[11]=i,e[12]=n.items,e[13]=r}else r=e[13];let o;return e[16]!==r?(o=s.jsx(ct,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(dt,{children:s.jsx(ue,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=o):o=e[17],o}case"custom":return n.content}}function Pi(t){const e=$.c(17),{sections:n,onClose:i,footer:r,additionalContent:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==i?(a=s.jsx(L.Suspense,{fallback:l,children:s.jsx(Mi,{onToggle:i})}),e[1]=i,e[2]=a):a=e[2];let d;if(e[3]!==i||e[4]!==n){let f;e[6]!==i?(f=(x,h)=>s.jsx(Oi,{section:x,onClose:i},h),e[6]=i,e[7]=f):f=e[7],d=n.map(f),e[3]=i,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==o?(c=o&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:o}),e[8]=o,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Kt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==r||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,r]}),e[13]=r,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:i}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==i||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:i,children:[m,u]}),e[4]=n.href,e[5]=i,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let r;e[11]!==n||e[12]!==i?(r=()=>{n.onClick?.(),i()},e[11]=n,e[12]=i,e[13]=r):r=e[13];let o;e[14]!==n.icon?(o=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=o):o=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==r||e[19]!==o||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[o,l]}),e[18]=r,e[19]=o,e[20]=l,e[21]=a):a=e[21],a}function It(t){const e=$.c(126),{user:n,userImage:i,menuItems:r,signOutItem:o,themeOptions:l,preferences:a,setPreferences:d,close:c,isMobile:m}=t;if(m){const O=n?.name??"U";let R;e[0]!==O||e[1]!==i?(R=s.jsx(Re,{url:i,fallback:O,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=O,e[1]=i,e[2]=R):R=e[2];const Y=n?.name??"User";let K;e[3]!==Y?(K=s.jsx("p",{className:"text-sm font-medium truncate",children:Y}),e[3]=Y,e[4]=K):K=e[4];const ne=n?.email;let V;e[5]!==ne?(V=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=V):V=e[6];let ie;e[7]!==K||e[8]!==V?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[K,V]}),e[7]=K,e[8]=V,e[9]=ie):ie=e[9];let re;e[10]!==n?(re=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ri)},e[10]=n,e[11]=re):re=e[11];let ae;e[12]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(yt,{size:14}),e[12]=ae):ae=e[12];let xe;e[13]!==re?(xe=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ae})}),e[13]=re,e[14]=xe):xe=e[14];let be;e[15]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=be):be=e[15];let T;e[16]!==xe?(T=s.jsx(tt,{delayDuration:300,children:s.jsxs(pe,{children:[xe,be]})}),e[16]=xe,e[17]=T):T=e[17];let U;e[18]!==T||e[19]!==R||e[20]!==ie?(U=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[R,ie,T]}),e[18]=T,e[19]=R,e[20]=ie,e[21]=U):U=e[21];let X;if(e[22]!==c||e[23]!==r){let de;e[25]!==c?(de=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=de):de=e[26],X=r.map(de),e[22]=c,e[23]=r,e[24]=X}else X=e[24];let W;e[27]!==c||e[28]!==o?(W=s.jsx(De,{item:o,onClose:c}),e[27]=c,e[28]=o,e[29]=W):W=e[29];let ce;e[30]!==X||e[31]!==W?(ce=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[X,W]})}),e[30]=X,e[31]=W,e[32]=ce):ce=e[32];let Se;if(e[33]!==a.theme||e[34]!==d||e[35]!==l){let de;e[37]!==a.theme||e[38]!==d?(de=Pe=>{const{value:Qe,icon:ys,label:Ss}=Pe;return s.jsx("button",{type:"button","aria-label":Ss,onClick:()=>d(_s=>({..._s,theme:Qe})),className:B("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Qe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ys},Qe)},e[37]=a.theme,e[38]=d,e[39]=de):de=e[39],Se=l.map(de),e[33]=a.theme,e[34]=d,e[35]=l,e[36]=Se}else Se=e[36];let _e;e[40]!==Se?(_e=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=_e):_e=e[41];const Ve=a.enableSounds?"Disable sounds":"Enable sounds";let Ne;e[42]!==d?(Ne=()=>d(Fi),e[42]=d,e[43]=Ne):Ne=e[43];const Xe=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Xe?(we=B("size-8 rounded-md flex items-center justify-center transition-colors",Xe),e[44]=Xe,e[45]=we):we=e[45];let Ce;e[46]!==a.enableSounds?(Ce=a.enableSounds?s.jsx(St,{size:14}):s.jsx(_t,{size:14}),e[46]=a.enableSounds,e[47]=Ce):Ce=e[47];let ke;e[48]!==Ve||e[49]!==Ne||e[50]!==we||e[51]!==Ce?(ke=s.jsx("button",{type:"button","aria-label":Ve,onClick:Ne,className:we,children:Ce}),e[48]=Ve,e[49]=Ne,e[50]=we,e[51]=Ce,e[52]=ke):ke=e[52];let Me;e[53]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.30.2"]}),e[53]=Me):Me=e[53];let Ae;e[54]!==ke?(Ae=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Me]}),e[54]=ke,e[55]=Ae):Ae=e[55];let Ie;e[56]!==_e||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[_e,Ae]}),e[56]=_e,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==U||e[60]!==ce||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[U,ce,Ie]}),e[59]=U,e[60]=ce,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==i?(f=s.jsx(Re,{url:i,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=i,e[65]=f):f=e[65];const x=n?.name??"User";let h;e[66]!==x?(h=s.jsx("p",{className:"text-sm font-medium truncate",children:x}),e[66]=x,e[67]=h):h=e[67];const b=n?.email;let p;e[68]!==b?(p=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b}),e[68]=b,e[69]=p):p=e[69];let g;e[70]!==h||e[71]!==p?(g=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,p]}),e[70]=h,e[71]=p,e[72]=g):g=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ei)},e[73]=n,e[74]=j):j=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(yt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==j?(v=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=j,e[77]=v):v=e[77];let C;e[78]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=C):C=e[78];let N;e[79]!==v?(N=s.jsx(tt,{delayDuration:300,children:s.jsxs(pe,{children:[v,C]})}),e[79]=v,e[80]=N):N=e[80];let _;e[81]!==N||e[82]!==f||e[83]!==g?(_=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,g,N]}),e[81]=N,e[82]=f,e[83]=g,e[84]=_):_=e[84];let S;if(e[85]!==c||e[86]!==r){let O;e[88]!==c?(O=R=>s.jsx(De,{item:R,onClose:c},R.key),e[88]=c,e[89]=O):O=e[89],S=r.map(O),e[85]=c,e[86]=r,e[87]=S}else S=e[87];let w;e[90]!==c||e[91]!==o?(w=s.jsx(De,{item:o,onClose:c}),e[90]=c,e[91]=o,e[92]=w):w=e[92];let A;e[93]!==S||e[94]!==w?(A=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,w]}),e[93]=S,e[94]=w,e[95]=A):A=e[95];let z;if(e[96]!==a.theme||e[97]!==d||e[98]!==l){let O;e[100]!==a.theme||e[101]!==d?(O=R=>{const{value:Y,icon:K,label:ne}=R;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>d(V=>({...V,theme:Y})),className:B("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Y?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:K},Y)},e[100]=a.theme,e[101]=d,e[102]=O):O=e[102],z=l.map(O),e[96]=a.theme,e[97]=d,e[98]=l,e[99]=z}else z=e[99];let k;e[103]!==z?(k=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=k):k=e[104];const I=a.enableSounds?"Disable sounds":"Enable sounds";let M;e[105]!==d?(M=()=>d(Di),e[105]=d,e[106]=M):M=e[106];const H=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let P;e[107]!==H?(P=B("size-7 rounded-md flex items-center justify-center transition-colors",H),e[107]=H,e[108]=P):P=e[108];let F;e[109]!==a.enableSounds?(F=a.enableSounds?s.jsx(St,{size:14}):s.jsx(_t,{size:14}),e[109]=a.enableSounds,e[110]=F):F=e[110];let E;e[111]!==I||e[112]!==M||e[113]!==P||e[114]!==F?(E=s.jsx("button",{type:"button","aria-label":I,onClick:M,className:P,children:F}),e[111]=I,e[112]=M,e[113]=P,e[114]=F,e[115]=E):E=e[115];let D;e[116]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.30.2"]}),e[116]=D):D=e[116];let G;e[117]!==E?(G=s.jsxs("div",{className:"flex items-center gap-2",children:[E,D]}),e[117]=E,e[118]=G):G=e[118];let Q;e[119]!==k||e[120]!==G?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[k,G]}),e[119]=k,e[120]=G,e[121]=Q):Q=e[121];let Z;return e[122]!==_||e[123]!==A||e[124]!==Q?(Z=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[_,A,Q]})}),e[122]=_,e[123]=A,e[124]=Q,e[125]=Z):Z=e[125],Z}function Di(t){return{...t,enableSounds:!t.enableSounds}}function Ei(){te.success("User ID copied")}function Fi(t){return{...t,enableSounds:!t.enableSounds}}function Ri(){te.success("User ID copied")}function rt(){const t=$.c(34),{data:e}=ge.useSession(),{org:n}=se(),i=le();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const l=Cs(r)?.params.org,[a,d]=ks(),c=mt(),[m,u]=L.useState(!1),f=e?.user,x=f?.image;let h;t[1]===Symbol.for("react.memo_cache_sentinel")?(h=()=>u(!1),t[1]=h):h=t[1];const b=h;let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ut,{size:16}),t[2]=p):p=t[2];let g;t[3]!==i||t[4]!==l?(g={key:"preferences",label:"Preferences",icon:p,onClick:()=>{i({to:"/$org/settings/profile",params:{org:l??""}})}},t[3]=i,t[4]=l,t[5]=g):g=t[5];let j;t[6]!==n||t[7]!==i?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Js,{size:16}),onClick:()=>{i({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=i,t[8]=j):j=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(en,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=y):y=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v={key:"privacy",label:"Privacy Policy",icon:s.jsx(on,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=v):v=t[10];let C;t[11]===Symbol.for("react.memo_cache_sentinel")?(C={key:"github",label:"decocms/studio",icon:s.jsx(As,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=C):C=t[11];let N;t[12]===Symbol.for("react.memo_cache_sentinel")?(N={key:"community",label:"Community",icon:s.jsx(ln,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=N):N=t[12];let _;t[13]===Symbol.for("react.memo_cache_sentinel")?(_={key:"homepage",label:"Homepage",icon:s.jsx(Zs,{size:16}),href:"https://decocms.com",external:!0},t[13]=_):_=t[13];let S;t[14]!==g||t[15]!==j?(S=[g,...j,y,v,C,N,_],t[14]=g,t[15]=j,t[16]=S):S=t[16];const w=S;let A;t[17]===Symbol.for("react.memo_cache_sentinel")?(A={key:"logout",label:"Sign out",icon:s.jsx(tn,{size:16}),onClick:Bi},t[17]=A):A=t[17];const z=A;let k;t[18]===Symbol.for("react.memo_cache_sentinel")?(k={value:"light",icon:s.jsx(nn,{size:14}),label:"Light theme"},t[18]=k):k=t[18];let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I={value:"dark",icon:s.jsx(rn,{size:14}),label:"Dark theme"},t[19]=I):I=t[19];let M;t[20]===Symbol.for("react.memo_cache_sentinel")?(M=[k,I,{value:"system",icon:s.jsx(st,{size:14}),label:"System theme"}],t[20]=M):M=t[20];const H=M;let P;t[21]!==c||t[22]!==w||t[23]!==a||t[24]!==d||t[25]!==f||t[26]!==x?(P={user:f,userImage:x,menuItems:w,signOutItem:z,themeOptions:H,preferences:a,setPreferences:d,close:b,isMobile:c},t[21]=c,t[22]=w,t[23]=a,t[24]=d,t[25]=f,t[26]=x,t[27]=P):P=t[27];const F=P;let E;return t[28]!==c||t[29]!==m||t[30]!==F||t[31]!==f?.name||t[32]!==x?(E=s.jsx(s.Fragment,{children:c?s.jsxs(Xt,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Re,{url:x,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Qt,{className:"h-[80dvh] p-0",children:[s.jsx(Yt,{className:"sr-only",children:"Account"}),s.jsx(It,{...F})]})]}):s.jsxs(Ge,{open:m,onOpenChange:u,children:[s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Re,{url:x,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(We,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Li,children:s.jsx(It,{...F})})]})}),t[28]=c,t[29]=m,t[30]=F,t[31]=f?.name,t[32]=x,t[33]=E):E=t[33],E}function Li(t){return t.preventDefault()}function Bi(){me("signed_out",{source:"account_popover"}),Is(),ge.signOut()}const $t=["requires_action","in_progress","failed","expired","completed"];function Hi(t){const e=new Map($t.map(n=>[n,[]]));for(const n of t){const i=n.status??"completed";(e.get(i)??e.get("completed")).push(n)}return $t.map(n=>({status:n,threads:e.get(n)}))}function ms(t){const e=$.c(4),{onClick:n}=t;let i,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{}),r=s.jsx("span",{children:"Add repo"}),e[0]=i,e[1]=r):(i=e[0],r=e[1]);let o;return e[2]!==n?(o=s.jsxs(J,{tooltip:"Add repo",onClick:n,children:[i,r]}),e[2]=n,e[3]=o):o=e[3],o}function Ui(t){const e=$.c(41),{onAddNew:n}=t,{org:i}=se(),r=$s(),o=le(),l=yn();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const c=Ue(a).virtualmcpid??null;let m;e[1]!==c?(m=!!c&&!Zt(c),e[1]=c,e[2]=m):m=e[2];const u=m;let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={slug:"mcp-github"},e[3]=f):f=e[3];const h=gn(f).filter(Wi),b=ht(),g=qe(u?c:null)?.metadata?.githubRepo?.connectionId??null;let j;e[4]!==i.id||e[5]!==i.slug?(j={connectionId:es,orgId:i.id,orgSlug:i.slug},e[4]=i.id,e[5]=i.slug,e[6]=j):j=e[6];const y=Jt(j);if(h.length===0){let O;return e[7]!==n?(O=s.jsx(ms,{onClick:n}),e[7]=n,e[8]=O):O=e[8],O}let v;e[9]!==c||e[10]!==o||e[11]!==i.id||e[12]!==r||e[13]!==y?(v=async(O,R)=>{await y.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{githubRepo:O}}}}),vt(r,i.id),te.success(`Previewing ${R}`),o({to:".",search:Gi,replace:!0})},e[9]=c,e[10]=o,e[11]=i.id,e[12]=r,e[13]=y,e[14]=v):v=e[14];const C=v;let N;e[15]!==b||e[16]!==l||e[17]!==i.id||e[18]!==r||e[19]!==y?(N=async(O,R,Y)=>{const K=b.find(ie=>{const re=ie.metadata?.githubRepo;return re?.owner?.toLowerCase()===O.owner.toLowerCase()&&re?.name?.toLowerCase()===O.name.toLowerCase()});if(K){l(K.id,{search:{main:"preview"}});return}const V=(await y.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:O.name,description:`Imported from ${Y}`,status:"active",pinned:!1,icon:null,connections:[{connection_id:R}],metadata:{githubRepo:O,instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}}}})).structuredContent?.item?.id;if(vt(r,i.id),!V)throw new Error("Failed to create the repo agent");te.success(`Created ${Y}`),l(V,{search:{main:"preview"}})},e[15]=b,e[16]=l,e[17]=i.id,e[18]=r,e[19]=y,e[20]=N):N=e[20];const _=N;let S;e[21]!==C||e[22]!==u||e[23]!==_?(S=async O=>{const R=nt(O);if(!R)return;const Y=`${R.owner}/${R.repo}`,K={owner:R.owner,name:R.repo,url:`https://github.com/${R.owner}/${R.repo}`,installationId:R.installationId,connectionId:O.id};try{u?await C(K,Y):await _(K,O.id,Y)}catch(ne){const V=ne;te.error("Failed to set preview repo: "+(V instanceof Error?V.message:"Unknown error"))}},e[21]=C,e[22]=u,e[23]=_,e[24]=S):S=e[24];const w=S,A=hn;let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(pn,{asChild:!0,children:s.jsxs(J,{tooltip:"Add repo",children:[s.jsx(it,{}),s.jsx("span",{children:"Add repo"})]})}),e[25]=z):z=e[25];const k=fn,I="start",M="right",H="w-56";let P;e[26]!==g||e[27]!==w?(P=O=>{const R=nt(O);return R?s.jsxs(wt,{onSelect:()=>w(O),children:[s.jsx(it,{className:"size-4 text-muted-foreground"}),s.jsxs("span",{className:"flex-1 truncate",children:[R.owner,"/",R.repo]}),O.id===g&&s.jsx(ft,{className:"size-4"})]},O.id):null},e[26]=g,e[27]=w,e[28]=P):P=e[28];const F=h.map(P);let E;e[29]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(xn,{}),e[29]=E):E=e[29];let D;e[30]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx($e,{className:"size-4"}),e[30]=D):D=e[30];let G;e[31]!==n?(G=s.jsxs(wt,{onSelect:n,children:[D,"Add new repo…"]}),e[31]=n,e[32]=G):G=e[32];let Q;e[33]!==k||e[34]!==F||e[35]!==G?(Q=s.jsxs(k,{align:I,side:M,className:H,children:[F,E,G]}),e[33]=k,e[34]=F,e[35]=G,e[36]=Q):Q=e[36];let Z;return e[37]!==A||e[38]!==Q||e[39]!==z?(Z=s.jsxs(A,{children:[z,Q]}),e[37]=A,e[38]=Q,e[39]=z,e[40]=Z):Z=e[40],Z}function Gi(t){return{...t,main:"preview"}}function Wi(t){return nt(t)!==null&&vn(t)}function qi(){const t=$.c(4),[e,n]=L.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ms,{onClick:()=>n(!0)}),t[0]=i):i=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(L.Suspense,{fallback:i,children:s.jsx(Ui,{onAddNew:()=>n(!0)})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(jn,{open:e,onOpenChange:n,mode:"connection"})]}),t[2]=e,t[3]=o):o=t[3],o}function ot(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,i=n===void 0?"icon":n,r=zn(),[o,l]=L.useState(!1);let a,d;if(e[0]!==r.capabilities||e[1]!==r.hostname||e[2]!==r.machineId||e[3]!==r.online){const y=Tn(r.capabilities);a=r.online?"Desktop linked":"Connect desktop",d=r.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:r.hostname??r.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=r.capabilities,e[1]=r.hostname,e[2]=r.machineId,e[3]=r.online,e[4]=a,e[5]=d}else a=e[4],d=e[5];const c=d;if(i==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),v=s.jsx(st,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let C;e[8]!==a?(C=s.jsx("span",{children:a}),e[8]=a,e[9]=C):C=e[9];let N;e[10]!==r.online?(N=r.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=r.online,e[11]=N):N=e[11];let _;e[12]!==a||e[13]!==C||e[14]!==N?(_=s.jsx(fe,{asChild:!0,children:s.jsxs(J,{tooltip:a,onClick:y,children:[v,C,N]})}),e[12]=a,e[13]=C,e[14]=N,e[15]=_):_=e[15];let S;e[16]!==c?(S=s.jsx(he,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let w;e[18]!==_||e[19]!==S?(w=s.jsxs(pe,{children:[_,S]}),e[18]=_,e[19]=S,e[20]=w):w=e[20];let A;e[21]!==o?(A=s.jsx(Ct,{open:o,onOpenChange:l}),e[21]=o,e[22]=A):A=e[22];let z;return e[23]!==A||e[24]!==w?(z=s.jsxs(s.Fragment,{children:[w,A]}),e[23]=A,e[24]=w,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),e[26]=m):m=e[26];const u=r.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(st,{size:16}),e[27]=f):f=e[27];let x;e[28]!==r.online?(x=r.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=r.online,e[29]=x):x=e[29];let h;e[30]!==u||e[31]!==x?(h=s.jsx(fe,{asChild:!0,children:s.jsxs(je,{onClick:m,"aria-label":u,children:[f,x]})}),e[30]=u,e[31]=x,e[32]=h):h=e[32];let b;e[33]!==c?(b=s.jsx(he,{side:"bottom",children:c}),e[33]=c,e[34]=b):b=e[34];let p;e[35]!==h||e[36]!==b?(p=s.jsxs(pe,{children:[h,b]}),e[35]=h,e[36]=b,e[37]=p):p=e[37];let g;e[38]!==o?(g=s.jsx(Ct,{open:o,onOpenChange:l}),e[38]=o,e[39]=g):g=e[39];let j;return e[40]!==g||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,g]}),e[40]=g,e[41]=p,e[42]=j):j=e[42],j}class Ki extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Vi(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Xi(){const t=$.c(17),e=le(),{org:n}=se(),{hasDecoKey:i,balanceDollars:r}=kn();if(!i)return null;let o;t[0]!==r?(o=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=o):o=t[1];let l;t[2]!==r?(l=B(r!=null&&Vi(r)),t[2]=r,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(an,{}),t[7]=d):d=t[7];let c;t[8]!==r?(c=r!=null?`$${r.toFixed(2)}`:"Credits",t[8]=r,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==o||t[13]!==l||t[14]!==a||t[15]!==m?(u=s.jsx(ue,{children:s.jsx(q,{children:s.jsxs(J,{tooltip:o,className:l,onClick:a,children:[d,m]})})}),t[12]=o,t[13]=l,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function zt(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ki,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(Xi,{})})}),t[0]=e):e=t[0],e}function Tt(){const t=$.c(7),e=le(),{org:n}=se();let i;t[0]!==e||t[1]!==n.slug?(i=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=i):i=t[2];let r,o;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ut,{}),o=s.jsx("span",{children:"Settings"}),t[3]=r,t[4]=o):(r=t[3],o=t[4]);let l;return t[5]!==i?(l=s.jsxs(J,{tooltip:"Settings",onClick:i,children:[r,o]}),t[5]=i,t[6]=l):l=t[6],l}function Mt(){const t=$.c(5),[e,n]=L.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q,{children:s.jsx(Cn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(cn,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=i):i=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(q,{children:s.jsx(qi,{})}),t[1]=r):r=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(ue,{className:"gap-0.5",children:[i,r,s.jsx(q,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(sn,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[2]=o):o=t[2];let l;return t[3]!==e?(l=s.jsxs(s.Fragment,{children:[o,s.jsx(An,{open:e,onOpenChange:n,mode:"browse"})]}),t[3]=e,t[4]=l):l=t[4],l}function Qi(){const t=$.c(10),{state:e}=ye();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Mt,{}),c=s.jsx(zt,{}),t[0]=d,t[1]=c):(d=t[0],c=t[1]);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(q,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(ot,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(q,{children:s.jsx(Tt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(et,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ue,{children:[m,u,s.jsx(q,{children:s.jsx(rt,{})})]})]}),t[4]=f):f=t[4],f}let i,r;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Mt,{}),r=s.jsx(zt,{}),t[5]=i,t[6]=r):(i=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(q,{children:s.jsx(ot,{variant:"full"})}),t[7]=o):o=t[7];let l;t[8]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(q,{children:s.jsx(Tt,{})}),t[8]=l):l=t[8];let a;return t[9]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs(et,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(ue,{className:"gap-0.5",children:[o,l,s.jsx(q,{children:s.jsx(rt,{})})]})]}),t[9]=a):a=t[9],a}function Yi(){const t=$.c(8),e=le(),{org:n}=se(),{setOpenMobile:i}=ye();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ue,{children:s.jsx(q,{children:s.jsx(rt,{})})})}),t[0]=r):r=t[0];let o;t[1]!==e||t[2]!==n.slug||t[3]!==i?(o=()=>{e({to:"/$org/settings",params:{org:n.slug}}),i(!1)},t[1]=e,t[2]=n.slug,t[3]=i,t[4]=o):o=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ut,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==o?(a=s.jsx(et,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[r,s.jsx(je,{"aria-label":"Settings",onClick:o,children:l})]})}),t[6]=o,t[7]=a):a=t[7],a}function Ot(t){const e=$.c(15),{className:n,wrapperClassName:i,children:r}=t,[o,l]=L.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=g=>{g&&l(g.scrollHeight>g.clientHeight+1)},e[0]=a):a=e[0];const d=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=g=>{const j=g.currentTarget;l(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==i?(u=B("relative",i),e[2]=i,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:r}),e[4]=r,e[5]=n,e[6]=f):f=e[6];const x=o?"opacity-100":"opacity-0";let h;e[7]!==x?(h=B("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",x),e[7]=x,e[8]=h):h=e[8];let b;e[9]!==h?(b=s.jsx("div",{"aria-hidden":!0,className:h}),e[9]=h,e[10]=b):b=e[10];let p;return e[11]!==u||e[12]!==f||e[13]!==b?(p=s.jsxs("div",{className:u,children:[f,b]}),e[11]=u,e[12]=f,e[13]=b,e[14]=p):p=e[14],p}function Ji(t){const e=$.c(8),{virtualMcpId:n,size:i,showAutomationBadge:r}=t,o=i===void 0?"sm":i;let l;e[0]!==o||e[1]!==n?(l=n?s.jsx(Zi,{virtualMcpId:n,size:o}):s.jsx(ve,{icon:null,name:"?",size:o}),e[0]=o,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==r?(a=r&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(is,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==a?(d=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=d):d=e[7],d}function Zi(t){const e=$.c(6),{virtualMcpId:n,size:i}=t,r=qe(n);if(!r){let a;return e[0]!==i?(a=s.jsx(ve,{icon:null,name:"?",size:i}),e[0]=i,e[1]=a):a=e[1],a}const o=r.icon??null;let l;return e[2]!==r.title||e[3]!==i||e[4]!==o?(l=s.jsx(ve,{icon:o,name:r.title,size:i}),e[2]=r.title,e[3]=i,e[4]=o,e[5]=l):l=e[5],l}function Pt(t){const e=$.c(36),{open:n,onOpenChange:i}=t,[r,o]=L.useState(""),{org:l}=se(),{setTaskId:a}=xt(),d=ns();let c,m,u;e[0]!==l.id||e[1]!==r?(u=r.trim(),m=Ts,c=zs.globalSearch(l.id,u),e[0]=l.id,e[1]=r,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let x;e[5]!==d||e[6]!==u?(x=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=x):x=e[7];let h;e[8]!==c||e[9]!==f||e[10]!==x?(h={queryKey:c,enabled:f,queryFn:x,staleTime:1e4},e[8]=c,e[9]=f,e[10]=x,e[11]=h):h=e[11];const{data:b,isFetching:p}=m(h);let g;e[12]!==b?.items?(g=b?.items??[],e[12]=b?.items,e[13]=g):g=e[13];const j=g;let y;e[14]!==i?(y=I=>{I||o(""),i(I)},e[14]=i,e[15]=y):y=e[15];const v=y;let C;e[16]!==v||e[17]!==a?(C=I=>{v(!1),a(I.id,I.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=C):C=e[18];const N=C;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Rn,{className:"sr-only",children:[s.jsx(Ln,{children:"Search"}),s.jsx(Bn,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let S;e[20]!==r?(S=s.jsx(qn,{value:r,onValueChange:o,placeholder:"Search..."}),e[20]=r,e[21]=S):S=e[21];let w;e[22]!==N||e[23]!==p||e[24]!==j||e[25]!==u?(w=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Gn,{children:"No results."}):j.map(I=>I.type==="thread"?s.jsxs(Wn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>N(I),className:"gap-2.5",children:[s.jsx(Ji,{virtualMcpId:I.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:I.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=N,e[23]=p,e[24]=j,e[25]=u,e[26]=w):w=e[26];let A;e[27]!==w?(A=s.jsx(Kn,{children:w}),e[27]=w,e[28]=A):A=e[28];let z;e[29]!==S||e[30]!==A?(z=s.jsxs(Hn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(Vn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,A]})]}),e[29]=S,e[30]=A,e[31]=z):z=e[31];let k;return e[32]!==v||e[33]!==n||e[34]!==z?(k=s.jsx(Un,{open:n,onOpenChange:v,children:z}),e[32]=v,e[33]=n,e[34]=z,e[35]=k):k=e[35],k}function er(t){return t==="ephemeral"||t.startsWith("thread:")}function us(t){const e=$.c(40),{task:n,isActive:i,onClick:r,onArchive:o,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:d,indented:c}=t,m=Yn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",x=qe(f?void 0:n.virtual_mcp_id);let h;e[0]!==x?(h=In(x),e[0]=x,e[1]=h):h=e[1];const b=h;Jn(6e4);const p=l||!!n.trigger_id,g=n.id,j="button",y=0;let v;e[2]!==r?(v=G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),r())},e[2]=r,e[3]=v):v=e[3];const C=c?"-ml-4 pl-6":"pl-2",N=i?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==C||e[5]!==N?(_=B("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",C,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=C,e[5]=N,e[6]=_):_=e[6];let S;e[7]!==f||e[8]!==a||e[9]!==x?.icon||e[10]!==x?.title?(S=a&&!f&&s.jsx(ve,{icon:x?.icon??null,name:x?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=x?.icon,e[10]=x?.title,e[11]=S):S=e[11];let w;e[12]!==p?(w=p&&s.jsx(is,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=w):w=e[13];const A=n.title||"Untitled task";let z;e[14]!==A?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:A}),e[14]=A,e[15]=z):z=e[15];let k;e[16]!==w||e[17]!==z?(k=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,z]}),e[16]=w,e[17]=z,e[18]=k):k=e[18];let I;e[19]!==b||e[20]!==i||e[21]!==n.branch||e[22]!==n.updated_at?(I=n.updated_at&&s.jsxs("div",{className:B("flex items-center gap-1 text-[11px] min-w-0",i?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!er(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):b?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[b.owner,"/",b.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:ei(new Date(n.updated_at))})]}),e[19]=b,e[20]=i,e[21]=n.branch,e[22]=n.updated_at,e[23]=I):I=e[23];let M;e[24]!==k||e[25]!==I?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[k,I]}),e[24]=k,e[25]=I,e[26]=M):M=e[26];const H="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",P=!d&&s.jsx("span",{className:B("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",o&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:B(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let F;e[27]!==o?(F=o&&s.jsxs(pe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:G=>{G.stopPropagation(),o()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ms,{size:14})})}),s.jsx(he,{side:"right",children:"Archive"})]}),e[27]=o,e[28]=F):F=e[28];let E;e[29]!==P||e[30]!==F?(E=s.jsxs("div",{className:H,children:[P,F]}),e[29]=P,e[30]=F,e[31]=E):E=e[31];let D;return e[32]!==r||e[33]!==M||e[34]!==E||e[35]!==v||e[36]!==_||e[37]!==S||e[38]!==n.id?(D=s.jsxs("div",{"data-task-id":g,role:j,tabIndex:y,onClick:r,onKeyDown:v,className:_,children:[S,M,E]}),e[32]=r,e[33]=M,e[34]=E,e[35]=v,e[36]=_,e[37]=S,e[38]=n.id,e[39]=D):D=e[39],D}const tr="sidebar.group.expanded.";function sr(t,e){const n=$.c(3),[i,r]=He(`${tr}${t}`,e);let o;return n[0]!==i||n[1]!==r?(o=[i,r],n[0]=i,n[1]=r,n[2]=o):o=n[2],o}function fs(t){const e=$.c(12),{onClick:n,isFetching:i,indented:r}=t,o=r?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==o?(l=B("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",o,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==i?(a=i&&s.jsx(Gt,{size:14,className:"animate-spin"}),e[2]=i,e[3]=a):a=e[3];const d=i?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:i,className:l,children:[a,c]}),e[6]=i,e[7]=n,e[8]=l,e[9]=a,e[10]=c,e[11]=m):m=e[11],m}function nr(t,e,n,i){return[t,e,n,i.type,i.member,i.currentUserId??""].join("|")}function ir(t){return t.member==="mine"&&!t.currentUserId}const hs=4;let Fe=0;const lt=[];function rr(){for(;Fe<hs&&lt.length>0;){const t=lt.shift();t&&t()}}function ps(t){return new Promise((e,n)=>{const i=()=>{Fe++,t().then(e,n).finally(()=>{Fe--,rr()})};Fe<hs?i():lt.push(i)})}const Ke=10;function Dt(t,e,n,i,r){const o={hidden:!1};i.member==="mine"&&i.currentUserId&&(o.created_by=i.currentUserId),i.type==="automation"&&(o.has_trigger=!0),i.type==="manual"&&(o.has_trigger=!1);const l={where:o,limit:r,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function or(t,e,n,i){let r=0;for(const o of t)xs(o,e,n,i)&&r++;return r}function Ye(t,e,n,i){return or(t,e,n,i)}function lr(t,e){return!!(t>=Ke||t===0&&e)}function Et(t,e){return t<e}function ar(t,e){return e===!1?!1:e===!0?!0:t}function xs(t,e,n,i){return!(t.hidden||(t.status??"completed")!==n||i.member==="mine"&&i.currentUserId&&t.created_by!==i.currentUserId||i.type==="automation"&&!t.trigger_id||i.type==="manual"&&t.trigger_id)}const Be=new Map,Ee=new Map;function cr(t,e){return e?t>=Ke?!0:null:!1}function Ft(t){return Be.get(t)}function dr(t,e){Be.set(t,e)}function mr(t,e,n){const i=Be.get(t);if(i!==void 0){n(i);return}let r=Ee.get(t);r||(r=ps(e).then(o=>(Be.set(t,o),Ee.delete(t),o)).catch(()=>(Ee.delete(t),Promise.reject(new Error("group probe failed")))),Ee.set(t,r)),r.then(n,()=>n(!1))}function Rt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ke,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ur(t,e,n,i,r){let o=0;for(const l of t)e.has(l.id)||xs(l,n,i,r)&&o++;return o}function fr(t,e,n,i){const r=$.c(8),{org:o}=se(),l=nr(o.id,t,e,n);let a;r[0]!==n?(a=ir(n),r[0]=n,r[1]=a):a=r[1];const d=a,[c,m]=L.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==l&&m({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const u=Dn(),{threads:f,hasMore:x}=pt(),h=Ye(f,t,e,n),b=lr(h,x),p=cr(h,x),g=ns();if(c.identity===l&&c.serverHasMore===null){const _=p??Ft(l);_!==void 0&&m({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:_})}!d&&c.identity===l&&c.serverHasMore===null&&p===null&&Ft(l)===void 0&&c.probeSubscribedIdentity!==l&&(m(_=>_.identity===l?{..._,isProbing:!0,probeSubscribedIdentity:l}:_),mr(l,async()=>{const _=Dt(t,e,0,n,1),S=await g.call("COLLECTION_THREADS_LIST",_),{totalCount:w}=Rt(S),A=Ye(u.threads.get(),t,e,n);return w===void 0?!1:Et(A,w)},_=>{m(S=>S.identity!==l?S:{...S,isProbing:!1,serverHasMore:_})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=l;m(w=>w.identity===S?{...w,isFetching:!0}:w);try{const w=Ye(f,t,e,n),A=Dt(t,e,w,n,Ke),z=await ps(()=>g.call("COLLECTION_THREADS_LIST",A)),{items:k,hasMore:I,totalCount:M}=Rt(z),H=new Set(f.map(hr)),P=ur(k,H,t,e,n),F=w;u.mergeThreads(k),m(E=>{if(E.identity!==S)return E;let D;return M!==void 0?D=Et(F+P,M):D=k.length===0||P===0?!1:I,dr(S,D),{...E,isFetching:!1,serverHasMore:D}})}catch(w){const A=w,z=A instanceof Error?A.message:String(A);te.error(`Could not load more tasks: ${z}`),m(k=>k.identity===S?{...k,isFetching:!1}:k)}},v=c.isFetching||c.isProbing,C=!d&&!v&&ar(b,c.serverHasMore);let N;return r[2]!==v||r[3]!==y||r[4]!==C||r[5]!==c.isProbing||r[6]!==c.serverHasMore?(N={hasMore:C,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},r[2]=v,r[3]=y,r[4]=C,r[5]=c.isProbing,r[6]=c.serverHasMore,r[7]=N):N=r[7],N}function hr(t){return t.id}function pr(t){const e=$.c(20),{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:x}=fr("status",n,d),[h,b]=L.useState(!1);!h&&i.length===0&&x===!0&&!c&&!m&&(b(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==r||e[1]!==a||e[2]!==d||e[3]!==l||e[4]!==o||e[5]!==i){let y;e[7]!==r||e[8]!==a||e[9]!==d||e[10]!==l||e[11]!==o?(y=v=>s.jsx(us,{task:v,isActive:r===v.id,onClick:()=>o(v),onArchive:a&&v.created_by===d.currentUserId?()=>l(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=r,e[8]=a,e[9]=d,e[10]=l,e[11]=o,e[12]=y):y=e[12],p=i.map(y),e[0]=r,e[1]=a,e[2]=d,e[3]=l,e[4]=o,e[5]=i,e[6]=p}else p=e[6];let g;e[13]!==f||e[14]!==c||e[15]!==u?(g=(f||c)&&s.jsx(fs,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=g):g=e[16];let j;return e[17]!==p||e[18]!==g?(j=s.jsxs(s.Fragment,{children:[p,g]}),e[17]=p,e[18]=g,e[19]=j):j=e[19],j}function xr(t){const e=$.c(36),{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d}=t,c=Zn[n],m=c.icon,[u,f]=sr(`status-${n}`,!1);let x;e[0]!==u||e[1]!==f?(x=function(){f(!u)},e[0]=u,e[1]=f,e[2]=x):x=e[2];const h=x;let b;e[3]!==h?(b=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},e[3]=h,e[4]=b):b=e[4];let p;e[5]!==m||e[6]!==c.iconClassName?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=p):p=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(gt,{size:14}):s.jsx(ti,{size:14})}),e[8]=u,e[9]=g):g=e[9];let j;e[10]!==p||e[11]!==g?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,g]}),e[10]=p,e[11]=g,e[12]=j):j=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==i.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:i.length})}),e[15]=i.length,e[16]=v):v=e[16];let C;e[17]!==u||e[18]!==h||e[19]!==b||e[20]!==j||e[21]!==y||e[22]!==v?(C=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:b,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,y,v]}),e[17]=u,e[18]=h,e[19]=b,e[20]=j,e[21]=y,e[22]=v,e[23]=C):C=e[23];let N;e[24]!==r||e[25]!==a||e[26]!==u||e[27]!==d||e[28]!==l||e[29]!==o||e[30]!==n||e[31]!==i?(N=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(pr,{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d})}),e[24]=r,e[25]=a,e[26]=u,e[27]=d,e[28]=l,e[29]=o,e[30]=n,e[31]=i,e[32]=N):N=e[32];let _;return e[33]!==C||e[34]!==N?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[C,N]}),e[33]=C,e[34]=N,e[35]=_):_=e[35],_}function Lt(t){const e=$.c(38),{threads:n,groupBy:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,filters:a,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Qn,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const g=u?"No threads match your filters":"No threads yet";let j;return e[1]!==g?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:g})]}),e[1]=g,e[2]=j):j=e[2],j}const f=n.length>1||d;if(i==="status"){let p;if(e[3]!==r||e[4]!==f||e[5]!==a||e[6]!==l||e[7]!==o||e[8]!==n){let j;e[10]!==r||e[11]!==f||e[12]!==a||e[13]!==l||e[14]!==o?(j=y=>s.jsx(xr,{status:y.status,threads:y.threads,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:f,filters:a},y.status),e[10]=r,e[11]=f,e[12]=a,e[13]=l,e[14]=o,e[15]=j):j=e[15],p=Hi(n).map(j),e[3]=r,e[4]=f,e[5]=a,e[6]=l,e[7]=o,e[8]=n,e[9]=p}else p=e[9];let g;return e[16]!==p?(g=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=g):g=e[17],g}let x;if(e[18]!==r||e[19]!==f||e[20]!==a||e[21]!==l||e[22]!==o||e[23]!==n){let p;e[25]!==r||e[26]!==f||e[27]!==a||e[28]!==l||e[29]!==o?(p=g=>s.jsx(us,{task:g,isActive:r===g.id,onClick:()=>o(g),onArchive:f&&g.created_by===a.currentUserId?()=>l(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[25]=r,e[26]=f,e[27]=a,e[28]=l,e[29]=o,e[30]=p):p=e[30],x=n.map(p),e[18]=r,e[19]=f,e[20]=a,e[21]=l,e[22]=o,e[23]=n,e[24]=x}else x=e[24];let h;e[31]!==d||e[32]!==c||e[33]!==m?(h=(d||c)&&s.jsx(fs,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=h):h=e[34];let b;return e[35]!==x||e[36]!==h?(b=s.jsxs(s.Fragment,{children:[x,h]}),e[35]=x,e[36]=h,e[37]=b):b=e[37],b}function Bt(t){const e=$.c(17),{label:n,onClick:i,active:r,children:o}=t,[l,a]=L.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>a(!0),c=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=r&&"bg-sidebar-accent text-foreground";let x;e[4]!==f?(x=B(f),e[4]=f,e[5]=x):x=e[5];let h;e[6]!==o||e[7]!==n||e[8]!==i||e[9]!==x?(h=s.jsx(fe,{asChild:!0,children:s.jsx(je,{"aria-label":n,onClick:i,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:x,children:o})}),e[6]=o,e[7]=n,e[8]=i,e[9]=x,e[10]=h):h=e[10];let b;e[11]!==n?(b=s.jsx(he,{side:"bottom",children:n}),e[11]=n,e[12]=b):b=e[12];let p;return e[13]!==l||e[14]!==h||e[15]!==b?(p=s.jsxs(pe,{open:l,children:[h,b]}),e[13]=l,e[14]=h,e[15]=b,e[16]=p):p=e[16],p}function Je(t){const e=$.c(13),{label:n,value:i,onChange:r,options:o}=t;let l;e[0]!==n?(l=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==r?(a=u=>u&&r(u),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==o?(d=o.map(gr),e[4]=o,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==i?(c=s.jsx(Pn,{type:"single",size:"sm",value:i,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=a,e[7]=d,e[8]=i,e[9]=c):c=e[9];let m;return e[10]!==l||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,c]}),e[10]=l,e[11]=c,e[12]=m):m=e[12],m}function gr(t){return s.jsxs(On,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function gs({onNavigate:t}={}){const{data:e}=ge.useSession(),n=e?.user?.id,{org:i}=se(),r=Jt({connectionId:es,orgId:i.id,orgSlug:i.slug}),o=Le(i.id).id,l=ht(),{threads:a,hasMore:d,isFetchingMore:c,fetchNextPage:m}=pt(),u=a.filter(T=>!T.hidden),{hide:f}=ss(),x=le(),{setTaskId:h,createNewTask:b}=xt(),p=at({strict:!1}),g=Ue({strict:!1}),j=p.taskId??null,y=g.virtualmcpid??a.find(T=>T.id===j)?.virtual_mcp_id??null,v=()=>{t?.()},C=[...u].sort((T,U)=>(U.updated_at??"").localeCompare(T.updated_at??"")),[N,_]=L.useState("all"),[S,w]=L.useState("flat"),[A,z]=He("sidebar-threads-scope-all",!1),[k,I]=L.useState(!1),[M,H]=L.useState(!1),P={type:N,member:"mine",currentUserId:n??null},F=T=>n?T.filter(U=>U.created_by===n):[],E=T=>N==="automation"?T.filter(U=>!!U.trigger_id):N==="manual"?T.filter(U=>!U.trigger_id):T,D=F(C),G=E(D),Q=E(C),Z=A?Q:G,O=T=>{if(n&&T.created_by&&T.created_by!==n)return;const U=T.id===j;if(f(T.id),!U)return;const X=D.find(W=>W.id!==T.id&&W.virtual_mcp_id===T.virtual_mcp_id);v(),X?h(X.id,X.virtual_mcp_id):x({to:"/$org",params:{org:i.slug}})},R=T=>{v(),h(T.id,T.virtual_mcp_id)},Y=async T=>{try{const U=await r.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((U.structuredContent??U).items?.length??0)===0}catch{return!1}},K=async()=>{const T=y??o;me("sidebar_new_thread_clicked",{virtual_mcp_id:T});const U=D.find(X=>X.virtual_mcp_id===T&&X.title==="New chat");if(U&&await Y(U.id)){v(),h(U.id,T);return}v(),b(T)},{state:ne,isMobile:V,toggleSidebar:ie}=ye();if(ne==="collapsed"&&!V){const T=Le(i.id),U=new Map((l??[]).map(W=>[W.id,W])),X=W=>(W?U.get(W):void 0)??(W===o?T:void 0);return s.jsxs(ue,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(q,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:ie,children:s.jsx(Vt,{size:16})})}),s.jsx(q,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{K()},children:s.jsx(Nt,{size:16})})}),Z.map(W=>{const ce=X(W.virtual_mcp_id);return s.jsx(q,{children:s.jsx(J,{tooltip:W.title||"New chat",isActive:W.id===j,onClick:()=>R(W),children:s.jsx(ve,{icon:ce?.icon??null,name:ce?.title??"Agent",size:"2xs"})})},W.id)})]})}const ae=S!=="flat"||N!=="all"||A===!0,xe=s.jsxs(Ge,{children:[s.jsxs(pe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(je,{"aria-label":"Filter threads",active:ae,children:[s.jsx(Mn,{size:16}),ae&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(he,{side:"bottom",children:"Filter threads"})]}),s.jsxs(We,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Je,{label:"View",value:S,onChange:T=>{me("tasks_panel_group_by_changed",{to_value:T}),w(T)},options:[{value:"flat",label:"List",icon:s.jsx(mn,{size:13})},{value:"status",label:"Status",icon:s.jsx(un,{size:13})}]}),s.jsx(Je,{label:"Type",value:N,onChange:T=>{me("tasks_panel_filter_changed",{to_value:T}),_(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Je,{label:"Scope",value:A?"team":"mine",onChange:T=>z(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),be=T=>s.jsx(tt,{delayDuration:300,children:s.jsxs("div",{className:B("shrink-0 px-1 flex items-center justify-between",T?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(rs,{}),xe]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Bt,{label:"Search threads",onClick:()=>{me("tasks_panel_search_opened"),H(!0),I(!0)},children:s.jsx(dn,{size:16})}),s.jsx(Bt,{label:"New thread",onClick:()=>{K()},children:s.jsx(Nt,{size:16})})]})]})});return V?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[be(!0),s.jsx(Ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Lt,{threads:Z,groupBy:S,activeTaskId:j,onSelectTask:R,onArchiveTask:O,filters:P,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ae})}),M&&s.jsx(Pt,{open:k,onOpenChange:I})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[be(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Lt,{threads:Z,groupBy:S,activeTaskId:j,onSelectTask:R,onArchiveTask:O,filters:P,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ae})})}),M&&s.jsx(Pt,{open:k,onOpenChange:I})]})}const br=5,jr=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function bs(){const t=$.c(3),{state:e}=ye();if(e==="collapsed"){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:br}).map(Sr)}),t[0]=r):r=t[0],r}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"})]}),s.jsx(oe,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:jr.map(vr)})]}),t[2]=i):i=t[2],i}function vr(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(oe,{className:"size-5 rounded-full shrink-0"}),s.jsx(oe,{className:B("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(yr)})]},e)}function yr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(oe,{className:"h-3 flex-1 rounded-sm"})},e)}function Sr(t,e){return s.jsx(oe,{className:"size-10 rounded-lg mx-auto"},e)}function _r(){const t=$.c(4),e=ls();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Qi,{}),t[0]=n):n=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Wt,{children:s.jsx(L.Suspense,{fallback:s.jsx(bs,{}),children:s.jsx(gs,{})})}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsx(ts,{children:s.jsx(ds,{sections:e,footer:n,additionalContent:i})}),t[2]=e,t[3]=r):r=t[3],r}function Nr(t){const e=$.c(8),{onClose:n}=t,i=ls();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Yi,{}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(bs,{}),e[1]=o):o=e[1];let l;e[2]!==n?(l=s.jsx(Wt,{children:s.jsx(L.Suspense,{fallback:o,children:s.jsx(gs,{onNavigate:n})})}),e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==n||e[5]!==i||e[6]!==l?(a=s.jsx(ts,{children:s.jsx(Pi,{sections:i,onClose:n,footer:r,additionalContent:l})}),e[4]=n,e[5]=i,e[6]=l,e[7]=a):a=e[7],a}function js(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wr=Os({name:Ps().min(2,"Organization name is required")});function Cr(t){const e=$.c(41),{open:n,onOpenChange:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:Ds(wr),defaultValues:{name:""}},e[0]=r):r=e[0];const o=Es(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Ar,onSuccess:kr},e[1]=l):l=e[1];const a=Fs(l),d=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ci,{children:[s.jsx(di,{children:"Create a new organization"}),s.jsx(mi,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==a||e[4]!==o){let _;e[6]!==a?(_=S=>a.mutateAsync(S),e[6]=a,e[7]=_):_=e[7],m=o.handleSubmit(_),e[3]=a,e[4]=o,e[5]=m}else m=e[5];let u;e[8]!==o.formState.isSubmitting?(u=_=>{const{field:S}=_;return s.jsxs(xi,{children:[s.jsx(gi,{children:"Organization Name"}),s.jsx(bi,{children:s.jsx(yi,{...S,placeholder:"Acme Inc.",disabled:o.formState.isSubmitting})}),s.jsx(ji,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",js(S.value)]})]}),s.jsx(vi,{})]})},e[8]=o.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==o.control||e[11]!==u?(f=s.jsx(hi,{control:o.control,name:"name",render:u}),e[10]=o.control,e[11]=u,e[12]=f):f=e[12];let x;e[13]!==d?(x=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=x):x=e[14];let h;e[15]!==a||e[16]!==o?(h=()=>{a.reset(),o.reset()},e[15]=a,e[16]=o,e[17]=h):h=e[17];let b;e[18]!==o.formState.isSubmitting||e[19]!==h?(b=s.jsx(li,{disabled:o.formState.isSubmitting,onClick:h,children:"Cancel"}),e[18]=o.formState.isSubmitting,e[19]=h,e[20]=b):b=e[20];const p=!o.formState.isValid||o.formState.isSubmitting;let g;e[21]!==o.formState.isSubmitting?(g=o.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(si,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=o.formState.isSubmitting,e[22]=g):g=e[22];let j;e[23]!==p||e[24]!==g?(j=s.jsx(Ze,{type:"submit",variant:"default",disabled:p,children:g}),e[23]=p,e[24]=g,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==b?(y=s.jsxs(ui,{children:[b,j]}),e[26]=j,e[27]=b,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==x?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,x,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=x,e[33]=v):v=e[33];let C;e[34]!==o||e[35]!==v?(C=s.jsxs(ai,{children:[c,s.jsx(pi,{...o,children:v})]}),e[34]=o,e[35]=v,e[36]=C):C=e[36];let N;return e[37]!==i||e[38]!==n||e[39]!==C?(N=s.jsx(fi,{open:n,onOpenChange:i,children:C}),e[37]=i,e[38]=n,e[39]=C,e[40]=N):N=e[40],N}function kr(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ar(t){const e=js(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ge.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const i=n?.data?.slug??e;if(!i)throw new Error("Failed to create organization");return{orgSlug:i}}function vs(){const t=L.useContext(Rs),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date),refetch:()=>n?.()}}function Ir(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function jt(t){const e=$.c(13),{org:n,size:i}=t,r=i===void 0?"sm":i,o=r==="xs"?"size-5":"size-6",l=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==o?(a=B(o,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:Ir(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:B("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=c):c=e[8];let m;return e[9]!==a||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:a,style:d,children:c}),e[9]=a,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function $r({invitation:t,onChanged:e}){const[n,i]=L.useState(!1),r=t.organizationName??"Unknown organization",o=async()=>{i(!0);try{const d=await ge.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),i(!1);return}}catch{te.error("Failed to accept invitation"),i(!1);return}te.success(`Joined ${r}`),Bs();let a;try{a=(await ge.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},l=async()=>{i(!0);try{const a=await ge.organization.rejectInvitation({invitationId:t.id});if(a.error){te.error(a.error.message),i(!1);return}te.success("Invitation declined"),i(!1),e()}catch{te.error("Failed to decline invitation"),i(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(jt,{org:{name:r},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:r}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Ze,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:o,disabled:n,children:"Accept"}),s.jsx(Ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:n,"aria-label":`Decline invitation to ${r}`,children:s.jsx(oi,{size:14})})]})]})}function zr(t){const e=$.c(29),{orgParam:n,onSelectOrg:i,onCreateOrg:r}=t,{data:o}=Ls(),{invitations:l,refetch:a}=vs();let d;e[0]!==n?(d=(k,I)=>k.slug===n?-1:I.slug===n?1:k.name.localeCompare(I.name),e[0]=n,e[1]=d):d=e[1];const c=[...o??[]].sort(d),[m,u]=L.useState(""),f=m.toLowerCase(),x=f?c.filter(k=>k.name.toLowerCase().includes(f)||k.slug.toLowerCase().includes(f)):c;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(os,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=h):h=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=k=>u(k.target.value),e[3]=b):b=e[3];let p;e[4]!==m?(p=k=>k.key==="Escape"&&m&&u(""),e[4]=m,e[5]=p):p=e[5];let g;e[6]!==m||e[7]!==p?(g=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:b,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=m,e[7]=p,e[8]=g):g=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx($e,{size:16}),e[9]=j):j=e[9];let y;e[10]!==r?(y=s.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=r,e[11]=y):y=e[11];let v;e[12]!==g||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[h,g,y]}),e[12]=g,e[13]=y,e[14]=v):v=e[14];const C="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let N;e[15]!==l||e[16]!==m||e[17]!==a?(N=!m&&l.map(k=>s.jsx($r,{invitation:k,onChanged:a},k.id)),e[15]=l,e[16]=m,e[17]=a,e[18]=N):N=e[18];const _=x.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?`No organizations match "${m}"`:"No organizations available"});let S;e[19]!==i||e[20]!==n?(S=k=>s.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:B("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(jt,{org:k,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===n&&s.jsx(ft,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[19]=i,e[20]=n,e[21]=S):S=e[21];const w=x.map(S);let A;e[22]!==N||e[23]!==_||e[24]!==w?(A=s.jsxs("div",{className:C,children:[N,_,w]}),e[22]=N,e[23]=_,e[24]=w,e[25]=A):A=e[25];let z;return e[26]!==A||e[27]!==v?(z=s.jsxs(s.Fragment,{children:[v,A]}),e[26]=A,e[27]=v,e[28]=z):z=e[28],z}function Tr(t){const e=$.c(22),{trigger:n,orgParam:i,align:r,side:o}=t,l=r===void 0?"start":r,a=o===void 0?"bottom":o,d=le(),[c,m]=L.useState(!1),[u,f]=L.useState(!1);let x;e[0]!==n?(x=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=x):x=e[1];const h=String(c);let b;e[2]!==d?(b=N=>{m(!1),d({to:"/$org",params:{org:N}})},e[2]=d,e[3]=b):b=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{m(!1),f(!0)},e[4]=p):p=e[4];let g;e[5]!==i||e[6]!==h||e[7]!==b?(g=s.jsx(zr,{orgParam:i,onSelectOrg:b,onCreateOrg:p},h),e[5]=i,e[6]=h,e[7]=b,e[8]=g):g=e[8];let j;e[9]!==l||e[10]!==a||e[11]!==g?(j=s.jsx(We,{side:a,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Or,onCloseAutoFocus:Mr,children:g}),e[9]=l,e[10]=a,e[11]=g,e[12]=j):j=e[12];let y;e[13]!==c||e[14]!==x||e[15]!==j?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[x,j]}),e[13]=c,e[14]=x,e[15]=j,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(Cr,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let C;return e[19]!==v||e[20]!==y?(C=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=C):C=e[21],C}function Mr(t){return t.preventDefault()}function Or(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Pr(t){const e=$.c(21),{value:n,onChange:i,placeholder:r,onKeyDown:o,className:l,isSearching:a,disabled:d}=t,c=r===void 0?"Search...":r;let m;e[0]!==l?(m=B("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=B("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let x;e[4]!==a?(x=a?s.jsx(Gt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(os,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=x):x=e[5];let h;e[6]!==i?(h=j=>i(j.target.value),e[6]=i,e[7]=h):h=e[7];let b;e[8]!==d||e[9]!==o||e[10]!==c||e[11]!==h||e[12]!==n?(b=s.jsx("input",{type:"text",value:n,onChange:h,onKeyDown:o,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=o,e[10]=c,e[11]=h,e[12]=n,e[13]=b):b=e[13];let p;e[14]!==f||e[15]!==x||e[16]!==b?(p=s.jsxs("label",{className:f,children:[x,b]}),e[14]=f,e[15]=x,e[16]=b,e[17]=p):p=e[17];let g;return e[18]!==m||e[19]!==p?(g=s.jsx("div",{className:m,children:p}),e[18]=m,e[19]=p,e[20]=g):g=e[20],g}const Dr="Select an existing agent";function Er(t){const e=$.c(5),{children:n}=t;let i;e[0]!==n?(i=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(he,{side:"right",sideOffset:8,children:Dr}),e[2]=r):r=e[2];let o;return e[3]!==i?(o=s.jsxs(pe,{defaultOpen:!0,delayDuration:0,children:[i,r]}),e[3]=i,e[4]=o):o=e[4],o}function Fr(t){const e=le(),{create:n}=ss(),{locator:i}=se(),r=at({strict:!1}),o=Ue({strict:!1});return async l=>{const a=crypto.randomUUID(),d=l===o.virtualmcpid?Fn(t,i,r.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Ht(t){const e=$.c(20),{agent:n,selected:i,onClick:r}=t,o=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==o?(l=B("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",o),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ve,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==i?(u=i&&s.jsx(ft,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=u):u=e[13];let f;return e[14]!==r||e[15]!==l||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:r,className:l,children:[a,m,u]}),e[14]=r,e[15]=l,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Rr(t){const e=$.c(24),{onClose:n,onSelectAgent:i,selectedAgentId:r}=t,[o,l]=L.useState(""),a=ht(),d=a??[],{org:c}=se(),{data:m}=ge.useSession(),u=m?.user?.id??"anon",f=_n(a),x=Nn(),h=Fr(c.slug),b=$n(a),p=o.toLowerCase(),g=d.filter(Br).filter(D=>!b.has(D.id)).filter(Lr).filter(D=>!o||D.title.toLowerCase().includes(p)),j=Le(c.id),y=!o||j.title.toLowerCase().includes(p),v=!!(i&&y);let C;e[0]!==n||e[1]!==i?(C=()=>{i?.(null),n(),l("")},e[0]=n,e[1]=i,e[2]=C):C=e[2];const N=C,_=D=>{if(i){i(D.id),n(),l("");return}wn({orgId:c.id,userId:u},D.id,f),x(),n(),l(""),h(D.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let w;e[3]!==o?(w=s.jsx(Pr,{value:o,onChange:l,placeholder:"Search agents..."}),e[3]=o,e[4]=w):w=e[4];const A="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-1",z=i&&y&&j&&s.jsx(Ht,{agent:j,selected:!r||r===j.id,onClick:N}),k=g.map(D=>s.jsx(Ht,{agent:D,selected:i?r===D.id:void 0,onClick:()=>_(D)},D.id));let I;e[5]!==v||e[6]!==o||e[7]!==g.length?(I=g.length===0&&!v&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:o?"No agents found":"No agents yet"}),e[5]=v,e[6]=o,e[7]=g.length,e[8]=I):I=e[8];let M;e[9]!==z||e[10]!==k||e[11]!==I?(M=s.jsxs("div",{className:A,children:[z,k,I]}),e[9]=z,e[10]=k,e[11]=I,e[12]=M):M=e[12];let H;e[13]!==c.slug?(H={org:c.slug},e[13]=c.slug,e[14]=H):H=e[14];let P;e[15]!==n?(P=()=>n(),e[15]=n,e[16]=P):P=e[16];let F;e[17]!==P||e[18]!==H?(F=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Hs,{to:"/$org/settings/agents",params:H,onClick:P,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[17]=P,e[18]=H,e[19]=F):F=e[19];let E;return e[20]!==F||e[21]!==w||e[22]!==M?(E=s.jsxs("div",{className:S,children:[w,M,F]}),e[20]=F,e[21]=w,e[22]=M,e[23]=E):E=e[23],E}function Lr(t){return!bn(t.id)}function Br(t){return!Zt(t.id)}function Hr(t){const e=$.c(23);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:i,trigger:r,onSelectAgent:o,selectedAgentId:l,side:a,align:d}=n,c=i===void 0?!1:i,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,x]=L.useState(!1),h=mt(),{setOpenMobile:b}=ye(),p=Sn(),g=p?"border border-border":void 0;let j;e[2]!==p?(j=w=>p?s.jsx(Er,{children:w}):w,e[2]=p,e[3]=j):j=e[3];const y=j;let v;e[4]!==h||e[5]!==b?(v=()=>{x(!1),h&&b(!1)},e[4]=h,e[5]=b,e[6]=v):v=e[6];const C=v;let N;e[7]!==C||e[8]!==o||e[9]!==f||e[10]!==l?(N=f&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(oe,{className:"h-4 w-24"})}),children:s.jsx(Rr,{onClose:C,onSelectAgent:o,selectedAgentId:l})}),e[7]=C,e[8]=o,e[9]=f,e[10]=l,e[11]=N):N=e[11];const _=N;let S;return e[12]!==u||e[13]!==c||e[14]!==g||e[15]!==p||e[16]!==h||e[17]!==f||e[18]!==_||e[19]!==m||e[20]!==r||e[21]!==y?(S=s.jsx(s.Fragment,{children:h?s.jsxs(s.Fragment,{children:[r?s.jsx("button",{type:"button",onClick:()=>x(!0),className:"contents",children:r}):c?y(s.jsx(je,{"aria-label":"Browse agents",className:B(g),onClick:()=>{me("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(q,{children:y(s.jsxs(J,{tooltip:p?void 0:"Browse agents",className:B(g),onClick:()=>{me("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Xt,{open:f,onOpenChange:x,direction:"bottom",children:s.jsxs(Qt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Yt,{className:"sr-only",children:"Browse agents"}),_]})})]}):s.jsxs(Ge,{open:f,onOpenChange:w=>{w&&!f&&me("agent_browser_opened",{surface:"desktop_popover"}),x(w)},children:[r?s.jsx(ze,{asChild:!0,children:r}):c?y(s.jsx(ze,{asChild:!0,children:s.jsx(je,{"aria-label":"Browse agents",className:B(g),children:s.jsx($e,{className:"size-4"})})})):s.jsx(q,{children:y(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:p?void 0:"Browse agents",className:B(g),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(We,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:_})]})}),e[12]=u,e[13]=c,e[14]=g,e[15]=p,e[16]=h,e[17]=f,e[18]=_,e[19]=m,e[20]=r,e[21]=y,e[22]=S):S=e[22],S}const Ur="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Gr(t){const e=$.c(19),{agentId:n,fallback:i,onOpenHome:r,onPick:o}=t,l=qe(n)??i??null,a=l?.title??"Super Agent",d=`Open ${a} home`,c=l?.icon??null;let m;e[0]!==c||e[1]!==a?(m=s.jsx(ve,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=m):m=e[2];let u;e[3]!==r||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:r,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m}),e[3]=r,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(gt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=x):x=e[9];let h;e[10]!==f?(h=s.jsxs("button",{type:"button",className:Ur,children:[f,x]}),e[10]=f,e[11]=h):h=e[11];let b;e[12]!==n||e[13]!==o||e[14]!==h?(b=s.jsx(Hr,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:o,trigger:h}),e[12]=n,e[13]=o,e[14]=h,e[15]=b):b=e[15];let p;return e[16]!==u||e[17]!==b?(p=s.jsxs("div",{className:"flex items-center gap-1",children:[u,b]}),e[16]=u,e[17]=b,e[18]=p):p=e[18],p}function Ut(){const t=$.c(42),{org:e}=se(),n=le();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[0]=i):i=t[0];const r=at(i);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[1]=o):o=t[1];const l=Ue(o),{threads:a}=pt(),{setTaskId:d,createNewTask:c}=xt(),m=vs().invitations.length>0;let u;t[2]!==e.id?(u=Le(e.id),t[2]=e.id,t[3]=u):u=t[3];const f=u,x=f.id,h=r.taskId?l.virtualmcpid??x:x;let b;t[4]!==c||t[5]!==x||t[6]!==n||t[7]!==e.slug||t[8]!==d||t[9]!==a?(b=H=>{if(!H||H===x){n({to:"/$org",params:{org:e.slug}});return}const P=Si(a,H);P?d(P.id,H):c(H)},t[4]=c,t[5]=x,t[6]=n,t[7]=e.slug,t[8]=d,t[9]=a,t[10]=b):b=t[10];const p=b,g=m?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let j;t[11]!==e?(j=s.jsx(jt,{org:e,size:"sm"}),t[11]=e,t[12]=j):j=t[12];let y;t[13]!==m?(y=m&&s.jsx("span",{className:"absolute -top-1 -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background"}),t[13]=m,t[14]=y):y=t[14];let v;t[15]!==j||t[16]!==y?(v=s.jsxs("span",{className:"relative inline-flex",children:[j,y]}),t[15]=j,t[16]=y,t[17]=v):v=t[17];let C;t[18]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(gt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[18]=C):C=t[18];let N;t[19]!==g||t[20]!==v?(N=s.jsx(fe,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":g,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-md pl-3 pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[v,C]})}),t[19]=g,t[20]=v,t[21]=N):N=t[21];let _;t[22]!==e.slug||t[23]!==N?(_=s.jsx(Tr,{orgParam:e.slug,trigger:N}),t[22]=e.slug,t[23]=N,t[24]=_):_=t[24];let S;t[25]!==e.name?(S=s.jsx(he,{side:"bottom",children:e.name}),t[25]=e.name,t[26]=S):S=t[26];let w;t[27]!==_||t[28]!==S?(w=s.jsx(kt,{children:s.jsxs(pe,{children:[_,S]})}),t[27]=_,t[28]=S,t[29]=w):w=t[29];let A;t[30]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[30]=A):A=t[30];const z=h===x?f:void 0;let k;t[31]!==h||t[32]!==p?(k=()=>p(h),t[31]=h,t[32]=p,t[33]=k):k=t[33];let I;t[34]!==h||t[35]!==p||t[36]!==z||t[37]!==k?(I=s.jsx(kt,{children:s.jsx(L.Suspense,{fallback:A,children:s.jsx(Gr,{agentId:h,fallback:z,onOpenHome:k,onPick:p})})}),t[34]=h,t[35]=p,t[36]=z,t[37]=k,t[38]=I):I=t[38];let M;return t[39]!==w||t[40]!==I?(M=s.jsx(ii,{className:"wco-no-drag",children:s.jsxs(ri,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[w,I]})}),t[39]=w,t[40]=I,t[41]=M):M=t[41],M}const Wr="sidebar.open";function qr(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Gs,{}),t[0]=e):e=t[0],e}function la(){const t=$.c(24),e=mt(),[n,i]=He(Wr,!1),{width:r,wrapperRef:o,onStartResize:l,resetWidth:a}=Ci();let d;t[0]!==e?(d=e?s.jsxs(ee.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[s.jsx(rs,{}),s.jsx(Ut,{}),s.jsx(ot,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ee.TogglesSlot,{}),s.jsx(ee.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ee.CenterSlot,{}),s.jsx(ee.RightSlot,{})]}):s.jsxs(ee.Header,{children:[s.jsxs(ee.LeftColumn,{children:[s.jsx(Ut,{}),s.jsx(ee.TogglesSlot,{})]}),s.jsx(ee.CenterSlot,{}),s.jsxs(ee.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(ee.TabsSlot,{})}),s.jsx(ee.RightSlot,{})]})]}),t[0]=e,t[1]=d):d=t[1];const c=`${r}px`;let m;t[2]!==c?(m={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},t[2]=c,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(_r,{}),s.jsx(_i,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},t[8]=x):x=t[8];let h;t[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ks,{className:"flex flex-col",style:x,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(L.Suspense,{fallback:s.jsx(qr,{}),children:s.jsx(Us,{})})})})}),t[9]=h):h=t[9];let b;t[10]!==u||t[11]!==f||t[12]!==o?(b=s.jsxs(Vs,{ref:o,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,h]}),t[10]=u,t[11]=f,t[12]=o,t[13]=b):b=t[13];let p;t[14]!==e?(p=e&&s.jsx(Xn,{renderSidebar:Kr}),t[14]=e,t[15]=p):p=t[15];let g;t[16]!==d||t[17]!==b||t[18]!==p?(g=s.jsx(ni,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[d,b,p]})}),t[16]=d,t[17]=b,t[18]=p,t[19]=g):g=t[19];let j;return t[20]!==i||t[21]!==n||t[22]!==g?(j=s.jsx(En,{children:s.jsx(ee.Provider,{children:s.jsx(Xs,{open:n,onOpenChange:i,children:g})})}),t[20]=i,t[21]=n,t[22]=g,t[23]=j):j=t[23],j}function Kr(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Nr,{onClose:e})})})}export{la as default};
1
+ import{c as $,j as s,Y as He,r as L,Z as se,b as le,l as B,M as me,_ as Ns,$ as ws,a as ge,a0 as Cs,a1 as ks,t as te,a2 as As,a3 as Is,p as $s,u as Ue,a4 as vt,K as zs,k as Ts,a5 as Ms,i as Gt,e as at,P as Wt,G as Os,H as Ps,I as Ds,J as Es,d as Fs,B as Ze,a6 as Rs,T as Ls,U as Bs,a7 as Hs,X as Us,a8 as Gs}from"./index-DMN_Rked.js";import{u as be,S as ct,a as dt,b as ue,c as J,d as q,e as qt,f as Kt,g as Ws,h as qs,i as et,j as Ks,k as Vs,l as Xs}from"./sidebar-Bm-lvNcY.js";import{u as mt}from"./use-mobile-Bnptpe5B.js";import{n as Qs}from"./Loading02-CspLF2F0.js";import{u as Ys}from"./use-organization-settings-Bx5d1sfW.js";import{S as oe}from"./skeleton-iuUYNmRM.js";import{i as Vt}from"./LayoutLeft-BtyrGENa.js";import{T as ve}from"./toolbar-icon-button-DhF-X-CG.js";import{P as Ge,a as ze,b as We}from"./popover-Clng0ZJV.js";import{D as Xt,a as Qt,b as Yt}from"./drawer-Blh4Dutf.js";import{A as Re}from"./avatar-D_h7Zjsw.js";import{a as fe,b as he,c as tt,T as pe}from"./tooltip-BtYF7_zM.js";import{a as yt}from"./Copy01-q2tZkjT4.js";import{n as Js,i as Zs}from"./Globe01-Bin8wesr.js";import{i as en}from"./ZoomOut-CS9L-ywb.js";import{i as tn,a as sn}from"./ZapSquare-V3ed5UhP.js";import{i as st}from"./Monitor01-BWuNG8O1.js";import{n as nn,a as rn}from"./Sun-i1Uh6gT7.js";import{a as ut}from"./Settings02-DMsX-AbA.js";import{i as on}from"./Shield01-wI6Ku8QP.js";import{a as ln}from"./Users03-0vBMlaHT.js";import{a as St,b as _t,c as an,d as cn,A as ye,e as Nt,i as dn,s as mn,f as un}from"./agent-icon-DZ_0evWF.js";import"./index-DkKZoD-8.js";import{D as fn,a as hn,b as pn,c as wt,d as xn}from"./dropdown-menu-B44reSZZ.js";import{i as ft}from"./Check-g-NnDeM7.js";import{s as $e}from"./Plus-BtlyhCvw.js";import{u as gn}from"./use-connection-8sLV5h2D.js";import{u as Jt}from"./use-mcp-client-BuOlOrnj.js";import{u as ht,a as qe}from"./use-virtual-mcp-CS2IAHte.js";import{i as Zt,S as es,a as Le,b as bn}from"./constants-B72Xmt_K.js";import{G as jn,g as nt,i as vn,a as it}from"./github-repo-picker-CNnbOcMn.js";import{u as yn,S as ts,a as Sn,g as _n,b as Nn,c as wn}from"./use-navigate-to-agent-DJjFVL6R.js";import{I as Cn}from"./invite-member-dialog-Dj0RpUB1.js";import{u as kn,A as An,g as In,a as $n}from"./agent-capabilities-BDsdarxp.js";import{u as zn,v as Tn,C as Ct}from"./connect-desktop-dialog-D2NDgQpd.js";import{i as Mn}from"./FilterLines-Dorw2Z-z.js";import{T as On,a as Pn}from"./toggle-group-YEkw_wl3.js";import{u as Dn,a as pt,b as ss,T as En}from"./hooks-n5BHrfUo.js";import{u as xt,r as Fn}from"./shell-layout-CKq6i_Cc.js";import{c as Rn,a as Ln,b as Bn,d as Hn,e as Un}from"./dialog-D9ySvI1O.js";import{C as Gn,a as Wn,b as qn,c as Kn,d as Vn}from"./command-B_ZTQl7x.js";import{u as ns}from"./studio-tools-DLBcGC5U.js";import{i as is}from"./Zap-07K1SyLr.js";import{S as rs,M as Xn}from"./shell-controls-BB9FzKsa.js";import{n as Qn}from"./Stars02-De8VF47I.js";import{g as Yn,u as Jn,S as Zn}from"./use-clock-tick-y2lakzVG.js";import{f as ei}from"./format-time-Cy7tTmZp.js";import{t as gt}from"./ChevronDown-CQf5r-0t.js";import{i as ti}from"./ChevronRight-BzUdHMwK.js";import{S as si,C as ni}from"./chat-context-C_WNvxNI.js";import{B as kt,a as ii,b as ri}from"./breadcrumb-BwIaP-rJ.js";import{i as os}from"./SearchMd-DQPYNWst.js";import{s as oi}from"./XClose-Bxhu78Fb.js";import{A as li,a as ai,b as ci,c as di,d as mi,e as ui,f as fi}from"./alert-dialog-1uk4XW0i.js";import{F as hi,a as pi,b as xi,c as gi,d as bi,f as ji,e as vi}from"./form-BBc7G1M6.js";import{I as yi}from"./input-C9Uf8Uy-.js";import{f as Si}from"./reusable-new-chat-qqWu133U.js";import{T as ee}from"./toolbar-T6dr23V8.js";import"./X-CF1SImWI.js";import"./User01-UnD8sXXC.js";import"./AlertCircle-DahgYBAW.js";import"./Tool01-D-4KEBn9.js";import"./SwitchHorizontal01-CYAijPcz.js";import"./XCircle-DinyVT9K.js";import"./ArrowUpRight-DFvdnwNr.js";import"./CheckCircle-Cb5Jbg2t.js";import"./ChevronUp-8lp9PAbT.js";import"./Circle-C2Tx9gws.js";import"./DotsVertical-Fs6hrY9l.js";import"./Eye-C5-fhZcB.js";import"./Star01-CPrulluL.js";import"./Globe04-DBhgUNpj.js";import"./HardDrive-iJnKVXq3.js";import"./Key01-C6YLNaPI.js";import"./LinkExternal01-CGvkWc_L.js";import"./List-BwGozbNv.js";import"./Palette-DSmqzbCU.js";import"./Play-IThg_ZW4.js";import"./SearchLg-C6-jg5ay.js";import"./Stars01-0PPh4bxa.js";import"./Trash01-CcpK6AE5.js";import"./Upload01-CV5XE_H-.js";import"./Users01-D9OMjKlD.js";import"./use-collections-Dv4e_gOh.js";import"./auth-9NoVZgB6.js";import"./checkbox-CHVHNKgG.js";import"./collection-search-BXhrJ3CT.js";import"./use-debounced-value-9umdfO4B.js";import"./authenticate-and-persist-oauth-iB_3ma16.js";import"./mcp-oauth-KLMYE_3J.js";import"./use-mcp-tools-B7-zbrlB.js";import"./extract-connection-data-CGzSQ9wP.js";import"./github-installations-DzN1UQ4x.js";import"./select-CU_eaLJy.js";import"./textarea-86Nn-Itu.js";import"./use-org-auth-client-CYcM54fk.js";import"./use-organization-roles-DZnqIOJB.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BAKQiVMF.js";import"./use-registry-connections-BJqsXkBj.js";import"./useInfiniteQuery-Cq4F2whY.js";import"./use-infinite-scroll-gDwS_J3l.js";import"./card-Cwa4ZL2D.js";import"./integration-icon-BaD8axF8.js";import"./collection-tabs-BbxGuA_q.js";import"./badge-DXC7bKKl.js";import"./connection-form-helpers-DrDDHd82.js";import"./useSuspenseInfiniteQuery-H5GMfaUD.js";import"./use-ai-providers-BLynx6Ck.js";import"./decopilot-sse-pool-n-O90qSn.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-C5onwtB3.js";import"./autosend-4FyzrbIb.js";import"./tab-id-yjGvxWDL.js";import"./use-org-sso-BkGwCpOF.js";import"./index-DC_IvZxa.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-Cpu2mHNY.js";import"./label-CX8Gr6s6.js";function _i(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:i}=t,{state:r,isMobile:o}=be();if(o||r==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let d;return e[2]!==i||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:i,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=i,e[3]=n,e[4]=d):d=e[4],d}const bt=240,Ni=400,wi="sidebar.width";function Te(t){return Math.max(bt,Math.min(Ni,t))}function Ci(){const t=$.c(11),[e,n]=He(wi,ki),i=L.useRef(null);let r;t[0]!==n||t[1]!==e?(r=m=>{m.preventDefault();const u=m.clientX,f=Te(e),g=i.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=g?Array.from(g.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const h of x)h.style.transition="none";const b=h=>{const j=Te(f+(h.clientX-u));g?.style.setProperty("--sidebar-width",`${j}px`)},p=h=>{const j=Te(f+(h.clientX-u));n(j);for(const y of x)y.style.transition="";window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",p),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",b),window.addEventListener("pointerup",p)},t[0]=n,t[1]=e,t[2]=r):r=t[2];const o=r;let l;t[3]!==n?(l=()=>{n(bt)},t[3]=n,t[4]=l):l=t[4];const a=l;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==o||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:i,onStartResize:o,resetWidth:a},t[7]=o,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function ki(t){return typeof t=="number"?Te(t):bt}function ls(){const t=$.c(8),{org:e}=se(),n=le(),i=Ys();let r;if(t[0]!==n||t[1]!==e||t[2]!==i){if(r=[],i){let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Qs,{className:"size-4!"}),t[4]=o):o=t[4];let l;t[5]!==n||t[6]!==e?(l={type:"items",items:[{key:"board",label:"Board",icon:o,onClick:()=>n({to:"/$org/board",params:{org:e.slug}})}]},t[5]=n,t[6]=e,t[7]=l):l=t[7],r.push(l)}t[0]=n,t[1]=e,t[2]=i,t[3]=r}else r=t[3];return r}function as(t){const e=$.c(3),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=i):i=e[0];let r;return e[1]!==n?(r=s.jsxs(ct,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[i,s.jsx(dt,{children:s.jsx(ue,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=r):r=e[2],r}function cs(t){const e=$.c(18),{item:n}=t,{isMobile:i,setOpenMobile:r}=be();let o;e[0]!==i||e[1]!==n||e[2]!==r?(o=()=>{me("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:i}),n.onClick?.(),i&&r(!1)},e[0]=i,e[1]=n,e[2]=r,e[3]=o):o=e[3];const l=o,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=B(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(q,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Ai(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qt,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,r=n.group.defaultExpanded;let o;e[2]!==n.group.items?(o=n.group.items.map($i),e[2]=n.group.items,e[3]=o):o=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==o?(l=s.jsx(as,{label:i,defaultExpanded:r,children:o}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=o,e[7]=l):l=e[7],l}case"items":{let i;e[8]!==n.items?(i=n.items.map(Ii),e[8]=n.items,e[9]=i):i=e[9];let r;return e[10]!==i?(r=s.jsx(ct,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(dt,{children:s.jsx(ue,{className:"gap-1.5",children:i})})}),e[10]=i,e[11]=r):r=e[11],r}case"custom":return n.content}}function Ii(t){return s.jsx(cs,{item:t},t.key)}function $i(t){return s.jsx(cs,{item:t},t.key)}function zi(t){const e=$.c(14),{sections:n,footer:i,additionalContent:r,variant:o,contentClassName:l}=t,a=o===void 0?"sidebar":o;let d;e[0]!==l?(d=B("flex flex-col flex-1 px-2 pb-2 gap-0.5",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(Ti),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==r?(m=r&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:r}),e[4]=r,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Kt,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==i||e[11]!==u||e[12]!==a?(f=s.jsxs(Ws,{variant:a,children:[u,i]}),e[10]=i,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Ti(t,e){return s.jsx(Ai,{section:t},e)}function ds(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ds.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(oe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Mi(t){const e=$.c(16),{onToggle:n,className:i}=t,o=Ns().logo??ws,l=typeof o=="string"?o:o.light,a=typeof o=="string"?o:o.dark;let d;e[0]!==i?(d=B("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",i),e[0]=i,e[1]=d):d=e[1];let c;e[2]!==l?(c=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=c):c=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Vt,{size:16}),e[9]=f):f=e[9];let g;e[10]!==n?(g=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=g):g=e[11];let x;return e[12]!==d||e[13]!==u||e[14]!==g?(x=s.jsxs(qs,{className:d,children:[u,g]}),e[12]=d,e[13]=u,e[14]=g,e[15]=x):x=e[15],x}function At(t){const e=$.c(18),{item:n,onClose:i}=t,r=n.isActive&&"z-10";let o;e[0]!==r?(o=B(r),e[0]=r,e[1]=o):o=e[1];let l;e[2]!==n||e[3]!==i?(l=()=>{n.onClick?.(),i()},e[2]=n,e[3]=i,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==d?(c=s.jsxs(J,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==o||e[16]!==c?(m=s.jsx(q,{className:o,children:c}),e[15]=o,e[16]=c,e[17]=m):m=e[17],m}function Oi(t){const e=$.c(18),{section:n,onClose:i}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(qt,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let l;if(e[2]!==i||e[3]!==n.group.items){let d;e[5]!==i?(d=c=>s.jsx(At,{item:c,onClose:i},c.key),e[5]=i,e[6]=d):d=e[6],l=n.group.items.map(d),e[2]=i,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(as,{label:r,defaultExpanded:o,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==i||e[12]!==n.items){let l;e[14]!==i?(l=a=>s.jsx(At,{item:a,onClose:i},a.key),e[14]=i,e[15]=l):l=e[15],r=n.items.map(l),e[11]=i,e[12]=n.items,e[13]=r}else r=e[13];let o;return e[16]!==r?(o=s.jsx(ct,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(dt,{children:s.jsx(ue,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=o):o=e[17],o}case"custom":return n.content}}function Pi(t){const e=$.c(17),{sections:n,onClose:i,footer:r,additionalContent:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==i?(a=s.jsx(L.Suspense,{fallback:l,children:s.jsx(Mi,{onToggle:i})}),e[1]=i,e[2]=a):a=e[2];let d;if(e[3]!==i||e[4]!==n){let f;e[6]!==i?(f=(g,x)=>s.jsx(Oi,{section:g,onClose:i},x),e[6]=i,e[7]=f):f=e[7],d=n.map(f),e[3]=i,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==o?(c=o&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:o}),e[8]=o,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Kt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==r||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,r]}),e[13]=r,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:i}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==i||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:i,children:[m,u]}),e[4]=n.href,e[5]=i,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let r;e[11]!==n||e[12]!==i?(r=()=>{n.onClick?.(),i()},e[11]=n,e[12]=i,e[13]=r):r=e[13];let o;e[14]!==n.icon?(o=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=o):o=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==r||e[19]!==o||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[o,l]}),e[18]=r,e[19]=o,e[20]=l,e[21]=a):a=e[21],a}function It(t){const e=$.c(126),{user:n,userImage:i,menuItems:r,signOutItem:o,themeOptions:l,preferences:a,setPreferences:d,close:c,isMobile:m}=t;if(m){const F=n?.name??"U";let R;e[0]!==F||e[1]!==i?(R=s.jsx(Re,{url:i,fallback:F,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=F,e[1]=i,e[2]=R):R=e[2];const Y=n?.name??"User";let K;e[3]!==Y?(K=s.jsx("p",{className:"text-sm font-medium truncate",children:Y}),e[3]=Y,e[4]=K):K=e[4];const ne=n?.email;let V;e[5]!==ne?(V=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=V):V=e[6];let ie;e[7]!==K||e[8]!==V?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[K,V]}),e[7]=K,e[8]=V,e[9]=ie):ie=e[9];let re;e[10]!==n?(re=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ri)},e[10]=n,e[11]=re):re=e[11];let ae;e[12]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(yt,{size:14}),e[12]=ae):ae=e[12];let xe;e[13]!==re?(xe=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ae})}),e[13]=re,e[14]=xe):xe=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==xe?(T=s.jsx(tt,{delayDuration:300,children:s.jsxs(pe,{children:[xe,je]})}),e[16]=xe,e[17]=T):T=e[17];let U;e[18]!==T||e[19]!==R||e[20]!==ie?(U=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[R,ie,T]}),e[18]=T,e[19]=R,e[20]=ie,e[21]=U):U=e[21];let X;if(e[22]!==c||e[23]!==r){let de;e[25]!==c?(de=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=de):de=e[26],X=r.map(de),e[22]=c,e[23]=r,e[24]=X}else X=e[24];let W;e[27]!==c||e[28]!==o?(W=s.jsx(De,{item:o,onClose:c}),e[27]=c,e[28]=o,e[29]=W):W=e[29];let ce;e[30]!==X||e[31]!==W?(ce=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[X,W]})}),e[30]=X,e[31]=W,e[32]=ce):ce=e[32];let Se;if(e[33]!==a.theme||e[34]!==d||e[35]!==l){let de;e[37]!==a.theme||e[38]!==d?(de=Pe=>{const{value:Qe,icon:ys,label:Ss}=Pe;return s.jsx("button",{type:"button","aria-label":Ss,onClick:()=>d(_s=>({..._s,theme:Qe})),className:B("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Qe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ys},Qe)},e[37]=a.theme,e[38]=d,e[39]=de):de=e[39],Se=l.map(de),e[33]=a.theme,e[34]=d,e[35]=l,e[36]=Se}else Se=e[36];let _e;e[40]!==Se?(_e=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=_e):_e=e[41];const Ve=a.enableSounds?"Disable sounds":"Enable sounds";let Ne;e[42]!==d?(Ne=()=>d(Fi),e[42]=d,e[43]=Ne):Ne=e[43];const Xe=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Xe?(we=B("size-8 rounded-md flex items-center justify-center transition-colors",Xe),e[44]=Xe,e[45]=we):we=e[45];let Ce;e[46]!==a.enableSounds?(Ce=a.enableSounds?s.jsx(St,{size:14}):s.jsx(_t,{size:14}),e[46]=a.enableSounds,e[47]=Ce):Ce=e[47];let ke;e[48]!==Ve||e[49]!==Ne||e[50]!==we||e[51]!==Ce?(ke=s.jsx("button",{type:"button","aria-label":Ve,onClick:Ne,className:we,children:Ce}),e[48]=Ve,e[49]=Ne,e[50]=we,e[51]=Ce,e[52]=ke):ke=e[52];let Me;e[53]===Symbol.for("react.memo_cache_sentinel")?(Me=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.30.3"]}),e[53]=Me):Me=e[53];let Ae;e[54]!==ke?(Ae=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Me]}),e[54]=ke,e[55]=Ae):Ae=e[55];let Ie;e[56]!==_e||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[_e,Ae]}),e[56]=_e,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==U||e[60]!==ce||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[U,ce,Ie]}),e[59]=U,e[60]=ce,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==i?(f=s.jsx(Re,{url:i,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=i,e[65]=f):f=e[65];const g=n?.name??"User";let x;e[66]!==g?(x=s.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[66]=g,e[67]=x):x=e[67];const b=n?.email;let p;e[68]!==b?(p=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b}),e[68]=b,e[69]=p):p=e[69];let h;e[70]!==x||e[71]!==p?(h=s.jsxs("div",{className:"flex-1 min-w-0",children:[x,p]}),e[70]=x,e[71]=p,e[72]=h):h=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ei)},e[73]=n,e[74]=j):j=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(yt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==j?(v=s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=j,e[77]=v):v=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(he,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let N;e[79]!==v?(N=s.jsx(tt,{delayDuration:300,children:s.jsxs(pe,{children:[v,w]})}),e[79]=v,e[80]=N):N=e[80];let _;e[81]!==N||e[82]!==f||e[83]!==h?(_=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,h,N]}),e[81]=N,e[82]=f,e[83]=h,e[84]=_):_=e[84];let S;if(e[85]!==c||e[86]!==r){let F;e[88]!==c?(F=R=>s.jsx(De,{item:R,onClose:c},R.key),e[88]=c,e[89]=F):F=e[89],S=r.map(F),e[85]=c,e[86]=r,e[87]=S}else S=e[87];let C;e[90]!==c||e[91]!==o?(C=s.jsx(De,{item:o,onClose:c}),e[90]=c,e[91]=o,e[92]=C):C=e[92];let A;e[93]!==S||e[94]!==C?(A=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,C]}),e[93]=S,e[94]=C,e[95]=A):A=e[95];let I;if(e[96]!==a.theme||e[97]!==d||e[98]!==l){let F;e[100]!==a.theme||e[101]!==d?(F=R=>{const{value:Y,icon:K,label:ne}=R;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>d(V=>({...V,theme:Y})),className:B("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Y?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:K},Y)},e[100]=a.theme,e[101]=d,e[102]=F):F=e[102],I=l.map(F),e[96]=a.theme,e[97]=d,e[98]=l,e[99]=I}else I=e[99];let k;e[103]!==I?(k=s.jsx("div",{className:"flex items-center gap-0.5",children:I}),e[103]=I,e[104]=k):k=e[104];const z=a.enableSounds?"Disable sounds":"Enable sounds";let E;e[105]!==d?(E=()=>d(Di),e[105]=d,e[106]=E):E=e[106];const H=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let O;e[107]!==H?(O=B("size-7 rounded-md flex items-center justify-center transition-colors",H),e[107]=H,e[108]=O):O=e[108];let D;e[109]!==a.enableSounds?(D=a.enableSounds?s.jsx(St,{size:14}):s.jsx(_t,{size:14}),e[109]=a.enableSounds,e[110]=D):D=e[110];let M;e[111]!==z||e[112]!==E||e[113]!==O||e[114]!==D?(M=s.jsx("button",{type:"button","aria-label":z,onClick:E,className:O,children:D}),e[111]=z,e[112]=E,e[113]=O,e[114]=D,e[115]=M):M=e[115];let P;e[116]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.30.3"]}),e[116]=P):P=e[116];let G;e[117]!==M?(G=s.jsxs("div",{className:"flex items-center gap-2",children:[M,P]}),e[117]=M,e[118]=G):G=e[118];let Q;e[119]!==k||e[120]!==G?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[k,G]}),e[119]=k,e[120]=G,e[121]=Q):Q=e[121];let Z;return e[122]!==_||e[123]!==A||e[124]!==Q?(Z=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[_,A,Q]})}),e[122]=_,e[123]=A,e[124]=Q,e[125]=Z):Z=e[125],Z}function Di(t){return{...t,enableSounds:!t.enableSounds}}function Ei(){te.success("User ID copied")}function Fi(t){return{...t,enableSounds:!t.enableSounds}}function Ri(){te.success("User ID copied")}function rt(){const t=$.c(34),{data:e}=ge.useSession(),{org:n}=se(),i=le();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const l=Cs(r)?.params.org,[a,d]=ks(),c=mt(),[m,u]=L.useState(!1),f=e?.user,g=f?.image;let x;t[1]===Symbol.for("react.memo_cache_sentinel")?(x=()=>u(!1),t[1]=x):x=t[1];const b=x;let p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ut,{size:16}),t[2]=p):p=t[2];let h;t[3]!==i||t[4]!==l?(h={key:"preferences",label:"Preferences",icon:p,onClick:()=>{i({to:"/$org/settings/profile",params:{org:l??""}})}},t[3]=i,t[4]=l,t[5]=h):h=t[5];let j;t[6]!==n||t[7]!==i?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Js,{size:16}),onClick:()=>{i({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=i,t[8]=j):j=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(en,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=y):y=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v={key:"privacy",label:"Privacy Policy",icon:s.jsx(on,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=v):v=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(As,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let N;t[12]===Symbol.for("react.memo_cache_sentinel")?(N={key:"community",label:"Community",icon:s.jsx(ln,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=N):N=t[12];let _;t[13]===Symbol.for("react.memo_cache_sentinel")?(_={key:"homepage",label:"Homepage",icon:s.jsx(Zs,{size:16}),href:"https://decocms.com",external:!0},t[13]=_):_=t[13];let S;t[14]!==h||t[15]!==j?(S=[h,...j,y,v,w,N,_],t[14]=h,t[15]=j,t[16]=S):S=t[16];const C=S;let A;t[17]===Symbol.for("react.memo_cache_sentinel")?(A={key:"logout",label:"Sign out",icon:s.jsx(tn,{size:16}),onClick:Bi},t[17]=A):A=t[17];const I=A;let k;t[18]===Symbol.for("react.memo_cache_sentinel")?(k={value:"light",icon:s.jsx(nn,{size:14}),label:"Light theme"},t[18]=k):k=t[18];let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={value:"dark",icon:s.jsx(rn,{size:14}),label:"Dark theme"},t[19]=z):z=t[19];let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=[k,z,{value:"system",icon:s.jsx(st,{size:14}),label:"System theme"}],t[20]=E):E=t[20];const H=E;let O;t[21]!==c||t[22]!==C||t[23]!==a||t[24]!==d||t[25]!==f||t[26]!==g?(O={user:f,userImage:g,menuItems:C,signOutItem:I,themeOptions:H,preferences:a,setPreferences:d,close:b,isMobile:c},t[21]=c,t[22]=C,t[23]=a,t[24]=d,t[25]=f,t[26]=g,t[27]=O):O=t[27];const D=O;let M;return t[28]!==c||t[29]!==m||t[30]!==D||t[31]!==f?.name||t[32]!==g?(M=s.jsx(s.Fragment,{children:c?s.jsxs(Xt,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Re,{url:g,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Qt,{className:"h-[80dvh] p-0",children:[s.jsx(Yt,{className:"sr-only",children:"Account"}),s.jsx(It,{...D})]})]}):s.jsxs(Ge,{open:m,onOpenChange:u,children:[s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Re,{url:g,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(We,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Li,children:s.jsx(It,{...D})})]})}),t[28]=c,t[29]=m,t[30]=D,t[31]=f?.name,t[32]=g,t[33]=M):M=t[33],M}function Li(t){return t.preventDefault()}function Bi(){me("signed_out",{source:"account_popover"}),Is(),ge.signOut()}const $t=["requires_action","in_progress","failed","expired","completed"];function Hi(t){const e=new Map($t.map(n=>[n,[]]));for(const n of t){const i=n.status??"completed";(e.get(i)??e.get("completed")).push(n)}return $t.map(n=>({status:n,threads:e.get(n)}))}function ms(t){const e=$.c(4),{onClick:n}=t;let i,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(it,{}),r=s.jsx("span",{children:"Add repo"}),e[0]=i,e[1]=r):(i=e[0],r=e[1]);let o;return e[2]!==n?(o=s.jsxs(J,{tooltip:"Add repo",onClick:n,children:[i,r]}),e[2]=n,e[3]=o):o=e[3],o}function Ui(t){const e=$.c(41),{onAddNew:n}=t,{org:i}=se(),r=$s(),o=le(),l=yn();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const c=Ue(a).virtualmcpid??null;let m;e[1]!==c?(m=!!c&&!Zt(c),e[1]=c,e[2]=m):m=e[2];const u=m;let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={slug:"mcp-github"},e[3]=f):f=e[3];const x=gn(f).filter(Wi),b=ht(),h=qe(u?c:null)?.metadata?.githubRepo?.connectionId??null;let j;e[4]!==i.id||e[5]!==i.slug?(j={connectionId:es,orgId:i.id,orgSlug:i.slug},e[4]=i.id,e[5]=i.slug,e[6]=j):j=e[6];const y=Jt(j);if(x.length===0){let F;return e[7]!==n?(F=s.jsx(ms,{onClick:n}),e[7]=n,e[8]=F):F=e[8],F}let v;e[9]!==c||e[10]!==o||e[11]!==i.id||e[12]!==r||e[13]!==y?(v=async(F,R)=>{await y.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{githubRepo:F}}}}),vt(r,i.id),te.success(`Previewing ${R}`),o({to:".",search:Gi,replace:!0})},e[9]=c,e[10]=o,e[11]=i.id,e[12]=r,e[13]=y,e[14]=v):v=e[14];const w=v;let N;e[15]!==b||e[16]!==l||e[17]!==i.id||e[18]!==r||e[19]!==y?(N=async(F,R,Y)=>{const K=b.find(ie=>{const re=ie.metadata?.githubRepo;return re?.owner?.toLowerCase()===F.owner.toLowerCase()&&re?.name?.toLowerCase()===F.name.toLowerCase()});if(K){l(K.id,{search:{main:"preview"}});return}const V=(await y.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:F.name,description:`Imported from ${Y}`,status:"active",pinned:!1,icon:null,connections:[{connection_id:R}],metadata:{githubRepo:F,instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}}}})).structuredContent?.item?.id;if(vt(r,i.id),!V)throw new Error("Failed to create the repo agent");te.success(`Created ${Y}`),l(V,{search:{main:"preview"}})},e[15]=b,e[16]=l,e[17]=i.id,e[18]=r,e[19]=y,e[20]=N):N=e[20];const _=N;let S;e[21]!==w||e[22]!==u||e[23]!==_?(S=async F=>{const R=nt(F);if(!R)return;const Y=`${R.owner}/${R.repo}`,K={owner:R.owner,name:R.repo,url:`https://github.com/${R.owner}/${R.repo}`,installationId:R.installationId,connectionId:F.id};try{u?await w(K,Y):await _(K,F.id,Y)}catch(ne){const V=ne;te.error("Failed to set preview repo: "+(V instanceof Error?V.message:"Unknown error"))}},e[21]=w,e[22]=u,e[23]=_,e[24]=S):S=e[24];const C=S,A=hn;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(pn,{asChild:!0,children:s.jsxs(J,{tooltip:"Add repo",children:[s.jsx(it,{}),s.jsx("span",{children:"Add repo"})]})}),e[25]=I):I=e[25];const k=fn,z="start",E="right",H="w-56";let O;e[26]!==h||e[27]!==C?(O=F=>{const R=nt(F);return R?s.jsxs(wt,{onSelect:()=>C(F),children:[s.jsx(it,{className:"size-4 text-muted-foreground"}),s.jsxs("span",{className:"flex-1 truncate",children:[R.owner,"/",R.repo]}),F.id===h&&s.jsx(ft,{className:"size-4"})]},F.id):null},e[26]=h,e[27]=C,e[28]=O):O=e[28];const D=x.map(O);let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(xn,{}),e[29]=M):M=e[29];let P;e[30]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx($e,{className:"size-4"}),e[30]=P):P=e[30];let G;e[31]!==n?(G=s.jsxs(wt,{onSelect:n,children:[P,"Add new repo…"]}),e[31]=n,e[32]=G):G=e[32];let Q;e[33]!==k||e[34]!==D||e[35]!==G?(Q=s.jsxs(k,{align:z,side:E,className:H,children:[D,M,G]}),e[33]=k,e[34]=D,e[35]=G,e[36]=Q):Q=e[36];let Z;return e[37]!==A||e[38]!==Q||e[39]!==I?(Z=s.jsxs(A,{children:[I,Q]}),e[37]=A,e[38]=Q,e[39]=I,e[40]=Z):Z=e[40],Z}function Gi(t){return{...t,main:"preview"}}function Wi(t){return nt(t)!==null&&vn(t)}function qi(){const t=$.c(4),[e,n]=L.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ms,{onClick:()=>n(!0)}),t[0]=i):i=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(L.Suspense,{fallback:i,children:s.jsx(Ui,{onAddNew:()=>n(!0)})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(jn,{open:e,onOpenChange:n,mode:"connection"})]}),t[2]=e,t[3]=o):o=t[3],o}function ot(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,i=n===void 0?"icon":n,r=zn(),[o,l]=L.useState(!1);let a,d;if(e[0]!==r.capabilities||e[1]!==r.hostname||e[2]!==r.machineId||e[3]!==r.online){const y=Tn(r.capabilities);a=r.online?"Desktop linked":"Connect desktop",d=r.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:r.hostname??r.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:y.length>0?`Available: ${y.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=r.capabilities,e[1]=r.hostname,e[2]=r.machineId,e[3]=r.online,e[4]=a,e[5]=d}else a=e[4],d=e[5];const c=d;if(i==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>l(!0),v=s.jsx(st,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let w;e[8]!==a?(w=s.jsx("span",{children:a}),e[8]=a,e[9]=w):w=e[9];let N;e[10]!==r.online?(N=r.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=r.online,e[11]=N):N=e[11];let _;e[12]!==a||e[13]!==w||e[14]!==N?(_=s.jsx(fe,{asChild:!0,children:s.jsxs(J,{tooltip:a,onClick:y,children:[v,w,N]})}),e[12]=a,e[13]=w,e[14]=N,e[15]=_):_=e[15];let S;e[16]!==c?(S=s.jsx(he,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let C;e[18]!==_||e[19]!==S?(C=s.jsxs(pe,{children:[_,S]}),e[18]=_,e[19]=S,e[20]=C):C=e[20];let A;e[21]!==o?(A=s.jsx(Ct,{open:o,onOpenChange:l}),e[21]=o,e[22]=A):A=e[22];let I;return e[23]!==A||e[24]!==C?(I=s.jsxs(s.Fragment,{children:[C,A]}),e[23]=A,e[24]=C,e[25]=I):I=e[25],I}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),e[26]=m):m=e[26];const u=r.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(st,{size:16}),e[27]=f):f=e[27];let g;e[28]!==r.online?(g=r.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=r.online,e[29]=g):g=e[29];let x;e[30]!==u||e[31]!==g?(x=s.jsx(fe,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,g]})}),e[30]=u,e[31]=g,e[32]=x):x=e[32];let b;e[33]!==c?(b=s.jsx(he,{side:"bottom",children:c}),e[33]=c,e[34]=b):b=e[34];let p;e[35]!==x||e[36]!==b?(p=s.jsxs(pe,{children:[x,b]}),e[35]=x,e[36]=b,e[37]=p):p=e[37];let h;e[38]!==o?(h=s.jsx(Ct,{open:o,onOpenChange:l}),e[38]=o,e[39]=h):h=e[39];let j;return e[40]!==h||e[41]!==p?(j=s.jsxs(s.Fragment,{children:[p,h]}),e[40]=h,e[41]=p,e[42]=j):j=e[42],j}class Ki extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function Vi(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Xi(){const t=$.c(17),e=le(),{org:n}=se(),{hasDecoKey:i,balanceDollars:r}=kn();if(!i)return null;let o;t[0]!==r?(o=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=o):o=t[1];let l;t[2]!==r?(l=B(r!=null&&Vi(r)),t[2]=r,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(an,{}),t[7]=d):d=t[7];let c;t[8]!==r?(c=r!=null?`$${r.toFixed(2)}`:"Credits",t[8]=r,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==o||t[13]!==l||t[14]!==a||t[15]!==m?(u=s.jsx(ue,{children:s.jsx(q,{children:s.jsxs(J,{tooltip:o,className:l,onClick:a,children:[d,m]})})}),t[12]=o,t[13]=l,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function zt(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ki,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(Xi,{})})}),t[0]=e):e=t[0],e}function Tt(){const t=$.c(7),e=le(),{org:n}=se();let i;t[0]!==e||t[1]!==n.slug?(i=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=i):i=t[2];let r,o;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ut,{}),o=s.jsx("span",{children:"Settings"}),t[3]=r,t[4]=o):(r=t[3],o=t[4]);let l;return t[5]!==i?(l=s.jsxs(J,{tooltip:"Settings",onClick:i,children:[r,o]}),t[5]=i,t[6]=l):l=t[6],l}function Mt(){const t=$.c(5),[e,n]=L.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q,{children:s.jsx(Cn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(cn,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=i):i=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(q,{children:s.jsx(qi,{})}),t[1]=r):r=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(ue,{className:"gap-0.5",children:[i,r,s.jsx(q,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(sn,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[2]=o):o=t[2];let l;return t[3]!==e?(l=s.jsxs(s.Fragment,{children:[o,s.jsx(An,{open:e,onOpenChange:n,mode:"browse"})]}),t[3]=e,t[4]=l):l=t[4],l}function Qi(){const t=$.c(10),{state:e}=be();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Mt,{}),c=s.jsx(zt,{}),t[0]=d,t[1]=c):(d=t[0],c=t[1]);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(q,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(ot,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(q,{children:s.jsx(Tt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(et,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ue,{children:[m,u,s.jsx(q,{children:s.jsx(rt,{})})]})]}),t[4]=f):f=t[4],f}let i,r;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Mt,{}),r=s.jsx(zt,{}),t[5]=i,t[6]=r):(i=t[5],r=t[6]);let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(q,{children:s.jsx(ot,{variant:"full"})}),t[7]=o):o=t[7];let l;t[8]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(q,{children:s.jsx(Tt,{})}),t[8]=l):l=t[8];let a;return t[9]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs(et,{className:"px-2 pb-3 gap-0.5",children:[i,r,s.jsxs(ue,{className:"gap-0.5",children:[o,l,s.jsx(q,{children:s.jsx(rt,{})})]})]}),t[9]=a):a=t[9],a}function Yi(){const t=$.c(8),e=le(),{org:n}=se(),{setOpenMobile:i}=be();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ue,{children:s.jsx(q,{children:s.jsx(rt,{})})})}),t[0]=r):r=t[0];let o;t[1]!==e||t[2]!==n.slug||t[3]!==i?(o=()=>{e({to:"/$org/settings",params:{org:n.slug}}),i(!1)},t[1]=e,t[2]=n.slug,t[3]=i,t[4]=o):o=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ut,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==o?(a=s.jsx(et,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[r,s.jsx(ve,{"aria-label":"Settings",onClick:o,children:l})]})}),t[6]=o,t[7]=a):a=t[7],a}function Ot(t){const e=$.c(15),{className:n,wrapperClassName:i,children:r}=t,[o,l]=L.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=h=>{h&&l(h.scrollHeight>h.clientHeight+1)},e[0]=a):a=e[0];const d=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=h=>{const j=h.currentTarget;l(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==i?(u=B("relative",i),e[2]=i,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:r}),e[4]=r,e[5]=n,e[6]=f):f=e[6];const g=o?"opacity-100":"opacity-0";let x;e[7]!==g?(x=B("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",g),e[7]=g,e[8]=x):x=e[8];let b;e[9]!==x?(b=s.jsx("div",{"aria-hidden":!0,className:x}),e[9]=x,e[10]=b):b=e[10];let p;return e[11]!==u||e[12]!==f||e[13]!==b?(p=s.jsxs("div",{className:u,children:[f,b]}),e[11]=u,e[12]=f,e[13]=b,e[14]=p):p=e[14],p}function Ji(t){const e=$.c(8),{virtualMcpId:n,size:i,showAutomationBadge:r}=t,o=i===void 0?"sm":i;let l;e[0]!==o||e[1]!==n?(l=n?s.jsx(Zi,{virtualMcpId:n,size:o}):s.jsx(ye,{icon:null,name:"?",size:o}),e[0]=o,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==r?(a=r&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(is,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==a?(d=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=d):d=e[7],d}function Zi(t){const e=$.c(6),{virtualMcpId:n,size:i}=t,r=qe(n);if(!r){let a;return e[0]!==i?(a=s.jsx(ye,{icon:null,name:"?",size:i}),e[0]=i,e[1]=a):a=e[1],a}const o=r.icon??null;let l;return e[2]!==r.title||e[3]!==i||e[4]!==o?(l=s.jsx(ye,{icon:o,name:r.title,size:i}),e[2]=r.title,e[3]=i,e[4]=o,e[5]=l):l=e[5],l}function Pt(t){const e=$.c(36),{open:n,onOpenChange:i}=t,[r,o]=L.useState(""),{org:l}=se(),{setTaskId:a}=xt(),d=ns();let c,m,u;e[0]!==l.id||e[1]!==r?(u=r.trim(),m=Ts,c=zs.globalSearch(l.id,u),e[0]=l.id,e[1]=r,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let g;e[5]!==d||e[6]!==u?(g=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=g):g=e[7];let x;e[8]!==c||e[9]!==f||e[10]!==g?(x={queryKey:c,enabled:f,queryFn:g,staleTime:1e4},e[8]=c,e[9]=f,e[10]=g,e[11]=x):x=e[11];const{data:b,isFetching:p}=m(x);let h;e[12]!==b?.items?(h=b?.items??[],e[12]=b?.items,e[13]=h):h=e[13];const j=h;let y;e[14]!==i?(y=z=>{z||o(""),i(z)},e[14]=i,e[15]=y):y=e[15];const v=y;let w;e[16]!==v||e[17]!==a?(w=z=>{v(!1),a(z.id,z.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=w):w=e[18];const N=w;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Rn,{className:"sr-only",children:[s.jsx(Ln,{children:"Search"}),s.jsx(Bn,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let S;e[20]!==r?(S=s.jsx(qn,{value:r,onValueChange:o,placeholder:"Search..."}),e[20]=r,e[21]=S):S=e[21];let C;e[22]!==N||e[23]!==p||e[24]!==j||e[25]!==u?(C=u?p&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Gn,{children:"No results."}):j.map(z=>z.type==="thread"?s.jsxs(Wn,{value:`thread:${z.id}:${z.title}`,onSelect:()=>N(z),className:"gap-2.5",children:[s.jsx(Ji,{virtualMcpId:z.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:z.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(z.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${z.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=N,e[23]=p,e[24]=j,e[25]=u,e[26]=C):C=e[26];let A;e[27]!==C?(A=s.jsx(Kn,{children:C}),e[27]=C,e[28]=A):A=e[28];let I;e[29]!==S||e[30]!==A?(I=s.jsxs(Hn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(Vn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[S,A]})]}),e[29]=S,e[30]=A,e[31]=I):I=e[31];let k;return e[32]!==v||e[33]!==n||e[34]!==I?(k=s.jsx(Un,{open:n,onOpenChange:v,children:I}),e[32]=v,e[33]=n,e[34]=I,e[35]=k):k=e[35],k}function er(t){return t==="ephemeral"||t.startsWith("thread:")}function us(t){const e=$.c(40),{task:n,isActive:i,onClick:r,onArchive:o,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:d,indented:c}=t,m=Yn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",g=qe(f?void 0:n.virtual_mcp_id);let x;e[0]!==g?(x=In(g),e[0]=g,e[1]=x):x=e[1];const b=x;Jn(6e4);const p=l||!!n.trigger_id,h=n.id,j="button",y=0;let v;e[2]!==r?(v=G=>{G.target===G.currentTarget&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),r())},e[2]=r,e[3]=v):v=e[3];const w=c?"-ml-4 pl-6":"pl-2",N=i?"bg-accent text-accent-foreground":"hover:bg-accent/60";let _;e[4]!==w||e[5]!==N?(_=B("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",w,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=w,e[5]=N,e[6]=_):_=e[6];let S;e[7]!==f||e[8]!==a||e[9]!==g?.icon||e[10]!==g?.title?(S=a&&!f&&s.jsx(ye,{icon:g?.icon??null,name:g?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=g?.icon,e[10]=g?.title,e[11]=S):S=e[11];let C;e[12]!==p?(C=p&&s.jsx(is,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=p,e[13]=C):C=e[13];const A=n.title||"Untitled task";let I;e[14]!==A?(I=s.jsx("div",{className:"text-sm text-foreground truncate",children:A}),e[14]=A,e[15]=I):I=e[15];let k;e[16]!==C||e[17]!==I?(k=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[C,I]}),e[16]=C,e[17]=I,e[18]=k):k=e[18];let z;e[19]!==b||e[20]!==i||e[21]!==n.branch||e[22]!==n.updated_at?(z=n.updated_at&&s.jsxs("div",{className:B("flex items-center gap-1 text-[11px] min-w-0",i?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!er(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):b?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[b.owner,"/",b.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:ei(new Date(n.updated_at))})]}),e[19]=b,e[20]=i,e[21]=n.branch,e[22]=n.updated_at,e[23]=z):z=e[23];let E;e[24]!==k||e[25]!==z?(E=s.jsxs("div",{className:"flex-1 min-w-0",children:[k,z]}),e[24]=k,e[25]=z,e[26]=E):E=e[26];const H="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",O=!d&&s.jsx("span",{className:B("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",o&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:B(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let D;e[27]!==o?(D=o&&s.jsxs(pe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:G=>{G.stopPropagation(),o()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ms,{size:14})})}),s.jsx(he,{side:"right",children:"Archive"})]}),e[27]=o,e[28]=D):D=e[28];let M;e[29]!==O||e[30]!==D?(M=s.jsxs("div",{className:H,children:[O,D]}),e[29]=O,e[30]=D,e[31]=M):M=e[31];let P;return e[32]!==r||e[33]!==E||e[34]!==M||e[35]!==v||e[36]!==_||e[37]!==S||e[38]!==n.id?(P=s.jsxs("div",{"data-task-id":h,role:j,tabIndex:y,onClick:r,onKeyDown:v,className:_,children:[S,E,M]}),e[32]=r,e[33]=E,e[34]=M,e[35]=v,e[36]=_,e[37]=S,e[38]=n.id,e[39]=P):P=e[39],P}const tr="sidebar.group.expanded.";function sr(t,e){const n=$.c(3),[i,r]=He(`${tr}${t}`,e);let o;return n[0]!==i||n[1]!==r?(o=[i,r],n[0]=i,n[1]=r,n[2]=o):o=n[2],o}function fs(t){const e=$.c(12),{onClick:n,isFetching:i,indented:r}=t,o=r?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==o?(l=B("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",o,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==i?(a=i&&s.jsx(Gt,{size:14,className:"animate-spin"}),e[2]=i,e[3]=a):a=e[3];const d=i?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:i,className:l,children:[a,c]}),e[6]=i,e[7]=n,e[8]=l,e[9]=a,e[10]=c,e[11]=m):m=e[11],m}function nr(t,e,n,i){return[t,e,n,i.type,i.member,i.currentUserId??""].join("|")}function ir(t){return t.member==="mine"&&!t.currentUserId}const hs=4;let Fe=0;const lt=[];function rr(){for(;Fe<hs&&lt.length>0;){const t=lt.shift();t&&t()}}function ps(t){return new Promise((e,n)=>{const i=()=>{Fe++,t().then(e,n).finally(()=>{Fe--,rr()})};Fe<hs?i():lt.push(i)})}const Ke=10;function Dt(t,e,n,i,r){const o={hidden:!1};i.member==="mine"&&i.currentUserId&&(o.created_by=i.currentUserId),i.type==="automation"&&(o.has_trigger=!0),i.type==="manual"&&(o.has_trigger=!1);const l={where:o,limit:r,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return l.status=e,l}function or(t,e,n,i){let r=0;for(const o of t)xs(o,e,n,i)&&r++;return r}function Ye(t,e,n,i){return or(t,e,n,i)}function lr(t,e){return!!(t>=Ke||t===0&&e)}function Et(t,e){return t<e}function ar(t,e){return e===!1?!1:e===!0?!0:t}function xs(t,e,n,i){return!(t.hidden||(t.status??"completed")!==n||i.member==="mine"&&i.currentUserId&&t.created_by!==i.currentUserId||i.type==="automation"&&!t.trigger_id||i.type==="manual"&&t.trigger_id)}const Be=new Map,Ee=new Map;function cr(t,e){return e?t>=Ke?!0:null:!1}function Ft(t){return Be.get(t)}function dr(t,e){Be.set(t,e)}function mr(t,e,n){const i=Be.get(t);if(i!==void 0){n(i);return}let r=Ee.get(t);r||(r=ps(e).then(o=>(Be.set(t,o),Ee.delete(t),o)).catch(()=>(Ee.delete(t),Promise.reject(new Error("group probe failed")))),Ee.set(t,r)),r.then(n,()=>n(!1))}function Rt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ke,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function ur(t,e,n,i,r){let o=0;for(const l of t)e.has(l.id)||xs(l,n,i,r)&&o++;return o}function fr(t,e,n,i){const r=$.c(8),{org:o}=se(),l=nr(o.id,t,e,n);let a;r[0]!==n?(a=ir(n),r[0]=n,r[1]=a):a=r[1];const d=a,[c,m]=L.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==l&&m({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const u=Dn(),{threads:f,hasMore:g}=pt(),x=Ye(f,t,e,n),b=lr(x,g),p=cr(x,g),h=ns();if(c.identity===l&&c.serverHasMore===null){const _=p??Ft(l);_!==void 0&&m({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:_})}!d&&c.identity===l&&c.serverHasMore===null&&p===null&&Ft(l)===void 0&&c.probeSubscribedIdentity!==l&&(m(_=>_.identity===l?{..._,isProbing:!0,probeSubscribedIdentity:l}:_),mr(l,async()=>{const _=Dt(t,e,0,n,1),S=await h.call("COLLECTION_THREADS_LIST",_),{totalCount:C}=Rt(S),A=Ye(u.threads.get(),t,e,n);return C===void 0?!1:Et(A,C)},_=>{m(S=>S.identity!==l?S:{...S,isProbing:!1,serverHasMore:_})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=l;m(C=>C.identity===S?{...C,isFetching:!0}:C);try{const C=Ye(f,t,e,n),A=Dt(t,e,C,n,Ke),I=await ps(()=>h.call("COLLECTION_THREADS_LIST",A)),{items:k,hasMore:z,totalCount:E}=Rt(I),H=new Set(f.map(hr)),O=ur(k,H,t,e,n),D=C;u.mergeThreads(k),m(M=>{if(M.identity!==S)return M;let P;return E!==void 0?P=Et(D+O,E):P=k.length===0||O===0?!1:z,dr(S,P),{...M,isFetching:!1,serverHasMore:P}})}catch(C){const A=C,I=A instanceof Error?A.message:String(A);te.error(`Could not load more tasks: ${I}`),m(k=>k.identity===S?{...k,isFetching:!1}:k)}},v=c.isFetching||c.isProbing,w=!d&&!v&&ar(b,c.serverHasMore);let N;return r[2]!==v||r[3]!==y||r[4]!==w||r[5]!==c.isProbing||r[6]!==c.serverHasMore?(N={hasMore:w,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},r[2]=v,r[3]=y,r[4]=w,r[5]=c.isProbing,r[6]=c.serverHasMore,r[7]=N):N=r[7],N}function hr(t){return t.id}function pr(t){const e=$.c(20),{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:g}=fr("status",n,d),[x,b]=L.useState(!1);!x&&i.length===0&&g===!0&&!c&&!m&&(b(!0),queueMicrotask(()=>{u()}));let p;if(e[0]!==r||e[1]!==a||e[2]!==d||e[3]!==l||e[4]!==o||e[5]!==i){let y;e[7]!==r||e[8]!==a||e[9]!==d||e[10]!==l||e[11]!==o?(y=v=>s.jsx(us,{task:v,isActive:r===v.id,onClick:()=>o(v),onArchive:a&&v.created_by===d.currentUserId?()=>l(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=r,e[8]=a,e[9]=d,e[10]=l,e[11]=o,e[12]=y):y=e[12],p=i.map(y),e[0]=r,e[1]=a,e[2]=d,e[3]=l,e[4]=o,e[5]=i,e[6]=p}else p=e[6];let h;e[13]!==f||e[14]!==c||e[15]!==u?(h=(f||c)&&s.jsx(fs,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=h):h=e[16];let j;return e[17]!==p||e[18]!==h?(j=s.jsxs(s.Fragment,{children:[p,h]}),e[17]=p,e[18]=h,e[19]=j):j=e[19],j}function xr(t){const e=$.c(36),{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d}=t,c=Zn[n],m=c.icon,[u,f]=sr(`status-${n}`,!1);let g;e[0]!==u||e[1]!==f?(g=function(){f(!u)},e[0]=u,e[1]=f,e[2]=g):g=e[2];const x=g;let b;e[3]!==x?(b=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=b):b=e[4];let p;e[5]!==m||e[6]!==c.iconClassName?(p=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(m,{size:12,className:c.iconClassName})}),e[5]=m,e[6]=c.iconClassName,e[7]=p):p=e[7];let h;e[8]!==u?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(gt,{size:14}):s.jsx(ti,{size:14})}),e[8]=u,e[9]=h):h=e[9];let j;e[10]!==p||e[11]!==h?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[p,h]}),e[10]=p,e[11]=h,e[12]=j):j=e[12];let y;e[13]!==c.label?(y=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=y):y=e[14];let v;e[15]!==i.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:i.length})}),e[15]=i.length,e[16]=v):v=e[16];let w;e[17]!==u||e[18]!==x||e[19]!==b||e[20]!==j||e[21]!==y||e[22]!==v?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:x,onKeyDown:b,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,y,v]}),e[17]=u,e[18]=x,e[19]=b,e[20]=j,e[21]=y,e[22]=v,e[23]=w):w=e[23];let N;e[24]!==r||e[25]!==a||e[26]!==u||e[27]!==d||e[28]!==l||e[29]!==o||e[30]!==n||e[31]!==i?(N=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(pr,{status:n,threads:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:a,filters:d})}),e[24]=r,e[25]=a,e[26]=u,e[27]=d,e[28]=l,e[29]=o,e[30]=n,e[31]=i,e[32]=N):N=e[32];let _;return e[33]!==w||e[34]!==N?(_=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,N]}),e[33]=w,e[34]=N,e[35]=_):_=e[35],_}function Lt(t){const e=$.c(38),{threads:n,groupBy:i,activeTaskId:r,onSelectTask:o,onArchiveTask:l,filters:a,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Qn,{className:"size-6 opacity-60"}),e[0]=p):p=e[0];const h=u?"No threads match your filters":"No threads yet";let j;return e[1]!==h?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[p,s.jsx("p",{className:"text-sm",children:h})]}),e[1]=h,e[2]=j):j=e[2],j}const f=n.length>1||d;if(i==="status"){let p;if(e[3]!==r||e[4]!==f||e[5]!==a||e[6]!==l||e[7]!==o||e[8]!==n){let j;e[10]!==r||e[11]!==f||e[12]!==a||e[13]!==l||e[14]!==o?(j=y=>s.jsx(xr,{status:y.status,threads:y.threads,activeTaskId:r,onSelectTask:o,onArchiveTask:l,canArchive:f,filters:a},y.status),e[10]=r,e[11]=f,e[12]=a,e[13]=l,e[14]=o,e[15]=j):j=e[15],p=Hi(n).map(j),e[3]=r,e[4]=f,e[5]=a,e[6]=l,e[7]=o,e[8]=n,e[9]=p}else p=e[9];let h;return e[16]!==p?(h=s.jsx(s.Fragment,{children:p}),e[16]=p,e[17]=h):h=e[17],h}let g;if(e[18]!==r||e[19]!==f||e[20]!==a||e[21]!==l||e[22]!==o||e[23]!==n){let p;e[25]!==r||e[26]!==f||e[27]!==a||e[28]!==l||e[29]!==o?(p=h=>s.jsx(us,{task:h,isActive:r===h.id,onClick:()=>o(h),onArchive:f&&h.created_by===a.currentUserId?()=>l(h):void 0,showAutomationBadge:!!h.trigger_id,showAgentIcon:!0},h.id),e[25]=r,e[26]=f,e[27]=a,e[28]=l,e[29]=o,e[30]=p):p=e[30],g=n.map(p),e[18]=r,e[19]=f,e[20]=a,e[21]=l,e[22]=o,e[23]=n,e[24]=g}else g=e[24];let x;e[31]!==d||e[32]!==c||e[33]!==m?(x=(d||c)&&s.jsx(fs,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=x):x=e[34];let b;return e[35]!==g||e[36]!==x?(b=s.jsxs(s.Fragment,{children:[g,x]}),e[35]=g,e[36]=x,e[37]=b):b=e[37],b}function Bt(t){const e=$.c(17),{label:n,onClick:i,active:r,children:o}=t,[l,a]=L.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>a(!0),c=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=r&&"bg-sidebar-accent text-foreground";let g;e[4]!==f?(g=B(f),e[4]=f,e[5]=g):g=e[5];let x;e[6]!==o||e[7]!==n||e[8]!==i||e[9]!==g?(x=s.jsx(fe,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:i,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:g,children:o})}),e[6]=o,e[7]=n,e[8]=i,e[9]=g,e[10]=x):x=e[10];let b;e[11]!==n?(b=s.jsx(he,{side:"bottom",children:n}),e[11]=n,e[12]=b):b=e[12];let p;return e[13]!==l||e[14]!==x||e[15]!==b?(p=s.jsxs(pe,{open:l,children:[x,b]}),e[13]=l,e[14]=x,e[15]=b,e[16]=p):p=e[16],p}function Je(t){const e=$.c(13),{label:n,value:i,onChange:r,options:o}=t;let l;e[0]!==n?(l=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=l):l=e[1];let a;e[2]!==r?(a=u=>u&&r(u),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==o?(d=o.map(gr),e[4]=o,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==i?(c=s.jsx(Pn,{type:"single",size:"sm",value:i,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=a,e[7]=d,e[8]=i,e[9]=c):c=e[9];let m;return e[10]!==l||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l,c]}),e[10]=l,e[11]=c,e[12]=m):m=e[12],m}function gr(t){return s.jsxs(On,{value:t.value,className:"h-6 gap-1.5 rounded-md border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function gs({onNavigate:t}={}){const{data:e}=ge.useSession(),n=e?.user?.id,{org:i}=se(),r=Jt({connectionId:es,orgId:i.id,orgSlug:i.slug}),o=Le(i.id).id,l=ht(),{threads:a,hasMore:d,isFetchingMore:c,fetchNextPage:m}=pt(),u=a.filter(T=>!T.hidden),{hide:f}=ss(),g=le(),{setTaskId:x,createNewTask:b}=xt(),p=at({strict:!1}),h=Ue({strict:!1}),j=p.taskId??null,y=h.virtualmcpid??a.find(T=>T.id===j)?.virtual_mcp_id??null,v=()=>{t?.()},w=[...u].sort((T,U)=>(U.updated_at??"").localeCompare(T.updated_at??"")),[N,_]=L.useState("all"),[S,C]=L.useState("flat"),[A,I]=He("sidebar-threads-scope-all",!1),[k,z]=L.useState(!1),[E,H]=L.useState(!1),O={type:N,member:"mine",currentUserId:n??null},D=T=>n?T.filter(U=>U.created_by===n):[],M=T=>N==="automation"?T.filter(U=>!!U.trigger_id):N==="manual"?T.filter(U=>!U.trigger_id):T,P=D(w),G=M(P),Q=M(w),Z=A?Q:G,F=T=>{if(n&&T.created_by&&T.created_by!==n)return;const U=T.id===j;if(f(T.id),!U)return;const X=P.find(W=>W.id!==T.id&&W.virtual_mcp_id===T.virtual_mcp_id);v(),X?x(X.id,X.virtual_mcp_id):g({to:"/$org",params:{org:i.slug}})},R=T=>{v(),x(T.id,T.virtual_mcp_id)},Y=async T=>{try{const U=await r.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((U.structuredContent??U).items?.length??0)===0}catch{return!1}},K=async()=>{const T=y??o;me("sidebar_new_thread_clicked",{virtual_mcp_id:T});const U=P.find(X=>X.virtual_mcp_id===T&&X.title==="New chat");if(U&&await Y(U.id)){v(),x(U.id,T);return}v(),b(T)},{state:ne,isMobile:V,toggleSidebar:ie}=be();if(ne==="collapsed"&&!V){const T=Le(i.id),U=new Map((l??[]).map(W=>[W.id,W])),X=W=>(W?U.get(W):void 0)??(W===o?T:void 0);return s.jsxs(ue,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(q,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:ie,children:s.jsx(Vt,{size:16})})}),s.jsx(q,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{K()},children:s.jsx(Nt,{size:16})})}),Z.map(W=>{const ce=X(W.virtual_mcp_id);return s.jsx(q,{children:s.jsx(J,{tooltip:W.title||"New chat",isActive:W.id===j,onClick:()=>R(W),children:s.jsx(ye,{icon:ce?.icon??null,name:ce?.title??"Agent",size:"2xs"})})},W.id)})]})}const ae=S!=="flat"||N!=="all"||A===!0,xe=s.jsxs(Ge,{children:[s.jsxs(pe,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ae,children:[s.jsx(Mn,{size:16}),ae&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(he,{side:"bottom",children:"Filter threads"})]}),s.jsxs(We,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Je,{label:"View",value:S,onChange:T=>{me("tasks_panel_group_by_changed",{to_value:T}),C(T)},options:[{value:"flat",label:"List",icon:s.jsx(mn,{size:13})},{value:"status",label:"Status",icon:s.jsx(un,{size:13})}]}),s.jsx(Je,{label:"Type",value:N,onChange:T=>{me("tasks_panel_filter_changed",{to_value:T}),_(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Je,{label:"Scope",value:A?"team":"mine",onChange:T=>I(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(tt,{delayDuration:300,children:s.jsxs("div",{className:B("shrink-0 px-1 flex items-center justify-between",T?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!T&&s.jsx(rs,{}),xe]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Bt,{label:"Search threads",onClick:()=>{me("tasks_panel_search_opened"),H(!0),z(!0)},children:s.jsx(dn,{size:16})}),s.jsx(Bt,{label:"New thread",onClick:()=>{K()},children:s.jsx(Nt,{size:16})})]})]})});return V?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(Ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Lt,{threads:Z,groupBy:S,activeTaskId:j,onSelectTask:R,onArchiveTask:F,filters:O,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ae})}),E&&s.jsx(Pt,{open:k,onOpenChange:z})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx(Ot,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Lt,{threads:Z,groupBy:S,activeTaskId:j,onSelectTask:R,onArchiveTask:F,filters:O,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ae})})}),E&&s.jsx(Pt,{open:k,onOpenChange:z})]})}const br=5,jr=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function bs(){const t=$.c(3),{state:e}=be();if(e==="collapsed"){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:br}).map(Sr)}),t[0]=r):r=t[0],r}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"})]}),s.jsx(oe,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:jr.map(vr)})]}),t[2]=i):i=t[2],i}function vr(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(oe,{className:"size-5 rounded-full shrink-0"}),s.jsx(oe,{className:B("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(yr)})]},e)}function yr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(oe,{className:"h-3 flex-1 rounded-sm"})},e)}function Sr(t,e){return s.jsx(oe,{className:"size-10 rounded-lg mx-auto"},e)}function _r(){const t=$.c(4),e=ls();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Qi,{}),t[0]=n):n=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Wt,{children:s.jsx(L.Suspense,{fallback:s.jsx(bs,{}),children:s.jsx(gs,{})})}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsx(ts,{children:s.jsx(ds,{sections:e,footer:n,additionalContent:i})}),t[2]=e,t[3]=r):r=t[3],r}function Nr(t){const e=$.c(8),{onClose:n}=t,i=ls();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Yi,{}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(bs,{}),e[1]=o):o=e[1];let l;e[2]!==n?(l=s.jsx(Wt,{children:s.jsx(L.Suspense,{fallback:o,children:s.jsx(gs,{onNavigate:n})})}),e[2]=n,e[3]=l):l=e[3];let a;return e[4]!==n||e[5]!==i||e[6]!==l?(a=s.jsx(ts,{children:s.jsx(Pi,{sections:i,onClose:n,footer:r,additionalContent:l})}),e[4]=n,e[5]=i,e[6]=l,e[7]=a):a=e[7],a}function js(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wr=Os({name:Ps().min(2,"Organization name is required")});function Cr(t){const e=$.c(41),{open:n,onOpenChange:i}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:Ds(wr),defaultValues:{name:""}},e[0]=r):r=e[0];const o=Es(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Ar,onSuccess:kr},e[1]=l):l=e[1];const a=Fs(l),d=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ci,{children:[s.jsx(di,{children:"Create a new organization"}),s.jsx(mi,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==a||e[4]!==o){let _;e[6]!==a?(_=S=>a.mutateAsync(S),e[6]=a,e[7]=_):_=e[7],m=o.handleSubmit(_),e[3]=a,e[4]=o,e[5]=m}else m=e[5];let u;e[8]!==o.formState.isSubmitting?(u=_=>{const{field:S}=_;return s.jsxs(xi,{children:[s.jsx(gi,{children:"Organization Name"}),s.jsx(bi,{children:s.jsx(yi,{...S,placeholder:"Acme Inc.",disabled:o.formState.isSubmitting})}),s.jsx(ji,{children:"The name of your company or organization"}),S.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",js(S.value)]})]}),s.jsx(vi,{})]})},e[8]=o.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==o.control||e[11]!==u?(f=s.jsx(hi,{control:o.control,name:"name",render:u}),e[10]=o.control,e[11]=u,e[12]=f):f=e[12];let g;e[13]!==d?(g=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=g):g=e[14];let x;e[15]!==a||e[16]!==o?(x=()=>{a.reset(),o.reset()},e[15]=a,e[16]=o,e[17]=x):x=e[17];let b;e[18]!==o.formState.isSubmitting||e[19]!==x?(b=s.jsx(li,{disabled:o.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=o.formState.isSubmitting,e[19]=x,e[20]=b):b=e[20];const p=!o.formState.isValid||o.formState.isSubmitting;let h;e[21]!==o.formState.isSubmitting?(h=o.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(si,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=o.formState.isSubmitting,e[22]=h):h=e[22];let j;e[23]!==p||e[24]!==h?(j=s.jsx(Ze,{type:"submit",variant:"default",disabled:p,children:h}),e[23]=p,e[24]=h,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==b?(y=s.jsxs(ui,{children:[b,j]}),e[26]=j,e[27]=b,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==g?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=g,e[33]=v):v=e[33];let w;e[34]!==o||e[35]!==v?(w=s.jsxs(ai,{children:[c,s.jsx(pi,{...o,children:v})]}),e[34]=o,e[35]=v,e[36]=w):w=e[36];let N;return e[37]!==i||e[38]!==n||e[39]!==w?(N=s.jsx(fi,{open:n,onOpenChange:i,children:w}),e[37]=i,e[38]=n,e[39]=w,e[40]=N):N=e[40],N}function kr(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ar(t){const e=js(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ge.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const i=n?.data?.slug??e;if(!i)throw new Error("Failed to create organization");return{orgSlug:i}}function vs(){const t=L.useContext(Rs),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date),refetch:()=>n?.()}}function Ir(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function jt(t){const e=$.c(13),{org:n,size:i}=t,r=i===void 0?"sm":i,o=r==="xs"?"size-5":"size-6",l=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==o?(a=B(o,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=o,e[1]=a):a=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:Ir(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:B("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=c):c=e[8];let m;return e[9]!==a||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:a,style:d,children:c}),e[9]=a,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function $r({invitation:t,onChanged:e}){const[n,i]=L.useState(!1),r=t.organizationName??"Unknown organization",o=async()=>{i(!0);try{const d=await ge.organization.acceptInvitation({invitationId:t.id});if(d.error){te.error(d.error.message),i(!1);return}}catch{te.error("Failed to accept invitation"),i(!1);return}te.success(`Joined ${r}`),Bs();let a;try{a=(await ge.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=a?`/${a}`:"/"},l=async()=>{i(!0);try{const a=await ge.organization.rejectInvitation({invitationId:t.id});if(a.error){te.error(a.error.message),i(!1);return}te.success("Invitation declined"),i(!1),e()}catch{te.error("Failed to decline invitation"),i(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[s.jsx(jt,{org:{name:r},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:r}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:"Invited to join"})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(Ze,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:o,disabled:n,children:"Accept"}),s.jsx(Ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:n,"aria-label":`Decline invitation to ${r}`,children:s.jsx(oi,{size:14})})]})]})}function zr(t){const e=$.c(29),{orgParam:n,onSelectOrg:i,onCreateOrg:r}=t,{data:o}=Ls(),{invitations:l,refetch:a}=vs();let d;e[0]!==n?(d=(k,z)=>k.slug===n?-1:z.slug===n?1:k.name.localeCompare(z.name),e[0]=n,e[1]=d):d=e[1];const c=[...o??[]].sort(d),[m,u]=L.useState(""),f=m.toLowerCase(),g=f?c.filter(k=>k.name.toLowerCase().includes(f)||k.slug.toLowerCase().includes(f)):c;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(os,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=k=>u(k.target.value),e[3]=b):b=e[3];let p;e[4]!==m?(p=k=>k.key==="Escape"&&m&&u(""),e[4]=m,e[5]=p):p=e[5];let h;e[6]!==m||e[7]!==p?(h=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:b,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=m,e[7]=p,e[8]=h):h=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx($e,{size:16}),e[9]=j):j=e[9];let y;e[10]!==r?(y=s.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:j}),e[10]=r,e[11]=y):y=e[11];let v;e[12]!==h||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,h,y]}),e[12]=h,e[13]=y,e[14]=v):v=e[14];const w="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let N;e[15]!==l||e[16]!==m||e[17]!==a?(N=!m&&l.map(k=>s.jsx($r,{invitation:k,onChanged:a},k.id)),e[15]=l,e[16]=m,e[17]=a,e[18]=N):N=e[18];const _=g.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:m?`No organizations match "${m}"`:"No organizations available"});let S;e[19]!==i||e[20]!==n?(S=k=>s.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:B("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(jt,{org:k,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===n&&s.jsx(ft,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[19]=i,e[20]=n,e[21]=S):S=e[21];const C=g.map(S);let A;e[22]!==N||e[23]!==_||e[24]!==C?(A=s.jsxs("div",{className:w,children:[N,_,C]}),e[22]=N,e[23]=_,e[24]=C,e[25]=A):A=e[25];let I;return e[26]!==A||e[27]!==v?(I=s.jsxs(s.Fragment,{children:[v,A]}),e[26]=A,e[27]=v,e[28]=I):I=e[28],I}function Tr(t){const e=$.c(22),{trigger:n,orgParam:i,align:r,side:o}=t,l=r===void 0?"start":r,a=o===void 0?"bottom":o,d=le(),[c,m]=L.useState(!1),[u,f]=L.useState(!1);let g;e[0]!==n?(g=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=g):g=e[1];const x=String(c);let b;e[2]!==d?(b=N=>{m(!1),d({to:"/$org",params:{org:N}})},e[2]=d,e[3]=b):b=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{m(!1),f(!0)},e[4]=p):p=e[4];let h;e[5]!==i||e[6]!==x||e[7]!==b?(h=s.jsx(zr,{orgParam:i,onSelectOrg:b,onCreateOrg:p},x),e[5]=i,e[6]=x,e[7]=b,e[8]=h):h=e[8];let j;e[9]!==l||e[10]!==a||e[11]!==h?(j=s.jsx(We,{side:a,align:l,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Or,onCloseAutoFocus:Mr,children:h}),e[9]=l,e[10]=a,e[11]=h,e[12]=j):j=e[12];let y;e[13]!==c||e[14]!==g||e[15]!==j?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[g,j]}),e[13]=c,e[14]=g,e[15]=j,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(Cr,{open:u,onOpenChange:f}),e[17]=u,e[18]=v):v=e[18];let w;return e[19]!==v||e[20]!==y?(w=s.jsxs(s.Fragment,{children:[y,v]}),e[19]=v,e[20]=y,e[21]=w):w=e[21],w}function Mr(t){return t.preventDefault()}function Or(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Pr(t){const e=$.c(21),{value:n,onChange:i,placeholder:r,onKeyDown:o,className:l,isSearching:a,disabled:d}=t,c=r===void 0?"Search...":r;let m;e[0]!==l?(m=B("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=B("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let g;e[4]!==a?(g=a?s.jsx(Gt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(os,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=g):g=e[5];let x;e[6]!==i?(x=j=>i(j.target.value),e[6]=i,e[7]=x):x=e[7];let b;e[8]!==d||e[9]!==o||e[10]!==c||e[11]!==x||e[12]!==n?(b=s.jsx("input",{type:"text",value:n,onChange:x,onKeyDown:o,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=o,e[10]=c,e[11]=x,e[12]=n,e[13]=b):b=e[13];let p;e[14]!==f||e[15]!==g||e[16]!==b?(p=s.jsxs("label",{className:f,children:[g,b]}),e[14]=f,e[15]=g,e[16]=b,e[17]=p):p=e[17];let h;return e[18]!==m||e[19]!==p?(h=s.jsx("div",{className:m,children:p}),e[18]=m,e[19]=p,e[20]=h):h=e[20],h}const Dr="Select an existing agent";function Er(t){const e=$.c(5),{children:n}=t;let i;e[0]!==n?(i=s.jsx(fe,{asChild:!0,children:n}),e[0]=n,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(he,{side:"right",sideOffset:8,children:Dr}),e[2]=r):r=e[2];let o;return e[3]!==i?(o=s.jsxs(pe,{defaultOpen:!0,delayDuration:0,children:[i,r]}),e[3]=i,e[4]=o):o=e[4],o}function Fr(t){const e=le(),{create:n}=ss(),{locator:i}=se(),r=at({strict:!1}),o=Ue({strict:!1});return async l=>{const a=crypto.randomUUID(),d=l===o.virtualmcpid?Fn(t,i,r.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Ht(t){const e=$.c(20),{agent:n,selected:i,onClick:r}=t,o=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let l;e[0]!==o?(l=B("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",o),e[0]=o,e[1]=l):l=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==i?(u=i&&s.jsx(ft,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=u):u=e[13];let f;return e[14]!==r||e[15]!==l||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:r,className:l,children:[a,m,u]}),e[14]=r,e[15]=l,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Rr(t){const e=$.c(24),{onClose:n,onSelectAgent:i,selectedAgentId:r}=t,[o,l]=L.useState(""),a=ht(),d=a??[],{org:c}=se(),{data:m}=ge.useSession(),u=m?.user?.id??"anon",f=_n(a),g=Nn(),x=Fr(c.slug),b=$n(a),p=o.toLowerCase(),h=d.filter(Br).filter(P=>!b.has(P.id)).filter(Lr).filter(P=>!o||P.title.toLowerCase().includes(p)),j=Le(c.id),y=!o||j.title.toLowerCase().includes(p),v=!!(i&&y);let w;e[0]!==n||e[1]!==i?(w=()=>{i?.(null),n(),l("")},e[0]=n,e[1]=i,e[2]=w):w=e[2];const N=w,_=P=>{if(i){i(P.id),n(),l("");return}wn({orgId:c.id,userId:u},P.id,f),g(),n(),l(""),x(P.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let C;e[3]!==o?(C=s.jsx(Pr,{value:o,onChange:l,placeholder:"Search agents..."}),e[3]=o,e[4]=C):C=e[4];const A="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-1",I=i&&y&&j&&s.jsx(Ht,{agent:j,selected:!r||r===j.id,onClick:N}),k=h.map(P=>s.jsx(Ht,{agent:P,selected:i?r===P.id:void 0,onClick:()=>_(P)},P.id));let z;e[5]!==v||e[6]!==o||e[7]!==h.length?(z=h.length===0&&!v&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:o?"No agents found":"No agents yet"}),e[5]=v,e[6]=o,e[7]=h.length,e[8]=z):z=e[8];let E;e[9]!==I||e[10]!==k||e[11]!==z?(E=s.jsxs("div",{className:A,children:[I,k,z]}),e[9]=I,e[10]=k,e[11]=z,e[12]=E):E=e[12];let H;e[13]!==c.slug?(H={org:c.slug},e[13]=c.slug,e[14]=H):H=e[14];let O;e[15]!==n?(O=()=>n(),e[15]=n,e[16]=O):O=e[16];let D;e[17]!==O||e[18]!==H?(D=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Hs,{to:"/$org/settings/agents",params:H,onClick:O,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[17]=O,e[18]=H,e[19]=D):D=e[19];let M;return e[20]!==D||e[21]!==C||e[22]!==E?(M=s.jsxs("div",{className:S,children:[C,E,D]}),e[20]=D,e[21]=C,e[22]=E,e[23]=M):M=e[23],M}function Lr(t){return!bn(t.id)}function Br(t){return!Zt(t.id)}function Hr(t){const e=$.c(23);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:i,trigger:r,onSelectAgent:o,selectedAgentId:l,side:a,align:d}=n,c=i===void 0?!1:i,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,g]=L.useState(!1),x=mt(),{setOpenMobile:b}=be(),p=Sn(),h=p?"border border-border":void 0;let j;e[2]!==p?(j=C=>p?s.jsx(Er,{children:C}):C,e[2]=p,e[3]=j):j=e[3];const y=j;let v;e[4]!==x||e[5]!==b?(v=()=>{g(!1),x&&b(!1)},e[4]=x,e[5]=b,e[6]=v):v=e[6];const w=v;let N;e[7]!==w||e[8]!==o||e[9]!==f||e[10]!==l?(N=f&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(oe,{className:"h-4 w-24"})}),children:s.jsx(Rr,{onClose:w,onSelectAgent:o,selectedAgentId:l})}),e[7]=w,e[8]=o,e[9]=f,e[10]=l,e[11]=N):N=e[11];const _=N;let S;return e[12]!==u||e[13]!==c||e[14]!==h||e[15]!==p||e[16]!==x||e[17]!==f||e[18]!==_||e[19]!==m||e[20]!==r||e[21]!==y?(S=s.jsx(s.Fragment,{children:x?s.jsxs(s.Fragment,{children:[r?s.jsx("button",{type:"button",onClick:()=>g(!0),className:"contents",children:r}):c?y(s.jsx(ve,{"aria-label":"Browse agents",className:B(h),onClick:()=>{me("agent_browser_opened",{surface:"mobile_drawer"}),g(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(q,{children:y(s.jsxs(J,{tooltip:p?void 0:"Browse agents",className:B(h),onClick:()=>{me("agent_browser_opened",{surface:"mobile_drawer"}),g(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Xt,{open:f,onOpenChange:g,direction:"bottom",children:s.jsxs(Qt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Yt,{className:"sr-only",children:"Browse agents"}),_]})})]}):s.jsxs(Ge,{open:f,onOpenChange:C=>{C&&!f&&me("agent_browser_opened",{surface:"desktop_popover"}),g(C)},children:[r?s.jsx(ze,{asChild:!0,children:r}):c?y(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:B(h),children:s.jsx($e,{className:"size-4"})})})):s.jsx(q,{children:y(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:p?void 0:"Browse agents",className:B(h),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(We,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:_})]})}),e[12]=u,e[13]=c,e[14]=h,e[15]=p,e[16]=x,e[17]=f,e[18]=_,e[19]=m,e[20]=r,e[21]=y,e[22]=S):S=e[22],S}const Ur="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Gr(t){const e=$.c(19),{agentId:n,fallback:i,onOpenHome:r,onPick:o}=t,l=qe(n)??i??null,a=l?.title??"Super Agent",d=`Open ${a} home`,c=l?.icon??null;let m;e[0]!==c||e[1]!==a?(m=s.jsx(ye,{icon:c,name:a,size:"xs"}),e[0]=c,e[1]=a,e[2]=m):m=e[2];let u;e[3]!==r||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:r,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m}),e[3]=r,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==a?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:a}),e[7]=a,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(gt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=g):g=e[9];let x;e[10]!==f?(x=s.jsxs("button",{type:"button",className:Ur,children:[f,g]}),e[10]=f,e[11]=x):x=e[11];let b;e[12]!==n||e[13]!==o||e[14]!==x?(b=s.jsx(Hr,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:o,trigger:x}),e[12]=n,e[13]=o,e[14]=x,e[15]=b):b=e[15];let p;return e[16]!==u||e[17]!==b?(p=s.jsxs("div",{className:"flex items-center gap-1",children:[u,b]}),e[16]=u,e[17]=b,e[18]=p):p=e[18],p}function Ut(){const t=$.c(43),{org:e}=se(),{state:n,isMobile:i}=be(),r=le();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const l=at(o);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const d=Ue(a),{threads:c}=pt(),{setTaskId:m,createNewTask:u}=xt(),f=vs().invitations.length>0,g=n==="collapsed"||i;let x;t[2]!==e.id?(x=Le(e.id),t[2]=e.id,t[3]=x):x=t[3];const b=x,p=b.id,h=l.taskId?d.virtualmcpid??p:p;let j;t[4]!==u||t[5]!==p||t[6]!==r||t[7]!==e.slug||t[8]!==m||t[9]!==c?(j=M=>{if(!M||M===p){r({to:"/$org",params:{org:e.slug}});return}const P=Si(c,M);P?m(P.id,M):u(M)},t[4]=u,t[5]=p,t[6]=r,t[7]=e.slug,t[8]=m,t[9]=c,t[10]=j):j=t[10];const y=j,v=f?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let w;t[11]!==e?(w=s.jsx(jt,{org:e,size:"sm"}),t[11]=e,t[12]=w):w=t[12];let N;t[13]!==f||t[14]!==g?(N=f&&s.jsx("span",{className:B("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",g?"-top-1":"top-1/2 -translate-y-1/2")}),t[13]=f,t[14]=g,t[15]=N):N=t[15];let _;t[16]!==w||t[17]!==N?(_=s.jsxs("span",{className:"relative inline-flex",children:[w,N]}),t[16]=w,t[17]=N,t[18]=_):_=t[18];let S;t[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(gt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[19]=S):S=t[19];let C;t[20]!==v||t[21]!==_?(C=s.jsx(fe,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":v,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-md pl-3 pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[_,S]})}),t[20]=v,t[21]=_,t[22]=C):C=t[22];let A;t[23]!==e.slug||t[24]!==C?(A=s.jsx(Tr,{orgParam:e.slug,trigger:C}),t[23]=e.slug,t[24]=C,t[25]=A):A=t[25];let I;t[26]!==e.name?(I=s.jsx(he,{side:"bottom",children:e.name}),t[26]=e.name,t[27]=I):I=t[27];let k;t[28]!==A||t[29]!==I?(k=s.jsx(kt,{children:s.jsxs(pe,{children:[A,I]})}),t[28]=A,t[29]=I,t[30]=k):k=t[30];let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[31]=z):z=t[31];const E=h===p?b:void 0;let H;t[32]!==h||t[33]!==y?(H=()=>y(h),t[32]=h,t[33]=y,t[34]=H):H=t[34];let O;t[35]!==h||t[36]!==y||t[37]!==E||t[38]!==H?(O=s.jsx(kt,{children:s.jsx(L.Suspense,{fallback:z,children:s.jsx(Gr,{agentId:h,fallback:E,onOpenHome:H,onPick:y})})}),t[35]=h,t[36]=y,t[37]=E,t[38]=H,t[39]=O):O=t[39];let D;return t[40]!==k||t[41]!==O?(D=s.jsx(ii,{className:"wco-no-drag",children:s.jsxs(ri,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[k,O]})}),t[40]=k,t[41]=O,t[42]=D):D=t[42],D}const Wr="sidebar.open";function qr(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Gs,{}),t[0]=e):e=t[0],e}function la(){const t=$.c(24),e=mt(),[n,i]=He(Wr,!1),{width:r,wrapperRef:o,onStartResize:l,resetWidth:a}=Ci();let d;t[0]!==e?(d=e?s.jsxs(ee.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[s.jsx(rs,{}),s.jsx(Ut,{}),s.jsx(ot,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ee.TogglesSlot,{}),s.jsx(ee.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ee.CenterSlot,{}),s.jsx(ee.RightSlot,{})]}):s.jsxs(ee.Header,{children:[s.jsxs(ee.LeftColumn,{children:[s.jsx(Ut,{}),s.jsx(ee.TogglesSlot,{})]}),s.jsx(ee.CenterSlot,{}),s.jsxs(ee.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:s.jsx(ee.TabsSlot,{})}),s.jsx(ee.RightSlot,{})]})]}),t[0]=e,t[1]=d):d=t[1];const c=`${r}px`;let m;t[2]!==c?(m={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},t[2]=c,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(_r,{}),s.jsx(_i,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g={background:"transparent",containerType:"inline-size"},t[8]=g):g=t[8];let x;t[9]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ks,{className:"flex flex-col",style:g,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(L.Suspense,{fallback:s.jsx(qr,{}),children:s.jsx(Us,{})})})})}),t[9]=x):x=t[9];let b;t[10]!==u||t[11]!==f||t[12]!==o?(b=s.jsxs(Vs,{ref:o,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,x]}),t[10]=u,t[11]=f,t[12]=o,t[13]=b):b=t[13];let p;t[14]!==e?(p=e&&s.jsx(Xn,{renderSidebar:Kr}),t[14]=e,t[15]=p):p=t[15];let h;t[16]!==d||t[17]!==b||t[18]!==p?(h=s.jsx(ni,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[d,b,p]})}),t[16]=d,t[17]=b,t[18]=p,t[19]=h):h=t[19];let j;return t[20]!==i||t[21]!==n||t[22]!==h?(j=s.jsx(En,{children:s.jsx(ee.Provider,{children:s.jsx(Xs,{open:n,onOpenChange:i,children:h})})}),t[20]=i,t[21]=n,t[22]=h,t[23]=j):j=t[23],j}function Kr(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Nr,{onClose:e})})})}export{la as default};
@@ -1 +1 @@
1
- import{c as s,l as a,j as d}from"./index-BYp7Ofgs.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
1
+ import{c as s,l as a,j as d}from"./index-DMN_Rked.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
@@ -1 +1 @@
1
- import{c as k,j as h,r as C,l as L}from"./index-BYp7Ofgs.js";import{n as Z}from"./XCircle-DhEfH4xa.js";import{A as y}from"./agent-icon-Cg17MSXd.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
1
+ import{c as k,j as h,r as C,l as L}from"./index-DMN_Rked.js";import{n as Z}from"./XCircle-DinyVT9K.js";import{A as y}from"./agent-icon-DZ_0evWF.js";const M={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},R={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},T={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},W={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function G(E){const t=k.c(13),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g;if(e?.startsWith("icon://")||e?.includes("#agentcolor=")){const r=W[n];let l;return t[0]!==o||t[1]!==e||t[2]!==s||t[3]!==r?(l=h.jsx(y,{icon:e,name:s,size:r,className:o}),t[0]=o,t[1]=e,t[2]=s,t[3]=r,t[4]=l):l=t[4],l}const S=e??"no-icon";let i;return t[5]!==o||t[6]!==c||t[7]!==I||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==S?(i=h.jsx($,{icon:e,name:s,size:n,className:o,fallbackIcon:c,fit:I},S),t[5]=o,t[6]=c,t[7]=I,t[8]=e,t[9]=s,t[10]=n,t[11]=S,t[12]=i):i=t[12],i}function $(E){const t=k.c(25),{icon:e,name:s,size:w,className:o,fallbackIcon:c,fit:g}=E,n=w===void 0?"md":w,I=g===void 0?"cover":g,[S,i]=C.useState(!1),r=!!e&&S,l=M[n],p=R[n];let a;t[0]!==o||t[1]!==l||t[2]!==p?(a=L("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,p,o),t[0]=o,t[1]=l,t[2]=p,t[3]=a):a=t[3];const N=e||void 0,_=I==="contain"?"object-contain":"object-cover",A=!r&&"hidden";let m;t[4]!==_||t[5]!==A?(m=L("h-full w-full",_,A),t[4]=_,t[5]=A,t[6]=m):m=t[6];let v,j;t[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>i(!1),j=()=>i(!0),t[7]=v,t[8]=j):(v=t[7],j=t[8]);let d;t[9]!==s||t[10]!==N||t[11]!==m?(d=h.jsx("img",{src:N,alt:s,className:m,onError:v,onLoad:j}),t[9]=s,t[10]=N,t[11]=m,t[12]=d):d=t[12];const z=r&&"hidden";let f;t[13]!==z?(f=L("h-full w-full flex items-center justify-center bg-muted/20",z),t[13]=z,t[14]=f):f=t[14];let x;t[15]!==c||t[16]!==n?(x=c??h.jsx(Z,{size:T[n],className:"text-muted-foreground"}),t[15]=c,t[16]=n,t[17]=x):x=t[17];let u;t[18]!==f||t[19]!==x?(u=h.jsx("div",{className:f,children:x}),t[18]=f,t[19]=x,t[20]=u):u=t[20];let b;return t[21]!==d||t[22]!==u||t[23]!==a?(b=h.jsxs("div",{className:a,children:[d,u]}),t[21]=d,t[22]=u,t[23]=a,t[24]=b):b=t[24],b}export{G as I};
@@ -1,3 +1,3 @@
1
- import{H as M,r as N,Z as R,p as L,a as V,J as B,d as K,M as p,t as c,K as j,j as s,B as C}from"./index-BYp7Ofgs.js";import{e as O,i as q,d as z,c as Q,a as k,D as H}from"./dialog-1Eqcgb9h.js";import{a as J,F as b,b as v,c as U,d as w,e as S}from"./form-uObUvJsx.js";import{a as Y,c as Z,d as G,S as W,b as X}from"./select-G_YqOyoi.js";import{T as _}from"./textarea-ChqR5uQR.js";import{u as ee}from"./use-org-auth-client-DXczVSBm.js";import{u as se}from"./use-organization-roles-BAuTLcqM.js";const te=M().email("Invalid email address");function ne(r){if(!r.trim())return[];const m=r.split(/[,;\n]/).map(a=>a.trim().toLowerCase()).filter(a=>a.length>0);return Array.from(new Set(m))}function de({trigger:r}){const[m,a]=N.useState(!1),{locator:g}=R(),E=ee(),x=L(),{data:F}=V.useSession(),f=F?.user?.email,{roles:P,isLoading:y}=se(),T=P.filter(t=>t.role!=="owner"),i=B({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),$=i.watch("emailsText"),A=i.watch("role"),l=ne($).filter(t=>{const e=te.safeParse(t).success,n=!f||t!==f.toLowerCase();return e&&n}),o=K({mutationFn:async({emails:t,role:e})=>{if(!e)throw new Error("Please select a role");const n=await Promise.allSettled(t.map(async d=>{const h=await E.organization.inviteMember({email:d,role:e});if(h.error)throw new Error(h.error.message);return h.data})),u=n.filter(d=>d.status==="rejected");if(u.length>0)throw new Error(`Failed to invite ${u.length} member${u.length>1?"s":""}`);return n},onSuccess:(t,{emails:e,role:n})=>{p("member_invited",{count:e.length,role:n}),x.invalidateQueries({queryKey:j.members(g)}),x.invalidateQueries({queryKey:j.invitations(g)}),c.success(e.length===1?"Member invited successfully!":`${e.length} members invited successfully!`),i.reset({emailsText:"",role:"user"}),a(!1)},onError:(t,{emails:e,role:n})=>{p("member_invite_failed",{count:e.length,role:n,error:t instanceof Error?t.message:String(t)}),c.error(t instanceof Error?t.message:"Failed to invite members")}}),D=t=>{if(l.length===0){c.error("Please enter at least one valid email address");return}if(!t.role){c.error("Please select a role");return}o.mutate({emails:l,role:t.role})},I=l.length>0&&!!A;return s.jsxs(O,{open:m,onOpenChange:a,children:[s.jsx(q,{asChild:!0,children:r}),s.jsxs(z,{className:"sm:max-w-lg",children:[s.jsx(Q,{children:s.jsx(k,{children:"Invite members"})}),s.jsx(J,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(D),className:"space-y-4",children:[s.jsx(b,{control:i.control,name:"emailsText",render:({field:t})=>s.jsxs(v,{children:[s.jsx(U,{children:"Email addresses"}),s.jsx(w,{children:s.jsx(_,{...t,disabled:o.isPending,placeholder:`Enter email addresses separated by commas or new lines
1
+ import{H as M,r as N,Z as R,p as L,a as V,J as B,d as K,M as p,t as c,K as j,j as s,B as C}from"./index-DMN_Rked.js";import{e as O,i as q,d as z,c as Q,a as k,D as H}from"./dialog-D9ySvI1O.js";import{a as J,F as b,b as v,c as U,d as w,e as S}from"./form-BBc7G1M6.js";import{a as Y,c as Z,d as G,S as W,b as X}from"./select-CU_eaLJy.js";import{T as _}from"./textarea-86Nn-Itu.js";import{u as ee}from"./use-org-auth-client-CYcM54fk.js";import{u as se}from"./use-organization-roles-DZnqIOJB.js";const te=M().email("Invalid email address");function ne(r){if(!r.trim())return[];const m=r.split(/[,;\n]/).map(a=>a.trim().toLowerCase()).filter(a=>a.length>0);return Array.from(new Set(m))}function de({trigger:r}){const[m,a]=N.useState(!1),{locator:g}=R(),E=ee(),x=L(),{data:F}=V.useSession(),f=F?.user?.email,{roles:P,isLoading:y}=se(),T=P.filter(t=>t.role!=="owner"),i=B({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),$=i.watch("emailsText"),A=i.watch("role"),l=ne($).filter(t=>{const e=te.safeParse(t).success,n=!f||t!==f.toLowerCase();return e&&n}),o=K({mutationFn:async({emails:t,role:e})=>{if(!e)throw new Error("Please select a role");const n=await Promise.allSettled(t.map(async d=>{const h=await E.organization.inviteMember({email:d,role:e});if(h.error)throw new Error(h.error.message);return h.data})),u=n.filter(d=>d.status==="rejected");if(u.length>0)throw new Error(`Failed to invite ${u.length} member${u.length>1?"s":""}`);return n},onSuccess:(t,{emails:e,role:n})=>{p("member_invited",{count:e.length,role:n}),x.invalidateQueries({queryKey:j.members(g)}),x.invalidateQueries({queryKey:j.invitations(g)}),c.success(e.length===1?"Member invited successfully!":`${e.length} members invited successfully!`),i.reset({emailsText:"",role:"user"}),a(!1)},onError:(t,{emails:e,role:n})=>{p("member_invite_failed",{count:e.length,role:n,error:t instanceof Error?t.message:String(t)}),c.error(t instanceof Error?t.message:"Failed to invite members")}}),D=t=>{if(l.length===0){c.error("Please enter at least one valid email address");return}if(!t.role){c.error("Please select a role");return}o.mutate({emails:l,role:t.role})},I=l.length>0&&!!A;return s.jsxs(O,{open:m,onOpenChange:a,children:[s.jsx(q,{asChild:!0,children:r}),s.jsxs(z,{className:"sm:max-w-lg",children:[s.jsx(Q,{children:s.jsx(k,{children:"Invite members"})}),s.jsx(J,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(D),className:"space-y-4",children:[s.jsx(b,{control:i.control,name:"emailsText",render:({field:t})=>s.jsxs(v,{children:[s.jsx(U,{children:"Email addresses"}),s.jsx(w,{children:s.jsx(_,{...t,disabled:o.isPending,placeholder:`Enter email addresses separated by commas or new lines
2
2
  e.g. user1@example.com, user2@example.com
3
3
  or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(S,{})]})}),s.jsx(b,{control:i.control,name:"role",render:({field:t})=>s.jsxs(v,{children:[s.jsx(w,{children:s.jsxs(Y,{value:t.value,onValueChange:t.onChange,disabled:o.isPending||y,children:[s.jsx(Z,{className:"w-full",children:s.jsx(G,{placeholder:"Select a role"})}),s.jsx(W,{children:T.map(e=>{const n=[];return e.isBuiltin||(e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),(e.connectionCount!==0||e.allowsAllConnections)&&(e.allowsAllTools?n.push("all tools"):e.toolCount&&e.toolCount>0&&n.push(`${e.toolCount} tool${e.toolCount!==1?"s":""}`))),s.jsx(X,{value:e.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:e.label}),!e.isBuiltin&&n.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:n.join(", ")})]})},e.role)})})]})}),s.jsx(S,{})]})}),s.jsxs(H,{children:[s.jsx(C,{variant:"outline",onClick:()=>{i.reset({emailsText:"",role:"user"}),a(!1)},type:"button",disabled:o.isPending,children:"Cancel"}),s.jsx(C,{type:"submit",disabled:o.isPending||!I,children:o.isPending?"Inviting...":`Invite ${l.length||0} Member${l.length!==1?"s":""}`})]})]})})]})]})}export{de as I};