@decocms/mesh 2.136.0 → 2.137.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/client/assets/{AlertCircle-BmterM6-.js → AlertCircle-Bz0Gu2J2.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-D-24Asic.js → AlignLeft-cTDyunvB.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-DhmtNBCn.js → ArrowDown-DA10fwsF.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BwnRcCxk.js → ArrowLeft-bHzBiXiT.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-B2lliNjJ.js → ArrowUp-DNV5Voek.js} +1 -1
  6. package/dist/client/assets/{Check-Dy5Jwsdl.js → Check-e1LxjlnS.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DCJamcsS.js → CheckCircle-aG4ywA2O.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-BMlUtSk0.js → CheckDone01-BbDxR0le.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-BEvXxeXZ.js → CheckVerified02-BSRvrUwy.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-B8UJn4iH.js → ChevronDown-BjWhsewG.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-LqDMtl3T.js → ChevronLeft-bfDO3afT.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-UHmTzu6U.js → ChevronRight-DZwFOSrA.js} +1 -1
  13. package/dist/client/assets/{Clock-CHKtyQRJ.js → Clock-BDkBqrq2.js} +1 -1
  14. package/dist/client/assets/{Code01-Ce_GLriH.js → Code01-Den27Mse.js} +1 -1
  15. package/dist/client/assets/{Container-nefPC-Vi.js → Container-w8ZJjmnR.js} +1 -1
  16. package/dist/client/assets/{Copy01-DTrKcR-Q.js → Copy01-BCJxa3pS.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-DMAzBi98.js → Dataflow03-C3PCJs5S.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-BmF1jyTg.js → DotsHorizontal-DdpEu4kv.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-N7qtMw5m.js → DotsVertical-D65a3izp.js} +1 -1
  20. package/dist/client/assets/{Download01-C8dWfeAI.js → Download01-AELYrpVY.js} +1 -1
  21. package/dist/client/assets/{Edit01-CMeQdBcS.js → Edit01-CPphoQZI.js} +1 -1
  22. package/dist/client/assets/{Edit05-DZ_UN_S5.js → Edit05-Bxh4QPsk.js} +1 -1
  23. package/dist/client/assets/{Eye-DxLOh0i-.js → Eye-B65VnOsY.js} +1 -1
  24. package/dist/client/assets/{File02-vPAwJvd9.js → File02-DbPhqcQA.js} +1 -1
  25. package/dist/client/assets/{File06-CJFI46Rj.js → File06-DI2DTxDK.js} +1 -1
  26. package/dist/client/assets/{FilterLines-BfBD1RVS.js → FilterLines-BWEMXQRq.js} +1 -1
  27. package/dist/client/assets/{Globe01-CFu5KWUK.js → Globe01-0k9H0lE8.js} +1 -1
  28. package/dist/client/assets/{Globe02-KBI1AO62.js → Globe02-C7u-Ldxq.js} +1 -1
  29. package/dist/client/assets/{Grid01-CqnSySeu.js → Grid01-CMrNK-TY.js} +1 -1
  30. package/dist/client/assets/{Hash02-DJ4pr-VX.js → Hash02-DhotVIqT.js} +1 -1
  31. package/dist/client/assets/{Home02-Do5D--q6.js → Home02-CSmINeMq.js} +1 -1
  32. package/dist/client/assets/{Image01-C8E_92eh.js → Image01-HHGXqEyS.js} +1 -1
  33. package/dist/client/assets/{Inbox01-DFatNHSu.js → Inbox01-BVd6Ufjh.js} +1 -1
  34. package/dist/client/assets/{InfoCircle-BbDPfNIr.js → InfoCircle-CBee5-NO.js} +1 -1
  35. package/dist/client/assets/{Key01-5M9GOooO.js → Key01-DY7k7KSd.js} +1 -1
  36. package/dist/client/assets/{LayersTwo01-D3z_72X4.js → LayersTwo01-CuCFLmbR.js} +1 -1
  37. package/dist/client/assets/{LayoutLeft-CuouUkb7.js → LayoutLeft-D-Sd6nh5.js} +1 -1
  38. package/dist/client/assets/{Link01-phTHWMEc.js → Link01-C0RF1TkY.js} +1 -1
  39. package/dist/client/assets/{LinkExternal01-3GykVej2.js → LinkExternal01-DUHpfLmD.js} +1 -1
  40. package/dist/client/assets/{List-C81A8jh_.js → List-DFmwlXqV.js} +1 -1
  41. package/dist/client/assets/{Loading01-BWjBCSBL.js → Loading01-By16fsIj.js} +1 -1
  42. package/dist/client/assets/{Lock01-BF4OPECE.js → Lock01-CJOMXMAI.js} +1 -1
  43. package/dist/client/assets/{Play-CGCsuB7w.js → Play-DYSuo3bc.js} +1 -1
  44. package/dist/client/assets/{Plus-CK3qvOs-.js → Plus-jLReB_Bt.js} +1 -1
  45. package/dist/client/assets/{RefreshCcw01-DCU1xktc.js → RefreshCcw01-CJTVrN2f.js} +1 -1
  46. package/dist/client/assets/{Save01-sMmuMs88.js → Save01-B5XsnIBD.js} +1 -1
  47. package/dist/client/assets/{SearchMd-CpD1Xdqo.js → SearchMd-DF5i6zVs.js} +1 -1
  48. package/dist/client/assets/{Settings01-Bhz_Vu7B.js → Settings01-B3dw12xC.js} +1 -1
  49. package/dist/client/assets/{Shield01-B4VkgvZ4.js → Shield01-B801SPcx.js} +1 -1
  50. package/dist/client/assets/{Terminal-EynP_hYL.js → Terminal-DvZ2cYHA.js} +1 -1
  51. package/dist/client/assets/{Trash01-p1zJKNMp.js → Trash01-BZm-kVJv.js} +1 -1
  52. package/dist/client/assets/{Upload01-CuSBdknv.js → Upload01-B_Zc3fui.js} +1 -1
  53. package/dist/client/assets/{Users03-C4-0uA3w.js → Users03-CUtoEpN2.js} +1 -1
  54. package/dist/client/assets/{X-C0j62Xtl.js → X-DZCW78jV.js} +1 -1
  55. package/dist/client/assets/{XCircle-BtpMj0Vx.js → XCircle-BRYqxNwU.js} +1 -1
  56. package/dist/client/assets/{XClose-BoXt6_S8.js → XClose-CuKHHhHx.js} +1 -1
  57. package/dist/client/assets/{Zap-D7Nzarh3.js → Zap-D7ItB-QC.js} +1 -1
  58. package/dist/client/assets/{agent-connections-preview-CHU0g32U.js → agent-connections-preview-NrV6TyCn.js} +1 -1
  59. package/dist/client/assets/agent-detail-CTx9BMRL.js +2 -0
  60. package/dist/client/assets/agents-DtA7iPv8.js +1 -0
  61. package/dist/client/assets/{alert-dialog-D1XudKG9.js → alert-dialog-BY3oMun9.js} +2 -2
  62. package/dist/client/assets/{auth-catchall-BgPC7rSe.js → auth-catchall-DM7vkLcv.js} +1 -1
  63. package/dist/client/assets/{avatar-DNxsCl6r.js → avatar-Bp7Qjpgt.js} +1 -1
  64. package/dist/client/assets/{badge-D8RzvYJ4.js → badge-CU_zbIXX.js} +1 -1
  65. package/dist/client/assets/{binder-Blih3Yob.js → binder-D8RBAvqy.js} +1 -1
  66. package/dist/client/assets/{breadcrumb-N-YM-0qC.js → breadcrumb-J-4TPKpB.js} +1 -1
  67. package/dist/client/assets/{card-DpIJfsV8.js → card-ekU23Imm.js} +1 -1
  68. package/dist/client/assets/{chart-ClRGWH0O.js → chart-B5BozNmG.js} +1 -1
  69. package/dist/client/assets/{checkbox-CUOTkCKW.js → checkbox-Dkby6oH1.js} +1 -1
  70. package/dist/client/assets/{circle-alert-D8ryfTOx.js → circle-alert-Dmir_dX9.js} +1 -1
  71. package/dist/client/assets/{collapsible-CpgZSwBN.js → collapsible-C32NLu9h.js} +1 -1
  72. package/dist/client/assets/{collection-detail-B3RGhDtS.js → collection-detail-CVcRRgDT.js} +3 -3
  73. package/dist/client/assets/{collection-display-button-DrtKZPsB.js → collection-display-button-Cep9T1dy.js} +1 -1
  74. package/dist/client/assets/{collection-search-Cq4rjP0Z.js → collection-search-D8Kd7sE4.js} +1 -1
  75. package/dist/client/assets/collection-tab-BkZUIpwh.js +1 -0
  76. package/dist/client/assets/{collection-table-wrapper-CyGYWMWl.js → collection-table-wrapper-j8x7CZEu.js} +1 -1
  77. package/dist/client/assets/{collection-tabs-r7GKXx3H.js → collection-tabs-_pBQ3xqw.js} +1 -1
  78. package/dist/client/assets/{command-DazlgUs5.js → command-dR8rnu75.js} +1 -1
  79. package/dist/client/assets/{connect-CvX0kEdi.js → connect-DIFUIUeS.js} +1 -1
  80. package/dist/client/assets/{connection-card-BEmi4FHw.js → connection-card-Da4urKr2.js} +1 -1
  81. package/dist/client/assets/connection-detail-_mYJNdTe.js +1 -0
  82. package/dist/client/assets/connection-status-D-gHs_bI.js +1 -0
  83. package/dist/client/assets/connections-z3dfk98Y.js +1 -0
  84. package/dist/client/assets/{constants-BLSLjUCX.js → constants-B_iiTUip.js} +1 -1
  85. package/dist/client/assets/constants-DWucmYRT.js +1 -0
  86. package/dist/client/assets/{create-organization-dialog-_OZHP19d.js → create-organization-dialog-Dp3eW5BV.js} +1 -1
  87. package/dist/client/assets/{create-project-dialog-CBSHMrrx.js → create-project-dialog-wLCAgffa.js} +1 -1
  88. package/dist/client/assets/{danger-CPETFW7T.js → danger-DN20H7Jv.js} +1 -1
  89. package/dist/client/assets/{danger-zone-LxdCiZtW.js → danger-zone-BlpO_iQ-.js} +1 -1
  90. package/dist/client/assets/{decopilot-events-BEPzMc6y.js → decopilot-events-Dczeyumg.js} +1 -1
  91. package/dist/client/assets/dependencies-Uah1lriA.js +1 -0
  92. package/dist/client/assets/{dialog-BEh9NHdw.js → dialog-BuY4tTjY.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-BBy53YtY.js → dropdown-menu-CF9W86LV.js} +1 -1
  94. package/dist/client/assets/dynamic-plugin-layout-DbZjG_ew.js +1 -0
  95. package/dist/client/assets/{editable-task-title-CQx9B12m.js → editable-task-title-Po1P2Wd0.js} +1 -1
  96. package/dist/client/assets/{empty-state-Cd-Y6dcy.js → empty-state-COL4jrg3.js} +1 -1
  97. package/dist/client/assets/{env-vars-editor-CFN3JqN6.js → env-vars-editor-KGRYrftY.js} +1 -1
  98. package/dist/client/assets/{extract-connection-data-Bjwt_XIu.js → extract-connection-data-BbBDZhaA.js} +1 -1
  99. package/dist/client/assets/{file-browser-B3GXvhIi.js → file-browser-B2axtg2i.js} +2 -2
  100. package/dist/client/assets/{form-DKOen-4i.js → form-Ci0uQFmj.js} +1 -1
  101. package/dist/client/assets/{general-i_n7wxur.js → general-DaCshnBc.js} +1 -1
  102. package/dist/client/assets/{grid-view-1tJniq0A.js → grid-view-Cs9Fsjar.js} +1 -1
  103. package/dist/client/assets/{home-B-4A2LlA.js → home-CiAMHjmh.js} +1 -1
  104. package/dist/client/assets/{icon-picker-BXWmqDNl.js → icon-picker-5o9r59w2.js} +1 -1
  105. package/dist/client/assets/{index-CrfXnuko.js → index-B5u30SQw.js} +1 -1
  106. package/dist/client/assets/index-CBuDQZ5c.js +1 -0
  107. package/dist/client/assets/{index-DYkmX0JZ.js → index-CNLrMiMB.js} +1 -1
  108. package/dist/client/assets/{index-xQ2t379n.js → index-Cb17fVaO.js} +3 -3
  109. package/dist/client/assets/{index-9MR1Aak3.js → index-Ch67qqnf.js} +1 -1
  110. package/dist/client/assets/index-ClZvg-b8.js +1 -0
  111. package/dist/client/assets/{index-D3pPaynQ.js → index-CvxrBAxY.js} +1 -1
  112. package/dist/client/assets/{index-C79VipEf.js → index-DLDRkAi_.js} +1 -1
  113. package/dist/client/assets/{index-Bxe5mObN.js → index-DlboOjMX.js} +1 -1
  114. package/dist/client/assets/{infiniteQueryObserver-bwcxH-lX.js → infiniteQueryObserver-CiekiSCa.js} +1 -1
  115. package/dist/client/assets/{input-CquIDQAg.js → input-Cch0IC2D.js} +1 -1
  116. package/dist/client/assets/{integration-icon-CyNzGslP.js → integration-icon-BtE6qqXO.js} +1 -1
  117. package/dist/client/assets/{label-DgKgIZIr.js → label-BLzrK_Rs.js} +1 -1
  118. package/dist/client/assets/layout-BDCv6fVK.js +1 -0
  119. package/dist/client/assets/{layout-BaoRfV41.js → layout-JuxaRCBK.js} +1 -1
  120. package/dist/client/assets/{localstorage-keys-BVjc41qz.js → localstorage-keys-CxWEzkpK.js} +1 -1
  121. package/dist/client/assets/login-4Ej4TxT2.js +1 -0
  122. package/dist/client/assets/{markdown-Ba8nOSsK.js → markdown-B9U6C-Vk.js} +1 -1
  123. package/dist/client/assets/{mcp-app-renderer-DYp1_awD.js → mcp-app-renderer-vWTHzC-y.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-BKgRq621.js → mcp-oauth-D_4U_dE3.js} +1 -1
  125. package/dist/client/assets/{mcp-server-card-CpB9f-pn.js → mcp-server-card-xdUT5WQB.js} +1 -1
  126. package/dist/client/assets/mcp-server-detail-CZ73zkO0.js +2 -0
  127. package/dist/client/assets/members-CNen9UaM.js +3 -0
  128. package/dist/client/assets/{monaco-editor-Bqq988E3.js → monaco-editor-CYwLLnlJ.js} +1 -1
  129. package/dist/client/assets/{monitoring-Cw8c9SQ5.js → monitoring-BoQ3xY78.js} +2 -2
  130. package/dist/client/assets/monitoring-dashboard-edit-BdndwDLO.js +1 -0
  131. package/dist/client/assets/{monitoring-dashboard-view-CmbMs5N1.js → monitoring-dashboard-view-C4LyubYv.js} +2 -2
  132. package/dist/client/assets/{oauth-callback-3thxiCVs.js → oauth-callback-B6grmhGw.js} +1 -1
  133. package/dist/client/assets/page-BEtq2_NI.js +1 -0
  134. package/dist/client/assets/page-BnZfgb1H.js +1 -0
  135. package/dist/client/assets/{plugin-empty-state-CgwqeTLL.js → plugin-empty-state-CJi_lWXP.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-n7cn669C.js → plugin-empty-state-DyUfvnh_.js} +1 -1
  137. package/dist/client/assets/{plugin-header-BxEyDthP.js → plugin-header-B7DjR-EV.js} +1 -1
  138. package/dist/client/assets/{plugin-header-AGaevBZn.js → plugin-header-UTo9wubo.js} +1 -1
  139. package/dist/client/assets/plugins-HjXVX3kj.js +1 -0
  140. package/dist/client/assets/{popover-BGz1EQnh.js → popover-CH5Uw6Js.js} +1 -1
  141. package/dist/client/assets/project-app-view-DdBfbyq8.js +1 -0
  142. package/dist/client/assets/project-layout-hj30-COK.js +1 -0
  143. package/dist/client/assets/{project-plugins-R_POmKuz.js → project-plugins-DiXNjiNd.js} +1 -1
  144. package/dist/client/assets/{projects-list-DvHzim4C.js → projects-list-BhN8iQTZ.js} +1 -1
  145. package/dist/client/assets/{readme-viewer-CSo2KaPk.js → readme-viewer-D1bVaWvP.js} +1 -1
  146. package/dist/client/assets/{registry-layout-BRpD6JKO.js → registry-layout-vtzlbvnH.js} +2 -2
  147. package/dist/client/assets/{registry-utils-Cjdxmsng.js → registry-utils-M1yY8DgS.js} +1 -1
  148. package/dist/client/assets/{reports-layout-WypzA6IP.js → reports-layout-BiNtHVIg.js} +2 -2
  149. package/dist/client/assets/{reset-password-C2yglusd.js → reset-password-CVwZZFPi.js} +1 -1
  150. package/dist/client/assets/{resizable-BeoLLDMu.js → resizable-taukBI4-.js} +1 -1
  151. package/dist/client/assets/{save-actions-OW6B8GGT.js → save-actions-DkD1FHqW.js} +1 -1
  152. package/dist/client/assets/{scroll-area-BlV5UvCB.js → scroll-area-nyuwfJ38.js} +1 -1
  153. package/dist/client/assets/{select-CDsJtNMV.js → select-iAQ1JGAr.js} +1 -1
  154. package/dist/client/assets/shell-layout-hy8oqx1b.js +3 -0
  155. package/dist/client/assets/{sidebar-settings-CYmJoaNT.js → sidebar-settings-DQE_2wSn.js} +1 -1
  156. package/dist/client/assets/{skeleton-Ct9swv0n.js → skeleton-BavbnGik.js} +1 -1
  157. package/dist/client/assets/{spinner-DfUcLZCl.js → spinner-BsdcXRt-.js} +1 -1
  158. package/dist/client/assets/{store-invite-ZCHtOCWs.js → store-invite-BlSnhDpm.js} +1 -1
  159. package/dist/client/assets/switch-BYETmQBd.js +1 -0
  160. package/dist/client/assets/{table-BCfVNRpI.js → table-5KSUgwco.js} +1 -1
  161. package/dist/client/assets/tabs-BCXNMT0l.js +1 -0
  162. package/dist/client/assets/tasks-BEHJWLwK.js +1 -0
  163. package/dist/client/assets/{tasks-panel-Bcd4i-z8.js → tasks-panel-DXBfZcDd.js} +1 -1
  164. package/dist/client/assets/{textarea-BvEkv28R.js → textarea-D4QsZZY2.js} +1 -1
  165. package/dist/client/assets/{time-range-picker-CTYo_Gy_.js → time-range-picker-LYFa1sSz.js} +1 -1
  166. package/dist/client/assets/{toggle-group-BuwLTYBs.js → toggle-group-CnLXoLRJ.js} +1 -1
  167. package/dist/client/assets/tools-list-CWpIc2sG.js +1 -0
  168. package/dist/client/assets/tooltip-Bb66VFhj.js +1 -0
  169. package/dist/client/assets/{topbar-portal-CUBonFlI.js → topbar-portal-DBCM_jc6.js} +1 -1
  170. package/dist/client/assets/{types-CnPYT6I7.js → types-CGMnrrVy.js} +1 -1
  171. package/dist/client/assets/use-binding-Bi9qdfAY.js +1 -0
  172. package/dist/client/assets/use-collections-BF-71bZg.js +1 -0
  173. package/dist/client/assets/use-connection-Bv6BgTqI.js +1 -0
  174. package/dist/client/assets/{use-copy-oq5GkYwB.js → use-copy-QwK_lQBK.js} +1 -1
  175. package/dist/client/assets/{use-create-virtual-mcp-COKyzJBE.js → use-create-virtual-mcp-wYKTF_rl.js} +1 -1
  176. package/dist/client/assets/use-install-from-registry-CM7KAiir.js +1 -0
  177. package/dist/client/assets/{use-list-state-DhRtf36X.js → use-list-state-CB-KMJqf.js} +1 -1
  178. package/dist/client/assets/use-llm-lZx_FT_g.js +1 -0
  179. package/dist/client/assets/{use-mcp-resources-B792gs6l.js → use-mcp-resources-MU6kxIry.js} +1 -1
  180. package/dist/client/assets/{use-mcp-tools-DScmBuoc.js → use-mcp-tools-q5O9mXfB.js} +1 -1
  181. package/dist/client/assets/{use-members-Chfn3LoP.js → use-members-xNw9MWgV.js} +1 -1
  182. package/dist/client/assets/{use-mobile-CZlm25dt.js → use-mobile-By224gq0.js} +1 -1
  183. package/dist/client/assets/{use-project-BUsmU3t_.js → use-project-Dr0Nftxm.js} +1 -1
  184. package/dist/client/assets/{use-settings-modal-D18j_l44.js → use-settings-modal-5estZr-G.js} +1 -1
  185. package/dist/client/assets/{use-view-mode-5Lt8g0uo.js → use-view-mode-Dd5y7aaP.js} +1 -1
  186. package/dist/client/assets/use-virtual-mcp-T76ZkZ-8.js +1 -0
  187. package/dist/client/assets/useInfiniteQuery-DGesCtT2.js +1 -0
  188. package/dist/client/assets/{useMutation-tQLZk7P3.js → useMutation-DRjp2Nl5.js} +1 -1
  189. package/dist/client/assets/useQuery-BcAK4m0m.js +1 -0
  190. package/dist/client/assets/useSuspenseInfiniteQuery-B9EajsfN.js +1 -0
  191. package/dist/client/assets/{user-CI081yAV.js → user-CkBLhwlg.js} +1 -1
  192. package/dist/client/assets/workflow-C8yX97ao.js +1 -0
  193. package/dist/client/index.html +1 -1
  194. package/package.json +1 -1
  195. package/dist/client/assets/agent-detail-DURsxgC5.js +0 -2
  196. package/dist/client/assets/agents-Cl7pGBMM.js +0 -1
  197. package/dist/client/assets/collection-tab-CDCwjyV8.js +0 -1
  198. package/dist/client/assets/connection-detail-CJDHlEwZ.js +0 -1
  199. package/dist/client/assets/connections-DZjwaIPT.js +0 -1
  200. package/dist/client/assets/constants-D_mJYCD9.js +0 -1
  201. package/dist/client/assets/dependencies-Cz-sRh-1.js +0 -1
  202. package/dist/client/assets/dynamic-plugin-layout-p6ER6wNw.js +0 -1
  203. package/dist/client/assets/index-C6W9eJZm.js +0 -1
  204. package/dist/client/assets/index-DVmCBhSl.js +0 -1
  205. package/dist/client/assets/layout-Dknw5WOk.js +0 -1
  206. package/dist/client/assets/login-CbUqOEDM.js +0 -1
  207. package/dist/client/assets/mcp-server-detail-CCUSuXBZ.js +0 -2
  208. package/dist/client/assets/members-C3L37RaV.js +0 -3
  209. package/dist/client/assets/monitoring-dashboard-edit-BMa2OOFc.js +0 -1
  210. package/dist/client/assets/page-D6s6DLQp.js +0 -1
  211. package/dist/client/assets/page-DojbxRSJ.js +0 -1
  212. package/dist/client/assets/plugins-DPuuPP05.js +0 -1
  213. package/dist/client/assets/project-app-view-B5525387.js +0 -1
  214. package/dist/client/assets/project-layout-DDwGJ0ig.js +0 -1
  215. package/dist/client/assets/shell-layout-DfbBuM37.js +0 -3
  216. package/dist/client/assets/switch-a3WrSRQb.js +0 -1
  217. package/dist/client/assets/tabs-DN8uQx_4.js +0 -1
  218. package/dist/client/assets/tasks-Bgtg3aZ6.js +0 -1
  219. package/dist/client/assets/tools-list-DKmevE2X.js +0 -1
  220. package/dist/client/assets/tooltip-B6yKYOIf.js +0 -1
  221. package/dist/client/assets/use-binding-BSjPQ0Be.js +0 -1
  222. package/dist/client/assets/use-connection-Dtj63U01.js +0 -1
  223. package/dist/client/assets/use-install-from-registry-DD_AL_1f.js +0 -1
  224. package/dist/client/assets/use-llm-5n5wwCT_.js +0 -1
  225. package/dist/client/assets/use-virtual-mcp-COkdNvVv.js +0 -1
  226. package/dist/client/assets/useInfiniteQuery-fRddscS9.js +0 -1
  227. package/dist/client/assets/useQuery-BLe-0FCm.js +0 -1
  228. package/dist/client/assets/useSuspenseInfiniteQuery-D0p_NlPn.js +0 -1
  229. package/dist/client/assets/workflow-Bu6-o0iD.js +0 -1
