decocms 2.293.6 → 2.293.8

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 (257) hide show
  1. package/dist/client/assets/{AlertCircle-B36A2QFL.js → AlertCircle-DveGq_Ka.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-D_zb4lb6.js → ArrowNarrowLeft-DHWYg1cd.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-prk50uPs.js → ArrowUpRight-CCBySLzZ.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-DvfXIdQt.js → CheckCircle-6bGazfo7.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-zvKs0N1K.js → ChevronDown-Bg0fGsAy.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-CrrqW2bG.js → ChevronRight-DMa-ECep.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-C2TIKwJI.js → ChevronUp-hL_C00tb.js} +1 -1
  8. package/dist/client/assets/{Container-BwL3l59c.js → Container-L4zxxTEg.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-C460ds4l.js → DotsVertical-DCxBI0BW.js} +1 -1
  10. package/dist/client/assets/{LinkExternal01-DeoOpOv1.js → LinkExternal01-BQ6T0Nws.js} +1 -1
  11. package/dist/client/assets/{Lock01-BBt_3y58.js → Lock01-0zry6wgC.js} +1 -1
  12. package/dist/client/assets/{Palette-CVLiEeLT.js → Palette-Cd-fSUE0.js} +1 -1
  13. package/dist/client/assets/{Play-tvrVvpTR.js → Play-PF2rNc4W.js} +1 -1
  14. package/dist/client/assets/{Plus-DCdnDXDt.js → Plus-DYo953wk.js} +1 -1
  15. package/dist/client/assets/{RefreshCcw01-Bd065eP7.js → RefreshCcw01-D1Vi0tae.js} +1 -1
  16. package/dist/client/assets/{SearchMd-D8Xoii_h.js → SearchMd-BxcVY0hk.js} +1 -1
  17. package/dist/client/assets/{Settings02-D9douFDH.js → Settings02-DfEUH8Vu.js} +1 -1
  18. package/dist/client/assets/{Shield01-dq85_WX6.js → Shield01-DkQy31Nt.js} +1 -1
  19. package/dist/client/assets/{Star01-BXrQ4_4P.js → Star01-B6ksoZr0.js} +1 -1
  20. package/dist/client/assets/{Sun-R7St0ooF.js → Sun-vFyK4_Ll.js} +1 -1
  21. package/dist/client/assets/{Tool01-C_nOjbFb.js → Tool01-Cb8li5k6.js} +1 -1
  22. package/dist/client/assets/{Trash01-piHhA1eY.js → Trash01-CqSlmOZQ.js} +1 -1
  23. package/dist/client/assets/{User01-Bs9zIKNa.js → User01-BHjwWDd7.js} +1 -1
  24. package/dist/client/assets/{Users03-DIGegSk9.js → Users03-CsGzKQhD.js} +1 -1
  25. package/dist/client/assets/{X-BvHt2ACZ.js → X-BSw526sh.js} +1 -1
  26. package/dist/client/assets/{XCircle-CBTxKfVv.js → XCircle-DGL-4U6P.js} +1 -1
  27. package/dist/client/assets/{XClose-ClpH7cE3.js → XClose-DfM5GjZF.js} +1 -1
  28. package/dist/client/assets/{Zap-B5sJ2alW.js → Zap-D55ucbXC.js} +1 -1
  29. package/dist/client/assets/{ZapSquare-CbT6zl12.js → ZapSquare-T3gHYvlz.js} +1 -1
  30. package/dist/client/assets/{accordion-Bh379PEA.js → accordion-BEf7bBJ7.js} +1 -1
  31. package/dist/client/assets/{agent-icon-uqjsUoaF.js → agent-icon-ChIrIWeW.js} +1 -1
  32. package/dist/client/assets/{agents-list-B6L5Q5Zn.js → agents-list-DdL2YfiV.js} +1 -1
  33. package/dist/client/assets/ai-providers-ObNEA0nx.js +1 -0
  34. package/dist/client/assets/{alert-dialog-BfcKMjjX.js → alert-dialog-D6jDWQW-.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-DUNq5XHY.js → auth-catchall-M0Jr5kFb.js} +1 -1
  36. package/dist/client/assets/{automation-list-row-BrbGouri.js → automation-list-row-Csh5lumM.js} +1 -1
  37. package/dist/client/assets/{automations-C6bk3hZS.js → automations-obZ5ZVAW.js} +1 -1
  38. package/dist/client/assets/{avatar-CyEGSKtu.js → avatar-CKkXwPlY.js} +1 -1
  39. package/dist/client/assets/{badge-VknisCwy.js → badge-yfBx4pKw.js} +1 -1
  40. package/dist/client/assets/{brand-context-BUiFxx-T.js → brand-context-DVAt0TKP.js} +1 -1
  41. package/dist/client/assets/{card-CDg5dztz.js → card-e-NpS5kl.js} +1 -1
  42. package/dist/client/assets/{chat-context-3wRDl-0M.js → chat-context-GRw0JUF-.js} +1 -1
  43. package/dist/client/assets/{checkbox-DLLDWIMe.js → checkbox-BWpfDwfi.js} +1 -1
  44. package/dist/client/assets/{collection-detail-BpIwnPMm.js → collection-detail-DOCM2IPO.js} +1 -1
  45. package/dist/client/assets/{collection-display-button-BsjL3adv.js → collection-display-button-BANI3stw.js} +1 -1
  46. package/dist/client/assets/{collection-search-5l9uPvgc.js → collection-search-DyFOds5R.js} +1 -1
  47. package/dist/client/assets/{collection-search-Di0TLKJL.js → collection-search-w3FCfjcj.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-Dhk_qxSm.js → collection-table-wrapper-Ro_jHI87.js} +1 -1
  49. package/dist/client/assets/{collection-tabs-BL2oSzPM.js → collection-tabs-BI0p7qpI.js} +1 -1
  50. package/dist/client/assets/{collections-CtzwlTej.js → collections-FijcH0pF.js} +1 -1
  51. package/dist/client/assets/{command-BA7x9fW7.js → command-nLSAlSuK.js} +1 -1
  52. package/dist/client/assets/{connection-card-BSH7EoZy.js → connection-card-wj_vHsSr.js} +1 -1
  53. package/dist/client/assets/{connection-detail-CI6ot1Hj.js → connection-detail-BvUUuCYo.js} +1 -1
  54. package/dist/client/assets/{connection-form-helpers-D3WtQeaM.js → connection-form-helpers-WMrQb6eb.js} +1 -1
  55. package/dist/client/assets/{connections-PEnh9Ql_.js → connections-D0bzAtOI.js} +1 -1
  56. package/dist/client/assets/{constants-ZGqIPRMK.js → constants-ChdU9xvz.js} +1 -1
  57. package/dist/client/assets/{constants-Bqmqc-6F.js → constants-D7vrREO4.js} +1 -1
  58. package/dist/client/assets/{dialog-C0dpGuB7.js → dialog-B0QYUD88.js} +1 -1
  59. package/dist/client/assets/{domain-settings-BMXPrmSK.js → domain-settings-9Q2boaGd.js} +1 -1
  60. package/dist/client/assets/{drawer-CxUmUy4j.js → drawer-B9QExE6j.js} +1 -1
  61. package/dist/client/assets/{dropdown-menu-CoOX5aZM.js → dropdown-menu-Dqqv-DxC.js} +1 -1
  62. package/dist/client/assets/{dynamic-plugin-layout-vT_xywFG.js → dynamic-plugin-layout-BVAHZf_l.js} +1 -1
  63. package/dist/client/assets/{empty-state-DjJ40wiI.js → empty-state-Brbj3WdC.js} +1 -1
  64. package/dist/client/assets/{empty-state-BJ76SNy0.js → empty-state-CtpU7jLB.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-t_2K4cBF.js → extract-connection-data-BdGRQa2R.js} +1 -1
  66. package/dist/client/assets/{features-Ym7epI5Z.js → features-CW2iqt4o.js} +1 -1
  67. package/dist/client/assets/{form-BF1TVr5l.js → form-CEqJ4N_7.js} +1 -1
  68. package/dist/client/assets/{general-B4tCSuG_.js → general-DfPdaroT.js} +1 -1
  69. package/dist/client/assets/{index-347gk0z9.js → index-B6VjlsLE.js} +1 -1
  70. package/dist/client/assets/index-B6jYwthz.js +1 -0
  71. package/dist/client/assets/{index-Ci8I0QKD.js → index-B9-yB4gn.js} +1 -1
  72. package/dist/client/assets/{index-DfFbc2bO.js → index-Bf3SCl0m.js} +3 -3
  73. package/dist/client/assets/{index-Bgunsvif.js → index-BsAZNtTY.js} +1 -1
  74. package/dist/client/assets/{index-Dd0NcmiX.js → index-C-hC1pHz.js} +1 -1
  75. package/dist/client/assets/{index-CBdskEJ7.js → index-C2C_Qiwh.js} +1 -1
  76. package/dist/client/assets/{index-D8fWr4mz.js → index-CZs7_uJZ.js} +1 -1
  77. package/dist/client/assets/{index-BFjT-crD.js → index-CwWV7ZbX.js} +1 -1
  78. package/dist/client/assets/{index-DWwQ7XZg.js → index-DCHF8zOG.js} +1 -1
  79. package/dist/client/assets/{index-CQwCzeUz.js → index-DRficqI-.js} +1 -1
  80. package/dist/client/assets/{index-CaxU6TyW.js → index-DcVnAzZR.js} +1 -1
  81. package/dist/client/assets/{index-B_1fESAt.js → index-O-xThSQt.js} +2 -2
  82. package/dist/client/assets/{index-D4F9AXm5.js → index-VDFVZp7i.js} +1 -1
  83. package/dist/client/assets/{index-BzHumkeW.js → index-dnp-3LXJ.js} +1 -1
  84. package/dist/client/assets/{index-D7ixneQ1.js → index-wTKQdlAH.js} +1 -1
  85. package/dist/client/assets/{infiniteQueryObserver-id8Zt-Pu.js → infiniteQueryObserver-BVq9Pm2a.js} +1 -1
  86. package/dist/client/assets/{input-DlBRDd00.js → input-oRQz03qA.js} +1 -1
  87. package/dist/client/assets/{integration-icon-BAE9XfFI.js → integration-icon-Dl850mlU.js} +1 -1
  88. package/dist/client/assets/{label-DKjVlGi5.js → label-C1-enMbO.js} +1 -1
  89. package/dist/client/assets/{layout-DSmcief8.js → layout-DNdIWyZp.js} +1 -1
  90. package/dist/client/assets/{lean-canvas-recruit-modal-CzSXUxqV.js → lean-canvas-recruit-modal-CRZY0Eb-.js} +1 -1
  91. package/dist/client/assets/{login-BihOw7ES.js → login-BfUv2H8w.js} +1 -1
  92. package/dist/client/assets/{members-PB45bKL5.js → members-CCgRCx0J.js} +1 -1
  93. package/dist/client/assets/{monaco-editor-C7PfwMbs.js → monaco-editor-u9gnS6t8.js} +1 -1
  94. package/dist/client/assets/{monitoring-stats-row-B87SiVhj.js → monitoring-stats-row--8mo81f4.js} +1 -1
  95. package/dist/client/assets/{oauth-callback-D5KyMYTE.js → oauth-callback-CXfLfK0p.js} +1 -1
  96. package/dist/client/assets/{oauth-callback-ai-provider-BY91oved.js → oauth-callback-ai-provider-CBc0oyoe.js} +1 -1
  97. package/dist/client/assets/{onboarding-Cy219VmV.js → onboarding-CvXVvrci.js} +1 -1
  98. package/dist/client/assets/{org-layout-Cg1DoCt9.js → org-layout-uft5TcR0.js} +1 -1
  99. package/dist/client/assets/{org-plugin-layout-BSgk8VaO.js → org-plugin-layout-BCAbckW3.js} +1 -1
  100. package/dist/client/assets/{pair-D0mM1A08.js → pair-D89tt-Oa.js} +1 -1
  101. package/dist/client/assets/{plugin-empty-state-BFnBNaHD.js → plugin-empty-state-CdC4a2f5.js} +1 -1
  102. package/dist/client/assets/{plugin-header-BemMW4gi.js → plugin-header-C436xgxX.js} +1 -1
  103. package/dist/client/assets/{plugin-layout-DTk8UBSr.js → plugin-layout-Ck_aFT7l.js} +1 -1
  104. package/dist/client/assets/{popover-Ba35MO8M.js → popover-Co2M62hE.js} +1 -1
  105. package/dist/client/assets/{profile-DG3VH4yz.js → profile-D8aA_SfN.js} +1 -1
  106. package/dist/client/assets/{project-app-view-B5c7GDWg.js → project-app-view-BQN6gYM4.js} +1 -1
  107. package/dist/client/assets/registry-F9ZprpXD.js +2 -0
  108. package/dist/client/assets/{registry-layout-DrEu9Tla.js → registry-layout-CDOchZNA.js} +1 -1
  109. package/dist/client/assets/{required-auth-layout-DTf-XicG.js → required-auth-layout-WPul4l6C.js} +1 -1
  110. package/dist/client/assets/{reset-password-C11C0772.js → reset-password-CCvsOolV.js} +1 -1
  111. package/dist/client/assets/{roles-CfCPlZBu.js → roles-CfoKq5oL.js} +1 -1
  112. package/dist/client/assets/{scroll-area-4Wx11tev.js → scroll-area-ePY6ucBL.js} +1 -1
  113. package/dist/client/assets/{search-input-DiAyKzXg.js → search-input-BA02UXZa.js} +1 -1
  114. package/dist/client/assets/{select--87U19hV.js → select-Cq_PvnKV.js} +1 -1
  115. package/dist/client/assets/{select-model-Dbd7p4ZE.js → select-model-BpJHvnyq.js} +1 -1
  116. package/dist/client/assets/{settings-layout-BqlvM4Ae.js → settings-layout-Dl8RrXAU.js} +1 -1
  117. package/dist/client/assets/{settings-section-D9sIYM4E.js → settings-section-BzS4xloW.js} +1 -1
  118. package/dist/client/assets/{shell-layout-Bmt2rqH0.js → shell-layout-DOMzE0SQ.js} +1 -1
  119. package/dist/client/assets/{skeleton-2Lz1swUi.js → skeleton-YcXGprZE.js} +1 -1
  120. package/dist/client/assets/{sso-C0TBvJFJ.js → sso-pG-n5D-C.js} +1 -1
  121. package/dist/client/assets/{store-7St-Sg6Q.js → store-DsWe3E_F.js} +1 -1
  122. package/dist/client/assets/store-registry-C1Sfy2sE.js +2 -0
  123. package/dist/client/assets/{switch-RVSo8CsZ.js → switch-BjSXi4cA.js} +1 -1
  124. package/dist/client/assets/{table-BEKnSYlw.js → table-q-k_hgAt.js} +1 -1
  125. package/dist/client/assets/{tabs-17p9c1Bg.js → tabs-C3iMtl0f.js} +1 -1
  126. package/dist/client/assets/{task-status-DrWeBrHL.js → task-status-jHWa41cV.js} +1 -1
  127. package/dist/client/assets/{textarea-D1NCT9Ub.js → textarea-BSpBSpMd.js} +1 -1
  128. package/dist/client/assets/{toggle-group-D1vplWsf.js → toggle-group-Z4_K_UMR.js} +1 -1
  129. package/dist/client/assets/{tools-list-h7vXh3gp.js → tools-list-DVlfSdCs.js} +1 -1
  130. package/dist/client/assets/{tooltip-B5RH0Km9.js → tooltip-CZKTj_88.js} +1 -1
  131. package/dist/client/assets/{types-5cCv0JMn.js → types-CTCqQWQm.js} +1 -1
  132. package/dist/client/assets/{use-ai-providers-C3NPNTdO.js → use-ai-providers-Bi5zwgNs.js} +1 -1
  133. package/dist/client/assets/{use-collections-Cp-zu_zb.js → use-collections-DpHr_hEj.js} +1 -1
  134. package/dist/client/assets/{use-connection-CKuqMHym.js → use-connection-Dkzl6ATr.js} +1 -1
  135. package/dist/client/assets/{use-copy-BM98uFIV.js → use-copy-CpuPfSHn.js} +1 -1
  136. package/dist/client/assets/{use-create-virtual-mcp-C8T5-fz3.js → use-create-virtual-mcp-BDDTbSDu.js} +1 -1
  137. package/dist/client/assets/{use-decopilot-events-hmCe1Nt8.js → use-decopilot-events-DfNhZiit.js} +1 -1
  138. package/dist/client/assets/{use-delete-connection-lX3xMRUW.js → use-delete-connection-DzmSSfSC.js} +1 -1
  139. package/dist/client/assets/{use-infinite-scroll-BocX6YNl.js → use-infinite-scroll-ZB6EnEL9.js} +1 -1
  140. package/dist/client/assets/{use-list-state-DNfZutsz.js → use-list-state-BxmWtMlf.js} +1 -1
  141. package/dist/client/assets/{use-mcp-tools-C9wUjtZc.js → use-mcp-tools-dN493Per.js} +1 -1
  142. package/dist/client/assets/{use-members-CsbuiRG3.js → use-members-BLQ9W5Dc.js} +1 -1
  143. package/dist/client/assets/{use-navigate-to-agent-BcuhYECi.js → use-navigate-to-agent-CBd-r96N.js} +1 -1
  144. package/dist/client/assets/{use-org-sso-Bk9sywkV.js → use-org-sso-Fy8p-ia7.js} +1 -1
  145. package/dist/client/assets/{use-organization-roles-BgHdRJZO.js → use-organization-roles-BY5zQhyp.js} +1 -1
  146. package/dist/client/assets/{use-organization-settings-CpbTKlON.js → use-organization-settings-BiTIuKde.js} +1 -1
  147. package/dist/client/assets/{use-registry-connections-BI43PAyv.js → use-registry-connections-B1h0NOZd.js} +1 -1
  148. package/dist/client/assets/{use-status-sounds-BJlWtU13.js → use-status-sounds-ChN-g_Kb.js} +1 -1
  149. package/dist/client/assets/{use-tasks-BxKxyAeq.js → use-tasks-CMJbyrNa.js} +1 -1
  150. package/dist/client/assets/{use-view-mode-DF7a89_i.js → use-view-mode-BglVjHEt.js} +1 -1
  151. package/dist/client/assets/{use-virtual-mcp-DsNfIZ6r.js → use-virtual-mcp-Cn-xT_JW.js} +1 -1
  152. package/dist/client/assets/useInfiniteQuery-BTmoYoSz.js +1 -0
  153. package/dist/client/assets/useSuspenseInfiniteQuery-D3qWdmTu.js +1 -0
  154. package/dist/client/assets/{user-BX6OkEuV.js → user-BnKZSLel.js} +1 -1
  155. package/dist/client/assets/{view-mode-toggle-mNMGuWyS.js → view-mode-toggle-BueYVsWt.js} +1 -1
  156. package/dist/client/assets/{workflow-0blabLpU.js → workflow-DbzdHDRp.js} +1 -1
  157. package/dist/client/assets/workflow-detail-D1gDF37Z.js +1 -0
  158. package/dist/client/index.html +1 -1
  159. package/dist/server/cli.js +4 -4
  160. package/dist/server/migrate.js +88 -88
  161. package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
  162. package/dist/server/node_modules/ansi-styles/index.js +223 -0
  163. package/dist/server/node_modules/{slice-ansi → ansi-styles}/license +0 -1
  164. package/dist/server/node_modules/ansi-styles/package.json +54 -0
  165. package/dist/server/node_modules/ansi-styles/readme.md +173 -0
  166. package/dist/server/node_modules/environment/index.d.ts +74 -0
  167. package/dist/server/node_modules/environment/index.js +47 -0
  168. package/dist/server/node_modules/environment/license +9 -0
  169. package/dist/server/node_modules/environment/package.json +74 -0
  170. package/dist/server/node_modules/environment/readme.md +94 -0
  171. package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
  172. package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
  173. package/dist/server/node_modules/escape-string-regexp/license +9 -0
  174. package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
  175. package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
  176. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  177. package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
  178. package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
  179. package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
  180. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
  181. package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
  182. package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
  183. package/dist/server/node_modules/is-unicode-supported/license +9 -0
  184. package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
  185. package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
  186. package/dist/server/node_modules/mimic-fn/index.d.ts +54 -0
  187. package/dist/server/node_modules/mimic-fn/index.js +13 -0
  188. package/dist/server/node_modules/mimic-fn/license +9 -0
  189. package/dist/server/node_modules/mimic-fn/package.json +42 -0
  190. package/dist/server/node_modules/mimic-fn/readme.md +69 -0
  191. package/dist/server/node_modules/pg-int8/LICENSE +13 -0
  192. package/dist/server/node_modules/pg-int8/README.md +16 -0
  193. package/dist/server/node_modules/pg-int8/index.js +100 -0
  194. package/dist/server/node_modules/pg-int8/package.json +24 -0
  195. package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
  196. package/dist/server/node_modules/postgres-array/index.js +97 -0
  197. package/dist/server/node_modules/{pg/LICENSE → postgres-array/license} +6 -6
  198. package/dist/server/node_modules/postgres-array/package.json +35 -0
  199. package/dist/server/node_modules/postgres-array/readme.md +43 -0
  200. package/dist/server/node_modules/postgres-bytea/index.js +33 -0
  201. package/dist/server/node_modules/postgres-bytea/license +21 -0
  202. package/dist/server/node_modules/postgres-bytea/package.json +34 -0
  203. package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
  204. package/dist/server/node_modules/postgres-date/index.js +116 -0
  205. package/dist/server/node_modules/postgres-date/license +21 -0
  206. package/dist/server/node_modules/postgres-date/package.json +33 -0
  207. package/dist/server/node_modules/postgres-date/readme.md +49 -0
  208. package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
  209. package/dist/server/node_modules/postgres-interval/index.js +125 -0
  210. package/dist/server/node_modules/postgres-interval/license +21 -0
  211. package/dist/server/node_modules/postgres-interval/package.json +36 -0
  212. package/dist/server/node_modules/postgres-interval/readme.md +48 -0
  213. package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
  214. package/dist/server/node_modules/restore-cursor/index.js +11 -0
  215. package/dist/server/node_modules/restore-cursor/license +9 -0
  216. package/dist/server/node_modules/restore-cursor/package.json +55 -0
  217. package/dist/server/node_modules/restore-cursor/readme.md +31 -0
  218. package/dist/server/node_modules/string-width/index.d.ts +39 -0
  219. package/dist/server/node_modules/string-width/index.js +82 -0
  220. package/dist/server/node_modules/string-width/license +9 -0
  221. package/dist/server/node_modules/string-width/package.json +64 -0
  222. package/dist/server/node_modules/string-width/readme.md +66 -0
  223. package/dist/server/server.js +1 -1
  224. package/package.json +1 -1
  225. package/dist/client/assets/ai-providers-CZnpdKmu.js +0 -1
  226. package/dist/client/assets/index-obfh5IKG.js +0 -1
  227. package/dist/client/assets/registry-CtVQc7mn.js +0 -2
  228. package/dist/client/assets/store-registry-98NJFUc3.js +0 -2
  229. package/dist/client/assets/useInfiniteQuery-CiV7khlb.js +0 -1
  230. package/dist/client/assets/useSuspenseInfiniteQuery-B0TtatHe.js +0 -1
  231. package/dist/client/assets/workflow-detail-BcWS9L9d.js +0 -1
  232. package/dist/server/node_modules/pg/README.md +0 -95
  233. package/dist/server/node_modules/pg/esm/index.mjs +0 -20
  234. package/dist/server/node_modules/pg/lib/client.js +0 -743
  235. package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
  236. package/dist/server/node_modules/pg/lib/connection.js +0 -221
  237. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
  238. package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
  239. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
  240. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
  241. package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
  242. package/dist/server/node_modules/pg/lib/defaults.js +0 -91
  243. package/dist/server/node_modules/pg/lib/index.js +0 -73
  244. package/dist/server/node_modules/pg/lib/native/client.js +0 -323
  245. package/dist/server/node_modules/pg/lib/native/index.js +0 -2
  246. package/dist/server/node_modules/pg/lib/native/query.js +0 -165
  247. package/dist/server/node_modules/pg/lib/query.js +0 -252
  248. package/dist/server/node_modules/pg/lib/result.js +0 -109
  249. package/dist/server/node_modules/pg/lib/stream.js +0 -83
  250. package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
  251. package/dist/server/node_modules/pg/lib/utils.js +0 -217
  252. package/dist/server/node_modules/pg/package.json +0 -76
  253. package/dist/server/node_modules/slice-ansi/index.d.ts +0 -19
  254. package/dist/server/node_modules/slice-ansi/index.js +0 -260
  255. package/dist/server/node_modules/slice-ansi/package.json +0 -59
  256. package/dist/server/node_modules/slice-ansi/readme.md +0 -54
  257. package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +0 -752
