decocms 4.49.3 → 4.50.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/dist/client/assets/{AlertCircle-BsDS7jNj.js → AlertCircle-DvQdKX2P.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-Bc3CxS8W.js → ArrowUpRight-C4ZUgCv8.js} +1 -1
  3. package/dist/client/assets/{Check-CAd1bC9m.js → Check-DT0Ecfph.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Cdg1p5fM.js → CheckCircle-B3kM3-nx.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-tAtL2zbj.js → ChevronDown-BL5D5Kww.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-v0xGbrLn.js → ChevronRight-Brlyqvfv.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-DC-9hom0.js → ChevronUp-D4h43NMl.js} +1 -1
  8. package/dist/client/assets/{Circle-DjdanfT5.js → Circle-gozopXYF.js} +1 -1
  9. package/dist/client/assets/{Copy01-DAQFba68.js → Copy01-DVjpmGSQ.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CuQyuHWG.js → DotsVertical-CuOtMg5m.js} +1 -1
  11. package/dist/client/assets/{Eye-BN-QaERw.js → Eye-cte0MnVy.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DzCYlHOw.js → FilterLines-B1MBg_Jt.js} +1 -1
  13. package/dist/client/assets/{Globe01-CFG_HzdE.js → Globe01-fOy2mEYg.js} +1 -1
  14. package/dist/client/assets/{Globe04-BEzAuler.js → Globe04-BhuakAIf.js} +1 -1
  15. package/dist/client/assets/{HardDrive-BYAloD_C.js → HardDrive-DKydDUbm.js} +1 -1
  16. package/dist/client/assets/{Key01-Zc6SBg99.js → Key01-BhnYqbq5.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-DkeZ-wGU.js → LayoutLeft-CIXRhIgm.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CqKEOrqN.js → LinkExternal01-Br3p9c4J.js} +1 -1
  19. package/dist/client/assets/{List-Bup1f1MX.js → List-DZFJgfGO.js} +1 -1
  20. package/dist/client/assets/Loading02-BYDO_yva.js +1 -0
  21. package/dist/client/assets/{Monitor01-CMiM2oxz.js → Monitor01-8NNEYlGa.js} +1 -1
  22. package/dist/client/assets/{Palette-BOEGfQ2j.js → Palette-BEYm0oRU.js} +1 -1
  23. package/dist/client/assets/{Play-DvxsNXOr.js → Play-BAkY7Fxv.js} +1 -1
  24. package/dist/client/assets/{Plus-Bs0jgtjM.js → Plus-BWS7YRCt.js} +1 -1
  25. package/dist/client/assets/{SearchLg-Dxmw6xZz.js → SearchLg-sYqeRxUE.js} +1 -1
  26. package/dist/client/assets/{SearchMd-DZb2QdDj.js → SearchMd-D3a2hIUP.js} +1 -1
  27. package/dist/client/assets/{Settings02-BD_qWlxL.js → Settings02-CJWk9pL-.js} +1 -1
  28. package/dist/client/assets/{Shield01-BWB7DMXT.js → Shield01-1T25s-tn.js} +1 -1
  29. package/dist/client/assets/{Star01-B8SKXby3.js → Star01-LBoyDaKY.js} +1 -1
  30. package/dist/client/assets/{Stars01-BBuA9YPy.js → Stars01-5MzsUK6G.js} +1 -1
  31. package/dist/client/assets/{Stars02-Drr3hQR7.js → Stars02-H_ePh5tT.js} +1 -1
  32. package/dist/client/assets/{Sun-CGc_p-DL.js → Sun-DvwmIRmO.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-DJrb6Lvg.js → SwitchHorizontal01-CEx7u3Ha.js} +1 -1
  34. package/dist/client/assets/{Tool01-D3DG8-dG.js → Tool01-BFRbBZqm.js} +1 -1
  35. package/dist/client/assets/{Trash01-Dy1oFJTP.js → Trash01-CqJAv-4z.js} +1 -1
  36. package/dist/client/assets/{Upload01-TK_S5g8u.js → Upload01-BEmoOwcr.js} +1 -1
  37. package/dist/client/assets/{User01-Bu3qeanf.js → User01-Ckt1oKpR.js} +1 -1
  38. package/dist/client/assets/{Users01-B_Z4mpH4.js → Users01-C3ZswPLc.js} +1 -1
  39. package/dist/client/assets/{Users03-C6Jg6hMj.js → Users03-BQZ9UhFk.js} +1 -1
  40. package/dist/client/assets/{X-BR6yV48A.js → X-CAX-FceB.js} +1 -1
  41. package/dist/client/assets/{XCircle-Tdmnaiof.js → XCircle-D6yhOy3u.js} +1 -1
  42. package/dist/client/assets/{XClose-D8xbZO7h.js → XClose-DuZ4u7Uu.js} +1 -1
  43. package/dist/client/assets/{Zap-CMr5_5zL.js → Zap-DWMv1jO1.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-DMcGWFjD.js → ZapSquare-do_RxxO8.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-aPkj7Qlz.js → ZoomOut-DK6J-pHc.js} +1 -1
  46. package/dist/client/assets/{access-gate-XssMLnmz.js → access-gate-BoaBcBcQ.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-CbCiElNn.js → add-section-modal-DzvsujkT.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-_vj6A7OP.js → agent-capabilities-udLJw-cm.js} +1 -1
  49. package/dist/client/assets/agent-icon-DryRwerX.js +1 -0
  50. package/dist/client/assets/{agents-list-BiAi9eni.js → agents-list-Ts1COBbM.js} +1 -1
  51. package/dist/client/assets/{ai-providers-D2uB1IIV.js → ai-providers-Bkg5iXmH.js} +1 -1
  52. package/dist/client/assets/{alert-43oJgx4A.js → alert-Dd7VLodG.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-BYZK7MmP.js → alert-dialog-C4qC2FY4.js} +1 -1
  54. package/dist/client/assets/{app-editor-bDj1A1A1.js → app-editor-CgSwIbOw.js} +1 -1
  55. package/dist/client/assets/{auth-CbWvobXA.js → auth-DBkkYg-T.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-Bm2W0VeF.js → auth-catchall-DfxF4BPq.js} +1 -1
  57. package/dist/client/assets/{auth-entry-BjmDJXlO.js → auth-entry-wfy-u0F0.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-Ai05nmLR.js → auth-split-layout-ktXvps3s.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-BcJO_SKj.js → authenticate-and-persist-oauth-Bbf69cXY.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-DGVnJGBZ.js → automation-list-row-DBzmw45u.js} +1 -1
  61. package/dist/client/assets/{automation-runs-DsZSPU4g.js → automation-runs-DHRDLBLv.js} +1 -1
  62. package/dist/client/assets/{automations-DV51pFAi.js → automations-CBd2I4AI.js} +1 -1
  63. package/dist/client/assets/{autosend-DkKJN73F.js → autosend-d6dIJs7M.js} +1 -1
  64. package/dist/client/assets/{avatar-onqhUIhg.js → avatar-DWC-yfzJ.js} +1 -1
  65. package/dist/client/assets/{badge-CBYAg42N.js → badge-DJdw3Rsl.js} +1 -1
  66. package/dist/client/assets/{block-document-BLrO8YF6.js → block-document-BGR4oU7t.js} +1 -1
  67. package/dist/client/assets/{brand-context-CItsAE4P.js → brand-context-DTtKwfXh.js} +1 -1
  68. package/dist/client/assets/{breadcrumb-DCQF8-Cq.js → breadcrumb-CbTWSDKt.js} +1 -1
  69. package/dist/client/assets/{buckets-BtmWrg32.js → buckets-DXJgsymj.js} +1 -1
  70. package/dist/client/assets/{bulk-category-panel-Di-HEgX1.js → bulk-category-panel-BLrzcvWT.js} +1 -1
  71. package/dist/client/assets/{calendar-DoM8D1HG.js → calendar-DuEt6MhW.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-Dl3n41vM.js → capability-load-error-jhIJPxL6.js} +1 -1
  73. package/dist/client/assets/{card-Dv-mQmP7.js → card-fRwe0bJZ.js} +1 -1
  74. package/dist/client/assets/category-editor-CcRWkoEb.js +1 -0
  75. package/dist/client/assets/{chat-context-BFcW1WlF.js → chat-context-B0O0Okxx.js} +1 -1
  76. package/dist/client/assets/{checkbox-n3KI4AGQ.js → checkbox-C1s1Cv92.js} +1 -1
  77. package/dist/client/assets/{cli-auth-success-DB5Umt34.js → cli-auth-success-Gjk2YP9E.js} +1 -1
  78. package/dist/client/assets/{collection-detail-CHr9WIeh.js → collection-detail-CtM2kg0x.js} +1 -1
  79. package/dist/client/assets/{collection-display-button-BPMGUA2n.js → collection-display-button-C3a5JxQa.js} +1 -1
  80. package/dist/client/assets/{collection-search-BhAEPd5p.js → collection-search-DFZjjhrH.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-BZMwh74L.js → collection-table-wrapper-C6PjuHgw.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-DVYhngM2.js → collection-tabs-DKk8l5Nv.js} +1 -1
  83. package/dist/client/assets/{command-CpEhzPdP.js → command-CslXjYaI.js} +1 -1
  84. package/dist/client/assets/{commerce-onboarding-VdE7M98f.js → commerce-onboarding-DHT_nBuJ.js} +1 -1
  85. package/dist/client/assets/{connect-desktop-dialog-CtfSCLJo.js → connect-desktop-dialog-D3fwzLbi.js} +1 -1
  86. package/dist/client/assets/{connection-card-DPq0g_d1.js → connection-card-Do3n6-0X.js} +1 -1
  87. package/dist/client/assets/{connection-detail-6Vf3zP7n.js → connection-detail-CzIcxrxO.js} +1 -1
  88. package/dist/client/assets/{connection-form-helpers-CW10Qgyt.js → connection-form-helpers-2Hj68sfK.js} +1 -1
  89. package/dist/client/assets/{connections-D4fz8gPY.js → connections-M8hPZ8h_.js} +1 -1
  90. package/dist/client/assets/{decopilot-sse-pool-oALvpvFW.js → decopilot-sse-pool-B14erbbw.js} +1 -1
  91. package/dist/client/assets/{dialog-CdQ9BYgU.js → dialog-B4FPUVJm.js} +1 -1
  92. package/dist/client/assets/{domain-settings-r2g0bDQa.js → domain-settings-B7X2BGW_.js} +1 -1
  93. package/dist/client/assets/{drawer-AnMvpdV8.js → drawer-CsmWGB6A.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-DmoXHaIh.js → dropdown-menu-BXp0fOBv.js} +1 -1
  95. package/dist/client/assets/{empty-state-C-kk7n_D.js → empty-state-DUwhZpUT.js} +1 -1
  96. package/dist/client/assets/{extract-connection-data-Cbb-bMdr.js → extract-connection-data-Du4c1lRI.js} +1 -1
  97. package/dist/client/assets/{file-explorer-cNn6Kq11.js → file-explorer-dehRUbZq.js} +2 -2
  98. package/dist/client/assets/{file-type-icon-DjAAkRd_.js → file-type-icon-BsGfZ7Mt.js} +1 -1
  99. package/dist/client/assets/{files-B0LVrDMx.js → files-BRsrXnK1.js} +1 -1
  100. package/dist/client/assets/{form-Cwl2xW04.js → form-CIHkncRQ.js} +1 -1
  101. package/dist/client/assets/{general-DoIX1d7b.js → general-C_FpLf3Q.js} +1 -1
  102. package/dist/client/assets/{github-repo-picker-BNqa7U_T.js → github-repo-picker-CnKj3G6a.js} +1 -1
  103. package/dist/client/assets/{hooks-h8pftJyw.js → hooks-Cln-uffe.js} +1 -1
  104. package/dist/client/assets/{index-SgyrHi7S.js → index-1lPjtuok.js} +1 -1
  105. package/dist/client/assets/{index-CeZlT01m.js → index-BCuWJvJV.js} +1 -1
  106. package/dist/client/assets/{index-CwM1XM76.js → index-BE0jgIkY.js} +1 -1
  107. package/dist/client/assets/{index-Btbu7WpH.js → index-BPc0E2v5.js} +1 -1
  108. package/dist/client/assets/{index-DvCStEGE.js → index-BrYQWjA0.js} +1 -1
  109. package/dist/client/assets/{index-IpIFDk9G.js → index-Bt7VlfeQ.js} +1 -1
  110. package/dist/client/assets/{index-_T6qHiXV.js → index-BtXBV2Et.js} +1 -1
  111. package/dist/client/assets/{index-F9wo0Qyl.js → index-C2Xrxv4z.js} +1 -1
  112. package/dist/client/assets/{index-BhTkfon5.js → index-DOA46HRo.js} +1 -1
  113. package/dist/client/assets/{index-Tu7JB-s1.js → index-Dgf9uMoE.js} +4 -4
  114. package/dist/client/assets/{index-DjZHvz7-.js → index-XnT9B5AX.js} +1 -1
  115. package/dist/client/assets/index-b3V1CkLW.css +1 -0
  116. package/dist/client/assets/index-l7TANBTQ.js +1 -0
  117. package/dist/client/assets/{index-CoinrRu1.js → index-loGM-Zqm.js} +27 -27
  118. package/dist/client/assets/{index-redirect-AKr_iZBt.js → index-redirect-9j6LkyoI.js} +1 -1
  119. package/dist/client/assets/{index-CeuXUQs7.js → index-w7ppCtrf.js} +1 -1
  120. package/dist/client/assets/{input-26jR_LS5.js → input-oiex_Sqb.js} +1 -1
  121. package/dist/client/assets/{integration-icon-CeIwSY6g.js → integration-icon-aZSadBLO.js} +1 -1
  122. package/dist/client/assets/{invite-member-dialog-C9P0fOu8.js → invite-member-dialog-IU7TOmN2.js} +1 -1
  123. package/dist/client/assets/{label-BYCB_C-p.js → label-CmLwbefD.js} +1 -1
  124. package/dist/client/assets/{login-DYfQww4J.js → login-C0ZjtJpq.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-DQDx9fRY.js → mcp-oauth-CdnuFysO.js} +1 -1
  126. package/dist/client/assets/{members-Bo_isX2L.js → members-BS0Y_-RA.js} +1 -1
  127. package/dist/client/assets/{monaco-editor-Cd4tC9CY.js → monaco-editor-d15d-RZJ.js} +1 -1
  128. package/dist/client/assets/{monitoring-stats-row-D97ZRlOf.js → monitoring-stats-row-zzC6T7XL.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-BNVfYsrt.js → oauth-callback-EgT8jFmC.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-ai-provider-DWfxLmYQ.js → oauth-callback-ai-provider-CRV9LcjN.js} +1 -1
  131. package/dist/client/assets/{onboarding-DFRf4Xfy.js → onboarding-N_yKxU4j.js} +1 -1
  132. package/dist/client/assets/{org-install-Bxv1Qcpj.js → org-install-D3e2RXf5.js} +1 -1
  133. package/dist/client/assets/{org-layout-DxLquIQH.js → org-layout-DNgYRXIB.js} +1 -1
  134. package/dist/client/assets/{organization-choice-_Phnw6fd.js → organization-choice-pAAagV_i.js} +1 -1
  135. package/dist/client/assets/page-seo-sheet-oQ_VYV1S.js +1 -0
  136. package/dist/client/assets/{popover-BKluFkmH.js → popover-BjB-5tFY.js} +1 -1
  137. package/dist/client/assets/{post-editor-D0GvbFHM.js → post-editor-DSs8Lcxg.js} +1 -1
  138. package/dist/client/assets/{primitives-W-BRd6Bq.js → primitives-Ds0WLoLr.js} +1 -1
  139. package/dist/client/assets/{profile-Cf7XumFP.js → profile-CzCmCXYA.js} +1 -1
  140. package/dist/client/assets/project-app-view-DkIw6469.js +1 -0
  141. package/dist/client/assets/record-editor-By2OLFPe.js +1 -0
  142. package/dist/client/assets/{registry-layout-BwddXMxb.js → registry-layout-B80BPaTp.js} +1 -1
  143. package/dist/client/assets/registry-wO6PtzH3.js +2 -0
  144. package/dist/client/assets/{require-capability-BUA84NVY.js → require-capability-CC8Cb4eK.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-BweWSRt1.js → required-auth-layout-Bxaf6y0u.js} +1 -1
  146. package/dist/client/assets/{reset-password-7fZA4JSY.js → reset-password-CaEUMCHV.js} +1 -1
  147. package/dist/client/assets/{roles-C8Lnnd7S.js → roles-CI4mrdaD.js} +1 -1
  148. package/dist/client/assets/{search-input-Bq0CM-XG.js → search-input-DUPgDj3Q.js} +1 -1
  149. package/dist/client/assets/{secrets-DxdVS4R3.js → secrets-hHXyxqcY.js} +1 -1
  150. package/dist/client/assets/{sections-editor-Xjdp2gUa.js → sections-editor-DLA_tn_Z.js} +2 -2
  151. package/dist/client/assets/{select-C2dlyl3o.js → select-Ct8ODrmD.js} +1 -1
  152. package/dist/client/assets/{select-model-DX38ElPu.js → select-model-CXARzc0b.js} +1 -1
  153. package/dist/client/assets/{seo-editor-fIkfTVFp.js → seo-editor-BpwYJzgf.js} +1 -1
  154. package/dist/client/assets/{seo-save-8FcJ90oB.js → seo-save-CaN3ncbg.js} +1 -1
  155. package/dist/client/assets/{settings-layout-Y7vOZY7y.js → settings-layout-CGatm5aT.js} +1 -1
  156. package/dist/client/assets/{settings-section-mo-cud1Q.js → settings-section-CIZ7OrhY.js} +1 -1
  157. package/dist/client/assets/{shell-controls-CrjfiCAj.js → shell-controls-DcH8LcQe.js} +1 -1
  158. package/dist/client/assets/{shell-layout-BUjt1pfT.js → shell-layout-B4WmiL97.js} +1 -1
  159. package/dist/client/assets/{sidebar-CfrgTfPQ.js → sidebar-DGCj3BzG.js} +1 -1
  160. package/dist/client/assets/{skeleton-CgzDET-q.js → skeleton-h_Rrfd9X.js} +1 -1
  161. package/dist/client/assets/{sso-B21o3fmp.js → sso-Xyp2hR06.js} +1 -1
  162. package/dist/client/assets/{store-D1P6xv0B.js → store-Cmzf3YVA.js} +1 -1
  163. package/dist/client/assets/store-registry-C9g9AZIb.js +2 -0
  164. package/dist/client/assets/{studio-tools-CriEbuhe.js → studio-tools-BaimbcRe.js} +1 -1
  165. package/dist/client/assets/{switch-WdVEpSZs.js → switch-5bdjLWcS.js} +1 -1
  166. package/dist/client/assets/{table-BdEjbwTN.js → table-m4VurkE4.js} +1 -1
  167. package/dist/client/assets/{tabs-DZSihvKg.js → tabs-7O9mSdEa.js} +1 -1
  168. package/dist/client/assets/{textarea-V-766O0J.js → textarea-DTygx-PF.js} +1 -1
  169. package/dist/client/assets/{toggle-group-RmMGMsDJ.js → toggle-group-CArvNNKC.js} +1 -1
  170. package/dist/client/assets/{toolbar-DxtPg69R.js → toolbar-Cap3B0tq.js} +1 -1
  171. package/dist/client/assets/{toolbar-icon-button--wX_LjdB.js → toolbar-icon-button-j_UeiHvv.js} +1 -1
  172. package/dist/client/assets/{tools-list-CPFFi_WG.js → tools-list-S4uoHI5a.js} +1 -1
  173. package/dist/client/assets/{tooltip-7ceFKwvg.js → tooltip-1foZ_k7s.js} +1 -1
  174. package/dist/client/assets/{types-DjLIkNtU.js → types-DI-1sdV1.js} +1 -1
  175. package/dist/client/assets/{use-ai-providers-DCCncCVR.js → use-ai-providers-CLhyvTsV.js} +1 -1
  176. package/dist/client/assets/{use-automations-CMd5Blai.js → use-automations-DI4zmIKR.js} +1 -1
  177. package/dist/client/assets/{use-capability-DNTULkT-.js → use-capability-BDb9Fsiz.js} +1 -1
  178. package/dist/client/assets/{use-clock-tick-CjDgXpmT.js → use-clock-tick-BVVBiunA.js} +1 -1
  179. package/dist/client/assets/{use-collections-DU8STQQS.js → use-collections-zePUbAs4.js} +1 -1
  180. package/dist/client/assets/{use-connection-B1t5awrd.js → use-connection-BibmCEFD.js} +1 -1
  181. package/dist/client/assets/{use-copy-B_A-Hyja.js → use-copy-DSFHRfjF.js} +1 -1
  182. package/dist/client/assets/{use-create-virtual-mcp-By8pLcBF.js → use-create-virtual-mcp-BiykOxhR.js} +1 -1
  183. package/dist/client/assets/{use-debounced-autosave-CbMzVovX.js → use-debounced-autosave-DcfXuKw9.js} +1 -1
  184. package/dist/client/assets/{use-debounced-value-aUceRR5E.js → use-debounced-value-CrZFsUmt.js} +1 -1
  185. package/dist/client/assets/{use-decopilot-events-Qaek_0wx.js → use-decopilot-events-BPApfysb.js} +1 -1
  186. package/dist/client/assets/{use-delete-connection-BvtQo2as.js → use-delete-connection-D87N3EAi.js} +1 -1
  187. package/dist/client/assets/{use-file-configs-C_LoJxeM.js → use-file-configs-uzLbxssm.js} +1 -1
  188. package/dist/client/assets/{use-infinite-scroll-DjmtIC5I.js → use-infinite-scroll-BmH_7PeD.js} +1 -1
  189. package/dist/client/assets/{use-join-requests-DFzSk106.js → use-join-requests-DEIhG119.js} +1 -1
  190. package/dist/client/assets/{use-mcp-client-DnG6uOC-.js → use-mcp-client-DbUnPC2U.js} +1 -1
  191. package/dist/client/assets/{use-mcp-prompts-BrXWzjJw.js → use-mcp-prompts-D4BjUd_Q.js} +1 -1
  192. package/dist/client/assets/{use-mcp-tools-0UGFFGDs.js → use-mcp-tools-aSGZtgAI.js} +1 -1
  193. package/dist/client/assets/{use-members-B9iAjbTR.js → use-members-Buz_D9kT.js} +1 -1
  194. package/dist/client/assets/{use-mobile-poskAeeK.js → use-mobile-B-H7VJlh.js} +1 -1
  195. package/dist/client/assets/{use-navigate-to-agent-ApWA-BYi.js → use-navigate-to-agent-_WYF41V-.js} +1 -1
  196. package/dist/client/assets/{use-org-auth-client-D3_b7CJu.js → use-org-auth-client-Dr5MvmUs.js} +1 -1
  197. package/dist/client/assets/{use-org-sso-CnQUNeLO.js → use-org-sso-BV4x4p-5.js} +1 -1
  198. package/dist/client/assets/{use-organization-roles-Ddtsbw3o.js → use-organization-roles-CqDIe-bv.js} +1 -1
  199. package/dist/client/assets/{use-organization-settings-Bay7q9sp.js → use-organization-settings-CsH8Ep36.js} +1 -1
  200. package/dist/client/assets/{use-registry-connections-BdnwTMCo.js → use-registry-connections-C948P_nl.js} +1 -1
  201. package/dist/client/assets/{use-secrets-DGc2Xwuj.js → use-secrets-B8xSCB_X.js} +1 -1
  202. package/dist/client/assets/{use-status-sounds-DImuK4_r.js → use-status-sounds-CtrLXRrg.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-Y567I08u.js → use-view-mode-CpRSxfa9.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-Ct78Y3I2.js → use-virtual-mcp-CjUwVbqH.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-DWB8a2J-.js +1 -0
  206. package/dist/client/assets/useSuspenseInfiniteQuery-Ip6E6dwx.js +1 -0
  207. package/dist/client/assets/{variant-calendar-CiKgUgSm.js → variant-calendar-DYAW4a46.js} +1 -1
  208. package/dist/client/assets/{view-mode-toggle-Q4VkZqK3.js → view-mode-toggle-IUxgH98b.js} +1 -1
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/cli.js +1 -1
  211. package/dist/server/server.js +1 -1
  212. package/package.json +1 -1
  213. package/dist/client/assets/Loading02-CgQpQof2.js +0 -1
  214. package/dist/client/assets/agent-icon-DtI10ZWs.js +0 -1
  215. package/dist/client/assets/category-editor-DWCneAkn.js +0 -1
  216. package/dist/client/assets/index-BXD26Hrq.js +0 -1
  217. package/dist/client/assets/index-CJ8_7qzi.css +0 -1
  218. package/dist/client/assets/page-seo-sheet-N1ivY8_M.js +0 -1
  219. package/dist/client/assets/project-app-view-DJyIqkUC.js +0 -1
  220. package/dist/client/assets/record-editor-_9nBSI_p.js +0 -1
  221. package/dist/client/assets/registry-BRIhs7Dd.js +0 -2
  222. package/dist/client/assets/store-registry-IsPbQEFr.js +0 -2
  223. package/dist/client/assets/useInfiniteQuery-C2zDK9Ja.js +0 -1
  224. package/dist/client/assets/useSuspenseInfiniteQuery-BfIIfaJ9.js +0 -1
@@ -1,4 +1,4 @@
1
- import{df as _t,dg as St,be as R,H as c,dh as de,bk as Ve,br as Et,bd as It,aT as Tt,ab as O,aa as W,a8 as oe,G as _,bf as f,a$ as F,di as wt,dj as E,a9 as Mt,t as ge,c as Ee,r as Y,$ as At,j as Ot}from"./index-Tu7JB-s1.js";import{u as Ct}from"./use-mcp-client-DnG6uOC-.js";import{S as Rt}from"./constants-B72Xmt_K.js";import{d as Nt,D as xt}from"./decopilot-sse-pool-oALvpvFW.js";import{d as Pt}from"./delay-CnY5UFtP.js";import{e as Dt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Me;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Me||(Me={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Ae;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ae||(Ae={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var ze="vercel.ai.error",kt=Symbol.for(ze),Oe,Ce,Z=class Je extends(Ce=Error,Oe=kt,Ce){constructor({name:e,message:a,cause:r}){super(a),this[Oe]=!0,this.name=e,this.cause=r}static isInstance(e){return Je.hasMarker(e,ze)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var We="AI_InvalidArgumentError",qe=`vercel.ai.error.${We}`,Lt=Symbol.for(qe),Re,Ne,jt=class extends(Ne=Z,Re=Lt,Ne){constructor({message:t,cause:e,argument:a}){super({name:We,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,qe)}},He="AI_JSONParseError",Ge=`vercel.ai.error.${He}`,Zt=Symbol.for(Ge),xe,Pe,De=class extends(Pe=Z,xe=Zt,Pe){constructor({text:t,cause:e}){super({name:He,message:`JSON parsing failed: Text: ${t}.
1
+ import{df as _t,dg as St,be as R,H as c,dh as de,bk as Ve,br as Et,bd as It,aT as Tt,ab as O,aa as W,a8 as oe,G as _,bf as f,a$ as F,di as wt,dj as E,a9 as Mt,t as ge,c as Ee,r as Y,$ as At,j as Ot}from"./index-Dgf9uMoE.js";import{u as Ct}from"./use-mcp-client-DbUnPC2U.js";import{S as Rt}from"./constants-B72Xmt_K.js";import{d as Nt,D as xt}from"./decopilot-sse-pool-B14erbbw.js";import{d as Pt}from"./delay-CnY5UFtP.js";import{e as Dt}from"./backoff-CrEUbyZT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var Me;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Me||(Me={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(n[u]=n[u]||{_errors:[]},n[u]._errors.push(a(i))):n[u]=n[u]||{_errors:[]},n=n[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Ae;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ae||(Ae={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));var ze="vercel.ai.error",kt=Symbol.for(ze),Oe,Ce,Z=class Je extends(Ce=Error,Oe=kt,Ce){constructor({name:e,message:a,cause:r}){super(a),this[Oe]=!0,this.name=e,this.cause=r}static isInstance(e){return Je.hasMarker(e,ze)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var We="AI_InvalidArgumentError",qe=`vercel.ai.error.${We}`,Lt=Symbol.for(qe),Re,Ne,jt=class extends(Ne=Z,Re=Lt,Ne){constructor({message:t,cause:e,argument:a}){super({name:We,message:t,cause:e}),this[Re]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,qe)}},He="AI_JSONParseError",Ge=`vercel.ai.error.${He}`,Zt=Symbol.for(Ge),xe,Pe,De=class extends(Pe=Z,xe=Zt,Pe){constructor({text:t,cause:e}){super({name:He,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Ye(e)}`,cause:e}),this[xe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Ge)}},Xe="AI_TypeValidationError",Qe=`vercel.ai.error.${Xe}`,$t=Symbol.for(Qe),ke,Le,X=class ve extends(Le=Z,ke=$t,Le){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:Xe,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Ye(a)}`,cause:a}),this[ke]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,Qe)}static wrap({value:e,cause:a,context:r}){var s,o,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new jt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Ut=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Ft=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function je(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ut.test(t)===!1&&Ft.test(t)===!1?e:Bt(e)}function Bt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function Vt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return je(t)}try{return je(t)}finally{Error.stackTraceLimit=e}}function Ie(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=z(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(z):z(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(z)),t.allOf!=null&&(t.allOf=t.allOf.map(z)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(z));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=z(e[a]);return t}function z(t){return typeof t=="boolean"?t:Ie(t)}var zt=Symbol("Let zodToJsonSchema decide on which parser to use"),Ze={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Jt=t=>typeof t=="string"?{...Ze,name:t}:{...Ze,...t};function N(){return{}}function Yt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(o.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Wt(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function qt(){return{type:"boolean"}}function Ke(t,e){return b(t.type._def,e)}var Ht=(t,e)=>b(t.innerType._def,e);function et(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>et(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Gt(t)}}var Gt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Xt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function Qt(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function Kt(t){return{type:"string",enum:Array.from(t.values)}}var ea=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function ta(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ea(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function aa(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function tt(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?sa(t):t}var ra=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sa(t){let e="";for(let a=0;a<t.length;a++)ra.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:$e(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=$e(e,r)}function $e(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,p=!1;for(let u=0;u<s.length;u++){if(i){o+=s[u],i=!1;continue}if(r.i){if(n){if(s[u].match(/[a-z]/)){p?(o+=s[u],o+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(o+=s[u],p=!0):o+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){o+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){o+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[u]==="$"){o+=`($|(?=[\r
@@ -1 +1 @@
1
- import{c as $,j as s,Y as He,r as L,l as E,M as oe,Z as bs,_ as js,a as ae,$ as se,b as xe,a0 as vs,a1 as ys,t as re,a2 as Ss,a3 as Ns,K as _s,k as Cs,a4 as ws,i as Lt,e as lt,u as rt,P as Rt,G as ks,H as As,I as Is,J as zs,d as $s,B as Je,a5 as Ts,T as Ms,U as Os,a6 as Ps,X as Ds,a7 as Fs}from"./index-Tu7JB-s1.js";import{u as pe,S as ot,a as at,b as ce,c as J,d as K,e as Bt,f as Ht,g as Es,h as Ls,i as Ze,j as Rs,k as Bs,l as Hs}from"./sidebar-CfrgTfPQ.js";import{u as ct}from"./use-mobile-poskAeeK.js";import{S as te}from"./skeleton-CgzDET-q.js";import{i as Gt}from"./LayoutLeft-DkeZ-wGU.js";import{T as ve}from"./toolbar-icon-button--wX_LjdB.js";import{P as Ge,a as ze,b as Ue}from"./popover-BKluFkmH.js";import{D as Ut,a as Wt,b as qt}from"./drawer-AnMvpdV8.js";import{A as Le}from"./avatar-onqhUIhg.js";import{a as de,b as me,c as et,T as ue}from"./tooltip-7ceFKwvg.js";import{a as gt}from"./Copy01-DAQFba68.js";import{n as Gs,i as Us}from"./Globe01-CFG_HzdE.js";import{i as Ws}from"./ZoomOut-aPkj7Qlz.js";import{i as qs,a as Ks}from"./ZapSquare-DMcGWFjD.js";import{i as tt}from"./Monitor01-CMiM2oxz.js";import{n as Xs,a as Vs}from"./Sun-CGc_p-DL.js";import{a as dt}from"./Settings02-BD_qWlxL.js";import{i as Ys}from"./Shield01-BWB7DMXT.js";import{a as Qs}from"./Users03-C6Jg6hMj.js";import{b as bt,c as jt,d as Js,e as Zs,A as ye,f as vt,i as en,s as tn,g as sn}from"./agent-icon-DtI10ZWs.js";import"./index-_T6qHiXV.js";import{I as nn}from"./invite-member-dialog-C9P0fOu8.js";import{u as ln,A as rn,g as on,a as an,b as Kt}from"./agent-capabilities-_vj6A7OP.js";import{u as cn,v as dn,C as yt}from"./connect-desktop-dialog-CtfSCLJo.js";import{i as mn}from"./FilterLines-DzCYlHOw.js";import{T as un,a as fn}from"./toggle-group-RmMGMsDJ.js";import{u as hn}from"./use-mcp-client-DnG6uOC-.js";import{S as xn,a as Re,i as pn,b as gn}from"./constants-B72Xmt_K.js";import{u as mt,a as Xt}from"./use-virtual-mcp-Ct78Y3I2.js";import{u as bn,a as ut,b as Vt,T as jn}from"./hooks-h8pftJyw.js";import{u as ft,r as vn}from"./shell-layout-BUjt1pfT.js";import{c as yn,a as Sn,b as Nn,d as _n,e as Cn}from"./dialog-CdQ9BYgU.js";import{C as wn,a as kn,b as An,c as In,d as zn}from"./command-CpEhzPdP.js";import{u as Yt}from"./studio-tools-CriEbuhe.js";import{i as Qt}from"./Zap-CMr5_5zL.js";import{S as Jt,M as $n}from"./shell-controls-CrjfiCAj.js";import{n as Tn}from"./Stars02-Drr3hQR7.js";import{g as Mn,u as On,S as Pn}from"./use-clock-tick-CjDgXpmT.js";import{f as Dn}from"./format-time-Cy7tTmZp.js";import{t as ht}from"./ChevronDown-tAtL2zbj.js";import{i as Fn}from"./ChevronRight-v0xGbrLn.js";import{S as Zt,u as En,g as Ln,a as Rn,b as Bn}from"./use-navigate-to-agent-ApWA-BYi.js";import{S as Hn,C as Gn}from"./chat-context-BFcW1WlF.js";import{B as St,a as Un,b as Wn}from"./breadcrumb-DCQF8-Cq.js";import{i as es}from"./Check-CAd1bC9m.js";import{s as $e}from"./Plus-Bs0jgtjM.js";import{i as ts}from"./SearchMd-DZb2QdDj.js";import{s as qn}from"./XClose-D8xbZO7h.js";import{A as Kn,a as Xn,b as Vn,c as Yn,d as Qn,e as Jn,f as Zn}from"./alert-dialog-BYZK7MmP.js";import{F as ei,a as ti,b as si,c as ni,d as ii,f as li,e as ri}from"./form-Cwl2xW04.js";import{I as oi}from"./input-26jR_LS5.js";import{G as ai,a as ci}from"./github-repo-picker-BNqa7U_T.js";import{f as di}from"./reusable-new-chat-CouMjkYR.js";import{T as Q}from"./toolbar-DxtPg69R.js";import{u as mi}from"./use-organization-settings-Bay7q9sp.js";import"./X-BR6yV48A.js";import"./User01-Bu3qeanf.js";import"./AlertCircle-BsDS7jNj.js";import"./Tool01-D3DG8-dG.js";import"./SwitchHorizontal01-DJrb6Lvg.js";import"./XCircle-Tdmnaiof.js";import"./ArrowUpRight-Bc3CxS8W.js";import"./Loading02-CgQpQof2.js";import"./CheckCircle-Cdg1p5fM.js";import"./ChevronUp-DC-9hom0.js";import"./Circle-DjdanfT5.js";import"./DotsVertical-CuQyuHWG.js";import"./Eye-BN-QaERw.js";import"./Star01-B8SKXby3.js";import"./Globe04-BEzAuler.js";import"./HardDrive-BYAloD_C.js";import"./Key01-Zc6SBg99.js";import"./LinkExternal01-CqKEOrqN.js";import"./List-Bup1f1MX.js";import"./Palette-BOEGfQ2j.js";import"./Play-DvxsNXOr.js";import"./SearchLg-Dxmw6xZz.js";import"./Stars01-BBuA9YPy.js";import"./Trash01-Dy1oFJTP.js";import"./Upload01-TK_S5g8u.js";import"./Users01-B_Z4mpH4.js";import"./select-C2dlyl3o.js";import"./textarea-V-766O0J.js";import"./use-org-auth-client-D3_b7CJu.js";import"./use-organization-roles-Ddtsbw3o.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DPq0g_d1.js";import"./use-registry-connections-BdnwTMCo.js";import"./use-connection-B1t5awrd.js";import"./use-collections-DU8STQQS.js";import"./useInfiniteQuery-C2zDK9Ja.js";import"./use-infinite-scroll-DjmtIC5I.js";import"./extract-connection-data-Cbb-bMdr.js";import"./card-Dv-mQmP7.js";import"./integration-icon-CeIwSY6g.js";import"./collection-search-BhAEPd5p.js";import"./collection-tabs-DVYhngM2.js";import"./badge-CBYAg42N.js";import"./connection-form-helpers-CW10Qgyt.js";import"./authenticate-and-persist-oauth-BcJO_SKj.js";import"./mcp-oauth-DQDx9fRY.js";import"./auth-CbWvobXA.js";import"./useSuspenseInfiniteQuery-BfIIfaJ9.js";import"./use-ai-providers-DCCncCVR.js";import"./decopilot-sse-pool-oALvpvFW.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-BweWSRt1.js";import"./autosend-DkKJN73F.js";import"./tab-id-bb-jjgGv.js";import"./use-org-sso-CnQUNeLO.js";import"./index-F9wo0Qyl.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-Qaek_0wx.js";import"./label-BYCB_C-p.js";import"./use-debounced-value-aUceRR5E.js";import"./use-mcp-tools-0UGFFGDs.js";import"./github-installations-D2vHSx02.js";function ui(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let a,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={left:"var(--sidebar-width)"},o=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]=a,e[1]=o):(a=e[0],o=e[1]);let d;return e[2]!==l||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:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:a,children:o}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const xt=240,fi=400,hi="sidebar.width";function Te(t){return Math.max(xt,Math.min(fi,t))}function xi(){const t=$.c(11),[e,n]=He(hi,pi),l=L.useRef(null);let i;t[0]!==n||t[1]!==e?(i=m=>{m.preventDefault();const u=m.clientX,f=Te(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of g)p.style.transition="none";const j=p=>{const b=Te(f+(p.clientX-u));h?.style.setProperty("--sidebar-width",`${b}px`)},x=p=>{const b=Te(f+(p.clientX-u));n(b);for(const y of g)y.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",x)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let a;t[3]!==n?(a=()=>{n(xt)},t[3]=n,t[4]=a):a=t[4];const o=a;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==r||t[8]!==o||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:r,resetWidth:o},t[7]=r,t[8]=o,t[9]=d,t[10]=c):c=t[10],c}function pi(t){return typeof t=="number"?Te(t):xt}function ss(){return[]}function ns(t){const e=$.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(ot,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(at,{children:s.jsx(ce,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function is(t){const e=$.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{oe("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const a=r,o=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=E(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]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=a,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(K,{className:c,children:u},o),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function gi(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Bt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(ji),e[2]=n.group.items,e[3]=r):r=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=a):a=e[7],a}case"items":{let l;e[8]!==n.items?(l=n.items.map(bi),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function bi(t){return s.jsx(is,{item:t},t.key)}function ji(t){return s.jsx(is,{item:t},t.key)}function vi(t){const e=$.c(14),{sections:n,footer:l,additionalContent:i,variant:r,contentClassName:a}=t,o=r===void 0?"sidebar":r;let d;e[0]!==a?(d=E("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(yi),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==i?(m=i&&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:i}),e[4]=i,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Ht,{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]!==l||e[11]!==u||e[12]!==o?(f=s.jsxs(Es,{variant:o,children:[u,l]}),e[10]=l,e[11]=u,e[12]=o,e[13]=f):f=e[13],f}function yi(t,e){return s.jsx(gi,{section:t},e)}function ls(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(vi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ls.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(te,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Si(t){const e=$.c(16),{onToggle:n,className:l}=t,r=bs().logo??js,a=typeof r=="string"?r:r.light,o=typeof r=="string"?r:r.dark;let d;e[0]!==l?(d=E("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",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==a?(c=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=a,e[3]=c):c=e[3];let m;e[4]!==o?(m=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=o,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(Gt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let g;return e[12]!==d||e[13]!==u||e[14]!==h?(g=s.jsxs(Ls,{className:d,children:[u,h]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15],g}function Nt(t){const e=$.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=E(i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n||e[3]!==l?(a=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=a):a=e[4];let o;e[5]!==n.icon?(o=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=o):o=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]!==a||e[12]!==o||e[13]!==d?(c=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[o,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=o,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==r||e[16]!==c?(m=s.jsx(K,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=m):m=e[17],m}function Ni(t){const e=$.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{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 a;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(Nt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],a=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=a}else a=e[4];let o;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(o=s.jsx(ns,{label:i,defaultExpanded:r,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=o):o=e[10],o}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let a;e[14]!==l?(a=o=>s.jsx(Nt,{item:o,onClose:l},o.key),e[14]=l,e[15]=a):a=e[15],i=n.items.map(a),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function _i(t){const e=$.c(17),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=a):a=e[0];let o;e[1]!==l?(o=s.jsx(L.Suspense,{fallback:a,children:s.jsx(Si,{onToggle:l})}),e[1]=l,e[2]=o):o=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(h,g)=>s.jsx(Ni,{section:h,onClose:l},g),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==r?(c=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[8]=r,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Ht,{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]!==i||e[14]!==o||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[o,m,i]}),e[13]=i,e[14]=o,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:l}=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]!==l||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:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let i;e[11]!==n||e[12]!==l?(i=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=i):i=e[13];let r;e[14]!==n.icon?(r=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=r):r=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let o;return e[18]!==i||e[19]!==r||e[20]!==a?(o=s.jsxs("button",{type:"button",onClick:i,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:[r,a]}),e[18]=i,e[19]=r,e[20]=a,e[21]=o):o=e[21],o}function _t(t){const e=$.c(126),{user:n,userImage:l,menuItems:i,signOutItem:r,themeOptions:a,preferences:o,setPreferences:d,close:c,isMobile:m}=t;if(m){const U=n?.name??"U";let W;e[0]!==U||e[1]!==l?(W=s.jsx(Le,{url:l,fallback:U,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=U,e[1]=l,e[2]=W):W=e[2];const R=n?.name??"User";let Z;e[3]!==R?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:R}),e[3]=R,e[4]=Z):Z=e[4];const ge=n?.email;let ee;e[5]!==ge?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ge}),e[5]=ge,e[6]=ee):ee=e[6];let fe;e[7]!==Z||e[8]!==ee?(fe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,ee]}),e[7]=Z,e[8]=ee,e[9]=fe):fe=e[9];let be;e[10]!==n?(be=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ai)},e[10]=n,e[11]=be):be=e[11];let ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(gt,{size:14}),e[12]=ne):ne=e[12];let he;e[13]!==be?(he=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:be,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ne})}),e[13]=be,e[14]=he):he=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==he?(T=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[he,je]})}),e[16]=he,e[17]=T):T=e[17];let G;e[18]!==T||e[19]!==W||e[20]!==fe?(G=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,fe,T]}),e[18]=T,e[19]=W,e[20]=fe,e[21]=G):G=e[21];let V;if(e[22]!==c||e[23]!==i){let le;e[25]!==c?(le=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=le):le=e[26],V=i.map(le),e[22]=c,e[23]=i,e[24]=V}else V=e[24];let q;e[27]!==c||e[28]!==r?(q=s.jsx(De,{item:r,onClose:c}),e[27]=c,e[28]=r,e[29]=q):q=e[29];let ie;e[30]!==V||e[31]!==q?(ie=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:[V,q]})}),e[30]=V,e[31]=q,e[32]=ie):ie=e[32];let Se;if(e[33]!==o.theme||e[34]!==d||e[35]!==a){let le;e[37]!==o.theme||e[38]!==d?(le=Pe=>{const{value:Xe,icon:xs,label:ps}=Pe;return s.jsx("button",{type:"button","aria-label":ps,onClick:()=>d(gs=>({...gs,theme:Xe})),className:E("size-8 rounded-md flex items-center justify-center transition-colors",o.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:xs},Xe)},e[37]=o.theme,e[38]=d,e[39]=le):le=e[39],Se=a.map(le),e[33]=o.theme,e[34]=d,e[35]=a,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const qe=o.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(ki),e[42]=d,e[43]=_e):_e=e[43];const Ke=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ce;e[44]!==Ke?(Ce=E("size-8 rounded-md flex items-center justify-center transition-colors",Ke),e[44]=Ke,e[45]=Ce):Ce=e[45];let we;e[46]!==o.enableSounds?(we=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[46]=o.enableSounds,e[47]=we):we=e[47];let ke;e[48]!==qe||e[49]!==_e||e[50]!==Ce||e[51]!==we?(ke=s.jsx("button",{type:"button","aria-label":qe,onClick:_e,className:Ce,children:we}),e[48]=qe,e[49]=_e,e[50]=Ce,e[51]=we,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.49.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]!==Ne||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ae]}),e[56]=Ne,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==G||e[60]!==ie||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,ie,Ie]}),e[59]=G,e[60]=ie,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Le,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const h=n?.name??"User";let g;e[66]!==h?(g=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=g):g=e[67];const j=n?.email;let x;e[68]!==j?(x=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j}),e[68]=j,e[69]=x):x=e[69];let p;e[70]!==g||e[71]!==x?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,x]}),e[70]=g,e[71]=x,e[72]=p):p=e[72];let b;e[73]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wi)},e[73]=n,e[74]=b):b=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(gt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==b?(v=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=b,e[77]=v):v=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let C;e[79]!==v?(C=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[v,w]})}),e[79]=v,e[80]=C):C=e[80];let N;e[81]!==C||e[82]!==f||e[83]!==p?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,p,C]}),e[81]=C,e[82]=f,e[83]=p,e[84]=N):N=e[84];let S;if(e[85]!==c||e[86]!==i){let U;e[88]!==c?(U=W=>s.jsx(De,{item:W,onClose:c},W.key),e[88]=c,e[89]=U):U=e[89],S=i.map(U),e[85]=c,e[86]=i,e[87]=S}else S=e[87];let A;e[90]!==c||e[91]!==r?(A=s.jsx(De,{item:r,onClose:c}),e[90]=c,e[91]=r,e[92]=A):A=e[92];let k;e[93]!==S||e[94]!==A?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,A]}),e[93]=S,e[94]=A,e[95]=k):k=e[95];let z;if(e[96]!==o.theme||e[97]!==d||e[98]!==a){let U;e[100]!==o.theme||e[101]!==d?(U=W=>{const{value:R,icon:Z,label:ge}=W;return s.jsx("button",{type:"button","aria-label":ge,onClick:()=>d(ee=>({...ee,theme:R})),className:E("size-7 rounded-md flex items-center justify-center transition-colors",o.theme===R?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},R)},e[100]=o.theme,e[101]=d,e[102]=U):U=e[102],z=a.map(U),e[96]=o.theme,e[97]=d,e[98]=a,e[99]=z}else z=e[99];let _;e[103]!==z?(_=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=_):_=e[104];const I=o.enableSounds?"Disable sounds":"Enable sounds";let M;e[105]!==d?(M=()=>d(Ci),e[105]=d,e[106]=M):M=e[106];const H=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[107]!==H?(D=E("size-7 rounded-md flex items-center justify-center transition-colors",H),e[107]=H,e[108]=D):D=e[108];let P;e[109]!==o.enableSounds?(P=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[109]=o.enableSounds,e[110]=P):P=e[110];let O;e[111]!==I||e[112]!==M||e[113]!==D||e[114]!==P?(O=s.jsx("button",{type:"button","aria-label":I,onClick:M,className:D,children:P}),e[111]=I,e[112]=M,e[113]=D,e[114]=P,e[115]=O):O=e[115];let F;e[116]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.49.3"]}),e[116]=F):F=e[116];let B;e[117]!==O?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[O,F]}),e[117]=O,e[118]=B):B=e[118];let Y;e[119]!==_||e[120]!==B?(Y=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[_,B]}),e[119]=_,e[120]=B,e[121]=Y):Y=e[121];let X;return e[122]!==N||e[123]!==k||e[124]!==Y?(X=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,k,Y]})}),e[122]=N,e[123]=k,e[124]=Y,e[125]=X):X=e[125],X}function Ci(t){return{...t,enableSounds:!t.enableSounds}}function wi(){re.success("User ID copied")}function ki(t){return{...t,enableSounds:!t.enableSounds}}function Ai(){re.success("User ID copied")}function st(){const t=$.c(34),{data:e}=ae.useSession(),{org:n}=se(),l=xe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=vs(i)?.params.org,[o,d]=ys(),c=ct(),[m,u]=L.useState(!1),f=e?.user,h=f?.image;let g;t[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>u(!1),t[1]=g):g=t[1];const j=g;let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(dt,{size:16}),t[2]=x):x=t[2];let p;t[3]!==l||t[4]!==a?(p={key:"preferences",label:"Preferences",icon:x,onClick:()=>{l({to:"/$org/settings/profile",params:{org:a??""}})}},t[3]=l,t[4]=a,t[5]=p):p=t[5];let b;t[6]!==n||t[7]!==l?(b=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Gs,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=b):b=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(Ws,{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(Ys,{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(Ss,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"community",label:"Community",icon:s.jsx(Qs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=C):C=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Us,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let S;t[14]!==p||t[15]!==b?(S=[p,...b,y,v,w,C,N],t[14]=p,t[15]=b,t[16]=S):S=t[16];const A=S;let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k={key:"logout",label:"Sign out",icon:s.jsx(qs,{size:16}),onClick:zi},t[17]=k):k=t[17];const z=k;let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=_):_=t[18];let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I={value:"dark",icon:s.jsx(Vs,{size:14}),label:"Dark theme"},t[19]=I):I=t[19];let M;t[20]===Symbol.for("react.memo_cache_sentinel")?(M=[_,I,{value:"system",icon:s.jsx(tt,{size:14}),label:"System theme"}],t[20]=M):M=t[20];const H=M;let D;t[21]!==c||t[22]!==A||t[23]!==o||t[24]!==d||t[25]!==f||t[26]!==h?(D={user:f,userImage:h,menuItems:A,signOutItem:z,themeOptions:H,preferences:o,setPreferences:d,close:j,isMobile:c},t[21]=c,t[22]=A,t[23]=o,t[24]=d,t[25]=f,t[26]=h,t[27]=D):D=t[27];const P=D;let O;return t[28]!==c||t[29]!==m||t[30]!==P||t[31]!==f?.name||t[32]!==h?(O=s.jsx(s.Fragment,{children:c?s.jsxs(Ut,{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(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Wt,{className:"h-[80dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Account"}),s.jsx(_t,{...P})]})]}):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(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ue,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Ii,children:s.jsx(_t,{...P})})]})}),t[28]=c,t[29]=m,t[30]=P,t[31]=f?.name,t[32]=h,t[33]=O):O=t[33],O}function Ii(t){return t.preventDefault()}function zi(){oe("signed_out",{source:"account_popover"}),Ns(),ae.signOut()}function nt(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=cn(),[r,a]=L.useState(!1);let o,d;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=dn(i.capabilities);o=i.online?"Desktop linked":"Connect desktop",d=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.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]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d}else o=e[4],d=e[5];const c=d;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>a(!0),v=s.jsx(tt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let w;e[8]!==o?(w=s.jsx("span",{children:o}),e[8]=o,e[9]=w):w=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let N;e[12]!==o||e[13]!==w||e[14]!==C?(N=s.jsx(de,{asChild:!0,children:s.jsxs(J,{tooltip:o,onClick:y,children:[v,w,C]})}),e[12]=o,e[13]=w,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=s.jsx(me,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let A;e[18]!==N||e[19]!==S?(A=s.jsxs(ue,{children:[N,S]}),e[18]=N,e[19]=S,e[20]=A):A=e[20];let k;e[21]!==r?(k=s.jsx(yt,{open:r,onOpenChange:a}),e[21]=r,e[22]=k):k=e[22];let z;return e[23]!==k||e[24]!==A?(z=s.jsxs(s.Fragment,{children:[A,k]}),e[23]=k,e[24]=A,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[26]=m):m=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let g;e[30]!==u||e[31]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=g):g=e[32];let j;e[33]!==c?(j=s.jsx(me,{side:"bottom",children:c}),e[33]=c,e[34]=j):j=e[34];let x;e[35]!==g||e[36]!==j?(x=s.jsxs(ue,{children:[g,j]}),e[35]=g,e[36]=j,e[37]=x):x=e[37];let p;e[38]!==r?(p=s.jsx(yt,{open:r,onOpenChange:a}),e[38]=r,e[39]=p):p=e[39];let b;return e[40]!==p||e[41]!==x?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[40]=p,e[41]=x,e[42]=b):b=e[42],b}class $i 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 Ti(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Mi(){const t=$.c(17),e=xe(),{org:n}=se(),{hasDecoKey:l,balanceDollars:i}=ln();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let a;t[2]!==i?(a=E(i!=null&&Ti(i)),t[2]=i,t[3]=a):a=t[3];let o;t[4]!==e||t[5]!==n.slug?(o=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=o):o=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Js,{}),t[7]=d):d=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,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]!==r||t[13]!==a||t[14]!==o||t[15]!==m?(u=s.jsx(ce,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:r,className:a,onClick:o,children:[d,m]})})}),t[12]=r,t[13]=a,t[14]=o,t[15]=m,t[16]=u):u=t[16],u}function Ct(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($i,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(Mi,{})})}),t[0]=e):e=t[0],e}function wt(){const t=$.c(7),e=xe(),{org:n}=se();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(dt,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let a;return t[5]!==l?(a=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=a):a=t[6],a}function kt(){const t=$.c(4),[e,n]=L.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(nn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(Zs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ce,{className:"gap-0.5",children:[l,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Ks,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(rn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Oi(){const t=$.c(10),{state:e}=pe();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(kt,{}),c=s.jsx(Ct,{}),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(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(nt,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{children:s.jsx(wt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(Ze,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ce,{children:[m,u,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[4]=f):f=t[4],f}let l,i;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),i=s.jsx(Ct,{}),t[5]=l,t[6]=i):(l=t[5],i=t[6]);let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(nt,{variant:"full"})}),t[7]=r):r=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx(wt,{})}),t[8]=a):a=t[8];let o;return t[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(Ze,{className:"px-2 pb-3 gap-0.5",children:[l,i,s.jsxs(ce,{className:"gap-0.5",children:[r,a,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[9]=o):o=t[9],o}function Pi(){const t=$.c(8),e=xe(),{org:n}=se(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ce,{children:s.jsx(K,{children:s.jsx(st,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(dt,{className:"size-4"}),t[5]=a):a=t[5];let o;return t[6]!==r?(o=s.jsx(Ze,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:a})]})}),t[6]=r,t[7]=o):o=t[7],o}function At(t){const e=$.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,a]=L.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p=>{p&&a(p.scrollHeight>p.clientHeight+1)},e[0]=o):o=e[0];const d=o;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const b=p.currentTarget;a(b.scrollHeight-b.scrollTop>b.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=E("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let g;e[7]!==h?(g=E("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=g):g=e[8];let j;e[9]!==g?(j=s.jsx("div",{"aria-hidden":!0,className:g}),e[9]=g,e[10]=j):j=e[10];let x;return e[11]!==u||e[12]!==f||e[13]!==j?(x=s.jsxs("div",{className:u,children:[f,j]}),e[11]=u,e[12]=f,e[13]=j,e[14]=x):x=e[14],x}function Di(t){const e=$.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let a;e[0]!==r||e[1]!==n?(a=n?s.jsx(Fi,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2];let o;e[3]!==i?(o=i&&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(Qt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==o?(d=s.jsxs("div",{className:"relative shrink-0",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7],d}function Fi(t){const e=$.c(6),{virtualMcpId:n,size:l}=t,i=mt(n);if(!i){let o;return e[0]!==l?(o=s.jsx(ye,{icon:null,name:"?",size:l}),e[0]=l,e[1]=o):o=e[1],o}const r=i.icon??null;let a;return e[2]!==i.title||e[3]!==l||e[4]!==r?(a=s.jsx(ye,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=a):a=e[5],a}function It(t){const e=$.c(36),{open:n,onOpenChange:l}=t,[i,r]=L.useState(""),{org:a}=se(),{setTaskId:o}=ft(),d=Yt();let c,m,u;e[0]!==a.id||e[1]!==i?(u=i.trim(),m=Cs,c=_s.globalSearch(a.id,u),e[0]=a.id,e[1]=i,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 h;e[5]!==d||e[6]!==u?(h=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=h):h=e[7];let g;e[8]!==c||e[9]!==f||e[10]!==h?(g={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=g):g=e[11];const{data:j,isFetching:x}=m(g);let p;e[12]!==j?.items?(p=j?.items??[],e[12]=j?.items,e[13]=p):p=e[13];const b=p;let y;e[14]!==l?(y=I=>{I||r(""),l(I)},e[14]=l,e[15]=y):y=e[15];const v=y;let w;e[16]!==v||e[17]!==o?(w=I=>{v(!1),o(I.id,I.virtual_mcp_id??void 0)},e[16]=v,e[17]=o,e[18]=w):w=e[18];const C=w;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(yn,{className:"sr-only",children:[s.jsx(Sn,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let S;e[20]!==i?(S=s.jsx(An,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==C||e[23]!==x||e[24]!==b||e[25]!==u?(A=u?x&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(wn,{children:"No results."}):b.map(I=>I.type==="thread"?s.jsxs(kn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>C(I),className:"gap-2.5",children:[s.jsx(Di,{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]=C,e[23]=x,e[24]=b,e[25]=u,e[26]=A):A=e[26];let k;e[27]!==A?(k=s.jsx(In,{children:A}),e[27]=A,e[28]=k):k=e[28];let z;e[29]!==S||e[30]!==k?(z=s.jsxs(_n,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(zn,{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,k]})]}),e[29]=S,e[30]=k,e[31]=z):z=e[31];let _;return e[32]!==v||e[33]!==n||e[34]!==z?(_=s.jsx(Cn,{open:n,onOpenChange:v,children:z}),e[32]=v,e[33]=n,e[34]=z,e[35]=_):_=e[35],_}function Ei(t){return t==="ephemeral"||t.startsWith("thread:")}function rs(t){const e=$.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:a,showAgentIcon:o,hideStatusIdle:d,indented:c}=t,m=Mn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",h=mt(f?void 0:n.virtual_mcp_id);let g;e[0]!==h?(g=on(h),e[0]=h,e[1]=g):g=e[1];const j=g;On(6e4);const x=a||!!n.trigger_id,p=n.id,b="button",y=0;let v;e[2]!==i?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const w=c?"-ml-4 pl-6":"pl-2",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let N;e[4]!==w||e[5]!==C?(N=E("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",C),e[4]=w,e[5]=C,e[6]=N):N=e[6];let S;e[7]!==f||e[8]!==o||e[9]!==h?.icon||e[10]!==h?.title?(S=o&&!f&&s.jsx(ye,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=o,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let A;e[12]!==x?(A=x&&s.jsx(Qt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=x,e[13]=A):A=e[13];const k=n.title||"Untitled task";let z;e[14]!==k?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:k}),e[14]=k,e[15]=z):z=e[15];let _;e[16]!==A||e[17]!==z?(_=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,z]}),e[16]=A,e[17]=z,e[18]=_):_=e[18];let I;e[19]!==j||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(I=n.updated_at&&s.jsxs("div",{className:E("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ei(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):j?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[j.owner,"/",j.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Dn(new Date(n.updated_at))})]}),e[19]=j,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=I):I=e[23];let M;e[24]!==_||e[25]!==I?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[_,I]}),e[24]=_,e[25]=I,e[26]=M):M=e[26];const H="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",D=!d&&s.jsx("span",{className:E("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:E(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let P;e[27]!==r?(P=r&&s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:B=>{B.stopPropagation(),r()},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(ws,{size:14})})}),s.jsx(me,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=P):P=e[28];let O;e[29]!==D||e[30]!==P?(O=s.jsxs("div",{className:H,children:[D,P]}),e[29]=D,e[30]=P,e[31]=O):O=e[31];let F;return e[32]!==i||e[33]!==M||e[34]!==O||e[35]!==v||e[36]!==N||e[37]!==S||e[38]!==n.id?(F=s.jsxs("div",{"data-task-id":p,role:b,tabIndex:y,onClick:i,onKeyDown:v,className:N,children:[S,M,O]}),e[32]=i,e[33]=M,e[34]=O,e[35]=v,e[36]=N,e[37]=S,e[38]=n.id,e[39]=F):F=e[39],F}const zt=["requires_action","in_progress","failed","expired","completed"];function Li(t){const e=new Map(zt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return zt.map(n=>({status:n,threads:e.get(n)}))}const Ri="sidebar.group.expanded.";function Bi(t,e){const n=$.c(3),[l,i]=He(`${Ri}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=$.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let a;e[0]!==r?(a=E("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"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]=r,e[1]=a):a=e[1];let o;e[2]!==l?(o=l&&s.jsx(Lt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=o):o=e[3];const d=l?"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]!==l||e[7]!==n||e[8]!==a||e[9]!==o||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:a,children:[o,c]}),e[6]=l,e[7]=n,e[8]=a,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function Hi(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Gi(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Ee=0;const it=[];function Ui(){for(;Ee<as&&it.length>0;){const t=it.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const l=()=>{Ee++,t().then(e,n).finally(()=>{Ee--,Ui()})};Ee<as?l():it.push(l)})}const We=10;function $t(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const a={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return a.status=e,a}function Wi(t,e,n,l){let i=0;for(const r of t)ds(r,e,n,l)&&i++;return i}function Ve(t,e,n,l){return Wi(t,e,n,l)}function qi(t,e){return!!(t>=We||t===0&&e)}function Tt(t,e){return t<e}function Ki(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Be=new Map,Fe=new Map;function Xi(t,e){return e?t>=We?!0:null:!1}function Mt(t){return Be.get(t)}function Vi(t,e){Be.set(t,e)}function Yi(t,e,n){const l=Be.get(t);if(l!==void 0){n(l);return}let i=Fe.get(t);i||(i=cs(e).then(r=>(Be.set(t,r),Fe.delete(t),r)).catch(()=>(Fe.delete(t),Promise.reject(new Error("group probe failed")))),Fe.set(t,i)),i.then(n,()=>n(!1))}function Ot(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===We,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Qi(t,e,n,l,i){let r=0;for(const a of t)e.has(a.id)||ds(a,n,l,i)&&r++;return r}function Ji(t,e,n,l){const i=$.c(8),{org:r}=se(),a=Hi(r.id,t,e,n);let o;i[0]!==n?(o=Gi(n),i[0]=n,i[1]=o):o=i[1];const d=o,[c,m]=L.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==a&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const u=bn(),{threads:f,hasMore:h}=ut(),g=Ve(f,t,e,n),j=qi(g,h),x=Xi(g,h),p=Yt();if(c.identity===a&&c.serverHasMore===null){const N=x??Mt(a);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===a&&c.serverHasMore===null&&x===null&&Mt(a)===void 0&&c.probeSubscribedIdentity!==a&&(m(N=>N.identity===a?{...N,isProbing:!0,probeSubscribedIdentity:a}:N),Yi(a,async()=>{const N=$t(t,e,0,n,1),S=await p.call("COLLECTION_THREADS_LIST",N),{totalCount:A}=Ot(S),k=Ve(u.threads.get(),t,e,n);return A===void 0?!1:Tt(k,A)},N=>{m(S=>S.identity!==a?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=a;m(A=>A.identity===S?{...A,isFetching:!0}:A);try{const A=Ve(f,t,e,n),k=$t(t,e,A,n,We),z=await cs(()=>p.call("COLLECTION_THREADS_LIST",k)),{items:_,hasMore:I,totalCount:M}=Ot(z),H=new Set(f.map(Zi)),D=Qi(_,H,t,e,n),P=A;u.mergeThreads(_),m(O=>{if(O.identity!==S)return O;let F;return M!==void 0?F=Tt(P+D,M):F=_.length===0||D===0?!1:I,Vi(S,F),{...O,isFetching:!1,serverHasMore:F}})}catch(A){const k=A,z=k instanceof Error?k.message:String(k);re.error(`Could not load more tasks: ${z}`),m(_=>_.identity===S?{..._,isFetching:!1}:_)}},v=c.isFetching||c.isProbing,w=!d&&!v&&Ki(j,c.serverHasMore);let C;return i[2]!==v||i[3]!==y||i[4]!==w||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:w,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=w,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function Zi(t){return t.id}function el(t){const e=$.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:h}=Ji("status",n,d),[g,j]=L.useState(!1);!g&&l.length===0&&h===!0&&!c&&!m&&(j(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==i||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==o||e[9]!==d||e[10]!==a||e[11]!==r?(y=v=>s.jsx(rs,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:o&&v.created_by===d.currentUserId?()=>a(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=o,e[9]=d,e[10]=a,e[11]=r,e[12]=y):y=e[12],x=l.map(y),e[0]=i,e[1]=o,e[2]=d,e[3]=a,e[4]=r,e[5]=l,e[6]=x}else x=e[6];let p;e[13]!==f||e[14]!==c||e[15]!==u?(p=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=p):p=e[16];let b;return e[17]!==x||e[18]!==p?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[17]=x,e[18]=p,e[19]=b):b=e[19],b}function tl(t){const e=$.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,c=Pn[n],m=c.icon,[u,f]=Bi(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const g=h;let j;e[3]!==g?(j=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),g())},e[3]=g,e[4]=j):j=e[4];let x;e[5]!==m||e[6]!==c.iconClassName?(x=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]=x):x=e[7];let p;e[8]!==u?(p=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(ht,{size:14}):s.jsx(Fn,{size:14})}),e[8]=u,e[9]=p):p=e[9];let b;e[10]!==x||e[11]!==p?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=b):b=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]!==l.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:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let w;e[17]!==u||e[18]!==g||e[19]!==j||e[20]!==b||e[21]!==y||e[22]!==v?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:j,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:[b,y,v]}),e[17]=u,e[18]=g,e[19]=j,e[20]=b,e[21]=y,e[22]=v,e[23]=w):w=e[23];let C;e[24]!==i||e[25]!==o||e[26]!==u||e[27]!==d||e[28]!==a||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(el,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d})}),e[24]=i,e[25]=o,e[26]=u,e[27]=d,e[28]=a,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==w||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,C]}),e[33]=w,e[34]=C,e[35]=N):N=e[35],N}function Pt(t){const e=$.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,filters:o,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Tn,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const p=u?"No threads match your filters":"No threads yet";let b;return e[1]!==p?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:p})]}),e[1]=p,e[2]=b):b=e[2],b}const f=n.length>1||d;if(l==="status"){let x;if(e[3]!==i||e[4]!==f||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==n){let b;e[10]!==i||e[11]!==f||e[12]!==o||e[13]!==a||e[14]!==r?(b=y=>s.jsx(tl,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:f,filters:o},y.status),e[10]=i,e[11]=f,e[12]=o,e[13]=a,e[14]=r,e[15]=b):b=e[15],x=Li(n).map(b),e[3]=i,e[4]=f,e[5]=o,e[6]=a,e[7]=r,e[8]=n,e[9]=x}else x=e[9];let p;return e[16]!==x?(p=s.jsx(s.Fragment,{children:x}),e[16]=x,e[17]=p):p=e[17],p}let h;if(e[18]!==i||e[19]!==f||e[20]!==o||e[21]!==a||e[22]!==r||e[23]!==n){let x;e[25]!==i||e[26]!==f||e[27]!==o||e[28]!==a||e[29]!==r?(x=p=>s.jsx(rs,{task:p,isActive:i===p.id,onClick:()=>r(p),onArchive:f&&p.created_by===o.currentUserId?()=>a(p):void 0,showAutomationBadge:!!p.trigger_id,showAgentIcon:!0},p.id),e[25]=i,e[26]=f,e[27]=o,e[28]=a,e[29]=r,e[30]=x):x=e[30],h=n.map(x),e[18]=i,e[19]=f,e[20]=o,e[21]=a,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let g;e[31]!==d||e[32]!==c||e[33]!==m?(g=(d||c)&&s.jsx(os,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=g):g=e[34];let j;return e[35]!==h||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[h,g]}),e[35]=h,e[36]=g,e[37]=j):j=e[37],j}function sl(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Dt(t){const e=$.c(17),{label:n,onClick:l,active:i,children:r}=t,[a,o]=L.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),c=()=>o(!1),m=()=>o(!0),u=()=>o(!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=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=E(f),e[4]=f,e[5]=h):h=e[5];let g;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=g):g=e[10];let j;e[11]!==n?(j=s.jsx(me,{side:"bottom",children:n}),e[11]=n,e[12]=j):j=e[12];let x;return e[13]!==a||e[14]!==g||e[15]!==j?(x=s.jsxs(ue,{open:a,children:[g,j]}),e[13]=a,e[14]=g,e[15]=j,e[16]=x):x=e[16],x}function Ye(t){const e=$.c(13),{label:n,value:l,onChange:i,options:r}=t;let a;e[0]!==n?(a=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==i?(o=u=>u&&i(u),e[2]=i,e[3]=o):o=e[3];let d;e[4]!==r?(d=r.map(nl),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==o||e[7]!==d||e[8]!==l?(c=s.jsx(fn,{type:"single",size:"sm",value:l,onValueChange:o,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=o,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==a||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[10]=a,e[11]=c,e[12]=m):m=e[12],m}function nl(t){return s.jsxs(un,{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 ms({onNavigate:t}={}){const{data:e}=ae.useSession(),n=e?.user?.id,{org:l}=se(),i=hn({connectionId:xn,orgId:l.id,orgSlug:l.slug}),r=Re(l.id).id,a=Xt(),{threads:o,hasMore:d,isFetchingMore:c,fetchNextPage:m}=ut(),u=o.filter(T=>!T.hidden),{hide:f}=Vt(),h=xe(),{setTaskId:g,createNewTask:j}=ft(),x=lt({strict:!1}),p=rt({strict:!1}),b=x.taskId??null,y=p.virtualmcpid??o.find(T=>T.id===b)?.virtual_mcp_id??null,v=()=>{t?.()},w=[...u].sort((T,G)=>(G.updated_at??"").localeCompare(T.updated_at??"")),[C,N]=L.useState("all"),[S,A]=L.useState("flat"),[k,z]=He("sidebar-threads-scope-all",!1),[_,I]=L.useState(!1),[M,H]=L.useState(!1),D={type:C,member:"mine",currentUserId:n??null},P=T=>n?T.filter(G=>G.created_by===n):[],O=T=>C==="automation"?T.filter(G=>!!G.trigger_id):C==="manual"?T.filter(G=>!G.trigger_id):T,F=P(w),B=O(F),Y=O(w),X=k?Y:B,U=T=>{if(n&&T.created_by&&T.created_by!==n)return;const G=T.id===b;if(f(T.id),!G)return;const V=sl(X,T.id,n);v(),V?g(V.id,V.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}})},W=T=>{v(),g(T.id,T.virtual_mcp_id)},R=async T=>{try{const G=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((G.structuredContent??G).items?.length??0)===0}catch{return!1}},Z=async()=>{const T=y??r;oe("sidebar_new_thread_clicked",{virtual_mcp_id:T});const G=F.find(V=>V.virtual_mcp_id===T&&V.title==="New chat");if(G&&await R(G.id)){v(),g(G.id,T);return}v(),j(T)},{state:ge,isMobile:ee,toggleSidebar:fe}=pe();if(ge==="collapsed"&&!ee){const T=Re(l.id),G=new Map((a??[]).map(q=>[q.id,q])),V=q=>(q?G.get(q):void 0)??(q===r?T:void 0);return s.jsxs(ce,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:fe,children:s.jsx(Gt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})}),X.map(q=>{const ie=V(q.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:q.title||"New chat",isActive:q.id===b,onClick:()=>W(q),children:s.jsx(ye,{icon:ie?.icon??null,name:ie?.title??"Agent",size:"2xs"})})},q.id)})]})}const ne=S!=="flat"||C!=="all"||k===!0,he=s.jsxs(Ge,{children:[s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ne,children:[s.jsx(mn,{size:16}),ne&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(me,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ue,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Ye,{label:"View",value:S,onChange:T=>{oe("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(Ye,{label:"Type",value:C,onChange:T=>{oe("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Ye,{label:"Scope",value:k?"team":"mine",onChange:T=>z(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(et,{delayDuration:300,children:s.jsxs("div",{className:E("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(Jt,{}),he]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Dt,{label:"Search threads",onClick:()=>{oe("tasks_panel_search_opened"),H(!0),I(!0)},children:s.jsx(en,{size:16})}),s.jsx(Dt,{label:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})]})]})});return ee?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(At,{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(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})}),M&&s.jsx(It,{open:_,onOpenChange:I})]}):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(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})})}),M&&s.jsx(It,{open:_,onOpenChange:I})]})}const il=5,ll=[{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 us(){const t=$.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:il}).map(al)}),t[0]=i):i=t[0],i}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(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"})]}),s.jsx(te,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=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:ll.map(rl)})]}),t[2]=l):l=t[2],l}function rl(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(te,{className:"size-5 rounded-full shrink-0"}),s.jsx(te,{className:E("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(ol)})]},e)}function ol(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(te,{className:"h-3 flex-1 rounded-sm"})},e)}function al(t,e){return s.jsx(te,{className:"size-10 rounded-lg mx-auto"},e)}function cl(){const t=$.c(4),e=ss();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Oi,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[1]=l):l=t[1];let i;return t[2]!==e?(i=s.jsx(Zt,{children:s.jsx(ls,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=i):i=t[3],i}function dl(t){const e=$.c(8),{onClose:n}=t,l=ss();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pi,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(us,{}),e[1]=r):r=e[1];let a;e[2]!==n?(a=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:r,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==l||e[6]!==a?(o=s.jsx(Zt,{children:s.jsx(_i,{sections:l,onClose:n,footer:i,additionalContent:a})}),e[4]=n,e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function fs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ml=ks({name:As().min(2,"Organization name is required")});function ul(t){const e=$.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Is(ml),defaultValues:{name:""}},e[0]=i):i=e[0];const r=zs(i);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:hl,onSuccess:fl},e[1]=a):a=e[1];const o=$s(a),d=o.error instanceof Error?o.error.message:o.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Vn,{children:[s.jsx(Yn,{children:"Create a new organization"}),s.jsx(Qn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==o||e[4]!==r){let N;e[6]!==o?(N=S=>o.mutateAsync(S),e[6]=o,e[7]=N):N=e[7],m=r.handleSubmit(N),e[3]=o,e[4]=r,e[5]=m}else m=e[5];let u;e[8]!==r.formState.isSubmitting?(u=N=>{const{field:S}=N;return s.jsxs(si,{children:[s.jsx(ni,{children:"Organization Name"}),s.jsx(ii,{children:s.jsx(oi,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(li,{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:"","/",fs(S.value)]})]}),s.jsx(ri,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(ei,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==d?(h=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=h):h=e[14];let g;e[15]!==o||e[16]!==r?(g=()=>{o.reset(),r.reset()},e[15]=o,e[16]=r,e[17]=g):g=e[17];let j;e[18]!==r.formState.isSubmitting||e[19]!==g?(j=s.jsx(Kn,{disabled:r.formState.isSubmitting,onClick:g,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=g,e[20]=j):j=e[20];const x=!r.formState.isValid||r.formState.isSubmitting;let p;e[21]!==r.formState.isSubmitting?(p=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Hn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=p):p=e[22];let b;e[23]!==x||e[24]!==p?(b=s.jsx(Je,{type:"submit",variant:"default",disabled:x,children:p}),e[23]=x,e[24]=p,e[25]=b):b=e[25];let y;e[26]!==b||e[27]!==j?(y=s.jsxs(Jn,{children:[j,b]}),e[26]=b,e[27]=j,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=h,e[33]=v):v=e[33];let w;e[34]!==r||e[35]!==v?(w=s.jsxs(Xn,{children:[c,s.jsx(ti,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=w):w=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==w?(C=s.jsx(Zn,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=C):C=e[40],C}function fl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function hl(t){const e=fs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ae.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function hs(){const t=L.useContext(Ts),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function xl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function pt(t){const e=$.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",a=i==="xs"?"text-[9px]":"text-xs";let o;e[0]!==r?(o=E(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=o):o=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:xl(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]!==a?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:E("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=c):c=e[8];let m;return e[9]!==o||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:o,style:d,children:c}),e[9]=o,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function pl({invitation:t,onChanged:e}){const[n,l]=L.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const d=await ae.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),l(!1);return}}catch{re.error("Failed to accept invitation"),l(!1);return}re.success(`Joined ${i}`),Os();let o;try{o=(await ae.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=o?`/${o}`:"/"},a=async()=>{l(!0);try{const o=await ae.organization.rejectInvitation({invitationId:t.id});if(o.error){re.error(o.error.message),l(!1);return}re.success("Invitation declined"),l(!1),e()}catch{re.error("Failed to decline invitation"),l(!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(pt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),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(Je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(qn,{size:14})})]})]})}function gl(t){const e=$.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Ms(),{invitations:a,refetch:o}=hs();let d;e[0]!==n?(d=(_,I)=>_.slug===n?-1:I.slug===n?1:_.name.localeCompare(I.name),e[0]=n,e[1]=d):d=e[1];const c=[...r??[]].sort(d),[m,u]=L.useState(""),f=m.toLowerCase(),h=f?c.filter(_=>_.name.toLowerCase().includes(f)||_.slug.toLowerCase().includes(f)):c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ts,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=_=>u(_.target.value),e[3]=j):j=e[3];let x;e[4]!==m?(x=_=>_.key==="Escape"&&m&&u(""),e[4]=m,e[5]=x):x=e[5];let p;e[6]!==m||e[7]!==x?(p=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:j,onKeyDown:x,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]=x,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($e,{size:16}),e[9]=b):b=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=i,e[11]=y):y=e[11];let v;e[12]!==p||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,p,y]}),e[12]=p,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 C;e[15]!==a||e[16]!==m||e[17]!==o?(C=!m&&a.map(_=>s.jsx(pl,{invitation:_,onChanged:o},_.id)),e[15]=a,e[16]=m,e[17]=o,e[18]=C):C=e[18];const N=h.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]!==l||e[20]!==n?(S=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(pt,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const A=h.map(S);let k;e[22]!==C||e[23]!==N||e[24]!==A?(k=s.jsxs("div",{className:w,children:[C,N,A]}),e[22]=C,e[23]=N,e[24]=A,e[25]=k):k=e[25];let z;return e[26]!==k||e[27]!==v?(z=s.jsxs(s.Fragment,{children:[v,k]}),e[26]=k,e[27]=v,e[28]=z):z=e[28],z}function bl(t){const e=$.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,a=i===void 0?"start":i,o=r===void 0?"bottom":r,d=xe(),[c,m]=L.useState(!1),[u,f]=L.useState(!1);let h;e[0]!==n?(h=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const g=String(c);let j;e[2]!==d?(j=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=j):j=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{m(!1),f(!0)},e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==g||e[7]!==j?(p=s.jsx(gl,{orgParam:l,onSelectOrg:j,onCreateOrg:x},g),e[5]=l,e[6]=g,e[7]=j,e[8]=p):p=e[8];let b;e[9]!==a||e[10]!==o||e[11]!==p?(b=s.jsx(Ue,{side:o,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:vl,onCloseAutoFocus:jl,children:p}),e[9]=a,e[10]=o,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c||e[14]!==h||e[15]!==b?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[h,b]}),e[13]=c,e[14]=h,e[15]=b,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(ul,{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 jl(t){return t.preventDefault()}function vl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function yl(t){const e=$.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:a,isSearching:o,disabled:d}=t,c=i===void 0?"Search...":i;let m;e[0]!==a?(m=E("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=E("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==o?(h=o?s.jsx(Lt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=o,e[5]=h):h=e[5];let g;e[6]!==l?(g=b=>l(b.target.value),e[6]=l,e[7]=g):g=e[7];let j;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==g||e[12]!==n?(j=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:r,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]=r,e[10]=c,e[11]=g,e[12]=n,e[13]=j):j=e[13];let x;e[14]!==f||e[15]!==h||e[16]!==j?(x=s.jsxs("label",{className:f,children:[h,j]}),e[14]=f,e[15]=h,e[16]=j,e[17]=x):x=e[17];let p;return e[18]!==m||e[19]!==x?(p=s.jsx("div",{className:m,children:x}),e[18]=m,e[19]=x,e[20]=p):p=e[20],p}const Sl="Select an existing agent";function Nl(t){const e=$.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(de,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(me,{side:"right",sideOffset:8,children:Sl}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(ue,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function _l(t){const e=xe(),{create:n}=Vt(),{locator:l}=se(),i=lt({strict:!1}),r=rt({strict:!1});return async a=>{const o=crypto.randomUUID(),d=a===r.virtualmcpid?vn(t,l,i.taskId??""):null;try{await n({id:o,virtual_mcp_id:a,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:o},search:{virtualmcpid:a}})}}function Qe(t){const e=$.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==n.icon||e[3]!==n.title?(o=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=o):o=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]!==l?(u=l&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:a,children:[o,m,u]}),e[14]=i,e[15]=a,e[16]=o,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=$.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function Cl(t){const e=$.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[a,o]=L.useState(""),d=Xt(),c=d??[],{org:m}=se(),{data:u}=ae.useSession(),f=u?.user?.id??"anon",h=Ln(d),g=Rn(),j=_l(m.slug),x=an(d),p=a.toLowerCase(),b=c.filter(Il).filter(R=>!x.has(R.id)).filter(Al).filter(R=>!a||R.title.toLowerCase().includes(p)),y=b.filter(kl),v=b.filter(wl),w=Re(m.id),C=!a||w.title.toLowerCase().includes(p),N=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const A=S,k=R=>{if(l){l(R.id),n(),o("");return}Bn({orgId:m.id,userId:f},R.id,h),g(),n(),o(""),j(R.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==a?(_=s.jsx(yl,{value:a,onChange:o,placeholder:"Search agents..."}),e[3]=a,e[4]=_):_=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&C&&w&&s.jsx(Qe,{agent:w,selected:!i||i===w.id,onClick:A}),H=v.length>0&&s.jsx(Ft,{children:"Agents"}),D=v.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id)),P=(y.length>0||!a)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(ci,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),O=y.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id));let F;e[5]!==N||e[6]!==a||e[7]!==b.length?(F=b.length===0&&!N&&a&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=N,e[6]=a,e[7]=b.length,e[8]=F):F=e[8];let B;e[9]!==F||e[10]!==M||e[11]!==H||e[12]!==D||e[13]!==P||e[14]!==O?(B=s.jsxs("div",{className:I,children:[M,H,D,P,O,F]}),e[9]=F,e[10]=M,e[11]=H,e[12]=D,e[13]=P,e[14]=O,e[15]=B):B=e[15];let Y;e[16]!==m.slug?(Y={org:m.slug},e[16]=m.slug,e[17]=Y):Y=e[17];let X;e[18]!==n?(X=()=>n(),e[18]=n,e[19]=X):X=e[19];let U;e[20]!==Y||e[21]!==X?(U=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ps,{to:"/$org/settings/agents",params:Y,onClick:X,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=Y,e[21]=X,e[22]=U):U=e[22];let W;return e[23]!==B||e[24]!==U||e[25]!==_?(W=s.jsxs("div",{className:z,children:[_,B,U]}),e[23]=B,e[24]=U,e[25]=_,e[26]=W):W=e[26],W}function wl(t){return!Kt(t.metadata)}function kl(t){return Kt(t.metadata)}function Al(t){return!gn(t.id)}function Il(t){return!pn(t.id)}function zl(t){const e=$.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:a,side:o,align:d}=n,c=l===void 0?!1:l,m=o===void 0?"right":o,u=d===void 0?"start":d,[f,h]=L.useState(!1),[g,j]=L.useState(!1),x=ct(),{setOpenMobile:p}=pe(),b=En(),y=b?"border border-border":void 0;let v;e[2]!==b?(v=H=>b?s.jsx(Nl,{children:H}):H,e[2]=b,e[3]=v):v=e[3];const w=v;let C;e[4]!==x||e[5]!==p?(C=()=>{h(!1),x&&p(!1)},e[4]=x,e[5]=p,e[6]=C):C=e[6];const N=C;let S;e[7]!==N?(S=()=>{N(),j(!0)},e[7]=N,e[8]=S):S=e[8];const A=S;let k;e[9]!==N||e[10]!==A||e[11]!==r||e[12]!==f||e[13]!==a?(k=f&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(te,{className:"h-4 w-24"})}),children:s.jsx(Cl,{onClose:N,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:A})}),e[9]=N,e[10]=A,e[11]=r,e[12]=f,e[13]=a,e[14]=k):k=e[14];const z=k;let _;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==b||e[19]!==x||e[20]!==f||e[21]!==z||e[22]!==m||e[23]!==i||e[24]!==w?(_=x?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?w(s.jsx(ve,{"aria-label":"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:w(s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ut,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Wt,{className:"max-h-[85dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ge,{open:f,onOpenChange:H=>{H&&!f&&oe("agent_browser_opened",{surface:"desktop_popover"}),h(H)},children:[i?s.jsx(ze,{asChild:!0,children:i}):c?w(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:E(y),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:w(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ue,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=b,e[19]=x,e[20]=f,e[21]=z,e[22]=m,e[23]=i,e[24]=w,e[25]=_):_=e[25];let I;e[26]!==g?(I=s.jsx(ai,{open:g,onOpenChange:j,mode:"agent"}),e[26]=g,e[27]=I):I=e[27];let M;return e[28]!==I||e[29]!==_?(M=s.jsxs(s.Fragment,{children:[_,I]}),e[28]=I,e[29]=_,e[30]=M):M=e[30],M}const $l="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 Tl(t){const e=$.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,a=mt(n)??l??null,o=a?.title??"Super Agent",d=`Open ${o} home`,c=a?.icon??null;let m;e[0]!==c||e[1]!==o?(m=s.jsx(ye,{icon:c,name:o,size:"xs"}),e[0]=c,e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:i,"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]=i,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==o?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let g;e[10]!==f?(g=s.jsxs("button",{type:"button",className:$l,children:[f,h]}),e[10]=f,e[11]=g):g=e[11];let j;e[12]!==n||e[13]!==r||e[14]!==g?(j=s.jsx(zl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:g}),e[12]=n,e[13]=r,e[14]=g,e[15]=j):j=e[15];let x;return e[16]!==u||e[17]!==j?(x=s.jsxs("div",{className:"flex items-center gap-1",children:[u,j]}),e[16]=u,e[17]=j,e[18]=x):x=e[18],x}function Et(){const t=$.c(44),{org:e}=se(),{state:n,isMobile:l}=pe(),i=xe();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const a=lt(r);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[1]=o):o=t[1];const d=rt(o),{threads:c}=ut(),{data:m}=ae.useSession(),{setTaskId:u,createNewTask:f}=ft(),h=hs().invitations.length>0,g=n==="collapsed"||l;let j;t[2]!==e.id?(j=Re(e.id),t[2]=e.id,t[3]=j):j=t[3];const x=j,p=x.id,b=a.taskId?d.virtualmcpid??p:p;let y;t[4]!==f||t[5]!==p||t[6]!==i||t[7]!==e.slug||t[8]!==m?.user?.id||t[9]!==u||t[10]!==c?(y=F=>{if(!F||F===p){i({to:"/$org",params:{org:e.slug}});return}const B=di(c,F,m?.user?.id);B?u(B.id,F):f(F)},t[4]=f,t[5]=p,t[6]=i,t[7]=e.slug,t[8]=m?.user?.id,t[9]=u,t[10]=c,t[11]=y):y=t[11];const v=y,w=h?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let C;t[12]!==e?(C=s.jsx(pt,{org:e,size:"sm"}),t[12]=e,t[13]=C):C=t[13];let N;t[14]!==h||t[15]!==g?(N=h&&s.jsx("span",{className:E("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[14]=h,t[15]=g,t[16]=N):N=t[16];let S;t[17]!==C||t[18]!==N?(S=s.jsxs("span",{className:"relative inline-flex",children:[C,N]}),t[17]=C,t[18]=N,t[19]=S):S=t[19];let A;t[20]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[20]=A):A=t[20];let k;t[21]!==w||t[22]!==S?(k=s.jsx(de,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":w,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,A]})}),t[21]=w,t[22]=S,t[23]=k):k=t[23];let z;t[24]!==e.slug||t[25]!==k?(z=s.jsx(bl,{orgParam:e.slug,trigger:k}),t[24]=e.slug,t[25]=k,t[26]=z):z=t[26];let _;t[27]!==e.name?(_=s.jsx(me,{side:"bottom",children:e.name}),t[27]=e.name,t[28]=_):_=t[28];let I;t[29]!==z||t[30]!==_?(I=s.jsx(St,{children:s.jsxs(ue,{children:[z,_]})}),t[29]=z,t[30]=_,t[31]=I):I=t[31];let M;t[32]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[32]=M):M=t[32];const H=b===p?x:void 0;let D;t[33]!==b||t[34]!==v?(D=()=>v(b),t[33]=b,t[34]=v,t[35]=D):D=t[35];let P;t[36]!==b||t[37]!==v||t[38]!==H||t[39]!==D?(P=s.jsx(St,{children:s.jsx(L.Suspense,{fallback:M,children:s.jsx(Tl,{agentId:b,fallback:H,onOpenHome:D,onPick:v})})}),t[36]=b,t[37]=v,t[38]=H,t[39]=D,t[40]=P):P=t[40];let O;return t[41]!==I||t[42]!==P?(O=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Wn,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[I,P]})}),t[41]=I,t[42]=P,t[43]=O):O=t[43],O}const Ml="sidebar.open";function Ol(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{}),t[0]=e):e=t[0],e}function Ko(){const t=$.c(27),e=ct(),n=mi(),[l,i]=He(Ml,!1),{width:r,wrapperRef:a,onStartResize:o,resetWidth:d}=xi();let c;t[0]!==e||t[1]!==n?(c=e?s.jsxs(Q.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:[!n&&s.jsx(Jt,{}),!n&&s.jsx(Et,{}),!n&&s.jsx(nt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Q.TogglesSlot,{}),!n&&s.jsx(Q.TabsSlot,{className:"min-w-0 justify-self-end"})]}),!n&&s.jsx(Q.CenterSlot,{}),!n&&s.jsx(Q.RightSlot,{})]}):s.jsxs(Q.Header,{children:[s.jsxs(Q.LeftColumn,{children:[!n&&s.jsx(Et,{}),s.jsx(Q.TogglesSlot,{})]}),n?s.jsx("div",{"aria-hidden":!0}):s.jsx(Q.CenterSlot,{}),s.jsx(Q.RightColumn,{children:!n&&s.jsxs(s.Fragment,{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(Q.TabsSlot,{})}),s.jsx(Q.RightSlot,{})]})})]}),t[0]=e,t[1]=n,t[2]=c):c=t[2];const m=`${r}px`;let u;t[3]!==m?(u={"--sidebar-width":m,"--sidebar-width-icon":"3.5rem"},t[3]=m,t[4]=u):u=t[4];const f=u;let h;t[5]!==e||t[6]!==o||t[7]!==n||t[8]!==d?(h=!e&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(cl,{}),s.jsx(ui,{onPointerDown:o,onDoubleClick:d})]}),t[5]=e,t[6]=o,t[7]=n,t[8]=d,t[9]=h):h=t[9];let g;t[10]===Symbol.for("react.memo_cache_sentinel")?(g={background:"transparent",containerType:"inline-size"},t[10]=g):g=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Rs,{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(Ol,{}),children:s.jsx(Ds,{})})})})}),t[11]=j):j=t[11];let x;t[12]!==f||t[13]!==h||t[14]!==a?(x=s.jsxs(Bs,{ref:a,className:"flex-1 bg-sidebar relative min-h-0",style:f,children:[h,j]}),t[12]=f,t[13]=h,t[14]=a,t[15]=x):x=t[15];let p;t[16]!==e||t[17]!==n?(p=e&&!n&&s.jsx($n,{renderSidebar:Pl}),t[16]=e,t[17]=n,t[18]=p):p=t[18];let b;t[19]!==c||t[20]!==x||t[21]!==p?(b=s.jsx(Gn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,p]})}),t[19]=c,t[20]=x,t[21]=p,t[22]=b):b=t[22];let y;return t[23]!==i||t[24]!==l||t[25]!==b?(y=s.jsx(jn,{children:s.jsx(Q.Provider,{children:s.jsx(Hs,{open:l,onOpenChange:i,children:b})})}),t[23]=i,t[24]=l,t[25]=b,t[26]=y):y=t[26],y}function Pl(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(dl,{onClose:e})})})}export{Ko as default};
1
+ import{c as $,j as s,Y as He,r as L,l as E,M as oe,Z as bs,_ as js,a as ae,$ as se,b as xe,a0 as vs,a1 as ys,t as re,a2 as Ss,a3 as Ns,K as _s,k as Cs,a4 as ws,i as Lt,e as lt,u as rt,P as Rt,G as ks,H as As,I as Is,J as zs,d as $s,B as Je,a5 as Ts,T as Ms,U as Os,a6 as Ps,X as Ds,a7 as Fs}from"./index-Dgf9uMoE.js";import{u as pe,S as ot,a as at,b as ce,c as J,d as K,e as Bt,f as Ht,g as Es,h as Ls,i as Ze,j as Rs,k as Bs,l as Hs}from"./sidebar-DGCj3BzG.js";import{u as ct}from"./use-mobile-B-H7VJlh.js";import{S as te}from"./skeleton-h_Rrfd9X.js";import{i as Gt}from"./LayoutLeft-CIXRhIgm.js";import{T as ve}from"./toolbar-icon-button-j_UeiHvv.js";import{P as Ge,a as ze,b as Ue}from"./popover-BjB-5tFY.js";import{D as Ut,a as Wt,b as qt}from"./drawer-CsmWGB6A.js";import{A as Le}from"./avatar-DWC-yfzJ.js";import{a as de,b as me,c as et,T as ue}from"./tooltip-1foZ_k7s.js";import{a as gt}from"./Copy01-DVjpmGSQ.js";import{n as Gs,i as Us}from"./Globe01-fOy2mEYg.js";import{i as Ws}from"./ZoomOut-DK6J-pHc.js";import{i as qs,a as Ks}from"./ZapSquare-do_RxxO8.js";import{i as tt}from"./Monitor01-8NNEYlGa.js";import{n as Xs,a as Vs}from"./Sun-DvwmIRmO.js";import{a as dt}from"./Settings02-CJWk9pL-.js";import{i as Ys}from"./Shield01-1T25s-tn.js";import{a as Qs}from"./Users03-BQZ9UhFk.js";import{b as bt,c as jt,d as Js,e as Zs,A as ye,f as vt,i as en,s as tn,g as sn}from"./agent-icon-DryRwerX.js";import"./index-BtXBV2Et.js";import{I as nn}from"./invite-member-dialog-IU7TOmN2.js";import{u as ln,A as rn,g as on,a as an,b as Kt}from"./agent-capabilities-udLJw-cm.js";import{u as cn,v as dn,C as yt}from"./connect-desktop-dialog-D3fwzLbi.js";import{i as mn}from"./FilterLines-B1MBg_Jt.js";import{T as un,a as fn}from"./toggle-group-CArvNNKC.js";import{u as hn}from"./use-mcp-client-DbUnPC2U.js";import{S as xn,a as Re,i as pn,b as gn}from"./constants-B72Xmt_K.js";import{u as mt,a as Xt}from"./use-virtual-mcp-CjUwVbqH.js";import{u as bn,a as ut,b as Vt,T as jn}from"./hooks-Cln-uffe.js";import{u as ft,r as vn}from"./shell-layout-B4WmiL97.js";import{c as yn,a as Sn,b as Nn,d as _n,e as Cn}from"./dialog-B4FPUVJm.js";import{C as wn,a as kn,b as An,c as In,d as zn}from"./command-CslXjYaI.js";import{u as Yt}from"./studio-tools-BaimbcRe.js";import{i as Qt}from"./Zap-DWMv1jO1.js";import{S as Jt,M as $n}from"./shell-controls-DcH8LcQe.js";import{n as Tn}from"./Stars02-H_ePh5tT.js";import{g as Mn,u as On,S as Pn}from"./use-clock-tick-BVVBiunA.js";import{f as Dn}from"./format-time-Cy7tTmZp.js";import{t as ht}from"./ChevronDown-BL5D5Kww.js";import{i as Fn}from"./ChevronRight-Brlyqvfv.js";import{S as Zt,u as En,g as Ln,a as Rn,b as Bn}from"./use-navigate-to-agent-_WYF41V-.js";import{S as Hn,C as Gn}from"./chat-context-B0O0Okxx.js";import{B as St,a as Un,b as Wn}from"./breadcrumb-CbTWSDKt.js";import{i as es}from"./Check-DT0Ecfph.js";import{s as $e}from"./Plus-BWS7YRCt.js";import{i as ts}from"./SearchMd-D3a2hIUP.js";import{s as qn}from"./XClose-DuZ4u7Uu.js";import{A as Kn,a as Xn,b as Vn,c as Yn,d as Qn,e as Jn,f as Zn}from"./alert-dialog-C4qC2FY4.js";import{F as ei,a as ti,b as si,c as ni,d as ii,f as li,e as ri}from"./form-CIHkncRQ.js";import{I as oi}from"./input-oiex_Sqb.js";import{G as ai,a as ci}from"./github-repo-picker-CnKj3G6a.js";import{f as di}from"./reusable-new-chat-CouMjkYR.js";import{T as Q}from"./toolbar-Cap3B0tq.js";import{u as mi}from"./use-organization-settings-CsH8Ep36.js";import"./X-CAX-FceB.js";import"./User01-Ckt1oKpR.js";import"./AlertCircle-DvQdKX2P.js";import"./Tool01-BFRbBZqm.js";import"./SwitchHorizontal01-CEx7u3Ha.js";import"./XCircle-D6yhOy3u.js";import"./ArrowUpRight-C4ZUgCv8.js";import"./Loading02-BYDO_yva.js";import"./CheckCircle-B3kM3-nx.js";import"./ChevronUp-D4h43NMl.js";import"./Circle-gozopXYF.js";import"./DotsVertical-CuOtMg5m.js";import"./Eye-cte0MnVy.js";import"./Star01-LBoyDaKY.js";import"./Globe04-BhuakAIf.js";import"./HardDrive-DKydDUbm.js";import"./Key01-BhnYqbq5.js";import"./LinkExternal01-Br3p9c4J.js";import"./List-DZFJgfGO.js";import"./Palette-BEYm0oRU.js";import"./Play-BAkY7Fxv.js";import"./SearchLg-sYqeRxUE.js";import"./Stars01-5MzsUK6G.js";import"./Trash01-CqJAv-4z.js";import"./Upload01-BEmoOwcr.js";import"./Users01-C3ZswPLc.js";import"./select-Ct8ODrmD.js";import"./textarea-DTygx-PF.js";import"./use-org-auth-client-Dr5MvmUs.js";import"./use-organization-roles-CqDIe-bv.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Do3n6-0X.js";import"./use-registry-connections-C948P_nl.js";import"./use-connection-BibmCEFD.js";import"./use-collections-zePUbAs4.js";import"./useInfiniteQuery-DWB8a2J-.js";import"./use-infinite-scroll-BmH_7PeD.js";import"./extract-connection-data-Du4c1lRI.js";import"./card-fRwe0bJZ.js";import"./integration-icon-aZSadBLO.js";import"./collection-search-DFZjjhrH.js";import"./collection-tabs-DKk8l5Nv.js";import"./badge-DJdw3Rsl.js";import"./connection-form-helpers-2Hj68sfK.js";import"./authenticate-and-persist-oauth-Bbf69cXY.js";import"./mcp-oauth-CdnuFysO.js";import"./auth-DBkkYg-T.js";import"./useSuspenseInfiniteQuery-Ip6E6dwx.js";import"./use-ai-providers-CLhyvTsV.js";import"./decopilot-sse-pool-B14erbbw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-Bxaf6y0u.js";import"./autosend-d6dIJs7M.js";import"./tab-id-bb-jjgGv.js";import"./use-org-sso-BV4x4p-5.js";import"./index-C2Xrxv4z.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-decopilot-events-BPApfysb.js";import"./label-CmLwbefD.js";import"./use-debounced-value-CrZFsUmt.js";import"./use-mcp-tools-aSGZtgAI.js";import"./github-installations-D2vHSx02.js";function ui(t){const e=$.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:i,isMobile:r}=pe();if(r||i==="collapsed")return null;let a,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={left:"var(--sidebar-width)"},o=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]=a,e[1]=o):(a=e[0],o=e[1]);let d;return e[2]!==l||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:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:a,children:o}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const xt=240,fi=400,hi="sidebar.width";function Te(t){return Math.max(xt,Math.min(fi,t))}function xi(){const t=$.c(11),[e,n]=He(hi,pi),l=L.useRef(null);let i;t[0]!==n||t[1]!==e?(i=m=>{m.preventDefault();const u=m.clientX,f=Te(e),h=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),g=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const p of g)p.style.transition="none";const j=p=>{const b=Te(f+(p.clientX-u));h?.style.setProperty("--sidebar-width",`${b}px`)},x=p=>{const b=Te(f+(p.clientX-u));n(b);for(const y of g)y.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",x),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",x)},t[0]=n,t[1]=e,t[2]=i):i=t[2];const r=i;let a;t[3]!==n?(a=()=>{n(xt)},t[3]=n,t[4]=a):a=t[4];const o=a;let d;t[5]!==e?(d=Te(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==r||t[8]!==o||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:r,resetWidth:o},t[7]=r,t[8]=o,t[9]=d,t[10]=c):c=t[10],c}function pi(t){return typeof t=="number"?Te(t):xt}function ss(){return[]}function ns(t){const e=$.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[0];let i;return e[1]!==n?(i=s.jsxs(ot,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(at,{children:s.jsx(ce,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=i):i=e[2],i}function is(t){const e=$.c(18),{item:n}=t,{isMobile:l,setOpenMobile:i}=pe();let r;e[0]!==l||e[1]!==n||e[2]!==i?(r=()=>{oe("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&i(!1)},e[0]=l,e[1]=n,e[2]=i,e[3]=r):r=e[3];const a=r,o=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=E(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]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=a,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(K,{className:c,children:u},o),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function gi(t){const e=$.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Bt,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,i=n.group.defaultExpanded;let r;e[2]!==n.group.items?(r=n.group.items.map(ji),e[2]=n.group.items,e[3]=r):r=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==r?(a=s.jsx(ns,{label:l,defaultExpanded:i,children:r}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=r,e[7]=a):a=e[7],a}case"items":{let l;e[8]!==n.items?(l=n.items.map(bi),e[8]=n.items,e[9]=l):l=e[9];let i;return e[10]!==l?(i=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=i):i=e[11],i}case"custom":return n.content}}function bi(t){return s.jsx(is,{item:t},t.key)}function ji(t){return s.jsx(is,{item:t},t.key)}function vi(t){const e=$.c(14),{sections:n,footer:l,additionalContent:i,variant:r,contentClassName:a}=t,o=r===void 0?"sidebar":r;let d;e[0]!==a?(d=E("flex flex-col flex-1 px-2 pb-2 gap-0.5",a),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(yi),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==i?(m=i&&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:i}),e[4]=i,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Ht,{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]!==l||e[11]!==u||e[12]!==o?(f=s.jsxs(Es,{variant:o,children:[u,l]}),e[10]=l,e[11]=u,e[12]=o,e[13]=f):f=e[13],f}function yi(t,e){return s.jsx(gi,{section:t},e)}function ls(t){const e=$.c(2);let n;return e[0]!==t?(n=s.jsx(vi,{...t}),e[0]=t,e[1]=n):n=e[1],n}ls.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(te,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Si(t){const e=$.c(16),{onToggle:n,className:l}=t,r=bs().logo??js,a=typeof r=="string"?r:r.light,o=typeof r=="string"?r:r.dark;let d;e[0]!==l?(d=E("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",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==a?(c=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=a,e[3]=c):c=e[3];let m;e[4]!==o?(m=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=o,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(Gt,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ve,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let g;return e[12]!==d||e[13]!==u||e[14]!==h?(g=s.jsxs(Ls,{className:d,children:[u,h]}),e[12]=d,e[13]=u,e[14]=h,e[15]=g):g=e[15],g}function Nt(t){const e=$.c(18),{item:n,onClose:l}=t,i=n.isActive&&"z-10";let r;e[0]!==i?(r=E(i),e[0]=i,e[1]=r):r=e[1];let a;e[2]!==n||e[3]!==l?(a=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=a):a=e[4];let o;e[5]!==n.icon?(o=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=o):o=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]!==a||e[12]!==o||e[13]!==d?(c=s.jsxs(J,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[o,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=o,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==r||e[16]!==c?(m=s.jsx(K,{className:r,children:c}),e[15]=r,e[16]=c,e[17]=m):m=e[17],m}function Ni(t){const e=$.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Bt,{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 a;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(Nt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],a=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=a}else a=e[4];let o;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(o=s.jsx(ns,{label:i,defaultExpanded:r,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=o):o=e[10],o}case"items":{let i;if(e[11]!==l||e[12]!==n.items){let a;e[14]!==l?(a=o=>s.jsx(Nt,{item:o,onClose:l},o.key),e[14]=l,e[15]=a):a=e[15],i=n.items.map(a),e[11]=l,e[12]=n.items,e[13]=i}else i=e[13];let r;return e[16]!==i?(r=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(at,{children:s.jsx(ce,{className:"gap-1.5",children:i})})}),e[16]=i,e[17]=r):r=e[17],r}case"custom":return n.content}}function _i(t){const e=$.c(17),{sections:n,onClose:l,footer:i,additionalContent:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=a):a=e[0];let o;e[1]!==l?(o=s.jsx(L.Suspense,{fallback:a,children:s.jsx(Si,{onToggle:l})}),e[1]=l,e[2]=o):o=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(h,g)=>s.jsx(Ni,{section:h,onClose:l},g),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==r?(c=r&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:r}),e[8]=r,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Ht,{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]!==i||e[14]!==o||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[o,m,i]}),e[13]=i,e[14]=o,e[15]=m,e[16]=u):u=e[16],u}function De(t){const e=$.c(22),{item:n,onClose:l}=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]!==l||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:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let i;e[11]!==n||e[12]!==l?(i=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=i):i=e[13];let r;e[14]!==n.icon?(r=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=r):r=e[15];let a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let o;return e[18]!==i||e[19]!==r||e[20]!==a?(o=s.jsxs("button",{type:"button",onClick:i,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:[r,a]}),e[18]=i,e[19]=r,e[20]=a,e[21]=o):o=e[21],o}function _t(t){const e=$.c(126),{user:n,userImage:l,menuItems:i,signOutItem:r,themeOptions:a,preferences:o,setPreferences:d,close:c,isMobile:m}=t;if(m){const U=n?.name??"U";let W;e[0]!==U||e[1]!==l?(W=s.jsx(Le,{url:l,fallback:U,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=U,e[1]=l,e[2]=W):W=e[2];const R=n?.name??"User";let Z;e[3]!==R?(Z=s.jsx("p",{className:"text-sm font-medium truncate",children:R}),e[3]=R,e[4]=Z):Z=e[4];const ge=n?.email;let ee;e[5]!==ge?(ee=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ge}),e[5]=ge,e[6]=ee):ee=e[6];let fe;e[7]!==Z||e[8]!==ee?(fe=s.jsxs("div",{className:"flex-1 min-w-0",children:[Z,ee]}),e[7]=Z,e[8]=ee,e[9]=fe):fe=e[9];let be;e[10]!==n?(be=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ai)},e[10]=n,e[11]=be):be=e[11];let ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(ne=s.jsx(gt,{size:14}),e[12]=ne):ne=e[12];let he;e[13]!==be?(he=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:be,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ne})}),e[13]=be,e[14]=he):he=e[14];let je;e[15]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=je):je=e[15];let T;e[16]!==he?(T=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[he,je]})}),e[16]=he,e[17]=T):T=e[17];let G;e[18]!==T||e[19]!==W||e[20]!==fe?(G=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,fe,T]}),e[18]=T,e[19]=W,e[20]=fe,e[21]=G):G=e[21];let V;if(e[22]!==c||e[23]!==i){let le;e[25]!==c?(le=Pe=>s.jsx(De,{item:Pe,onClose:c},Pe.key),e[25]=c,e[26]=le):le=e[26],V=i.map(le),e[22]=c,e[23]=i,e[24]=V}else V=e[24];let q;e[27]!==c||e[28]!==r?(q=s.jsx(De,{item:r,onClose:c}),e[27]=c,e[28]=r,e[29]=q):q=e[29];let ie;e[30]!==V||e[31]!==q?(ie=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:[V,q]})}),e[30]=V,e[31]=q,e[32]=ie):ie=e[32];let Se;if(e[33]!==o.theme||e[34]!==d||e[35]!==a){let le;e[37]!==o.theme||e[38]!==d?(le=Pe=>{const{value:Xe,icon:xs,label:ps}=Pe;return s.jsx("button",{type:"button","aria-label":ps,onClick:()=>d(gs=>({...gs,theme:Xe})),className:E("size-8 rounded-md flex items-center justify-center transition-colors",o.theme===Xe?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:xs},Xe)},e[37]=o.theme,e[38]=d,e[39]=le):le=e[39],Se=a.map(le),e[33]=o.theme,e[34]=d,e[35]=a,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const qe=o.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(ki),e[42]=d,e[43]=_e):_e=e[43];const Ke=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ce;e[44]!==Ke?(Ce=E("size-8 rounded-md flex items-center justify-center transition-colors",Ke),e[44]=Ke,e[45]=Ce):Ce=e[45];let we;e[46]!==o.enableSounds?(we=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[46]=o.enableSounds,e[47]=we):we=e[47];let ke;e[48]!==qe||e[49]!==_e||e[50]!==Ce||e[51]!==we?(ke=s.jsx("button",{type:"button","aria-label":qe,onClick:_e,className:Ce,children:we}),e[48]=qe,e[49]=_e,e[50]=Ce,e[51]=we,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.50.1"]}),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]!==Ne||e[57]!==Ae?(Ie=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ae]}),e[56]=Ne,e[57]=Ae,e[58]=Ie):Ie=e[58];let Oe;return e[59]!==G||e[60]!==ie||e[61]!==Ie?(Oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,ie,Ie]}),e[59]=G,e[60]=ie,e[61]=Ie,e[62]=Oe):Oe=e[62],Oe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Le,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const h=n?.name??"User";let g;e[66]!==h?(g=s.jsx("p",{className:"text-sm font-medium truncate",children:h}),e[66]=h,e[67]=g):g=e[67];const j=n?.email;let x;e[68]!==j?(x=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:j}),e[68]=j,e[69]=x):x=e[69];let p;e[70]!==g||e[71]!==x?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[g,x]}),e[70]=g,e[71]=x,e[72]=p):p=e[72];let b;e[73]!==n?(b=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(wi)},e[73]=n,e[74]=b):b=e[74];let y;e[75]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(gt,{size:14}),e[75]=y):y=e[75];let v;e[76]!==b?(v=s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:y})}),e[76]=b,e[77]=v):v=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(me,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let C;e[79]!==v?(C=s.jsx(et,{delayDuration:300,children:s.jsxs(ue,{children:[v,w]})}),e[79]=v,e[80]=C):C=e[80];let N;e[81]!==C||e[82]!==f||e[83]!==p?(N=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,p,C]}),e[81]=C,e[82]=f,e[83]=p,e[84]=N):N=e[84];let S;if(e[85]!==c||e[86]!==i){let U;e[88]!==c?(U=W=>s.jsx(De,{item:W,onClose:c},W.key),e[88]=c,e[89]=U):U=e[89],S=i.map(U),e[85]=c,e[86]=i,e[87]=S}else S=e[87];let A;e[90]!==c||e[91]!==r?(A=s.jsx(De,{item:r,onClose:c}),e[90]=c,e[91]=r,e[92]=A):A=e[92];let k;e[93]!==S||e[94]!==A?(k=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[S,A]}),e[93]=S,e[94]=A,e[95]=k):k=e[95];let z;if(e[96]!==o.theme||e[97]!==d||e[98]!==a){let U;e[100]!==o.theme||e[101]!==d?(U=W=>{const{value:R,icon:Z,label:ge}=W;return s.jsx("button",{type:"button","aria-label":ge,onClick:()=>d(ee=>({...ee,theme:R})),className:E("size-7 rounded-md flex items-center justify-center transition-colors",o.theme===R?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},R)},e[100]=o.theme,e[101]=d,e[102]=U):U=e[102],z=a.map(U),e[96]=o.theme,e[97]=d,e[98]=a,e[99]=z}else z=e[99];let _;e[103]!==z?(_=s.jsx("div",{className:"flex items-center gap-0.5",children:z}),e[103]=z,e[104]=_):_=e[104];const I=o.enableSounds?"Disable sounds":"Enable sounds";let M;e[105]!==d?(M=()=>d(Ci),e[105]=d,e[106]=M):M=e[106];const H=o.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[107]!==H?(D=E("size-7 rounded-md flex items-center justify-center transition-colors",H),e[107]=H,e[108]=D):D=e[108];let P;e[109]!==o.enableSounds?(P=o.enableSounds?s.jsx(bt,{size:14}):s.jsx(jt,{size:14}),e[109]=o.enableSounds,e[110]=P):P=e[110];let O;e[111]!==I||e[112]!==M||e[113]!==D||e[114]!==P?(O=s.jsx("button",{type:"button","aria-label":I,onClick:M,className:D,children:P}),e[111]=I,e[112]=M,e[113]=D,e[114]=P,e[115]=O):O=e[115];let F;e[116]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.50.1"]}),e[116]=F):F=e[116];let B;e[117]!==O?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[O,F]}),e[117]=O,e[118]=B):B=e[118];let Y;e[119]!==_||e[120]!==B?(Y=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[_,B]}),e[119]=_,e[120]=B,e[121]=Y):Y=e[121];let X;return e[122]!==N||e[123]!==k||e[124]!==Y?(X=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[N,k,Y]})}),e[122]=N,e[123]=k,e[124]=Y,e[125]=X):X=e[125],X}function Ci(t){return{...t,enableSounds:!t.enableSounds}}function wi(){re.success("User ID copied")}function ki(t){return{...t,enableSounds:!t.enableSounds}}function Ai(){re.success("User ID copied")}function st(){const t=$.c(34),{data:e}=ae.useSession(),{org:n}=se(),l=xe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org",shouldThrow:!1},t[0]=i):i=t[0];const a=vs(i)?.params.org,[o,d]=ys(),c=ct(),[m,u]=L.useState(!1),f=e?.user,h=f?.image;let g;t[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>u(!1),t[1]=g):g=t[1];const j=g;let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(dt,{size:16}),t[2]=x):x=t[2];let p;t[3]!==l||t[4]!==a?(p={key:"preferences",label:"Preferences",icon:x,onClick:()=>{l({to:"/$org/settings/profile",params:{org:a??""}})}},t[3]=l,t[4]=a,t[5]=p):p=t[5];let b;t[6]!==n||t[7]!==l?(b=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Gs,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=b):b=t[8];let y;t[9]===Symbol.for("react.memo_cache_sentinel")?(y={key:"terms",label:"Terms of Use",icon:s.jsx(Ws,{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(Ys,{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(Ss,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"community",label:"Community",icon:s.jsx(Qs,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=C):C=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N={key:"homepage",label:"Homepage",icon:s.jsx(Us,{size:16}),href:"https://decocms.com",external:!0},t[13]=N):N=t[13];let S;t[14]!==p||t[15]!==b?(S=[p,...b,y,v,w,C,N],t[14]=p,t[15]=b,t[16]=S):S=t[16];const A=S;let k;t[17]===Symbol.for("react.memo_cache_sentinel")?(k={key:"logout",label:"Sign out",icon:s.jsx(qs,{size:16}),onClick:zi},t[17]=k):k=t[17];const z=k;let _;t[18]===Symbol.for("react.memo_cache_sentinel")?(_={value:"light",icon:s.jsx(Xs,{size:14}),label:"Light theme"},t[18]=_):_=t[18];let I;t[19]===Symbol.for("react.memo_cache_sentinel")?(I={value:"dark",icon:s.jsx(Vs,{size:14}),label:"Dark theme"},t[19]=I):I=t[19];let M;t[20]===Symbol.for("react.memo_cache_sentinel")?(M=[_,I,{value:"system",icon:s.jsx(tt,{size:14}),label:"System theme"}],t[20]=M):M=t[20];const H=M;let D;t[21]!==c||t[22]!==A||t[23]!==o||t[24]!==d||t[25]!==f||t[26]!==h?(D={user:f,userImage:h,menuItems:A,signOutItem:z,themeOptions:H,preferences:o,setPreferences:d,close:j,isMobile:c},t[21]=c,t[22]=A,t[23]=o,t[24]=d,t[25]=f,t[26]=h,t[27]=D):D=t[27];const P=D;let O;return t[28]!==c||t[29]!==m||t[30]!==P||t[31]!==f?.name||t[32]!==h?(O=s.jsx(s.Fragment,{children:c?s.jsxs(Ut,{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(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Wt,{className:"h-[80dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Account"}),s.jsx(_t,{...P})]})]}):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(Le,{url:h,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Ue,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Ii,children:s.jsx(_t,{...P})})]})}),t[28]=c,t[29]=m,t[30]=P,t[31]=f?.name,t[32]=h,t[33]=O):O=t[33],O}function Ii(t){return t.preventDefault()}function zi(){oe("signed_out",{source:"account_popover"}),Ns(),ae.signOut()}function nt(t){const e=$.c(43),{variant:n}=t===void 0?{}:t,l=n===void 0?"icon":n,i=cn(),[r,a]=L.useState(!1);let o,d;if(e[0]!==i.capabilities||e[1]!==i.hostname||e[2]!==i.machineId||e[3]!==i.online){const y=dn(i.capabilities);o=i.online?"Desktop linked":"Connect desktop",d=i.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:i.hostname??i.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]=i.capabilities,e[1]=i.hostname,e[2]=i.machineId,e[3]=i.online,e[4]=o,e[5]=d}else o=e[4],d=e[5];const c=d;if(l==="full"){let y,v;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>a(!0),v=s.jsx(tt,{}),e[6]=y,e[7]=v):(y=e[6],v=e[7]);let w;e[8]!==o?(w=s.jsx("span",{children:o}),e[8]=o,e[9]=w):w=e[9];let C;e[10]!==i.online?(C=i.online&&s.jsx("span",{className:"ml-auto size-2 rounded-full bg-success animate-pulse"}),e[10]=i.online,e[11]=C):C=e[11];let N;e[12]!==o||e[13]!==w||e[14]!==C?(N=s.jsx(de,{asChild:!0,children:s.jsxs(J,{tooltip:o,onClick:y,children:[v,w,C]})}),e[12]=o,e[13]=w,e[14]=C,e[15]=N):N=e[15];let S;e[16]!==c?(S=s.jsx(me,{side:"right",children:c}),e[16]=c,e[17]=S):S=e[17];let A;e[18]!==N||e[19]!==S?(A=s.jsxs(ue,{children:[N,S]}),e[18]=N,e[19]=S,e[20]=A):A=e[20];let k;e[21]!==r?(k=s.jsx(yt,{open:r,onOpenChange:a}),e[21]=r,e[22]=k):k=e[22];let z;return e[23]!==k||e[24]!==A?(z=s.jsxs(s.Fragment,{children:[A,k]}),e[23]=k,e[24]=A,e[25]=z):z=e[25],z}let m;e[26]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[26]=m):m=e[26];const u=i.online?"Desktop linked":"Connect your desktop";let f;e[27]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(tt,{size:16}),e[27]=f):f=e[27];let h;e[28]!==i.online?(h=i.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[28]=i.online,e[29]=h):h=e[29];let g;e[30]!==u||e[31]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsxs(ve,{onClick:m,"aria-label":u,children:[f,h]})}),e[30]=u,e[31]=h,e[32]=g):g=e[32];let j;e[33]!==c?(j=s.jsx(me,{side:"bottom",children:c}),e[33]=c,e[34]=j):j=e[34];let x;e[35]!==g||e[36]!==j?(x=s.jsxs(ue,{children:[g,j]}),e[35]=g,e[36]=j,e[37]=x):x=e[37];let p;e[38]!==r?(p=s.jsx(yt,{open:r,onOpenChange:a}),e[38]=r,e[39]=p):p=e[39];let b;return e[40]!==p||e[41]!==x?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[40]=p,e[41]=x,e[42]=b):b=e[42],b}class $i 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 Ti(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Mi(){const t=$.c(17),e=xe(),{org:n}=se(),{hasDecoKey:l,balanceDollars:i}=ln();if(!l)return null;let r;t[0]!==i?(r=i!=null?`Credits: $${i.toFixed(2)}`:"Credits",t[0]=i,t[1]=r):r=t[1];let a;t[2]!==i?(a=E(i!=null&&Ti(i)),t[2]=i,t[3]=a):a=t[3];let o;t[4]!==e||t[5]!==n.slug?(o=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=o):o=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Js,{}),t[7]=d):d=t[7];let c;t[8]!==i?(c=i!=null?`$${i.toFixed(2)}`:"Credits",t[8]=i,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]!==r||t[13]!==a||t[14]!==o||t[15]!==m?(u=s.jsx(ce,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:r,className:a,onClick:o,children:[d,m]})})}),t[12]=r,t[13]=a,t[14]=o,t[15]=m,t[16]=u):u=t[16],u}function Ct(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx($i,{children:s.jsx(L.Suspense,{fallback:null,children:s.jsx(Mi,{})})}),t[0]=e):e=t[0],e}function wt(){const t=$.c(7),e=xe(),{org:n}=se();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let i,r;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(dt,{}),r=s.jsx("span",{children:"Settings"}),t[3]=i,t[4]=r):(i=t[3],r=t[4]);let a;return t[5]!==l?(a=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[i,r]}),t[5]=l,t[6]=a):a=t[6],a}function kt(){const t=$.c(4),[e,n]=L.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(nn,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(Zs,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(ce,{className:"gap-0.5",children:[l,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(Ks,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[1]=i):i=t[1];let r;return t[2]!==e?(r=s.jsxs(s.Fragment,{children:[i,s.jsx(rn,{open:e,onOpenChange:n,mode:"browse"})]}),t[2]=e,t[3]=r):r=t[3],r}function Oi(){const t=$.c(10),{state:e}=pe();if(e==="collapsed"){let d,c;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(kt,{}),c=s.jsx(Ct,{}),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(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(nt,{})})}),t[2]=m):m=t[2];let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{children:s.jsx(wt,{})}),t[3]=u):u=t[3];let f;return t[4]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsxs(Ze,{className:"px-2 pb-3 gap-1",children:[d,c,s.jsxs(ce,{children:[m,u,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[4]=f):f=t[4],f}let l,i;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),i=s.jsx(Ct,{}),t[5]=l,t[6]=i):(l=t[5],i=t[6]);let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(nt,{variant:"full"})}),t[7]=r):r=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx(wt,{})}),t[8]=a):a=t[8];let o;return t[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(Ze,{className:"px-2 pb-3 gap-0.5",children:[l,i,s.jsxs(ce,{className:"gap-0.5",children:[r,a,s.jsx(K,{children:s.jsx(st,{})})]})]}),t[9]=o):o=t[9],o}function Pi(){const t=$.c(8),e=xe(),{org:n}=se(),{setOpenMobile:l}=pe();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(ce,{children:s.jsx(K,{children:s.jsx(st,{})})})}),t[0]=i):i=t[0];let r;t[1]!==e||t[2]!==n.slug||t[3]!==l?(r=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=r):r=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(dt,{className:"size-4"}),t[5]=a):a=t[5];let o;return t[6]!==r?(o=s.jsx(Ze,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[i,s.jsx(ve,{"aria-label":"Settings",onClick:r,children:a})]})}),t[6]=r,t[7]=o):o=t[7],o}function At(t){const e=$.c(15),{className:n,wrapperClassName:l,children:i}=t,[r,a]=L.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p=>{p&&a(p.scrollHeight>p.clientHeight+1)},e[0]=o):o=e[0];const d=o;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const b=p.currentTarget;a(b.scrollHeight-b.scrollTop>b.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=E("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:i}),e[4]=i,e[5]=n,e[6]=f):f=e[6];const h=r?"opacity-100":"opacity-0";let g;e[7]!==h?(g=E("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",h),e[7]=h,e[8]=g):g=e[8];let j;e[9]!==g?(j=s.jsx("div",{"aria-hidden":!0,className:g}),e[9]=g,e[10]=j):j=e[10];let x;return e[11]!==u||e[12]!==f||e[13]!==j?(x=s.jsxs("div",{className:u,children:[f,j]}),e[11]=u,e[12]=f,e[13]=j,e[14]=x):x=e[14],x}function Di(t){const e=$.c(8),{virtualMcpId:n,size:l,showAutomationBadge:i}=t,r=l===void 0?"sm":l;let a;e[0]!==r||e[1]!==n?(a=n?s.jsx(Fi,{virtualMcpId:n,size:r}):s.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=n,e[2]=a):a=e[2];let o;e[3]!==i?(o=i&&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(Qt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o):o=e[4];let d;return e[5]!==a||e[6]!==o?(d=s.jsxs("div",{className:"relative shrink-0",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7],d}function Fi(t){const e=$.c(6),{virtualMcpId:n,size:l}=t,i=mt(n);if(!i){let o;return e[0]!==l?(o=s.jsx(ye,{icon:null,name:"?",size:l}),e[0]=l,e[1]=o):o=e[1],o}const r=i.icon??null;let a;return e[2]!==i.title||e[3]!==l||e[4]!==r?(a=s.jsx(ye,{icon:r,name:i.title,size:l}),e[2]=i.title,e[3]=l,e[4]=r,e[5]=a):a=e[5],a}function It(t){const e=$.c(36),{open:n,onOpenChange:l}=t,[i,r]=L.useState(""),{org:a}=se(),{setTaskId:o}=ft(),d=Yt();let c,m,u;e[0]!==a.id||e[1]!==i?(u=i.trim(),m=Cs,c=_s.globalSearch(a.id,u),e[0]=a.id,e[1]=i,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 h;e[5]!==d||e[6]!==u?(h=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=h):h=e[7];let g;e[8]!==c||e[9]!==f||e[10]!==h?(g={queryKey:c,enabled:f,queryFn:h,staleTime:1e4},e[8]=c,e[9]=f,e[10]=h,e[11]=g):g=e[11];const{data:j,isFetching:x}=m(g);let p;e[12]!==j?.items?(p=j?.items??[],e[12]=j?.items,e[13]=p):p=e[13];const b=p;let y;e[14]!==l?(y=I=>{I||r(""),l(I)},e[14]=l,e[15]=y):y=e[15];const v=y;let w;e[16]!==v||e[17]!==o?(w=I=>{v(!1),o(I.id,I.virtual_mcp_id??void 0)},e[16]=v,e[17]=o,e[18]=w):w=e[18];const C=w;let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsxs(yn,{className:"sr-only",children:[s.jsx(Sn,{children:"Search"}),s.jsx(Nn,{children:"Search across your organization's resources."})]}),e[19]=N):N=e[19];let S;e[20]!==i?(S=s.jsx(An,{value:i,onValueChange:r,placeholder:"Search..."}),e[20]=i,e[21]=S):S=e[21];let A;e[22]!==C||e[23]!==x||e[24]!==b||e[25]!==u?(A=u?x&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(wn,{children:"No results."}):b.map(I=>I.type==="thread"?s.jsxs(kn,{value:`thread:${I.id}:${I.title}`,onSelect:()=>C(I),className:"gap-2.5",children:[s.jsx(Di,{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]=C,e[23]=x,e[24]=b,e[25]=u,e[26]=A):A=e[26];let k;e[27]!==A?(k=s.jsx(In,{children:A}),e[27]=A,e[28]=k):k=e[28];let z;e[29]!==S||e[30]!==k?(z=s.jsxs(_n,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[N,s.jsxs(zn,{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,k]})]}),e[29]=S,e[30]=k,e[31]=z):z=e[31];let _;return e[32]!==v||e[33]!==n||e[34]!==z?(_=s.jsx(Cn,{open:n,onOpenChange:v,children:z}),e[32]=v,e[33]=n,e[34]=z,e[35]=_):_=e[35],_}function Ei(t){return t==="ephemeral"||t.startsWith("thread:")}function rs(t){const e=$.c(40),{task:n,isActive:l,onClick:i,onArchive:r,showAutomationBadge:a,showAgentIcon:o,hideStatusIdle:d,indented:c}=t,m=Mn(n.status),u=m.icon,f=n.metadata?.kind==="tool_call_run",h=mt(f?void 0:n.virtual_mcp_id);let g;e[0]!==h?(g=on(h),e[0]=h,e[1]=g):g=e[1];const j=g;On(6e4);const x=a||!!n.trigger_id,p=n.id,b="button",y=0;let v;e[2]!==i?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),i())},e[2]=i,e[3]=v):v=e[3];const w=c?"-ml-4 pl-6":"pl-2",C=l?"bg-accent text-accent-foreground":"hover:bg-accent/60";let N;e[4]!==w||e[5]!==C?(N=E("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",C),e[4]=w,e[5]=C,e[6]=N):N=e[6];let S;e[7]!==f||e[8]!==o||e[9]!==h?.icon||e[10]!==h?.title?(S=o&&!f&&s.jsx(ye,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=o,e[9]=h?.icon,e[10]=h?.title,e[11]=S):S=e[11];let A;e[12]!==x?(A=x&&s.jsx(Qt,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=x,e[13]=A):A=e[13];const k=n.title||"Untitled task";let z;e[14]!==k?(z=s.jsx("div",{className:"text-sm text-foreground truncate",children:k}),e[14]=k,e[15]=z):z=e[15];let _;e[16]!==A||e[17]!==z?(_=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[A,z]}),e[16]=A,e[17]=z,e[18]=_):_=e[18];let I;e[19]!==j||e[20]!==l||e[21]!==n.branch||e[22]!==n.updated_at?(I=n.updated_at&&s.jsxs("div",{className:E("flex items-center gap-1 text-[11px] min-w-0",l?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Ei(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):j?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[j.owner,"/",j.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Dn(new Date(n.updated_at))})]}),e[19]=j,e[20]=l,e[21]=n.branch,e[22]=n.updated_at,e[23]=I):I=e[23];let M;e[24]!==_||e[25]!==I?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[_,I]}),e[24]=_,e[25]=I,e[26]=M):M=e[26];const H="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",D=!d&&s.jsx("span",{className:E("[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity",r&&"group-hover/row:opacity-0"),"aria-label":m.label,children:s.jsx(u,{size:14,className:E(m.iconClassName,n.status==="in_progress"&&"animate-spin")})});let P;e[27]!==r?(P=r&&s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:B=>{B.stopPropagation(),r()},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(ws,{size:14})})}),s.jsx(me,{side:"right",children:"Archive"})]}),e[27]=r,e[28]=P):P=e[28];let O;e[29]!==D||e[30]!==P?(O=s.jsxs("div",{className:H,children:[D,P]}),e[29]=D,e[30]=P,e[31]=O):O=e[31];let F;return e[32]!==i||e[33]!==M||e[34]!==O||e[35]!==v||e[36]!==N||e[37]!==S||e[38]!==n.id?(F=s.jsxs("div",{"data-task-id":p,role:b,tabIndex:y,onClick:i,onKeyDown:v,className:N,children:[S,M,O]}),e[32]=i,e[33]=M,e[34]=O,e[35]=v,e[36]=N,e[37]=S,e[38]=n.id,e[39]=F):F=e[39],F}const zt=["requires_action","in_progress","failed","expired","completed"];function Li(t){const e=new Map(zt.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return zt.map(n=>({status:n,threads:e.get(n)}))}const Ri="sidebar.group.expanded.";function Bi(t,e){const n=$.c(3),[l,i]=He(`${Ri}${t}`,e);let r;return n[0]!==l||n[1]!==i?(r=[l,i],n[0]=l,n[1]=i,n[2]=r):r=n[2],r}function os(t){const e=$.c(12),{onClick:n,isFetching:l,indented:i}=t,r=i?"-ml-4 pl-6 pr-2":"px-2";let a;e[0]!==r?(a=E("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",r,"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]=r,e[1]=a):a=e[1];let o;e[2]!==l?(o=l&&s.jsx(Lt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=o):o=e[3];const d=l?"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]!==l||e[7]!==n||e[8]!==a||e[9]!==o||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:a,children:[o,c]}),e[6]=l,e[7]=n,e[8]=a,e[9]=o,e[10]=c,e[11]=m):m=e[11],m}function Hi(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function Gi(t){return t.member==="mine"&&!t.currentUserId}const as=4;let Ee=0;const it=[];function Ui(){for(;Ee<as&&it.length>0;){const t=it.shift();t&&t()}}function cs(t){return new Promise((e,n)=>{const l=()=>{Ee++,t().then(e,n).finally(()=>{Ee--,Ui()})};Ee<as?l():it.push(l)})}const We=10;function $t(t,e,n,l,i){const r={hidden:!1};l.member==="mine"&&l.currentUserId&&(r.created_by=l.currentUserId),l.type==="automation"&&(r.has_trigger=!0),l.type==="manual"&&(r.has_trigger=!1);const a={where:r,limit:i,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return a.status=e,a}function Wi(t,e,n,l){let i=0;for(const r of t)ds(r,e,n,l)&&i++;return i}function Ve(t,e,n,l){return Wi(t,e,n,l)}function qi(t,e){return!!(t>=We||t===0&&e)}function Tt(t,e){return t<e}function Ki(t,e){return e===!1?!1:e===!0?!0:t}function ds(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const Be=new Map,Fe=new Map;function Xi(t,e){return e?t>=We?!0:null:!1}function Mt(t){return Be.get(t)}function Vi(t,e){Be.set(t,e)}function Yi(t,e,n){const l=Be.get(t);if(l!==void 0){n(l);return}let i=Fe.get(t);i||(i=cs(e).then(r=>(Be.set(t,r),Fe.delete(t),r)).catch(()=>(Fe.delete(t),Promise.reject(new Error("group probe failed")))),Fe.set(t,i)),i.then(n,()=>n(!1))}function Ot(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===We,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Qi(t,e,n,l,i){let r=0;for(const a of t)e.has(a.id)||ds(a,n,l,i)&&r++;return r}function Ji(t,e,n,l){const i=$.c(8),{org:r}=se(),a=Hi(r.id,t,e,n);let o;i[0]!==n?(o=Gi(n),i[0]=n,i[1]=o):o=i[1];const d=o,[c,m]=L.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==a&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const u=bn(),{threads:f,hasMore:h}=ut(),g=Ve(f,t,e,n),j=qi(g,h),x=Xi(g,h),p=Yt();if(c.identity===a&&c.serverHasMore===null){const N=x??Mt(a);N!==void 0&&m({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:N})}!d&&c.identity===a&&c.serverHasMore===null&&x===null&&Mt(a)===void 0&&c.probeSubscribedIdentity!==a&&(m(N=>N.identity===a?{...N,isProbing:!0,probeSubscribedIdentity:a}:N),Yi(a,async()=>{const N=$t(t,e,0,n,1),S=await p.call("COLLECTION_THREADS_LIST",N),{totalCount:A}=Ot(S),k=Ve(u.threads.get(),t,e,n);return A===void 0?!1:Tt(k,A)},N=>{m(S=>S.identity!==a?S:{...S,isProbing:!1,serverHasMore:N})}));const y=async function(){if(c.isFetching||c.isProbing||d)return;const S=a;m(A=>A.identity===S?{...A,isFetching:!0}:A);try{const A=Ve(f,t,e,n),k=$t(t,e,A,n,We),z=await cs(()=>p.call("COLLECTION_THREADS_LIST",k)),{items:_,hasMore:I,totalCount:M}=Ot(z),H=new Set(f.map(Zi)),D=Qi(_,H,t,e,n),P=A;u.mergeThreads(_),m(O=>{if(O.identity!==S)return O;let F;return M!==void 0?F=Tt(P+D,M):F=_.length===0||D===0?!1:I,Vi(S,F),{...O,isFetching:!1,serverHasMore:F}})}catch(A){const k=A,z=k instanceof Error?k.message:String(k);re.error(`Could not load more tasks: ${z}`),m(_=>_.identity===S?{..._,isFetching:!1}:_)}},v=c.isFetching||c.isProbing,w=!d&&!v&&Ki(j,c.serverHasMore);let C;return i[2]!==v||i[3]!==y||i[4]!==w||i[5]!==c.isProbing||i[6]!==c.serverHasMore?(C={hasMore:w,isFetching:v,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:y},i[2]=v,i[3]=y,i[4]=w,i[5]=c.isProbing,i[6]=c.serverHasMore,i[7]=C):C=i[7],C}function Zi(t){return t.id}function el(t){const e=$.c(20),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,{isFetching:c,isProbing:m,loadMore:u,hasMore:f,serverHasMore:h}=Ji("status",n,d),[g,j]=L.useState(!1);!g&&l.length===0&&h===!0&&!c&&!m&&(j(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==i||e[1]!==o||e[2]!==d||e[3]!==a||e[4]!==r||e[5]!==l){let y;e[7]!==i||e[8]!==o||e[9]!==d||e[10]!==a||e[11]!==r?(y=v=>s.jsx(rs,{task:v,isActive:i===v.id,onClick:()=>r(v),onArchive:o&&v.created_by===d.currentUserId?()=>a(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[7]=i,e[8]=o,e[9]=d,e[10]=a,e[11]=r,e[12]=y):y=e[12],x=l.map(y),e[0]=i,e[1]=o,e[2]=d,e[3]=a,e[4]=r,e[5]=l,e[6]=x}else x=e[6];let p;e[13]!==f||e[14]!==c||e[15]!==u?(p=(f||c)&&s.jsx(os,{onClick:()=>{u()},isFetching:c,indented:!0}),e[13]=f,e[14]=c,e[15]=u,e[16]=p):p=e[16];let b;return e[17]!==x||e[18]!==p?(b=s.jsxs(s.Fragment,{children:[x,p]}),e[17]=x,e[18]=p,e[19]=b):b=e[19],b}function tl(t){const e=$.c(36),{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d}=t,c=Pn[n],m=c.icon,[u,f]=Bi(`status-${n}`,!1);let h;e[0]!==u||e[1]!==f?(h=function(){f(!u)},e[0]=u,e[1]=f,e[2]=h):h=e[2];const g=h;let j;e[3]!==g?(j=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),g())},e[3]=g,e[4]=j):j=e[4];let x;e[5]!==m||e[6]!==c.iconClassName?(x=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]=x):x=e[7];let p;e[8]!==u?(p=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(ht,{size:14}):s.jsx(Fn,{size:14})}),e[8]=u,e[9]=p):p=e[9];let b;e[10]!==x||e[11]!==p?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=b):b=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]!==l.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:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let w;e[17]!==u||e[18]!==g||e[19]!==j||e[20]!==b||e[21]!==y||e[22]!==v?(w=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:j,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:[b,y,v]}),e[17]=u,e[18]=g,e[19]=j,e[20]=b,e[21]=y,e[22]=v,e[23]=w):w=e[23];let C;e[24]!==i||e[25]!==o||e[26]!==u||e[27]!==d||e[28]!==a||e[29]!==r||e[30]!==n||e[31]!==l?(C=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(el,{status:n,threads:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:o,filters:d})}),e[24]=i,e[25]=o,e[26]=u,e[27]=d,e[28]=a,e[29]=r,e[30]=n,e[31]=l,e[32]=C):C=e[32];let N;return e[33]!==w||e[34]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[w,C]}),e[33]=w,e[34]=C,e[35]=N):N=e[35],N}function Pt(t){const e=$.c(38),{threads:n,groupBy:l,activeTaskId:i,onSelectTask:r,onArchiveTask:a,filters:o,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Tn,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];const p=u?"No threads match your filters":"No threads yet";let b;return e[1]!==p?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,s.jsx("p",{className:"text-sm",children:p})]}),e[1]=p,e[2]=b):b=e[2],b}const f=n.length>1||d;if(l==="status"){let x;if(e[3]!==i||e[4]!==f||e[5]!==o||e[6]!==a||e[7]!==r||e[8]!==n){let b;e[10]!==i||e[11]!==f||e[12]!==o||e[13]!==a||e[14]!==r?(b=y=>s.jsx(tl,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:r,onArchiveTask:a,canArchive:f,filters:o},y.status),e[10]=i,e[11]=f,e[12]=o,e[13]=a,e[14]=r,e[15]=b):b=e[15],x=Li(n).map(b),e[3]=i,e[4]=f,e[5]=o,e[6]=a,e[7]=r,e[8]=n,e[9]=x}else x=e[9];let p;return e[16]!==x?(p=s.jsx(s.Fragment,{children:x}),e[16]=x,e[17]=p):p=e[17],p}let h;if(e[18]!==i||e[19]!==f||e[20]!==o||e[21]!==a||e[22]!==r||e[23]!==n){let x;e[25]!==i||e[26]!==f||e[27]!==o||e[28]!==a||e[29]!==r?(x=p=>s.jsx(rs,{task:p,isActive:i===p.id,onClick:()=>r(p),onArchive:f&&p.created_by===o.currentUserId?()=>a(p):void 0,showAutomationBadge:!!p.trigger_id,showAgentIcon:!0},p.id),e[25]=i,e[26]=f,e[27]=o,e[28]=a,e[29]=r,e[30]=x):x=e[30],h=n.map(x),e[18]=i,e[19]=f,e[20]=o,e[21]=a,e[22]=r,e[23]=n,e[24]=h}else h=e[24];let g;e[31]!==d||e[32]!==c||e[33]!==m?(g=(d||c)&&s.jsx(os,{onClick:m,isFetching:c}),e[31]=d,e[32]=c,e[33]=m,e[34]=g):g=e[34];let j;return e[35]!==h||e[36]!==g?(j=s.jsxs(s.Fragment,{children:[h,g]}),e[35]=h,e[36]=g,e[37]=j):j=e[37],j}function sl(t,e,n){if(!n)return;const l=t.findIndex(i=>i.id===e);if(l!==-1){for(let i=l+1;i<t.length;i++){const r=t[i];if(r?.created_by===n)return r}for(let i=l-1;i>=0;i--){const r=t[i];if(r?.created_by===n)return r}}}function Dt(t){const e=$.c(17),{label:n,onClick:l,active:i,children:r}=t,[a,o]=L.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>o(!0),c=()=>o(!1),m=()=>o(!0),u=()=>o(!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=i&&"bg-sidebar-accent text-foreground";let h;e[4]!==f?(h=E(f),e[4]=f,e[5]=h):h=e[5];let g;e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==h?(g=s.jsx(de,{asChild:!0,children:s.jsx(ve,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:h,children:r})}),e[6]=r,e[7]=n,e[8]=l,e[9]=h,e[10]=g):g=e[10];let j;e[11]!==n?(j=s.jsx(me,{side:"bottom",children:n}),e[11]=n,e[12]=j):j=e[12];let x;return e[13]!==a||e[14]!==g||e[15]!==j?(x=s.jsxs(ue,{open:a,children:[g,j]}),e[13]=a,e[14]=g,e[15]=j,e[16]=x):x=e[16],x}function Ye(t){const e=$.c(13),{label:n,value:l,onChange:i,options:r}=t;let a;e[0]!==n?(a=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=a):a=e[1];let o;e[2]!==i?(o=u=>u&&i(u),e[2]=i,e[3]=o):o=e[3];let d;e[4]!==r?(d=r.map(nl),e[4]=r,e[5]=d):d=e[5];let c;e[6]!==o||e[7]!==d||e[8]!==l?(c=s.jsx(fn,{type:"single",size:"sm",value:l,onValueChange:o,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=o,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==a||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a,c]}),e[10]=a,e[11]=c,e[12]=m):m=e[12],m}function nl(t){return s.jsxs(un,{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 ms({onNavigate:t}={}){const{data:e}=ae.useSession(),n=e?.user?.id,{org:l}=se(),i=hn({connectionId:xn,orgId:l.id,orgSlug:l.slug}),r=Re(l.id).id,a=Xt(),{threads:o,hasMore:d,isFetchingMore:c,fetchNextPage:m}=ut(),u=o.filter(T=>!T.hidden),{hide:f}=Vt(),h=xe(),{setTaskId:g,createNewTask:j}=ft(),x=lt({strict:!1}),p=rt({strict:!1}),b=x.taskId??null,y=p.virtualmcpid??o.find(T=>T.id===b)?.virtual_mcp_id??null,v=()=>{t?.()},w=[...u].sort((T,G)=>(G.updated_at??"").localeCompare(T.updated_at??"")),[C,N]=L.useState("all"),[S,A]=L.useState("flat"),[k,z]=He("sidebar-threads-scope-all",!1),[_,I]=L.useState(!1),[M,H]=L.useState(!1),D={type:C,member:"mine",currentUserId:n??null},P=T=>n?T.filter(G=>G.created_by===n):[],O=T=>C==="automation"?T.filter(G=>!!G.trigger_id):C==="manual"?T.filter(G=>!G.trigger_id):T,F=P(w),B=O(F),Y=O(w),X=k?Y:B,U=T=>{if(n&&T.created_by&&T.created_by!==n)return;const G=T.id===b;if(f(T.id),!G)return;const V=sl(X,T.id,n);v(),V?g(V.id,V.virtual_mcp_id):h({to:"/$org",params:{org:l.slug}})},W=T=>{v(),g(T.id,T.virtual_mcp_id)},R=async T=>{try{const G=await i.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:T,limit:1,offset:0}});return((G.structuredContent??G).items?.length??0)===0}catch{return!1}},Z=async()=>{const T=y??r;oe("sidebar_new_thread_clicked",{virtual_mcp_id:T});const G=F.find(V=>V.virtual_mcp_id===T&&V.title==="New chat");if(G&&await R(G.id)){v(),g(G.id,T);return}v(),j(T)},{state:ge,isMobile:ee,toggleSidebar:fe}=pe();if(ge==="collapsed"&&!ee){const T=Re(l.id),G=new Map((a??[]).map(q=>[q.id,q])),V=q=>(q?G.get(q):void 0)??(q===r?T:void 0);return s.jsxs(ce,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:fe,children:s.jsx(Gt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})}),X.map(q=>{const ie=V(q.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:q.title||"New chat",isActive:q.id===b,onClick:()=>W(q),children:s.jsx(ye,{icon:ie?.icon??null,name:ie?.title??"Agent",size:"2xs"})})},q.id)})]})}const ne=S!=="flat"||C!=="all"||k===!0,he=s.jsxs(Ge,{children:[s.jsxs(ue,{children:[s.jsx(de,{asChild:!0,children:s.jsx(ze,{asChild:!0,children:s.jsxs(ve,{"aria-label":"Filter threads",active:ne,children:[s.jsx(mn,{size:16}),ne&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(me,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Ue,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(Ye,{label:"View",value:S,onChange:T=>{oe("tasks_panel_group_by_changed",{to_value:T}),A(T)},options:[{value:"flat",label:"List",icon:s.jsx(tn,{size:13})},{value:"status",label:"Status",icon:s.jsx(sn,{size:13})}]}),s.jsx(Ye,{label:"Type",value:C,onChange:T=>{oe("tasks_panel_filter_changed",{to_value:T}),N(T)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(Ye,{label:"Scope",value:k?"team":"mine",onChange:T=>z(T==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),je=T=>s.jsx(et,{delayDuration:300,children:s.jsxs("div",{className:E("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(Jt,{}),he]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Dt,{label:"Search threads",onClick:()=>{oe("tasks_panel_search_opened"),H(!0),I(!0)},children:s.jsx(en,{size:16})}),s.jsx(Dt,{label:"New thread",onClick:()=>{Z()},children:s.jsx(vt,{size:16})})]})]})});return ee?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[je(!0),s.jsx(At,{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(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})}),M&&s.jsx(It,{open:_,onOpenChange:I})]}):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(At,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:X,groupBy:S,activeTaskId:b,onSelectTask:W,onArchiveTask:U,filters:D,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ne})})}),M&&s.jsx(It,{open:_,onOpenChange:I})]})}const il=5,ll=[{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 us(){const t=$.c(3),{state:e}=pe();if(e==="collapsed"){let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:il}).map(al)}),t[0]=i):i=t[0],i}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(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"}),s.jsx(te,{className:"size-6 rounded-md"})]}),s.jsx(te,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=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:ll.map(rl)})]}),t[2]=l):l=t[2],l}function rl(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(te,{className:"size-5 rounded-full shrink-0"}),s.jsx(te,{className:E("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(ol)})]},e)}function ol(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(te,{className:"h-3 flex-1 rounded-sm"})},e)}function al(t,e){return s.jsx(te,{className:"size-10 rounded-lg mx-auto"},e)}function cl(){const t=$.c(4),e=ss();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Oi,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:s.jsx(us,{}),children:s.jsx(ms,{})})}),t[1]=l):l=t[1];let i;return t[2]!==e?(i=s.jsx(Zt,{children:s.jsx(ls,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=i):i=t[3],i}function dl(t){const e=$.c(8),{onClose:n}=t,l=ss();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Pi,{}),e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(us,{}),e[1]=r):r=e[1];let a;e[2]!==n?(a=s.jsx(Rt,{children:s.jsx(L.Suspense,{fallback:r,children:s.jsx(ms,{onNavigate:n})})}),e[2]=n,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==l||e[6]!==a?(o=s.jsx(Zt,{children:s.jsx(_i,{sections:l,onClose:n,footer:i,additionalContent:a})}),e[4]=n,e[5]=l,e[6]=a,e[7]=o):o=e[7],o}function fs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ml=ks({name:As().min(2,"Organization name is required")});function ul(t){const e=$.c(41),{open:n,onOpenChange:l}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={resolver:Is(ml),defaultValues:{name:""}},e[0]=i):i=e[0];const r=zs(i);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:hl,onSuccess:fl},e[1]=a):a=e[1];const o=$s(a),d=o.error instanceof Error?o.error.message:o.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Vn,{children:[s.jsx(Yn,{children:"Create a new organization"}),s.jsx(Qn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==o||e[4]!==r){let N;e[6]!==o?(N=S=>o.mutateAsync(S),e[6]=o,e[7]=N):N=e[7],m=r.handleSubmit(N),e[3]=o,e[4]=r,e[5]=m}else m=e[5];let u;e[8]!==r.formState.isSubmitting?(u=N=>{const{field:S}=N;return s.jsxs(si,{children:[s.jsx(ni,{children:"Organization Name"}),s.jsx(ii,{children:s.jsx(oi,{...S,placeholder:"Acme Inc.",disabled:r.formState.isSubmitting})}),s.jsx(li,{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:"","/",fs(S.value)]})]}),s.jsx(ri,{})]})},e[8]=r.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==r.control||e[11]!==u?(f=s.jsx(ei,{control:r.control,name:"name",render:u}),e[10]=r.control,e[11]=u,e[12]=f):f=e[12];let h;e[13]!==d?(h=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=h):h=e[14];let g;e[15]!==o||e[16]!==r?(g=()=>{o.reset(),r.reset()},e[15]=o,e[16]=r,e[17]=g):g=e[17];let j;e[18]!==r.formState.isSubmitting||e[19]!==g?(j=s.jsx(Kn,{disabled:r.formState.isSubmitting,onClick:g,children:"Cancel"}),e[18]=r.formState.isSubmitting,e[19]=g,e[20]=j):j=e[20];const x=!r.formState.isValid||r.formState.isSubmitting;let p;e[21]!==r.formState.isSubmitting?(p=r.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Hn,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=r.formState.isSubmitting,e[22]=p):p=e[22];let b;e[23]!==x||e[24]!==p?(b=s.jsx(Je,{type:"submit",variant:"default",disabled:x,children:p}),e[23]=x,e[24]=p,e[25]=b):b=e[25];let y;e[26]!==b||e[27]!==j?(y=s.jsxs(Jn,{children:[j,b]}),e[26]=b,e[27]=j,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==m||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=m,e[31]=f,e[32]=h,e[33]=v):v=e[33];let w;e[34]!==r||e[35]!==v?(w=s.jsxs(Xn,{children:[c,s.jsx(ti,{...r,children:v})]}),e[34]=r,e[35]=v,e[36]=w):w=e[36];let C;return e[37]!==l||e[38]!==n||e[39]!==w?(C=s.jsx(Zn,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=C):C=e[40],C}function fl(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function hl(t){const e=fs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await ae.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function hs(){const t=L.useContext(Ts),{data:e,refetch:n}=t.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>n?.()}}function xl(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function pt(t){const e=$.c(13),{org:n,size:l}=t,i=l===void 0?"sm":l,r=i==="xs"?"size-5":"size-6",a=i==="xs"?"text-[9px]":"text-xs";let o;e[0]!==r?(o=E(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=o):o=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:xl(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]!==a?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:E("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=c):c=e[8];let m;return e[9]!==o||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:o,style:d,children:c}),e[9]=o,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function pl({invitation:t,onChanged:e}){const[n,l]=L.useState(!1),i=t.organizationName??"Unknown organization",r=async()=>{l(!0);try{const d=await ae.organization.acceptInvitation({invitationId:t.id});if(d.error){re.error(d.error.message),l(!1);return}}catch{re.error("Failed to accept invitation"),l(!1);return}re.success(`Joined ${i}`),Os();let o;try{o=(await ae.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=o?`/${o}`:"/"},a=async()=>{l(!0);try{const o=await ae.organization.rejectInvitation({invitationId:t.id});if(o.error){re.error(o.error.message),l(!1);return}re.success("Invitation declined"),l(!1),e()}catch{re.error("Failed to decline invitation"),l(!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(pt,{org:{name:i},size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"truncate text-sm font-medium",children:i}),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(Je,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:r,disabled:n,children:"Accept"}),s.jsx(Je,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:a,disabled:n,"aria-label":`Decline invitation to ${i}`,children:s.jsx(qn,{size:14})})]})]})}function gl(t){const e=$.c(29),{orgParam:n,onSelectOrg:l,onCreateOrg:i}=t,{data:r}=Ms(),{invitations:a,refetch:o}=hs();let d;e[0]!==n?(d=(_,I)=>_.slug===n?-1:I.slug===n?1:_.name.localeCompare(I.name),e[0]=n,e[1]=d):d=e[1];const c=[...r??[]].sort(d),[m,u]=L.useState(""),f=m.toLowerCase(),h=f?c.filter(_=>_.name.toLowerCase().includes(f)||_.slug.toLowerCase().includes(f)):c;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ts,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=g):g=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=_=>u(_.target.value),e[3]=j):j=e[3];let x;e[4]!==m?(x=_=>_.key==="Escape"&&m&&u(""),e[4]=m,e[5]=x):x=e[5];let p;e[6]!==m||e[7]!==x?(p=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:m,onChange:j,onKeyDown:x,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]=x,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($e,{size:16}),e[9]=b):b=e[9];let y;e[10]!==i?(y=s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=i,e[11]=y):y=e[11];let v;e[12]!==p||e[13]!==y?(v=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[g,p,y]}),e[12]=p,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 C;e[15]!==a||e[16]!==m||e[17]!==o?(C=!m&&a.map(_=>s.jsx(pl,{invitation:_,onChanged:o},_.id)),e[15]=a,e[16]=m,e[17]=o,e[18]=C):C=e[18];const N=h.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]!==l||e[20]!==n?(S=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(pt,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[19]=l,e[20]=n,e[21]=S):S=e[21];const A=h.map(S);let k;e[22]!==C||e[23]!==N||e[24]!==A?(k=s.jsxs("div",{className:w,children:[C,N,A]}),e[22]=C,e[23]=N,e[24]=A,e[25]=k):k=e[25];let z;return e[26]!==k||e[27]!==v?(z=s.jsxs(s.Fragment,{children:[v,k]}),e[26]=k,e[27]=v,e[28]=z):z=e[28],z}function bl(t){const e=$.c(22),{trigger:n,orgParam:l,align:i,side:r}=t,a=i===void 0?"start":i,o=r===void 0?"bottom":r,d=xe(),[c,m]=L.useState(!1),[u,f]=L.useState(!1);let h;e[0]!==n?(h=s.jsx(ze,{asChild:!0,children:n}),e[0]=n,e[1]=h):h=e[1];const g=String(c);let j;e[2]!==d?(j=C=>{m(!1),d({to:"/$org",params:{org:C}})},e[2]=d,e[3]=j):j=e[3];let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{m(!1),f(!0)},e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==g||e[7]!==j?(p=s.jsx(gl,{orgParam:l,onSelectOrg:j,onCreateOrg:x},g),e[5]=l,e[6]=g,e[7]=j,e[8]=p):p=e[8];let b;e[9]!==a||e[10]!==o||e[11]!==p?(b=s.jsx(Ue,{side:o,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:vl,onCloseAutoFocus:jl,children:p}),e[9]=a,e[10]=o,e[11]=p,e[12]=b):b=e[12];let y;e[13]!==c||e[14]!==h||e[15]!==b?(y=s.jsxs(Ge,{open:c,onOpenChange:m,children:[h,b]}),e[13]=c,e[14]=h,e[15]=b,e[16]=y):y=e[16];let v;e[17]!==u?(v=s.jsx(ul,{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 jl(t){return t.preventDefault()}function vl(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function yl(t){const e=$.c(21),{value:n,onChange:l,placeholder:i,onKeyDown:r,className:a,isSearching:o,disabled:d}=t,c=i===void 0?"Search...":i;let m;e[0]!==a?(m=E("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=E("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let h;e[4]!==o?(h=o?s.jsx(Lt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=o,e[5]=h):h=e[5];let g;e[6]!==l?(g=b=>l(b.target.value),e[6]=l,e[7]=g):g=e[7];let j;e[8]!==d||e[9]!==r||e[10]!==c||e[11]!==g||e[12]!==n?(j=s.jsx("input",{type:"text",value:n,onChange:g,onKeyDown:r,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]=r,e[10]=c,e[11]=g,e[12]=n,e[13]=j):j=e[13];let x;e[14]!==f||e[15]!==h||e[16]!==j?(x=s.jsxs("label",{className:f,children:[h,j]}),e[14]=f,e[15]=h,e[16]=j,e[17]=x):x=e[17];let p;return e[18]!==m||e[19]!==x?(p=s.jsx("div",{className:m,children:x}),e[18]=m,e[19]=x,e[20]=p):p=e[20],p}const Sl="Select an existing agent";function Nl(t){const e=$.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(de,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(me,{side:"right",sideOffset:8,children:Sl}),e[2]=i):i=e[2];let r;return e[3]!==l?(r=s.jsxs(ue,{defaultOpen:!0,delayDuration:0,children:[l,i]}),e[3]=l,e[4]=r):r=e[4],r}function _l(t){const e=xe(),{create:n}=Vt(),{locator:l}=se(),i=lt({strict:!1}),r=rt({strict:!1});return async a=>{const o=crypto.randomUUID(),d=a===r.virtualmcpid?vn(t,l,i.taskId??""):null;try{await n({id:o,virtual_mcp_id:a,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:o},search:{virtualmcpid:a}})}}function Qe(t){const e=$.c(20),{agent:n,selected:l,onClick:i}=t,r=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=E("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let o;e[2]!==n.icon||e[3]!==n.title?(o=s.jsx(ye,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=o):o=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]!==l?(u=l&&s.jsx(es,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:i,className:a,children:[o,m,u]}),e[14]=i,e[15]=a,e[16]=o,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Ft(t){const e=$.c(5),{children:n,action:l}=t;let i;e[0]!==n?(i=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i?(r=s.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,l]}),e[2]=l,e[3]=i,e[4]=r):r=e[4],r}function Cl(t){const e=$.c(27),{onClose:n,onSelectAgent:l,selectedAgentId:i,onImportFromGithub:r}=t,[a,o]=L.useState(""),d=Xt(),c=d??[],{org:m}=se(),{data:u}=ae.useSession(),f=u?.user?.id??"anon",h=Ln(d),g=Rn(),j=_l(m.slug),x=an(d),p=a.toLowerCase(),b=c.filter(Il).filter(R=>!x.has(R.id)).filter(Al).filter(R=>!a||R.title.toLowerCase().includes(p)),y=b.filter(kl),v=b.filter(wl),w=Re(m.id),C=!a||w.title.toLowerCase().includes(p),N=!!(l&&C);let S;e[0]!==n||e[1]!==l?(S=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=S):S=e[2];const A=S,k=R=>{if(l){l(R.id),n(),o("");return}Bn({orgId:m.id,userId:f},R.id,h),g(),n(),o(""),j(R.id)},z="flex flex-col max-h-[min(640px,80dvh)]";let _;e[3]!==a?(_=s.jsx(yl,{value:a,onChange:o,placeholder:"Search agents..."}),e[3]=a,e[4]=_):_=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",M=l&&C&&w&&s.jsx(Qe,{agent:w,selected:!i||i===w.id,onClick:A}),H=v.length>0&&s.jsx(Ft,{children:"Agents"}),D=v.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id)),P=(y.length>0||!a)&&s.jsx(Ft,{action:s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[s.jsx(ci,{className:"size-3.5"}),"Import"]}),children:"Code Agents"}),O=y.map(R=>s.jsx(Qe,{agent:R,selected:l?i===R.id:void 0,onClick:()=>k(R)},R.id));let F;e[5]!==N||e[6]!==a||e[7]!==b.length?(F=b.length===0&&!N&&a&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:"No agents found"}),e[5]=N,e[6]=a,e[7]=b.length,e[8]=F):F=e[8];let B;e[9]!==F||e[10]!==M||e[11]!==H||e[12]!==D||e[13]!==P||e[14]!==O?(B=s.jsxs("div",{className:I,children:[M,H,D,P,O,F]}),e[9]=F,e[10]=M,e[11]=H,e[12]=D,e[13]=P,e[14]=O,e[15]=B):B=e[15];let Y;e[16]!==m.slug?(Y={org:m.slug},e[16]=m.slug,e[17]=Y):Y=e[17];let X;e[18]!==n?(X=()=>n(),e[18]=n,e[19]=X):X=e[19];let U;e[20]!==Y||e[21]!==X?(U=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ps,{to:"/$org/settings/agents",params:Y,onClick:X,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[20]=Y,e[21]=X,e[22]=U):U=e[22];let W;return e[23]!==B||e[24]!==U||e[25]!==_?(W=s.jsxs("div",{className:z,children:[_,B,U]}),e[23]=B,e[24]=U,e[25]=_,e[26]=W):W=e[26],W}function wl(t){return!Kt(t.metadata)}function kl(t){return Kt(t.metadata)}function Al(t){return!gn(t.id)}function Il(t){return!pn(t.id)}function zl(t){const e=$.c(31);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:i,onSelectAgent:r,selectedAgentId:a,side:o,align:d}=n,c=l===void 0?!1:l,m=o===void 0?"right":o,u=d===void 0?"start":d,[f,h]=L.useState(!1),[g,j]=L.useState(!1),x=ct(),{setOpenMobile:p}=pe(),b=En(),y=b?"border border-border":void 0;let v;e[2]!==b?(v=H=>b?s.jsx(Nl,{children:H}):H,e[2]=b,e[3]=v):v=e[3];const w=v;let C;e[4]!==x||e[5]!==p?(C=()=>{h(!1),x&&p(!1)},e[4]=x,e[5]=p,e[6]=C):C=e[6];const N=C;let S;e[7]!==N?(S=()=>{N(),j(!0)},e[7]=N,e[8]=S):S=e[8];const A=S;let k;e[9]!==N||e[10]!==A||e[11]!==r||e[12]!==f||e[13]!==a?(k=f&&s.jsx(L.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(te,{className:"h-4 w-24"})}),children:s.jsx(Cl,{onClose:N,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:A})}),e[9]=N,e[10]=A,e[11]=r,e[12]=f,e[13]=a,e[14]=k):k=e[14];const z=k;let _;e[15]!==u||e[16]!==c||e[17]!==y||e[18]!==b||e[19]!==x||e[20]!==f||e[21]!==z||e[22]!==m||e[23]!==i||e[24]!==w?(_=x?s.jsxs(s.Fragment,{children:[i?s.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:i}):c?w(s.jsx(ve,{"aria-label":"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:w(s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),onClick:()=>{oe("agent_browser_opened",{surface:"mobile_drawer"}),h(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Ut,{open:f,onOpenChange:h,direction:"bottom",children:s.jsxs(Wt,{className:"max-h-[85dvh] p-0",children:[s.jsx(qt,{className:"sr-only",children:"Browse agents"}),z]})})]}):s.jsxs(Ge,{open:f,onOpenChange:H=>{H&&!f&&oe("agent_browser_opened",{surface:"desktop_popover"}),h(H)},children:[i?s.jsx(ze,{asChild:!0,children:i}):c?w(s.jsx(ze,{asChild:!0,children:s.jsx(ve,{"aria-label":"Browse agents",className:E(y),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:w(s.jsx(ze,{asChild:!0,children:s.jsxs(J,{tooltip:b?void 0:"Browse agents",className:E(y),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ue,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:z})]}),e[15]=u,e[16]=c,e[17]=y,e[18]=b,e[19]=x,e[20]=f,e[21]=z,e[22]=m,e[23]=i,e[24]=w,e[25]=_):_=e[25];let I;e[26]!==g?(I=s.jsx(ai,{open:g,onOpenChange:j,mode:"agent"}),e[26]=g,e[27]=I):I=e[27];let M;return e[28]!==I||e[29]!==_?(M=s.jsxs(s.Fragment,{children:[_,I]}),e[28]=I,e[29]=_,e[30]=M):M=e[30],M}const $l="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 Tl(t){const e=$.c(19),{agentId:n,fallback:l,onOpenHome:i,onPick:r}=t,a=mt(n)??l??null,o=a?.title??"Super Agent",d=`Open ${o} home`,c=a?.icon??null;let m;e[0]!==c||e[1]!==o?(m=s.jsx(ye,{icon:c,name:o,size:"xs"}),e[0]=c,e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i||e[4]!==d||e[5]!==m?(u=s.jsx("button",{type:"button",onClick:i,"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]=i,e[4]=d,e[5]=m,e[6]=u):u=e[6];let f;e[7]!==o?(f=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let g;e[10]!==f?(g=s.jsxs("button",{type:"button",className:$l,children:[f,h]}),e[10]=f,e[11]=g):g=e[11];let j;e[12]!==n||e[13]!==r||e[14]!==g?(j=s.jsx(zl,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:g}),e[12]=n,e[13]=r,e[14]=g,e[15]=j):j=e[15];let x;return e[16]!==u||e[17]!==j?(x=s.jsxs("div",{className:"flex items-center gap-1",children:[u,j]}),e[16]=u,e[17]=j,e[18]=x):x=e[18],x}function Et(){const t=$.c(44),{org:e}=se(),{state:n,isMobile:l}=pe(),i=xe();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const a=lt(r);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[1]=o):o=t[1];const d=rt(o),{threads:c}=ut(),{data:m}=ae.useSession(),{setTaskId:u,createNewTask:f}=ft(),h=hs().invitations.length>0,g=n==="collapsed"||l;let j;t[2]!==e.id?(j=Re(e.id),t[2]=e.id,t[3]=j):j=t[3];const x=j,p=x.id,b=a.taskId?d.virtualmcpid??p:p;let y;t[4]!==f||t[5]!==p||t[6]!==i||t[7]!==e.slug||t[8]!==m?.user?.id||t[9]!==u||t[10]!==c?(y=F=>{if(!F||F===p){i({to:"/$org",params:{org:e.slug}});return}const B=di(c,F,m?.user?.id);B?u(B.id,F):f(F)},t[4]=f,t[5]=p,t[6]=i,t[7]=e.slug,t[8]=m?.user?.id,t[9]=u,t[10]=c,t[11]=y):y=t[11];const v=y,w=h?`${e.name} — switch organization (pending invitation)`:`${e.name} — switch organization`;let C;t[12]!==e?(C=s.jsx(pt,{org:e,size:"sm"}),t[12]=e,t[13]=C):C=t[13];let N;t[14]!==h||t[15]!==g?(N=h&&s.jsx("span",{className:E("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[14]=h,t[15]=g,t[16]=N):N=t[16];let S;t[17]!==C||t[18]!==N?(S=s.jsxs("span",{className:"relative inline-flex",children:[C,N]}),t[17]=C,t[18]=N,t[19]=S):S=t[19];let A;t[20]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ht,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[20]=A):A=t[20];let k;t[21]!==w||t[22]!==S?(k=s.jsx(de,{asChild:!0,children:s.jsxs("button",{type:"button","aria-label":w,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,A]})}),t[21]=w,t[22]=S,t[23]=k):k=t[23];let z;t[24]!==e.slug||t[25]!==k?(z=s.jsx(bl,{orgParam:e.slug,trigger:k}),t[24]=e.slug,t[25]=k,t[26]=z):z=t[26];let _;t[27]!==e.name?(_=s.jsx(me,{side:"bottom",children:e.name}),t[27]=e.name,t[28]=_):_=t[28];let I;t[29]!==z||t[30]!==_?(I=s.jsx(St,{children:s.jsxs(ue,{children:[z,_]})}),t[29]=z,t[30]=_,t[31]=I):I=t[31];let M;t[32]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),t[32]=M):M=t[32];const H=b===p?x:void 0;let D;t[33]!==b||t[34]!==v?(D=()=>v(b),t[33]=b,t[34]=v,t[35]=D):D=t[35];let P;t[36]!==b||t[37]!==v||t[38]!==H||t[39]!==D?(P=s.jsx(St,{children:s.jsx(L.Suspense,{fallback:M,children:s.jsx(Tl,{agentId:b,fallback:H,onOpenHome:D,onPick:v})})}),t[36]=b,t[37]=v,t[38]=H,t[39]=D,t[40]=P):P=t[40];let O;return t[41]!==I||t[42]!==P?(O=s.jsx(Un,{className:"wco-no-drag",children:s.jsxs(Wn,{className:"flex-nowrap gap-1.5 sm:gap-1.5",children:[I,P]})}),t[41]=I,t[42]=P,t[43]=O):O=t[43],O}const Ml="sidebar.open";function Ol(){const t=$.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fs,{}),t[0]=e):e=t[0],e}function Ko(){const t=$.c(27),e=ct(),n=mi(),[l,i]=He(Ml,!1),{width:r,wrapperRef:a,onStartResize:o,resetWidth:d}=xi();let c;t[0]!==e||t[1]!==n?(c=e?s.jsxs(Q.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:[!n&&s.jsx(Jt,{}),!n&&s.jsx(Et,{}),!n&&s.jsx(nt,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Q.TogglesSlot,{}),!n&&s.jsx(Q.TabsSlot,{className:"min-w-0 justify-self-end"})]}),!n&&s.jsx(Q.CenterSlot,{}),!n&&s.jsx(Q.RightSlot,{})]}):s.jsxs(Q.Header,{children:[s.jsxs(Q.LeftColumn,{children:[!n&&s.jsx(Et,{}),s.jsx(Q.TogglesSlot,{})]}),n?s.jsx("div",{"aria-hidden":!0}):s.jsx(Q.CenterSlot,{}),s.jsx(Q.RightColumn,{children:!n&&s.jsxs(s.Fragment,{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(Q.TabsSlot,{})}),s.jsx(Q.RightSlot,{})]})})]}),t[0]=e,t[1]=n,t[2]=c):c=t[2];const m=`${r}px`;let u;t[3]!==m?(u={"--sidebar-width":m,"--sidebar-width-icon":"3.5rem"},t[3]=m,t[4]=u):u=t[4];const f=u;let h;t[5]!==e||t[6]!==o||t[7]!==n||t[8]!==d?(h=!e&&!n&&s.jsxs(s.Fragment,{children:[s.jsx(cl,{}),s.jsx(ui,{onPointerDown:o,onDoubleClick:d})]}),t[5]=e,t[6]=o,t[7]=n,t[8]=d,t[9]=h):h=t[9];let g;t[10]===Symbol.for("react.memo_cache_sentinel")?(g={background:"transparent",containerType:"inline-size"},t[10]=g):g=t[10];let j;t[11]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Rs,{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(Ol,{}),children:s.jsx(Ds,{})})})})}),t[11]=j):j=t[11];let x;t[12]!==f||t[13]!==h||t[14]!==a?(x=s.jsxs(Bs,{ref:a,className:"flex-1 bg-sidebar relative min-h-0",style:f,children:[h,j]}),t[12]=f,t[13]=h,t[14]=a,t[15]=x):x=t[15];let p;t[16]!==e||t[17]!==n?(p=e&&!n&&s.jsx($n,{renderSidebar:Pl}),t[16]=e,t[17]=n,t[18]=p):p=t[18];let b;t[19]!==c||t[20]!==x||t[21]!==p?(b=s.jsx(Gn,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,p]})}),t[19]=c,t[20]=x,t[21]=p,t[22]=b):b=t[22];let y;return t[23]!==i||t[24]!==l||t[25]!==b?(y=s.jsx(jn,{children:s.jsx(Q.Provider,{children:s.jsx(Hs,{open:l,onOpenChange:i,children:b})})}),t[23]=i,t[24]=l,t[25]=b,t[26]=y):y=t[26],y}function Pl(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(dl,{onClose:e})})})}export{Ko 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-Tu7JB-s1.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-Dgf9uMoE.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,4 +1,4 @@
1
- import{r as a,aJ as R}from"./index-Tu7JB-s1.js";function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as a,aJ as R}from"./index-Dgf9uMoE.js";function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ne(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oe(e,t){if(e==null)return{};var r,n,o=je(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function je(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Me(e,t){return me(e)||ye(e,t)||Ee(e,t)||we()}function Pe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e){var t=Pe(e,"string");return typeof t=="symbol"?t:t+""}function Ee(e,t){if(e){if(typeof e=="string")return re(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}function Re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ie(Object(r),!0).forEach(function(n){Re(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ie(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function A(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function F(e){return{}.toString.call(e).includes("Object")}function Te(e){return!Object.keys(e).length}function D(e){return typeof e=="function"}function Ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Le(e,t){return F(t)||P("changeType"),Object.keys(t).some(function(r){return!Ce(e,r)})&&P("changeField"),t}function Ae(e){D(e)||P("selectorType")}function $e(e){D(e)||F(e)||P("handlerType"),F(e)&&Object.values(e).some(function(t){return!D(t)})&&P("handlersType")}function De(e){e||P("initialIsRequired"),F(e)||P("initialType"),Te(e)&&P("initialContent")}function Ve(e,t){throw new Error(e[t]||e.default)}var xe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},P=A(Ve)(xe),q={changes:Le,selector:Ae,handler:$e,initial:De};function Ne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};q.initial(e),q.handler(t);var r={current:e},n=A(Fe)(r,t),o=A(ze)(r),i=A(q.changes)(e),c=A(qe)(r);function s(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(j){return j};return q.selector(p),p(r.current)}function f(p){Ie(n,o,i,c)(p)}return[s,f]}function qe(e,t){return D(t)?t(e.current):t}function ze(e,t){return e.current=ae(ae({},e.current),t),t}function Fe(e,t,r){return D(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Ue={create:Ne},He={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function We(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function Be(e){return{}.toString.call(e).includes("Object")}function Ke(e){return e||ue("configIsRequired"),Be(e)||ue("configType"),e.urls?(Ge(),{paths:{vs:e.urls.monacoBase}}):e}function Ge(){console.warn(ce.deprecation)}function Je(e,t){throw new Error(e[t]||e.default)}var ce={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
3
  You are using deprecated way of configuration.
4
4