@@ -1 +0,0 @@
1
- import{r as v,c as I,d as at,j as s,v as ue,t as Pe,aA as xs,o as ps,s as Re,b as rt,u as me,n as At,l as hs,k as gs,K as mt,B as ce,c4 as Pt,O as Ee,P as It,S as et,e as vs,aE as ys}from"./index-xQ2t379n.js";import{u as Et}from"./use-project-BUsmU3t_.js";import{c as bs,d as js,b as Ns,a as Ot,D as Lt}from"./dialog-BEh9NHdw.js";import{i as Dt}from"./X-C0j62Xtl.js";import{S as ne}from"./skeleton-Ct9swv0n.js";import{t as Ss,i as lt,u as ws}from"./use-settings-modal-D18j_l44.js";import{A as Tt}from"./avatar-DNxsCl6r.js";import{t as Cs}from"./Settings01-Bhz_Vu7B.js";import{i as _s}from"./Zap-D7Nzarh3.js";import{a as ks,b as As,c as Ps,T as Is}from"./tooltip-B6yKYOIf.js";import{i as Es}from"./Check-Dy5Jwsdl.js";import{a as Os}from"./Copy01-DTrKcR-Q.js";import{S as Le}from"./switch-a3WrSRQb.js";import{S as Ls,a as Ds,d as We,c as Ts}from"./select-CDsJtNMV.js";import{i as zs}from"./Code01-Ce_GLriH.js";import{i as $s}from"./Shield01-B4VkgvZ4.js";import{u as zt,a as Ms,T as Fe,b as Ue,c as Bs}from"./tabs-DN8uQx_4.js";import{u as Gs}from"./useMutation-tQLZk7P3.js";import{a as Rs,F as Ve,b as Ke,c as Ye,d as He,f as qe,e as Ws}from"./form-DKOen-4i.js";import{I as Ie}from"./input-CquIDQAg.js";import{i as Fs}from"./Upload01-CuSBdknv.js";import{P as Us}from"./project-plugins-R_POmKuz.js";import{u as Vs,a as Ks,b as Ys,i as ie,r as Me,D as $t,c as Be,d as fe,s as ft,e as xt,Z as Mt,g as Bt,f as Gt,h as Rt,j as ke,k as nt,l as Ge,m as it,n as Hs,o as qs,p as Wt,q as ot,t as ct,v as Ft,w as Qs,x as Ut,y as pt,z as Xs,A as Js,B as Zs,R as ea,S as ta,C as sa,E as aa,F as Vt,G as ra,H as la,I as na,J as ia,K as oa,L as ca,M as da,N as ua,O as De,P as ma,Q as ht,T as gt,U as vt,V as fa,W as Kt,X as xa,Y as Ne,_ as pa,$ as ha,a0 as ga,a1 as va,a2 as ya,a3 as Qe,a4 as ba,a5 as Te,a6 as ja,a7 as Na,a8 as J,a9 as Yt,aa as Sa,ab as wa,ac as Ca,ad as _a,ae as ka,af as Aa,ag as Pa,ah as Ia,ai as Ea,aj as Oa,ak as La,al as Da,am as Ta,an as za,ao as $a,ap as Ma,aq as Ba,ar as Ga}from"./chart-ClRGWH0O.js";import{L as Ae}from"./label-DgKgIZIr.js";import{B as Ra}from"./badge-D8RzvYJ4.js";import{i as Wa}from"./AlertCircle-BmterM6-.js";import{s as Ht}from"./Plus-CK3qvOs-.js";import{s as Fa}from"./RefreshCcw01-DCU1xktc.js";import{u as _e,a as dt,K as Ua}from"./constants-BLSLjUCX.js";import{h as Va}from"./use-connection-Dtj63U01.js";import{b as oe,a as qt}from"./use-mcp-tools-DScmBuoc.js";import{u as Ka}from"./use-members-Chfn3LoP.js";import{c as Ya,A as Ha}from"./use-binding-BSjPQ0Be.js";import"./useQuery-BLe-0FCm.js";import"./index-CrfXnuko.js";import"./ChevronDown-B8UJn4iH.js";import"./localstorage-keys-BVjc41qz.js";import"./Container-nefPC-Vi.js";import"./use-install-from-registry-DD_AL_1f.js";import"./extract-connection-data-Bjwt_XIu.js";import"./constants-D_mJYCD9.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-Cjdxmsng.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-BWjBCSBL.js";import"./index-DYkmX0JZ.js";import"./binder-Blih3Yob.js";const Qt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));Qt.displayName="Beaker01";const Xt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Xt.displayName="Bell01";function qa(t){const e=I.c(26),{activeSection:r,onNavigate:a}=t,{data:n}=at.useSession(),l=n?.user,i=l?.image,o=l?.name??"Profile",d=l?.name??"U";let m;e[0]!==d||e[1]!==i?(m=s.jsx(Tt,{url:i,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=i,e[2]=m):m=e[2];let c;e[3]!==o||e[4]!==m?(c={key:"account.profile",label:o,icon:m},e[3]=o,e[4]=m,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={key:"account.preferences",label:"Preferences",icon:s.jsx(Cs,{size:14})},e[6]=u):u=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={key:"account.experimental",label:"Experimental",icon:s.jsx(Qt,{size:14})},e[7]=f):f=e[7];let x;e[8]!==c?(x=[c,u,f],e[8]=c,e[9]=x):x=e[9];const h=x;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.general",label:"General",icon:s.jsx(Ss,{size:14})},e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.plugins",label:"Features",icon:s.jsx(_s,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=[p,g,{key:"org.billing",label:"Billing",icon:s.jsx(lt,{size:14})}],e[12]=y):y=e[12];const S=y;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=N):N=e[13];let b;e[14]!==h||e[15]!==r||e[16]!==a?(b=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[N,h.map(_=>s.jsxs("button",{type:"button",onClick:()=>a(_.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===_.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:_.icon}),s.jsx("span",{className:"truncate",children:_.label})]},_.key))]}),e[14]=h,e[15]=r,e[16]=a,e[17]=b):b=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=w):w=e[18];let j;e[19]!==r||e[20]!==a?(j=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[w,S.map(_=>s.jsxs("button",{type:"button",onClick:()=>a(_.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===_.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:_.icon}),s.jsx("span",{className:"truncate",children:_.label})]},_.key))]}),e[19]=r,e[20]=a,e[21]=j):j=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.136.0"]})}),e[22]=C):C=e[22];let k;return e[23]!==b||e[24]!==j?(k=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[b,j,C]}),e[23]=b,e[24]=j,e[25]=k):k=e[25],k}function Qa(){const t=I.c(32),{data:e}=at.useSession(),[r,a]=v.useState(!1),n=e?.user,l=n?.image;let i;t[0]!==n?(i=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=n,t[1]=i):i=t[1];const o=i;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const m=n?.name??"U";let c;t[3]!==m||t[4]!==l?(c=s.jsx(Tt,{url:l,fallback:m,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=m,t[4]=l,t[5]=c):c=t[5];const u=n?.name??"User";let f;t[6]!==u?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:u}),t[6]=u,t[7]=f):f=t[7];const x=n?.email;let h;t[8]!==x?(h=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=h):h=t[9];let p;t[10]!==f||t[11]!==h?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,h]}),t[10]=f,t[11]=h,t[12]=p):p=t[12];let g;t[13]!==c||t[14]!==p?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,p]}),t[13]=c,t[14]=p,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=S):S=t[17];const N=n?.id;let b;t[18]!==N?(b=s.jsx("span",{className:"font-mono text-sm",children:N}),t[18]=N,t[19]=b):b=t[19];let w;t[20]!==r?(w=r?s.jsx(Es,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Os,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=w):w=t[21];let j;t[22]!==o||t[23]!==b||t[24]!==w?(j=s.jsx(ks,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,w]})}),t[22]=o,t[23]=b,t[24]=w,t[25]=j):j=t[25];let C;t[26]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(As,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=C):C=t[26];let k;t[27]!==j?(k=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[S,s.jsx(Ps,{children:s.jsxs(Is,{children:[j,C]})})]})]}),t[27]=j,t[28]=k):k=t[28];let _;return t[29]!==k||t[30]!==g?(_=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,k]}),t[29]=k,t[30]=g,t[31]=_):_=t[31],_}function Xe(t){const e=I.c(27),{icon:r,label:a,description:n,control:l,onClick:i,disabled:o}=t,d=o?void 0:i,m=i?"button":void 0,c=i&&!o?0:void 0;let u;e[0]!==o||e[1]!==i?(u=i&&!o?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),i())}:void 0,e[0]=o,e[1]=i,e[2]=u):u=e[2];const f=i&&!o?"pointer":void 0;let x;e[3]!==f?(x={cursor:f},e[3]=f,e[4]=x):x=e[4];let h;e[5]!==r?(h=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=h):h=e[6];let p;e[7]!==a?(p=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=p):p=e[8];let g;e[9]!==n?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:n}),e[9]=n,e[10]=g):g=e[10];let y;e[11]!==p||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[p,g]}),e[11]=p,e[12]=g,e[13]=y):y=e[13];let S;e[14]!==y||e[15]!==h?(S=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[h,y]}),e[14]=y,e[15]=h,e[16]=S):S=e[16];let N;e[17]!==l?(N=s.jsx("div",{onClick:Xa,className:"shrink-0",children:l}),e[17]=l,e[18]=N):N=e[18];let b;return e[19]!==d||e[20]!==S||e[21]!==N||e[22]!==m||e[23]!==c||e[24]!==u||e[25]!==x?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:m,tabIndex:c,onKeyDown:u,style:x,children:[S,N]}),e[19]=d,e[20]=S,e[21]=N,e[22]=m,e[23]=c,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function Xa(t){return t.stopPropagation()}function yt(){const t=I.c(35),[e,r]=zt();let a;t[0]!==r?(a=async C=>{if(C&&await Notification.requestPermission()!=="granted"){Pe.error("Notifications denied. Please enable them in your browser settings."),r(Za);return}r(k=>({...k,enableNotifications:C}))},t[0]=r,t[1]=a):a=t[1];const n=a;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=l):l=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(zs,{size:16}),t[3]=i):i=t[3];let o;t[4]!==r?(o=()=>r(Ja),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=C=>r(k=>({...k,devMode:C})),t[6]=r,t[7]=d):d=t[7];let m;t[8]!==e.devMode||t[9]!==d?(m=s.jsx(Le,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=m):m=t[10];let c;t[11]!==o||t[12]!==m?(c=s.jsx(Xe,{icon:i,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:m}),t[11]=o,t[12]=m,t[13]=c):c=t[13];let u;t[14]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Xt,{size:16}),t[14]=u):u=t[14];let f;t[15]!==n||t[16]!==e.enableNotifications?(f=s.jsx(Xe,{icon:u,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>n(!e.enableNotifications),control:s.jsx(Le,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:n})}),t[15]=n,t[16]=e.enableNotifications,t[17]=f):f=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx($s,{size:16}),t[18]=x):x=t[18];let h;t[19]!==r?(h=C=>r(k=>({...k,toolApprovalLevel:C})),t[19]=r,t[20]=h):h=t[20];let p;t[21]===Symbol.for("react.memo_cache_sentinel")?(p={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=p):p=t[21];const g=p[e.toolApprovalLevel];let y;t[22]!==g?(y=s.jsx(Ds,{className:"w-36",children:s.jsx("span",{children:g})}),t[22]=g,t[23]=y):y=t[23];let S;t[24]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(We,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=S):S=t[24];let N;t[25]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(We,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=N):N=t[25];let b;t[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs(Ts,{children:[S,N,s.jsx(We,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=b):b=t[26];let w;t[27]!==e.toolApprovalLevel||t[28]!==h||t[29]!==y?(w=s.jsx(Xe,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ls,{value:e.toolApprovalLevel,onValueChange:h,children:[y,b]})}),t[27]=e.toolApprovalLevel,t[28]=h,t[29]=y,t[30]=w):w=t[30];let j;return t[31]!==w||t[32]!==c||t[33]!==f?(j=s.jsxs("div",{className:"flex flex-col gap-6",children:[l,s.jsxs("div",{className:"flex flex-col",children:[c,f,w]})]}),t[31]=w,t[32]=c,t[33]=f,t[34]=j):j=t[34],j}function Ja(t){return{...t,devMode:!t.devMode}}function Za(t){return{...t,enableNotifications:!1}}function er(t){const e=I.c(22),{icon:r,label:a,description:n,checked:l,onCheckedChange:i}=t;let o;e[0]!==l||e[1]!==i?(o=()=>i(!l),e[0]=l,e[1]=i,e[2]=o):o=e[2];let d;e[3]!==r?(d=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[3]=r,e[4]=d):d=e[4];let m;e[5]!==a?(m=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[5]=a,e[6]=m):m=e[6];let c;e[7]!==n?(c=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:n}),e[7]=n,e[8]=c):c=e[8];let u;e[9]!==m||e[10]!==c?(u=s.jsxs("div",{className:"min-w-0",children:[m,c]}),e[9]=m,e[10]=c,e[11]=u):u=e[11];let f;e[12]!==d||e[13]!==u?(f=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[d,u]}),e[12]=d,e[13]=u,e[14]=f):f=e[14];let x;e[15]!==l||e[16]!==i?(x=s.jsx("div",{onClick:tr,className:"shrink-0",children:s.jsx(Le,{checked:l,onCheckedChange:i})}),e[15]=l,e[16]=i,e[17]=x):x=e[17];let h;return e[18]!==o||e[19]!==f||e[20]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:o,children:[f,x]}),e[18]=o,e[19]=f,e[20]=x,e[21]=h):h=e[21],h}function tr(t){return t.stopPropagation()}function sr(){const t=I.c(7),[e,r]=zt();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),t[0]=a):a=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(xs,{size:16}),t[1]=n):n=t[1];let l;t[2]!==r?(l=o=>r(d=>({...d,experimental_projects:o})),t[2]=r,t[3]=l):l=t[3];let i;return t[4]!==e.experimental_projects||t[5]!==l?(i=s.jsxs("div",{className:"flex flex-col gap-6",children:[a,s.jsx("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:s.jsx(er,{icon:n,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:e.experimental_projects,onCheckedChange:l})})]}),t[4]=e.experimental_projects,t[5]=l,t[6]=i):i=t[6],i}const ar=ps({name:Re().min(1,"Name is required").max(255,"Name is too long"),slug:Re().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Re().optional()});function rr(t){const e=I.c(24),{value:r,onChange:a,name:n}=t,l=v.useRef(null);let i;e[0]!==a?(i=b=>{const w=b.target.files?.[0];if(w){if(w.size>2097152){Pe.error("Image must be smaller than 2MB");return}const j=new FileReader;j.onerror=()=>{const C=j.error;console.error("FileReader error:",C),Pe.error(C?.message||"Failed to read image file. Please try again."),l.current&&(l.current.value="")},j.onloadend=()=>{if(j.readyState===FileReader.DONE&&j.result){const C=j.result;a(C)}},j.readAsDataURL(w)}},e[0]=a,e[1]=i):i=e[1];const o=i;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{l.current?.click()},e[2]=d):d=e[2];const m=d;let c;e[3]!==a?(c=b=>{b.stopPropagation(),a("")},e[3]=a,e[4]=c):c=e[4];const u=c;let f;e[5]!==o?(f=s.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=f):f=e[6];let x;e[7]!==u||e[8]!==n||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:n||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:u,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Dt,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:m,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Fs,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=u,e[8]=n,e[9]=r,e[10]=x):x=e[10];const h=r?"Change Logo":"Upload Logo";let p;e[11]!==h?(p=s.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:m,className:"mb-2",children:h}),e[11]=h,e[12]=p):p=e[12];let g;e[13]!==u||e[14]!==r?(g=r&&s.jsx(ce,{type:"button",variant:"ghost",size:"sm",onClick:u,className:"ml-2",children:"Remove"}),e[13]=u,e[14]=r,e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=y):y=e[16];let S;e[17]!==p||e[18]!==g?(S=s.jsxs("div",{className:"flex-1",children:[p,g,y]}),e[17]=p,e[18]=g,e[19]=S):S=e[19];let N;return e[20]!==S||e[21]!==f||e[22]!==x?(N=s.jsxs("div",{className:"flex items-start gap-4",children:[f,x,S]}),e[20]=S,e[21]=f,e[22]=x,e[23]=N):N=e[23],N}function lr(){const t=rt(),{org:e,project:r}=me(),a=At(),[n,l]=v.useState(!1),i=hs({resolver:gs(ar),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Gs({mutationFn:async c=>{const u={name:c.name,slug:c.slug};c.logo&&(u.logo=c.logo);const f=await at.organization.update({organizationId:e.id,data:u});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:mt.organizations()}),a.invalidateQueries({queryKey:mt.activeOrganization(e.slug)}),Pe.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Pe.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{l(!1)}}),d=c=>{l(!0),o.mutate(c)},m=i.formState.isDirty;return s.jsx(Rs,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Ve,{control:i.control,name:"name",render:({field:c})=>s.jsxs(Ke,{children:[s.jsx(Ye,{children:"Organization Name"}),s.jsx(He,{children:s.jsx(Ie,{placeholder:"My Organization",...c,disabled:n})}),s.jsx(qe,{})]})}),s.jsx(Ve,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(Ke,{children:[s.jsx(Ye,{children:"Organization Slug"}),s.jsx(He,{children:s.jsx(Ie,{placeholder:"my-organization",...c,disabled:n,onChange:u=>{const f=u.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Ws,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(qe,{})]})}),s.jsx(Ve,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(Ke,{children:[s.jsx(Ye,{children:"Logo"}),s.jsx(He,{children:s.jsx(rr,{value:c.value,onChange:c.onChange,name:i.watch("name")})}),s.jsx(qe,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(ce,{type:"submit",disabled:!m||n,className:"min-w-24",children:n?"Saving...":"Save Changes"}),m&&s.jsx(ce,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:n,children:"Cancel"})]})]})})}function nr(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(lr,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,n=new Array(a>2?a-2:0),l=2;l<a;l++)n[l-2]=arguments[l];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(r.replace(/%s/g,()=>n[i++]))}},ir=["x1","y1","x2","y2","key"],or=["offset"],cr=["xAxisId","yAxisId"],dr=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){ur(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function ur(t,e,r){return(e=mr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mr(t){var e=fr(t,"string");return typeof e=="symbol"?e:e+""}function fr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,a,n=xr(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var pr=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:n,width:l,height:i,ry:o}=t;return v.createElement("rect",{x:a,y:n,ry:o,width:l,height:i,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Jt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var n,{x1:l,y1:i,x2:o,y2:d,key:m}=r,c=ze(r,ir),u=(n=nt(c))!==null&&n!==void 0?n:{},{offset:f}=u,x=ze(u,or);a=v.createElement("line",xe({},x,{x1:l,y1:i,x2:o,y2:d,fill:"none",key:m}))}return a}function hr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:n}=t;if(!a||!n||!n.length)return null;var{xAxisId:l,yAxisId:i}=t,o=ze(t,cr),d=n.map((m,c)=>{var u=Z(Z({},o),{},{x1:e,y1:m,x2:e+r,y2:m,key:"line-".concat(c),index:c});return v.createElement(Jt,{key:"line-".concat(c),option:a,lineItemProps:u})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function gr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:n}=t;if(!a||!n||!n.length)return null;var{xAxisId:l,yAxisId:i}=t,o=ze(t,dr),d=n.map((m,c)=>{var u=Z(Z({},o),{},{x1:m,y1:e,x2:m,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Jt,{option:a,lineItemProps:u,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function vr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:n,width:l,height:i,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var m=o.map(u=>Math.round(u+n-n)).sort((u,f)=>u-f);n!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var x=m[f+1],h=x==null,p=h?n+i-u:x-u;if(p<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:u,x:a,height:p,width:l,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function yr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:n,y:l,width:i,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var m=d.map(u=>Math.round(u+n-n)).sort((u,f)=>u-f);n!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var x=m[f+1],h=x==null,p=h?n+i-u:x-u;if(p<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:u,y:l,width:p,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var br=(t,e)=>{var{xAxis:r,width:a,height:n,offset:l}=t;return Bt(Gt(Z(Z(Z({},ke),r),{},{ticks:Rt(r),viewBox:{x:0,y:0,width:a,height:n}})),l.left,l.left+l.width,e)},jr=(t,e)=>{var{yAxis:r,width:a,height:n,offset:l}=t;return Bt(Gt(Z(Z(Z({},ke),r),{},{ticks:Rt(r),viewBox:{x:0,y:0,width:a,height:n}})),l.top,l.top+l.height,e)},Nr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:$t.grid};function Zt(t){var e=Vs(),r=Ks(),a=Ys(),n=Z(Z({},Me(t,Nr)),{},{x:ie(t.x)?t.x:a.left,y:ie(t.y)?t.y:a.top,width:ie(t.width)?t.width:a.width,height:ie(t.height)?t.height:a.height}),{xAxisId:l,yAxisId:i,x:o,y:d,width:m,height:c,syncWithTicks:u,horizontalValues:f,verticalValues:x}=n,h=Be(),p=fe(_=>ft(_,"xAxis",l,h)),g=fe(_=>ft(_,"yAxis",i,h));if(!xt(m)||!xt(c)||!ie(o)||!ie(d))return null;var y=n.verticalCoordinatesGenerator||br,S=n.horizontalCoordinatesGenerator||jr,{horizontalPoints:N,verticalPoints:b}=n;if((!N||!N.length)&&typeof S=="function"){var w=f&&f.length,j=S({yAxis:g?Z(Z({},g),{},{ticks:w?f:g.ticks}):void 0,width:e??m,height:r??c,offset:a},w?!0:u);bt(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(N=j)}if((!b||!b.length)&&typeof y=="function"){var C=x&&x.length,k=y({xAxis:p?Z(Z({},p),{},{ticks:C?x:p.ticks}):void 0,width:e??m,height:r??c,offset:a},C?!0:u);bt(Array.isArray(k),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof k,"]")),Array.isArray(k)&&(b=k)}return v.createElement(Mt,{zIndex:n.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(pr,{fill:n.fill,fillOpacity:n.fillOpacity,x:n.x,y:n.y,width:n.width,height:n.height,ry:n.ry}),v.createElement(vr,xe({},n,{horizontalPoints:N})),v.createElement(yr,xe({},n,{verticalPoints:b})),v.createElement(hr,xe({},n,{offset:a,horizontalPoints:N,xAxis:p,yAxis:g})),v.createElement(gr,xe({},n,{offset:a,verticalPoints:b,xAxis:p,yAxis:g}))))}Zt.displayName="CartesianGrid";var es=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),ts=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),ss=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),as=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),Sr=Ge([it,es,ss,ts,as],(t,e,r,a,n)=>Ut(t,"xAxis")?pt(e,a,!1):pt(r,n,!1)),wr=(t,e)=>e,rs=Ge([Xs,wr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),ls=t=>{var e=it(t),r=Ut(e,"xAxis");return r?"yAxis":"xAxis"},Cr=(t,e)=>{var r=ls(t);return r==="yAxis"?ct(t,e):ot(t,e)},_r=(t,e,r)=>Js(t,ls(t),Cr(t,e),r),kr=Ge([rs,_r],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,n=Qs(t);if(!(a==null||n==null)){var l=(r=e[a])===null||r===void 0?void 0:r.stackedData,i=l?.find(o=>o.key===n);if(i!=null)return i.map(o=>[o[0],o[1]])}}}),Ar=Ge([it,es,ss,ts,as,kr,Hs,Sr,rs,qs],(t,e,r,a,n,l,i,o,d,m)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:f}=i;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||n==null||a.length===0||n.length===0||o==null)){var{data:x}=d,h;if(x&&x.length>0?h=x:h=c?.slice(u,f+1),h!=null)return Yr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:n,dataStartIndex:u,areaSettings:d,stackedData:l,displayedData:h,chartBaseValue:m,bandSize:o})}}),Pr=["id"],Ir=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function ns(t,e){if(t==null)return{};var r,a,n=Er(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Er(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){Or(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Or(t,e,r){return(e=Lr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lr(t){var e=Dr(t,"string");return typeof e=="symbol"?e:e+""}function Dr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $e(t,e){return t&&t!=="none"?t:e}var Tr=t=>{var{dataKey:e,name:r,stroke:a,fill:n,legendType:l,hide:i}=t;return[{inactive:i,dataKey:e,type:l,color:$e(a,n),value:Vt(r,e),payload:t}]},zr=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:n,fill:l,name:i,hide:o,unit:d,tooltipType:m,id:c}=t,u={dataDefinedOnItem:r,getPosition:la,settings:{stroke:a,strokeWidth:n,fill:l,dataKey:e,nameKey:void 0,name:Vt(i,e),hide:o,type:m,color:$e(a,l),unit:d,graphicalItemId:c}};return v.createElement(ra,{tooltipEntrySettings:u})});function $r(t){var{clipPathId:e,points:r,props:a}=t,{needClip:n,dot:l,dataKey:i}=a,o=nt(a);return v.createElement(ba,{points:r,dot:l,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:n,clipPathId:e})}function Mr(t){var{showLabels:e,children:r,points:a}=t,n=a.map(l=>{var i,o,d={x:(i=l.x)!==null&&i!==void 0?i:0,y:(o=l.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:l.value,payload:l.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(va,{value:e?n:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:n,props:l}=t,{layout:i,type:o,stroke:d,connectNulls:m,isRange:c}=l,{id:u}=l,f=ns(l,Pr),x=nt(f),h=ya(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(De,{clipPath:a?"url(#clipPath-".concat(n,")"):void 0},v.createElement(Qe,pe({},h,{id:u,points:e,connectNulls:m,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Qe,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:e})),d!=="none"&&c&&v.createElement(Qe,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:r}))),v.createElement($r,{points:e,props:f,clipPathId:n}))}function Br(t){var e,r,{alpha:a,baseLine:n,points:l,strokeWidth:i}=t,o=(e=l[0])===null||e===void 0?void 0:e.y,d=(r=l[l.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(d))return null;var m=a*Math.abs(o-d),c=Math.max(...l.map(u=>u.x||0));return ie(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(u=>u.x||0),c)),ie(c)?v.createElement("rect",{x:0,y:o<d?o:o-m,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(m)}):null}function Gr(t){var e,r,{alpha:a,baseLine:n,points:l,strokeWidth:i}=t,o=(e=l[0])===null||e===void 0?void 0:e.x,d=(r=l[l.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(d))return null;var m=a*Math.abs(o-d),c=Math.max(...l.map(u=>u.y||0));return ie(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(u=>u.y||0),c)),ie(c)?v.createElement("rect",{x:o<d?o:o-m,y:0,width:m,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function Rr(t){var{alpha:e,layout:r,points:a,baseLine:n,strokeWidth:l}=t;return r==="vertical"?v.createElement(Br,{alpha:e,points:a,baseLine:n,strokeWidth:l}):v.createElement(Gr,{alpha:e,points:a,baseLine:n,strokeWidth:l})}function Wr(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:n,previousBaselineRef:l}=t,{points:i,baseLine:o,isAnimationActive:d,animationBegin:m,animationDuration:c,animationEasing:u,onAnimationStart:f,onAnimationEnd:x}=a,h=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),p=fa(h,"recharts-area-"),g=Kt(),[y,S]=v.useState(!1),N=!y,b=v.useCallback(()=>{typeof x=="function"&&x(),S(!1)},[x]),w=v.useCallback(()=>{typeof f=="function"&&f(),S(!0)},[f]);if(g==null)return null;var j=n.current,C=l.current;return v.createElement(Mr,{showLabels:N,points:i},a.children,v.createElement(xa,{animationId:p,begin:m,duration:c,isActive:d,easing:u,onAnimationEnd:b,onAnimationStart:w,key:p},k=>{if(j){var _=j.length/i.length,E=k===1?i:i.map((A,L)=>{var O=Math.floor(L*_);if(j[O]){var D=j[O];return Se(Se({},A),{},{x:Ne(D.x,A.x,k),y:Ne(D.y,A.y,k)})}return A}),z;return ie(o)?z=Ne(C,o,k):pa(o)||ha(o)?z=Ne(C,0,k):z=o.map((A,L)=>{var O=Math.floor(L*_);if(Array.isArray(C)&&C[O]){var D=C[O];return Se(Se({},A),{},{x:Ne(D.x,A.x,k),y:Ne(D.y,A.y,k)})}return A}),k>0&&(n.current=E,l.current=z),v.createElement(St,{points:E,baseLine:z,needClip:e,clipPathId:r,props:a})}return k>0&&(n.current=i,l.current=o),v.createElement(De,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Rr,{alpha:k,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(De,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:i,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(ga,{label:a.label}))}function Fr(t){var{needClip:e,clipPathId:r,props:a}=t,n=v.useRef(null),l=v.useRef();return v.createElement(Wr,{needClip:e,clipPathId:r,props:a,previousPointsRef:n,previousBaselineRef:l})}class Ur extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:n,top:l,left:i,needClip:o,xAxisId:d,yAxisId:m,width:c,height:u,id:f,baseLine:x,zIndex:h}=this.props;if(e)return null;var p=Pt("recharts-area",n),g=f,{r:y,strokeWidth:S}=da(r),N=ua(r),b=y*2+S,w=o?"url(#clipPath-".concat(N?"":"dots-").concat(g,")"):void 0;return v.createElement(Mt,{zIndex:h},v.createElement(De,{className:p},o&&v.createElement("defs",null,v.createElement(ma,{clipPathId:g,xAxisId:d,yAxisId:m}),!N&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:i-b/2,y:l-b/2,width:c+b,height:u+b}))),v.createElement(Fr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(ht,{points:a,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}),this.props.isRange&&Array.isArray(x)&&v.createElement(ht,{points:x,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}))}}var is={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:$t.area};function Vr(t){var e,r=Me(t,is),{activeDot:a,animationBegin:n,animationDuration:l,animationEasing:i,connectNulls:o,dot:d,fill:m,fillOpacity:c,hide:u,isAnimationActive:f,legendType:x,stroke:h,xAxisId:p,yAxisId:g}=r,y=ns(r,Ir),S=na(),N=ia(),{needClip:b}=oa(p,g),w=Be(),{points:j,isRange:C,baseLine:k}=(e=fe(O=>Ar(O,t.id,w)))!==null&&e!==void 0?e:{},_=ca();if(S!=="horizontal"&&S!=="vertical"||_==null||N!=="AreaChart"&&N!=="ComposedChart")return null;var{height:E,width:z,x:A,y:L}=_;return!j||!j.length?null:v.createElement(Ur,pe({},y,{activeDot:a,animationBegin:n,animationDuration:l,animationEasing:i,baseLine:k,connectNulls:o,dot:d,fill:m,fillOpacity:c,height:E,hide:u,layout:S,isAnimationActive:f==="auto"?!ja.isSsr:f,isRange:C,legendType:x,needClip:b,points:j,stroke:h,width:z,left:A,top:L,xAxisId:p,yAxisId:g}))}var Kr=(t,e,r,a,n)=>{var l=r??e;if(ie(l))return l;var i=t==="horizontal"?n:a,o=i.scale.domain();if(i.type==="number"){var d=Math.max(o[0],o[1]),m=Math.min(o[0],o[1]);return l==="dataMin"?m:l==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return l==="dataMin"?o[0]:l==="dataMax"?o[1]:o[0]};function Yr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:n,layout:l,chartBaseValue:i,xAxis:o,yAxis:d,displayedData:m,dataStartIndex:c,xAxisTicks:u,yAxisTicks:f,bandSize:x}=t,h=n&&n.length,p=Kr(l,i,r,o,d),g=l==="horizontal",y=!1,S=m.map((b,w)=>{var j,C,k,_;if(h)_=n[c+w];else{var E=gt(b,a);Array.isArray(E)?(_=E,y=!0):_=[p,E]}var z=(j=(C=_)===null||C===void 0?void 0:C[1])!==null&&j!==void 0?j:null,A=z==null||h&&!e&&gt(b,a)==null;if(g){var L;return{x:vt({axis:o,ticks:u,bandSize:x,entry:b,index:w}),y:A?null:(L=d.scale.map(z))!==null&&L!==void 0?L:null,value:_,payload:b}}return{x:A?null:(k=o.scale.map(z))!==null&&k!==void 0?k:null,y:vt({axis:d,ticks:f,bandSize:x,entry:b,index:w}),value:_,payload:b}}),N;return h||y?N=S.map(b=>{var w,j=Array.isArray(b.value)?b.value[0]:null;if(g){var C;return{x:b.x,y:j!=null&&b.y!=null&&(C=d.scale.map(j))!==null&&C!==void 0?C:null,payload:b.payload}}return{x:j!=null&&(w=o.scale.map(j))!==null&&w!==void 0?w:null,y:b.y,payload:b.payload}}):N=g?d.scale.map(p):o.scale.map(p),{points:S,baseLine:N??0,isRange:y}}function Hr(t){var e=Me(t,is),r=Be();return v.createElement(ea,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(ta,{legendPayload:Tr(e)}),v.createElement(zr,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(sa,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:aa(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Vr,pe({},e,{id:a}))))}var os=v.memo(Hr,Zs);os.displayName="Area";var qr=["type"],Qr=["dangerouslySetInnerHTML","ticks","scale"],Xr=["id","scale"];function tt(){return tt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},tt.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Jr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Jr(t,e,r){return(e=Zr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zr(t){var e=el(t,"string");return typeof e=="symbol"?e:e+""}function el(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function st(t,e){if(t==null)return{};var r,a,n=tl(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tl(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function sl(t){var e=Yt(),r=v.useRef(null),a=Kt(),{type:n}=t,l=st(t,qr),i=Da(a,"yAxis",n),o=v.useMemo(()=>{if(i!=null)return Ct(Ct({},l),{},{type:i})},[i,l]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(Sa(o)):r.current!==o&&e(wa({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(Ca(r.current)),r.current=null)},[e]),null}function al(t){var{yAxisId:e,className:r,width:a,label:n}=t,l=v.useRef(null),i=v.useRef(null),o=fe(_a),d=Be(),m=Yt(),c="yAxis",u=fe(j=>ka(j,e)),f=fe(j=>Aa(j,e)),x=fe(j=>Pa(j,c,e,d)),h=fe(j=>Ia(j,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!u||Ea(n)||v.isValidElement(n)||h==null)){var j=l.current;if(j){var C=j.getCalculatedWidth();Math.round(u.width)!==Math.round(C)&&m(Oa({id:e,width:C}))}}},[x,u,m,n,e,a,h]),u==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:y}=t,S=st(t,Qr),{id:N,scale:b}=h,w=st(h,Xr);return v.createElement(La,tt({},S,w,{ref:l,labelRef:i,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:u.width,height:u.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c}))}var rl={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:ke.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:ke.tickLine,tickSize:ke.tickSize,type:J.type,width:J.width,yAxisId:0},ll=t=>{var e=Me(t,rl);return v.createElement(v.Fragment,null,v.createElement(sl,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter}),v.createElement(al,e))},cs=v.memo(ll,Na);cs.displayName="YAxis";var nl=["axis"],il=v.forwardRef((t,e)=>v.createElement(Ta,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:nl,tooltipPayloadSearcher:za,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function ut(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const n=new Date(r),l=t==="7d"?7:t==="30d"?30:90;return n.setDate(n.getDate()-l),{startDate:n.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function V(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const ds="gateway-chip-period";function ol(){try{const t=localStorage.getItem(ds);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function cl(t){try{localStorage.setItem(ds,t)}catch{}}const dl={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},ul={daily:"daily",weekly:"weekly",monthly:"monthly"},ml=[5,10,25,50,100],fl=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function xl(t){const e=I.c(51),{open:r,onOpenChange:a,connectionId:n,currentLimitUsd:l,billingMode:i,currentLimitPeriod:o}=t,{org:d}=me(),[m,c]=v.useState(null),[u,f]=v.useState(""),[x,h]=v.useState(null),[p,g]=v.useState(null),[y,S]=v.useState(o??"none");let N;e[0]!==n||e[1]!==d.id?(N={connectionId:n,orgId:d.id},e[0]=n,e[1]=d.id,e[2]=N):N=e[2];const b=_e(N);let w;e[3]!==b?(w={client:b},e[3]=b,e[4]=w):w=e[4];const{mutate:j,isPending:C}=qt(w),k=At(),_=i==="postpaid";let E;e[5]!==u?(E=u?Number.parseFloat(u):null,e[5]=u,e[6]=E):E=e[6];const A=m??E,L=y==="none"?null:y,O=_&&A!=null&&A===l&&L===o;let D;e[7]!==b?(D=Ua.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=D):D=e[8];const G=D;let K;e[9]!==G||e[10]!==k?(K=async()=>{await k.invalidateQueries({queryKey:G,exact:!0}),await k.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=k,e[11]=K):K=e[11];const F=K;let T,$;e[12]!==i||e[13]!==o||e[14]!==l||e[15]!==A||e[16]!==_||e[17]!==y||e[18]!==j||e[19]!==a||e[20]!==F?($=()=>{if(!A||A<=0)return;const B=_?A:l+A;g(null);const ae={limit_usd:B,billing_mode:i,return_url:window.location.href};_&&(ae.limit_period=y),j({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await F(),te?.checkout_url?h(te.checkout_url):T()},onError:re=>{g(re.message??"Failed to update limit.")}})},T=()=>{c(null),f(""),h(null),g(null),S(o??"none"),a(!1)},e[12]=i,e[13]=o,e[14]=l,e[15]=A,e[16]=_,e[17]=y,e[18]=j,e[19]=a,e[20]=F,e[21]=T,e[22]=$):(T=e[21],$=e[22]);const Y=_?"Configure Spending Limit":"Add Credit",H=_?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=_?"New limit":"Select amount",U=_?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(bs,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(js,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let R;e[27]!==q||e[28]!==ee?(R=s.jsxs(Ns,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=R):R=e[29];let W;e[30]!==M||e[31]!==x||e[32]!==U||e[33]!==l||e[34]!==u||e[35]!==A||e[36]!==p||e[37]!==$||e[38]!==C||e[39]!==_||e[40]!==O||e[41]!==y||e[42]!==m?(W=x?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(ce,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:x,children:[s.jsx(lt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(Ae,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:ml.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:ue("rounded-md border px-3 py-2 text-sm font-medium transition-colors",m===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Ae,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:_?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Ie,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:u,onChange:B=>{f(B.target.value),c(null)}})]})]}),_&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Ae,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:fl.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>S(ae),className:ue("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),p&&s.jsx("p",{className:"text-xs text-destructive",children:p}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:_?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:l>0?V(l):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:V(l)})]})}),s.jsx(ce,{onClick:$,disabled:C||!A||A<=0||O,className:"gap-2",children:C?"Updating...":U})]})]}),e[30]=M,e[31]=x,e[32]=U,e[33]=l,e[34]=u,e[35]=A,e[36]=p,e[37]=$,e[38]=C,e[39]=_,e[40]=O,e[41]=y,e[42]=m,e[43]=W):W=e[43];let Q;e[44]!==R||e[45]!==W?(Q=s.jsxs(Ot,{className:"sm:max-w-md",children:[R,W]}),e[44]=R,e[45]=W,e[46]=Q):Q=e[46];let se;return e[47]!==T||e[48]!==r||e[49]!==Q?(se=s.jsx(Lt,{open:r,onOpenChange:T,children:Q}),e[47]=T,e[48]=r,e[49]=Q,e[50]=se):se=e[50],se}function pl(t){const e=I.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:n,avgDailySpend:l}=r;if(a==null)return null;let i;e[0]!==n?(i=n?new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=n,e[1]=i):i=e[1];const o=i,d=a!==1?"s":"";let m;e[2]!==a||e[3]!==d?(m=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=u):u=e[7];let f;e[8]!==l?(f=V(l),e[8]=l,e[9]=f):f=e[9];let x;e[10]!==f?(x=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=x):x=e[11];let h;e[12]!==r.resetsBeforeDepletion?(h=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=h):h=e[13];const p=dl[r.confidence];let g;e[14]!==p?(g=s.jsx(Ra,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:p}),e[14]=p,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==m||e[18]!==c||e[19]!==x||e[20]!==h?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[m,c,u,x,h,g]}),e[16]=g,e[17]=m,e[18]=c,e[19]=x,e[20]=h,e[21]=y):y=e[21],y}function hl(t){const e=I.c(37),{usage:r,limit:a,limitPeriod:n,onConfigureLimit:l,connectionId:i,alert:o}=t,d=a.total!=null&&a.total>0;let m;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(m=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=m):m=e[3];const c=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=u):u=e[4];let f;e[5]!==r.total?(f=V(r.total),e[5]=r.total,e[6]=f):f=e[6];let x;e[7]!==f?(x=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=x):x=e[8];let h;e[9]!==d||e[10]!==a.total||e[11]!==n?(h=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",V(a.total)," limit",n&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(Fa,{size:10}),ul[n]]})]}),e[9]=d,e[10]=a.total,e[11]=n,e[12]=h):h=e[12];let p;e[13]!==d?(p=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=p):p=e[14];let g;e[15]!==x||e[16]!==h||e[17]!==p?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,x,h,p]}),e[15]=x,e[16]=h,e[17]=p,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ht,{size:16}),e[19]=y):y=e[19];const S=d?"Configure Limit":"Set Limit";let N;e[20]!==l||e[21]!==S?(N=s.jsxs(ce,{onClick:l,variant:"outline",className:"gap-2",children:[y,S]}),e[20]=l,e[21]=S,e[22]=N):N=e[22];let b;e[23]!==N||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,N]}),e[23]=N,e[24]=g,e[25]=b):b=e[25];let w;e[26]!==d||e[27]!==a.reset||e[28]!==c?(w=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:ue("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=w):w=e[29];let j;e[30]!==o||e[31]!==i?(j=s.jsx(us,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=j):j=e[32];let C;return e[33]!==b||e[34]!==w||e[35]!==j?(C=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,w,j]}),e[33]=b,e[34]=w,e[35]=j,e[36]=C):C=e[36],C}function gl(t){const e=I.c(30),{available:r,total:a,estimation:n,onAddCredit:l,connectionId:i,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=m):m=e[0];let c;e[1]!==r?(c=V(r),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=u):u=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",V(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let x;e[7]!==u||e[8]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,u,f]}),e[7]=u,e[8]=f,e[9]=x):x=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ht,{size:16}),e[10]=h):h=e[10];let p;e[11]!==l?(p=s.jsxs(ce,{onClick:l,className:"gap-2 px-5",children:[h,"Add Credit"]}),e[11]=l,e[12]=p):p=e[12];let g;e[13]!==x||e[14]!==p?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[x,p]}),e[13]=x,e[14]=p,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[V(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let S;e[20]!==n?(S=s.jsx(pl,{estimation:n}),e[20]=n,e[21]=S):S=e[21];let N;e[22]!==o||e[23]!==i?(N=s.jsx(us,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=N):N=e[24];let b;return e[25]!==S||e[26]!==N||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,S,N]}),e[25]=S,e[26]=N,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function us(t){const e=I.c(78),{connectionId:r,alert:a,billingMode:n}=t,{org:l}=me(),[i,o]=v.useState(!1),[d,m]=v.useState(a.enabled),[c,u]=v.useState(String(a.threshold_usd)),[f,x]=v.useState(a.email??""),[h,p]=v.useState(!1),[g,y]=v.useState(null);let S;e[0]!==r||e[1]!==l.id?(S={connectionId:r,orgId:l.id},e[0]=r,e[1]=l.id,e[2]=S):S=e[2];const N=_e(S);let b;e[3]!==N?(b={client:N},e[3]=N,e[4]=b):b=e[4];const{mutate:w,isPending:j}=qt(b),C=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let k;e[5]!==f||e[6]!==d||e[7]!==w||e[8]!==c?(k=()=>{y(null),p(!1);const X=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(X)||X<=0){y("Threshold must be a positive number.");return}w({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:X,...f?{email:f}:{}}},{onSuccess:()=>{p(!0),setTimeout(()=>p(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=w,e[8]=c,e[9]=k):k=e[9];const _=k,E=n==="postpaid"?"Usage Alert":"Low-Balance Alert",z=n==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>o(!0),e[10]=X):X=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx(Wa,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==E?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:E}),e[12]=E,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==n?(ve=a.enabled?n==="postpaid"?`Enabled · Alert at ${V(a.threshold_usd)}`:`Enabled · Alert below ${V(a.threshold_usd)}`:n==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=n,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Oe;return e[25]!==je||e[26]!==be?(Oe=s.jsxs("button",{type:"button",onClick:X,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Oe):Oe=e[27],Oe}let A;e[28]!==E?(A=s.jsx("p",{className:"text-xs font-medium text-foreground",children:E}),e[28]=E,e[29]=A):A=e[29];let L;e[30]!==z?(L=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:z}),e[30]=z,e[31]=L):L=e[31];let O;e[32]!==A||e[33]!==L?(O=s.jsxs("div",{children:[A,L]}),e[32]=A,e[33]=L,e[34]=O):O=e[34];let D;e[35]!==d?(D=s.jsx(Le,{checked:d,onCheckedChange:m}),e[35]=d,e[36]=D):D=e[36];let G;e[37]!==O||e[38]!==D?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[O,D]}),e[37]=O,e[38]=D,e[39]=G):G=e[39];const K=!d&&"opacity-50 pointer-events-none";let F;e[40]!==K?(F=ue("flex flex-col gap-3 transition-opacity",K),e[40]=K,e[41]=F):F=e[41];const T=n==="postpaid"?"Notify at":"Notify below";let $;e[42]!==T?($=s.jsx(Ae,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:T}),e[42]=T,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=X=>u(X.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Ie,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ae,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=X=>x(X.target.value),e[52]=ee):ee=e[52];let R;e[53]!==f?(R=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Ie,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=R):R=e[54];let W;e[55]!==U||e[56]!==R?(W=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,R]}),e[55]=U,e[56]=R,e[57]=W):W=e[57];let Q;e[58]!==g?(Q=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=Q):Q=e[59];let se;e[60]!==F||e[61]!==W||e[62]!==Q?(se=s.jsxs("div",{className:F,children:[W,Q]}),e[60]=F,e[61]=W,e[62]=Q,e[63]=se):se=e[63];let B;e[64]!==h?(B=h&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=h,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(ce,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=j||!C,te=j?"Saving...":"Save Alert";let le;e[67]!==_||e[68]!==re||e[69]!==te?(le=s.jsx(ce,{size:"sm",className:"h-7 text-xs",onClick:_,disabled:re,children:te}),e[67]=_,e[68]=re,e[69]=te,e[70]=le):le=e[70];let de;e[71]!==B||e[72]!==le?(de=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=de):de=e[73];let P;return e[74]!==se||e[75]!==de||e[76]!==G?(P=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,de]}),e[74]=se,e[75]=de,e[76]=G,e[77]=P):P=e[77],P}const vl={cost:{label:"Cost",color:"var(--chart-1)"}};function yl(){const t=I.c(54),{org:e}=me(),[r,a]=v.useState("30d");let n;t[0]!==r?(n=ut(r),t[0]=r,t[1]=n):n=t[1];const l=n;let i;t[2]!==e.id?(i={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=i):i=t[3];const o=_e(i);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let m;t[5]!==l?(m={widget:d,timeRange:l},t[5]=l,t[6]=m):m=t[6];let c;t[7]!==o||t[8]!==m?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:m,staleTime:6e4,select:Ce},t[7]=o,t[8]=m,t[9]=c):c=t[9];const{data:u}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let x;t[11]!==l?(x={widget:f,timeRange:l},t[11]=l,t[12]=x):x=t[12];let h;t[13]!==o||t[14]!==x?(h={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:x,staleTime:6e4,select:Ce},t[13]=o,t[14]=x,t[15]=h):h=t[15];const{data:p}=oe(h);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title"}},t[16]=g):g=t[16];let y;t[17]!==l?(y={widget:g,timeRange:l},t[17]=l,t[18]=y):y=t[18];let S;t[19]!==o||t[20]!==y?(S={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=S):S=t[21];const{data:N}=oe(S);let b;t[22]!==u?.timeseries?(b=u?.timeseries??[],t[22]=u?.timeseries,t[23]=b):b=t[23];let w;t[24]!==b?(w=b.map(Cl),t[24]=b,t[25]=w):w=t[25];const j=w;let C;if(t[26]!==p?.value||t[27]!==j||t[28]!==N?.groups||t[29]!==u?.timeseries||t[30]!==r){const k=(u?.timeseries??[]).reduce(wl,0),_=p?.value??0,E=(N?.groups??[]).filter(Sl).sort(Nl).slice(0,5),z=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let A;t[32]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=A):A=t[32];const L=V(k);let O;t[33]!==L?(O=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:L}),t[33]=L,t[34]=O):O=t[34];let D;t[35]!==z?(D=s.jsx("p",{className:"text-xs text-muted-foreground",children:z}),t[35]=z,t[36]=D):D=t[36];let G;t[37]!==O||t[38]!==D?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[O,D]}),t[37]=O,t[38]=D,t[39]=G):G=t[39];let K;t[40]!==_?(K=_.toLocaleString(),t[40]=_,t[41]=K):K=t[41];let F;t[42]!==K?(F=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[K," tool calls"]}),t[42]=K,t[43]=F):F=t[43];let T;t[44]!==G||t[45]!==F?(T=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[A,G,F]}),t[44]=G,t[45]=F,t[46]=T):T=t[46];let $;t[47]!==r?($=s.jsx(ms,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==T||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[T,$]}),t[49]=T,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==j?(H=j.length>0?s.jsx($a,{config:vl,className:"h-[200px] w-full",children:s.jsxs(il,{data:j,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Zt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Ma,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(cs,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:jl}),s.jsx(Ba,{content:s.jsx(Ga,{formatter:bl})}),s.jsx(os,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=j,t[53]=H):H=t[53],C=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,E.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:E.map((M,U)=>{const q=k>0?Math.min(M.value/k*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:V(M.value)})]},M.key)})})]})]}),t[26]=p?.value,t[27]=j,t[28]=N?.groups,t[29]=u?.timeseries,t[30]=r,t[31]=C}else C=t[31];return C}function bl(t){return V(t)}function jl(t){return`$${t}`}function Nl(t,e){return e.value-t.value}function Sl(t){return t.value>0}function wl(t,e){return t+e.value}function Cl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function _l(){const t=I.c(6),[e,r]=v.useState(ol);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{r(m),cl(m)},t[0]=a):a=t[0];const n=a;let l,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),i=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=l,t[2]=i):(l=t[1],i=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[l,i,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(m=>s.jsx("button",{type:"button",onClick:()=>n(m),className:ue("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===m?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:m},m))})]}),t[4]=e,t[5]=d):d=t[5],d}function Je(t){const e=I.c(20),{label:r,value:a,subValue:n,maxValue:l,color:i}=t,o=i===void 0?"bg-chart-1":i;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const m=d,c=l>0?Math.min(m/l*100,100):0;let u;e[2]!==r?(u=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==o?(f=ue("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const x=`${c}%`;let h;e[6]!==x?(h={width:x},e[6]=x,e[7]=h):h=e[7];let p;e[8]!==f||e[9]!==h?(p=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:h})}),e[8]=f,e[9]=h,e[10]=p):p=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==n?(y=n&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:n}),e[13]=n,e[14]=y):y=e[14];let S;return e[15]!==u||e[16]!==p||e[17]!==g||e[18]!==y?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[u,p,g,y]}),e[15]=u,e[16]=p,e[17]=g,e[18]=y,e[19]=S):S=e[19],S}function Ze(t){const e=I.c(8),{title:r,children:a,empty:n}=t;let l;e[0]!==r?(l=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=l):l=e[1];let i;e[2]!==a||e[3]!==n?(i=n?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==l||e[6]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[l,i]}),e[5]=l,e[6]=i,e[7]=o):o=e[7],o}const _t={"7d":"7 days","30d":"30 days","90d":"90 days"};function ms(t){const e=I.c(4),{period:r,onPeriodChange:a}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Object.keys(_t),e[0]=n):n=e[0];let l;return e[1]!==a||e[2]!==r?(l=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:n.map(i=>s.jsx("button",{type:"button",onClick:()=>a(i),className:ue("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:_t[i]},i))}),e[1]=a,e[2]=r,e[3]=l):l=e[3],l}function kt(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,n)=>n.cost-a.cost)}function kl(){const t=I.c(27),{org:e}=me(),[r,a]=v.useState("30d"),n=ut(r),{data:l}=Ka(),i=l?.data?.members??[],o=new Map(i.map(Ll));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const m=_e(d),c=P=>({client:m,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:P.fn,...P.groupByColumn&&{groupByColumn:P.groupByColumn}}},timeRange:n},staleTime:6e4,select:Ce}),{data:u,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title"})),{data:x,isLoading:h}=oe(c({fn:"count_all",groupByColumn:"connection_title"})),{data:p,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id"})),{data:y,isLoading:S}=oe(c({fn:"count_all",groupByColumn:"user_id"})),{data:N,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name"}));let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w={fn:"count_all",groupByColumn:"tool_name"},t[2]=w):w=t[2];const{data:j,isLoading:C}=oe(c(w));if(f||h||g||S||b||C){let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-8 w-48"}),t[3]=P):P=t[3];let X;return t[4]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs("div",{className:"flex flex-col gap-4",children:[P,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(Ol)})]}),t[4]=X):X=t[4],X}const _=kt(u?.groups??[],x?.groups??[]),E=kt(p?.groups??[],y?.groups??[]).map(P=>({...P,key:o.get(P.key)??P.key})),z=j?.groups??[],A=new Map((N?.groups??[]).map(El)),L=z.map(P=>({name:P.key,calls:P.value,cost:A.get(P.key)??0})).sort(Il).slice(0,20),O=_.reduce(Pl,0),D=_.reduce(Al,0),G=_[0]?.cost??1,K=E[0]?.cost??1,F=L[0]?.calls??1;let T;t[5]!==r?(T=s.jsx(ms,{period:r,onPeriodChange:a}),t[5]=r,t[6]=T):T=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=_.length===0,H=_.slice(0,8).map(P=>s.jsx(Je,{label:P.key,value:V(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},P.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Ze,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=E.length===0,ee=E.slice(0,8).map(P=>s.jsx(Je,{label:P.key,value:V(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:K,color:"bg-chart-4"},P.key));let R;t[12]!==ee?(R=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=R):R=t[13];let W;t[14]!==R||t[15]!==q?(W=s.jsx(Ze,{title:"Cost by User",empty:q,children:R}),t[14]=R,t[15]=q,t[16]=W):W=t[16];const Q=Ze,se="Top Tools",B=L.length===0,ae="space-y-2.5",re=L.slice(0,8).map(P=>s.jsx(Je,{label:P.name,value:P.calls.toLocaleString(),subValue:P.cost>0?V(P.cost):void 0,maxValue:F,color:"bg-chart-3"},P.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==Q||t[20]!==B||t[21]!==te?(le=s.jsx(Q,{title:se,empty:B,children:te}),t[19]=Q,t[20]=B,t[21]=te,t[22]=le):le=t[22];let de;return t[23]!==W||t[24]!==le||t[25]!==U?(de=s.jsxs("div",{className:$,children:[U,W,le]}),t[23]=W,t[24]=le,t[25]=U,t[26]=de):de=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:V(O)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:D.toLocaleString()})]})]}),T]}),de]})}function Al(t,e){return t+e.calls}function Pl(t,e){return t+e.cost}function Il(t,e){return e.calls-t.calls}function El(t){return[t.key,t.value]}function Ol(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function Ll(t){return[t.userId,t.user.name??t.user.email]}function Dl(t,e){const r=new Map;for(const a of t){const l=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(l)??{cost:0,calls:0};r.set(l,{cost:i.cost+a.value,calls:i.calls})}for(const a of e){const l=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(l)??{cost:0,calls:0};r.set(l,{cost:i.cost,calls:i.calls+a.value})}return Array.from(r.entries()).map(([a,n])=>({month:a,...n})).reverse()}function Tl(){const t=I.c(27),{org:e}=me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=ut("90d"),t[0]=r):r=t[0];const a=r;let n;t[1]!==e.id?(n={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=n):n=t[2];const l=_e(n);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a},t[3]=i):i=t[3];let o;t[4]!==l?(o={client:l,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:i,staleTime:6e4,select:Ce},t[4]=l,t[5]=o):o=t[5];const{data:d,isLoading:m}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a},t[6]=c):c=t[6];let u;t[7]!==l?(u={client:l,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=l,t[8]=u):u=t[8];const{data:f,isLoading:x}=oe(u);if(m||x){let w;return t[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ne,{className:"h-8 w-48"}),s.jsx(ne,{className:"h-48 rounded-xl"})]}),t[9]=w):w=t[9],w}let h,p,g,y,S;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const w=Dl(d?.timeseries??[],f?.timeseries??[]);S="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=h):h=t[17],p="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=w.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:w.map(zl)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=h,t[13]=p,t[14]=g,t[15]=y,t[16]=S}else h=t[12],p=t[13],g=t[14],y=t[15],S=t[16];let N;t[19]!==p||t[20]!==g||t[21]!==y?(N=s.jsxs("div",{className:p,children:[g,y]}),t[19]=p,t[20]=g,t[21]=y,t[22]=N):N=t[22];let b;return t[23]!==h||t[24]!==N||t[25]!==S?(b=s.jsxs("div",{className:S,children:[h,N]}),t[23]=h,t[24]=N,t[25]=S,t[26]=b):b=t[26],b}function zl(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:V(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function $l(t){const e=I.c(31),{connectionId:r}=t,{org:a}=me(),[n,l]=v.useState(!1);let i;e[0]!==r||e[1]!==a.id?(i={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=i):i=e[2];const o=_e(i);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let m;e[4]!==o?(m={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Ml},e[4]=o,e[5]=m):m=e[5];const{data:c,isLoading:u}=oe(m);if(u){let E;return e[6]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=E):E=e[6],E}if(!c)return null;const f=c.limit.remaining??0,x=c.limit.total??0,h=c.usage,p=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let S;e[7]!==c.alert?(S=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=S):S=e[8];const N=S,b=c.limit,w=p==="postpaid"&&(x==null||x===0);let j;e[9]!==N||e[10]!==f||e[11]!==p||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==x||e[17]!==h?(j=p==="postpaid"?s.jsx(hl,{usage:h,limit:b,limitPeriod:g,onConfigureLimit:()=>l(!0),connectionId:r,alert:N}):s.jsx(gl,{available:f,total:x,estimation:y,onAddCredit:()=>l(!0),connectionId:r,alert:N}),e[9]=N,e[10]=f,e[11]=p,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=x,e[17]=h,e[18]=j):j=e[18];let C;e[19]!==w?(C=w&&s.jsx(_l,{}),e[19]=w,e[20]=C):C=e[20];let k;e[21]!==p||e[22]!==r||e[23]!==n||e[24]!==g||e[25]!==x?(k=s.jsx(xl,{open:n,onOpenChange:l,connectionId:r,currentLimitUsd:x,billingMode:p,currentLimitPeriod:g}),e[21]=p,e[22]=r,e[23]=n,e[24]=g,e[25]=x,e[26]=k):k=e[26];let _;return e[27]!==j||e[28]!==C||e[29]!==k?(_=s.jsxs(s.Fragment,{children:[j,C,k]}),e[27]=j,e[28]=C,e[29]=k,e[30]=_):_=e[30],_}function Ml(t){return t.structuredContent}function Bl(t){const e=I.c(11),{gatewayConnectionId:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=a):a=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(Ms,{variant:"underline",children:[s.jsx(Fe,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(Fe,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(Fe,{value:"history",variant:"underline",children:"History"})]}),e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&s.jsx($l,{connectionId:r}),e[2]=r,e[3]=l):l=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(yl,{}),e[4]=i):i=e[4];let o;e[5]!==l?(o=s.jsxs(Ue,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[l,i]}),e[5]=l,e[6]=o):o=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ue,{value:"breakdown",className:"pt-2",children:s.jsx(kl,{})}),e[7]=d):d=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ue,{value:"history",className:"pt-2",children:s.jsx(Tl,{})}),e[8]=m):m=e[8];let c;return e[9]!==o?(c=s.jsxs(s.Fragment,{children:[a,s.jsxs(Bs,{defaultValue:"summary",variant:"underline",children:[n,o,d,m]})]}),e[9]=o,e[10]=c):c=e[10],c}function Gl(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ne,{className:"h-5 w-32"}),s.jsx(ne,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ne,{className:"h-28 rounded-xl"}),s.jsx(ne,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Rl(){const t=I.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(lt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class Wl extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(Rl,{}):this.props.children}}function Fl(){const t=I.c(4),e=Va();let r;t[0]!==e?(r=e.find(Ul),t[0]=e,t[1]=r):r=t[1];const n=r?.id??null;let l;return t[2]!==n?(l=s.jsx(Bl,{gatewayConnectionId:n}),t[2]=n,t[3]=l):l=t[3],l}function Ul(t){return Ya(t,Ha)}function Vl(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(Wl,{children:s.jsx(v.Suspense,{fallback:s.jsx(Gl,{}),children:s.jsx(Fl,{})})})}),t[0]=e):e=t[0],e}function fs(){const t=I.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"h-6 w-48"}),r=s.jsx(ne,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ne,{className:"h-12 w-full"}),s.jsx(ne,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Kl(t){const e=I.c(14),{projectSlug:r,children:a}=t,{org:n}=me(),{data:l,isLoading:i}=Et(n.id,r);if(i||!l){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(fs,{}),e[0]=u):u=e[0],u}const o=r===Ee;let d;e[1]!==l.description||e[2]!==l.enabledPlugins||e[3]!==l.id||e[4]!==l.name||e[5]!==l.organizationId||e[6]!==l.slug||e[7]!==l.ui||e[8]!==o?(d={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:o},e[1]=l.description,e[2]=l.enabledPlugins,e[3]=l.id,e[4]=l.name,e[5]=l.organizationId,e[6]=l.slug,e[7]=l.ui,e[8]=o,e[9]=d):d=e[9];const m=d;let c;return e[10]!==a||e[11]!==m||e[12]!==n?(c=s.jsx(It,{org:n,project:m,children:a}),e[10]=a,e[11]=m,e[12]=n,e[13]=c):c=e[13],c}function Yl(t){const e=I.c(7),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Qa,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"account.experimental":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(sr,{}),e[2]=a):a=e[2],a}case"org.general":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(nr,{}),e[3]=a):a=e[3],a}case"org.plugins":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Kl,{projectSlug:Ee,children:s.jsx(Us,{})}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Vl,{}),e[5]=a):a=e[5],a}default:{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[6]=a):a=e[6],a}}}function Hl(){const t=I.c(23),{isOpen:e,activeSection:r,open:a,close:n}=ws();let l;t[0]!==n?(l=g=>!g&&n(),t[0]=n,t[1]=l):l=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=i):i=t[2];let o;t[3]!==r||t[4]!==a?(o=s.jsx(v.Suspense,{fallback:i,children:s.jsx(qa,{activeSection:r,onNavigate:a})}),t[3]=r,t[4]=a,t[5]=o):o=t[5];let d,m;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Dt,{size:16}),m=s.jsx("span",{className:"sr-only",children:"Close"}),t[6]=d,t[7]=m):(d=t[6],m=t[7]);let c;t[8]!==n?(c=s.jsxs("button",{type:"button",onClick:n,className:"sticky top-4 float-right mr-4 mt-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[d,m]}),t[8]=n,t[9]=c):c=t[9];let u;t[10]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(fs,{}),t[10]=u):u=t[10];let f;t[11]!==r?(f=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:u,children:s.jsx(Yl,{section:r})})}),t[11]=r,t[12]=f):f=t[12];let x;t[13]!==c||t[14]!==f?(x=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[c,f]}),t[13]=c,t[14]=f,t[15]=x):x=t[15];let h;t[16]!==o||t[17]!==x?(h=s.jsx(Ot,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=h):h=t[18];let p;return t[19]!==e||t[20]!==l||t[21]!==h?(p=s.jsx(Lt,{open:e,onOpenChange:l,children:h}),t[19]=e,t[20]=l,t[21]=h,t[22]=p):p=t[22],p}function ql(t){const e=I.c(12),{projectSlug:r,orgSlug:a,error:n}=t,l=rt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==n.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:n.message}),e[3]=n.message,e[4]=d):d=e[4];let m;e[5]!==l||e[6]!==a?(m=s.jsx(ce,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[5]=l,e[6]=a,e[7]=m):m=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==m?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,o,d,m]}),e[8]=o,e[9]=d,e[10]=m,e[11]=c):c=e[11],c}function Ql(t){const e=I.c(9),{projectSlug:r,orgSlug:a}=t,n=rt();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=l):l=e[0];let i;e[1]!==r?(i=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==n||e[4]!==a?(o=s.jsx(ce,{variant:"link",onClick:()=>n({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[3]=n,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function Xl(){const t=I.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=vs(e),{org:a}=me(),n=r.org,l=r.project,{data:i,isLoading:o,error:d}=Et(a.id,l);if(o){let p;return t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(et,{}),t[1]=p):p=t[1],p}if(d){let p;return t[2]!==d||t[3]!==n||t[4]!==l?(p=s.jsx(ql,{projectSlug:l,orgSlug:n,error:d}),t[2]=d,t[3]=n,t[4]=l,t[5]=p):p=t[5],p}if(!i){let p;return t[6]!==n||t[7]!==l?(p=s.jsx(Ql,{projectSlug:l,orgSlug:n}),t[6]=n,t[7]=l,t[8]=p):p=t[8],p}const m=i.slug===Ee;let c;t[9]!==i.description||t[10]!==i.enabledPlugins||t[11]!==i.id||t[12]!==i.name||t[13]!==i.organizationId||t[14]!==i.slug||t[15]!==i.ui||t[16]!==m?(c={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:m},t[9]=i.description,t[10]=i.enabledPlugins,t[11]=i.id,t[12]=i.name,t[13]=i.organizationId,t[14]=i.slug,t[15]=i.ui,t[16]=m,t[17]=c):c=t[17];const u=c;let f,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(ys,{})}),x=s.jsx(Hl,{}),t[18]=f,t[19]=x):(f=t[18],x=t[19]);let h;return t[20]!==u||t[21]!==a?(h=s.jsxs(It,{org:a,project:u,children:[f,x]}),t[20]=u,t[21]=a,t[22]=h):h=t[22],h}function Kn(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(Xl,{})}),t[0]=e):e=t[0],e}export{Kn as default};
@@ -1,3 +0,0 @@
1
- import{r as E,c as _,j as s,E as Ue,u as ve,v as I,b as Be,aC as Fe,L as Oe,c5 as gt,ba as bt,O as F,aA as jt,a8 as vt,aa as Nt,ab as yt,a9 as St,ac as kt,ae as Ct,ad as _t,w as wt,z as $t,e as qe,d as pe,t as ue,c6 as zt,bB as It,n as Pt,B as Te,A as At,S as Ye,f as Et,h as Ot,N as Tt,m as Mt,K as Dt,aE as Qe,P as Rt}from"./index-xQ2t379n.js";import{C as J}from"./index-D3pPaynQ.js";import{I as Lt}from"./integration-icon-CyNzGslP.js";import{u as Ze,P as de}from"./index-C79VipEf.js";import{d as Ht,u as Ut}from"./constants-BLSLjUCX.js";import{n as Me}from"./CheckDone01-BMlUtSk0.js";import{n as Bt}from"./ChevronLeft-LqDMtl3T.js";import{i as Ft}from"./Loading01-BWjBCSBL.js";import{s as Se}from"./Plus-CK3qvOs-.js";import{t as We}from"./Users03-C4-0uA3w.js";import{i as De}from"./X-C0j62Xtl.js";import{E as Wt,C as Gt}from"./editable-task-title-CQx9B12m.js";import{T as Kt}from"./tasks-panel-Bcd4i-z8.js";import{a as Vt,e as qt,C as Yt,d as Qt,f as Zt}from"./collapsible-CpgZSwBN.js";import{C as Xe}from"./create-project-dialog-CBSHMrrx.js";import{u as Ae}from"./tabs-DN8uQx_4.js";import{t as Je,u as et,i as Xt}from"./use-settings-modal-D18j_l44.js";import{n as Jt}from"./Container-nefPC-Vi.js";import{e as es}from"./Dataflow03-DMAzBi98.js";import{a as ts}from"./Home02-Do5D--q6.js";import{i as Re}from"./LayoutLeft-CuouUkb7.js";import{t as Ce}from"./Settings01-Bhz_Vu7B.js";import{u as tt,a as st}from"./use-project-BUsmU3t_.js";import{u as ss}from"./use-mobile-CZlm25dt.js";import{c as ns,b as is,a as as,T as ls}from"./tooltip-B6yKYOIf.js";import{S as ee}from"./skeleton-Ct9swv0n.js";import{n as ge}from"./LinkExternal01-3GykVej2.js";import{t as nt}from"./ChevronDown-B8UJn4iH.js";import{A as be}from"./avatar-DNxsCl6r.js";import{c as q,g as ke,d as os,e as rs,f as cs,b as it,D as at,a as lt}from"./dropdown-menu-BBy53YtY.js";import{i as je}from"./Check-Dy5Jwsdl.js";import{C as ds}from"./create-organization-dialog-_OZHP19d.js";import{a as ms}from"./Copy01-DTrKcR-Q.js";import{i as fs}from"./File06-CJFI46Rj.js";import{i as us}from"./Globe01-CFu5KWUK.js";import{i as ps}from"./Shield01-B4VkgvZ4.js";import{P as xs,b as hs,a as gs}from"./popover-BGz1EQnh.js";import{n as Ve}from"./Inbox01-DFatNHSu.js";import{s as bs}from"./XClose-BoXt6_S8.js";import{h as js}from"./use-connection-Dtj63U01.js";import{b as vs}from"./use-mcp-tools-DScmBuoc.js";import{c as Ns,A as ys}from"./use-binding-BSjPQ0Be.js";import{i as Ss}from"./ChevronRight-UHmTzu6U.js";import{u as Ge,L as Ke}from"./localstorage-keys-BVjc41qz.js";import{a as ks,R as ot,b as Cs}from"./resizable-BeoLLDMu.js";import"./spinner-DfUcLZCl.js";import"./decopilot-events-BEPzMc6y.js";import"./useQuery-BLe-0FCm.js";import"./dialog-BEh9NHdw.js";import"./form-DKOen-4i.js";import"./label-DgKgIZIr.js";import"./input-CquIDQAg.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-B2lliNjJ.js";import"./Edit01-CMeQdBcS.js";import"./XCircle-BtpMj0Vx.js";import"./AlertCircle-BmterM6-.js";import"./select-CDsJtNMV.js";import"./index-CrfXnuko.js";import"./ArrowLeft-BwnRcCxk.js";import"./use-copy-oq5GkYwB.js";import"./badge-D8RzvYJ4.js";import"./Code01-Ce_GLriH.js";import"./use-virtual-mcp-COkdNvVv.js";import"./SearchMd-CpD1Xdqo.js";import"./use-create-virtual-mcp-COKyzJBE.js";import"./use-mcp-resources-B792gs6l.js";import"./marked.esm-BaswSlok.js";import"./markdown-Ba8nOSsK.js";import"./mcp-app-renderer-DYp1_awD.js";import"./types-CnPYT6I7.js";import"./Eye-DxLOh0i-.js";import"./Globe02-KBI1AO62.js";import"./LayersTwo01-D3z_72X4.js";import"./collection-search-Cq4rjP0Z.js";import"./generate-id-Dyweu44Y.js";import"./Clock-CHKtyQRJ.js";import"./Trash01-p1zJKNMp.js";import"./CheckCircle-DCJamcsS.js";import"./user-CI081yAV.js";import"./format-time-CMKyl-GC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-llm-5n5wwCT_.js";import"./checkbox-CUOTkCKW.js";import"./AlignLeft-D-24Asic.js";import"./Image01-C8E_92eh.js";import"./RefreshCcw01-DCU1xktc.js";import"./useSuspenseInfiniteQuery-D0p_NlPn.js";import"./infiniteQueryObserver-bwcxH-lX.js";import"./useMutation-tQLZk7P3.js";import"./textarea-BvEkv28R.js";import"./alert-dialog-D1XudKG9.js";import"./binder-Blih3Yob.js";const rt=({size:t=24,color:e="currentColor",...n})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},E.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));rt.displayName="BarChart10";const ct=({size:t=24,color:e="currentColor",...n})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},E.createElement("path",{d:"M8 14s1.5 2 4 2 4-2 4-2m-1-5h.01M9 9h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-6.5-3a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-6 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z"}));ct.displayName="FaceSmile";const dt=({size:t=24,color:e="currentColor",...n})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},E.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));dt.displayName="LogOut01";function _s(){const t=_.c(72),{org:e}=ve(),[,n]=Ze(),{selectedVirtualMcp:i,modelsConnections:a,isChatEmpty:l,activeTaskId:o,createTask:r,switchToTask:c,tasks:d}=Vt();let f;if(t[0]!==o||t[1]!==d){let K;t[3]!==o?(K=ne=>ne.id===o,t[3]=o,t[4]=K):K=t[4],f=d.find(K),t[0]=o,t[1]=d,t[2]=f}else f=t[2];const u=f,[m,x]=E.useState("chat"),[h,b]=E.useTransition();let g;t[5]!==e.id?(g=Ht(e.id),t[5]=e.id,t[6]=g):g=t[6];const v=i??g;let p;t[7]!==r?(p=()=>{b(()=>{r()})},t[7]=r,t[8]=p):p=t[8];const S=p;if(a.length===0){let K;t[9]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(de.Header.Left,{className:"gap-2"}),t[9]=K):K=t[9];let ne;t[10]!==n?(ne=()=>n(!1),t[10]=n,t[11]=ne):ne=t[11];let he;t[12]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(De,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[12]=he):he=t[12];let le;t[13]!==ne?(le=s.jsxs(de.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[K,s.jsx(de.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:ne,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:he})})]}),t[13]=ne,t[14]=le):le=t[14];let oe;t[15]!==e?(oe=s.jsx(J.Main,{className:"flex flex-col items-center",children:s.jsx(J.EmptyState,{children:s.jsx(J.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[15]=e,t[16]=oe):oe=t[16];let Ne;return t[17]!==le||t[18]!==oe?(Ne=s.jsxs(J,{className:"animate-in fade-in-0 duration-200",children:[le,oe]}),t[17]=le,t[18]=oe,t[19]=Ne):Ne=t[19],Ne}const N=m!=="chat"||h?"opacity-0 pointer-events-none":"opacity-100";let j;t[20]!==N?(j=I("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",N),t[20]=N,t[21]=j):j=t[21];let y;t[22]!==u||t[23]!==l?(y=!l&&u?.title&&s.jsx(Wt,{taskId:u.id,text:u.title,className:"text-sm font-medium text-foreground"}),t[22]=u,t[23]=l,t[24]=y):y=t[24];let w;t[25]!==y?(w=s.jsx(de.Header.Left,{className:"gap-2",children:y}),t[25]=y,t[26]=w):w=t[26];let $;t[27]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[27]=$):$=t[27];let k;t[28]!==S||t[29]!==h?(k=s.jsx("button",{type:"button",onClick:S,disabled:h,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:$}),t[28]=S,t[29]=h,t[30]=k):k=t[30];let A;t[31]===Symbol.for("react.memo_cache_sentinel")?(A=()=>x("tasks"),t[31]=A):A=t[31];let T;t[32]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("button",{type:"button",onClick:A,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Tasks",children:s.jsx(Me,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[32]=T):T=t[32];let L;t[33]!==n?(L=()=>n(!1),t[33]=n,t[34]=L):L=t[34];let U;t[35]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(De,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[35]=U):U=t[35];let H;t[36]!==L?(H=s.jsx("button",{type:"button",onClick:L,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:U}),t[36]=L,t[37]=H):H=t[37];let M;t[38]!==H||t[39]!==k?(M=s.jsxs(de.Header.Right,{className:"gap-1",children:[k,T,H]}),t[38]=H,t[39]=k,t[40]=M):M=t[40];let D;t[41]!==M||t[42]!==w?(D=s.jsxs(de.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[w,M]}),t[41]=M,t[42]=w,t[43]=D):D=t[43];let O;t[44]!==v||t[45]!==l?(O=s.jsx(J.Main,{children:l?s.jsx(J.EmptyState,{children:s.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[s.jsx(Lt,{icon:v.icon,name:v.title,size:"lg",fallbackIcon:s.jsx(We,{size:32}),className:"size-[60px]! rounded-[18px]!"}),s.jsx("h3",{className:"text-xl font-medium text-foreground",children:v.title}),s.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:v.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),s.jsx(J.IceBreakers,{})]})}):s.jsx(J.Messages,{})}),t[44]=v,t[45]=l,t[46]=O):O=t[46];let B;t[47]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(J.Footer,{children:s.jsx(J.Input,{onOpenContextPanel:()=>x("context")})}),t[47]=B):B=t[47];let R;t[48]!==D||t[49]!==O||t[50]!==j?(R=s.jsxs("div",{className:j,children:[D,O,B]}),t[48]=D,t[49]=O,t[50]=j,t[51]=R):R=t[51];const V=m==="tasks"?"opacity-100":"opacity-0 pointer-events-none";let ce;t[52]!==V?(ce=I("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",V),t[52]=V,t[53]=ce):ce=t[53];let te;t[54]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(de.Header.Left,{className:"gap-2",children:s.jsx("span",{className:"text-sm font-normal text-foreground",children:"Tasks"})}),t[54]=te):te=t[54];let se;t[55]===Symbol.for("react.memo_cache_sentinel")?(se=()=>x("chat"),t[55]=se):se=t[55];let Y;t[56]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsxs(de.Header,{className:"flex-none",hideSidebarTrigger:!0,children:[te,s.jsx(de.Header.Right,{className:"gap-1",children:s.jsx("button",{type:"button",onClick:se,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Back to chat",children:s.jsx(Bt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})})]}),t[56]=Y):Y=t[56];let Q;t[57]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Ft,{size:16,className:"animate-spin text-muted-foreground"})}),t[57]=Q):Q=t[57];let W;t[58]!==c?(W=s.jsx(Ue,{fallback:ws,children:s.jsx(E.Suspense,{fallback:Q,children:s.jsx(Kt,{onTaskSelect:async K=>{await c(K),x("chat")}})})}),t[58]=c,t[59]=W):W=t[59];let G;t[60]!==ce||t[61]!==W?(G=s.jsxs("div",{className:ce,children:[Y,W]}),t[60]=ce,t[61]=W,t[62]=G):G=t[62];const P=m==="context"?"opacity-100":"opacity-0 pointer-events-none";let Z;t[63]!==P?(Z=I("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",P),t[63]=P,t[64]=Z):Z=t[64];let xe;t[65]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx(Gt,{back:!0,onClose:()=>x("chat")}),t[65]=xe):xe=t[65];let ie;t[66]!==Z?(ie=s.jsx("div",{className:Z,children:xe}),t[66]=Z,t[67]=ie):ie=t[67];let ae;return t[68]!==R||t[69]!==G||t[70]!==ie?(ae=s.jsxs(J,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[R,G,ie]}),t[68]=R,t[69]=G,t[70]=ie,t[71]=ae):ae=t[71],ae}function ws(){return s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Unable to load tasks"})})}function $s(){const t=_.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(J.Skeleton,{}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ue,{fallback:e,children:s.jsx(E.Suspense,{fallback:s.jsx(J.Skeleton,{}),children:s.jsx(_s,{})})}),t[1]=n):n=t[1],n}function zs(){const t=_.c(58),[e]=Ae(),{locator:n,org:i}=ve(),a=Be(),l=Fe(),{org:o,project:r}=Oe.parse(n),c=Oe.isOrgAdminProject(n),{data:d}=tt(i.id,r);let f;t[0]!==d?.enabledPlugins?(f=d?.enabledPlugins??[],t[0]=d?.enabledPlugins,t[1]=f):f=t[1];const u=f,m=d?.ui?.pinnedViews??[];let x;t[2]!==u?(x=z=>u.includes(z.pluginId),t[2]=u,t[3]=x):x=t[3];const h=gt.filter(x),b=l.location.pathname,g=`/${o}/${r}`,C=b===g||b===`${g}/`;let v;t[4]!==g||t[5]!==b?(v=z=>b.startsWith(`${g}/${z}`),t[4]=g,t[5]=b,t[6]=v):v=t[6];const p=v;let S;t[7]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ts,{}),t[7]=S):S=t[7];const N={key:"home",label:"Home",icon:S,isActive:C,onClick:()=>{C?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org/$project",params:{org:o,project:r}})}};let j;t[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Me,{}),t[8]=j):j=t[8];const y={key:"tasks",label:"Tasks",icon:j,isActive:p("tasks"),onClick:()=>a({to:"/$org/$project/tasks",params:{org:o,project:F}})};let w;t[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Jt,{}),t[9]=w):w=t[9];const $={key:"mcps",label:"Connections",icon:w,isActive:p("mcps"),onClick:()=>a({to:"/$org/$project/mcps",params:{org:o,project:F}})};let k;t[10]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(jt,{}),t[10]=k):k=t[10];const A={key:"projects",label:"Projects",icon:k,isActive:p("projects"),onClick:()=>a({to:"/$org/$project/projects",params:{org:o,project:F}})};let T;t[11]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Je,{}),t[11]=T):T=t[11];const L={key:"store",label:"Store",icon:T,isActive:p("store"),onClick:()=>a({to:"/$org/$project/store",params:{org:o,project:F}})};let U;t[12]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(We,{}),t[12]=U):U=t[12];const H={key:"agents",label:"Agents",icon:U,isActive:p("agents"),onClick:()=>a({to:"/$org/$project/agents",params:{org:o,project:F}})};let M;t[13]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(rt,{}),t[13]=M):M=t[13];const D={key:"monitoring",label:"Monitor",icon:M,isActive:p("monitoring"),onClick:()=>a({to:"/$org/$project/monitoring",params:{org:o,project:F}})};let O;t[14]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(ct,{}),t[14]=O):O=t[14];const B={key:"members",label:"Members",icon:O,isActive:p("members"),onClick:()=>a({to:"/$org/$project/members",params:{org:o,project:F}})},R=h.map(z=>({key:z.pluginId,label:z.label,icon:z.icon,isActive:p(z.pluginId),onClick:()=>a({to:"/$org/$project/$pluginId",params:{org:o,project:r,pluginId:z.pluginId}})}));let V;t[15]!==u?(V=z=>u.includes(z.pluginId),t[15]=u,t[16]=V):V=t[16];const te=bt.filter(V).map(z=>({type:"group",group:{id:`${z.pluginId}-${z.id}`,label:z.label,items:z.items.map((X,fe)=>({key:`${z.pluginId}-${z.id}-${fe}`,label:X.label,icon:X.icon,isActive:p(z.pluginId),onClick:()=>a({to:"/$org/$project/$pluginId",params:{org:o,project:r,pluginId:z.pluginId}})})),defaultExpanded:z.defaultExpanded??!0}})),se=m.map(z=>({key:`app-${z.connectionId}-${z.toolName}`,label:z.label||z.toolName,icon:z.icon?s.jsx("img",{src:z.icon,alt:"",className:"size-4 rounded"}):s.jsx(Re,{}),isActive:p(`apps/${z.connectionId}/${encodeURIComponent(z.toolName)}`),onClick:()=>a({to:"/$org/$project/apps/$connectionId/$toolName",params:{org:o,project:r,connectionId:z.connectionId,toolName:z.toolName}})}));let Y;t[17]!==se?(Y=se.length>0?{type:"group",group:{id:"apps",label:"Apps",items:se,defaultExpanded:!0}}:null,t[17]=se,t[18]=Y):Y=t[18];const Q=Y;if(c){let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ce,{}),t[19]=z):z=t[19];let X;t[20]!==p?(X=p("settings"),t[20]=p,t[21]=X):X=t[21];let fe;t[22]!==a||t[23]!==o?(fe=()=>a({to:"/$org/$project/settings",params:{org:o,project:F}}),t[22]=a,t[23]=o,t[24]=fe):fe=t[24];let ze;t[25]!==X||t[26]!==fe?(ze={key:"settings",label:"Settings",icon:z,isActive:X,onClick:fe},t[25]=X,t[26]=fe,t[27]=ze):ze=t[27];const ht=ze,Ie=[{type:"items",items:[N,y,...e.experimental_projects?[A]:[]]},{type:"group",group:{id:"build",label:"Build",items:[H,$,L],defaultExpanded:!0}},{type:"group",group:{id:"manage",label:"Manage",items:[D,B,ht],defaultExpanded:!0}}];if(R.length>0){let Pe;t[28]!==R?(Pe={type:"items",items:R},t[28]=R,t[29]=Pe):Pe=t[29],Ie.push(Pe)}return te.length>0&&Ie.push(...te),Q&&Ie.push(Q),Ie}let W;t[30]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Me,{}),t[30]=W):W=t[30];let G;t[31]!==p?(G=p("tasks"),t[31]=p,t[32]=G):G=t[32];let P;t[33]!==a||t[34]!==o||t[35]!==r?(P=()=>a({to:"/$org/$project/tasks",params:{org:o,project:r}}),t[33]=a,t[34]=o,t[35]=r,t[36]=P):P=t[36];let Z;t[37]!==G||t[38]!==P?(Z={key:"tasks",label:"Tasks",icon:W,isActive:G,onClick:P},t[37]=G,t[38]=P,t[39]=Z):Z=t[39];const xe=Z;let ie;t[40]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(es,{}),t[40]=ie):ie=t[40];let ae;t[41]!==p?(ae=p("workflows"),t[41]=p,t[42]=ae):ae=t[42];let K;t[43]!==a||t[44]!==o||t[45]!==r?(K=()=>a({to:"/$org/$project/workflows",params:{org:o,project:r}}),t[43]=a,t[44]=o,t[45]=r,t[46]=K):K=t[46];let ne;t[47]!==ae||t[48]!==K?(ne={key:"workflows",label:"Workflows",icon:ie,isActive:ae,onClick:K},t[47]=ae,t[48]=K,t[49]=ne):ne=t[49];const he=ne;let le;t[50]===Symbol.for("react.memo_cache_sentinel")?(le=s.jsx(Ce,{}),t[50]=le):le=t[50];let oe;t[51]!==a||t[52]!==o||t[53]!==r?(oe={key:"configure",label:"Configure",icon:le,isActive:!1,isExternal:!0,onClick:()=>a({to:"/$org/$project/projects/$slug/settings/general",params:{org:o,project:F,slug:r}})},t[51]=a,t[52]=o,t[53]=r,t[54]=oe):oe=t[54];const ye=[{type:"items",items:[N,xe,he,oe]}];if(R.length>0){let z;t[55]===Symbol.for("react.memo_cache_sentinel")?(z={type:"divider"},t[55]=z):z=t[55],ye.push(z);let X;t[56]!==R?(X={type:"items",items:R},t[56]=R,t[57]=X):X=t[57],ye.push(X)}return te.length>0&&ye.push(...te),Q&&ye.push(Q),ye}function Is(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=s.jsx(vt,{"data-slot":"sheet",...n}),e[2]=n,e[3]=i):i=e[3],i}function Ps(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let i;return e[2]!==n?(i=s.jsx(kt,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=i):i=e[3],i}function As(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx(_t,{"data-slot":"sheet-overlay",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function Es(t){const e=_.c(17);let n,i,a,l;e[0]!==t?({className:i,children:n,side:l,...a}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=a,e[4]=l):(n=e[1],i=e[2],a=e[3],l=e[4]);const o=l===void 0?"right":l;let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(As,{}),e[5]=r):r=e[5];const c=o==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=o==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",f=o==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",u=o==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let m;e[6]!==i||e[7]!==c||e[8]!==d||e[9]!==f||e[10]!==u?(m=I("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,f,u,i),e[6]=i,e[7]=c,e[8]=d,e[9]=f,e[10]=u,e[11]=m):m=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs(Ct,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[s.jsx(De,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=x):x=e[12];let h;return e[13]!==n||e[14]!==a||e[15]!==m?(h=s.jsxs(Ps,{children:[r,s.jsxs(St,{"data-slot":"sheet-content",className:m,...a,children:[n,x]})]}),e[13]=n,e[14]=a,e[15]=m,e[16]=h):h=e[16],h}function Os(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("flex flex-col gap-1.5 p-4",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("div",{"data-slot":"sheet-header",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function Ts(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("text-foreground font-semibold",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx(Nt,{"data-slot":"sheet-title",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function Ms(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("text-muted-foreground text-sm",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx(yt,{"data-slot":"sheet-description",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}const Ds="sidebar_state",Rs=3600*24*7,Ls="16rem",Hs="18rem",Us="3rem",Bs="b",mt=E.createContext(null);function Ee(){const t=E.useContext(mt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Fs(t){const e=_.c(21),{defaultOpen:n,open:i,onOpenChange:a,children:l}=t,o=n===void 0?!0:n,r=ss(),[c,d]=E.useState(!1),[f,u]=E.useState(o),m=i??f;let x;e[0]!==m||e[1]!==a?(x=w=>{const $=typeof w=="function"?w(m):w;a?a($):u($),document.cookie=`${Ds}=${$}; path=/; max-age=${Rs}`},e[0]=m,e[1]=a,e[2]=x):x=e[2];const h=x;let b;e[3]!==r||e[4]!==h?(b=()=>r?d(Gs):h(Ws),e[3]=r,e[4]=h,e[5]=b):b=e[5];const g=b;let C,v;e[6]!==g?(C=()=>{const w=$=>{if($.key===Bs&&($.metaKey||$.ctrlKey)){const k=$.target;if(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable)return;$.preventDefault(),g()}};return globalThis.addEventListener("keydown",w),()=>globalThis.removeEventListener("keydown",w)},v=[g],e[6]=g,e[7]=C,e[8]=v):(C=e[7],v=e[8]),E.useEffect(C,v);const p=m?"expanded":"collapsed";let S;e[9]!==r||e[10]!==m||e[11]!==c||e[12]!==h||e[13]!==p||e[14]!==g?(S={state:p,open:m,setOpen:h,isMobile:r,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=r,e[10]=m,e[11]=c,e[12]=h,e[13]=p,e[14]=g,e[15]=S):S=e[15];const N=S;let j;e[16]!==l?(j=s.jsx(ns,{delayDuration:0,children:l}),e[16]=l,e[17]=j):j=e[17];let y;return e[18]!==N||e[19]!==j?(y=s.jsx(mt.Provider,{value:N,children:j}),e[18]=N,e[19]=j,e[20]=y):y=e[20],y}function Ws(t){return!t}function Gs(t){return!t}function Ks(t){const e=_.c(14);let n,i,a,l;e[0]!==t?({className:i,style:l,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=a,e[4]=l):(n=e[1],i=e[2],a=e[3],l=e[4]);let o;e[5]!==l?(o={"--sidebar-width":Ls,"--sidebar-width-icon":Us,...l},e[5]=l,e[6]=o):o=e[6];const r=o;let c;e[7]!==i?(c=I("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",i),e[7]=i,e[8]=c):c=e[8];let d;return e[9]!==n||e[10]!==a||e[11]!==r||e[12]!==c?(d=s.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:c,...a,children:n}),e[9]=n,e[10]=a,e[11]=r,e[12]=c,e[13]=d):d=e[13],d}function Vs(t){const e=_.c(42);let n,i,a,l,o,r;e[0]!==t?({side:l,variant:o,collapsible:r,className:i,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=a,e[4]=l,e[5]=o,e[6]=r):(n=e[1],i=e[2],a=e[3],l=e[4],o=e[5],r=e[6]);const c=l===void 0?"left":l,d=o===void 0?"sidebar":o,f=r===void 0?"offcanvas":r,{isMobile:u,state:m,openMobile:x,setOpenMobile:h}=Ee();if(f==="none"){let j;e[7]!==i?(j=I("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),e[7]=i,e[8]=j):j=e[8];let y;return e[9]!==n||e[10]!==a||e[11]!==j?(y=s.jsx("div",{"data-slot":"sidebar",className:j,...a,children:n}),e[9]=n,e[10]=a,e[11]=j,e[12]=y):y=e[12],y}if(u){let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j={"--sidebar-width":Hs},e[13]=j):j=e[13];let y;e[14]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsxs(Os,{className:"sr-only",children:[s.jsx(Ts,{children:"Sidebar"}),s.jsx(Ms,{children:"Displays the mobile sidebar."})]}),e[14]=y):y=e[14];let w;e[15]!==n?(w=s.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[15]=n,e[16]=w):w=e[16];let $;e[17]!==c||e[18]!==w?($=s.jsxs(Es,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:j,side:c,children:[y,w]}),e[17]=c,e[18]=w,e[19]=$):$=e[19];let k;return e[20]!==x||e[21]!==a||e[22]!==h||e[23]!==$?(k=s.jsx(Is,{open:x,onOpenChange:h,...a,children:$}),e[20]=x,e[21]=a,e[22]=h,e[23]=$,e[24]=k):k=e[24],k}const b=d==="floating"||d==="inset"?"data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"data-[collapsible=icon]:w-(--sidebar-width-icon)";let g;e[25]!==b?(g=I("group peer text-sidebar-foreground hidden md:flex flex-col shrink-0 overflow-hidden","w-(--sidebar-width) transition-[width] duration-300 ease-[var(--ease-out-quart)]","data-[collapsible=offcanvas]:w-0",b),e[25]=b,e[26]=g):g=e[26];const C=m==="collapsed"?f:"";let v;e[27]!==i?(v=I("flex flex-col h-full w-(--sidebar-width)",i),e[27]=i,e[28]=v):v=e[28];let p;e[29]!==n?(p=s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n}),e[29]=n,e[30]=p):p=e[30];let S;e[31]!==a||e[32]!==v||e[33]!==p?(S=s.jsx("div",{"data-slot":"sidebar-container",className:v,...a,children:p}),e[31]=a,e[32]=v,e[33]=p,e[34]=S):S=e[34];let N;return e[35]!==c||e[36]!==m||e[37]!==g||e[38]!==C||e[39]!==S||e[40]!==d?(N=s.jsx("div",{className:g,"data-state":m,"data-collapsible":C,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:S}),e[35]=c,e[36]=m,e[37]=g,e[38]=C,e[39]=S,e[40]=d,e[41]=N):N=e[41],N}function qs(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("main",{"data-slot":"sidebar-inset",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function ft(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function Ys(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function Qs(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("h-4 m-0! w-full",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("div",{"data-sidebar":"separator",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function Zs(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function _e(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function we(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("w-full text-sm",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function me(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("flex w-full min-w-0 flex-col gap-1",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}function re(t){const e=_.c(8);let n,i;e[0]!==t?({className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i):(n=e[1],i=e[2]);let a;e[3]!==n?(a=I("group/menu-item relative",n),e[3]=n,e[4]=a):a=e[4];let l;return e[5]!==i||e[6]!==a?(l=s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...i}),e[5]=i,e[6]=a,e[7]=l):l=e[7],l}const Xs=$t("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md py-0 pr-0.5 pl-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&_svg]:opacity-60 hover:[&_svg]:opacity-100",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2!",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function $e(t){const e=_.c(28);let n,i,a,l,o,r,c;e[0]!==t?({asChild:a,isActive:l,variant:o,size:r,tooltip:c,className:n,...i}=t,e[0]=t,e[1]=n,e[2]=i,e[3]=a,e[4]=l,e[5]=o,e[6]=r,e[7]=c):(n=e[1],i=e[2],a=e[3],l=e[4],o=e[5],r=e[6],c=e[7]);const d=a===void 0?!1:a,f=l===void 0?!1:l,u=o===void 0?"default":o,m=r===void 0?"default":r,x=d?wt:"button",{isMobile:h,state:b}=Ee();let g;e[8]!==n||e[9]!==m||e[10]!==u?(g=I(Xs({variant:u,size:m}),n),e[8]=n,e[9]=m,e[10]=u,e[11]=g):g=e[11];let C;e[12]!==x||e[13]!==f||e[14]!==i||e[15]!==m||e[16]!==g?(C=s.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":m,"data-active":f,className:g,...i}),e[12]=x,e[13]=f,e[14]=i,e[15]=m,e[16]=g,e[17]=C):C=e[17];const v=C;if(!c)return v;if(typeof c=="string"){let y;e[18]!==c?(y={children:c},e[18]=c,e[19]=y):y=e[19],c=y}let p;e[20]!==v?(p=s.jsx(as,{asChild:!0,children:v}),e[20]=v,e[21]=p):p=e[21];const S=b!=="collapsed"||h;let N;e[22]!==S||e[23]!==c?(N=s.jsx(is,{side:"right",align:"center",hidden:S,...c}),e[22]=S,e[23]=c,e[24]=N):N=e[24];let j;return e[25]!==p||e[26]!==N?(j=s.jsxs(ls,{children:[p,N]}),e[25]=p,e[26]=N,e[27]=j):j=e[27],j}function Js(t){const e=_.c(11),{label:n,children:i,defaultExpanded:a}=t,l=a===void 0?!0:a,[o,r]=E.useState(l),{state:c}=Ee(),d=c==="collapsed";let f;e[0]!==o||e[1]!==d||e[2]!==n?(f=d?s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-8 rounded-full bg-sidebar-foreground/15"})}):s.jsx(me,{children:s.jsx(re,{children:s.jsxs($e,{className:"h-6 cursor-pointer select-none gap-1 [&>svg]:size-3",onClick:()=>r(!o),children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n}),s.jsx(nt,{size:12,className:I("text-muted-foreground transition-transform duration-200",!o&&"-rotate-90")})]})})}),e[0]=o,e[1]=d,e[2]=n,e[3]=f):f=e[3];let u;e[4]!==i||e[5]!==o||e[6]!==d?(u=(d||o)&&s.jsx(we,{children:s.jsx(me,{className:"gap-0.5",children:i})}),e[4]=i,e[5]=o,e[6]=d,e[7]=u):u=e[7];let m;return e[8]!==f||e[9]!==u?(m=s.jsxs(_e,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[f,u]}),e[8]=f,e[9]=u,e[10]=m):m=e[10],m}function ut(t){const e=_.c(22),{item:n}=t,i=n.key,a=n.onClick,l=n.isActive,o=n.label,r=n.isExternal&&"group/external";let c;e[0]!==r?(c=I(r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==n.icon?(d=s.jsx("span",{className:"[&>svg]:size-4",children:n.icon}),e[2]=n.icon,e[3]=d):d=e[3];const f=n.isExternal&&"group-hover/external:underline underline-offset-2";let u;e[4]!==f?(u=I("truncate group-data-[collapsible=icon]:hidden",f),e[4]=f,e[5]=u):u=e[5];let m;e[6]!==n.label||e[7]!==u?(m=s.jsx("span",{className:u,children:n.label}),e[6]=n.label,e[7]=u,e[8]=m):m=e[8];let x;e[9]!==n.isExternal?(x=n.isExternal&&s.jsx(ge,{size:12,className:"ml-auto mr-1 shrink-0 opacity-0 group-hover/external:opacity-60 transition-opacity group-data-[collapsible=icon]:hidden"}),e[9]=n.isExternal,e[10]=x):x=e[10];let h;e[11]!==n.isActive||e[12]!==n.label||e[13]!==n.onClick||e[14]!==m||e[15]!==x||e[16]!==c||e[17]!==d?(h=s.jsxs($e,{onClick:a,isActive:l,tooltip:o,className:c,children:[d,m,x]}),e[11]=n.isActive,e[12]=n.label,e[13]=n.onClick,e[14]=m,e[15]=x,e[16]=c,e[17]=d,e[18]=h):h=e[18];let b;return e[19]!==n.key||e[20]!==h?(b=s.jsx(re,{children:h},i),e[19]=n.key,e[20]=h,e[21]=b):b=e[21],b}function en(t){const e=_.c(12),{section:n}=t;switch(n.type){case"divider":{let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Qs,{className:"my-2"}),e[0]=i):i=e[0],i}case"spacer":{let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1"}),e[1]=i):i=e[1],i}case"group":{const i=n.group.label,a=n.group.defaultExpanded;let l;e[2]!==n.group.items?(l=n.group.items.map(sn),e[2]=n.group.items,e[3]=l):l=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==l?(o=s.jsx(Js,{label:i,defaultExpanded:a,children:l}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=l,e[7]=o):o=e[7],o}case"items":{let i;e[8]!==n.items?(i=n.items.map(tn),e[8]=n.items,e[9]=i):i=e[9];let a;return e[10]!==i?(a=s.jsx(_e,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(we,{children:s.jsx(me,{className:"gap-0.5",children:i})})}),e[10]=i,e[11]=a):a=e[11],a}}}function tn(t){return s.jsx(ut,{item:t},t.key)}function sn(t){return s.jsx(ut,{item:t},t.key)}function pt(t){const e=_.c(14),{sections:n,header:i,footer:a,additionalContent:l,variant:o,collapsible:r,contentClassName:c}=t,d=o===void 0?"sidebar":o,f=r===void 0?"icon":r;let u;e[0]!==c?(u=I("flex flex-col flex-1 overflow-x-hidden mt-1 px-3.5 pb-2 group-data-[collapsible=icon]:px-2",c),e[0]=c,e[1]=u):u=e[1];let m;e[2]!==n?(m=n.map(nn),e[2]=n,e[3]=m):m=e[3];let x;e[4]!==l||e[5]!==u||e[6]!==m?(x=s.jsxs(Zs,{className:u,children:[m,l]}),e[4]=l,e[5]=u,e[6]=m,e[7]=x):x=e[7];let h;return e[8]!==f||e[9]!==a||e[10]!==i||e[11]!==x||e[12]!==d?(h=s.jsxs(Vs,{variant:d,collapsible:f,children:[i,x,a]}),e[8]=f,e[9]=a,e[10]=i,e[11]=x,e[12]=d,e[13]=h):h=e[13],h}function nn(t,e){return s.jsx(en,{section:t},e)}pt.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(ee,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function an(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"space-y-0.5 px-1 py-1",children:[s.jsx(ee,{className:"h-8 w-full rounded-lg"}),s.jsx(ee,{className:"h-8 w-full rounded-lg"})]}),t[0]=e):e=t[0],e}function ln(t){const e=_.c(12),{organizationId:n,currentProjectSlug:i,onSelect:a}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={suspense:!0},e[0]=l):l=e[0];const{data:o}=st(n,l);let r,c;if(e[1]!==i||e[2]!==a||e[3]!==o){c=Symbol.for("react.early_return_sentinel");e:{const f=o?.filter(on)??[];if(f.length===0){let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:"No projects yet"}),e[6]=m):m=e[6],c=m;break e}let u;e[7]!==i||e[8]!==a?(u=m=>{const x=i===m.slug,h=m.ui?.themeColor??"#3B82F6";return s.jsxs(q,{className:I("gap-2.5",x&&"bg-accent"),onClick:()=>a(m.slug),children:[s.jsx("div",{className:"size-6 rounded-md shrink-0 flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:h},children:m.ui?.icon?s.jsx("img",{src:m.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"text-xs font-semibold text-white",children:m.name.charAt(0).toUpperCase()})}),s.jsx("span",{className:"flex-1 truncate",children:m.name}),x&&s.jsx(je,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},m.id)},e[7]=i,e[8]=a,e[9]=u):u=e[9],r=f.map(u)}e[1]=i,e[2]=a,e[3]=o,e[4]=r,e[5]=c}else r=e[4],c=e[5];if(c!==Symbol.for("react.early_return_sentinel"))return c;let d;return e[10]!==r?(d=s.jsx(s.Fragment,{children:r}),e[10]=r,e[11]=d):d=e[11],d}function on(t){return t.slug!==F}function rn(t){let e=0;for(let i=0;i<t.length;i++)e=t.charCodeAt(i)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Le(t){const e=_.c(44),{isCollapsed:n,onCreateProject:i}=t,a=n===void 0?!1:n;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[0]=l):l=e[0];const{org:o,project:r}=qe(l),{data:c}=pe.useListOrganizations(),d=Be(),f=c?.find(P=>P.slug===o),[u,m]=E.useState(!1),[x]=Ae(),h=x.experimental_projects,b=r===F,{data:g}=tt(f?.id??"",b?"":r??"");let C;e[1]!==o?(C=(P,Z)=>P.slug===o?-1:Z.slug===o?1:P.name.localeCompare(Z.name),e[1]=o,e[2]=C):C=e[2];const v=[...c??[]].sort(C);let p;e[3]!==d||e[4]!==o?(p=()=>{o&&d({to:"/$org/$project",params:{org:o,project:F}})},e[3]=d,e[4]=o,e[5]=p):p=e[5];const S=p;let N;e[6]!==d||e[7]!==o?(N=P=>{o&&d({to:"/$org/$project",params:{org:o,project:P}})},e[6]=d,e[7]=o,e[8]=N):N=e[8];const j=N;let y;e[9]!==d?(y=P=>{d({to:"/$org/$project",params:{org:P,project:F}})},e[9]=d,e[10]=y):y=e[10];const w=y;let $;e[11]!==i?($=i?()=>i():void 0,e[11]=i,e[12]=$):$=e[12];const k=$;let A;e[13]!==d||e[14]!==o||e[15]!==r?(A=()=>{if(!o||!r)return;const P=r===F;d({to:"/$org/$project",params:{org:o,project:r},search:Z=>({...Z,settings:P?"org.general":`project:${r}:general`})})},e[13]=d,e[14]=o,e[15]=r,e[16]=A):A=e[16];const T=A,L=at,U=a?"w-auto pr-1.5":"w-full";let H;e[17]!==U?(H=I("flex items-center gap-3 rounded-md p-1.5 pr-2 text-left hover:bg-sidebar-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring min-h-[2.75rem]",U),e[17]=U,e[18]=H):H=e[18];const M=b?s.jsx("div",{className:I("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",a?"size-6":"size-8"),style:f?.logo?void 0:rn(f?.name??""),children:f?.logo?s.jsx("img",{src:f.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:I("font-semibold leading-none",a?"text-[9px]":"text-xs"),children:(f?.name??"?").slice(0,2).toUpperCase()})}):s.jsx("div",{className:I("shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden transition-[width,height] duration-300 ease-[var(--ease-out-quart)]",a?"size-6":"size-8"),style:{backgroundColor:g?.ui?.themeColor??"#60a5fa"},children:g?.ui?.icon?s.jsx("img",{src:g.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:I("font-semibold text-white",a?"text-xs":"text-lg"),children:(g?.name??r??"?").charAt(0).toUpperCase()})});let D;e[19]!==f?.name||e[20]!==g?.name||e[21]!==h||e[22]!==a||e[23]!==b||e[24]!==r?(D=!a&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:h?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"block text-[11px] text-sidebar-foreground/50 leading-tight truncate",children:f?.name??"Select org"}),s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:b?"Studio":g?.name??r??""})]}):s.jsx("span",{className:"block text-sm font-semibold text-sidebar-foreground truncate leading-tight",children:f?.name??"Select org"})}),s.jsx(qt,{size:16,className:"shrink-0 text-sidebar-foreground/40"})]}),e[19]=f?.name,e[20]=g?.name,e[21]=h,e[22]=a,e[23]=b,e[24]=r,e[25]=D):D=e[25];let O;e[26]!==H||e[27]!==M||e[28]!==D?(O=s.jsx(lt,{asChild:!0,children:s.jsxs("button",{type:"button",className:H,children:[M,D]})}),e[26]=H,e[27]=M,e[28]=D,e[29]=O):O=e[29];const B=it,R="start",V="bottom",ce="w-64 flex flex-col gap-0.5",te=cn,se=h?s.jsxs(s.Fragment,{children:[s.jsxs(q,{className:I("gap-2.5",b&&"bg-accent"),onClick:S,children:[s.jsx(be,{url:f?.logo??"",fallback:f?.name??"",size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsxs("span",{className:"flex-1 truncate",children:["Studio · ",f?.name]}),b&&s.jsx(je,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]}),s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Projects"}),f&&s.jsx(E.Suspense,{fallback:s.jsx(an,{}),children:s.jsx(ln,{organizationId:f.id,currentProjectSlug:r,orgSlug:o??"",onSelect:j})}),k&&s.jsxs(q,{className:"gap-2.5",onClick:k,children:[s.jsx(Se,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create project"})]}),s.jsx(ke,{}),s.jsxs(os,{children:[s.jsxs(rs,{className:"gap-2.5",children:[s.jsx(Je,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Switch organization"})]}),s.jsxs(cs,{className:"w-48 flex flex-col gap-0.5",children:[v.map(P=>s.jsxs(q,{className:I("gap-2.5",P.slug===o&&"bg-accent"),onClick:()=>w(P.slug),children:[s.jsx(be,{url:P.logo??"",fallback:P.name,size:"xs",className:"size-5 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:P.name}),P.slug===o&&s.jsx(je,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},P.id)),s.jsx(ke,{}),s.jsxs(q,{className:"gap-2.5",onClick:()=>m(!0),children:[s.jsx(Se,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]})]})]}),s.jsxs(q,{className:"gap-2.5",onClick:T,children:[s.jsx(Ce,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"px-2 pt-2 pb-0.5 text-[11px] font-medium text-muted-foreground/50 uppercase tracking-wider",children:"Organizations"}),v.map(P=>s.jsxs(q,{className:I("gap-2.5",P.slug===o&&"bg-accent"),onClick:()=>w(P.slug),children:[s.jsx(be,{url:P.logo??"",fallback:P.name,size:"sm",className:"size-6 rounded-md shrink-0",objectFit:"cover"}),s.jsx("span",{className:"flex-1 truncate",children:P.name}),P.slug===o&&s.jsx(je,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},P.id)),s.jsxs(q,{className:"gap-2.5",onClick:()=>m(!0),children:[s.jsx(Se,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Create organization"})]}),s.jsx(ke,{}),s.jsxs(q,{className:"gap-2.5",onClick:T,children:[s.jsx(Ce,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Settings"})]})]});let Y;e[30]!==B||e[31]!==te||e[32]!==se?(Y=s.jsx(B,{align:R,side:V,className:ce,onCloseAutoFocus:te,children:se}),e[30]=B,e[31]=te,e[32]=se,e[33]=Y):Y=e[33];let Q;e[34]!==L||e[35]!==O||e[36]!==Y?(Q=s.jsxs(L,{children:[O,Y]}),e[34]=L,e[35]=O,e[36]=Y,e[37]=Q):Q=e[37];let W;e[38]!==u||e[39]!==m?(W=s.jsx(ds,{open:u,onOpenChange:m}),e[38]=u,e[39]=m,e[40]=W):W=e[40];let G;return e[41]!==Q||e[42]!==W?(G=s.jsxs(s.Fragment,{children:[Q,W]}),e[41]=Q,e[42]=W,e[43]=G):G=e[43],G}function cn(t){return t.preventDefault()}Le.Skeleton=function(){return s.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[s.jsx(ee,{className:"size-5 rounded-[5px] shrink-0 bg-sidebar-accent"}),s.jsx(ee,{className:"h-3.5 flex-1 bg-sidebar-accent"})]})};function He(t){const e=_.c(4),{onCreateProject:n}=t,{state:i,toggleSidebar:a}=Ee(),l=i==="collapsed";let o;return e[0]!==l||e[1]!==n||e[2]!==a?(o=s.jsx(ft,{className:"px-3 group-data-[collapsible=icon]:px-2 animate-in fade-in-0 duration-200",children:s.jsx(me,{children:s.jsx(re,{children:l?s.jsxs("div",{className:"flex flex-col w-full gap-0.5",children:[s.jsx(Le,{isCollapsed:!0,onCreateProject:n}),s.jsx($e,{onClick:a,tooltip:"Expand sidebar",children:s.jsx(Re,{})})]}):s.jsxs("div",{className:"flex items-center justify-between w-full gap-1",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx(Le,{isCollapsed:!1,onCreateProject:n})}),s.jsx($e,{onClick:a,tooltip:"Collapse sidebar",className:"size-7 shrink-0",children:s.jsx(Re,{})})]})})})}),e[0]=l,e[1]=n,e[2]=a,e[3]=o):o=e[3],o}He.Skeleton=function(){return s.jsx(ft,{className:"px-3",children:s.jsx(me,{children:s.jsx(re,{children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 p-1.5",children:[s.jsx(ee,{className:"size-8 rounded-md shrink-0 bg-sidebar-accent"}),s.jsx(ee,{className:"h-3.5 w-16 bg-sidebar-accent"})]}),s.jsx("div",{className:"flex items-center gap-0.5",children:s.jsx(ee,{className:"size-7 rounded-lg bg-sidebar-accent"})})]})})})})};function dn(t){const e=_.c(50),{user:n,userImage:i}=t,{open:a}=et(),[l,o]=E.useState(!1);let r;e[0]!==n.email||e[1]!==n.id||e[2]!==n.name?(r=()=>{const V=`ID: ${n.id}
2
- Name: ${n.name||"N/A"}
3
- Email: ${n.email}`;navigator.clipboard.writeText(V),o(!0),ue.success("User info copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[0]=n.email,e[1]=n.id,e[2]=n.name,e[3]=r):r=e[3];const c=r,d=n.name||n.email||"U";let f;e[4]!==d||e[5]!==i?(f=s.jsx(be,{url:i,fallback:d,shape:"circle",size:"2xs",className:"shrink-0 size-5"}),e[4]=d,e[5]=i,e[6]=f):f=e[6];const u=n.name||"User";let m;e[7]!==u?(m=s.jsx("div",{className:"flex-1 min-w-0 group-data-[collapsible=icon]:hidden",children:s.jsx("div",{className:"text-sm font-medium truncate text-sidebar-foreground leading-none",children:u})}),e[7]=u,e[8]=m):m=e[8];let x;e[9]!==f||e[10]!==m?(x=s.jsx(lt,{asChild:!0,children:s.jsxs("button",{className:"flex w-full h-8 items-center gap-2 rounded-md px-1 hover:bg-sidebar-accent transition-colors text-left min-w-0",children:[f,m]})}),e[9]=f,e[10]=m,e[11]=x):x=e[11];const h=n.name||n.email||"U";let b;e[12]!==h||e[13]!==i?(b=s.jsx(be,{url:i,fallback:h,shape:"circle",size:"sm",className:"shrink-0"}),e[12]=h,e[13]=i,e[14]=b):b=e[14];const g=n.name||"User";let C;e[15]!==g?(C=s.jsx("div",{className:"text-sm font-medium truncate",children:g}),e[15]=g,e[16]=C):C=e[16];let v;e[17]!==n.email?(v=s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:n.email}),e[17]=n.email,e[18]=v):v=e[18];let p;e[19]!==C||e[20]!==v?(p=s.jsxs("div",{className:"flex-1 min-w-0",children:[C,v]}),e[19]=C,e[20]=v,e[21]=p):p=e[21];let S;e[22]!==l?(S=s.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:l?s.jsx(je,{size:14,className:"text-green-600"}):s.jsx(ms,{size:14,className:"text-muted-foreground"})}),e[22]=l,e[23]=S):S=e[23];let N;e[24]!==c||e[25]!==p||e[26]!==S||e[27]!==b?(N=s.jsxs(q,{onClick:c,className:"gap-2.5 group",children:[b,p,S]}),e[24]=c,e[25]=p,e[26]=S,e[27]=b,e[28]=N):N=e[28];let j;e[29]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(ke,{}),e[29]=j):j=e[29];let y;e[30]!==a?(y=()=>a("account.preferences"),e[30]=a,e[31]=y):y=e[31];let w,$;e[32]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Ce,{size:14,className:"shrink-0 text-muted-foreground"}),$=s.jsx("span",{children:"Settings"}),e[32]=w,e[33]=$):(w=e[32],$=e[33]);let k;e[34]!==y?(k=s.jsxs(q,{className:"gap-2.5",onClick:y,children:[w,$]}),e[34]=y,e[35]=k):k=e[35];let A;e[36]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(fs,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Terms of Use"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[36]=A):A=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(ps,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Privacy Policy"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[37]=T):T=e[37];let L;e[38]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(zt,{className:"w-3.5 h-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"decocms/mesh"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[38]=L):L=e[38];let U;e[39]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com/discord",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(We,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Community"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),e[39]=U):U=e[39];let H,M;e[40]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(q,{asChild:!0,children:s.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 group",children:[s.jsx(us,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:"Homepage"}),s.jsx(ge,{size:14,className:"shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})}),M=s.jsx(ke,{}),e[40]=H,e[41]=M):(H=e[40],M=e[41]);let D;e[42]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(q,{className:"gap-2.5",onClick:mn,children:[s.jsx(dt,{size:14,className:"shrink-0 text-muted-foreground"}),s.jsx("span",{children:"Sign out"})]}),e[42]=D):D=e[42];let O;e[43]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("div",{className:"px-2 py-1.5",children:s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.136.0"]})}),e[43]=O):O=e[43];let B;e[44]!==N||e[45]!==k?(B=s.jsxs(it,{side:"top",align:"end",collisionPadding:8,className:"w-64 flex flex-col gap-0.5",onCloseAutoFocus:fn,children:[N,j,k,A,T,L,U,H,M,D,O]}),e[44]=N,e[45]=k,e[46]=B):B=e[46];let R;return e[47]!==B||e[48]!==x?(R=s.jsxs(at,{children:[x,B]}),e[47]=B,e[48]=x,e[49]=R):R=e[49],R}function mn(){return pe.signOut()}function fn(t){return t.preventDefault()}function xt(){const t=_.c(7),{data:e}=pe.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(be,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const n=e.user,i=n.name??void 0;let a;t[1]!==i||t[2]!==n?(a={...n,name:i},t[1]=i,t[2]=n,t[3]=a):a=t[3];const l=a,o=n.image;let r;return t[4]!==o||t[5]!==l?(r=s.jsx(dn,{user:l,userImage:o}),t[4]=o,t[5]=l,t[6]=r):r=t[6],r}function un({invitation:t}){const[e,n]=E.useState(!1),[i,a]=E.useState(!1),l=Pt(),o=async()=>{n(!0);try{const c=await pe.organization.acceptInvitation({invitationId:t.id});if(c.error)ue.error(c.error.message),n(!1);else{const d=await pe.organization.setActive({organizationId:t.organizationId});ue.success("Invitation accepted!");const f=d?.data?.slug;window.location.href=f?`/${f}`:"/"}}catch{ue.error("Failed to accept invitation"),n(!1)}},r=async()=>{a(!0);try{const c=await pe.organization.rejectInvitation({invitationId:t.id});c.error?(ue.error(c.error.message),a(!1)):(ue.success("Invitation declined"),l.invalidateQueries())}catch{ue.error("Failed to decline invitation"),a(!1)}};return s.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:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(Te,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:o,disabled:e||i,"aria-label":"Accept invitation",children:s.jsx(je,{size:14})}),s.jsx(Te,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:r,disabled:e||i,"aria-label":"Decline invitation",children:s.jsx(bs,{size:14})})]})]})}function pn(){const t=E.useContext(It),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date)}class xn extends E.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}const hn="gateway-chip-period";function gn(){try{const t=localStorage.getItem(hn);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function bn(t,e){if(!e||e<=0)return"text-foreground/70";const n=t/e;return n<=.05?"text-destructive":n<=.2?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function jn(t){return t>=90?"text-destructive":t>=70?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function vn(t){const e=_.c(42),{connectionId:n}=t,{open:i}=et(),{org:a}=ve();let l;e[0]!==n||e[1]!==a.id?(l={connectionId:n,orgId:a.id},e[0]=n,e[1]=a.id,e[2]=l):l=e[2];const o=Ut(l);let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r={},e[3]=r):r=e[3];let c;e[4]!==o?(c={client:o,toolName:"GATEWAY_USAGE",toolArguments:r,staleTime:6e4,select:Nn},e[4]=o,e[5]=c):c=e[5];const{data:d}=vs(c),f=d?.billing.mode??"prepaid",u=d?.limit.total??null,m=d?.limit.remaining??0;let x;e[6]!==d?.usage?(x=d?.usage??{total:0,daily:0,weekly:0,monthly:0},e[6]=d?.usage,e[7]=x):x=e[7];const h=x;let b,g,C,v,p,S,N;if(e[8]!==f||e[9]!==b||e[10]!==m||e[11]!==u||e[12]!==i||e[13]!==h){let w;if(f==="prepaid"){b="Credits";let k;e[21]!==m?(k=m.toFixed(2),e[21]=m,e[22]=k):k=e[22],g=`$${k}`,w=bn(m,u)}else if(u!=null&&u>0){const k=u-m;let A;e[23]!==u||e[24]!==k?(A=Math.round(k/u*100),e[23]=u,e[24]=k,e[25]=A):A=e[25];const T=Math.min(100,A);b="Usage",g=`${T}%`,w=jn(T)}else{const k=gn(),A=k==="daily"?h.daily:k==="weekly"?h.weekly:h.monthly,T=k==="daily"?"/day":k==="weekly"?"/wk":"/mo";b="Usage";let L;e[26]!==A?(L=A.toFixed(2),e[26]=A,e[27]=L):L=e[27],g=`$${L}${T}`,w="text-foreground/70"}v="button",e[28]!==i?(p=()=>i("org.billing"),e[28]=i,e[29]=p):p=e[29],S="group-data-[collapsible=icon]:hidden flex items-center justify-between w-full px-2 py-1.5 rounded-md hover:bg-sidebar-accent transition-colors";let $;e[30]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(Xt,{size:13,className:"text-muted-foreground/60 shrink-0"}),e[30]=$):$=e[30],e[31]!==b?(N=s.jsxs("div",{className:"flex items-center gap-1.5",children:[$,s.jsx("span",{className:"text-xs text-muted-foreground",children:b})]}),e[31]=b,e[32]=N):N=e[32],C=I("text-xs font-medium tabular-nums",w),e[8]=f,e[9]=b,e[10]=m,e[11]=u,e[12]=i,e[13]=h,e[14]=C,e[15]=v,e[16]=p,e[17]=S,e[18]=N,e[19]=b,e[20]=g}else C=e[14],v=e[15],p=e[16],S=e[17],N=e[18],b=e[19],g=e[20];let j;e[33]!==C||e[34]!==g?(j=s.jsx("span",{className:C,children:g}),e[33]=C,e[34]=g,e[35]=j):j=e[35];let y;return e[36]!==j||e[37]!==v||e[38]!==p||e[39]!==S||e[40]!==N?(y=s.jsxs("button",{type:v,onClick:p,className:S,children:[N,j]}),e[36]=j,e[37]=v,e[38]=p,e[39]=S,e[40]=N,e[41]=y):y=e[41],y}function Nn(t){return t.structuredContent}function yn(){const t=_.c(4),e=js();let n;t[0]!==e?(n=e.find(Sn),t[0]=e,t[1]=n):n=t[1];const i=n;if(!i?.id)return null;let a;return t[2]!==i.id?(a=s.jsx(vn,{connectionId:i.id}),t[2]=i.id,t[3]=a):a=t[3],a}function Sn(t){return Ns(t,ys)}function kn(){const t=_.c(13),e=pn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(xn,{children:s.jsx(E.Suspense,{fallback:null,children:s.jsx(yn,{})})}),t[0]=n):n=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(xt,{})}),t[1]=i):i=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(hs,{asChild:!0,children:s.jsx(Te,{variant:"ghost",size:"icon",className:"size-8 text-sidebar-foreground/50 hover:text-sidebar-foreground hover:bg-sidebar-accent","aria-label":"Open inbox",children:s.jsx(Ve,{size:16})})}),t[2]=a):a=t[2];let l;t[3]!==e.length?(l=e.length>0&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 ring-2 ring-sidebar pointer-events-none"}),t[3]=e.length,t[4]=l):l=t[4];let o;t[5]!==l?(o=s.jsxs("div",{className:"relative",children:[a,l]}),t[5]=l,t[6]=o):o=t[6];let r;t[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),t[7]=r):r=t[7];let c;t[8]!==e?(c=s.jsxs(xs,{side:"right",align:"end",sideOffset:24,className:"w-[400px] p-0 h-[650px] flex flex-col",children:[r,e.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Ve,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"No messages or invites pending"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages, workspace and project invitations will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:e.map(Cn)})]}),t[8]=e,t[9]=c):c=t[9];let d;return t[10]!==o||t[11]!==c?(d=s.jsxs(Ys,{className:"px-3.5 pb-3 group-data-[collapsible=icon]:px-2",children:[n,s.jsx(me,{children:s.jsx(re,{children:s.jsxs("div",{className:"flex items-center w-full gap-1",children:[i,s.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs(gs,{children:[o,c]})})]})})})]}),t[10]=o,t[11]=c,t[12]=d):d=t[12],d}function Cn(t){return s.jsx(un,{invitation:t},t.id)}function _n(t){const e=_.c(11),{project:n}=t,i=n.ui?.themeColor??"#60a5fa";if(n.ui?.icon){let c;return e[0]!==n.ui.icon?(c=s.jsx("img",{src:n.ui.icon,alt:"",className:"size-4 rounded object-cover border border-border/50"}),e[0]=n.ui.icon,e[1]=c):c=e[1],c}let a;e[2]!==i?(a={backgroundColor:i},e[2]=i,e[3]=a):a=e[3];let l;e[4]!==n.name?(l=n.name.charAt(0).toUpperCase(),e[4]=n.name,e[5]=l):l=e[5];let o;e[6]!==l?(o=s.jsx("span",{className:"text-[10px] font-medium text-white",children:l}),e[6]=l,e[7]=o):o=e[7];let r;return e[8]!==a||e[9]!==o?(r=s.jsx("div",{className:"size-4 rounded flex items-center justify-center border border-border/50",style:a,children:o}),e[8]=a,e[9]=o,e[10]=r):r=e[10],r}function wn(t){const e=_.c(14),{project:n}=t,i=Be(),{org:a}=ve();let l;e[0]!==i||e[1]!==a.slug||e[2]!==n.slug?(l=()=>{i({to:"/$org/$project",params:{org:a.slug,project:n.slug}})},e[0]=i,e[1]=a.slug,e[2]=n.slug,e[3]=l):l=e[3];let o;e[4]!==n?(o=s.jsx(_n,{project:n}),e[4]=n,e[5]=o):o=e[5];let r;e[6]!==n.name?(r=s.jsx("span",{className:"truncate flex-1 group-data-[collapsible=icon]:hidden",children:n.name}),e[6]=n.name,e[7]=r):r=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ss,{size:12,className:"text-muted-foreground opacity-0 group-hover/item:opacity-100 transition-opacity group-data-[collapsible=icon]:hidden"}),e[8]=c):c=e[8];let d;return e[9]!==n.name||e[10]!==l||e[11]!==o||e[12]!==r?(d=s.jsx(re,{children:s.jsxs($e,{onClick:l,tooltip:n.name,children:[o,r,c]})}),e[9]=n.name,e[10]=l,e[11]=o,e[12]=r,e[13]=d):d=e[13],d}function $n(){const t=_.c(55),{org:e}=ve(),{data:n,isLoading:i}=st(e.id),[a,l]=E.useState(!0),[o,r]=E.useState(!1);let c,d,f,u,m,x,h,b,g,C,v,p,S;if(t[0]!==i||t[1]!==a||t[2]!==n){S=Symbol.for("react.early_return_sentinel");e:{const L=n?.filter(In)??[];if(i){let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(_e,{className:"py-0 px-0",children:s.jsx(we,{children:s.jsxs(me,{className:"gap-0.5",children:[R,s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})})]})})}),t[17]=V):V=t[17],S=V;break e}p="group/projects-section mt-2",m=Yt,C=a,v=l,u=_e,g="py-0 px-0",f=we,d=me,h="gap-0.5";let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Projects"}),t[18]=U):U=t[18];const H=!a&&"-rotate-90";let M;t[19]!==H?(M=I("text-muted-foreground shrink-0 transition-transform duration-200",H),t[19]=H,t[20]=M):M=t[20];let D;t[21]!==M?(D=s.jsx(Qt,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex flex-1 items-center gap-1 cursor-pointer min-w-0",children:[U,s.jsx(nt,{size:12,className:M})]})}),t[21]=M,t[22]=D):D=t[22];let O;t[23]===Symbol.for("react.memo_cache_sentinel")?(O=()=>r(!0),t[23]=O):O=t[23];let B;t[24]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("button",{type:"button",onClick:O,title:"Create new project",className:"opacity-0 group-hover/projects-section:opacity-100 transition-opacity text-muted-foreground hover:text-foreground flex items-center justify-center h-4 rounded shrink-0",children:s.jsx(Se,{size:16})}),t[24]=B):B=t[24],t[25]!==D?(b=s.jsx(re,{className:"group-data-[collapsible=icon]:hidden",children:s.jsxs("div",{className:"flex h-6 w-full items-center gap-1 rounded-md pl-1.5 pr-0.5 hover:bg-sidebar-accent transition-colors",children:[D,B]})}),t[25]=D,t[26]=b):b=t[26],c=Zt,x=L.length===0?s.jsx(re,{children:s.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:"No projects yet"})}):L.map(zn)}t[0]=i,t[1]=a,t[2]=n,t[3]=c,t[4]=d,t[5]=f,t[6]=u,t[7]=m,t[8]=x,t[9]=h,t[10]=b,t[11]=g,t[12]=C,t[13]=v,t[14]=p,t[15]=S}else c=t[3],d=t[4],f=t[5],u=t[6],m=t[7],x=t[8],h=t[9],b=t[10],g=t[11],C=t[12],v=t[13],p=t[14],S=t[15];if(S!==Symbol.for("react.early_return_sentinel"))return S;let N;t[27]!==c||t[28]!==x?(N=s.jsx(c,{children:x}),t[27]=c,t[28]=x,t[29]=N):N=t[29];let j;t[30]!==d||t[31]!==h||t[32]!==b||t[33]!==N?(j=s.jsxs(d,{className:h,children:[b,N]}),t[30]=d,t[31]=h,t[32]=b,t[33]=N,t[34]=j):j=t[34];let y;t[35]!==f||t[36]!==j?(y=s.jsx(f,{children:j}),t[35]=f,t[36]=j,t[37]=y):y=t[37];let w;t[38]!==u||t[39]!==y||t[40]!==g?(w=s.jsx(u,{className:g,children:y}),t[38]=u,t[39]=y,t[40]=g,t[41]=w):w=t[41];let $;t[42]!==m||t[43]!==w||t[44]!==C||t[45]!==v?($=s.jsx(m,{open:C,onOpenChange:v,children:w}),t[42]=m,t[43]=w,t[44]=C,t[45]=v,t[46]=$):$=t[46];let k;t[47]!==$||t[48]!==p?(k=s.jsx("div",{className:p,children:$}),t[47]=$,t[48]=p,t[49]=k):k=t[49];let A;t[50]!==o?(A=s.jsx(Xe,{open:o,onOpenChange:r}),t[50]=o,t[51]=A):A=t[51];let T;return t[52]!==k||t[53]!==A?(T=s.jsxs(s.Fragment,{children:[k,A]}),t[52]=k,t[53]=A,t[54]=T):T=t[54],T}function zn(t){return s.jsx(wn,{project:t},t.id)}function In(t){return t.slug!==F}function Pn(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(E.Suspense,{fallback:s.jsx(_e,{className:"py-0 px-0",children:s.jsx(we,{children:s.jsx(me,{className:"gap-0.5",children:s.jsx(re,{children:s.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[s.jsx(ee,{className:"h-4 w-4 rounded"}),s.jsx(ee,{className:"h-4 flex-1"})]})})})})}),children:s.jsx($n,{})}),t[0]=e):e=t[0],e}function An(t){const e=_.c(13),{onCreateProject:n}=t,[i]=Ae(),a=zs(),{locator:l}=ve();let o;e[0]!==l?(o=Oe.isOrgAdminProject(l),e[0]=l,e[1]=o):o=e[1];const r=o;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(He.Skeleton,{}),e[2]=c):c=e[2];let d;e[3]!==n?(d=s.jsx(E.Suspense,{fallback:c,children:s.jsx(He,{onCreateProject:n})}),e[3]=n,e[4]=d):d=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(kn,{}),e[5]=f):f=e[5];let u;e[6]!==r||e[7]!==i?(u=r&&i.experimental_projects?s.jsx(Ue,{children:s.jsx(E.Suspense,{fallback:null,children:s.jsx(Pn,{})})}):null,e[6]=r,e[7]=i,e[8]=u):u=e[8];let m;return e[9]!==a||e[10]!==d||e[11]!==u?(m=s.jsx(pt,{sections:a,header:d,footer:f,additionalContent:u}),e[9]=a,e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function En(){const t=_.c(2),n=Fe().location.href;let i;return t[0]!==n?(i=s.jsx(Tt,{to:"/login",search:{next:n},replace:!0}),t[0]=n,t[1]=i):i=t[1],i}function On(t){const e=_.c(6),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(At,{children:s.jsx(Ye,{})}),e[0]=i):i=e[0];let a;e[1]!==n?(a=s.jsx(Et,{children:n}),e[1]=n,e[2]=a):a=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ot,{children:s.jsx(En,{})}),e[3]=l):l=e[3];let o;return e[4]!==a?(o=s.jsxs(s.Fragment,{children:[i,a,l]}),e[4]=a,e[5]=o):o=e[5],o}function Tn(t){const e=_.c(10),{children:n,className:i}=t,[,a]=E.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=Ke.decoChatPanelWidth(),e[0]=l):l=e[0];const[o,r]=Ge(l,30);let c;e[1]!==r?(c=m=>a(()=>r(m)),e[1]=r,e[2]=c):c=e[2];const d=c;let f;e[3]!==i?(f=I("min-w-0",i),e[3]=i,e[4]=f):f=e[4];let u;return e[5]!==o||e[6]!==n||e[7]!==d||e[8]!==f?(u=s.jsx(ot,{defaultSize:o,minSize:20,className:f,onResize:d,children:n}),e[5]=o,e[6]=n,e[7]=d,e[8]=f,e[9]=u):u=e[9],u}function Mn(t){const e=_.c(5),{children:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=Ke.sidebarOpen(),e[0]=i):i=e[0];const[a,l]=Ge(i,!0);let o;return e[1]!==n||e[2]!==l||e[3]!==a?(o=s.jsx(Fs,{open:a,onOpenChange:l,children:n}),e[1]=n,e[2]=l,e[3]=a,e[4]=o):o=e[4],o}function Dn(t){const e=_.c(24),{isStudio:n,isHomeRoute:i,onCreateProject:a}=t,[l]=Ze();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Ke.decoChatPanelWidth(),e[0]=o):o=e[0];const[r]=Ge(o,30),[c]=Ae(),d=n&&c.experimental_projects?"":void 0,f=`${r}cqi`;let u;e[1]!==f?(u={"--sidebar-width":"13.5rem","--sidebar-width-mobile":"11rem","--chat-panel-w":f},e[1]=f,e[2]=u):u=e[2];const m=u;let x;e[3]!==a?(x=s.jsx(An,{onCreateProject:a}),e[3]=a,e[4]=x):x=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},e[5]=h):h=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b={overflow:"visible"},e[6]=b):b=e[6];let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g={overflow:"visible"},e[7]=g):g=e[7];const C=l&&"rounded-tr-[0.75rem] border-r";let v;e[8]!==C?(v=I("flex flex-col flex-1 min-h-0 bg-card overflow-hidden","border-t border-l border-sidebar-border","rounded-tl-[0.75rem]","transition-[border-radius] duration-200 ease-[var(--ease-out-quart)]",C),e[8]=C,e[9]=v):v=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("div",{className:"flex-1 overflow-hidden",children:s.jsx(Qe,{})}),e[10]=p):p=e[10];let S;e[11]!==v?(S=s.jsx(ot,{className:"min-w-0 flex flex-col",style:g,children:s.jsx("div",{className:v,children:p})}),e[11]=v,e[12]=S):S=e[12];let N;e[13]!==l||e[14]!==i?(N=!i&&s.jsxs(s.Fragment,{children:[s.jsx(ks,{className:"bg-sidebar"}),s.jsx(Tn,{className:I("transition-[max-width] duration-200 ease-[var(--ease-out-quart)] overflow-hidden",l?"max-w-[var(--chat-panel-w)] bg-sidebar":"max-w-0"),children:s.jsx("div",{className:"h-full min-w-[var(--chat-panel-w)] pl-1.5 pr-1.5 pb-1.5",children:s.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden border border-sidebar-border shadow-sm",children:s.jsx($s,{})})})})]}),e[13]=l,e[14]=i,e[15]=N):N=e[15];let j;e[16]!==S||e[17]!==N?(j=s.jsx(qs,{className:"pt-1.5",style:h,children:s.jsxs(Cs,{direction:"horizontal",className:"h-full",style:b,children:[S,N]})}),e[16]=S,e[17]=N,e[18]=j):j=e[18];let y;return e[19]!==j||e[20]!==d||e[21]!==m||e[22]!==x?(y=s.jsxs(Ks,{className:"flex-1 bg-sidebar","data-studio":d,style:m,children:[x,j]}),e[19]=j,e[20]=d,e[21]=m,e[22]=x,e[23]=y):y=e[23],y}function Rn(){const{org:t,project:e}=qe({strict:!1}),n=Fe(),[i,a]=E.useState(!1),l=n.location.pathname===`/${t}/${e}`||n.location.pathname===`/${t}/${e}/`,o=e??F,{data:r}=Mt({queryKey:Dt.activeOrganization(t),queryFn:async()=>{if(!t)return null;const{data:f}=await pe.organization.setActive({organizationSlug:t});return{org:f,project:{slug:o,isOrgAdmin:o===F}}},gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1});if(!r)return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx("header",{className:"h-12 flex items-center justify-end px-4 border-b border-border",children:s.jsx("div",{className:"w-fit",children:s.jsx(xt,{})})}),s.jsx(Qe,{})]});if(!r.org)return window.location.pathname!=="/"&&(window.location.href="/"),null;const c={...r,project:{...r.project,slug:o,isOrgAdmin:o===F}},d=o===F;return s.jsxs(Rt,{...c,children:[s.jsx(Mn,{children:s.jsx("div",{className:"flex flex-col h-screen overflow-hidden",children:s.jsx(J.Provider,{children:s.jsx(Dn,{isStudio:d,isHomeRoute:l,onCreateProject:()=>a(!0)})})})}),s.jsx(Xe,{open:i,onOpenChange:a})]})}function Ca(){const t=_.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(On,{children:s.jsx(E.Suspense,{fallback:s.jsx(Ye,{}),children:s.jsx(Rn,{})})}),t[0]=e):e=t[0],e}export{Ca as default};
@@ -1 +0,0 @@
1
- import{r as c,j as i,H as C,I as y,G as I,M as T,W as M,X as H,U,c as z,v as g}from"./index-xQ2t379n.js";var m="Switch",[A]=U(m),[q,L]=A(m),E=c.forwardRef((a,e)=>{const{__scopeSwitch:t,name:r,checked:s,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=a,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=I({prop:s,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:T(a.onClick,b=>{N(B=>!B),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((a,e)=>{const{__scopeSwitch:t,...r}=a,s=L(P,t);return i.jsx(C.span,{"data-state":j(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:a,control:e,checked:t,bubbles:r=!0,...s},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...s,tabIndex:-1,ref:d,style:{...s.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(a){return a?"checked":"unchecked"}var W=E,X=R;function D(a){const e=z.c(9);let t,r;e[0]!==a?({className:t,...r}=a,e[0]=a,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(X,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==s?(o=i.jsx(W,{"data-slot":"switch",className:s,...r,children:n}),e[6]=r,e[7]=s,e[8]=o):o=e[8],o}export{D as S};
@@ -1 +0,0 @@
1
- import{c as v,r as p,D as $,G as F,j as d,H as m,aF as M,T as P,U as L,Q as y,J as k,M as T,R as D,v as x}from"./index-xQ2t379n.js";import{u as V,L as G}from"./localstorage-keys-BVjc41qz.js";const K={devMode:!1,experimental_projects:!1,toolApprovalLevel:"none",enableNotifications:typeof Notification<"u"};function W(){const a=v.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=G.preferences(),a[0]=e):e=a[0],V(e,z)}function z(a){return{...K,...a}}var g="Tabs",[O]=L(g,[y]),_=y(),[B,h]=O(g),N=p.forwardRef((a,e)=>{const{__scopeTabs:r,value:t,onValueChange:n,defaultValue:o,orientation:s="horizontal",dir:i,activationMode:l="automatic",...b}=a,u=$(i),[c,f]=F({prop:t,onChange:n,defaultProp:o??"",caller:g});return d.jsx(B,{scope:r,baseId:M(),value:c,onValueChange:f,orientation:s,dir:u,activationMode:l,children:d.jsx(m.div,{dir:u,"data-orientation":s,...b,ref:e})})});N.displayName=g;var C="TabsList",E=p.forwardRef((a,e)=>{const{__scopeTabs:r,loop:t=!0,...n}=a,o=h(C,r),s=_(r);return d.jsx(D,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:t,children:d.jsx(m.div,{role:"tablist","aria-orientation":o.orientation,...n,ref:e})})});E.displayName=C;var w="TabsTrigger",R=p.forwardRef((a,e)=>{const{__scopeTabs:r,value:t,disabled:n=!1,...o}=a,s=h(w,r),i=_(r),l=I(s.baseId,t),b=S(s.baseId,t),u=t===s.value;return d.jsx(k,{asChild:!0,...i,focusable:!n,active:u,children:d.jsx(m.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":b,"data-state":u?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:l,...o,ref:e,onMouseDown:T(a.onMouseDown,c=>{!n&&c.button===0&&c.ctrlKey===!1?s.onValueChange(t):c.preventDefault()}),onKeyDown:T(a.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&s.onValueChange(t)}),onFocus:T(a.onFocus,()=>{const c=s.activationMode!=="manual";!u&&!n&&c&&s.onValueChange(t)})})})});R.displayName=w;var j="TabsContent",A=p.forwardRef((a,e)=>{const{__scopeTabs:r,value:t,forceMount:n,children:o,...s}=a,i=h(j,r),l=I(i.baseId,t),b=S(i.baseId,t),u=t===i.value,c=p.useRef(u);return p.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),d.jsx(P,{present:n||u,children:({present:f})=>d.jsx(m.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:b,tabIndex:0,...s,ref:e,style:{...a.style,animationDuration:c.current?"0s":void 0},children:f&&o})})});A.displayName=j;function I(a,e){return`${a}-trigger-${e}`}function S(a,e){return`${a}-content-${e}`}var H=N,U=E,q=R,J=A;function X(a){const e=v.c(10);let r,t,n;e[0]!==a?({className:r,variant:n,...t}=a,e[0]=a,e[1]=r,e[2]=t,e[3]=n):(r=e[1],t=e[2],n=e[3]);const o=n===void 0?"pill":n;let s;e[4]!==r?(s=x("flex flex-col gap-2",r),e[4]=r,e[5]=s):s=e[5];let i;return e[6]!==t||e[7]!==s||e[8]!==o?(i=d.jsx(H,{"data-slot":"tabs","data-variant":o,className:s,...t}),e[6]=t,e[7]=s,e[8]=o,e[9]=i):i=e[9],i}function Z(a){const e=v.c(11);let r,t,n;e[0]!==a?({className:r,variant:n,...t}=a,e[0]=a,e[1]=r,e[2]=t,e[3]=n):(r=e[1],t=e[2],n=e[3]);const o=n||"pill",s=o==="underline"?"flex h-[52px] items-center border-b border-border":o==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==r||e[5]!==s?(i=x(s,r),e[4]=r,e[5]=s,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==t||e[9]!==i?(l=d.jsx(U,{"data-slot":"tabs-list","data-variant":o,className:i,...t}),e[7]=o,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function ee(a){const e=v.c(11);let r,t,n;e[0]!==a?({className:r,variant:n,...t}=a,e[0]=a,e[1]=r,e[2]=t,e[3]=n):(r=e[1],t=e[2],n=e[3]);const o=n||"pill",s=o==="underline"?"cursor-pointer flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":o==="canvas"?"cursor-pointer flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground cursor-pointer focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==r||e[5]!==s?(i=x(s,r),e[4]=r,e[5]=s,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==t||e[9]!==i?(l=d.jsx(q,{"data-slot":"tabs-trigger","data-variant":o,className:i,...t}),e[7]=o,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function te(a){const e=v.c(8);let r,t;e[0]!==a?({className:r,...t}=a,e[0]=a,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let n;e[3]!==r?(n=x("flex-1 outline-none h-full",r),e[3]=r,e[4]=n):n=e[4];let o;return e[5]!==t||e[6]!==n?(o=d.jsx(J,{"data-slot":"tabs-content",className:n,...t}),e[5]=t,e[6]=n,e[7]=o):o=e[7],o}export{ee as T,Z as a,te as b,X as c,W as u};
@@ -1 +0,0 @@
1
- import{c as n,j as r,E as d,r as f,u as x,b as j}from"./index-xQ2t379n.js";import{T as h}from"./tasks-panel-Bcd4i-z8.js";import{P as p}from"./index-C79VipEf.js";import{B as g,a as b,b as T,c as k}from"./breadcrumb-N-YM-0qC.js";import{i as B}from"./Loading01-BWjBCSBL.js";import{u as S}from"./collapsible-CpgZSwBN.js";import"./index-D3pPaynQ.js";import"./popover-BGz1EQnh.js";import"./skeleton-Ct9swv0n.js";import"./spinner-DfUcLZCl.js";import"./tooltip-B6yKYOIf.js";import"./index-CrfXnuko.js";import"./constants-BLSLjUCX.js";import"./decopilot-events-BEPzMc6y.js";import"./useQuery-BLe-0FCm.js";import"./dialog-BEh9NHdw.js";import"./X-C0j62Xtl.js";import"./form-DKOen-4i.js";import"./label-DgKgIZIr.js";import"./input-CquIDQAg.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-B2lliNjJ.js";import"./ChevronDown-B8UJn4iH.js";import"./Edit01-CMeQdBcS.js";import"./Users03-C4-0uA3w.js";import"./XCircle-BtpMj0Vx.js";import"./AlertCircle-BmterM6-.js";import"./select-CDsJtNMV.js";import"./Check-Dy5Jwsdl.js";import"./tabs-DN8uQx_4.js";import"./localstorage-keys-BVjc41qz.js";import"./useMutation-tQLZk7P3.js";import"./ArrowLeft-BwnRcCxk.js";import"./use-copy-oq5GkYwB.js";import"./badge-D8RzvYJ4.js";import"./Code01-Ce_GLriH.js";import"./integration-icon-CyNzGslP.js";import"./Container-nefPC-Vi.js";import"./use-virtual-mcp-COkdNvVv.js";import"./use-connection-Dtj63U01.js";import"./SearchMd-CpD1Xdqo.js";import"./use-create-virtual-mcp-COKyzJBE.js";import"./use-mcp-resources-B792gs6l.js";import"./ChevronRight-UHmTzu6U.js";import"./Copy01-DTrKcR-Q.js";import"./marked.esm-BaswSlok.js";import"./markdown-Ba8nOSsK.js";import"./mcp-app-renderer-DYp1_awD.js";import"./types-CnPYT6I7.js";import"./Eye-DxLOh0i-.js";import"./Globe02-KBI1AO62.js";import"./LayersTwo01-D3z_72X4.js";import"./XClose-BoXt6_S8.js";import"./collection-search-Cq4rjP0Z.js";import"./generate-id-Dyweu44Y.js";import"./Clock-CHKtyQRJ.js";import"./Trash01-p1zJKNMp.js";import"./user-CI081yAV.js";import"./avatar-DNxsCl6r.js";import"./format-time-CMKyl-GC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./CheckCircle-DCJamcsS.js";import"./Plus-CK3qvOs-.js";import"./use-llm-5n5wwCT_.js";import"./use-binding-BSjPQ0Be.js";import"./binder-Blih3Yob.js";import"./checkbox-CUOTkCKW.js";import"./AlignLeft-D-24Asic.js";import"./Image01-C8E_92eh.js";import"./RefreshCcw01-DCU1xktc.js";import"./Settings01-Bhz_Vu7B.js";import"./useSuspenseInfiniteQuery-D0p_NlPn.js";import"./infiniteQueryObserver-bwcxH-lX.js";function v(){const t=n.c(8),{org:o,project:s}=x(),a=j(),{switchToTask:c}=S();let i;t[0]!==a||t[1]!==o.slug||t[2]!==s.slug||t[3]!==c?(i=async u=>{await c(u),a({to:"/$org/$project",params:{org:o.slug,project:s.slug}})},t[0]=a,t[1]=o.slug,t[2]=s.slug,t[3]=c,t[4]=i):i=t[4];const l=i;let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(p.Header,{children:r.jsx(p.Header.Left,{children:r.jsx(g,{children:r.jsx(b,{children:r.jsx(T,{children:r.jsx(k,{children:"Tasks"})})})})})}),t[5]=m):m=t[5];let e;return t[6]!==l?(e=r.jsxs(p,{children:[m,r.jsx(p.Content,{children:r.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:r.jsx(h,{onTaskSelect:l})})})]}),t[6]=l,t[7]=e):e=t[7],e}function Kt(){const t=n.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(d,{children:r.jsx(f.Suspense,{fallback:r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(B,{size:32,className:"animate-spin text-muted-foreground"})}),children:r.jsx(v,{})})}),t[0]=o):o=t[0],o}export{Kt as default};
@@ -1 +0,0 @@
1
- import{c as z,b as X,r as H,j as t,_ as Y,$ as Z,O as ee}from"./index-xQ2t379n.js";import{C as te}from"./collection-display-button-DrtKZPsB.js";import{E as B,C as se}from"./collection-search-Cq4rjP0Z.js";import{C as oe}from"./collection-table-wrapper-CyGYWMWl.js";import{I as ne}from"./integration-icon-CyNzGslP.js";import{B as K}from"./badge-D8RzvYJ4.js";import{C as re}from"./card-DpIJfsV8.js";import{T as G,a as P,b as W,c as ae}from"./tooltip-B6yKYOIf.js";import{g as ie}from"./types-CnPYT6I7.js";import{s as le}from"./Eye-DxLOh0i-.js";import{s as ce}from"./Globe02-KBI1AO62.js";import{s as me}from"./LayersTwo01-D3z_72X4.js";import{V as de}from"./layout-BaoRfV41.js";const fe=[{key:"readOnlyHint",label:"Read-only",Icon:le,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:Y,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:Z,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:ce,variant:"outline"}];function pe(s){const e=z.c(18),{annotations:a,_meta:d}=s;let u;e[0]!==d?(u=ie(d),e[0]=d,e[1]=u):u=e[1];const l=!!u;let h,x,c,f,m;if(e[2]!==a||e[3]!==l){m=Symbol.for("react.early_return_sentinel");e:{const n=a?fe.filter(I=>a[I.key]===!0):[];if(n.length===0&&!l){m=null;break e}h=ae,x="flex gap-1 flex-nowrap",e[9]!==l?(c=l&&t.jsxs(G,{children:[t.jsx(P,{asChild:!0,children:t.jsx(K,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:t.jsx(me,{})})}),t.jsx(W,{children:"Interactive"})]}),e[9]=l,e[10]=c):c=e[10],f=n.map(ue)}e[2]=a,e[3]=l,e[4]=h,e[5]=x,e[6]=c,e[7]=f,e[8]=m}else h=e[4],x=e[5],c=e[6],f=e[7],m=e[8];if(m!==Symbol.for("react.early_return_sentinel"))return m;let p;e[11]!==x||e[12]!==c||e[13]!==f?(p=t.jsxs("div",{className:x,children:[c,f]}),e[11]=x,e[12]=c,e[13]=f,e[14]=p):p=e[14];let g;return e[15]!==h||e[16]!==p?(g=t.jsx(h,{children:p}),e[15]=h,e[16]=p,e[17]=g):g=e[17],g}function ue(s){const{label:e,Icon:a,variant:d}=s;return t.jsxs(G,{children:[t.jsx(P,{asChild:!0,children:t.jsx(K,{asChild:!0,variant:d,className:"size-6 p-1",children:t.jsx(a,{})})}),t.jsx(W,{children:e})]},e)}function De(s){const e=z.c(40),{tools:a,connectionId:d,org:u,onToolClick:l,showToolbar:h,emptyMessage:x,isLoading:c}=s,f=h===void 0?!0:h,m=x===void 0?"This connection doesn't have any tools yet.":x,p=c===void 0?!1:c,g=X(),[n,I]=H.useState(""),[j,F]=H.useState("table"),[r,M]=H.useState("name"),[i,V]=H.useState("asc");let w;e[0]!==i||e[1]!==r?(w=o=>{r===o?(V(Ne),i==="desc"&&M(void 0)):(M(o),V("asc"))},e[0]=i,e[1]=r,e[2]=w):w=e[2];const y=w;let _;e[3]!==d||e[4]!==g||e[5]!==l||e[6]!==u?(_=o=>{l?l(o):d&&u&&g({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:u,project:ee,connectionId:d,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=d,e[4]=g,e[5]=l,e[6]=u,e[7]=_):_=e[7];const k=_;let $;if(e[8]!==n||e[9]!==i||e[10]!==r||e[11]!==a){const o=!a||a.length===0?[]:n.trim()?(()=>{const E=n.toLowerCase();return a.filter(S=>S.name.toLowerCase().includes(E)||S.description&&S.description.toLowerCase().includes(E))})():a;$=!r||!i?o:[...o].sort((E,S)=>{const q=E[r]||"",Q=S[r]||"",U=String(q).localeCompare(String(Q));return i==="asc"?U:-U}),e[8]=n,e[9]=i,e[10]=r,e[11]=a,e[12]=$}else $=e[12];const T=$;let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"name",header:"Name",render:ye,sortable:!0},{id:"annotations",header:"Hints",render:je,cellClassName:"w-32 shrink-0"},{id:"description",header:"Description",render:ge,cellClassName:"flex-1",sortable:!0}],e[13]=L):L=e[13];const A=L;let O;e[14]===Symbol.for("react.memo_cache_sentinel")?(O=A.filter(xe).map(he),e[14]=O):O=e[14];const J=O;let N;e[15]!==y||e[16]!==f||e[17]!==i||e[18]!==r||e[19]!==j?(N=f&&t.jsx(de,{children:t.jsx(te,{viewMode:j,onViewModeChange:F,sortKey:r,sortDirection:i,onSort:y,sortOptions:J})}),e[15]=y,e[16]=f,e[17]=i,e[18]=r,e[19]=j,e[20]=N):N=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=o=>{o.key==="Escape"&&(I(""),o.target.blur())},e[21]=R):R=e[21];let v;e[22]!==n?(v=t.jsx(se,{value:n,onChange:I,placeholder:"Search tools...",onKeyDown:R}),e[22]=n,e[23]=v):v=e[23];let b;e[24]!==m||e[25]!==y||e[26]!==k||e[27]!==p||e[28]!==n||e[29]!==i||e[30]!==r||e[31]!==T||e[32]!==j?(b=j==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:T.length===0?t.jsx(B,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:T.map(o=>t.jsx(re,{className:"cursor-pointer transition-colors",onClick:()=>k(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ne,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(oe,{columns:A,data:T,isLoading:p,sortKey:r,sortDirection:i,onSort:y,onRowClick:o=>k(o),emptyState:t.jsx(B,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":m})}),e[24]=m,e[25]=y,e[26]=k,e[27]=p,e[28]=n,e[29]=i,e[30]=r,e[31]=T,e[32]=j,e[33]=b):b=e[33];let C;e[34]!==v||e[35]!==b?(C=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v,b]}),e[34]=v,e[35]=b,e[36]=C):C=e[36];let D;return e[37]!==C||e[38]!==N?(D=t.jsxs(t.Fragment,{children:[N,C]}),e[37]=C,e[38]=N,e[39]=D):D=e[39],D}function he(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function xe(s){return s.sortable}function ge(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function je(s){return t.jsx(pe,{annotations:s.annotations,_meta:s._meta})}function ye(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function Ne(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{De as T,pe as a};
@@ -1 +0,0 @@
1
- import{r as i,I as H,j as c,aU as W,H as K,M as C,T as S,aV as Z,aF as J,G as Q,aW as ee,aX as $,aY as te,aZ as oe,U as re,a_ as ne,a$ as se,c as j,v as ae}from"./index-xQ2t379n.js";import{R as ie}from"./index-CrfXnuko.js";var[O]=re("Tooltip",[$]),D=$(),G="TooltipProvider",le=700,A="tooltip.open",[ce,k]=O(G),F=o=>{const{__scopeTooltip:e,delayDuration:t=le,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=i.useRef(!0),d=i.useRef(!1),a=i.useRef(0);return i.useEffect(()=>{const p=a.current;return()=>window.clearTimeout(p)},[]),c.jsx(ce,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:i.useCallback(()=>{window.clearTimeout(a.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:i.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};F.displayName=G;var R="Tooltip",[ue,_]=O(R),z=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,a=k(R,o.__scopeTooltip),p=D(e),[u,v]=i.useState(null),x=J(),f=i.useRef(0),h=l??a.disableHoverableContent,T=d??a.delayDuration,g=i.useRef(!1),[y,m]=Q({prop:r,defaultProp:n??!1,onChange:N=>{N?(a.onOpen(),document.dispatchEvent(new CustomEvent(A))):a.onClose(),s?.(N)},caller:R}),w=i.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,m(!0)},[m]),P=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,m(!1)},[m]),I=i.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,m(!0),f.current=0},T)},[T,m]);return i.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(ee,{...p,children:c.jsx(ue,{scope:e,contentId:x,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:i.useCallback(()=>{a.isOpenDelayedRef.current?I():E()},[a.isOpenDelayedRef,I,E]),onTriggerLeave:i.useCallback(()=>{h?P():(window.clearTimeout(f.current),f.current=0)},[P,h]),onOpen:E,onClose:P,disableHoverableContent:h,children:t})})};z.displayName=R;var L="TooltipTrigger",U=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=D(t),d=i.useRef(null),a=H(e,d,n.onTriggerChange),p=i.useRef(!1),u=i.useRef(!1),v=i.useCallback(()=>p.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(W,{asChild:!0,...l,children:c.jsx(K.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:a,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});U.displayName=L;var M="TooltipPortal",[de,pe]=O(M,{forceMount:void 0}),B=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(M,e);return c.jsx(de,{scope:e,forceMount:t,children:c.jsx(S,{present:t||s.open,children:c.jsx(Z,{asChild:!0,container:n,children:r})})})};B.displayName=M;var b="TooltipContent",V=i.forwardRef((o,e)=>{const t=pe(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return c.jsx(S,{present:r||l.open,children:l.disableHoverableContent?c.jsx(Y,{side:n,...s,ref:e}):c.jsx(fe,{side:n,...s,ref:e})})}),fe=i.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=i.useRef(null),s=H(e,n),[l,d]=i.useState(null),{trigger:a,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,x=i.useCallback(()=>{d(null),v(!1)},[v]),f=i.useCallback((h,T)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},m=ge(y,g.getBoundingClientRect()),w=Te(y,m),E=me(T.getBoundingClientRect()),P=Ce([...w,...E]);d(P),v(!0)},[v]);return i.useEffect(()=>()=>x(),[x]),i.useEffect(()=>{if(a&&u){const h=g=>f(g,u),T=g=>f(g,a);return a.addEventListener("pointerleave",h),u.addEventListener("pointerleave",T),()=>{a.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",T)}}},[a,u,f,x]),i.useEffect(()=>{if(l){const h=T=>{const g=T.target,y={x:T.clientX,y:T.clientY},m=a?.contains(g)||u?.contains(g),w=!ye(y,l);m?x():w&&(x(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[a,u,l,p,x]),c.jsx(Y,{...o,ref:s})}),[ve,xe]=O(R,{isInside:!1}),he=ne("TooltipContent"),Y=i.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,a=_(b,t),p=D(t),{onClose:u}=a;return i.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),i.useEffect(()=>{if(a.trigger){const v=x=>{x.target?.contains(a.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[a.trigger,u]),c.jsx(te,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(oe,{"data-state":a.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(he,{children:r}),c.jsx(ve,{scope:t,isInside:!0,children:c.jsx(ie,{id:a.contentId,role:"tooltip",children:n||r})})]})})});V.displayName=b;var X="TooltipArrow",q=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return xe(X,t).isInside?null:c.jsx(se,{...n,...r,ref:e})});q.displayName=X;function ge(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Te(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function me(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function ye(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],a=e[l],p=d.x,u=d.y,v=a.x,x=a.y;u>r!=x>r&&t<(v-p)*(r-u)/(x-u)+p&&(n=!n)}return n}function Ce(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),be(e)}function be(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var we=F,Ee=z,Pe=U,Re=B,_e=V,je=q;function Oe(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(we,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Le(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Oe,{children:c.jsx(Ee,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function ke(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Pe,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Me(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==r?(d=ae("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(je,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==d?(p=c.jsx(Re,{children:c.jsxs(_e,{"data-slot":"tooltip-content",sideOffset:l,className:d,...n,children:[t,a]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=d,e[12]=p):p=e[12],p}export{Le as T,ke as a,Me as b,Oe as c};
@@ -1 +0,0 @@
1
- import{a as v}from"./binder-Blih3Yob.js";import{bH as O,a1 as C,o as t,s as e,bI as g,bb as c,bJ as l,bK as M,bL as D,bM as i,bc as y,bN as m,bO as T,bP as n,bQ as _,bR as k,bS as w,bT as G,bU as U,bV as A}from"./index-xQ2t379n.js";const B=C.extend({avatar:e().describe("URL or data URI to the assistant's avatar image"),system_prompt:e().describe("System prompt that defines the assistant's behavior"),virtual_mcp_id:e().describe("Virtual MCP ID to use for this assistant"),model:t({id:e().describe("Model ID"),connectionId:e().describe("Connection ID that provides the model")}).describe("Selected model reference for this assistant")}),W=O("assistant",B),F=[...W],I=k(()=>m([w(),e(),i(),T(),g(e(),I),c(I)])),h=g(e(),g(e(),I)).optional().describe("Additional provider-specific options. Outer record keyed by provider name, inner by option key"),E=t({type:n("text"),text:e().describe("The text content"),providerOptions:h}),j=t({type:n("text"),text:e().describe("The text content"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),q=e().describe("File data as URL string"),R=t({type:n("file"),filename:e().optional().describe("Optional filename of the file"),data:q,mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),providerOptions:h}),Y=t({type:n("file"),mediaType:e().describe("IANA media type of the file (e.g., image/png, audio/mp3)"),data:e().describe("Generated file data as base64 encoded string")}),$=t({type:n("reasoning"),text:e().describe("The reasoning text"),providerOptions:h}),J=t({type:n("reasoning"),text:e().describe("The reasoning text"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),K=t({type:n("tool-call"),toolCallId:e().describe("ID of the tool call, used to match with tool result"),toolName:e().describe("Name of the tool being called"),input:e().describe("Arguments of the tool call (JSON-serializable object matching tool input schema)"),providerExecuted:T().optional().describe("Whether the tool call will be executed by the provider"),providerOptions:h}),V=t({type:n("tool-call"),toolCallId:e().describe("ID of the tool call"),toolName:e().describe("Name of the tool being called"),input:e().describe("Stringified JSON object with the tool call arguments"),providerExecuted:T().optional().describe("Whether the tool call will be executed by the provider"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),z=m([t({type:n("text"),value:e()}),t({type:n("json"),value:I}),t({type:n("error-text"),value:e()}),t({type:n("error-json"),value:I}),t({type:n("content"),value:c(m([t({type:n("text"),text:e().describe("Text content")}),t({type:n("media"),data:e().describe("Base-64 encoded media data"),mediaType:e().describe("IANA media type")})]))}),t({type:n("execution-denied"),reason:e().optional()}),e().describe("Raw or JSON-serialized output (e.g. from AI SDK mapToolResultOutput)")]),x=t({type:n("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),output:z.describe("Result of the tool call"),result:_().describe("Unknown result of the tool call"),providerOptions:h}),H=t({type:n("tool-result"),toolCallId:e().describe("ID of the tool call that this result is associated with"),toolName:e().describe("Name of the tool that generated this result"),result:l().describe("Result of the tool call (JSON-serializable)"),isError:T().optional().describe("Whether the result is an error or error message"),providerExecuted:T().optional().describe("Whether the tool result was generated by the provider"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),X=m([t({type:n("source"),sourceType:n("url"),id:e().describe("The ID of the source"),url:e().describe("The URL of the source"),title:e().optional().describe("The title of the source"),providerMetadata:l().optional().describe("Additional provider-specific metadata")}),t({type:n("source"),sourceType:n("document"),id:e().describe("The ID of the source"),mediaType:e().describe("IANA media type of the document (e.g., application/pdf)"),title:e().describe("The title of the document"),filename:e().optional().describe("Optional filename of the document"),providerMetadata:l().optional().describe("Additional provider-specific metadata")})]),Q=t({role:n("system"),content:e().describe("System message content"),providerOptions:h}),Z=t({role:n("user"),content:c(m([E,R])).describe("User message content parts (text or file)"),providerOptions:h}),ee=t({role:n("assistant"),content:c(m([E,R,$,K,x])).describe("Assistant message content parts (text, file, reasoning, tool-call, or tool-result)"),providerOptions:h}),te=t({role:n("tool"),content:c(x).describe("Tool message content (tool results)"),providerOptions:h}),oe=m([Q,Z,ee,te]),ae=c(oe).describe("A list of messages forming the prompt"),ne=t({prompt:ae.describe("A language model prompt is a standardized prompt type (array of messages with roles: system, user, assistant, tool)"),maxOutputTokens:i().optional().describe("Maximum number of tokens to generate"),temperature:i().optional().describe("Temperature setting. The range depends on the provider and model"),topP:i().optional().describe("Nucleus sampling parameter"),topK:i().optional().describe("Only sample from the top K options for each subsequent token. Used to remove long tail low probability responses"),presencePenalty:i().optional().describe("Presence penalty setting. It affects the likelihood of the model to repeat information that is already in the prompt"),frequencyPenalty:i().optional().describe("Frequency penalty setting. It affects the likelihood of the model to repeatedly use the same words or phrases"),seed:i().optional().describe("The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results"),stopSequences:c(e()).optional().describe("Stop sequences. If set, the model will stop generating text when one of the stop sequences is generated"),responseFormat:m([t({type:n("text")}),t({type:n("json"),schema:l().optional().describe("JSON schema that the generated output should conform to"),name:e().optional().describe("Name of output that should be generated"),description:e().optional().describe("Description of the output that should be generated")})]).optional().describe("Response format. The output can either be text or JSON. Default is text"),tools:c(l()).optional().describe("The tools that are available for the model"),toolChoice:l().optional().describe("Specifies how the tool should be selected. Defaults to 'auto'"),includeRawChunks:T().optional().describe("Include raw chunks in the stream. Only applicable for streaming calls"),abortSignal:l().optional().describe("Abort signal for cancelling the operation"),providerOptions:l().optional().describe("Additional provider-specific options")}),ie=t({content:c(m([j,Y,J,V,H,X])).describe("Ordered content that the model has generated (text, tool-calls, reasoning, files, sources)"),finishReason:y(["stop","length","content-filter","tool-calls","error","other","unknown"]).describe("Reason why generation stopped"),usage:D({inputTokens:i().optional(),outputTokens:i().optional(),totalTokens:i().optional(),reasoningTokens:i().optional()}).describe("Usage information for the language model call"),providerMetadata:l().optional().describe("Additional provider-specific metadata"),request:t({body:l().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:t({id:e().optional().describe("ID for the generated response"),timestamp:M().optional().describe("Timestamp for the start of the generated response"),modelId:e().optional().describe("The ID of the response model that was used"),headers:g(e(),e()).optional().describe("Response headers"),body:l().optional().describe("Response HTTP body")}).optional().describe("Optional response information for telemetry and debugging"),warnings:c(l()).describe("Warnings for the call, e.g. unsupported settings")});t({stream:l().describe("ReadableStream of LanguageModelV2StreamPart"),request:t({body:l().optional().describe("Request HTTP body sent to the provider API")}).optional().describe("Optional request information for telemetry and debugging"),response:t({headers:g(e(),e()).optional().describe("Response headers")}).optional().describe("Optional response data")});const re=t({supportedUrls:g(e(),c(e())).describe("Supported URL patterns by media type for the provider")});t({modelId:e().describe("The ID of the model"),logo:e().nullable(),description:e().nullable(),capabilities:c(e()),limits:t({contextWindow:i(),maxOutputTokens:i()}).nullable(),costs:t({input:i(),output:i()}).nullable(),provider:y(["openai","anthropic","google","x-ai","deepseek","openai-compatible","openrouter"]).nullable()});const N=t({modelId:e().describe("The ID of the model"),callOptions:ne}),se=C.extend({logo:e().nullable(),description:e().nullable(),capabilities:c(e()),limits:t({contextWindow:i(),maxOutputTokens:i()}).nullable(),costs:t({input:i(),output:i()}).nullable(),provider:y(["openai","anthropic","google","xai","deepseek","openai-compatible","openrouter"]).nullable()}),le=O("llm",se,{readOnly:!0}),ce=[{name:"LLM_METADATA",inputSchema:t({modelId:e().describe("The ID of the model")}),outputSchema:re},{name:"LLM_DO_STREAM",inputSchema:N,streamable:!0},{name:"LLM_DO_GENERATE",inputSchema:N,outputSchema:ie},...le],de=t({scopes:c(e()).describe("List of scopes available"),stateSchema:g(e(),_()).describe("JSON Schema (draft-07) defining the state structure")}),pe=[{name:"MCP_CONFIGURATION",inputSchema:t({}),outputSchema:de}],ue=t({}).strict(),me=t({billing:t({mode:y(["prepaid","postpaid"]),limitPeriod:y(["daily","weekly","monthly"]).nullable()}),limit:t({total:i().nullable(),remaining:i().nullable(),reset:e().nullable()}),usage:t({total:i(),daily:i(),weekly:i(),monthly:i()}),alert:t({enabled:T(),threshold_usd:i(),email:e().nullable()}),connectionId:e()}),he=[{name:"GATEWAY_USAGE",inputSchema:ue,outputSchema:me},{name:"GATEWAY_SET_LIMIT",inputSchema:t({}),outputSchema:t({}),opt:!0},{name:"GATEWAY_SET_ALERT",inputSchema:t({}),outputSchema:t({}),opt:!0}],L={LLMS:ce,WORKFLOW:U,WORKFLOW_EXECUTION:G,ASSISTANTS:F,MCP:pe,AI_GATEWAY_BILLING:he};function be(o){return o.map(a=>({name:a.name,inputSchema:a.inputSchema?(()=>{try{return A(a.inputSchema)}catch(s){return console.error(`Failed to convert input schema for ${a.name}:`,s),t({})}})():t({}),outputSchema:a.outputSchema?(()=>{try{return A(a.outputSchema)}catch(s){return console.error(`Failed to convert output schema for ${a.name}:`,s),t({})}})():t({})}))}function fe(o,a){const s=o.tools;if(!s||s.length===0)return!1;const r=s.map(p=>({name:p.name,inputSchema:p.inputSchema})),d=a.map(p=>({name:p.name,inputSchema:p.inputSchema,opt:p.opt}));return v(d).isImplementedBy(r)}function Ae({connections:o,binding:a}){const s=(()=>{if(a){if(typeof a=="string"){const r=a.toUpperCase(),d=L[r];if(!d){console.warn(`[useBindingConnections] Unknown binding "${a}". Available bindings: ${Object.keys(L).join(", ")}. Returning all connections without filtering.`);return}return d}if(a.length===0){console.warn("[useBindingConnections] Empty binding array provided. Returning all connections without filtering.");return}return be(a)}})();return o?s?o.filter(r=>fe(r,s)):o:[]}function ge(o){return o.toLowerCase().split("_").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function P(o){if(!o||o.length===0)return[];const a=/^COLLECTION_(.+)_LIST$/,s=[];for(const r of o){const d=r.name.match(a);d?.[1]&&s.push(d[1])}return s}function Te(o){return!o||o.length===0?!1:o.some(a=>a.name==="REGISTRY_ITEM_LIST"||a.name==="COLLECTION_REGISTRY_APP_LIST"?!0:a.name.startsWith("COLLECTION_REGISTRY_APP_"))}function Se(o,a){const r=o.find(u=>u.name===`COLLECTION_${a}_CREATE`)?.inputSchema?.properties;if(r&&typeof r=="object"&&"data"in r)return r.data;const b=o.find(u=>u.name===`COLLECTION_${a}_UPDATE`)?.inputSchema?.properties;if(b&&typeof b=="object"&&"data"in b)return b.data;const S=o.find(u=>u.name===`COLLECTION_${a}_LIST`)?.outputSchema?.properties;if(S&&typeof S=="object"&&"items"in S){const u=S.items;if(u.items)return u.items}}function ye(o,a){const s=a.toUpperCase();return{hasCreateTool:o.some(r=>r.name===`COLLECTION_${s}_CREATE`),hasUpdateTool:o.some(r=>r.name===`COLLECTION_${s}_UPDATE`),hasDeleteTool:o.some(r=>r.name===`COLLECTION_${s}_DELETE`)}}function Ie(o){if(!o||o.length===0)return[];const a=P(o);if(a.length===0)return[];const s=[];for(const r of a)try{const d=O(r.toLowerCase(),C,{readOnly:!0}),b=o.map(f=>({name:f.name,inputSchema:f.inputSchema})),p=d.map(f=>({name:f.name,inputSchema:f.inputSchema}));if(v(p).isImplementedBy(b)){const f=ye(o,r);s.push({name:r,displayName:ge(r),schema:Se(o,r),...f})}}catch{}return s}function Ne(o){return Ie(o?.tools??null)}function Le(o){return o?o.filter(a=>P(a.tools).includes("REGISTRY_APP")||Te(a.tools)):[]}export{he as A,Ae as a,Ne as b,fe as c,Le as u};
@@ -1 +0,0 @@
1
- import{m as P,c as I,n as Q,t as L,u as x}from"./index-xQ2t379n.js";import{u as v}from"./useMutation-tQLZk7P3.js";import{K,a as q,u as U}from"./constants-BLSLjUCX.js";function b(e,n,s){const t=[];if(e?.trim()){const o=e.trim(),r=s.map(i=>({field:[String(i)],operator:"contains",value:o}));r.length===1&&r[0]?t.push(r[0]):r.length>1&&t.push({operator:"or",conditions:r})}if(n&&n.length>0)for(const o of n)t.push({field:[o.column],operator:"eq",value:o.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function D(e,n,s){const t=e??s,o=n??"asc";return[{field:[String(t)],direction:o}]}function O(e){if(!e||typeof e!="object")throw new Error("Invalid result");if("isError"in e&&e.isError)throw new Error("content"in e&&Array.isArray(e.content)&&e.content[0]?.type==="text"?e.content[0].text:"Unknown error");if("structuredContent"in e)return e.structuredContent;throw new Error("No structured content found")}function k(e,n,s,t){const o=I.c(14);let r,i,u;if(o[0]!==t||o[1]!==n||o[2]!==s||o[3]!==e){const a=n.toUpperCase();r=`COLLECTION_${a}_GET`,u=P,i=K.collectionItem(t,e,"",a,s??""),o[0]=t,o[1]=n,o[2]=s,o[3]=e,o[4]=r,o[5]=i,o[6]=u}else r=o[4],i=o[5],u=o[6];let c;o[7]!==t||o[8]!==r||o[9]!==s?(c=async()=>{if(!s)return{item:null};const a=await t.callTool({name:r,arguments:{id:s}});return O(a)},o[7]=t,o[8]=r,o[9]=s,o[10]=c):c=o[10];let d;o[11]!==i||o[12]!==c?(d={queryKey:i,queryFn:c,staleTime:6e4},o[11]=i,o[12]=c,o[13]=d):d=o[13];const{data:p}=u(d);return p?.item??null}const B={structuredContent:{items:[]},isError:!1};function R(e,n,s,t={}){const{searchTerm:o,filters:r,sortKey:i,sortDirection:u,searchFields:c=["title","description"],defaultSortKey:d="updated_at",pageSize:p=100}=t,a=n.toUpperCase(),m=`COLLECTION_${a}_LIST`,f=b(o,r,c),y=D(i,u,d),C={...f&&{where:f},...y&&{orderBy:y},limit:p,offset:0},g=JSON.stringify(C),E=K.collectionList(s,e,"",a,g),{data:_}=P({queryKey:E,queryFn:async()=>s?await s.callTool({name:m,arguments:C}):B,staleTime:3e4,retry:!1,select:N=>O(N??{})?.items??[]});return _}function X(e,n,s,t={}){const{searchTerm:o,filters:r,sortKey:i,sortDirection:u,searchFields:c=["title","description"],defaultSortKey:d="updated_at",pageSize:p=100}=t,a=n.toUpperCase(),m=b(o,r,c),f=D(i,u,d),y={...m&&{where:m},...f&&{orderBy:f},limit:p,offset:0},C=JSON.stringify(y);return K.collectionList(e,s,"",a,C)}function j(e,n,s){const t=I.c(34),o=Q();let r;t[0]!==n?(r=n.toUpperCase(),t[0]=n,t[1]=r):r=t[1];const i=r,u=`COLLECTION_${i}_CREATE`,c=`COLLECTION_${i}_UPDATE`,d=`COLLECTION_${i}_DELETE`;let p;t[2]!==o||t[3]!==e||t[4]!==i?(p=()=>{o.invalidateQueries({predicate:S=>{const l=S.queryKey;return l[1]===e&&l[3]==="collection"&&l[4]===i}})},t[2]=o,t[3]=e,t[4]=i,t[5]=p):p=t[5];const a=p;let m;t[6]!==s||t[7]!==u?(m=async S=>{const l=await s.callTool({name:u,arguments:{data:S}});if(l.isError)throw new Error(Array.isArray(l.content)?l.content[0]?.text:String(l.content));return O(l).item},t[6]=s,t[7]=u,t[8]=m):m=t[8];let f;t[9]!==a?(f=()=>{a(),L.success("Item created successfully")},t[9]=a,t[10]=f):f=t[10];let y;t[11]!==m||t[12]!==f?(y={mutationFn:m,onSuccess:f,onError:Y},t[11]=m,t[12]=f,t[13]=y):y=t[13];const C=v(y);let g;t[14]!==s||t[15]!==c?(g=async S=>{const{id:l,data:F}=S,M=await s.callTool({name:c,arguments:{id:l,data:F}});return O(M).item},t[14]=s,t[15]=c,t[16]=g):g=t[16];let E;t[17]!==a?(E=()=>{a(),L.success("Item updated successfully")},t[17]=a,t[18]=E):E=t[18];let _;t[19]!==g||t[20]!==E?(_={mutationFn:g,onSuccess:E,onError:J},t[19]=g,t[20]=E,t[21]=_):_=t[21];const N=v(_);let T;t[22]!==s||t[23]!==d?(T=async S=>{const l=await s.callTool({name:d,arguments:{id:S}});return O(l).item.id},t[22]=s,t[23]=d,t[24]=T):T=t[24];let h;t[25]!==a?(h=()=>{a(),L.success("Item deleted successfully")},t[25]=a,t[26]=h):h=t[26];let w;t[27]!==T||t[28]!==h?(w={mutationFn:T,onSuccess:h,onError:z},t[27]=T,t[28]=h,t[29]=w):w=t[29];const A=v(w);let $;return t[30]!==C||t[31]!==A||t[32]!==N?($={create:C,update:N,delete:A},t[30]=C,t[31]=A,t[32]=N,t[33]=$):$=t[33],$}function z(e){const n=e instanceof Error?e.message:String(e);L.error(`Failed to delete item: ${n}`)}function J(e){const n=e instanceof Error?e.message:String(e);L.error(`Failed to update item: ${n}`)}function Y(e){const n=e instanceof Error?e.message:String(e);L.error(`Failed to create item: ${n}`)}function Z(e){const n=I.c(4);let s;n[0]!==e?(s=e===void 0?{}:e,n[0]=e,n[1]=s):s=n[1];const t=s,{org:o}=x();let r;n[2]!==o.id?(r={connectionId:q,orgId:o.id},n[2]=o.id,n[3]=r):r=n[3];const i=U(r);return R(o.id,"CONNECTIONS",i,t)}function tt(e){const n=I.c(2),{org:s}=x();let t;n[0]!==s.id?(t={connectionId:q,orgId:s.id},n[0]=s.id,n[1]=t):t=n[1];const o=U(t);return k(s.id,"CONNECTIONS",e,o)}function et(){const e=I.c(2),{org:n}=x();let s;e[0]!==n.id?(s={connectionId:q,orgId:n.id},e[0]=n.id,e[1]=s):s=e[1];const t=U(s);return j(n.id,"CONNECTIONS",t)}export{B as E,D as a,X as b,b as c,k as d,R as e,tt as f,et as g,Z as h,j as u};
@@ -1 +0,0 @@
1
- import{u as y,d as g,t as e}from"./index-xQ2t379n.js";import{u as C}from"./use-binding-BSjPQ0Be.js";import{g as S,h as v}from"./use-connection-Dtj63U01.js";import{e as B}from"./extract-connection-data-Bjwt_XIu.js";import{f as I,c as P,e as _}from"./registry-utils-Cjdxmsng.js";function w(t){return t.startsWith("@")?t:`@${t}`}function F(){const{org:t}=y(),{data:s}=g.useSession(),i=S(),l=v(),u=C(l);return{installByBinding:async r=>{if(!t||!s?.user?.id){e.error("Not authenticated");return}const d=w(r),a=(await Promise.all(u.map(async o=>{const c=I(o.tools);if(!c)return null;try{const p=await P(o.id,t.id,c,{where:{appName:d}});return _(p??[])[0]??null}catch{return null}}))).find(o=>o!==null);if(!a){e.error(`MCP Server not found in registry: ${r}`);return}const n=B(a,t.id,s.user.id),m=n.connection_type==="STDIO",f=!!n.connection_url,h=m&&n.connection_headers&&typeof n.connection_headers=="object"&&"command"in n.connection_headers;if(!f&&!h){e.error("This MCP Server cannot be connected: no connection method available");return}return await i.create.mutateAsync(n),{id:n.id,connection:n}},isInstalling:i.create.isPending}}export{F as u};
@@ -1 +0,0 @@
1
- import{c,u}from"./index-xQ2t379n.js";import{h as m,e as a}from"./use-connection-Dtj63U01.js";import{j as p}from"./constants-BLSLjUCX.js";import{a as C}from"./use-binding-BSjPQ0Be.js";function x(n,s){const o=c.c(5);let e;o[0]!==s?(e=s===void 0?{}:s,o[0]=s,o[1]=e):e=o[1];const r=e,{org:i}=u();let t;o[2]!==n||o[3]!==i.id?(t={connectionId:n,orgId:i.id},o[2]=n,o[3]=i.id,o[4]=t):t=o[4];const l=p(t);return a(n??"no-connection","LLM",l,r)}function j(){const n=c.c(2),s=m();let o;return n[0]!==s?(o={connections:s,binding:"LLMS"},n[0]=s,n[1]=o):o=n[1],C(o)}export{x as a,j as u};