@@ -1 +1 @@
1
- import{e as C,s as pe,f as ve,U as It,g as We,d as qe,W as ys,X as _s,Y as Ss,j as n,Z as Cs,c as J,t as se,r as b,$ as Mt,a0 as $t,H as Ns,J as ks,C as ws,z as Is,a as Ms,B as et,b as Se,a1 as $s,P as Tt,x as je,a2 as Ts,a3 as As,o as Re,a4 as Ps,a5 as Os,a6 as zs,a7 as Rs,a8 as Oe,a9 as Es,aa as Ds,ab as Ls,ac as Fs,ad as At,ae as Us,af as Gs,ag as Bs,ah as Hs,ai as Vs,aj as Ks,ak as Ws,al as qs,am as Qs,an as Ys,ao as Ee,L as Xs,E as it,K as Pt}from"./index-B_1fESAt.js";import{p as Js,g as Zs,D as en,E as mt,F as ft,G as tn,H as xt,I as sn,A as Pe,J as nn,k as on,K as rn,L as ln}from"./agent-icon-uqjsUoaF.js";import{i as an,f as De,g as Le,h as ge,u as Qe,j as he,k as ie,l as Ot,m as zt,n as cn,o as Rt,p as Et}from"./index-DWwQ7XZg.js";import{u as Dt,r as Lt}from"./shell-layout-Bmt2rqH0.js";import{f as dn,g as un,h as mn}from"./pair-D0mM1A08.js";import{S as Ve}from"./skeleton-2Lz1swUi.js";import{b as lt,P as at,a as ct}from"./popover-Ba35MO8M.js";import{b as Ft,a as Ut,D as Gt}from"./drawer-CxUmUy4j.js";import{A as pt}from"./avatar-CyEGSKtu.js";import{u as Bt,a as tt,b as st,c as ht,T as nt}from"./tooltip-B5RH0Km9.js";import{i as Ht}from"./ChevronDown-zvKs0N1K.js";import{c as gt,a as fn,e as xn}from"./XCircle-CBTxKfVv.js";import{i as pn,b as hn,n as gn}from"./ZapSquare-CbT6zl12.js";import{n as bn,a as jn,i as vn}from"./Sun-R7St0ooF.js";import{s as Ke}from"./Plus-DCdnDXDt.js";import{a as Ye}from"./Settings02-D9douFDH.js";import{i as yn}from"./Shield01-dq85_WX6.js";import{a as Vt}from"./Users03-DIGegSk9.js";import{f as _n,a as Sn,b as Cn,c as Nn,d as kn,e as wn,A as In}from"./alert-dialog-BfcKMjjX.js";import{F as Mn,a as $n,b as Tn,c as An,d as Pn,e as On,f as zn}from"./form-BF1TVr5l.js";import{I as Rn}from"./input-DlBRDd00.js";import{S as En}from"./index-347gk0z9.js";import"./index-CBdskEJ7.js";import{s as Dn}from"./XClose-ClpH7cE3.js";import{S as Kt,u as Wt,W as ze,i as Ln,b as Fn}from"./constants-ZGqIPRMK.js";import{u as Un}from"./use-mcp-tools-C9wUjtZc.js";import{u as Gn}from"./use-ai-providers-C3NPNTdO.js";import{A as Bn,b as Hn,S as Vn,c as Kn,d as Wn,C as qn}from"./index-BFjT-crD.js";import{u as Qn,a as bt,K as Yn,P as Xn,S as Jn,v as Zn,D as eo,c as to,s as so,b as no,d as oo,C as ro,e as io}from"./collection-search-Di0TLKJL.js";import{i as jt}from"./X-BvHt2ACZ.js";import{b as qt,u as Qt}from"./use-virtual-mcp-DsNfIZ6r.js";import{u as Yt,a as lo}from"./use-navigate-to-agent-BcuhYECi.js";import{u as ao}from"./use-create-virtual-mcp-C8T5-fz3.js";import{I as co,a as uo,S as mo,L as fo,b as xo,G as po}from"./lean-canvas-recruit-modal-CzSXUxqV.js";import{u as Xt}from"./use-tasks-BxKxyAeq.js";import{e as ot,f as ho}from"./chat-context-3wRDl-0M.js";import{i as go}from"./ChevronRight-CrrqW2bG.js";import{E as bo}from"./empty-state-BJ76SNy0.js";import{u as jo}from"./use-decopilot-events-hmCe1Nt8.js";import{g as Jt,a as vt,b as yt,h as _t,D as St}from"./dropdown-menu-CoOX5aZM.js";import{i as vo}from"./Zap-B5sJ2alW.js";import{g as yo}from"./task-status-DrWeBrHL.js";function Zt(){const t=C.c(77),{org:e}=pe(),s=ve(),o=It(),{setTasksOpen:r,openTab:i}=Dt(),l=e.slug,a=pe().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=We(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=qe(d),x=o.location.pathname;let f;t[2]!==a.enabledPlugins?(f=a.enabledPlugins??[],t[2]=a.enabledPlugins,t[3]=f):f=t[3];const p=f;let j;t[4]!==a.ui?(j=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=j):j=t[5];const I=j;let g,k,h,S;if(t[6]!==a.id||t[7]!==p||t[8]!==s||t[9]!==l||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let N;t[17]!==p?(N=X=>p.includes(X.pluginId),t[17]=p,t[18]=N):N=t[18];const K=ys.filter(N),W=m.virtualmcpid??a.id;k=!!m.virtualmcpid;const G=u.taskId??"",Y=u.pluginId;let ee;t[19]!==Y?(ee=X=>Y===X,t[19]=Y,t[20]=ee):ee=t[20],g=ee;let Z;t[21]!==G||t[22]!==s||t[23]!==l||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();s({to:"/$org/$taskId/$pluginId",params:{org:l,taskId:oe,pluginId:X},search:ae=>({...ae,virtualmcpid:W})})},t[21]=G,t[22]=s,t[23]=l,t[24]=W,t[25]=Z):Z=t[25],h=Z;let ne;t[26]!==g||t[27]!==h?(ne=X=>({key:X.pluginId,label:X.label,icon:X.icon,isActive:g(X.pluginId),onClick:()=>h(X.pluginId)}),t[26]=g,t[27]=h,t[28]=ne):ne=t[28],S=K.map(ne),t[6]=a.id,t[7]=p,t[8]=s,t[9]=l,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=k,t[15]=h,t[16]=S}else g=t[13],k=t[14],h=t[15],S=t[16];const y=S;let v;if(t[29]!==p||t[30]!==g||t[31]!==h){let N;t[33]!==p?(N=G=>p.includes(G.pluginId),t[33]=p,t[34]=N):N=t[34];const K=_s.filter(N);let W;t[35]!==g||t[36]!==h?(W=G=>({type:"group",group:{id:`${G.pluginId}-${G.id}`,label:G.label,items:G.items.map((Y,ee)=>({key:`${G.pluginId}-${G.id}-${ee}`,label:Y.label,icon:Y.icon,isActive:g(G.pluginId),onClick:()=>h(G.pluginId)})),defaultExpanded:G.defaultExpanded??!0}}),t[35]=g,t[36]=h,t[37]=W):W=t[37],v=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=v}else v=t[32];const _=v;let M;if(t[38]!==i||t[39]!==I){let N;t[41]!==i?(N=K=>{const W=Js(K.icon),G=W.type==="icon"?Zs(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?n.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?n.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):n.jsx(an,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>i(dn(K.connectionId,K.toolName))}},t[41]=i,t[42]=N):N=t[42],M=I.map(N),t[38]=i,t[39]=I,t[40]=M}else M=t[40];const D=M;let w;t[43]!==D?(w=D.length>0?{type:"group",group:{id:"apps",label:"Apps",items:D,defaultExpanded:!0}}:null,t[43]=D,t[44]=w):w=t[44];const $=w;let O;t[45]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(en,{className:"size-4!"}),t[45]=O):O=t[45];const T=x===`/${l}`||x===`/${l}/`;let A;t[46]!==s||t[47]!==l||t[48]!==r?(A=()=>{r(!1),s({to:"/$org",params:{org:l}})},t[46]=s,t[47]=l,t[48]=r,t[49]=A):A=t[49];let P;t[50]!==A||t[51]!==T?(P={key:"home",label:"Home",icon:O,isActive:T,onClick:A},t[50]=A,t[51]=T,t[52]=P):P=t[52];const z=P;let L;t[53]!==p?(L=p.includes(Ss),t[53]=p,t[54]=L):L=t[54];const R=L;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(Cs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==l||t[57]!==x?(U=x.startsWith(`/${l}/settings/workflows`),t[56]=l,t[57]=x,t[58]=U):U=t[58];let F;t[59]!==s||t[60]!==l?(F=()=>s({to:"/$org/settings/workflows",params:{org:l}}),t[59]=s,t[60]=l,t[61]=F):F=t[61];let H;t[62]!==U||t[63]!==F?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:F},t[62]=U,t[63]=F,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==z||t[66]!==k||t[67]!==R||t[68]!==V){const N=[z];k&&R&&N.push(V),q={type:"items",items:N},t[65]=z,t[66]=k,t[67]=R,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==$||t[71]!==_||t[72]!==y||t[73]!==q){if(Q=[q],y.length>0){let N;t[75]!==y?(N={type:"items",items:y},t[75]=y,t[76]=N):N=t[76],Q.push(N)}_.length>0&&Q.push(..._),$&&Q.push($),t[70]=$,t[71]=_,t[72]=y,t[73]=q,t[74]=Q}else Q=t[74];return Q}function es(t){const e=C.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex h-6 items-center",children:n.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let r;return e[1]!==s?(r=n.jsxs(De,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,n.jsx(Le,{children:n.jsx(ge,{className:"gap-0.5",children:s})})]}),e[1]=s,e[2]=r):r=e[2],r}function _o(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function ts(t){const e=C.c(15),{item:s}=t,{isMobile:o,setOpenMobile:r}=Qe();let i;e[0]!==o||e[1]!==s||e[2]!==r?(i=()=>{se("nav_item_clicked",{nav_key:s.key,nav_label:s.label,is_active:!!s.isActive,is_mobile:o}),s.onClick?.(),o&&r(!1)},e[0]=o,e[1]=s,e[2]=r,e[3]=i):i=e[3];const l=i,a=s.key,c=s.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==l||e[7]!==s.icon||e[8]!==s.isActive||e[9]!==s.label?(d=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:s.icon}),e[6]=l,e[7]=s.icon,e[8]=s.isActive,e[9]=s.label,e[10]=d):d=e[10];let m;return e[11]!==s.key||e[12]!==u||e[13]!==d?(m=n.jsx(ie,{className:u,children:d},a),e[11]=s.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function So(t){const e=C.c(12),{section:s}=t;switch(s.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ot,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=s.group.label,r=s.group.defaultExpanded;let i;e[2]!==s.group.items?(i=s.group.items.map(No),e[2]=s.group.items,e[3]=i):i=e[3];let l;return e[4]!==s.group.defaultExpanded||e[5]!==s.group.label||e[6]!==i?(l=n.jsx(es,{label:o,defaultExpanded:r,children:i}),e[4]=s.group.defaultExpanded,e[5]=s.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let o;e[8]!==s.items?(o=s.items.map(Co),e[8]=s.items,e[9]=o):o=e[9];let r;return e[10]!==o?(r=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=r):r=e[11],r}}}function Co(t){return n.jsx(ts,{item:t},t.key)}function No(t){return n.jsx(ts,{item:t},t.key)}function ko(t){const e=C.c(14),{sections:s,header:o,footer:r,additionalContent:i,variant:l,contentClassName:a}=t,c=l===void 0?"sidebar":l;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(_o,{})}),e[0]=u):u=e[0];let d;e[1]!==a?(d=J("flex flex-col flex-1 px-2 py-2 gap-0",a),e[1]=a,e[2]=d):d=e[2];let m;e[3]!==s?(m=s.map(wo),e[3]=s,e[4]=m):m=e[4];let x;e[5]!==i||e[6]!==d||e[7]!==m?(x=n.jsxs(zt,{className:d,children:[m,i]}),e[5]=i,e[6]=d,e[7]=m,e[8]=x):x=e[8];let f;return e[9]!==r||e[10]!==o||e[11]!==x||e[12]!==c?(f=n.jsxs(cn,{variant:c,children:[u,o,x,r]}),e[9]=r,e[10]=o,e[11]=x,e[12]=c,e[13]=f):f=e[13],f}function wo(t,e){return n.jsx(So,{section:t},e)}function ss(t){const e=C.c(2);let s;return e[0]!==t?(s=n.jsx(ko,{...t}),e[0]=t,e[1]=s):s=e[1],s}ss.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Ve,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Io(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function Ct(t){const e=C.c(15),{item:s,onClose:o}=t,r=s.isActive&&"z-10";let i;e[0]!==r?(i=J(r),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==o?(l=()=>{s.onClick?.(),o()},e[2]=s,e[3]=o,e[4]=l):l=e[4];let a;e[5]!==s.icon?(a=n.jsx("span",{className:"[&>svg]:size-8",children:s.icon}),e[5]=s.icon,e[6]=a):a=e[6];let c;e[7]!==s.isActive||e[8]!==s.label||e[9]!==l||e[10]!==a?(c=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:a}),e[7]=s.isActive,e[8]=s.label,e[9]=l,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==i||e[13]!==c?(u=n.jsx(ie,{className:i,children:c}),e[12]=i,e[13]=c,e[14]=u):u=e[14],u}function Mo(t){const e=C.c(18),{section:s,onClose:o}=t;switch(s.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ot,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=s.group.label,i=s.group.defaultExpanded;let l;if(e[2]!==o||e[3]!==s.group.items){let c;e[5]!==o?(c=u=>n.jsx(Ct,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],l=s.group.items.map(c),e[2]=o,e[3]=s.group.items,e[4]=l}else l=e[4];let a;return e[7]!==s.group.defaultExpanded||e[8]!==s.group.label||e[9]!==l?(a=n.jsx(es,{label:r,defaultExpanded:i,children:l}),e[7]=s.group.defaultExpanded,e[8]=s.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==o||e[12]!==s.items){let l;e[14]!==o?(l=a=>n.jsx(Ct,{item:a,onClose:o},a.key),e[14]=o,e[15]=l):l=e[15],r=s.items.map(l),e[11]=o,e[12]=s.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}}}function $o(t){const e=C.c(12),{sections:s,onClose:o,footer:r,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(Io,{})}),e[0]=l):l=e[0];let a;if(e[1]!==o||e[2]!==s){let d;e[4]!==o?(d=(m,x)=>n.jsx(Mo,{section:m,onClose:o},x),e[4]=o,e[5]=d):d=e[5],a=s.map(d),e[1]=o,e[2]=s,e[3]=a}else a=e[3];let c;e[6]!==i||e[7]!==a?(c=n.jsxs(zt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,i]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==r||e[10]!==c?(u=n.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[l,c,r]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function ns(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const To=Ns({name:ks().min(2,"Organization name is required")});function Ao(t){const e=C.c(41),{open:s,onOpenChange:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:ws(To),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Is(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Oo,onSuccess:Po},e[1]=l):l=e[1];const a=Ms(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs(Cn,{children:[n.jsx(Nn,{children:"Create a new organization"}),n.jsx(kn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==i){let _;e[6]!==a?(_=M=>a.mutateAsync(M),e[6]=a,e[7]=_):_=e[7],d=i.handleSubmit(_),e[3]=a,e[4]=i,e[5]=d}else d=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:M}=_;return n.jsxs(Tn,{children:[n.jsx(An,{children:"Organization Name"}),n.jsx(Pn,{children:n.jsx(Rn,{...M,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),n.jsx(On,{children:"The name of your company or organization"}),M.value&&n.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",n.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ns(M.value)]})]}),n.jsx(zn,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let x;e[10]!==i.control||e[11]!==m?(x=n.jsx(Mn,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=x):x=e[12];let f;e[13]!==c?(f=c&&n.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let j;e[18]!==i.formState.isSubmitting||e[19]!==p?(j=n.jsx(_n,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=j):j=e[20];const I=!i.formState.isValid||i.formState.isSubmitting;let g;e[21]!==i.formState.isSubmitting?(g=i.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(En,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=g):g=e[22];let k;e[23]!==I||e[24]!==g?(k=n.jsx(et,{type:"submit",variant:"default",disabled:I,children:g}),e[23]=I,e[24]=g,e[25]=k):k=e[25];let h;e[26]!==k||e[27]!==j?(h=n.jsxs(wn,{children:[j,k]}),e[26]=k,e[27]=j,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==d||e[31]!==x||e[32]!==f?(S=n.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[x,f,h]}),e[29]=h,e[30]=d,e[31]=x,e[32]=f,e[33]=S):S=e[33];let y;e[34]!==i||e[35]!==S?(y=n.jsxs(Sn,{children:[u,n.jsx($n,{...i,children:S})]}),e[34]=i,e[35]=S,e[36]=y):y=e[36];let v;return e[37]!==o||e[38]!==s||e[39]!==y?(v=n.jsx(In,{open:s,onOpenChange:o,children:y}),e[37]=o,e[38]=s,e[39]=y,e[40]=v):v=e[40],v}function Po(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Oo(t){const e=ns(t.name);if(!e)throw new Error("Organization slug is invalid");const s=await Se.organization.create({name:t.name,slug:e});if(s?.error)throw new Error(s.error.message||"Failed to create organization");const o=s?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function rt(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function zo(t){const e=C.c(13),{org:s,size:o}=t,r=o===void 0?"sm":o,i=r==="xs"?"size-5":"size-6",l=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=J(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:rt(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?n.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:J("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=n.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function Be(t){const e=C.c(22),{item:s,onClose:o}=t;if(s.href){const c=s.external?"_blank":void 0,u=s.external?"noopener noreferrer":void 0;let d;e[0]!==s.icon?(d=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[0]=s.icon,e[1]=d):d=e[1];let m;e[2]!==s.label?(m=n.jsx("span",{className:"flex-1",children:s.label}),e[2]=s.label,e[3]=m):m=e[3];let x;return e[4]!==s.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(x=n.jsxs("a",{href:s.href,target:c,rel:u,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:o,children:[d,m]}),e[4]=s.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=x):x=e[10],x}let r;e[11]!==s||e[12]!==o?(r=()=>{s.onClick?.(),o()},e[11]=s,e[12]=o,e[13]=r):r=e[13];let i;e[14]!==s.icon?(i=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[14]=s.icon,e[15]=i):i=e[15];let l;e[16]!==s.label?(l=n.jsx("span",{className:"flex-1",children:s.label}),e[16]=s.label,e[17]=l):l=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==l?(a=n.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=r,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Nt(t){const e=C.c(16),{sortedOrgs:s,orgParam:o,onSelectOrg:r,onCreateOrg:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ke,{size:16}),e[1]=a):a=e[1];let c;e[2]!==i?(c=n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[l,n.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:a})]}),e[2]=i,e[3]=c):c=e[3];let u;if(e[4]!==r||e[5]!==o||e[6]!==s){let x;e[8]!==r||e[9]!==o?(x=f=>n.jsxs("button",{type:"button",onClick:()=>r(f.slug),className:J("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",f.slug===o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[n.jsx(zo,{org:f,size:"sm"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:f.name}),n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.slug})]}),f.slug===o&&n.jsx(Ht,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},f.id),e[8]=r,e[9]=o,e[10]=x):x=e[10],u=s.map(x),e[4]=r,e[5]=o,e[6]=s,e[7]=u}else u=e[7];let d;e[11]!==u?(d=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function kt(t){const e=C.c(142),{user:s,userImage:o,menuItems:r,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x,close:f,isMobile:p}=t;if(p){const G=s?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=n.jsx(pt,{url:o,fallback:G,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=G,e[1]=o,e[2]=Y):Y=e[2];const ee=s?.name??"User";let Z;e[3]!==ee?(Z=n.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=s?.email;let X;e[5]!==ne?(X=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=X):X=e[6];let oe;e[7]!==Z||e[8]!==X?(oe=n.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let ae;e[10]!==s?(ae=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Lo)},e[10]=s,e[11]=ae):ae=e[11];let Ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ne=n.jsx(gt,{size:14}),e[12]=Ne):Ne=e[12];let ce;e[13]!==ae?(ce=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:ae,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ne})}),e[13]=ae,e[14]=ce):ce=e[14];let ye;e[15]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ye):ye=e[15];let _e;e[16]!==ce?(_e=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[ce,ye]})}),e[16]=ce,e[17]=_e):_e=e[17];let re;e[18]!==_e||e[19]!==Y||e[20]!==oe?(re=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,_e]}),e[18]=_e,e[19]=Y,e[20]=oe,e[21]=re):re=e[21];let de;e[22]!==x||e[23]!==m||e[24]!==d||e[25]!==u?(de=n.jsx("div",{className:"border-b border-border pb-2",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[22]=x,e[23]=m,e[24]=d,e[25]=u,e[26]=de):de=e[26];let ue;if(e[27]!==f||e[28]!==r){let be;e[30]!==f?(be=Ge=>n.jsx(Be,{item:Ge,onClose:f},Ge.key),e[30]=f,e[31]=be):be=e[31],ue=r.map(be),e[27]=f,e[28]=r,e[29]=ue}else ue=e[29];let me;e[32]!==f||e[33]!==i?(me=n.jsx(Be,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=me):me=e[34];let fe;e[35]!==ue||e[36]!==me?(fe=n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ue,me]}),e[35]=ue,e[36]=me,e[37]=fe):fe=e[37];let xe;e[38]!==de||e[39]!==fe?(xe=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[de,fe]}),e[38]=de,e[39]=fe,e[40]=xe):xe=e[40];let E;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let be;e[45]!==a.theme||e[46]!==c?(be=Ge=>{const{value:Ze,icon:bs,label:js}=Ge;return n.jsx("button",{type:"button","aria-label":js,onClick:()=>c(vs=>({...vs,theme:Ze})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ze?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:bs},Ze)},e[45]=a.theme,e[46]=c,e[47]=be):be=e[47],E=l.map(be),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=E}else E=e[44];let ke;e[48]!==E?(ke=n.jsx("div",{className:"flex items-center gap-0.5",children:E}),e[48]=E,e[49]=ke):ke=e[49];const Xe=a.enableSounds?"Disable sounds":"Enable sounds";let we;e[50]!==c?(we=()=>c(Do),e[50]=c,e[51]=we):we=e[51];const Je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ie;e[52]!==Je?(Ie=J("size-8 rounded-md flex items-center justify-center transition-colors",Je),e[52]=Je,e[53]=Ie):Ie=e[53];let Me;e[54]!==a.enableSounds?(Me=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[54]=a.enableSounds,e[55]=Me):Me=e[55];let $e;e[56]!==Xe||e[57]!==we||e[58]!==Ie||e[59]!==Me?($e=n.jsx("button",{type:"button","aria-label":Xe,onClick:we,className:Ie,children:Me}),e[56]=Xe,e[57]=we,e[58]=Ie,e[59]=Me,e[60]=$e):$e=e[60];let Fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.293.6"]}),e[61]=Fe):Fe=e[61];let Te;e[62]!==$e?(Te=n.jsxs("div",{className:"flex items-center gap-2",children:[$e,Fe]}),e[62]=$e,e[63]=Te):Te=e[63];let Ae;e[64]!==ke||e[65]!==Te?(Ae=n.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ke,Te]}),e[64]=ke,e[65]=Te,e[66]=Ae):Ae=e[66];let Ue;return e[67]!==re||e[68]!==xe||e[69]!==Ae?(Ue=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[re,xe,Ae]}),e[67]=re,e[68]=xe,e[69]=Ae,e[70]=Ue):Ue=e[70],Ue}const j=s?.name??"U";let I;e[71]!==j||e[72]!==o?(I=n.jsx(pt,{url:o,fallback:j,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=j,e[72]=o,e[73]=I):I=e[73];const g=s?.name??"User";let k;e[74]!==g?(k=n.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=k):k=e[75];const h=s?.email;let S;e[76]!==h?(S=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=S):S=e[77];let y;e[78]!==k||e[79]!==S?(y=n.jsxs("div",{className:"flex-1 min-w-0",children:[k,S]}),e[78]=k,e[79]=S,e[80]=y):y=e[80];let v;e[81]!==s?(v=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Eo)},e[81]=s,e[82]=v):v=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(gt,{size:14}),e[83]=_):_=e[83];let M;e[84]!==v?(M=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=v,e[85]=M):M=e[85];let D;e[86]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=D):D=e[86];let w;e[87]!==M?(w=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[M,D]})}),e[87]=M,e[88]=w):w=e[88];let $;e[89]!==w||e[90]!==I||e[91]!==y?($=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[I,y,w]}),e[89]=w,e[90]=I,e[91]=y,e[92]=$):$=e[92];let O;if(e[93]!==f||e[94]!==r){let G;e[96]!==f?(G=Y=>n.jsx(Be,{item:Y,onClose:f},Y.key),e[96]=f,e[97]=G):G=e[97],O=r.map(G),e[93]=f,e[94]=r,e[95]=O}else O=e[95];let T;e[98]!==f||e[99]!==i?(T=n.jsx(Be,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=T):T=e[100];let A;e[101]!==O||e[102]!==T?(A=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[O,T]}),e[101]=O,e[102]=T,e[103]=A):A=e[103];let P;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return n.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(X=>({...X,theme:ee})),className:J("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ee?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},ee)},e[108]=a.theme,e[109]=c,e[110]=G):G=e[110],P=l.map(G),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=P}else P=e[107];let z;e[111]!==P?(z=n.jsx("div",{className:"flex items-center gap-0.5",children:P}),e[111]=P,e[112]=z):z=e[112];const L=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ro),e[113]=c,e[114]=R):R=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let U;e[115]!==B?(U=J("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=U):U=e[116];let F;e[117]!==a.enableSounds?(F=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[117]=a.enableSounds,e[118]=F):F=e[118];let H;e[119]!==L||e[120]!==R||e[121]!==U||e[122]!==F?(H=n.jsx("button",{type:"button","aria-label":L,onClick:R,className:U,children:F}),e[119]=L,e[120]=R,e[121]=U,e[122]=F,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.293.6"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=n.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==z||e[128]!==q?(Q=n.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,q]}),e[127]=z,e[128]=q,e[129]=Q):Q=e[129];let N;e[130]!==$||e[131]!==A||e[132]!==Q?(N=n.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[$,A,Q]}),e[130]=$,e[131]=A,e[132]=Q,e[133]=N):N=e[133];let K;e[134]!==x||e[135]!==m||e[136]!==d||e[137]!==u?(K=n.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[134]=x,e[135]=m,e[136]=d,e[137]=u,e[138]=K):K=e[138];let W;return e[139]!==N||e[140]!==K?(W=n.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[N,K]}),e[139]=N,e[140]=K,e[141]=W):W=e[141],W}function Ro(t){return{...t,enableSounds:!t.enableSounds}}function Eo(){je.success("User ID copied")}function Do(t){return{...t,enableSounds:!t.enableSounds}}function Lo(){je.success("User ID copied")}function os(){const t=C.c(50),{data:e}=Se.useSession(),{data:s}=Se.useListOrganizations(),o=ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const l=$s(r)?.params.org,[a,c]=Tt(),u=Bt(),[d,m]=b.useState(!1),[x,f]=b.useState(!1),p=e?.user,j=p?.image;let I;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==l||t[5]!==s||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==j){const h=s?.find(W=>W.slug===l);let S;if(t[11]!==l||t[12]!==s){let W;t[14]!==l?(W=(G,Y)=>G.slug===l?-1:Y.slug===l?1:G.name.localeCompare(Y.name),t[14]=l,t[15]=W):W=t[15],S=[...s??[]].sort(W),t[11]=l,t[12]=s,t[13]=S}else S=t[13];const y=S;let v;t[16]!==o?(v=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=v):v=t[17];const _=v;let M;t[18]===Symbol.for("react.memo_cache_sentinel")?(M=()=>m(!1),t[18]=M):M=t[18];const D=M;let w;t[19]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Ye,{size:16}),t[19]=w):w=t[19];let $;t[20]!==o||t[21]!==l?($={key:"preferences",label:"Preferences",icon:w,onClick:()=>{o({to:"/$org/settings/profile",params:{org:l??""}})}},t[20]=o,t[21]=l,t[22]=$):$=t[22];let O;t[23]===Symbol.for("react.memo_cache_sentinel")?(O={key:"terms",label:"Terms of Use",icon:n.jsx(tn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=O):O=t[23];let T;t[24]===Symbol.for("react.memo_cache_sentinel")?(T={key:"privacy",label:"Privacy Policy",icon:n.jsx(yn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=T):T=t[24];let A;t[25]===Symbol.for("react.memo_cache_sentinel")?(A={key:"github",label:"decocms/studio",icon:n.jsx(Ts,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=A):A=t[25];let P;t[26]===Symbol.for("react.memo_cache_sentinel")?(P={key:"community",label:"Community",icon:n.jsx(Vt,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=P):P=t[26];let z;t[27]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:n.jsx(fn,{size:16}),href:"https://decocms.com",external:!0},t[27]=z):z=t[27];let L;t[28]!==$?(L=[$,O,T,A,P,z],t[28]=$,t[29]=L):L=t[29];const R=L;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:n.jsx(pn,{size:16}),onClick:Uo},t[30]=B):B=t[30];const U=B;let F;t[31]===Symbol.for("react.memo_cache_sentinel")?(F={value:"light",icon:n.jsx(bn,{size:14}),label:"Light theme"},t[31]=F):F=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:n.jsx(jn,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[F,H,{value:"system",icon:n.jsx(vn,{size:14}),label:"System theme"}],t[33]=V):V=t[33];const q=V;let Q;t[34]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(!1),f(!0)},t[34]=Q):Q=t[34];let N;t[35]!==_||t[36]!==u||t[37]!==R||t[38]!==l||t[39]!==a||t[40]!==c||t[41]!==y||t[42]!==p||t[43]!==j?(N={user:p,userImage:j,menuItems:R,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:y,orgParam:l,onSelectOrg:_,onCreateOrg:Q,close:D,isMobile:u},t[35]=_,t[36]=u,t[37]=R,t[38]=l,t[39]=a,t[40]=c,t[41]=y,t[42]=p,t[43]=j,t[44]=N):N=t[44];const K=N;I=u?n.jsxs(Ft,{open:d,onOpenChange:m,direction:"bottom",children:[n.jsxs("button",{type:"button",onClick:()=>m(!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:[n.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),n.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),n.jsxs(Ut,{className:"h-[80dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Account"}),n.jsx(kt,{...K})]})]}):n.jsxs(lt,{open:d,onOpenChange:m,children:[n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:h?.name??"Account",className:"rounded-md",children:n.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),n.jsx(ct,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Fo,children:n.jsx(kt,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=l,t[5]=s,t[6]=a,t[7]=c,t[8]=p,t[9]=j,t[10]=I}else I=t[10];let g;t[45]!==x?(g=n.jsx(Ao,{open:x,onOpenChange:f}),t[45]=x,t[46]=g):g=t[46];let k;return t[47]!==I||t[48]!==g?(k=n.jsxs(n.Fragment,{children:[I,g]}),t[47]=I,t[48]=g,t[49]=k):k=t[49],k}function Fo(t){return t.preventDefault()}function Uo(){se("signed_out",{source:"account_popover"}),Se.signOut()}function Go({invitation:t}){const[e,s]=b.useState(!1),[o,r]=b.useState(!1),i=Re(),l=async()=>{s(!0);try{const c=await Se.organization.acceptInvitation({invitationId:t.id});if(c.error)je.error(c.error.message),s(!1);else{const u=await Se.organization.setActive({organizationId:t.organizationId});je.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{je.error("Failed to accept invitation"),s(!1)}},a=async()=>{r(!0);try{const c=await Se.organization.rejectInvitation({invitationId:t.id});c.error?(je.error(c.error.message),r(!1)):(je.success("Invitation declined"),i.invalidateQueries())}catch{je.error("Failed to decline invitation"),r(!1)}};return n.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),n.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||o,"aria-label":"Accept invitation",children:n.jsx(Ht,{size:14})}),n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:n.jsx(Dn,{size:14})})]})]})}function Bo(){const t=b.useContext(As),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Ho extends b.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function Vo(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ko(){const t=C.c(19),e=ve(),{org:s}=pe();let o;t[0]!==s.id?(o={connectionId:Kt,orgId:s.id},t[0]=s.id,t[1]=o):o=t[1];const r=Wt(o);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[2]=i):i=t[2];let l;t[3]!==r?(l={client:r,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:Wo},t[3]=r,t[4]=l):l=t[4];const{data:a,isPending:c,isError:u}=Un(l),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[5]!==d||t[6]!==u||t[7]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[5]=d,t[6]=u,t[7]=c,t[8]=m):m=t[8];const x=m;let f;t[9]!==d?(f=J(d!=null&&Vo(d)),t[9]=d,t[10]=f):f=t[10];let p;t[11]!==e||t[12]!==s.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[11]=e,t[12]=s.slug,t[13]=p):p=t[13];let j;t[14]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(sn,{size:24}),t[14]=j):j=t[14];let I;return t[15]!==f||t[16]!==p||t[17]!==x?(I=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:x,className:f,onClick:p,children:j})})}),t[15]=f,t[16]=p,t[17]=x,t[18]=I):I=t[18],I}function Wo(t){return t.structuredContent}function qo(){const t=C.c(1);if(!Gn().some(Qo))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ko,{}),t[0]=o):o=t[0],o}function Qo(t){return t.providerId==="deco"}function Yo(){const t=C.c(3),[e,s]=b.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),s(!0)},children:n.jsx(hn,{size:24})})})}),t[0]=o):o=t[0];let r;return t[1]!==e?(r=n.jsxs(n.Fragment,{children:[o,n.jsx(Bn,{mode:"browse",open:e,onOpenChange:s,defaultTab:"all"})]}),t[1]=e,t[2]=r):r=t[2],r}function Xo(){const t=C.c(11),e=Bo();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(xt,{size:24}),t[0]=s):s=t[0];let o;t[1]!==e.length?(o=e.length>0&&n.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e.length,t[2]=o):o=t[2];let r;t[3]!==o?(r=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsxs(he,{tooltip:"Inbox",className:"relative",children:[s,o]})})})}),t[3]=o,t[4]=r):r=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:n.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[5]=i):i=t[5];let l;t[6]!==e?(l=n.jsxs(ct,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:[i,e.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[n.jsx(xt,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):n.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Jo)})]}),t[6]=e,t[7]=l):l=t[7];let a;return t[8]!==r||t[9]!==l?(a=n.jsxs(lt,{children:[r,l]}),t[8]=r,t[9]=l,t[10]=a):a=t[10],a}function Jo(t){return n.jsx(Go,{invitation:t},t.id)}function Zo(){const t=C.c(6),e=ve(),{org:s}=pe();let o;t[0]!==e||t[1]!==s.slug?(o=()=>e({to:"/$org/settings",params:{org:s.slug}}),t[0]=e,t[1]=s.slug,t[2]=o):o=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ye,{size:24}),t[3]=r):r=t[3];let i;return t[4]!==o?(i=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:o,children:r})})}),t[4]=o,t[5]=i):i=t[5],i}function er(){const t=C.c(5);let e,s,o,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ho,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(qo,{})})}),s=n.jsx(Yo,{}),o=n.jsx(Xo,{}),r=n.jsx(Zo,{}),t[0]=e,t[1]=s,t[2]=o,t[3]=r):(e=t[0],s=t[1],o=t[2],r=t[3]);let i;return t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs(Et,{className:"px-2 pb-3 gap-1",children:[e,s,o,r,n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(os,{})})})]}),t[4]=i):i=t[4],i}function tr(){const t=C.c(10),e=ve(),{org:s}=pe(),{setOpenMobile:o}=Qe();let r;t[0]!==e||t[1]!==s.slug||t[2]!==o?(r=()=>{e({to:"/$org/settings",params:{org:s.slug}}),o(!1)},t[0]=e,t[1]=s.slug,t[2]=o,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ye,{}),t[4]=i):i=t[4];let l;t[5]!==r?(l=n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:r,children:i})}),t[5]=r,t[6]=l):l=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ie,{children:n.jsx(os,{})}),t[7]=a):a=t[7];let c;return t[8]!==l?(c=n.jsx(Et,{children:n.jsxs(ge,{children:[l,a]})}),t[8]=l,t[9]=c):c=t[9],c}var dt="ContextMenu",[sr]=Us(dt,[At]),te=At(),[nr,rs]=sr(dt),is=t=>{const{__scopeContextMenu:e,children:s,onOpenChange:o,dir:r,modal:i=!0}=t,[l,a]=b.useState(!1),c=te(e),u=Ps(o),d=b.useCallback(m=>{a(m),u(m)},[u]);return n.jsx(nr,{scope:e,open:l,onOpenChange:d,modal:i,children:n.jsx(Os,{...c,dir:r,open:l,onOpenChange:d,modal:i,children:s})})};is.displayName=dt;var ls="ContextMenuTrigger",as=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,disabled:o=!1,...r}=t,i=rs(ls,s),l=te(s),a=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=b.useRef(0),d=b.useCallback(()=>window.clearTimeout(u.current),[]),m=x=>{a.current={x:x.clientX,y:x.clientY},i.onOpenChange(!0)};return b.useEffect(()=>d,[d]),b.useEffect(()=>{o&&d()},[o,d]),n.jsxs(n.Fragment,{children:[n.jsx(zs,{...l,virtualRef:c}),n.jsx(Rs.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,x=>{d(),m(x),x.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,He(x=>{d(),u.current=window.setTimeout(()=>m(x),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,He(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,He(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,He(d))})]})});as.displayName=ls;var or="ContextMenuPortal",cs=t=>{const{__scopeContextMenu:e,...s}=t,o=te(e);return n.jsx(Es,{...o,...s})};cs.displayName=or;var ds="ContextMenuContent",us=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=rs(ds,s),i=te(s),l=b.useRef(!1);return n.jsx(Ds,{...i,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&l.current&&a.preventDefault(),l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!r.modal&&(l.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});us.displayName=ds;var rr="ContextMenuGroup",ir=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Gs,{...r,...o,ref:e})});ir.displayName=rr;var lr="ContextMenuLabel",ar=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Bs,{...r,...o,ref:e})});ar.displayName=lr;var cr="ContextMenuItem",ms=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ls,{...r,...o,ref:e})});ms.displayName=cr;var dr="ContextMenuCheckboxItem",ur=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Hs,{...r,...o,ref:e})});ur.displayName=dr;var mr="ContextMenuRadioGroup",fr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Vs,{...r,...o,ref:e})});fr.displayName=mr;var xr="ContextMenuRadioItem",pr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ks,{...r,...o,ref:e})});pr.displayName=xr;var hr="ContextMenuItemIndicator",gr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ws,{...r,...o,ref:e})});gr.displayName=hr;var br="ContextMenuSeparator",fs=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Fs,{...r,...o,ref:e})});fs.displayName=br;var jr="ContextMenuArrow",vr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(qs,{...r,...o,ref:e})});vr.displayName=jr;var yr="ContextMenuSubTrigger",_r=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Qs,{...r,...o,ref:e})});_r.displayName=yr;var Sr="ContextMenuSubContent",Cr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ys,{...r,...o,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Cr.displayName=Sr;function He(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Nr=is,kr=as,wr=cs,Ir=us,Mr=ms,$r=fs;function Tr(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(Nr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=o):o=e[3],o}function Ar(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(kr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=o):o=e[3],o}function Pr(t){const e=C.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let r;e[3]!==s?(r=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx(wr,{children:n.jsx(Ir,{"data-slot":"context-menu-content",className:r,...o})}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function wt(t){const e=C.c(12);let s,o,r,i;e[0]!==t?({className:s,inset:o,variant:i,...r}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=r,e[4]=i):(s=e[1],o=e[2],r=e[3],i=e[4]);const l=i===void 0?"default":i;let a;e[5]!==s?(a=J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==r||e[9]!==a||e[10]!==l?(c=n.jsx(Mr,{"data-slot":"context-menu-item","data-inset":o,"data-variant":l,className:a,...r}),e[7]=o,e[8]=r,e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function Or(t){const e=C.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let r;e[3]!==s?(r=J("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx($r,{"data-slot":"context-menu-separator",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function zr(t){const e=ve(),s=Re(),o=Xt(),{locator:r}=pe(),i=We({strict:!1}),l=qe({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===l.virtualmcpid?Lt(s,r,i.taskId??""):null;try{await o.create.mutateAsync({id:c,virtual_mcp_id:a,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:a}})}}function Rr({agent:t,org:e,onUnpin:s,isDragging:o}){const r=ve(),{isMobile:i,setOpenMobile:l}=Qe(),a=Hn(e),u=It({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=b.useState(null),x=b.useRef(null),f=b.useRef(null),p=b.useRef(!1);p.current=!!o,o&&(d||f.current)&&(f.current&&(clearTimeout(f.current),f.current=null),d&&m(null));const j=h=>{if(p.current)return;const S=h.currentTarget.getBoundingClientRect();f.current=setTimeout(()=>{p.current||m(S)},550)},I=h=>{f.current&&(clearTimeout(f.current),f.current=null),!(x.current&&h.relatedTarget instanceof Node&&x.current.contains(h.relatedTarget))&&m(null)},g=d?Math.round(d.height*.9):0,k=d?d.width+g:0;return n.jsx(Tr,{children:n.jsxs(ie,{className:J(d&&"z-[55]"),children:[n.jsx(Ar,{asChild:!0,children:n.jsx(he,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{i&&l(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:j,onMouseLeave:I,children:n.jsx(Pe,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),n.jsxs(Pr,{children:[n.jsxs(wt,{onClick:()=>{const h=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[n.jsx(Ye,{size:14}),"Settings"]}),n.jsx(Or,{}),n.jsxs(wt,{onClick:()=>{s(),u&&r({to:"/$org",params:{org:e}})},className:"",children:[n.jsx(jt,{size:14}),"Unpin"]})]}),d&&Ee.createPortal(n.jsx("button",{ref:x,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),s(),r({to:"/$org",params:{org:e}})},className:J("flex items-center justify-center","bg-sidebar-accent text-muted-foreground","rounded-xl cursor-pointer","animate-in fade-in-0 slide-in-from-right-2","duration-150 [animation-timing-function:cubic-bezier(0.165,0.84,0.44,1)]","hover:text-foreground transition-colors"),style:{position:"fixed",top:d.top,left:d.left,height:d.height,width:k,paddingLeft:d.width,zIndex:50,boxShadow:"inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0 0 0.5px hsla(0, 0%, 0%, 0.12)"},children:n.jsx(jt,{size:14})}),document.body)]})})}function Er(t){const e=C.c(18);let s;e[0]!==t.agent.id?(s={id:t.agent.id},e[0]=t.agent.id,e[1]=s):s=e[1];const{attributes:o,listeners:r,setNodeRef:i,transform:l,transition:a,isDragging:c}=oo(s);let u;e[2]!==l?(u=ro.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=u):u=e[3];const d=c?.5:void 0,m=c?100:void 0;let x;e[4]!==u||e[5]!==d||e[6]!==m||e[7]!==a?(x={transform:u,transition:a,opacity:d,zIndex:m},e[4]=u,e[5]=d,e[6]=m,e[7]=a,e[8]=x):x=e[8];const f=x;let p;e[9]!==c||e[10]!==t?(p=n.jsx(Rr,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let j;return e[12]!==o||e[13]!==r||e[14]!==i||e[15]!==f||e[16]!==p?(j=n.jsx("div",{ref:i,style:f,...o,...r,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=r,e[14]=i,e[15]=f,e[16]=p,e[17]=j):j=e[17],j}function Dr(t){const e=C.c(9),{agent:s,onClick:o}=t;let r;e[0]!==s.icon||e[1]!==s.title?(r=n.jsx(Pe,{icon:s.icon,name:s.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=s.icon,e[1]=s.title,e[2]=r):r=e[2];let i;e[3]!==s.title?(i=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:s.title}),e[3]=s.title,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==r||e[7]!==i?(l=n.jsxs("button",{type:"button",onClick:o,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[r,i]}),e[5]=o,e[6]=r,e[7]=i,e[8]=l):l=e[8],l}function Lr(t){const e=C.c(80),{onClose:s,onOpenImportDeco:o,onOpenGithubImport:r,onOpenSelfHealing:i,onOpenDiagnosticsModal:l,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,x]=b.useState(""),f=qt(),{org:p}=pe();let j;e[0]!==f?(j=f.filter(Wr).map(Kr),e[0]=f,e[1]=j):j=e[1];const I=j,{pin:g,isPinned:k}=Yt(p.id,I);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:S,isCreating:y}=ao(h),[v]=Tt(),_=zr(p.slug),M=lo();let D,w,$,O,T,A,P,z;if(e[3]!==f||e[4]!==S||e[5]!==y||e[6]!==k||e[7]!==M||e[8]!==_||e[9]!==s||e[10]!==u||e[11]!==d||e[12]!==l||e[13]!==r||e[14]!==o||e[15]!==a||e[16]!==i||e[17]!==c||e[18]!==g||e[19]!==v.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();z=f.filter(Vr).filter(E=>!m||E.title.toLowerCase().includes(V));let q;e[29]!==f?(q=f.some(Hr),e[29]=f,e[30]=q):q=e[30];const Q=q;D=ze.filter(E=>(!m||E.title.toLowerCase().includes(V))&&!(E.id==="studio-pack"&&Q)&&!(E.id==="self-healing-storefront"&&!v.experimental_vibecode));let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=ze.find(Br),e[31]=N):N=e[31];const K=N,W=K?f.find(E=>E.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Gr),e[32]=G):G=e[32];const Y=G,ee=Y?f.find(E=>E.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Ur),e[33]=Z):Z=e[33];const ne=Z,X=ne?f.find(E=>E.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(Fr),e[34]=oe):oe=e[34];const ae=oe,Ne=ae?f.find(E=>E.metadata?.type===ae.id):void 0;let ce;e[35]!==k||e[36]!==_||e[37]!==s||e[38]!==g?(ce=E=>{k(E.id)||g(E.id),s(),x(""),_(E.id)},e[35]=k,e[36]=_,e[37]=s,e[38]=g,e[39]=ce):ce=e[39];const ye=ce,_e=E=>{s(),x(""),E==="self-healing-storefront"?i():E==="site-editor"?o():E==="site-diagnostics"?W?M(W.id):l():E==="lean-canvas"?ee?M(ee.id):a():E==="ai-image"?X?M(X.id):u():E==="ai-research"?Ne?M(Ne.id):d():E==="studio-pack"?c():_(E)};A="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(P=n.jsx(io,{value:m,onChange:x,placeholder:"Search agents..."}),e[40]=m,e[41]=P):P=e[41],w="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx("div",{className:"px-1 pt-3 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[42]=$):$=e[42];let re;e[43]!==S||e[44]!==s?(re=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await S(),s()},e[43]=S,e[44]=s,e[45]=re):re=e[45];let de,ue;e[46]===Symbol.for("react.memo_cache_sentinel")?(de=n.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:n.jsx(Ke,{size:16,className:"text-muted-foreground"})}),ue=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=de,e[47]=ue):(de=e[46],ue=e[47]);let me;e[48]!==y||e[49]!==re?(me=n.jsxs("button",{type:"button",disabled:y,onClick:re,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[de,ue]}),e[48]=y,e[49]=re,e[50]=me):me=e[50];let fe;e[51]!==s||e[52]!==r||e[53]!==v.experimental_vibecode?(fe=v.experimental_vibecode&&n.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),r(),s()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:n.jsx(po,{className:"size-5 text-muted-foreground"})}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=s,e[52]=r,e[53]=v.experimental_vibecode,e[54]=fe):fe=e[54];let xe;e[55]!==ye?(xe=E=>n.jsx(Dr,{agent:E,onClick:()=>ye(E)},E.id),e[55]=ye,e[56]=xe):xe=e[56],O=n.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[me,fe,z.map(xe)]}),T=D.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-1 pt-4 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),n.jsx("div",{className:"grid grid-cols-3 gap-1",children:D.map(E=>n.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:E.id,template_title:E.title}),_e(E.id)},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[n.jsx(Pe,{icon:E.icon,name:E.title,size:"md",className:"transition-transform group-hover:scale-105"}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:E.title})]},E.id))})]}),e[3]=f,e[4]=S,e[5]=y,e[6]=k,e[7]=M,e[8]=_,e[9]=s,e[10]=u,e[11]=d,e[12]=l,e[13]=r,e[14]=o,e[15]=a,e[16]=i,e[17]=c,e[18]=g,e[19]=v.experimental_vibecode,e[20]=m,e[21]=D,e[22]=w,e[23]=$,e[24]=O,e[25]=T,e[26]=A,e[27]=P,e[28]=z}else D=e[21],w=e[22],$=e[23],O=e[24],T=e[25],A=e[26],P=e[27],z=e[28];let L;e[57]!==D||e[58]!==y||e[59]!==m||e[60]!==z.length?(L=z.length===0&&D.length===0&&!y&&n.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:m?"No agents found":"No agents yet"}),e[57]=D,e[58]=y,e[59]=m,e[60]=z.length,e[61]=L):L=e[61];let R;e[62]!==w||e[63]!==$||e[64]!==O||e[65]!==T||e[66]!==L?(R=n.jsxs("div",{className:w,children:[$,O,T,L]}),e[62]=w,e[63]=$,e[64]=O,e[65]=T,e[66]=L,e[67]=R):R=e[67];let B;e[68]!==p.slug?(B={org:p.slug},e[68]=p.slug,e[69]=B):B=e[69];let U;e[70]!==s?(U=()=>s(),e[70]=s,e[71]=U):U=e[71];let F;e[72]!==B||e[73]!==U?(F=n.jsx("div",{className:"border-t border-border px-3 py-2.5",children:n.jsx(Xs,{to:"/$org/settings/agents",params:B,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[72]=B,e[73]=U,e[74]=F):F=e[74];let H;return e[75]!==R||e[76]!==F||e[77]!==A||e[78]!==P?(H=n.jsxs("div",{className:A,children:[P,R,F]}),e[75]=R,e[76]=F,e[77]=A,e[78]=P,e[79]=H):H=e[79],H}function Fr(t){return t.id==="ai-research"}function Ur(t){return t.id==="ai-image"}function Gr(t){return t.id==="lean-canvas"}function Br(t){return t.id==="site-diagnostics"}function Hr(t){return Fn(t.id)}function Vr(t){return!Ln(t.id)}function Kr(t){return t.id}function Wr(t){return t.pinned}function qr(){const t=C.c(36),[e,s]=b.useState(!1),[o,r]=b.useState(!1),[i,l]=b.useState(!1),[a,c]=b.useState(!1),[u,d]=b.useState(!1),[m,x]=b.useState(!1),[f,p]=b.useState(!1),[j,I]=b.useState(!1),[g,k]=b.useState(!1),h=Bt(),{setOpenMobile:S}=Qe();let y;t[0]!==h||t[1]!==S?(y=()=>{s(!1),h&&S(!1)},t[0]=h,t[1]=S,t[2]=y):y=t[2];const v=y;let _;t[3]!==v||t[4]!==e?(_=e&&n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Ve,{className:"h-4 w-24"})}),children:n.jsx(Lr,{onClose:v,onOpenImportDeco:()=>r(!0),onOpenGithubImport:()=>{l(!0),v()},onOpenSelfHealing:()=>{c(!0),v()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>x(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>I(!0),onOpenAiResearchModal:()=>k(!0)})}),t[3]=v,t[4]=e,t[5]=_):_=t[5];const M=_;let D;t[6]!==h||t[7]!==e||t[8]!==M?(D=h?n.jsxs(n.Fragment,{children:[n.jsx(ie,{children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},children:n.jsx(Ke,{className:"!opacity-100"})})}),n.jsx(Ft,{open:e,onOpenChange:s,direction:"bottom",children:n.jsxs(Ut,{className:"max-h-[85dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Browse agents"}),M]})})]}):n.jsxs(lt,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),s(B)},children:[n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:n.jsx(Ke,{className:"!opacity-100"})})})}),n.jsx(ct,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:M})]}),t[6]=h,t[7]=e,t[8]=M,t[9]=D):D=t[9];let w;t[10]!==o?(w=n.jsx(co,{open:o,onOpenChange:r}),t[10]=o,t[11]=w):w=t[11];let $;t[12]!==i?($=n.jsx(uo,{open:i,onOpenChange:l}),t[12]=i,t[13]=$):$=t[13];let O;t[14]!==a?(O=n.jsx(Vn,{open:a,onOpenChange:c}),t[14]=a,t[15]=O):O=t[15];let T;t[16]!==u?(T=n.jsx(mo,{open:u,onOpenChange:d}),t[16]=u,t[17]=T):T=t[17];let A;t[18]!==m?(A=n.jsx(fo,{open:m,onOpenChange:x}),t[18]=m,t[19]=A):A=t[19];let P;t[20]!==f?(P=n.jsx(xo,{open:f,onOpenChange:p}),t[20]=f,t[21]=P):P=t[21];let z;t[22]!==j?(z=n.jsx(Kn,{open:j,onOpenChange:I}),t[22]=j,t[23]=z):z=t[23];let L;t[24]!==g?(L=n.jsx(Wn,{open:g,onOpenChange:k}),t[24]=g,t[25]=L):L=t[25];let R;return t[26]!==L||t[27]!==D||t[28]!==w||t[29]!==$||t[30]!==O||t[31]!==T||t[32]!==A||t[33]!==P||t[34]!==z?(R=n.jsxs(n.Fragment,{children:[D,w,$,O,T,A,P,z,L]}),t[26]=L,t[27]=D,t[28]=w,t[29]=$,t[30]=O,t[31]=T,t[32]=A,t[33]=P,t[34]=z,t[35]=R):R=t[35],R}function Qr(){const t=C.c(34),e=qt(),{org:s}=pe();let o;t[0]!==e?(o=e.filter(Zr).map(Jr),t[0]=e,t[1]=o):o=t[1];const r=o,{pinnedIds:i,unpin:l,reorder:a}=Yt(s.id,r),c=new Map(e.map(Xr)),u=i.map(R=>c.get(R)).filter(Yr);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:5}},t[2]=d):d=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m={coordinateGetter:so},t[3]=m):m=t[3];const x=Qn(bt(Xn,d),bt(Yn,m));let f;t[4]!==i||t[5]!==a?(f=R=>{const{active:B,over:U}=R;if(!U||B.id===U.id)return;const F=i.indexOf(B.id),H=i.indexOf(U.id);F===-1||H===-1||a(no([...i],F,H))},t[4]=i,t[5]=a,t[6]=f):f=t[6];const p=f,j=De,I="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const k=Le,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",S=ge,y="gap-2";let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(qr,{}),t[8]=v):v=t[8];const _=eo,M=to,D=Jn,w=Zn;let $;t[9]!==s.slug||t[10]!==l?($=R=>n.jsx(Er,{agent:R,org:s.slug,onUnpin:()=>l(R.id)},R.id),t[9]=s.slug,t[10]=l,t[11]=$):$=t[11];const O=u.map($);let T;t[12]!==D||t[13]!==i||t[14]!==w||t[15]!==O?(T=n.jsx(D,{items:i,strategy:w,children:O}),t[12]=D,t[13]=i,t[14]=w,t[15]=O,t[16]=T):T=t[16];let A;t[17]!==_||t[18]!==p||t[19]!==x||t[20]!==T||t[21]!==M?(A=n.jsx(_,{sensors:x,collisionDetection:M,onDragEnd:p,children:T}),t[17]=_,t[18]=p,t[19]=x,t[20]=T,t[21]=M,t[22]=A):A=t[22];let P;t[23]!==S||t[24]!==A||t[25]!==v?(P=n.jsxs(S,{className:y,children:[v,A]}),t[23]=S,t[24]=A,t[25]=v,t[26]=P):P=t[26];let z;t[27]!==k||t[28]!==P?(z=n.jsx(k,{className:h,children:P}),t[27]=k,t[28]=P,t[29]=z):z=t[29];let L;return t[30]!==j||t[31]!==z||t[32]!==g?(L=n.jsxs(j,{className:I,children:[g,z]}),t[30]=j,t[31]=z,t[32]=g,t[33]=L):L=t[33],L}function Yr(t){return!!t}function Xr(t){return[t.id,t]}function Jr(t){return t.id}function Zr(t){return t.pinned}function xs(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(b.Suspense,{fallback:n.jsx(De,{className:"py-0 px-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-2",children:n.jsx(ie,{children:n.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[n.jsx(Ve,{className:"h-4 w-4 rounded"}),n.jsx(Ve,{className:"h-4 flex-1"})]})})})})}),children:n.jsx(Qr,{})}),t[0]=e):e=t[0],e}function yl(){const t=C.c(4),e=Zt();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(er,{}),t[0]=s):s=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),t[1]=o):o=t[1];let r;return t[2]!==e?(r=n.jsx(ss,{sections:e,footer:s,additionalContent:o}),t[2]=e,t[3]=r):r=t[3],r}function _l(t){const e=C.c(5),{onClose:s}=t,o=Zt();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(tr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx($o,{sections:o,onClose:s,footer:r,additionalContent:i}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function ei(t,e){return t===1?!0:t===0?!1:e}function ti(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",o=t.mainParamPresent?t.mainParamValue!=="0":!s,r=s?!0:t.entityMetadata?.chatDefaultOpen??!1;return{mainOpen:o,chatOpen:r}}function Sl(t,e){return t&&e?{chat:45,main:55}:t&&!e?{chat:100,main:0}:!t&&e?{chat:0,main:100}:{chat:0,main:0}}function si(t,e){return t===1?!0:t===0?!1:e}function Cl(t,e){const s=ve(),o=qe({strict:!1}),r=We({strict:!1}),i=Re(),l=Xt(),{locator:a}=pe(),{virtualMcpId:c,orgSlug:u,isAgentRoute:d}=e,m=ti({entityMetadata:t,mainParamPresent:o.main!==void 0,mainParamValue:o.main}),x=si(o.chat,m.chatOpen),f=m.mainOpen,p=b.useRef(crypto.randomUUID()),j=r.taskId??p.current,I="/$org/$taskId",g=w=>({org:u,taskId:w}),k=d?{virtualmcpid:c}:{},h=(w,$)=>{s({to:I,params:g(j),search:O=>({...O,...w}),replace:$?.replace??!1})},S=(w,$)=>{s({to:I,params:g(w),search:O=>{const T={};return $?T.virtualmcpid=$:d&&(T.virtualmcpid=c),O.tasks&&(T.tasks=O.tasks),T}})},y=()=>{f?h({main:"0"},{replace:!0}):h({main:un(t)},{replace:!0})},v=()=>{h({chat:x?0:1},{replace:!0})},_=()=>{x||h({chat:1},{replace:!0})},M=async()=>{const w=crypto.randomUUID(),$=Lt(i,a,j);try{await l.create.mutateAsync({id:w,virtual_mcp_id:c,...$?{branch:$}:{}})}catch{}s({to:I,params:g(w),search:O=>{const T={...k,chat:1};return O.tasks&&(T.tasks=O.tasks),T}})},D=w=>{h({main:w},{replace:!0})};return{taskId:j,mainOpen:f,chatOpen:x,mainParam:o.main,setTaskId:S,toggleMain:y,toggleChat:v,openChat:_,createNewTask:M,openTab:D}}const ut=b.createContext(null);function Nl(t){const e=C.c(15),{children:s}=t,o=ve();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=qe(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open"},e[1]=l):l=e[1];const{tasks:a}=ot(l);let c;e[2]!==i.tasks||e[3]!==a.length?(c=()=>ei(i.tasks,a.length>0),e[2]=i.tasks,e[3]=a.length,e[4]=c):c=e[4];const[u,d]=b.useState(c);let m,x;e[5]!==o||e[6]!==u?(m=()=>{o({search:(g=>({...g,tasks:u?1:0})),replace:!0})},x=[u,o],e[5]=o,e[6]=u,e[7]=m,e[8]=x):(m=e[7],x=e[8]),b.useEffect(m,x);let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=()=>d(ni),e[9]=f):f=e[9];const p=f;let j;e[10]!==u?(j={tasksOpen:u,toggleTasks:p},e[10]=u,e[11]=j):j=e[11];let I;return e[12]!==s||e[13]!==j?(I=n.jsx(ut.Provider,{value:j,children:s}),e[12]=s,e[13]=j,e[14]=I):I=e[14],I}function ni(t){return!t}function kl(){const t=b.useContext(ut);if(!t)throw new Error("useTasksPanelState must be used inside <TasksPanelStateProvider>");return t}function wl(){return b.useContext(ut)}const ps=b.createContext(null);function Ce(){const t=b.use(ps);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function le(t){const e=C.c(10),{children:s}=t,[o,r]=b.useState(null),[i,l]=b.useState(null),[a,c]=b.useState(null),[u,d]=b.useState(null);let m;e[0]!==a||e[1]!==u||e[2]!==i||e[3]!==o?(m={togglesEl:o,setTogglesEl:r,tabsEl:i,setTabsEl:l,centerEl:a,setCenterEl:c,rightEl:u,setRightEl:d},e[0]=a,e[1]=u,e[2]=i,e[3]=o,e[4]=m):m=e[4];let x;e[5]!==s?(x=n.jsx("div",{className:"flex flex-col h-full min-h-0",children:s}),e[5]=s,e[6]=x):x=e[6];let f;return e[7]!==m||e[8]!==x?(f=n.jsx(ps,{value:m,children:x}),e[7]=m,e[8]=x,e[9]=f):f=e[9],f}function oi(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"shrink-0 grid grid-cols-3 items-center pl-1 pr-2 pt-0.25 h-12",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ri(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ii(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=o):o=e[1],o}function li(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("button",{type:"button",onClick:ci,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:n.jsx(gn,{size:16})}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs(n.Fragment,{children:[e,n.jsx("button",{type:"button",onClick:ai,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:n.jsx(go,{size:16})})]}),t[1]=s):s=t[1],s}function ai(){return window.history.forward()}function ci(){return window.history.back()}function di(){const t=C.c(2),{setCenterEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function ui(t){const e=C.c(3),{children:s}=t,{centerEl:o}=Ce();if(!o)return null;let r;return e[0]!==o||e[1]!==s?(r=Ee.createPortal(s,o),e[0]=o,e[1]=s,e[2]=r):r=e[2],r}function mi(){const t=C.c(2),{setTabsEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"shrink-0 flex items-center overflow-x-auto"}),t[0]=e,t[1]=s):s=t[1],s}function fi(t){const e=C.c(3),{children:s}=t,{tabsEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function xi(){const t=C.c(2),{setTogglesEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center gap-0.5 shrink-0 ml-0.5"}),t[0]=e,t[1]=s):s=t[1],s}function pi(t){const e=C.c(3),{children:s}=t,{togglesEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function hi(){const t=C.c(2),{setRightEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}function gi(t){const e=C.c(3),{children:s}=t,{rightEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}le.Header=oi;le.LeftColumn=ri;le.RightColumn=ii;le.Nav=li;le.CenterSlot=di;le.Center=ui;le.TabsSlot=mi;le.Tabs=fi;le.TogglesSlot=xi;le.Toggles=pi;le.RightSlot=hi;le.Right=gi;function bi(){const t=C.c(6),{org:e,locator:s}=pe(),o=Re();let r;t[0]!==s||t[1]!==o?(r=()=>{o.invalidateQueries({queryKey:Pt.tasksPrefix(s)})},t[0]=s,t[1]=o,t[2]=r):r=t[2];let i;t[3]!==e.id||t[4]!==r?(i={orgId:e.id,onTaskStatus:r},t[3]=e.id,t[4]=r,t[5]=i):i=t[5],jo(i)}function ji(t){const e=C.c(8),{virtualMcpId:s,size:o,showAutomationBadge:r}=t,i=o===void 0?"sm":o;let l;e[0]!==i||e[1]!==s?(l=s?n.jsx(vi,{virtualMcpId:s,size:i}):n.jsx(Pe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;e[3]!==r?(a=r&&n.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:n.jsx(vo,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=n.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function vi(t){const e=C.c(6),{virtualMcpId:s,size:o}=t,r=Qt(s);if(!r){let a;return e[0]!==o?(a=n.jsx(Pe,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const i=r.icon??null;let l;return e[2]!==r.title||e[3]!==o||e[4]!==i?(l=n.jsx(Pe,{icon:i,name:r.title,size:o}),e[2]=r.title,e[3]=o,e[4]=i,e[5]=l):l=e[5],l}function yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function _i(t){const e=C.c(47),{task:s,isActive:o,onClick:r,onArchive:i,showAutomationBadge:l}=t,a=yo(s.status),c=a.icon,u=Qt(s.virtual_mcp_id);let d;e[0]!==u?(d=yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,x=b.useRef(null);let f;e[2]!==o?(f=()=>{if(!o)return;const V=x.current;V&&(V.focus({preventScroll:!0}),V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}))},e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o||e[5]!==s.id?(p=[o,s.id],e[4]=o,e[5]=s.id,e[6]=p):p=e[6],b.useEffect(f,p);const j="button",I=0;let g;e[7]!==r?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),r())},e[7]=r,e[8]=g):g=e[8];const k=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==k?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors",k),e[9]=k,e[10]=h):h=e[10];let S;e[11]!==l||e[12]!==s.virtual_mcp_id?(S=n.jsx(ji,{virtualMcpId:s.virtual_mcp_id,size:"xs",showAutomationBadge:l}),e[11]=l,e[12]=s.virtual_mcp_id,e[13]=S):S=e[13];const y=s.title||"Untitled task";let v;e[14]!==y?(v=n.jsx("div",{className:"text-sm text-foreground truncate",children:y}),e[14]=y,e[15]=v):v=e[15];let _;e[16]!==m||e[17]!==s.branch||e[18]!==s.updated_at?(_=s.updated_at&&n.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[s.branch?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):m?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:mn(new Date(s.updated_at))})]}),e[16]=m,e[17]=s.branch,e[18]=s.updated_at,e[19]=_):_=e[19];let M;e[20]!==v||e[21]!==_?(M=n.jsxs("div",{className:"flex-1 min-w-0",children:[v,_]}),e[20]=v,e[21]=_,e[22]=M):M=e[22];const D="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",w="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",$=a.label,O=14,T=J(a.iconClassName,s.status==="in_progress"&&"animate-spin");let A;e[23]!==c||e[24]!==T?(A=n.jsx(c,{size:O,className:T}),e[23]=c,e[24]=T,e[25]=A):A=e[25];let P;e[26]!==a||e[27]!==A?(P=n.jsx("span",{className:w,"aria-label":$,children:A}),e[26]=a,e[27]=A,e[28]=P):P=e[28];let z;e[29]!==i?(z=V=>{V.stopPropagation(),i()},e[29]=i,e[30]=z):z=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(nn,{size:14}),e[31]=L):L=e[31];let R;e[32]!==z?(R=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Archive task",onClick:z,className:"[grid-area:slot] invisible group-hover/row:visible flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted",children:L})}),e[32]=z,e[33]=R):R=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(st,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==R?(U=n.jsxs(nt,{children:[R,B]}),e[35]=R,e[36]=U):U=e[36];let F;e[37]!==P||e[38]!==U?(F=n.jsxs("div",{className:D,children:[P,U]}),e[37]=P,e[38]=U,e[39]=F):F=e[39];let H;return e[40]!==r||e[41]!==M||e[42]!==F||e[43]!==g||e[44]!==h||e[45]!==S?(H=n.jsxs("div",{ref:x,role:j,tabIndex:I,onClick:r,onKeyDown:g,className:h,children:[S,M,F]}),e[40]=r,e[41]=M,e[42]=F,e[43]=g,e[44]=h,e[45]=S,e[46]=H):H=e[46],H}const hs={all:"All tasks",manual:"Chats",automation:"Automation"},gs={all:"All members",mine:"Mine only"};function Si(t){const e=C.c(59),{title:s,tasks:o,activeTaskId:r,onSelect:i,onArchive:l,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[x,f]=b.useState("all"),[p,j]=b.useState("mine");let I;e[0]!==m||e[1]!==p||e[2]!==o?(I=p==="mine"&&m?o.filter(N=>N.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=I):I=e[3];const g=I;let k;e[4]!==x||e[5]!==g?(k=x==="automation"?g.filter(wi):x==="manual"?g.filter(ki):g,e[4]=x,e[5]=g,e[6]=k):k=e[6];const h=k;let S;e[7]!==s?(S=n.jsx("span",{children:s}),e[7]=s,e[8]=S):S=e[8];let y;e[9]!==p?(y=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter by member",className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:p==="mine"?n.jsx(rn,{size:16}):n.jsx(Vt,{size:16})})}),e[9]=p,e[10]=y):y=e[10];let v;e[11]!==p?(v=N=>{const K=N;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),j(K)},e[11]=p,e[12]=v):v=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=Object.keys(gs),e[13]=_):_=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=_.map(Ni),e[14]=M):M=e[14];let D;e[15]!==p||e[16]!==v?(D=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:p,onValueChange:v,children:M})}),e[15]=p,e[16]=v,e[17]=D):D=e[17];let w;e[18]!==y||e[19]!==D?(w=n.jsxs(St,{children:[y,D]}),e[18]=y,e[19]=D,e[20]=w):w=e[20];const $=x!=="all"&&"text-purple-500";let O;e[21]!==$?(O=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",$),e[21]=$,e[22]=O):O=e[22];let T;e[23]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(xn,{size:16}),e[23]=T):T=e[23];let A;e[24]!==O?(A=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter tasks",className:O,children:T})}),e[24]=O,e[25]=A):A=e[25];let P;e[26]!==x?(P=N=>{const K=N;K!==x&&se("tasks_panel_filter_changed",{to_value:K}),f(K)},e[26]=x,e[27]=P):P=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=Object.keys(hs),e[28]=z):z=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=z.map(Ci),e[29]=L):L=e[29];let R;e[30]!==x||e[31]!==P?(R=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:x,onValueChange:P,children:L})}),e[30]=x,e[31]=P,e[32]=R):R=e[32];let B;e[33]!==A||e[34]!==R?(B=n.jsxs(St,{children:[A,R]}),e[33]=A,e[34]=R,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==s?(U=c&&a&&n.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${s.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:n.jsx(on,{size:16})}),e[36]=a,e[37]=c,e[38]=s,e[39]=U):U=e[39];let F;e[40]!==B||e[41]!==U||e[42]!==w?(F=n.jsxs("div",{className:"flex items-center gap-0.5",children:[w,B,U]}),e[40]=B,e[41]=U,e[42]=w,e[43]=F):F=e[43];let H;e[44]!==F||e[45]!==S?(H=n.jsxs("div",{className:"shrink-0 pl-2 pr-1.5 h-7 flex items-center justify-between text-xs font-medium text-muted-foreground mb-1",children:[S,F]}),e[44]=F,e[45]=S,e[46]=H):H=e[46];let V;e[47]!==r||e[48]!==d||e[49]!==l||e[50]!==i||e[51]!==u||e[52]!==h?(V=h.length===0&&d?n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(N=>n.jsx(_i,{task:N,isActive:r===N.id,onClick:()=>{r!==N.id&&se("tasks_panel_task_clicked",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null,from_automation:!!N.fromAutomation}),i(N)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null}),l(N)},showAutomationBadge:u||N.fromAutomation},N.id)),e[47]=r,e[48]=d,e[49]=l,e[50]=i,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5",children:V}),e[54]=V,e[55]=q):q=e[55];let Q;return e[56]!==H||e[57]!==q?(Q=n.jsxs("div",{className:"flex flex-col h-full min-h-0 mt-1",children:[H,q]}),e[56]=H,e[57]=q,e[58]=Q):Q=e[58],Q}function Ci(t){return n.jsx(Jt,{value:t,children:hs[t]},t)}function Ni(t){return n.jsx(Jt,{value:t,children:gs[t]},t)}function ki(t){return!t.fromAutomation}function wi(t){return t.fromAutomation}function Ii(){const t=C.c(22);bi();const{data:e}=Se.useSession(),s=e?.user?.id;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={owner:"me",status:"open",hasTrigger:!1},t[0]=o):o=t[0];const{tasks:r}=ot(o);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={owner:"all",status:"open",hasTrigger:!0},t[1]=i):i=t[1];const{tasks:l}=ot(i),{setTaskId:a,createNewTask:c}=Dt();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=We(u),{locator:m,org:x}=pe(),f=Re();let p;t[3]!==x.id?(p={connectionId:Kt,orgId:x.id},t[3]=x.id,t[4]=p):p=t[4];const j=Wt(p),I=d.taskId??null;let g;t[5]!==l||t[6]!==r?(g=[...r,...l.map($i)].sort(Mi),t[5]=l,t[6]=r,t[7]=g):g=t[7];const k=g;let h;t[8]!==j||t[9]!==m||t[10]!==f?(h=async _=>{try{await ho(j,_.id,{hidden:!0}),f.invalidateQueries({queryKey:Pt.tasksPrefix(m)})}catch(M){const w=M;je.error(`Failed to archive task: ${w.message}`)}},t[8]=j,t[9]=m,t[10]=f,t[11]=h):h=t[11];const S=h;if(k.length===0){let _;return t[12]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("div",{className:"h-full flex items-center justify-center p-4",children:n.jsx(bo,{image:n.jsx(ln,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[12]=_):_=t[12],_}let y;t[13]!==a?(y=_=>a(_.id,_.virtual_mcp_id),t[13]=a,t[14]=y):y=t[14];let v;return t[15]!==I||t[16]!==k||t[17]!==c||t[18]!==s||t[19]!==S||t[20]!==y?(v=n.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:n.jsx(Si,{title:"Tasks",tasks:k,activeTaskId:I,onSelect:y,onArchive:S,onNew:c,showNewButton:!0,currentUserId:s})}),t[15]=I,t[16]=k,t[17]=c,t[18]=s,t[19]=S,t[20]=y,t[21]=v):v=t[21],v}function Mi(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function $i(t){return{...t,fromAutomation:!0}}function Ti(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(Ai)}),t[0]=e):e=t[0],e}function Ai(t,e){return n.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Il(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(qn.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(it,{fallback:e,children:n.jsx(b.Suspense,{fallback:n.jsx(Ti,{}),children:n.jsx(Ii,{})})}),t[1]=s):s=t[1],s}export{yl as S,Il as T,Nl as a,le as b,Sl as c,wl as d,Cl as e,_l as f,yi as g,kl as u};
1
+ import{e as C,s as pe,f as ve,U as It,g as We,d as qe,W as ys,X as _s,Y as Ss,j as n,Z as Cs,c as J,t as se,r as b,$ as Mt,a0 as $t,H as Ns,J as ks,C as ws,z as Is,a as Ms,B as et,b as Se,a1 as $s,P as Tt,x as je,a2 as Ts,a3 as As,o as Re,a4 as Ps,a5 as Os,a6 as zs,a7 as Rs,a8 as Oe,a9 as Es,aa as Ds,ab as Ls,ac as Fs,ad as At,ae as Us,af as Gs,ag as Bs,ah as Hs,ai as Vs,aj as Ks,ak as Ws,al as qs,am as Qs,an as Ys,ao as Ee,L as Xs,E as it,K as Pt}from"./index-O-xThSQt.js";import{p as Js,g as Zs,D as en,E as mt,F as ft,G as tn,H as xt,I as sn,A as Pe,J as nn,k as on,K as rn,L as ln}from"./agent-icon-ChIrIWeW.js";import{i as an,f as De,g as Le,h as ge,u as Qe,j as he,k as ie,l as Ot,m as zt,n as cn,o as Rt,p as Et}from"./index-DCHF8zOG.js";import{u as Dt,r as Lt}from"./shell-layout-DOMzE0SQ.js";import{f as dn,g as un,h as mn}from"./pair-D89tt-Oa.js";import{S as Ve}from"./skeleton-YcXGprZE.js";import{b as lt,P as at,a as ct}from"./popover-Co2M62hE.js";import{b as Ft,a as Ut,D as Gt}from"./drawer-B9QExE6j.js";import{A as pt}from"./avatar-CKkXwPlY.js";import{u as Bt,a as tt,b as st,c as ht,T as nt}from"./tooltip-CZKTj_88.js";import{i as Ht}from"./ChevronDown-Bg0fGsAy.js";import{c as gt,a as fn,e as xn}from"./XCircle-DGL-4U6P.js";import{i as pn,b as hn,n as gn}from"./ZapSquare-T3gHYvlz.js";import{n as bn,a as jn,i as vn}from"./Sun-vFyK4_Ll.js";import{s as Ke}from"./Plus-DYo953wk.js";import{a as Ye}from"./Settings02-DfEUH8Vu.js";import{i as yn}from"./Shield01-DkQy31Nt.js";import{a as Vt}from"./Users03-CsGzKQhD.js";import{f as _n,a as Sn,b as Cn,c as Nn,d as kn,e as wn,A as In}from"./alert-dialog-D6jDWQW-.js";import{F as Mn,a as $n,b as Tn,c as An,d as Pn,e as On,f as zn}from"./form-CEqJ4N_7.js";import{I as Rn}from"./input-oRQz03qA.js";import{S as En}from"./index-B6VjlsLE.js";import"./index-C2C_Qiwh.js";import{s as Dn}from"./XClose-DfM5GjZF.js";import{S as Kt,u as Wt,W as ze,i as Ln,b as Fn}from"./constants-ChdU9xvz.js";import{u as Un}from"./use-mcp-tools-dN493Per.js";import{u as Gn}from"./use-ai-providers-Bi5zwgNs.js";import{A as Bn,b as Hn,S as Vn,c as Kn,d as Wn,C as qn}from"./index-CwWV7ZbX.js";import{u as Qn,a as bt,K as Yn,P as Xn,S as Jn,v as Zn,D as eo,c as to,s as so,b as no,d as oo,C as ro,e as io}from"./collection-search-w3FCfjcj.js";import{i as jt}from"./X-BSw526sh.js";import{b as qt,u as Qt}from"./use-virtual-mcp-Cn-xT_JW.js";import{u as Yt,a as lo}from"./use-navigate-to-agent-CBd-r96N.js";import{u as ao}from"./use-create-virtual-mcp-BDDTbSDu.js";import{I as co,a as uo,S as mo,L as fo,b as xo,G as po}from"./lean-canvas-recruit-modal-CRZY0Eb-.js";import{u as Xt}from"./use-tasks-CMJbyrNa.js";import{e as ot,f as ho}from"./chat-context-GRw0JUF-.js";import{i as go}from"./ChevronRight-DMa-ECep.js";import{E as bo}from"./empty-state-CtpU7jLB.js";import{u as jo}from"./use-decopilot-events-DfNhZiit.js";import{g as Jt,a as vt,b as yt,h as _t,D as St}from"./dropdown-menu-Dqqv-DxC.js";import{i as vo}from"./Zap-D55ucbXC.js";import{g as yo}from"./task-status-jHWa41cV.js";function Zt(){const t=C.c(77),{org:e}=pe(),s=ve(),o=It(),{setTasksOpen:r,openTab:i}=Dt(),l=e.slug,a=pe().project;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},t[0]=c):c=t[0];const u=We(c);let d;t[1]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[1]=d):d=t[1];const m=qe(d),x=o.location.pathname;let f;t[2]!==a.enabledPlugins?(f=a.enabledPlugins??[],t[2]=a.enabledPlugins,t[3]=f):f=t[3];const p=f;let j;t[4]!==a.ui?(j=a.ui?.pinnedViews??[],t[4]=a.ui,t[5]=j):j=t[5];const I=j;let g,k,h,S;if(t[6]!==a.id||t[7]!==p||t[8]!==s||t[9]!==l||t[10]!==u.pluginId||t[11]!==u.taskId||t[12]!==m.virtualmcpid){let N;t[17]!==p?(N=X=>p.includes(X.pluginId),t[17]=p,t[18]=N):N=t[18];const K=ys.filter(N),W=m.virtualmcpid??a.id;k=!!m.virtualmcpid;const G=u.taskId??"",Y=u.pluginId;let ee;t[19]!==Y?(ee=X=>Y===X,t[19]=Y,t[20]=ee):ee=t[20],g=ee;let Z;t[21]!==G||t[22]!==s||t[23]!==l||t[24]!==W?(Z=X=>{const oe=G||crypto.randomUUID();s({to:"/$org/$taskId/$pluginId",params:{org:l,taskId:oe,pluginId:X},search:ae=>({...ae,virtualmcpid:W})})},t[21]=G,t[22]=s,t[23]=l,t[24]=W,t[25]=Z):Z=t[25],h=Z;let ne;t[26]!==g||t[27]!==h?(ne=X=>({key:X.pluginId,label:X.label,icon:X.icon,isActive:g(X.pluginId),onClick:()=>h(X.pluginId)}),t[26]=g,t[27]=h,t[28]=ne):ne=t[28],S=K.map(ne),t[6]=a.id,t[7]=p,t[8]=s,t[9]=l,t[10]=u.pluginId,t[11]=u.taskId,t[12]=m.virtualmcpid,t[13]=g,t[14]=k,t[15]=h,t[16]=S}else g=t[13],k=t[14],h=t[15],S=t[16];const y=S;let v;if(t[29]!==p||t[30]!==g||t[31]!==h){let N;t[33]!==p?(N=G=>p.includes(G.pluginId),t[33]=p,t[34]=N):N=t[34];const K=_s.filter(N);let W;t[35]!==g||t[36]!==h?(W=G=>({type:"group",group:{id:`${G.pluginId}-${G.id}`,label:G.label,items:G.items.map((Y,ee)=>({key:`${G.pluginId}-${G.id}-${ee}`,label:Y.label,icon:Y.icon,isActive:g(G.pluginId),onClick:()=>h(G.pluginId)})),defaultExpanded:G.defaultExpanded??!0}}),t[35]=g,t[36]=h,t[37]=W):W=t[37],v=K.map(W),t[29]=p,t[30]=g,t[31]=h,t[32]=v}else v=t[32];const _=v;let M;if(t[38]!==i||t[39]!==I){let N;t[41]!==i?(N=K=>{const W=Js(K.icon),G=W.type==="icon"?Zs(W.name):null;return{key:`app-${K.connectionId}-${K.toolName}`,label:K.label||K.toolName,icon:G?n.jsx(G,{size:16,className:"text-muted-foreground"}):W.type==="url"?n.jsx("img",{src:W.url,alt:"",className:"size-4 rounded"}):n.jsx(an,{size:16,className:"text-muted-foreground"}),isActive:!1,onClick:()=>i(dn(K.connectionId,K.toolName))}},t[41]=i,t[42]=N):N=t[42],M=I.map(N),t[38]=i,t[39]=I,t[40]=M}else M=t[40];const D=M;let w;t[43]!==D?(w=D.length>0?{type:"group",group:{id:"apps",label:"Apps",items:D,defaultExpanded:!0}}:null,t[43]=D,t[44]=w):w=t[44];const $=w;let O;t[45]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(en,{className:"size-4!"}),t[45]=O):O=t[45];const T=x===`/${l}`||x===`/${l}/`;let A;t[46]!==s||t[47]!==l||t[48]!==r?(A=()=>{r(!1),s({to:"/$org",params:{org:l}})},t[46]=s,t[47]=l,t[48]=r,t[49]=A):A=t[49];let P;t[50]!==A||t[51]!==T?(P={key:"home",label:"Home",icon:O,isActive:T,onClick:A},t[50]=A,t[51]=T,t[52]=P):P=t[52];const z=P;let L;t[53]!==p?(L=p.includes(Ss),t[53]=p,t[54]=L):L=t[54];const R=L;let B;t[55]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(Cs,{className:"size-4!"}),t[55]=B):B=t[55];let U;t[56]!==l||t[57]!==x?(U=x.startsWith(`/${l}/settings/workflows`),t[56]=l,t[57]=x,t[58]=U):U=t[58];let F;t[59]!==s||t[60]!==l?(F=()=>s({to:"/$org/settings/workflows",params:{org:l}}),t[59]=s,t[60]=l,t[61]=F):F=t[61];let H;t[62]!==U||t[63]!==F?(H={key:"workflows",label:"Workflows",icon:B,isActive:U,onClick:F},t[62]=U,t[63]=F,t[64]=H):H=t[64];const V=H;let q;if(t[65]!==z||t[66]!==k||t[67]!==R||t[68]!==V){const N=[z];k&&R&&N.push(V),q={type:"items",items:N},t[65]=z,t[66]=k,t[67]=R,t[68]=V,t[69]=q}else q=t[69];let Q;if(t[70]!==$||t[71]!==_||t[72]!==y||t[73]!==q){if(Q=[q],y.length>0){let N;t[75]!==y?(N={type:"items",items:y},t[75]=y,t[76]=N):N=t[76],Q.push(N)}_.length>0&&Q.push(..._),$&&Q.push($),t[70]=$,t[71]=_,t[72]=y,t[73]=q,t[74]=Q}else Q=t[74];return Q}function es(t){const e=C.c(3),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex h-6 items-center",children:n.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=o):o=e[0];let r;return e[1]!==s?(r=n.jsxs(De,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[o,n.jsx(Le,{children:n.jsx(ge,{className:"gap-0.5",children:s})})]}),e[1]=s,e[2]=r):r=e[2],r}function _o(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function ts(t){const e=C.c(15),{item:s}=t,{isMobile:o,setOpenMobile:r}=Qe();let i;e[0]!==o||e[1]!==s||e[2]!==r?(i=()=>{se("nav_item_clicked",{nav_key:s.key,nav_label:s.label,is_active:!!s.isActive,is_mobile:o}),s.onClick?.(),o&&r(!1)},e[0]=o,e[1]=s,e[2]=r,e[3]=i):i=e[3];const l=i,a=s.key,c=s.isActive&&"z-10";let u;e[4]!==c?(u=J(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==l||e[7]!==s.icon||e[8]!==s.isActive||e[9]!==s.label?(d=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:s.icon}),e[6]=l,e[7]=s.icon,e[8]=s.isActive,e[9]=s.label,e[10]=d):d=e[10];let m;return e[11]!==s.key||e[12]!==u||e[13]!==d?(m=n.jsx(ie,{className:u,children:d},a),e[11]=s.key,e[12]=u,e[13]=d,e[14]=m):m=e[14],m}function So(t){const e=C.c(12),{section:s}=t;switch(s.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ot,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=s.group.label,r=s.group.defaultExpanded;let i;e[2]!==s.group.items?(i=s.group.items.map(No),e[2]=s.group.items,e[3]=i):i=e[3];let l;return e[4]!==s.group.defaultExpanded||e[5]!==s.group.label||e[6]!==i?(l=n.jsx(es,{label:o,defaultExpanded:r,children:i}),e[4]=s.group.defaultExpanded,e[5]=s.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let o;e[8]!==s.items?(o=s.items.map(Co),e[8]=s.items,e[9]=o):o=e[9];let r;return e[10]!==o?(r=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:o})})}),e[10]=o,e[11]=r):r=e[11],r}}}function Co(t){return n.jsx(ts,{item:t},t.key)}function No(t){return n.jsx(ts,{item:t},t.key)}function ko(t){const e=C.c(14),{sections:s,header:o,footer:r,additionalContent:i,variant:l,contentClassName:a}=t,c=l===void 0?"sidebar":l;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(_o,{})}),e[0]=u):u=e[0];let d;e[1]!==a?(d=J("flex flex-col flex-1 px-2 py-2 gap-0",a),e[1]=a,e[2]=d):d=e[2];let m;e[3]!==s?(m=s.map(wo),e[3]=s,e[4]=m):m=e[4];let x;e[5]!==i||e[6]!==d||e[7]!==m?(x=n.jsxs(zt,{className:d,children:[m,i]}),e[5]=i,e[6]=d,e[7]=m,e[8]=x):x=e[8];let f;return e[9]!==r||e[10]!==o||e[11]!==x||e[12]!==c?(f=n.jsxs(cn,{variant:c,children:[u,o,x,r]}),e[9]=r,e[10]=o,e[11]=x,e[12]=c,e[13]=f):f=e[13],f}function wo(t,e){return n.jsx(So,{section:t},e)}function ss(t){const e=C.c(2);let s;return e[0]!==t?(s=n.jsx(ko,{...t}),e[0]=t,e[1]=s):s=e[1],s}ss.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Ve,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function Io(){const t=C.c(7),s=Mt().logo??$t,o=typeof s=="string"?s:s.light,r=typeof s=="string"?s:s.dark;let i;t[0]!==o?(i=n.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=o,t[1]=i):i=t[1];let l;t[2]!==r?(l=n.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=r,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=n.jsx(Rt,{className:"flex items-center justify-center shrink-0 px-2 pb-0",children:n.jsxs("div",{className:"flex w-full aspect-square items-center justify-center",children:[i,l]})}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function Ct(t){const e=C.c(15),{item:s,onClose:o}=t,r=s.isActive&&"z-10";let i;e[0]!==r?(i=J(r),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==s||e[3]!==o?(l=()=>{s.onClick?.(),o()},e[2]=s,e[3]=o,e[4]=l):l=e[4];let a;e[5]!==s.icon?(a=n.jsx("span",{className:"[&>svg]:size-8",children:s.icon}),e[5]=s.icon,e[6]=a):a=e[6];let c;e[7]!==s.isActive||e[8]!==s.label||e[9]!==l||e[10]!==a?(c=n.jsx(he,{onClick:l,isActive:s.isActive,tooltip:s.label,className:"bg-muted/75",children:a}),e[7]=s.isActive,e[8]=s.label,e[9]=l,e[10]=a,e[11]=c):c=e[11];let u;return e[12]!==i||e[13]!==c?(u=n.jsx(ie,{className:i,children:c}),e[12]=i,e[13]=c,e[14]=u):u=e[14],u}function Mo(t){const e=C.c(18),{section:s,onClose:o}=t;switch(s.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ot,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=s.group.label,i=s.group.defaultExpanded;let l;if(e[2]!==o||e[3]!==s.group.items){let c;e[5]!==o?(c=u=>n.jsx(Ct,{item:u,onClose:o},u.key),e[5]=o,e[6]=c):c=e[6],l=s.group.items.map(c),e[2]=o,e[3]=s.group.items,e[4]=l}else l=e[4];let a;return e[7]!==s.group.defaultExpanded||e[8]!==s.group.label||e[9]!==l?(a=n.jsx(es,{label:r,defaultExpanded:i,children:l}),e[7]=s.group.defaultExpanded,e[8]=s.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==o||e[12]!==s.items){let l;e[14]!==o?(l=a=>n.jsx(Ct,{item:a,onClose:o},a.key),e[14]=o,e[15]=l):l=e[15],r=s.items.map(l),e[11]=o,e[12]=s.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=n.jsx(De,{className:"pt-0 pr-0 pb-0 pl-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}}}function $o(t){const e=C.c(12),{sections:s,onClose:o,footer:r,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"h-10 shrink-0"}),children:n.jsx(Io,{})}),e[0]=l):l=e[0];let a;if(e[1]!==o||e[2]!==s){let d;e[4]!==o?(d=(m,x)=>n.jsx(Mo,{section:m,onClose:o},x),e[4]=o,e[5]=d):d=e[5],a=s.map(d),e[1]=o,e[2]=s,e[3]=a}else a=e[3];let c;e[6]!==i||e[7]!==a?(c=n.jsxs(zt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,i]}),e[6]=i,e[7]=a,e[8]=c):c=e[8];let u;return e[9]!==r||e[10]!==c?(u=n.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[l,c,r]}),e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function ns(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const To=Ns({name:ks().min(2,"Organization name is required")});function Ao(t){const e=C.c(41),{open:s,onOpenChange:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:ws(To),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Is(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:Oo,onSuccess:Po},e[1]=l):l=e[1];const a=Ms(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsxs(Cn,{children:[n.jsx(Nn,{children:"Create a new organization"}),n.jsx(kn,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==i){let _;e[6]!==a?(_=M=>a.mutateAsync(M),e[6]=a,e[7]=_):_=e[7],d=i.handleSubmit(_),e[3]=a,e[4]=i,e[5]=d}else d=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:M}=_;return n.jsxs(Tn,{children:[n.jsx(An,{children:"Organization Name"}),n.jsx(Pn,{children:n.jsx(Rn,{...M,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),n.jsx(On,{children:"The name of your company or organization"}),M.value&&n.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",n.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ns(M.value)]})]}),n.jsx(zn,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let x;e[10]!==i.control||e[11]!==m?(x=n.jsx(Mn,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=x):x=e[12];let f;e[13]!==c?(f=c&&n.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let j;e[18]!==i.formState.isSubmitting||e[19]!==p?(j=n.jsx(_n,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=j):j=e[20];const I=!i.formState.isValid||i.formState.isSubmitting;let g;e[21]!==i.formState.isSubmitting?(g=i.formState.isSubmitting?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(En,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=g):g=e[22];let k;e[23]!==I||e[24]!==g?(k=n.jsx(et,{type:"submit",variant:"default",disabled:I,children:g}),e[23]=I,e[24]=g,e[25]=k):k=e[25];let h;e[26]!==k||e[27]!==j?(h=n.jsxs(wn,{children:[j,k]}),e[26]=k,e[27]=j,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==d||e[31]!==x||e[32]!==f?(S=n.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[x,f,h]}),e[29]=h,e[30]=d,e[31]=x,e[32]=f,e[33]=S):S=e[33];let y;e[34]!==i||e[35]!==S?(y=n.jsxs(Sn,{children:[u,n.jsx($n,{...i,children:S})]}),e[34]=i,e[35]=S,e[36]=y):y=e[36];let v;return e[37]!==o||e[38]!==s||e[39]!==y?(v=n.jsx(In,{open:s,onOpenChange:o,children:y}),e[37]=o,e[38]=s,e[39]=y,e[40]=v):v=e[40],v}function Po(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Oo(t){const e=ns(t.name);if(!e)throw new Error("Organization slug is invalid");const s=await Se.organization.create({name:t.name,slug:e});if(s?.error)throw new Error(s.error.message||"Failed to create organization");const o=s?.data?.slug??e;if(!o)throw new Error("Failed to create organization");return{orgSlug:o}}function rt(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function zo(t){const e=C.c(13),{org:s,size:o}=t,r=o===void 0?"sm":o,i=r==="xs"?"size-5":"size-6",l=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=J(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:rt(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let u;e[5]!==s.logo||e[6]!==s.name||e[7]!==l?(u=s.logo?n.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:J("font-semibold leading-none",l),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=l,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=n.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function Be(t){const e=C.c(22),{item:s,onClose:o}=t;if(s.href){const c=s.external?"_blank":void 0,u=s.external?"noopener noreferrer":void 0;let d;e[0]!==s.icon?(d=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[0]=s.icon,e[1]=d):d=e[1];let m;e[2]!==s.label?(m=n.jsx("span",{className:"flex-1",children:s.label}),e[2]=s.label,e[3]=m):m=e[3];let x;return e[4]!==s.href||e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==m?(x=n.jsxs("a",{href:s.href,target:c,rel:u,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:o,children:[d,m]}),e[4]=s.href,e[5]=o,e[6]=c,e[7]=u,e[8]=d,e[9]=m,e[10]=x):x=e[10],x}let r;e[11]!==s||e[12]!==o?(r=()=>{s.onClick?.(),o()},e[11]=s,e[12]=o,e[13]=r):r=e[13];let i;e[14]!==s.icon?(i=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:s.icon}),e[14]=s.icon,e[15]=i):i=e[15];let l;e[16]!==s.label?(l=n.jsx("span",{className:"flex-1",children:s.label}),e[16]=s.label,e[17]=l):l=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==l?(a=n.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=r,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Nt(t){const e=C.c(16),{sortedOrgs:s,orgParam:o,onSelectOrg:r,onCreateOrg:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ke,{size:16}),e[1]=a):a=e[1];let c;e[2]!==i?(c=n.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[l,n.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:a})]}),e[2]=i,e[3]=c):c=e[3];let u;if(e[4]!==r||e[5]!==o||e[6]!==s){let x;e[8]!==r||e[9]!==o?(x=f=>n.jsxs("button",{type:"button",onClick:()=>r(f.slug),className:J("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",f.slug===o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[n.jsx(zo,{org:f,size:"sm"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium truncate",children:f.name}),n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.slug})]}),f.slug===o&&n.jsx(Ht,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},f.id),e[8]=r,e[9]=o,e[10]=x):x=e[10],u=s.map(x),e[4]=r,e[5]=o,e[6]=s,e[7]=u}else u=e[7];let d;e[11]!==u?(d=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==c||e[14]!==d?(m=n.jsxs(n.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=m):m=e[15],m}function kt(t){const e=C.c(142),{user:s,userImage:o,menuItems:r,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x,close:f,isMobile:p}=t;if(p){const G=s?.name??"U";let Y;e[0]!==G||e[1]!==o?(Y=n.jsx(pt,{url:o,fallback:G,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=G,e[1]=o,e[2]=Y):Y=e[2];const ee=s?.name??"User";let Z;e[3]!==ee?(Z=n.jsx("p",{className:"text-sm font-medium truncate",children:ee}),e[3]=ee,e[4]=Z):Z=e[4];const ne=s?.email;let X;e[5]!==ne?(X=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=X):X=e[6];let oe;e[7]!==Z||e[8]!==X?(oe=n.jsxs("div",{className:"flex-1 min-w-0",children:[Z,X]}),e[7]=Z,e[8]=X,e[9]=oe):oe=e[9];let ae;e[10]!==s?(ae=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Lo)},e[10]=s,e[11]=ae):ae=e[11];let Ne;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ne=n.jsx(gt,{size:14}),e[12]=Ne):Ne=e[12];let ce;e[13]!==ae?(ce=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:ae,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ne})}),e[13]=ae,e[14]=ce):ce=e[14];let ye;e[15]===Symbol.for("react.memo_cache_sentinel")?(ye=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ye):ye=e[15];let _e;e[16]!==ce?(_e=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[ce,ye]})}),e[16]=ce,e[17]=_e):_e=e[17];let re;e[18]!==_e||e[19]!==Y||e[20]!==oe?(re=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[Y,oe,_e]}),e[18]=_e,e[19]=Y,e[20]=oe,e[21]=re):re=e[21];let de;e[22]!==x||e[23]!==m||e[24]!==d||e[25]!==u?(de=n.jsx("div",{className:"border-b border-border pb-2",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[22]=x,e[23]=m,e[24]=d,e[25]=u,e[26]=de):de=e[26];let ue;if(e[27]!==f||e[28]!==r){let be;e[30]!==f?(be=Ge=>n.jsx(Be,{item:Ge,onClose:f},Ge.key),e[30]=f,e[31]=be):be=e[31],ue=r.map(be),e[27]=f,e[28]=r,e[29]=ue}else ue=e[29];let me;e[32]!==f||e[33]!==i?(me=n.jsx(Be,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=me):me=e[34];let fe;e[35]!==ue||e[36]!==me?(fe=n.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[ue,me]}),e[35]=ue,e[36]=me,e[37]=fe):fe=e[37];let xe;e[38]!==de||e[39]!==fe?(xe=n.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[de,fe]}),e[38]=de,e[39]=fe,e[40]=xe):xe=e[40];let E;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let be;e[45]!==a.theme||e[46]!==c?(be=Ge=>{const{value:Ze,icon:bs,label:js}=Ge;return n.jsx("button",{type:"button","aria-label":js,onClick:()=>c(vs=>({...vs,theme:Ze})),className:J("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ze?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:bs},Ze)},e[45]=a.theme,e[46]=c,e[47]=be):be=e[47],E=l.map(be),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=E}else E=e[44];let ke;e[48]!==E?(ke=n.jsx("div",{className:"flex items-center gap-0.5",children:E}),e[48]=E,e[49]=ke):ke=e[49];const Xe=a.enableSounds?"Disable sounds":"Enable sounds";let we;e[50]!==c?(we=()=>c(Do),e[50]=c,e[51]=we):we=e[51];const Je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ie;e[52]!==Je?(Ie=J("size-8 rounded-md flex items-center justify-center transition-colors",Je),e[52]=Je,e[53]=Ie):Ie=e[53];let Me;e[54]!==a.enableSounds?(Me=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[54]=a.enableSounds,e[55]=Me):Me=e[55];let $e;e[56]!==Xe||e[57]!==we||e[58]!==Ie||e[59]!==Me?($e=n.jsx("button",{type:"button","aria-label":Xe,onClick:we,className:Ie,children:Me}),e[56]=Xe,e[57]=we,e[58]=Ie,e[59]=Me,e[60]=$e):$e=e[60];let Fe;e[61]===Symbol.for("react.memo_cache_sentinel")?(Fe=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.293.8"]}),e[61]=Fe):Fe=e[61];let Te;e[62]!==$e?(Te=n.jsxs("div",{className:"flex items-center gap-2",children:[$e,Fe]}),e[62]=$e,e[63]=Te):Te=e[63];let Ae;e[64]!==ke||e[65]!==Te?(Ae=n.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[ke,Te]}),e[64]=ke,e[65]=Te,e[66]=Ae):Ae=e[66];let Ue;return e[67]!==re||e[68]!==xe||e[69]!==Ae?(Ue=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[re,xe,Ae]}),e[67]=re,e[68]=xe,e[69]=Ae,e[70]=Ue):Ue=e[70],Ue}const j=s?.name??"U";let I;e[71]!==j||e[72]!==o?(I=n.jsx(pt,{url:o,fallback:j,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=j,e[72]=o,e[73]=I):I=e[73];const g=s?.name??"User";let k;e[74]!==g?(k=n.jsx("p",{className:"text-sm font-medium truncate",children:g}),e[74]=g,e[75]=k):k=e[75];const h=s?.email;let S;e[76]!==h?(S=n.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[76]=h,e[77]=S):S=e[77];let y;e[78]!==k||e[79]!==S?(y=n.jsxs("div",{className:"flex-1 min-w-0",children:[k,S]}),e[78]=k,e[79]=S,e[80]=y):y=e[80];let v;e[81]!==s?(v=()=>{s?.id&&navigator.clipboard.writeText(s.id).then(Eo)},e[81]=s,e[82]=v):v=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(gt,{size:14}),e[83]=_):_=e[83];let M;e[84]!==v?(M=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button",tabIndex:-1,onClick:v,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=v,e[85]=M):M=e[85];let D;e[86]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(st,{side:"right",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=D):D=e[86];let w;e[87]!==M?(w=n.jsx(ht,{delayDuration:300,children:n.jsxs(nt,{children:[M,D]})}),e[87]=M,e[88]=w):w=e[88];let $;e[89]!==w||e[90]!==I||e[91]!==y?($=n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[I,y,w]}),e[89]=w,e[90]=I,e[91]=y,e[92]=$):$=e[92];let O;if(e[93]!==f||e[94]!==r){let G;e[96]!==f?(G=Y=>n.jsx(Be,{item:Y,onClose:f},Y.key),e[96]=f,e[97]=G):G=e[97],O=r.map(G),e[93]=f,e[94]=r,e[95]=O}else O=e[95];let T;e[98]!==f||e[99]!==i?(T=n.jsx(Be,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=T):T=e[100];let A;e[101]!==O||e[102]!==T?(A=n.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[O,T]}),e[101]=O,e[102]=T,e[103]=A):A=e[103];let P;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let G;e[108]!==a.theme||e[109]!==c?(G=Y=>{const{value:ee,icon:Z,label:ne}=Y;return n.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(X=>({...X,theme:ee})),className:J("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ee?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Z},ee)},e[108]=a.theme,e[109]=c,e[110]=G):G=e[110],P=l.map(G),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=P}else P=e[107];let z;e[111]!==P?(z=n.jsx("div",{className:"flex items-center gap-0.5",children:P}),e[111]=P,e[112]=z):z=e[112];const L=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ro),e[113]=c,e[114]=R):R=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let U;e[115]!==B?(U=J("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=U):U=e[116];let F;e[117]!==a.enableSounds?(F=a.enableSounds?n.jsx(mt,{size:14}):n.jsx(ft,{size:14}),e[117]=a.enableSounds,e[118]=F):F=e[118];let H;e[119]!==L||e[120]!==R||e[121]!==U||e[122]!==F?(H=n.jsx("button",{type:"button","aria-label":L,onClick:R,className:U,children:F}),e[119]=L,e[120]=R,e[121]=U,e[122]=F,e[123]=H):H=e[123];let V;e[124]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.293.8"]}),e[124]=V):V=e[124];let q;e[125]!==H?(q=n.jsxs("div",{className:"flex items-center gap-2",children:[H,V]}),e[125]=H,e[126]=q):q=e[126];let Q;e[127]!==z||e[128]!==q?(Q=n.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,q]}),e[127]=z,e[128]=q,e[129]=Q):Q=e[129];let N;e[130]!==$||e[131]!==A||e[132]!==Q?(N=n.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[$,A,Q]}),e[130]=$,e[131]=A,e[132]=Q,e[133]=N):N=e[133];let K;e[134]!==x||e[135]!==m||e[136]!==d||e[137]!==u?(K=n.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:n.jsx(Nt,{sortedOrgs:u,orgParam:d,onSelectOrg:m,onCreateOrg:x})}),e[134]=x,e[135]=m,e[136]=d,e[137]=u,e[138]=K):K=e[138];let W;return e[139]!==N||e[140]!==K?(W=n.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[N,K]}),e[139]=N,e[140]=K,e[141]=W):W=e[141],W}function Ro(t){return{...t,enableSounds:!t.enableSounds}}function Eo(){je.success("User ID copied")}function Do(t){return{...t,enableSounds:!t.enableSounds}}function Lo(){je.success("User ID copied")}function os(){const t=C.c(50),{data:e}=Se.useSession(),{data:s}=Se.useListOrganizations(),o=ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const l=$s(r)?.params.org,[a,c]=Tt(),u=Bt(),[d,m]=b.useState(!1),[x,f]=b.useState(!1),p=e?.user,j=p?.image;let I;if(t[1]!==u||t[2]!==o||t[3]!==d||t[4]!==l||t[5]!==s||t[6]!==a||t[7]!==c||t[8]!==p||t[9]!==j){const h=s?.find(W=>W.slug===l);let S;if(t[11]!==l||t[12]!==s){let W;t[14]!==l?(W=(G,Y)=>G.slug===l?-1:Y.slug===l?1:G.name.localeCompare(Y.name),t[14]=l,t[15]=W):W=t[15],S=[...s??[]].sort(W),t[11]=l,t[12]=s,t[13]=S}else S=t[13];const y=S;let v;t[16]!==o?(v=W=>{m(!1),o({to:"/$org",params:{org:W}})},t[16]=o,t[17]=v):v=t[17];const _=v;let M;t[18]===Symbol.for("react.memo_cache_sentinel")?(M=()=>m(!1),t[18]=M):M=t[18];const D=M;let w;t[19]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(Ye,{size:16}),t[19]=w):w=t[19];let $;t[20]!==o||t[21]!==l?($={key:"preferences",label:"Preferences",icon:w,onClick:()=>{o({to:"/$org/settings/profile",params:{org:l??""}})}},t[20]=o,t[21]=l,t[22]=$):$=t[22];let O;t[23]===Symbol.for("react.memo_cache_sentinel")?(O={key:"terms",label:"Terms of Use",icon:n.jsx(tn,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=O):O=t[23];let T;t[24]===Symbol.for("react.memo_cache_sentinel")?(T={key:"privacy",label:"Privacy Policy",icon:n.jsx(yn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=T):T=t[24];let A;t[25]===Symbol.for("react.memo_cache_sentinel")?(A={key:"github",label:"decocms/studio",icon:n.jsx(Ts,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=A):A=t[25];let P;t[26]===Symbol.for("react.memo_cache_sentinel")?(P={key:"community",label:"Community",icon:n.jsx(Vt,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=P):P=t[26];let z;t[27]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:n.jsx(fn,{size:16}),href:"https://decocms.com",external:!0},t[27]=z):z=t[27];let L;t[28]!==$?(L=[$,O,T,A,P,z],t[28]=$,t[29]=L):L=t[29];const R=L;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:n.jsx(pn,{size:16}),onClick:Uo},t[30]=B):B=t[30];const U=B;let F;t[31]===Symbol.for("react.memo_cache_sentinel")?(F={value:"light",icon:n.jsx(bn,{size:14}),label:"Light theme"},t[31]=F):F=t[31];let H;t[32]===Symbol.for("react.memo_cache_sentinel")?(H={value:"dark",icon:n.jsx(jn,{size:14}),label:"Dark theme"},t[32]=H):H=t[32];let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=[F,H,{value:"system",icon:n.jsx(vn,{size:14}),label:"System theme"}],t[33]=V):V=t[33];const q=V;let Q;t[34]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>{m(!1),f(!0)},t[34]=Q):Q=t[34];let N;t[35]!==_||t[36]!==u||t[37]!==R||t[38]!==l||t[39]!==a||t[40]!==c||t[41]!==y||t[42]!==p||t[43]!==j?(N={user:p,userImage:j,menuItems:R,signOutItem:U,themeOptions:q,preferences:a,setPreferences:c,sortedOrgs:y,orgParam:l,onSelectOrg:_,onCreateOrg:Q,close:D,isMobile:u},t[35]=_,t[36]=u,t[37]=R,t[38]=l,t[39]=a,t[40]=c,t[41]=y,t[42]=p,t[43]=j,t[44]=N):N=t[44];const K=N;I=u?n.jsxs(Ft,{open:d,onOpenChange:m,direction:"bottom",children:[n.jsxs("button",{type:"button",onClick:()=>m(!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:[n.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(h?.name??"?").slice(0,2).toUpperCase()})}),n.jsx("span",{className:"truncate",children:h?.name??"Account"})]}),n.jsxs(Ut,{className:"h-[80dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Account"}),n.jsx(kt,{...K})]})]}):n.jsxs(lt,{open:d,onOpenChange:m,children:[n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:h?.name??"Account",className:"rounded-md",children:n.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:h?.logo?void 0:rt(h?.name??""),children:h?.logo?n.jsx("img",{src:h.logo,alt:"",className:"size-full object-cover"}):n.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(h?.name??"?").slice(0,2).toUpperCase()})})})}),n.jsx(ct,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Fo,children:n.jsx(kt,{...K})})]}),t[1]=u,t[2]=o,t[3]=d,t[4]=l,t[5]=s,t[6]=a,t[7]=c,t[8]=p,t[9]=j,t[10]=I}else I=t[10];let g;t[45]!==x?(g=n.jsx(Ao,{open:x,onOpenChange:f}),t[45]=x,t[46]=g):g=t[46];let k;return t[47]!==I||t[48]!==g?(k=n.jsxs(n.Fragment,{children:[I,g]}),t[47]=I,t[48]=g,t[49]=k):k=t[49],k}function Fo(t){return t.preventDefault()}function Uo(){se("signed_out",{source:"account_popover"}),Se.signOut()}function Go({invitation:t}){const[e,s]=b.useState(!1),[o,r]=b.useState(!1),i=Re(),l=async()=>{s(!0);try{const c=await Se.organization.acceptInvitation({invitationId:t.id});if(c.error)je.error(c.error.message),s(!1);else{const u=await Se.organization.setActive({organizationId:t.organizationId});je.success("Invitation accepted!");const d=u?.data?.slug;window.location.href=d?`/${d}`:"/"}}catch{je.error("Failed to accept invitation"),s(!1)}},a=async()=>{r(!0);try{const c=await Se.organization.rejectInvitation({invitationId:t.id});c.error?(je.error(c.error.message),r(!1)):(je.success("Invitation declined"),i.invalidateQueries())}catch{je.error("Failed to decline invitation"),r(!1)}};return n.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),n.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),n.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||o,"aria-label":"Accept invitation",children:n.jsx(Ht,{size:14})}),n.jsx(et,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||o,"aria-label":"Decline invitation",children:n.jsx(Dn,{size:14})})]})]})}function Bo(){const t=b.useContext(As),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date)}class Ho extends b.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){}render(){return this.state.hasError?null:this.props.children}}function Vo(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Ko(){const t=C.c(19),e=ve(),{org:s}=pe();let o;t[0]!==s.id?(o={connectionId:Kt,orgId:s.id},t[0]=s.id,t[1]=o):o=t[1];const r=Wt(o);let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[2]=i):i=t[2];let l;t[3]!==r?(l={client:r,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:Wo},t[3]=r,t[4]=l):l=t[4];const{data:a,isPending:c,isError:u}=Un(l),d=a?.balanceCents!=null?a.balanceCents/100:null;let m;t[5]!==d||t[6]!==u||t[7]!==c?(m=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[5]=d,t[6]=u,t[7]=c,t[8]=m):m=t[8];const x=m;let f;t[9]!==d?(f=J(d!=null&&Vo(d)),t[9]=d,t[10]=f):f=t[10];let p;t[11]!==e||t[12]!==s.slug?(p=()=>e({to:"/$org/settings/ai-providers",params:{org:s.slug}}),t[11]=e,t[12]=s.slug,t[13]=p):p=t[13];let j;t[14]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(sn,{size:24}),t[14]=j):j=t[14];let I;return t[15]!==f||t[16]!==p||t[17]!==x?(I=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:x,className:f,onClick:p,children:j})})}),t[15]=f,t[16]=p,t[17]=x,t[18]=I):I=t[18],I}function Wo(t){return t.structuredContent}function qo(){const t=C.c(1);if(!Gn().some(Qo))return null;let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Ko,{}),t[0]=o):o=t[0],o}function Qo(t){return t.providerId==="deco"}function Yo(){const t=C.c(3),[e,s]=b.useState(!1);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Connections",onClick:()=>{se("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),s(!0)},children:n.jsx(hn,{size:24})})})}),t[0]=o):o=t[0];let r;return t[1]!==e?(r=n.jsxs(n.Fragment,{children:[o,n.jsx(Bn,{mode:"browse",open:e,onOpenChange:s,defaultTab:"all"})]}),t[1]=e,t[2]=r):r=t[2],r}function Xo(){const t=C.c(11),e=Bo();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(xt,{size:24}),t[0]=s):s=t[0];let o;t[1]!==e.length?(o=e.length>0&&n.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e.length,t[2]=o):o=t[2];let r;t[3]!==o?(r=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsxs(he,{tooltip:"Inbox",className:"relative",children:[s,o]})})})}),t[3]=o,t[4]=r):r=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:n.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[5]=i):i=t[5];let l;t[6]!==e?(l=n.jsxs(ct,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:[i,e.length===0?n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[n.jsx(xt,{size:24,className:"text-muted-foreground/50"}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"No invites pending"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Organization invitations will appear here"})]}):n.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Jo)})]}),t[6]=e,t[7]=l):l=t[7];let a;return t[8]!==r||t[9]!==l?(a=n.jsxs(lt,{children:[r,l]}),t[8]=r,t[9]=l,t[10]=a):a=t[10],a}function Jo(t){return n.jsx(Go,{invitation:t},t.id)}function Zo(){const t=C.c(6),e=ve(),{org:s}=pe();let o;t[0]!==e||t[1]!==s.slug?(o=()=>e({to:"/$org/settings",params:{org:s.slug}}),t[0]=e,t[1]=s.slug,t[2]=o):o=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ye,{size:24}),t[3]=r):r=t[3];let i;return t[4]!==o?(i=n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:o,children:r})})}),t[4]=o,t[5]=i):i=t[5],i}function er(){const t=C.c(5);let e,s,o,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Ho,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(qo,{})})}),s=n.jsx(Yo,{}),o=n.jsx(Xo,{}),r=n.jsx(Zo,{}),t[0]=e,t[1]=s,t[2]=o,t[3]=r):(e=t[0],s=t[1],o=t[2],r=t[3]);let i;return t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs(Et,{className:"px-2 pb-3 gap-1",children:[e,s,o,r,n.jsx(ge,{children:n.jsx(ie,{children:n.jsx(os,{})})})]}),t[4]=i):i=t[4],i}function tr(){const t=C.c(10),e=ve(),{org:s}=pe(),{setOpenMobile:o}=Qe();let r;t[0]!==e||t[1]!==s.slug||t[2]!==o?(r=()=>{e({to:"/$org/settings",params:{org:s.slug}}),o(!1)},t[0]=e,t[1]=s.slug,t[2]=o,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ye,{}),t[4]=i):i=t[4];let l;t[5]!==r?(l=n.jsx(ie,{children:n.jsx(he,{tooltip:"Settings",onClick:r,children:i})}),t[5]=r,t[6]=l):l=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ie,{children:n.jsx(os,{})}),t[7]=a):a=t[7];let c;return t[8]!==l?(c=n.jsx(Et,{children:n.jsxs(ge,{children:[l,a]})}),t[8]=l,t[9]=c):c=t[9],c}var dt="ContextMenu",[sr]=Us(dt,[At]),te=At(),[nr,rs]=sr(dt),is=t=>{const{__scopeContextMenu:e,children:s,onOpenChange:o,dir:r,modal:i=!0}=t,[l,a]=b.useState(!1),c=te(e),u=Ps(o),d=b.useCallback(m=>{a(m),u(m)},[u]);return n.jsx(nr,{scope:e,open:l,onOpenChange:d,modal:i,children:n.jsx(Os,{...c,dir:r,open:l,onOpenChange:d,modal:i,children:s})})};is.displayName=dt;var ls="ContextMenuTrigger",as=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,disabled:o=!1,...r}=t,i=rs(ls,s),l=te(s),a=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=b.useRef(0),d=b.useCallback(()=>window.clearTimeout(u.current),[]),m=x=>{a.current={x:x.clientX,y:x.clientY},i.onOpenChange(!0)};return b.useEffect(()=>d,[d]),b.useEffect(()=>{o&&d()},[o,d]),n.jsxs(n.Fragment,{children:[n.jsx(zs,{...l,virtualRef:c}),n.jsx(Rs.span,{"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:o?t.onContextMenu:Oe(t.onContextMenu,x=>{d(),m(x),x.preventDefault()}),onPointerDown:o?t.onPointerDown:Oe(t.onPointerDown,He(x=>{d(),u.current=window.setTimeout(()=>m(x),700)})),onPointerMove:o?t.onPointerMove:Oe(t.onPointerMove,He(d)),onPointerCancel:o?t.onPointerCancel:Oe(t.onPointerCancel,He(d)),onPointerUp:o?t.onPointerUp:Oe(t.onPointerUp,He(d))})]})});as.displayName=ls;var or="ContextMenuPortal",cs=t=>{const{__scopeContextMenu:e,...s}=t,o=te(e);return n.jsx(Es,{...o,...s})};cs.displayName=or;var ds="ContextMenuContent",us=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=rs(ds,s),i=te(s),l=b.useRef(!1);return n.jsx(Ds,{...i,...o,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&l.current&&a.preventDefault(),l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!r.modal&&(l.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});us.displayName=ds;var rr="ContextMenuGroup",ir=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Gs,{...r,...o,ref:e})});ir.displayName=rr;var lr="ContextMenuLabel",ar=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Bs,{...r,...o,ref:e})});ar.displayName=lr;var cr="ContextMenuItem",ms=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ls,{...r,...o,ref:e})});ms.displayName=cr;var dr="ContextMenuCheckboxItem",ur=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Hs,{...r,...o,ref:e})});ur.displayName=dr;var mr="ContextMenuRadioGroup",fr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Vs,{...r,...o,ref:e})});fr.displayName=mr;var xr="ContextMenuRadioItem",pr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ks,{...r,...o,ref:e})});pr.displayName=xr;var hr="ContextMenuItemIndicator",gr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ws,{...r,...o,ref:e})});gr.displayName=hr;var br="ContextMenuSeparator",fs=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Fs,{...r,...o,ref:e})});fs.displayName=br;var jr="ContextMenuArrow",vr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(qs,{...r,...o,ref:e})});vr.displayName=jr;var yr="ContextMenuSubTrigger",_r=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Qs,{...r,...o,ref:e})});_r.displayName=yr;var Sr="ContextMenuSubContent",Cr=b.forwardRef((t,e)=>{const{__scopeContextMenu:s,...o}=t,r=te(s);return n.jsx(Ys,{...r,...o,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Cr.displayName=Sr;function He(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Nr=is,kr=as,wr=cs,Ir=us,Mr=ms,$r=fs;function Tr(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(Nr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=o):o=e[3],o}function Ar(t){const e=C.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=n.jsx(kr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=o):o=e[3],o}function Pr(t){const e=C.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let r;e[3]!==s?(r=J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx(wr,{children:n.jsx(Ir,{"data-slot":"context-menu-content",className:r,...o})}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function wt(t){const e=C.c(12);let s,o,r,i;e[0]!==t?({className:s,inset:o,variant:i,...r}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=r,e[4]=i):(s=e[1],o=e[2],r=e[3],i=e[4]);const l=i===void 0?"default":i;let a;e[5]!==s?(a=J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=a):a=e[6];let c;return e[7]!==o||e[8]!==r||e[9]!==a||e[10]!==l?(c=n.jsx(Mr,{"data-slot":"context-menu-item","data-inset":o,"data-variant":l,className:a,...r}),e[7]=o,e[8]=r,e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function Or(t){const e=C.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let r;e[3]!==s?(r=J("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=n.jsx($r,{"data-slot":"context-menu-separator",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function zr(t){const e=ve(),s=Re(),o=Xt(),{locator:r}=pe(),i=We({strict:!1}),l=qe({strict:!1});return async a=>{const c=crypto.randomUUID(),u=a===l.virtualmcpid?Lt(s,r,i.taskId??""):null;try{await o.create.mutateAsync({id:c,virtual_mcp_id:a,...u?{branch:u}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:c},search:{virtualmcpid:a}})}}function Rr({agent:t,org:e,onUnpin:s,isDragging:o}){const r=ve(),{isMobile:i,setOpenMobile:l}=Qe(),a=Hn(e),u=It({select:h=>h.location.pathname}).startsWith(`/${e}/${t.id}`),[d,m]=b.useState(null),x=b.useRef(null),f=b.useRef(null),p=b.useRef(!1);p.current=!!o,o&&(d||f.current)&&(f.current&&(clearTimeout(f.current),f.current=null),d&&m(null));const j=h=>{if(p.current)return;const S=h.currentTarget.getBoundingClientRect();f.current=setTimeout(()=>{p.current||m(S)},550)},I=h=>{f.current&&(clearTimeout(f.current),f.current=null),!(x.current&&h.relatedTarget instanceof Node&&x.current.contains(h.relatedTarget))&&m(null)},g=d?Math.round(d.height*.9):0,k=d?d.width+g:0;return n.jsx(Tr,{children:n.jsxs(ie,{className:J(d&&"z-[55]"),children:[n.jsx(Ar,{asChild:!0,children:n.jsx(he,{tooltip:d?void 0:t.title,isActive:u,onClick:async()=>{i&&l(!1);const{resumed:h}=await a(t.id);se("sidebar_agent_pin_clicked",{agent_id:t.id,agent_title:t.title,resumed:h})},onMouseEnter:j,onMouseLeave:I,children:n.jsx(Pe,{icon:t.icon,name:t.title,size:"xs",className:"w-full h-full [&_svg]:w-1/2 [&_svg]:h-1/2"})})}),n.jsxs(Pr,{children:[n.jsxs(wt,{onClick:()=>{const h=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:e,taskId:h},search:{virtualmcpid:t.id}})},children:[n.jsx(Ye,{size:14}),"Settings"]}),n.jsx(Or,{}),n.jsxs(wt,{onClick:()=>{s(),u&&r({to:"/$org",params:{org:e}})},className:"",children:[n.jsx(jt,{size:14}),"Unpin"]})]}),d&&Ee.createPortal(n.jsx("button",{ref:x,type:"button",onMouseLeave:()=>m(null),onClick:h=>{h.stopPropagation(),m(null),s(),r({to:"/$org",params:{org:e}})},className:J("flex items-center justify-center","bg-sidebar-accent text-muted-foreground","rounded-xl cursor-pointer","animate-in fade-in-0 slide-in-from-right-2","duration-150 [animation-timing-function:cubic-bezier(0.165,0.84,0.44,1)]","hover:text-foreground transition-colors"),style:{position:"fixed",top:d.top,left:d.left,height:d.height,width:k,paddingLeft:d.width,zIndex:50,boxShadow:"inset 0 0 0.5px 1px hsla(0, 0%, 100%, 0.075), 0 0 0 0.5px hsla(0, 0%, 0%, 0.12)"},children:n.jsx(jt,{size:14})}),document.body)]})})}function Er(t){const e=C.c(18);let s;e[0]!==t.agent.id?(s={id:t.agent.id},e[0]=t.agent.id,e[1]=s):s=e[1];const{attributes:o,listeners:r,setNodeRef:i,transform:l,transition:a,isDragging:c}=oo(s);let u;e[2]!==l?(u=ro.Transform.toString(l?{...l,x:0}:null),e[2]=l,e[3]=u):u=e[3];const d=c?.5:void 0,m=c?100:void 0;let x;e[4]!==u||e[5]!==d||e[6]!==m||e[7]!==a?(x={transform:u,transition:a,opacity:d,zIndex:m},e[4]=u,e[5]=d,e[6]=m,e[7]=a,e[8]=x):x=e[8];const f=x;let p;e[9]!==c||e[10]!==t?(p=n.jsx(Rr,{...t,isDragging:c}),e[9]=c,e[10]=t,e[11]=p):p=e[11];let j;return e[12]!==o||e[13]!==r||e[14]!==i||e[15]!==f||e[16]!==p?(j=n.jsx("div",{ref:i,style:f,...o,...r,tabIndex:-1,className:"w-full",children:p}),e[12]=o,e[13]=r,e[14]=i,e[15]=f,e[16]=p,e[17]=j):j=e[17],j}function Dr(t){const e=C.c(9),{agent:s,onClick:o}=t;let r;e[0]!==s.icon||e[1]!==s.title?(r=n.jsx(Pe,{icon:s.icon,name:s.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=s.icon,e[1]=s.title,e[2]=r):r=e[2];let i;e[3]!==s.title?(i=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:s.title}),e[3]=s.title,e[4]=i):i=e[4];let l;return e[5]!==o||e[6]!==r||e[7]!==i?(l=n.jsxs("button",{type:"button",onClick:o,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[r,i]}),e[5]=o,e[6]=r,e[7]=i,e[8]=l):l=e[8],l}function Lr(t){const e=C.c(80),{onClose:s,onOpenImportDeco:o,onOpenGithubImport:r,onOpenSelfHealing:i,onOpenDiagnosticsModal:l,onOpenLeanCanvasModal:a,onOpenStudioPackModal:c,onOpenAiImageModal:u,onOpenAiResearchModal:d}=t,[m,x]=b.useState(""),f=qt(),{org:p}=pe();let j;e[0]!==f?(j=f.filter(Wr).map(Kr),e[0]=f,e[1]=j):j=e[1];const I=j,{pin:g,isPinned:k}=Yt(p.id,I);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:S,isCreating:y}=ao(h),[v]=Tt(),_=zr(p.slug),M=lo();let D,w,$,O,T,A,P,z;if(e[3]!==f||e[4]!==S||e[5]!==y||e[6]!==k||e[7]!==M||e[8]!==_||e[9]!==s||e[10]!==u||e[11]!==d||e[12]!==l||e[13]!==r||e[14]!==o||e[15]!==a||e[16]!==i||e[17]!==c||e[18]!==g||e[19]!==v.experimental_vibecode||e[20]!==m){const V=m.toLowerCase();z=f.filter(Vr).filter(E=>!m||E.title.toLowerCase().includes(V));let q;e[29]!==f?(q=f.some(Hr),e[29]=f,e[30]=q):q=e[30];const Q=q;D=ze.filter(E=>(!m||E.title.toLowerCase().includes(V))&&!(E.id==="studio-pack"&&Q)&&!(E.id==="self-healing-storefront"&&!v.experimental_vibecode));let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=ze.find(Br),e[31]=N):N=e[31];const K=N,W=K?f.find(E=>E.metadata?.type===K.id):void 0;let G;e[32]===Symbol.for("react.memo_cache_sentinel")?(G=ze.find(Gr),e[32]=G):G=e[32];const Y=G,ee=Y?f.find(E=>E.metadata?.type===Y.id):void 0;let Z;e[33]===Symbol.for("react.memo_cache_sentinel")?(Z=ze.find(Ur),e[33]=Z):Z=e[33];const ne=Z,X=ne?f.find(E=>E.metadata?.type===ne.id):void 0;let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe=ze.find(Fr),e[34]=oe):oe=e[34];const ae=oe,Ne=ae?f.find(E=>E.metadata?.type===ae.id):void 0;let ce;e[35]!==k||e[36]!==_||e[37]!==s||e[38]!==g?(ce=E=>{k(E.id)||g(E.id),s(),x(""),_(E.id)},e[35]=k,e[36]=_,e[37]=s,e[38]=g,e[39]=ce):ce=e[39];const ye=ce,_e=E=>{s(),x(""),E==="self-healing-storefront"?i():E==="site-editor"?o():E==="site-diagnostics"?W?M(W.id):l():E==="lean-canvas"?ee?M(ee.id):a():E==="ai-image"?X?M(X.id):u():E==="ai-research"?Ne?M(Ne.id):d():E==="studio-pack"?c():_(E)};A="flex flex-col max-h-[min(640px,80dvh)]",e[40]!==m?(P=n.jsx(io,{value:m,onChange:x,placeholder:"Search agents..."}),e[40]=m,e[41]=P):P=e[41],w="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[42]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx("div",{className:"px-1 pt-3 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[42]=$):$=e[42];let re;e[43]!==S||e[44]!==s?(re=async()=>{se("agent_create_new_clicked",{source:"browse_popover"}),await S(),s()},e[43]=S,e[44]=s,e[45]=re):re=e[45];let de,ue;e[46]===Symbol.for("react.memo_cache_sentinel")?(de=n.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:n.jsx(Ke,{size:16,className:"text-muted-foreground"})}),ue=n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[46]=de,e[47]=ue):(de=e[46],ue=e[47]);let me;e[48]!==y||e[49]!==re?(me=n.jsxs("button",{type:"button",disabled:y,onClick:re,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[de,ue]}),e[48]=y,e[49]=re,e[50]=me):me=e[50];let fe;e[51]!==s||e[52]!==r||e[53]!==v.experimental_vibecode?(fe=v.experimental_vibecode&&n.jsxs("button",{type:"button",onClick:()=>{se("agent_import_clicked",{source:"github"}),r(),s()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:n.jsx(po,{className:"size-5 text-muted-foreground"})}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[51]=s,e[52]=r,e[53]=v.experimental_vibecode,e[54]=fe):fe=e[54];let xe;e[55]!==ye?(xe=E=>n.jsx(Dr,{agent:E,onClick:()=>ye(E)},E.id),e[55]=ye,e[56]=xe):xe=e[56],O=n.jsxs("div",{className:"grid grid-cols-3 gap-1",children:[me,fe,z.map(xe)]}),T=D.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-1 pt-4 pb-2",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agent templates"})}),n.jsx("div",{className:"grid grid-cols-3 gap-1",children:D.map(E=>n.jsxs("button",{type:"button",onClick:()=>{se("agent_template_clicked",{template_id:E.id,template_title:E.title}),_e(E.id)},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[n.jsx(Pe,{icon:E.icon,name:E.title,size:"md",className:"transition-transform group-hover:scale-105"}),n.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:E.title})]},E.id))})]}),e[3]=f,e[4]=S,e[5]=y,e[6]=k,e[7]=M,e[8]=_,e[9]=s,e[10]=u,e[11]=d,e[12]=l,e[13]=r,e[14]=o,e[15]=a,e[16]=i,e[17]=c,e[18]=g,e[19]=v.experimental_vibecode,e[20]=m,e[21]=D,e[22]=w,e[23]=$,e[24]=O,e[25]=T,e[26]=A,e[27]=P,e[28]=z}else D=e[21],w=e[22],$=e[23],O=e[24],T=e[25],A=e[26],P=e[27],z=e[28];let L;e[57]!==D||e[58]!==y||e[59]!==m||e[60]!==z.length?(L=z.length===0&&D.length===0&&!y&&n.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:m?"No agents found":"No agents yet"}),e[57]=D,e[58]=y,e[59]=m,e[60]=z.length,e[61]=L):L=e[61];let R;e[62]!==w||e[63]!==$||e[64]!==O||e[65]!==T||e[66]!==L?(R=n.jsxs("div",{className:w,children:[$,O,T,L]}),e[62]=w,e[63]=$,e[64]=O,e[65]=T,e[66]=L,e[67]=R):R=e[67];let B;e[68]!==p.slug?(B={org:p.slug},e[68]=p.slug,e[69]=B):B=e[69];let U;e[70]!==s?(U=()=>s(),e[70]=s,e[71]=U):U=e[71];let F;e[72]!==B||e[73]!==U?(F=n.jsx("div",{className:"border-t border-border px-3 py-2.5",children:n.jsx(Xs,{to:"/$org/settings/agents",params:B,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[72]=B,e[73]=U,e[74]=F):F=e[74];let H;return e[75]!==R||e[76]!==F||e[77]!==A||e[78]!==P?(H=n.jsxs("div",{className:A,children:[P,R,F]}),e[75]=R,e[76]=F,e[77]=A,e[78]=P,e[79]=H):H=e[79],H}function Fr(t){return t.id==="ai-research"}function Ur(t){return t.id==="ai-image"}function Gr(t){return t.id==="lean-canvas"}function Br(t){return t.id==="site-diagnostics"}function Hr(t){return Fn(t.id)}function Vr(t){return!Ln(t.id)}function Kr(t){return t.id}function Wr(t){return t.pinned}function qr(){const t=C.c(36),[e,s]=b.useState(!1),[o,r]=b.useState(!1),[i,l]=b.useState(!1),[a,c]=b.useState(!1),[u,d]=b.useState(!1),[m,x]=b.useState(!1),[f,p]=b.useState(!1),[j,I]=b.useState(!1),[g,k]=b.useState(!1),h=Bt(),{setOpenMobile:S}=Qe();let y;t[0]!==h||t[1]!==S?(y=()=>{s(!1),h&&S(!1)},t[0]=h,t[1]=S,t[2]=y):y=t[2];const v=y;let _;t[3]!==v||t[4]!==e?(_=e&&n.jsx(b.Suspense,{fallback:n.jsx("div",{className:"flex items-center justify-center py-8",children:n.jsx(Ve,{className:"h-4 w-24"})}),children:n.jsx(Lr,{onClose:v,onOpenImportDeco:()=>r(!0),onOpenGithubImport:()=>{l(!0),v()},onOpenSelfHealing:()=>{c(!0),v()},onOpenDiagnosticsModal:()=>d(!0),onOpenLeanCanvasModal:()=>x(!0),onOpenStudioPackModal:()=>p(!0),onOpenAiImageModal:()=>I(!0),onOpenAiResearchModal:()=>k(!0)})}),t[3]=v,t[4]=e,t[5]=_):_=t[5];const M=_;let D;t[6]!==h||t[7]!==e||t[8]!==M?(D=h?n.jsxs(n.Fragment,{children:[n.jsx(ie,{children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",onClick:()=>{se("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},children:n.jsx(Ke,{className:"!opacity-100"})})}),n.jsx(Ft,{open:e,onOpenChange:s,direction:"bottom",children:n.jsxs(Ut,{className:"max-h-[85dvh] p-0",children:[n.jsx(Gt,{className:"sr-only",children:"Browse agents"}),M]})})]}):n.jsxs(lt,{open:e,onOpenChange:B=>{B&&!e&&se("agent_browser_opened",{surface:"desktop_popover"}),s(B)},children:[n.jsx(ie,{children:n.jsx(at,{asChild:!0,children:n.jsx(he,{tooltip:"Browse agents",className:"bg-muted/75 hover:bg-sidebar-accent",children:n.jsx(Ke,{className:"!opacity-100"})})})}),n.jsx(ct,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:M})]}),t[6]=h,t[7]=e,t[8]=M,t[9]=D):D=t[9];let w;t[10]!==o?(w=n.jsx(co,{open:o,onOpenChange:r}),t[10]=o,t[11]=w):w=t[11];let $;t[12]!==i?($=n.jsx(uo,{open:i,onOpenChange:l}),t[12]=i,t[13]=$):$=t[13];let O;t[14]!==a?(O=n.jsx(Vn,{open:a,onOpenChange:c}),t[14]=a,t[15]=O):O=t[15];let T;t[16]!==u?(T=n.jsx(mo,{open:u,onOpenChange:d}),t[16]=u,t[17]=T):T=t[17];let A;t[18]!==m?(A=n.jsx(fo,{open:m,onOpenChange:x}),t[18]=m,t[19]=A):A=t[19];let P;t[20]!==f?(P=n.jsx(xo,{open:f,onOpenChange:p}),t[20]=f,t[21]=P):P=t[21];let z;t[22]!==j?(z=n.jsx(Kn,{open:j,onOpenChange:I}),t[22]=j,t[23]=z):z=t[23];let L;t[24]!==g?(L=n.jsx(Wn,{open:g,onOpenChange:k}),t[24]=g,t[25]=L):L=t[25];let R;return t[26]!==L||t[27]!==D||t[28]!==w||t[29]!==$||t[30]!==O||t[31]!==T||t[32]!==A||t[33]!==P||t[34]!==z?(R=n.jsxs(n.Fragment,{children:[D,w,$,O,T,A,P,z,L]}),t[26]=L,t[27]=D,t[28]=w,t[29]=$,t[30]=O,t[31]=T,t[32]=A,t[33]=P,t[34]=z,t[35]=R):R=t[35],R}function Qr(){const t=C.c(34),e=qt(),{org:s}=pe();let o;t[0]!==e?(o=e.filter(Zr).map(Jr),t[0]=e,t[1]=o):o=t[1];const r=o,{pinnedIds:i,unpin:l,reorder:a}=Yt(s.id,r),c=new Map(e.map(Xr)),u=i.map(R=>c.get(R)).filter(Yr);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:5}},t[2]=d):d=t[2];let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m={coordinateGetter:so},t[3]=m):m=t[3];const x=Qn(bt(Xn,d),bt(Yn,m));let f;t[4]!==i||t[5]!==a?(f=R=>{const{active:B,over:U}=R;if(!U||B.id===U.id)return;const F=i.indexOf(B.id),H=i.indexOf(U.id);F===-1||H===-1||a(no([...i],F,H))},t[4]=i,t[5]=a,t[6]=f):f=t[6];const p=f,j=De,I="py-0 px-0 mt-2 flex-1 min-h-0";let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("div",{className:"h-px bg-border mx-2 mb-2"}),t[7]=g):g=t[7];const k=Le,h="flex flex-1 min-h-0 flex-col overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",S=ge,y="gap-2";let v;t[8]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(qr,{}),t[8]=v):v=t[8];const _=eo,M=to,D=Jn,w=Zn;let $;t[9]!==s.slug||t[10]!==l?($=R=>n.jsx(Er,{agent:R,org:s.slug,onUnpin:()=>l(R.id)},R.id),t[9]=s.slug,t[10]=l,t[11]=$):$=t[11];const O=u.map($);let T;t[12]!==D||t[13]!==i||t[14]!==w||t[15]!==O?(T=n.jsx(D,{items:i,strategy:w,children:O}),t[12]=D,t[13]=i,t[14]=w,t[15]=O,t[16]=T):T=t[16];let A;t[17]!==_||t[18]!==p||t[19]!==x||t[20]!==T||t[21]!==M?(A=n.jsx(_,{sensors:x,collisionDetection:M,onDragEnd:p,children:T}),t[17]=_,t[18]=p,t[19]=x,t[20]=T,t[21]=M,t[22]=A):A=t[22];let P;t[23]!==S||t[24]!==A||t[25]!==v?(P=n.jsxs(S,{className:y,children:[v,A]}),t[23]=S,t[24]=A,t[25]=v,t[26]=P):P=t[26];let z;t[27]!==k||t[28]!==P?(z=n.jsx(k,{className:h,children:P}),t[27]=k,t[28]=P,t[29]=z):z=t[29];let L;return t[30]!==j||t[31]!==z||t[32]!==g?(L=n.jsxs(j,{className:I,children:[g,z]}),t[30]=j,t[31]=z,t[32]=g,t[33]=L):L=t[33],L}function Yr(t){return!!t}function Xr(t){return[t.id,t]}function Jr(t){return t.id}function Zr(t){return t.pinned}function xs(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(b.Suspense,{fallback:n.jsx(De,{className:"py-0 px-0",children:n.jsx(Le,{children:n.jsx(ge,{className:"gap-2",children:n.jsx(ie,{children:n.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[n.jsx(Ve,{className:"h-4 w-4 rounded"}),n.jsx(Ve,{className:"h-4 flex-1"})]})})})})}),children:n.jsx(Qr,{})}),t[0]=e):e=t[0],e}function yl(){const t=C.c(4),e=Zt();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(er,{}),t[0]=s):s=t[0];let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),t[1]=o):o=t[1];let r;return t[2]!==e?(r=n.jsx(ss,{sections:e,footer:s,additionalContent:o}),t[2]=e,t[3]=r):r=t[3],r}function _l(t){const e=C.c(5),{onClose:s}=t,o=Zt();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(tr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(it,{children:n.jsx(b.Suspense,{fallback:null,children:n.jsx(xs,{})})}),e[1]=i):i=e[1];let l;return e[2]!==s||e[3]!==o?(l=n.jsx($o,{sections:o,onClose:s,footer:r,additionalContent:i}),e[2]=s,e[3]=o,e[4]=l):l=e[4],l}function ei(t,e){return t===1?!0:t===0?!1:e}function ti(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",o=t.mainParamPresent?t.mainParamValue!=="0":!s,r=s?!0:t.entityMetadata?.chatDefaultOpen??!1;return{mainOpen:o,chatOpen:r}}function Sl(t,e){return t&&e?{chat:45,main:55}:t&&!e?{chat:100,main:0}:!t&&e?{chat:0,main:100}:{chat:0,main:0}}function si(t,e){return t===1?!0:t===0?!1:e}function Cl(t,e){const s=ve(),o=qe({strict:!1}),r=We({strict:!1}),i=Re(),l=Xt(),{locator:a}=pe(),{virtualMcpId:c,orgSlug:u,isAgentRoute:d}=e,m=ti({entityMetadata:t,mainParamPresent:o.main!==void 0,mainParamValue:o.main}),x=si(o.chat,m.chatOpen),f=m.mainOpen,p=b.useRef(crypto.randomUUID()),j=r.taskId??p.current,I="/$org/$taskId",g=w=>({org:u,taskId:w}),k=d?{virtualmcpid:c}:{},h=(w,$)=>{s({to:I,params:g(j),search:O=>({...O,...w}),replace:$?.replace??!1})},S=(w,$)=>{s({to:I,params:g(w),search:O=>{const T={};return $?T.virtualmcpid=$:d&&(T.virtualmcpid=c),O.tasks&&(T.tasks=O.tasks),T}})},y=()=>{f?h({main:"0"},{replace:!0}):h({main:un(t)},{replace:!0})},v=()=>{h({chat:x?0:1},{replace:!0})},_=()=>{x||h({chat:1},{replace:!0})},M=async()=>{const w=crypto.randomUUID(),$=Lt(i,a,j);try{await l.create.mutateAsync({id:w,virtual_mcp_id:c,...$?{branch:$}:{}})}catch{}s({to:I,params:g(w),search:O=>{const T={...k,chat:1};return O.tasks&&(T.tasks=O.tasks),T}})},D=w=>{h({main:w},{replace:!0})};return{taskId:j,mainOpen:f,chatOpen:x,mainParam:o.main,setTaskId:S,toggleMain:y,toggleChat:v,openChat:_,createNewTask:M,openTab:D}}const ut=b.createContext(null);function Nl(t){const e=C.c(15),{children:s}=t,o=ve();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=qe(r);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={owner:"all",status:"open"},e[1]=l):l=e[1];const{tasks:a}=ot(l);let c;e[2]!==i.tasks||e[3]!==a.length?(c=()=>ei(i.tasks,a.length>0),e[2]=i.tasks,e[3]=a.length,e[4]=c):c=e[4];const[u,d]=b.useState(c);let m,x;e[5]!==o||e[6]!==u?(m=()=>{o({search:(g=>({...g,tasks:u?1:0})),replace:!0})},x=[u,o],e[5]=o,e[6]=u,e[7]=m,e[8]=x):(m=e[7],x=e[8]),b.useEffect(m,x);let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=()=>d(ni),e[9]=f):f=e[9];const p=f;let j;e[10]!==u?(j={tasksOpen:u,toggleTasks:p},e[10]=u,e[11]=j):j=e[11];let I;return e[12]!==s||e[13]!==j?(I=n.jsx(ut.Provider,{value:j,children:s}),e[12]=s,e[13]=j,e[14]=I):I=e[14],I}function ni(t){return!t}function kl(){const t=b.useContext(ut);if(!t)throw new Error("useTasksPanelState must be used inside <TasksPanelStateProvider>");return t}function wl(){return b.useContext(ut)}const ps=b.createContext(null);function Ce(){const t=b.use(ps);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function le(t){const e=C.c(10),{children:s}=t,[o,r]=b.useState(null),[i,l]=b.useState(null),[a,c]=b.useState(null),[u,d]=b.useState(null);let m;e[0]!==a||e[1]!==u||e[2]!==i||e[3]!==o?(m={togglesEl:o,setTogglesEl:r,tabsEl:i,setTabsEl:l,centerEl:a,setCenterEl:c,rightEl:u,setRightEl:d},e[0]=a,e[1]=u,e[2]=i,e[3]=o,e[4]=m):m=e[4];let x;e[5]!==s?(x=n.jsx("div",{className:"flex flex-col h-full min-h-0",children:s}),e[5]=s,e[6]=x):x=e[6];let f;return e[7]!==m||e[8]!==x?(f=n.jsx(ps,{value:m,children:x}),e[7]=m,e[8]=x,e[9]=f):f=e[9],f}function oi(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"shrink-0 grid grid-cols-3 items-center pl-1 pr-2 pt-0.25 h-12",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ri(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=o):o=e[1],o}function ii(t){const e=C.c(2),{children:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=o):o=e[1],o}function li(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("button",{type:"button",onClick:ci,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go back",children:n.jsx(gn,{size:16})}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs(n.Fragment,{children:[e,n.jsx("button",{type:"button",onClick:ai,className:"flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Go forward",children:n.jsx(go,{size:16})})]}),t[1]=s):s=t[1],s}function ai(){return window.history.forward()}function ci(){return window.history.back()}function di(){const t=C.c(2),{setCenterEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function ui(t){const e=C.c(3),{children:s}=t,{centerEl:o}=Ce();if(!o)return null;let r;return e[0]!==o||e[1]!==s?(r=Ee.createPortal(s,o),e[0]=o,e[1]=s,e[2]=r):r=e[2],r}function mi(){const t=C.c(2),{setTabsEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"shrink-0 flex items-center overflow-x-auto"}),t[0]=e,t[1]=s):s=t[1],s}function fi(t){const e=C.c(3),{children:s}=t,{tabsEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function xi(){const t=C.c(2),{setTogglesEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center gap-0.5 shrink-0 ml-0.5"}),t[0]=e,t[1]=s):s=t[1],s}function pi(t){const e=C.c(3),{children:s}=t,{togglesEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}function hi(){const t=C.c(2),{setRightEl:e}=Ce();let s;return t[0]!==e?(s=n.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}function gi(t){const e=C.c(3),{children:s}=t,{rightEl:o}=Ce();if(!o)return null;let r;return e[0]!==s||e[1]!==o?(r=Ee.createPortal(s,o),e[0]=s,e[1]=o,e[2]=r):r=e[2],r}le.Header=oi;le.LeftColumn=ri;le.RightColumn=ii;le.Nav=li;le.CenterSlot=di;le.Center=ui;le.TabsSlot=mi;le.Tabs=fi;le.TogglesSlot=xi;le.Toggles=pi;le.RightSlot=hi;le.Right=gi;function bi(){const t=C.c(6),{org:e,locator:s}=pe(),o=Re();let r;t[0]!==s||t[1]!==o?(r=()=>{o.invalidateQueries({queryKey:Pt.tasksPrefix(s)})},t[0]=s,t[1]=o,t[2]=r):r=t[2];let i;t[3]!==e.id||t[4]!==r?(i={orgId:e.id,onTaskStatus:r},t[3]=e.id,t[4]=r,t[5]=i):i=t[5],jo(i)}function ji(t){const e=C.c(8),{virtualMcpId:s,size:o,showAutomationBadge:r}=t,i=o===void 0?"sm":o;let l;e[0]!==i||e[1]!==s?(l=s?n.jsx(vi,{virtualMcpId:s,size:i}):n.jsx(Pe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=s,e[2]=l):l=e[2];let a;e[3]!==r?(a=r&&n.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:n.jsx(vo,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=n.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function vi(t){const e=C.c(6),{virtualMcpId:s,size:o}=t,r=Qt(s);if(!r){let a;return e[0]!==o?(a=n.jsx(Pe,{icon:null,name:"?",size:o}),e[0]=o,e[1]=a):a=e[1],a}const i=r.icon??null;let l;return e[2]!==r.title||e[3]!==o||e[4]!==i?(l=n.jsx(Pe,{icon:i,name:r.title,size:o}),e[2]=r.title,e[3]=o,e[4]=i,e[5]=l):l=e[5],l}function yi(t){const e=t?.metadata?.githubRepo;return e?.connectionId&&t?.connections?.some(o=>o.connection_id===e.connectionId)?e:null}function _i(t){const e=C.c(47),{task:s,isActive:o,onClick:r,onArchive:i,showAutomationBadge:l}=t,a=yo(s.status),c=a.icon,u=Qt(s.virtual_mcp_id);let d;e[0]!==u?(d=yi(u),e[0]=u,e[1]=d):d=e[1];const m=d,x=b.useRef(null);let f;e[2]!==o?(f=()=>{if(!o)return;const V=x.current;V&&(V.focus({preventScroll:!0}),V.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}))},e[2]=o,e[3]=f):f=e[3];let p;e[4]!==o||e[5]!==s.id?(p=[o,s.id],e[4]=o,e[5]=s.id,e[6]=p):p=e[6],b.useEffect(f,p);const j="button",I=0;let g;e[7]!==r?(g=V=>{V.target===V.currentTarget&&(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),r())},e[7]=r,e[8]=g):g=e[8];const k=o?"bg-accent":"hover:bg-accent/60";let h;e[9]!==k?(h=J("group/row flex items-center gap-3 px-2 py-1.5 rounded-md cursor-pointer transition-colors",k),e[9]=k,e[10]=h):h=e[10];let S;e[11]!==l||e[12]!==s.virtual_mcp_id?(S=n.jsx(ji,{virtualMcpId:s.virtual_mcp_id,size:"xs",showAutomationBadge:l}),e[11]=l,e[12]=s.virtual_mcp_id,e[13]=S):S=e[13];const y=s.title||"Untitled task";let v;e[14]!==y?(v=n.jsx("div",{className:"text-sm text-foreground truncate",children:y}),e[14]=y,e[15]=v):v=e[15];let _;e[16]!==m||e[17]!==s.branch||e[18]!==s.updated_at?(_=s.updated_at&&n.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground min-w-0",children:[s.branch?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):m?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[m.owner,"/",m.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:mn(new Date(s.updated_at))})]}),e[16]=m,e[17]=s.branch,e[18]=s.updated_at,e[19]=_):_=e[19];let M;e[20]!==v||e[21]!==_?(M=n.jsxs("div",{className:"flex-1 min-w-0",children:[v,_]}),e[20]=v,e[21]=_,e[22]=M):M=e[22];const D="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",w="[grid-area:slot] flex size-7 items-center justify-center group-hover/row:invisible",$=a.label,O=14,T=J(a.iconClassName,s.status==="in_progress"&&"animate-spin");let A;e[23]!==c||e[24]!==T?(A=n.jsx(c,{size:O,className:T}),e[23]=c,e[24]=T,e[25]=A):A=e[25];let P;e[26]!==a||e[27]!==A?(P=n.jsx("span",{className:w,"aria-label":$,children:A}),e[26]=a,e[27]=A,e[28]=P):P=e[28];let z;e[29]!==i?(z=V=>{V.stopPropagation(),i()},e[29]=i,e[30]=z):z=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(nn,{size:14}),e[31]=L):L=e[31];let R;e[32]!==z?(R=n.jsx(tt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Archive task",onClick:z,className:"[grid-area:slot] invisible group-hover/row:visible flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted",children:L})}),e[32]=z,e[33]=R):R=e[33];let B;e[34]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(st,{side:"right",children:"Archive"}),e[34]=B):B=e[34];let U;e[35]!==R?(U=n.jsxs(nt,{children:[R,B]}),e[35]=R,e[36]=U):U=e[36];let F;e[37]!==P||e[38]!==U?(F=n.jsxs("div",{className:D,children:[P,U]}),e[37]=P,e[38]=U,e[39]=F):F=e[39];let H;return e[40]!==r||e[41]!==M||e[42]!==F||e[43]!==g||e[44]!==h||e[45]!==S?(H=n.jsxs("div",{ref:x,role:j,tabIndex:I,onClick:r,onKeyDown:g,className:h,children:[S,M,F]}),e[40]=r,e[41]=M,e[42]=F,e[43]=g,e[44]=h,e[45]=S,e[46]=H):H=e[46],H}const hs={all:"All tasks",manual:"Chats",automation:"Automation"},gs={all:"All members",mine:"Mine only"};function Si(t){const e=C.c(59),{title:s,tasks:o,activeTaskId:r,onSelect:i,onArchive:l,onNew:a,showNewButton:c,showAutomationBadge:u,emptyLabel:d,currentUserId:m}=t,[x,f]=b.useState("all"),[p,j]=b.useState("mine");let I;e[0]!==m||e[1]!==p||e[2]!==o?(I=p==="mine"&&m?o.filter(N=>N.created_by===m):o,e[0]=m,e[1]=p,e[2]=o,e[3]=I):I=e[3];const g=I;let k;e[4]!==x||e[5]!==g?(k=x==="automation"?g.filter(wi):x==="manual"?g.filter(ki):g,e[4]=x,e[5]=g,e[6]=k):k=e[6];const h=k;let S;e[7]!==s?(S=n.jsx("span",{children:s}),e[7]=s,e[8]=S):S=e[8];let y;e[9]!==p?(y=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter by member",className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:p==="mine"?n.jsx(rn,{size:16}):n.jsx(Vt,{size:16})})}),e[9]=p,e[10]=y):y=e[10];let v;e[11]!==p?(v=N=>{const K=N;K!==p&&se("tasks_panel_member_filter_changed",{to_value:K}),j(K)},e[11]=p,e[12]=v):v=e[12];let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=Object.keys(gs),e[13]=_):_=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=_.map(Ni),e[14]=M):M=e[14];let D;e[15]!==p||e[16]!==v?(D=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:p,onValueChange:v,children:M})}),e[15]=p,e[16]=v,e[17]=D):D=e[17];let w;e[18]!==y||e[19]!==D?(w=n.jsxs(St,{children:[y,D]}),e[18]=y,e[19]=D,e[20]=w):w=e[20];const $=x!=="all"&&"text-purple-500";let O;e[21]!==$?(O=J("flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",$),e[21]=$,e[22]=O):O=e[22];let T;e[23]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(xn,{size:16}),e[23]=T):T=e[23];let A;e[24]!==O?(A=n.jsx(vt,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":"Filter tasks",className:O,children:T})}),e[24]=O,e[25]=A):A=e[25];let P;e[26]!==x?(P=N=>{const K=N;K!==x&&se("tasks_panel_filter_changed",{to_value:K}),f(K)},e[26]=x,e[27]=P):P=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=Object.keys(hs),e[28]=z):z=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=z.map(Ci),e[29]=L):L=e[29];let R;e[30]!==x||e[31]!==P?(R=n.jsx(yt,{align:"end",children:n.jsx(_t,{value:x,onValueChange:P,children:L})}),e[30]=x,e[31]=P,e[32]=R):R=e[32];let B;e[33]!==A||e[34]!==R?(B=n.jsxs(St,{children:[A,R]}),e[33]=A,e[34]=R,e[35]=B):B=e[35];let U;e[36]!==a||e[37]!==c||e[38]!==s?(U=c&&a&&n.jsx("button",{type:"button",onClick:()=>{se("tasks_panel_new_clicked"),a()},"aria-label":`New ${s.toLowerCase()}`,className:"flex size-8 items-center justify-center rounded-md hover:bg-muted hover:text-foreground",children:n.jsx(on,{size:16})}),e[36]=a,e[37]=c,e[38]=s,e[39]=U):U=e[39];let F;e[40]!==B||e[41]!==U||e[42]!==w?(F=n.jsxs("div",{className:"flex items-center gap-0.5",children:[w,B,U]}),e[40]=B,e[41]=U,e[42]=w,e[43]=F):F=e[43];let H;e[44]!==F||e[45]!==S?(H=n.jsxs("div",{className:"shrink-0 pl-2 pr-1.5 h-7 flex items-center justify-between text-xs font-medium text-muted-foreground mb-1",children:[S,F]}),e[44]=F,e[45]=S,e[46]=H):H=e[46];let V;e[47]!==r||e[48]!==d||e[49]!==l||e[50]!==i||e[51]!==u||e[52]!==h?(V=h.length===0&&d?n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/70",children:d}):h.map(N=>n.jsx(_i,{task:N,isActive:r===N.id,onClick:()=>{r!==N.id&&se("tasks_panel_task_clicked",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null,from_automation:!!N.fromAutomation}),i(N)},onArchive:()=>{se("tasks_panel_task_archived",{thread_id:N.id,virtual_mcp_id:N.virtual_mcp_id??null}),l(N)},showAutomationBadge:u||N.fromAutomation},N.id)),e[47]=r,e[48]=d,e[49]=l,e[50]=i,e[51]=u,e[52]=h,e[53]=V):V=e[53];let q;e[54]!==V?(q=n.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-0.5",children:V}),e[54]=V,e[55]=q):q=e[55];let Q;return e[56]!==H||e[57]!==q?(Q=n.jsxs("div",{className:"flex flex-col h-full min-h-0 mt-1",children:[H,q]}),e[56]=H,e[57]=q,e[58]=Q):Q=e[58],Q}function Ci(t){return n.jsx(Jt,{value:t,children:hs[t]},t)}function Ni(t){return n.jsx(Jt,{value:t,children:gs[t]},t)}function ki(t){return!t.fromAutomation}function wi(t){return t.fromAutomation}function Ii(){const t=C.c(22);bi();const{data:e}=Se.useSession(),s=e?.user?.id;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={owner:"me",status:"open",hasTrigger:!1},t[0]=o):o=t[0];const{tasks:r}=ot(o);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={owner:"all",status:"open",hasTrigger:!0},t[1]=i):i=t[1];const{tasks:l}=ot(i),{setTaskId:a,createNewTask:c}=Dt();let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={strict:!1},t[2]=u):u=t[2];const d=We(u),{locator:m,org:x}=pe(),f=Re();let p;t[3]!==x.id?(p={connectionId:Kt,orgId:x.id},t[3]=x.id,t[4]=p):p=t[4];const j=Wt(p),I=d.taskId??null;let g;t[5]!==l||t[6]!==r?(g=[...r,...l.map($i)].sort(Mi),t[5]=l,t[6]=r,t[7]=g):g=t[7];const k=g;let h;t[8]!==j||t[9]!==m||t[10]!==f?(h=async _=>{try{await ho(j,_.id,{hidden:!0}),f.invalidateQueries({queryKey:Pt.tasksPrefix(m)})}catch(M){const w=M;je.error(`Failed to archive task: ${w.message}`)}},t[8]=j,t[9]=m,t[10]=f,t[11]=h):h=t[11];const S=h;if(k.length===0){let _;return t[12]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx("div",{className:"h-full flex items-center justify-center p-4",children:n.jsx(bo,{image:n.jsx(ln,{size:48,className:"text-muted-foreground"}),title:"No tasks yet",description:"Start a conversation to create your first task."})}),t[12]=_):_=t[12],_}let y;t[13]!==a?(y=_=>a(_.id,_.virtual_mcp_id),t[13]=a,t[14]=y):y=t[14];let v;return t[15]!==I||t[16]!==k||t[17]!==c||t[18]!==s||t[19]!==S||t[20]!==y?(v=n.jsx("div",{className:"flex flex-col h-full min-h-0 p-2 gap-3",children:n.jsx(Si,{title:"Tasks",tasks:k,activeTaskId:I,onSelect:y,onArchive:S,onNew:c,showNewButton:!0,currentUserId:s})}),t[15]=I,t[16]=k,t[17]=c,t[18]=s,t[19]=S,t[20]=y,t[21]=v):v=t[21],v}function Mi(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function $i(t){return{...t,fromAutomation:!0}}function Ti(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col h-full p-2 gap-1.5",children:Array.from({length:6}).map(Ai)}),t[0]=e):e=t[0],e}function Ai(t,e){return n.jsx("div",{className:"h-10 rounded-md bg-muted/60 animate-pulse"},e)}function Il(){const t=C.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(qn.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(it,{fallback:e,children:n.jsx(b.Suspense,{fallback:n.jsx(Ti,{}),children:n.jsx(Ii,{})})}),t[1]=s):s=t[1],s}export{yl as S,Il as T,Nl as a,le as b,Sl as c,wl as d,Cl as e,_l as f,yi as g,kl as u};