@decocms/mesh 2.123.4 → 2.124.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 (210) hide show
  1. package/dist/client/assets/{AlertCircle-DiDJuuO7.js → AlertCircle-FqZvtfh1.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-T8X2xR5Y.js → AlertOctagon-raXiOXHj.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-BR7J9Jvh.js → AlertTriangle-Cag6cydu.js} +1 -1
  4. package/dist/client/assets/ArrowDown-BzwwIvol.js +1 -0
  5. package/dist/client/assets/{ArrowLeft-CZ4ZZXqO.js → ArrowLeft-CHSuXHTI.js} +1 -1
  6. package/dist/client/assets/ArrowUp-lkpB-gsw.js +1 -0
  7. package/dist/client/assets/{Check-ebSdGxZp.js → Check-BEIYk4IG.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-BX10u03U.js → CheckCircle-BwIxyhQy.js} +1 -1
  9. package/dist/client/assets/{CheckDone01-BKZeNjYI.js → CheckDone01-Duh5ZNi_.js} +1 -1
  10. package/dist/client/assets/{CheckVerified02-Bc-TzDsw.js → CheckVerified02-DFKFrqtt.js} +1 -1
  11. package/dist/client/assets/{ChevronDown-BxrIQ2Hg.js → ChevronDown-DDsgD0_a.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-D1zpPr9G.js → ChevronRight-dj0VUAfs.js} +1 -1
  13. package/dist/client/assets/{Clock-ByTlM-Ae.js → Clock-Dv-gTw8O.js} +1 -1
  14. package/dist/client/assets/{Code01-62o0ASv5.js → Code01-DbWG3kai.js} +1 -1
  15. package/dist/client/assets/{Container-Cr2TCDTS.js → Container-BY7Dg1ME.js} +1 -1
  16. package/dist/client/assets/{Copy01-CfVZSokb.js → Copy01-BpXeBtQY.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-CEYvQeh9.js → Dataflow03-Ce5PVi3u.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-D_wKOZTi.js → DotsHorizontal--qP7BuAi.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-BNJZVkhj.js → DotsVertical-_M8uWFPN.js} +1 -1
  20. package/dist/client/assets/{Download01-CMusldak.js → Download01-Cvq7FqwC.js} +1 -1
  21. package/dist/client/assets/{Edit01-BySGjbs-.js → Edit01-BOdZHKPa.js} +1 -1
  22. package/dist/client/assets/{Eye-Wh_bq-Y4.js → Eye-D_CQVe6k.js} +1 -1
  23. package/dist/client/assets/{File02-Drnn3tnJ.js → File02-BtCmWw9V.js} +1 -1
  24. package/dist/client/assets/{File06-CL04kImU.js → File06-D2nPQ2vd.js} +1 -1
  25. package/dist/client/assets/{FilterLines-DgwYDfry.js → FilterLines-CeQtwyiF.js} +1 -1
  26. package/dist/client/assets/{Globe01-BMVTN5_w.js → Globe01-BUNBHHR9.js} +1 -1
  27. package/dist/client/assets/{Globe02-BD3ZCWms.js → Globe02-DXh1wFnz.js} +1 -1
  28. package/dist/client/assets/{Grid01-BWcrgmNx.js → Grid01-DDvgvRE8.js} +1 -1
  29. package/dist/client/assets/{Hash02-Dqi3bcQt.js → Hash02-CCi87yL-.js} +1 -1
  30. package/dist/client/assets/{Home02-lTWiIHtK.js → Home02-WM8fzzhX.js} +1 -1
  31. package/dist/client/assets/{Image01-DcX1niB5.js → Image01-ToJS21L5.js} +1 -1
  32. package/dist/client/assets/{Inbox01-8_gDqife.js → Inbox01-Dl3sNTM-.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-BKPaDpeK.js → InfoCircle-CHNw8w2I.js} +1 -1
  34. package/dist/client/assets/{Key01-CyWdmMm6.js → Key01-CBasGMu5.js} +1 -1
  35. package/dist/client/assets/{LinkExternal01-DPNrtGWV.js → LinkExternal01-BIouwr8D.js} +1 -1
  36. package/dist/client/assets/{List-DqeEnxu3.js → List-iNTJ6fUY.js} +1 -1
  37. package/dist/client/assets/{Loading01-BZRHfswB.js → Loading01-BFMhWWtD.js} +1 -1
  38. package/dist/client/assets/{Lock01-BDqkVPGz.js → Lock01-C4Sc75k7.js} +1 -1
  39. package/dist/client/assets/{Pin01-BDMJN64-.js → Pin01-BE9Oh0sU.js} +1 -1
  40. package/dist/client/assets/{Play-BKXV9SNy.js → Play-gsrF7xxW.js} +1 -1
  41. package/dist/client/assets/{Plus-YlJja9E2.js → Plus-Ck954sGm.js} +1 -1
  42. package/dist/client/assets/{RefreshCcw01-Ci0qepHw.js → RefreshCcw01-zTyzcouM.js} +1 -1
  43. package/dist/client/assets/{RefreshCw01-Sv3Ciq4-.js → RefreshCw01-DbiZ19Ml.js} +1 -1
  44. package/dist/client/assets/{Rows03-DjbwBGBI.js → Rows03-B0JH9Ohl.js} +1 -1
  45. package/dist/client/assets/{Save01-CUHpjboy.js → Save01-CGYgsRh8.js} +1 -1
  46. package/dist/client/assets/{SearchMd-CdY2Qz31.js → SearchMd-Dvn1Eo76.js} +1 -1
  47. package/dist/client/assets/{Settings01-hHMZndAB.js → Settings01-CE-2gHzf.js} +1 -1
  48. package/dist/client/assets/{Shield01-BC6B_xBt.js → Shield01-BB8IGqoD.js} +1 -1
  49. package/dist/client/assets/{Terminal-D2rGQta9.js → Terminal-DQESGxaj.js} +1 -1
  50. package/dist/client/assets/{Trash01-DjSET-_p.js → Trash01-BC7PAlKV.js} +1 -1
  51. package/dist/client/assets/{Upload01-C0CPwbYb.js → Upload01-CASznv9t.js} +1 -1
  52. package/dist/client/assets/{Users03-BiJcw06H.js → Users03-DJ0q7ZN3.js} +1 -1
  53. package/dist/client/assets/{XCircle-oJlXTAnn.js → XCircle-JhpX2IQK.js} +1 -1
  54. package/dist/client/assets/{XClose-CNjsPY9p.js → XClose-Cpw_0BW6.js} +1 -1
  55. package/dist/client/assets/{agent-connections-preview-CyTgEjXK.js → agent-connections-preview-Dhs8DGJ9.js} +1 -1
  56. package/dist/client/assets/agent-detail-C8HmsASY.js +2 -0
  57. package/dist/client/assets/agents-BUO9Of5M.js +1 -0
  58. package/dist/client/assets/alert-dialog-K0UnFp_v.js +7 -0
  59. package/dist/client/assets/{auth-catchall-BSjXqHGj.js → auth-catchall-Cts5maQI.js} +1 -1
  60. package/dist/client/assets/{avatar-CLzAk7bk.js → avatar-BLu12sL5.js} +1 -1
  61. package/dist/client/assets/{badge-zj5rJqFG.js → badge-D4ZHiXFA.js} +1 -1
  62. package/dist/client/assets/{binder-Yx0eVQL7.js → binder-BeV9Iq0g.js} +1 -1
  63. package/dist/client/assets/{breadcrumb-p3FP4YzT.js → breadcrumb-kQQ-d55s.js} +1 -1
  64. package/dist/client/assets/{button-BlFVi9O-.js → button-BxOn_P7A.js} +1 -1
  65. package/dist/client/assets/{card-C5XZXHnb.js → card-DMS-g9Fe.js} +1 -1
  66. package/dist/client/assets/{chart-CECGc95G.js → chart-Dm5seKC_.js} +1 -1
  67. package/dist/client/assets/{checkbox-C81GTltZ.js → checkbox-QVK1EYTJ.js} +1 -1
  68. package/dist/client/assets/{circle-alert-DTrbbil0.js → circle-alert-BGE5uKTO.js} +1 -1
  69. package/dist/client/assets/{collection-detail-DC6lEGsR.js → collection-detail-BNuWQnMo.js} +3 -3
  70. package/dist/client/assets/collection-search-WzmN-NEH.js +1 -0
  71. package/dist/client/assets/collection-tab-CqF7e-el.js +1 -0
  72. package/dist/client/assets/collection-table-wrapper-DpYYlIci.js +1 -0
  73. package/dist/client/assets/{collection-tabs-DXae7bMN.js → collection-tabs-BzQ9gNkb.js} +1 -1
  74. package/dist/client/assets/{command-C0Lk3OoX.js → command-pJXSXf5S.js} +1 -1
  75. package/dist/client/assets/{connect-B0zgap2s.js → connect-DpHmbRge.js} +1 -1
  76. package/dist/client/assets/{connection-card-Bfx8qlqL.js → connection-card-CRsOF1KU.js} +1 -1
  77. package/dist/client/assets/connection-detail-B1dOB0AI.js +1 -0
  78. package/dist/client/assets/connections-EWXE105G.js +1 -0
  79. package/dist/client/assets/{constants-DS4O9R8r.js → constants-9bKBT988.js} +1 -1
  80. package/dist/client/assets/constants-CS_UcM7e.js +1 -0
  81. package/dist/client/assets/context-LmNUO0nU.js +23 -0
  82. package/dist/client/assets/{create-organization-dialog-BFIfEtVL.js → create-organization-dialog-CuKocaBI.js} +1 -1
  83. package/dist/client/assets/{create-project-dialog-D2mtQ7wt.js → create-project-dialog-heqHF5Xt.js} +1 -1
  84. package/dist/client/assets/deco-constants-YxoGHwHI.js +1 -0
  85. package/dist/client/assets/{dialog-BED3woG1.js → dialog-8Qx5GCEw.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-Db2R0f6-.js → dropdown-menu-BbhseL--.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-BzLyvc2d.js → dynamic-plugin-layout-Ch1QuglW.js} +1 -1
  88. package/dist/client/assets/empty-state-C7VZap1W.js +1 -0
  89. package/dist/client/assets/{empty-state-CIZqXQMR.js → empty-state-CSzTWTZI.js} +1 -1
  90. package/dist/client/assets/{env-vars-editor-CDWwUXgx.js → env-vars-editor-C0KF8UB-.js} +1 -1
  91. package/dist/client/assets/{error-boundary-DFWzxGF2.js → error-boundary-BpCU-F5d.js} +1 -1
  92. package/dist/client/assets/{extract-connection-data-1y_2LKN1.js → extract-connection-data-CLG2vt6G.js} +1 -1
  93. package/dist/client/assets/{file-browser-BLbb-Y8y.js → file-browser-4BKj7MWu.js} +2 -2
  94. package/dist/client/assets/{form-DdvC8UfL.js → form-Dn5Ilwyi.js} +1 -1
  95. package/dist/client/assets/{grid-view-CqSeu3_O.js → grid-view-aIHLkNPN.js} +1 -1
  96. package/dist/client/assets/{home-DlTcQ85K.js → home-md1YObTz.js} +1 -1
  97. package/dist/client/assets/index-BpxApmrT.css +1 -0
  98. package/dist/client/assets/{index-Cs9SJKB2.js → index-BtVQ48XT.js} +1 -1
  99. package/dist/client/assets/{index-Bb5ajAZZ.js → index-CIUI9_Ip.js} +63 -65
  100. package/dist/client/assets/{index-BG2jkRwM.js → index-CWIKLTkS.js} +1 -1
  101. package/dist/client/assets/{index-Chdo1wOf.js → index-DQipirM0.js} +3 -3
  102. package/dist/client/assets/{index-C5tdq0OE.js → index-DdzAhdkZ.js} +1 -1
  103. package/dist/client/assets/{index-6Tp9fsVX.js → index-DlglR7Dv.js} +1 -1
  104. package/dist/client/assets/{index-D8_oQFvH.js → index-Du85XF43.js} +1 -1
  105. package/dist/client/assets/{index-CNFSBpm2.js → index-ow5WSrzH.js} +1 -1
  106. package/dist/client/assets/{infiniteQueryObserver-DOxbID_2.js → infiniteQueryObserver-45WqMl59.js} +1 -1
  107. package/dist/client/assets/{input-C2bYHqSZ.js → input-D3a40-af.js} +1 -1
  108. package/dist/client/assets/{integration-icon-CHfvIBul.js → integration-icon-6FQvxTss.js} +1 -1
  109. package/dist/client/assets/{label-Cz00Hk_C.js → label-_-PuJzKE.js} +1 -1
  110. package/dist/client/assets/{layout-D8HdJww7.js → layout-C5y_iFls.js} +1 -1
  111. package/dist/client/assets/{localstorage-keys-D6jY_B8O.js → localstorage-keys-Xr0m_-Nl.js} +1 -1
  112. package/dist/client/assets/{login-B4sEC044.js → login-CGG5vJdW.js} +1 -1
  113. package/dist/client/assets/{markdown-W0glOUUc.js → markdown-DumqyZQo.js} +2 -2
  114. package/dist/client/assets/{mcp-oauth-CxZiVIG0.js → mcp-oauth-ZHptqU19.js} +1 -1
  115. package/dist/client/assets/{mcp-server-card-MyE_33s4.js → mcp-server-card-uS3QofMZ.js} +1 -1
  116. package/dist/client/assets/mcp-server-detail-BKF_R4E0.js +2 -0
  117. package/dist/client/assets/members-BRSEA55l.js +3 -0
  118. package/dist/client/assets/{monitoring-DnyUAZQs.js → monitoring-ChGczzDH.js} +2 -2
  119. package/dist/client/assets/{monitoring-dashboard-edit-CeSLs60r.js → monitoring-dashboard-edit-1EYxjqsS.js} +1 -1
  120. package/dist/client/assets/{monitoring-dashboard-view-CXYrse_E.js → monitoring-dashboard-view-B9ky_iuo.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-CtEIzTst.js → oauth-callback-DiCjOlTo.js} +1 -1
  122. package/dist/client/assets/page-Bd4vke_j.js +1 -0
  123. package/dist/client/assets/page-BqTRzB6R.js +1 -0
  124. package/dist/client/assets/{plugin-empty-state-C3dQRExn.js → plugin-empty-state-3Ic2Cddr.js} +1 -1
  125. package/dist/client/assets/{plugin-empty-state-CtOLvnau.js → plugin-empty-state-B0aoDY0o.js} +1 -1
  126. package/dist/client/assets/{plugin-header-BpYtnCvY.js → plugin-header-1MpH5dMN.js} +1 -1
  127. package/dist/client/assets/{plugin-header-wMO8zy_s.js → plugin-header-lqwqxxa8.js} +1 -1
  128. package/dist/client/assets/{popover-B4On8gSm.js → popover-O7pPZSal.js} +1 -1
  129. package/dist/client/assets/project-layout-Dk2D-43Q.js +1 -0
  130. package/dist/client/assets/projects-list-CApnnFAH.js +1 -0
  131. package/dist/client/assets/ranking-layout-CB_f3cVs.js +1 -0
  132. package/dist/client/assets/{readme-viewer-gb5hrmSg.js → readme-viewer-61IpnmPP.js} +1 -1
  133. package/dist/client/assets/{registry-layout-Cyki9u_h.js → registry-layout-DGM76yIZ.js} +1 -1
  134. package/dist/client/assets/{registry-utils-BL6Np0uD.js → registry-utils-DSUIffwE.js} +1 -1
  135. package/dist/client/assets/{reports-layout-DImwy6ND.js → reports-layout-BMSW5Pvz.js} +2 -2
  136. package/dist/client/assets/{reset-password-ButVRXi9.js → reset-password-R313_uMV.js} +1 -1
  137. package/dist/client/assets/{resizable-DUdJ1A_O.js → resizable-Dz9Hl0cL.js} +1 -1
  138. package/dist/client/assets/{save-actions-BiCpAXjr.js → save-actions-De5hNsxX.js} +1 -1
  139. package/dist/client/assets/{scroll-area-C9Z4g4D3.js → scroll-area-dZhjEr7K.js} +1 -1
  140. package/dist/client/assets/{select-DwyzrBGR.js → select-BSYdCUMN.js} +1 -1
  141. package/dist/client/assets/shell-layout-CGTPLB_Q.js +3 -0
  142. package/dist/client/assets/{skeleton-DdrlSfda.js → skeleton-D-Lsp11A.js} +1 -1
  143. package/dist/client/assets/{spinner-DeIV40-d.js → spinner-BL4ZMZYA.js} +1 -1
  144. package/dist/client/assets/{store-invite-DHfus7Si.js → store-invite-B0hYE1ZZ.js} +1 -1
  145. package/dist/client/assets/{switch-BW_XeGpN.js → switch-DyckCxcC.js} +1 -1
  146. package/dist/client/assets/{table-N5hQy-1m.js → table-D0pFXKN4.js} +1 -1
  147. package/dist/client/assets/tasks-DPZywEmF.js +1 -0
  148. package/dist/client/assets/{textarea-B5CEImaf.js → textarea-DX9d61Sr.js} +1 -1
  149. package/dist/client/assets/{time-range-picker-B3M_kZtN.js → time-range-picker-fngIp4Wo.js} +1 -1
  150. package/dist/client/assets/{toggle-group-k8q-T2Qa.js → toggle-group-Z0vsy7J4.js} +1 -1
  151. package/dist/client/assets/tools-list-B0lut0n1.js +1 -0
  152. package/dist/client/assets/{tooltip-BWW8lvJo.js → tooltip-B7RjBzxU.js} +1 -1
  153. package/dist/client/assets/{topbar-portal-m9wB0x-E.js → topbar-portal-D44GN90b.js} +1 -1
  154. package/dist/client/assets/{typewriter-title-DcVIzze1.js → typewriter-title-CkssIeLy.js} +1 -1
  155. package/dist/client/assets/{use-binding-DT0OPEEL.js → use-binding-oEpPFbv0.js} +1 -1
  156. package/dist/client/assets/{use-connection-O4z2Mc_F.js → use-connection-DXequUdB.js} +1 -1
  157. package/dist/client/assets/{use-copy-Drx5AGFH.js → use-copy-h8i-bDIZ.js} +1 -1
  158. package/dist/client/assets/{use-create-virtual-mcp-CZu2JnDv.js → use-create-virtual-mcp-DG-_igKD.js} +1 -1
  159. package/dist/client/assets/use-deco-chat-open-BAG5m-JA.js +1 -0
  160. package/dist/client/assets/{use-install-from-registry-Dc84s0lp.js → use-install-from-registry-BCGIZz8M.js} +1 -1
  161. package/dist/client/assets/{use-list-state-DQM_pDDC.js → use-list-state-DjtYoYEW.js} +1 -1
  162. package/dist/client/assets/{use-llm-Z9GIoSzc.js → use-llm-DDqwpIPn.js} +1 -1
  163. package/dist/client/assets/{use-mcp-prompts-uD1aNW_g.js → use-mcp-prompts-CqOiamVC.js} +1 -1
  164. package/dist/client/assets/{use-mcp-tools-B8wkpbTs.js → use-mcp-tools-Dt6WorDi.js} +1 -1
  165. package/dist/client/assets/{use-mobile-ziAtnWz2.js → use-mobile-CYG2M3Mj.js} +1 -1
  166. package/dist/client/assets/{use-organization-settings-BJEr33WT.js → use-organization-settings-Db9DvZjz.js} +1 -1
  167. package/dist/client/assets/{use-project-Dz1PHkz5.js → use-project-x4-rNIeb.js} +1 -1
  168. package/dist/client/assets/{use-settings-modal-CYH_HZlL.js → use-settings-modal-D-E-U1i_.js} +1 -1
  169. package/dist/client/assets/{use-view-mode-CRJUL6S-.js → use-view-mode-C5FzaFBT.js} +1 -1
  170. package/dist/client/assets/{use-virtual-mcp-BateG3is.js → use-virtual-mcp-Bq4iD2DN.js} +1 -1
  171. package/dist/client/assets/useInfiniteQuery-qwQj5SMK.js +1 -0
  172. package/dist/client/assets/{useMutation-BTkDU0tp.js → useMutation-8rEyObWg.js} +1 -1
  173. package/dist/client/assets/useQuery-CqT-L2b-.js +1 -0
  174. package/dist/client/assets/useSuspenseInfiniteQuery-BKpm_7Fb.js +1 -0
  175. package/dist/client/assets/view-mode-toggle-DumSmhPz.js +1 -0
  176. package/dist/client/assets/workflow-Nf6onDYr.js +1 -0
  177. package/dist/client/index.html +2 -2
  178. package/dist/server/cli.js +168 -168
  179. package/dist/server/migrate.js +2 -2
  180. package/dist/server/server.js +2 -2
  181. package/package.json +1 -1
  182. package/dist/client/assets/ArrowUp-CBTnQfpb.js +0 -1
  183. package/dist/client/assets/Tool01-8K3JOGke.js +0 -1
  184. package/dist/client/assets/agent-detail-9DFcapAu.js +0 -2
  185. package/dist/client/assets/agents-4gtiAnuv.js +0 -1
  186. package/dist/client/assets/alert-dialog-DG1mgLiN.js +0 -7
  187. package/dist/client/assets/collection-tab-dYtQ3dOc.js +0 -1
  188. package/dist/client/assets/collection-table-wrapper-D3UQPYYs.js +0 -1
  189. package/dist/client/assets/connection-detail-CFl60IV3.js +0 -1
  190. package/dist/client/assets/connections-40Z9p3na.js +0 -1
  191. package/dist/client/assets/constants-0nWmzfAq.js +0 -1
  192. package/dist/client/assets/context-CJpih0Aq.js +0 -23
  193. package/dist/client/assets/deco-constants-B2fB4qCk.js +0 -1
  194. package/dist/client/assets/empty-state-DwKYfPjb.js +0 -1
  195. package/dist/client/assets/index-BHAz67cr.css +0 -1
  196. package/dist/client/assets/mcp-server-detail-DPKP-AVk.js +0 -2
  197. package/dist/client/assets/members-C0wNcB0L.js +0 -3
  198. package/dist/client/assets/page-BaeXPwI_.js +0 -1
  199. package/dist/client/assets/page-wIVLNXO6.js +0 -1
  200. package/dist/client/assets/project-layout-1AjzWWMn.js +0 -1
  201. package/dist/client/assets/projects-list-DNSZsINF.js +0 -1
  202. package/dist/client/assets/ranking-layout-BgeMngBH.js +0 -1
  203. package/dist/client/assets/shell-layout-BGf6BKNx.js +0 -3
  204. package/dist/client/assets/tasks-CKkoq9mO.js +0 -1
  205. package/dist/client/assets/tools-list-TXvbi7bf.js +0 -1
  206. package/dist/client/assets/use-deco-chat-open-Qq9AtQ8h.js +0 -1
  207. package/dist/client/assets/useInfiniteQuery-BHuahm2t.js +0 -1
  208. package/dist/client/assets/useQuery-C0AkqYB7.js +0 -1
  209. package/dist/client/assets/useSuspenseInfiniteQuery-DPaJK1nP.js +0 -1
  210. package/dist/client/assets/workflow-CTPlOYoh.js +0 -1
@@ -0,0 +1,23 @@
1
+ import{r as I,bH as Xa,bI as Ka,D as es,bc as q,s as x,bJ as Be,bK as Yt,bg as ts,bh as as,bb as ss,bd as B,b7 as je,aj as $e,o as j,be as E,bf as ue,bL as rs,bM as k,ak as os,bp as ns,c as D,u as be,K as ye,e as Qt,m as We,t as ke,j as d,b as is,O as ls,d as cs}from"./index-DQipirM0.js";import{u as mt,a as ft,d as us}from"./constants-9bKBT988.js";import{b as ds}from"./use-virtual-mcp-Bq4iD2DN.js";import{A as Nt,D as Ke}from"./decopilot-events-Brt4gAR6.js";import{u as ht,a as ps}from"./use-llm-DDqwpIPn.js";import{u as ms}from"./useQuery-CqT-L2b-.js";import{u as qe,L as gt}from"./localstorage-keys-Xr0m_-Nl.js";import{E as vt}from"./error-boundary-BpCU-F5d.js";import{S as U,u as fs}from"./skeleton-D-Lsp11A.js";import{c as Xt,B as rt}from"./button-BxOn_P7A.js";import{I as hs}from"./input-D3a40-af.js";import{P as gs,a as vs,b as ys}from"./popover-O7pPZSal.js";import{S as xs,a as bs,b as _s,c as Es,d as Ss}from"./select-BSYdCUMN.js";import{i as Is}from"./AlertTriangle-Cag6cydu.js";import{t as ot}from"./ChevronDown-DDsgD0_a.js";import{i as ws}from"./File06-D2nPQ2vd.js";import{c as Ns}from"./Grid01-DDvgvRE8.js";import{a as Ts}from"./Image01-ToJS21L5.js";import{s as Cs}from"./RefreshCcw01-zTyzcouM.js";import{i as Kt}from"./SearchMd-Dvn1Eo76.js";import{t as As}from"./Settings01-CE-2gHzf.js";import{b as yt,c as Ms,a as Rs,e as js}from"./use-connection-DXequUdB.js";import{u as ks}from"./useSuspenseInfiniteQuery-BKpm_7Fb.js";var Oe;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function a(r){throw new Error}t.assertNever=a,t.arrayToEnum=r=>{const o={};for(const i of r)o[i]=i;return o},t.getValidEnumValues=r=>{const o=t.objectKeys(r).filter(n=>typeof r[r[n]]!="number"),i={};for(const n of o)i[n]=r[n];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(i);return o},t.find=(r,o)=>{for(const i of r)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,o=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=s,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var Tt;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Tt||(Tt={}));Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class He extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},s={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(a(i));else{let n=s,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(n[l]=n[l]||{_errors:[]},n[l]._errors.push(a(i))):n[l]=n[l]||{_errors:[]},n=n[l],c++}}};return r(this),s}static assert(e){if(!(e instanceof He))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),s=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];a[o]=a[o]||[],a[o].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:a}}get formErrors(){return this.flatten()}}He.create=t=>new He(t);var Ct;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Ct||(Ct={}));var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const ea=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));ea.displayName="ChevronSelectorVertical";const ta=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));ta.displayName="CurrencyDollar";const aa=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));aa.displayName="LogOut04";const sa=({size:t=24,color:e="currentColor",...a})=>I.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},I.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));sa.displayName="Stars01";var ra="vercel.ai.error",Os=Symbol.for(ra),At,Mt,K=class oa extends(Mt=Error,At=Os,Mt){constructor({name:e,message:a,cause:s}){super(a),this[At]=!0,this.name=e,this.cause=s}static isInstance(e){return oa.hasMarker(e,ra)}static hasMarker(e,a){const s=Symbol.for(a);return e!=null&&typeof e=="object"&&s in e&&typeof e[s]=="boolean"&&e[s]===!0}};function na(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var ia="AI_InvalidArgumentError",la=`vercel.ai.error.${ia}`,Ps=Symbol.for(la),Rt,jt,Ds=class extends(jt=K,Rt=Ps,jt){constructor({message:t,cause:e,argument:a}){super({name:ia,message:t,cause:e}),this[Rt]=!0,this.argument=a}static isInstance(t){return K.hasMarker(t,la)}},ca="AI_JSONParseError",ua=`vercel.ai.error.${ca}`,$s=Symbol.for(ua),kt,Ot,Pt=class extends(Ot=K,kt=$s,Ot){constructor({text:t,cause:e}){super({name:ca,message:`JSON parsing failed: Text: ${t}.
2
+ Error message: ${na(e)}`,cause:e}),this[kt]=!0,this.text=t}static isInstance(t){return K.hasMarker(t,ua)}},da="AI_TypeValidationError",pa=`vercel.ai.error.${da}`,Ls=Symbol.for(pa),Dt,$t,Ne=class nt extends($t=K,Dt=Ls,$t){constructor({value:e,cause:a,context:s}){let r="Type validation failed";if(s?.field&&(r+=` for ${s.field}`),s?.entityName||s?.entityId){r+=" (";const o=[];s.entityName&&o.push(s.entityName),s.entityId&&o.push(`id: "${s.entityId}"`),r+=o.join(", "),r+=")"}super({name:da,message:`${r}: Value: ${JSON.stringify(e)}.
3
+ Error message: ${na(a)}`,cause:a}),this[Dt]=!0,this.value=e,this.context=s}static isInstance(e){return K.hasMarker(e,pa)}static wrap({value:e,cause:a,context:s}){var r,o,i;return nt.isInstance(a)&&a.value===e&&((r=a.context)==null?void 0:r.field)===s?.field&&((o=a.context)==null?void 0:o.entityName)===s?.entityName&&((i=a.context)==null?void 0:i.entityId)===s?.entityId?a:new nt({value:e,cause:a,context:s})}},Le=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:s="-"}={})=>{const r=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return r;if(a.includes(s))throw new Ds({argument:"separator",message:`The separator "${s}" must not be part of the alphabet "${a}".`});return()=>`${t}${s}${r()}`},Zs=Le();function Lt(t=globalThis){var e,a,s;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(s=(a=t.process)==null?void 0:a.versions)!=null&&s.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function ve(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((a,s)=>{e[s.toLowerCase()]=a});else{Array.isArray(t)||(t=Object.entries(t));for(const[a,s]of t)s!=null&&(e[a.toLowerCase()]=s)}return e}function Zt(t,...e){const a=new Headers(ve(t)),s=a.get("user-agent")||"";return a.set("user-agent",[s,...e].filter(Boolean).join(" ")),Object.fromEntries(a.entries())}var Fs=/"__proto__"\s*:/,Us=/"constructor"\s*:/;function Ft(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Fs.test(t)===!1&&Us.test(t)===!1?e:zs(e)}function zs(t){let e=[t];for(;e.length;){const a=e;e=[];for(const s of a){if(Object.prototype.hasOwnProperty.call(s,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const r in s){const o=s[r];o&&typeof o=="object"&&e.push(o)}}}return t}function Vs(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ft(t)}try{return Ft(t)}finally{Error.stackTraceLimit=e}}function xt(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const s of Object.keys(a))a[s]=ge(a[s])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(ge):ge(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(ge)),t.allOf!=null&&(t.allOf=t.allOf.map(ge)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(ge));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=ge(e[a]);return t}function ge(t){return typeof t=="boolean"?t:xt(t)}var Bs=Symbol("Let zodToJsonSchema decide on which parser to use"),Ut={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},qs=t=>typeof t=="string"?{...Ut,name:t}:{...Ut,...t};function W(){return{}}function Hs(t,e){var a,s,r;const o={type:"array"};return(a=t.type)!=null&&a._def&&((r=(s=t.type)==null?void 0:s._def)==null?void 0:r.typeName)!==w.ZodAny&&(o.items=R(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Ws(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Js(){return{type:"boolean"}}function ma(t,e){return R(t.type._def,e)}var Gs=(t,e)=>R(t.innerType._def,e);function fa(t,e,a){const s=a??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((r,o)=>fa(t,e,r))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Ys(t)}}var Ys=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Qs(t,e){return{...R(t.innerType._def,e),default:t.defaultValue()}}function Xs(t,e){return e.effectStrategy==="input"?R(t.schema._def,e):W()}function Ks(t){return{type:"string",enum:Array.from(t.values)}}var er=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function tr(t,e){const a=[R(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),R(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(r=>!!r),s=[];return a.forEach(r=>{if(er(r))s.push(...r.allOf);else{let o=r;if("additionalProperties"in r&&r.additionalProperties===!1){const{additionalProperties:i,...n}=r;o=n}s.push(o)}}),s.length?{allOf:s}:void 0}function ar(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var et=void 0,G={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(et===void 0&&(et=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),et),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function ha(t,e){const a={type:"string"};if(t.checks)for(const s of t.checks)switch(s.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"email":switch(e.emailStrategy){case"format:email":Y(a,"email",s.message,e);break;case"format:idn-email":Y(a,"idn-email",s.message,e);break;case"pattern:zod":V(a,G.email,s.message,e);break}break;case"url":Y(a,"uri",s.message,e);break;case"uuid":Y(a,"uuid",s.message,e);break;case"regex":V(a,s.regex,s.message,e);break;case"cuid":V(a,G.cuid,s.message,e);break;case"cuid2":V(a,G.cuid2,s.message,e);break;case"startsWith":V(a,RegExp(`^${tt(s.value,e)}`),s.message,e);break;case"endsWith":V(a,RegExp(`${tt(s.value,e)}$`),s.message,e);break;case"datetime":Y(a,"date-time",s.message,e);break;case"date":Y(a,"date",s.message,e);break;case"time":Y(a,"time",s.message,e);break;case"duration":Y(a,"duration",s.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,s.value):s.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,s.value):s.value;break;case"includes":{V(a,RegExp(tt(s.value,e)),s.message,e);break}case"ip":{s.version!=="v6"&&Y(a,"ipv4",s.message,e),s.version!=="v4"&&Y(a,"ipv6",s.message,e);break}case"base64url":V(a,G.base64url,s.message,e);break;case"jwt":V(a,G.jwt,s.message,e);break;case"cidr":{s.version!=="v6"&&V(a,G.ipv4Cidr,s.message,e),s.version!=="v4"&&V(a,G.ipv6Cidr,s.message,e);break}case"emoji":V(a,G.emoji(),s.message,e);break;case"ulid":{V(a,G.ulid,s.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Y(a,"binary",s.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{V(a,G.base64,s.message,e);break}}break}case"nanoid":V(a,G.nanoid,s.message,e)}return a}function tt(t,e){return e.patternStrategy==="escape"?rr(t):t}var sr=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function rr(t){let e="";for(let a=0;a<t.length;a++)sr.has(t[a])||(e+="\\"),e+=t[a];return e}function Y(t,e,a,s){var r;t.format||(r=t.anyOf)!=null&&r.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&s.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function V(t,e,a,s){var r;t.pattern||(r=t.allOf)!=null&&r.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:zt(e,s),...a&&s.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=zt(e,s)}function zt(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const s={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},r=s.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,c=!1;for(let l=0;l<r.length;l++){if(i){o+=r[l],i=!1;continue}if(s.i){if(n){if(r[l].match(/[a-z]/)){c?(o+=r[l],o+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&((a=r[l+2])!=null&&a.match(/[a-z]/))?(o+=r[l],c=!0):o+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){o+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(s.m){if(r[l]==="^"){o+=`(^|(?<=[\r
4
+ ]))`;continue}else if(r[l]==="$"){o+=`($|(?=[\r
5
+ ]))`;continue}}if(s.s&&r[l]==="."){o+=n?`${r[l]}\r
6
+ `:`[${r[l]}\r
7
+ ]`;continue}o+=r[l],r[l]==="\\"?i=!0:n&&r[l]==="]"?n=!1:!n&&r[l]==="["&&(n=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return o}function ga(t,e){var a,s,r,o,i,n;const c={type:"object",additionalProperties:(a=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?a:e.allowedAdditionalProperties};if(((s=t.keyType)==null?void 0:s._def.typeName)===w.ZodString&&((r=t.keyType._def.checks)!=null&&r.length)){const{type:l,...p}=ha(t.keyType._def,e);return{...c,propertyNames:p}}else{if(((o=t.keyType)==null?void 0:o._def.typeName)===w.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(((i=t.keyType)==null?void 0:i._def.typeName)===w.ZodBranded&&t.keyType._def.type._def.typeName===w.ZodString&&((n=t.keyType._def.type._def.checks)!=null&&n.length)){const{type:l,...p}=ma(t.keyType._def,e);return{...c,propertyNames:p}}}return c}function or(t,e){if(e.mapStrategy==="record")return ga(t,e);const a=R(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||W(),s=R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||W();return{type:"array",maxItems:125,items:{type:"array",items:[a,s],minItems:2,maxItems:2}}}function nr(t){const e=t.values,s=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),r=Array.from(new Set(s.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:s}}function ir(){return{not:W()}}function lr(){return{type:"null"}}var it={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function cr(t,e){const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(s=>s._def.typeName in it&&(!s._def.checks||!s._def.checks.length))){const s=a.reduce((r,o)=>{const i=it[o._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:s.length>1?s:s[0]}}else if(a.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){const s=a.reduce((r,o)=>{const i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(s.length===a.length){const r=s.filter((o,i,n)=>n.indexOf(o)===i);return{type:r.length>1?r:r[0],enum:a.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(a.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((s,r)=>[...s,...r._def.values.filter(o=>!s.includes(o))],[])};return ur(t,e)}var ur=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((s,r)=>R(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return a.length?{anyOf:a}:void 0};function dr(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[it[t.innerType._def.typeName],"null"]};const a=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function pr(t){const e={type:"number"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"int":e.type="integer";break;case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function mr(t,e){const a={type:"object",properties:{}},s=[],r=t.shape();for(const i in r){let n=r[i];if(n===void 0||n._def===void 0)continue;const c=hr(n),l=R(n._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(a.properties[i]=l,c||s.push(i))}s.length&&(a.required=s);const o=fr(t,e);return o!==void 0&&(a.additionalProperties=o),a}function fr(t,e){if(t.catchall._def.typeName!=="ZodNever")return R(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function hr(t){try{return t.isOptional()}catch{return!0}}var gr=(t,e)=>{var a;if(e.currentPath.toString()===((a=e.propertyPath)==null?void 0:a.toString()))return R(t.innerType._def,e);const s=R(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return s?{anyOf:[{not:W()},s]}:W()},vr=(t,e)=>{if(e.pipeStrategy==="input")return R(t.in._def,e);if(e.pipeStrategy==="output")return R(t.out._def,e);const a=R(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=R(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,s].filter(r=>r!==void 0)}};function yr(t,e){return R(t.type._def,e)}function xr(t,e){const s={type:"array",uniqueItems:!0,items:R(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(s.minItems=t.minSize.value),t.maxSize&&(s.maxItems=t.maxSize.value),s}function br(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[]),additionalItems:R(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,s)=>R(a._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((a,s)=>s===void 0?a:[...a,s],[])}}function _r(){return{not:W()}}function Er(){return W()}var Sr=(t,e)=>R(t.innerType._def,e),Ir=(t,e,a)=>{switch(e){case w.ZodString:return ha(t,a);case w.ZodNumber:return pr(t);case w.ZodObject:return mr(t,a);case w.ZodBigInt:return Ws(t);case w.ZodBoolean:return Js();case w.ZodDate:return fa(t,a);case w.ZodUndefined:return _r();case w.ZodNull:return lr();case w.ZodArray:return Hs(t,a);case w.ZodUnion:case w.ZodDiscriminatedUnion:return cr(t,a);case w.ZodIntersection:return tr(t,a);case w.ZodTuple:return br(t,a);case w.ZodRecord:return ga(t,a);case w.ZodLiteral:return ar(t);case w.ZodEnum:return Ks(t);case w.ZodNativeEnum:return nr(t);case w.ZodNullable:return dr(t,a);case w.ZodOptional:return gr(t,a);case w.ZodMap:return or(t,a);case w.ZodSet:return xr(t,a);case w.ZodLazy:return()=>t.getter()._def;case w.ZodPromise:return yr(t,a);case w.ZodNaN:case w.ZodNever:return ir();case w.ZodEffects:return Xs(t,a);case w.ZodAny:return W();case w.ZodUnknown:return Er();case w.ZodDefault:return Qs(t,a);case w.ZodBranded:return ma(t,a);case w.ZodReadonly:return Sr(t,a);case w.ZodCatch:return Gs(t,a);case w.ZodPipeline:return vr(t,a);case w.ZodFunction:case w.ZodVoid:case w.ZodSymbol:return;default:return(s=>{})()}},wr=(t,e)=>{let a=0;for(;a<t.length&&a<e.length&&t[a]===e[a];a++);return[(t.length-a).toString(),...e.slice(a)].join("/")};function R(t,e,a=!1){var s;const r=e.seen.get(t);if(e.override){const c=(s=e.override)==null?void 0:s.call(e,t,e,r,a);if(c!==Bs)return c}if(r&&!a){const c=Nr(r,e);if(c!==void 0)return c}const o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);const i=Ir(t,t.typeName,e),n=typeof i=="function"?R(i(),e):i;if(n&&Tr(t,e,n),e.postProcess){const c=e.postProcess(n,t,e);return o.jsonSchema=n,c}return o.jsonSchema=n,n}var Nr=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:wr(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((a,s)=>e.currentPath[s]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),W()):e.$refStrategy==="seen"?W():void 0}},Tr=(t,e,a)=>(t.description&&(a.description=t.description),a),Cr=t=>{const e=qs(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([s,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}},Ar=(t,e)=>{var a;const s=Cr(e);let r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[p,m])=>{var v;return{...l,[p]:(v=R(m._def,{...s,currentPath:[...s.basePath,s.definitionPath,p]},!0))!=null?v:W()}},{}):void 0;const o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=(a=R(t._def,o===void 0?s:{...s,currentPath:[...s.basePath,s.definitionPath,o]},!1))!=null?a:W(),n=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;n!==void 0&&(i.title=n);const c=o===void 0?r?{...i,[s.definitionPath]:r}:i:{$ref:[...s.$refStrategy==="relative"?[]:s.basePath,s.definitionPath,o].join("/"),[s.definitionPath]:{...r,[o]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},lt=Symbol.for("vercel.ai.schema");function Mr(t){let e;return()=>(e==null&&(e=t()),e)}function Je(t,{validate:e}={}){return{[lt]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Rr(t){return typeof t=="object"&&t!==null&&lt in t&&t[lt]===!0&&"jsonSchema"in t&&"validate"in t}function bt(t){return t==null?Je({properties:{},additionalProperties:!1}):Rr(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?va(t):jr(t):t()}function jr(t){return Je(()=>xt(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const a=await t["~standard"].validate(e);return"value"in a?{success:!0,value:a.value}:{success:!1,error:new Ne({value:e,cause:a.issues})}}})}function kr(t,e){var a;const s=(a=void 0)!=null?a:!1;return Je(()=>Ar(t,{$refStrategy:s?"root":"none"}),{validate:async r=>{const o=await t.safeParseAsync(r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function Or(t,e){var a;const s=(a=void 0)!=null?a:!1;return Je(()=>xt(es(t,{target:"draft-7",io:"input",reused:s?"ref":"inline"})),{validate:async r=>{const o=await Ka(t,r);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function Pr(t){return"_zod"in t}function va(t,e){return Pr(t)?Or(t):kr(t)}async function Vt({value:t,schema:e,context:a}){const s=await Pe({value:t,schema:e,context:a});if(!s.success)throw Ne.wrap({value:t,cause:s.error,context:a});return s.value}async function Pe({value:t,schema:e,context:a}){const s=bt(e);try{if(s.validate==null)return{success:!0,value:t,rawValue:t};const r=await s.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:Ne.wrap({value:t,cause:r.error,context:a}),rawValue:t}}catch(r){return{success:!1,error:Ne.wrap({value:t,cause:r,context:a}),rawValue:t}}}async function xe({text:t,schema:e}){try{const a=Vs(t);return e==null?{success:!0,value:a,rawValue:a}:await Pe({value:a,schema:e})}catch(a){return{success:!1,error:Pt.isInstance(a)?a:new Pt({text:t,cause:a}),rawValue:void 0}}}function Dr({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new Xa).pipeThrough(new TransformStream({async transform({data:a},s){a!=="[DONE]"&&s.enqueue(await xe({text:a,schema:e}))}}))}async function pe(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var $r=Object.defineProperty,Lr=(t,e)=>{for(var a in e)$r(t,a,{get:e[a],enumerable:!0})},ya="AI_NoObjectGeneratedError",xa=`vercel.ai.error.${ya}`,Zr=Symbol.for(xa),ba,me=class extends K{constructor({message:t="No object generated.",cause:e,text:a,response:s,usage:r,finishReason:o}){super({name:ya,message:t,cause:e}),this[ba]=!0,this.text=a,this.response=s,this.usage=r,this.finishReason=o}static isInstance(t){return K.hasMarker(t,xa)}};ba=Zr;var _a="AI_UIMessageStreamError",Ea=`vercel.ai.error.${_a}`,Fr=Symbol.for(Ea),Sa,Se=class extends K{constructor({chunkType:t,chunkId:e,message:a}){super({name:_a,message:a}),this[Sa]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return K.hasMarker(t,Ea)}};Sa=Fr;var Bt="6.0.106",Ia=q([x(),Be(Uint8Array),Be(ArrayBuffer),Yt(t=>{var e,a;return(a=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?a:!1},{message:"Must be a Buffer"})]),De=ts(()=>q([as(),x(),ss(),B(),je(x(),De.optional()),$e(De)])),M=je(x(),je(x(),De.optional())),wa=j({type:E("text"),text:x(),providerOptions:M.optional()}),Ur=j({type:E("image"),image:q([Ia,Be(URL)]),mediaType:x().optional(),providerOptions:M.optional()}),Na=j({type:E("file"),data:q([Ia,Be(URL)]),filename:x().optional(),mediaType:x(),providerOptions:M.optional()}),zr=j({type:E("reasoning"),text:x(),providerOptions:M.optional()}),Vr=j({type:E("tool-call"),toolCallId:x(),toolName:x(),input:ue(),providerOptions:M.optional(),providerExecuted:B().optional()}),Br=rs("type",[j({type:E("text"),value:x(),providerOptions:M.optional()}),j({type:E("json"),value:De,providerOptions:M.optional()}),j({type:E("execution-denied"),reason:x().optional(),providerOptions:M.optional()}),j({type:E("error-text"),value:x(),providerOptions:M.optional()}),j({type:E("error-json"),value:De,providerOptions:M.optional()}),j({type:E("content"),value:$e(q([j({type:E("text"),text:x(),providerOptions:M.optional()}),j({type:E("media"),data:x(),mediaType:x()}),j({type:E("file-data"),data:x(),mediaType:x(),filename:x().optional(),providerOptions:M.optional()}),j({type:E("file-url"),url:x(),providerOptions:M.optional()}),j({type:E("file-id"),fileId:q([x(),je(x(),x())]),providerOptions:M.optional()}),j({type:E("image-data"),data:x(),mediaType:x(),providerOptions:M.optional()}),j({type:E("image-url"),url:x(),providerOptions:M.optional()}),j({type:E("image-file-id"),fileId:q([x(),je(x(),x())]),providerOptions:M.optional()}),j({type:E("custom"),providerOptions:M.optional()})]))})]),Ta=j({type:E("tool-result"),toolCallId:x(),toolName:x(),output:Br,providerOptions:M.optional()}),qr=j({type:E("tool-approval-request"),approvalId:x(),toolCallId:x()}),Hr=j({type:E("tool-approval-response"),approvalId:x(),approved:B(),reason:x().optional()}),Wr=j({role:E("system"),content:x(),providerOptions:M.optional()}),Jr=j({role:E("user"),content:q([x(),$e(q([wa,Ur,Na]))]),providerOptions:M.optional()}),Gr=j({role:E("assistant"),content:q([x(),$e(q([wa,Na,zr,Vr,Ta,qr]))]),providerOptions:M.optional()}),Yr=j({role:E("tool"),content:$e(q([Ta,Hr])),providerOptions:M.optional()});q([Wr,Jr,Gr,Yr]);function Ca(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const a={...t};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const r=e[s];if(r===void 0)continue;const o=s in t?t[s]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),n=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&n?a[s]=Ca(o,r):a[s]=r}return a}var Qr={};Lr(Qr,{array:()=>to,choice:()=>ao,json:()=>so,object:()=>eo,text:()=>Kr});function Xr(t){const e=["ROOT"];let a=-1,s=null;function r(c,l,p){switch(c){case'"':{a=l,e.pop(),e.push(p),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{a=l,s=l,e.pop(),e.push(p),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=l,e.pop(),e.push(p),e.push("INSIDE_NUMBER");break}case"{":{a=l,e.pop(),e.push(p),e.push("INSIDE_OBJECT_START");break}case"[":{a=l,e.pop(),e.push(p),e.push("INSIDE_ARRAY_START");break}}}function o(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{a=l,e.pop();break}}}function i(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=l,e.pop();break}}}for(let c=0;c<t.length;c++){const l=t[c];switch(e[e.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{a=c,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),a=c;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:a=c}break}case"INSIDE_ARRAY_START":{l==="]"?(a=c,e.pop()):(a=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{a=c,e.pop();break}default:{a=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),a=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{a=c;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(l,c);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(l,c);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const m=t.substring(s,c+1);!"false".startsWith(m)&&!"true".startsWith(m)&&!"null".startsWith(m)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(l,c):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c)):a=c;break}}}let n=t.slice(0,a+1);for(let c=e.length-1;c>=0;c--)switch(e[c]){case"INSIDE_STRING":{n+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{n+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{n+="]";break}case"INSIDE_LITERAL":{const p=t.substring(s,t.length);"true".startsWith(p)?n+="true".slice(p.length):"false".startsWith(p)?n+="false".slice(p.length):"null".startsWith(p)&&(n+="null".slice(p.length))}}return n}async function Ze(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await xe({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await xe({text:Xr(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Kr=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),eo=({schema:t,name:e,description:a})=>{const s=bt(t);return{name:"object",responseFormat:pe(s.jsonSchema).then(r=>({type:"json",schema:r,...e!=null&&{name:e},...a!=null&&{description:a}})),async parseCompleteOutput({text:r},o){const i=await xe({text:r});if(!i.success)throw new me({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});const n=await Pe({value:i.value,schema:s});if(!n.success)throw new me({message:"No object generated: response did not match schema.",cause:n.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});return n.value},async parsePartialOutput({text:r}){const o=await Ze(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},to=({element:t,name:e,description:a})=>{const s=bt(t);return{name:"array",responseFormat:pe(s.jsonSchema).then(r=>{const{$schema:o,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}}),async parseCompleteOutput({text:r},o){const i=await xe({text:r});if(!i.success)throw new me({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});const n=i.value;if(n==null||typeof n!="object"||!("elements"in n)||!Array.isArray(n.elements))throw new me({message:"No object generated: response did not match schema.",cause:new Ne({value:n,cause:"response must be an object with an elements array"}),text:r,response:o.response,usage:o.usage,finishReason:o.finishReason});for(const c of n.elements){const l=await Pe({value:c,schema:s});if(!l.success)throw new me({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:o.response,usage:o.usage,finishReason:o.finishReason})}return n.elements},async parsePartialOutput({text:r}){const o=await Ze(r);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=o.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const n=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const l of n){const p=await Pe({value:l,schema:s});p.success&&c.push(p.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;r<o.length;r++)i.enqueue(o[r])}})}}},ao=({options:t,name:e,description:a})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...a!=null&&{description:a}}),async parseCompleteOutput({text:s},r){const o=await xe({text:s});if(!o.success)throw new me({message:"No object generated: could not parse the response.",cause:o.error,text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});const i=o.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!t.includes(i.result))throw new me({message:"No object generated: response did not match schema.",cause:new Ne({value:i,cause:"response must be an object that contains a choice value."}),text:s,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:s}){const r=await Ze(s);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const o=r.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;const i=t.filter(n=>n.startsWith(o.result));return r.state==="successful-parse"?i.includes(o.result)?{partial:o.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),so=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:a},s){const r=await xe({text:a});if(!r.success)throw new me({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:s.response,usage:s.usage,finishReason:s.finishReason});return r.value},async parsePartialOutput({text:a}){const s=await Ze(a);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return s.value===void 0?void 0:{partial:s.value}}},createElementStreamTransform(){}});Le({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
8
+
9
+ `)},flush(t){t.enqueue(`data: [DONE]
10
+
11
+ `)}})}});var ro=Mr(()=>va(q([k({type:E("text-start"),id:x(),providerMetadata:M.optional()}),k({type:E("text-delta"),id:x(),delta:x(),providerMetadata:M.optional()}),k({type:E("text-end"),id:x(),providerMetadata:M.optional()}),k({type:E("error"),errorText:x()}),k({type:E("tool-input-start"),toolCallId:x(),toolName:x(),providerExecuted:B().optional(),providerMetadata:M.optional(),dynamic:B().optional(),title:x().optional()}),k({type:E("tool-input-delta"),toolCallId:x(),inputTextDelta:x()}),k({type:E("tool-input-available"),toolCallId:x(),toolName:x(),input:ue(),providerExecuted:B().optional(),providerMetadata:M.optional(),dynamic:B().optional(),title:x().optional()}),k({type:E("tool-input-error"),toolCallId:x(),toolName:x(),input:ue(),providerExecuted:B().optional(),providerMetadata:M.optional(),dynamic:B().optional(),errorText:x(),title:x().optional()}),k({type:E("tool-approval-request"),approvalId:x(),toolCallId:x()}),k({type:E("tool-output-available"),toolCallId:x(),output:ue(),providerExecuted:B().optional(),dynamic:B().optional(),preliminary:B().optional()}),k({type:E("tool-output-error"),toolCallId:x(),errorText:x(),providerExecuted:B().optional(),dynamic:B().optional()}),k({type:E("tool-output-denied"),toolCallId:x()}),k({type:E("reasoning-start"),id:x(),providerMetadata:M.optional()}),k({type:E("reasoning-delta"),id:x(),delta:x(),providerMetadata:M.optional()}),k({type:E("reasoning-end"),id:x(),providerMetadata:M.optional()}),k({type:E("source-url"),sourceId:x(),url:x(),title:x().optional(),providerMetadata:M.optional()}),k({type:E("source-document"),sourceId:x(),mediaType:x(),title:x(),filename:x().optional(),providerMetadata:M.optional()}),k({type:E("file"),url:x(),mediaType:x(),providerMetadata:M.optional()}),k({type:Yt(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:x().optional(),data:ue(),transient:B().optional()}),k({type:E("start-step")}),k({type:E("finish-step")}),k({type:E("start"),messageId:x().optional(),messageMetadata:ue().optional()}),k({type:E("finish"),finishReason:os(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:ue().optional()}),k({type:E("abort"),reason:x().optional()}),k({type:E("message-metadata"),messageMetadata:ue()})])));function oo(t){return t.type.startsWith("data-")}function ct(t){return t.type.startsWith("tool-")}function no(t){return t.type==="dynamic-tool"}function Te(t){return ct(t)||no(t)}function qt(t){return t.type.split("-").slice(1).join("-")}function io({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function lo({stream:t,messageMetadataSchema:e,dataPartSchemas:a,runUpdateMessageJob:s,onError:r,onToolCall:o,onData:i}){return t.pipeThrough(new TransformStream({async transform(n,c){await s(async({state:l,write:p})=>{var m,v,f,y;function b(u){const A=l.message.parts.filter(Te).find(N=>N.toolCallId===u);if(A==null)throw new Se({chunkType:"tool-invocation",chunkId:u,message:`No tool invocation found for tool call ID "${u}".`});return A}function g(u){var S;const A=l.message.parts.find($=>ct($)&&$.toolCallId===u.toolCallId),N=u,T=A;A!=null?(A.state=u.state,T.input=N.input,T.output=N.output,T.errorText=N.errorText,T.rawInput=N.rawInput,T.preliminary=N.preliminary,u.title!==void 0&&(T.title=u.title),T.providerExecuted=(S=N.providerExecuted)!=null?S:A.providerExecuted,N.providerMetadata!=null&&(A.callProviderMetadata=N.providerMetadata)):l.message.parts.push({type:`tool-${u.toolName}`,toolCallId:u.toolCallId,state:u.state,title:u.title,input:N.input,output:N.output,rawInput:N.rawInput,errorText:N.errorText,providerExecuted:N.providerExecuted,preliminary:N.preliminary,...N.providerMetadata!=null?{callProviderMetadata:N.providerMetadata}:{}})}function h(u){var S,A;const N=l.message.parts.find(z=>z.type==="dynamic-tool"&&z.toolCallId===u.toolCallId),T=u,$=N;N!=null?(N.state=u.state,$.toolName=u.toolName,$.input=T.input,$.output=T.output,$.errorText=T.errorText,$.rawInput=(S=T.rawInput)!=null?S:$.rawInput,$.preliminary=T.preliminary,u.title!==void 0&&($.title=u.title),$.providerExecuted=(A=T.providerExecuted)!=null?A:N.providerExecuted,T.providerMetadata!=null&&(N.callProviderMetadata=T.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:u.toolName,toolCallId:u.toolCallId,state:u.state,input:T.input,output:T.output,errorText:T.errorText,preliminary:T.preliminary,providerExecuted:T.providerExecuted,title:u.title,...T.providerMetadata!=null?{callProviderMetadata:T.providerMetadata}:{}})}async function _(u){if(u!=null){const S=l.message.metadata!=null?Ca(l.message.metadata,u):u;e!=null&&await Vt({value:S,schema:e,context:{field:"message.metadata",entityId:l.message.id}}),l.message.metadata=S}}switch(n.type){case"text-start":{const u={type:"text",text:"",providerMetadata:n.providerMetadata,state:"streaming"};l.activeTextParts[n.id]=u,l.message.parts.push(u),p();break}case"text-delta":{const u=l.activeTextParts[n.id];if(u==null)throw new Se({chunkType:"text-delta",chunkId:n.id,message:`Received text-delta for missing text part with ID "${n.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});u.text+=n.delta,u.providerMetadata=(m=n.providerMetadata)!=null?m:u.providerMetadata,p();break}case"text-end":{const u=l.activeTextParts[n.id];if(u==null)throw new Se({chunkType:"text-end",chunkId:n.id,message:`Received text-end for missing text part with ID "${n.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});u.state="done",u.providerMetadata=(v=n.providerMetadata)!=null?v:u.providerMetadata,delete l.activeTextParts[n.id],p();break}case"reasoning-start":{const u={type:"reasoning",text:"",providerMetadata:n.providerMetadata,state:"streaming"};l.activeReasoningParts[n.id]=u,l.message.parts.push(u),p();break}case"reasoning-delta":{const u=l.activeReasoningParts[n.id];if(u==null)throw new Se({chunkType:"reasoning-delta",chunkId:n.id,message:`Received reasoning-delta for missing reasoning part with ID "${n.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});u.text+=n.delta,u.providerMetadata=(f=n.providerMetadata)!=null?f:u.providerMetadata,p();break}case"reasoning-end":{const u=l.activeReasoningParts[n.id];if(u==null)throw new Se({chunkType:"reasoning-end",chunkId:n.id,message:`Received reasoning-end for missing reasoning part with ID "${n.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});u.providerMetadata=(y=n.providerMetadata)!=null?y:u.providerMetadata,u.state="done",delete l.activeReasoningParts[n.id],p();break}case"file":{l.message.parts.push({type:"file",mediaType:n.mediaType,url:n.url}),p();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:n.sourceId,url:n.url,title:n.title,providerMetadata:n.providerMetadata}),p();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:n.sourceId,mediaType:n.mediaType,title:n.title,filename:n.filename,providerMetadata:n.providerMetadata}),p();break}case"tool-input-start":{const u=l.message.parts.filter(ct);l.partialToolCalls[n.toolCallId]={text:"",toolName:n.toolName,index:u.length,dynamic:n.dynamic,title:n.title},n.dynamic?h({toolCallId:n.toolCallId,toolName:n.toolName,state:"input-streaming",input:void 0,providerExecuted:n.providerExecuted,title:n.title,providerMetadata:n.providerMetadata}):g({toolCallId:n.toolCallId,toolName:n.toolName,state:"input-streaming",input:void 0,providerExecuted:n.providerExecuted,title:n.title,providerMetadata:n.providerMetadata}),p();break}case"tool-input-delta":{const u=l.partialToolCalls[n.toolCallId];if(u==null)throw new Se({chunkType:"tool-input-delta",chunkId:n.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${n.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});u.text+=n.inputTextDelta;const{value:S}=await Ze(u.text);u.dynamic?h({toolCallId:n.toolCallId,toolName:u.toolName,state:"input-streaming",input:S,title:u.title}):g({toolCallId:n.toolCallId,toolName:u.toolName,state:"input-streaming",input:S,title:u.title}),p();break}case"tool-input-available":{n.dynamic?h({toolCallId:n.toolCallId,toolName:n.toolName,state:"input-available",input:n.input,providerExecuted:n.providerExecuted,providerMetadata:n.providerMetadata,title:n.title}):g({toolCallId:n.toolCallId,toolName:n.toolName,state:"input-available",input:n.input,providerExecuted:n.providerExecuted,providerMetadata:n.providerMetadata,title:n.title}),p(),o&&!n.providerExecuted&&await o({toolCall:n});break}case"tool-input-error":{const u=l.message.parts.filter(Te).find(A=>A.toolCallId===n.toolCallId);(u!=null?u.type==="dynamic-tool":!!n.dynamic)?h({toolCallId:n.toolCallId,toolName:n.toolName,state:"output-error",input:n.input,errorText:n.errorText,providerExecuted:n.providerExecuted,providerMetadata:n.providerMetadata}):g({toolCallId:n.toolCallId,toolName:n.toolName,state:"output-error",input:void 0,rawInput:n.input,errorText:n.errorText,providerExecuted:n.providerExecuted,providerMetadata:n.providerMetadata}),p();break}case"tool-approval-request":{const u=b(n.toolCallId);u.state="approval-requested",u.approval={id:n.approvalId},p();break}case"tool-output-denied":{const u=b(n.toolCallId);u.state="output-denied",p();break}case"tool-output-available":{const u=b(n.toolCallId);u.type==="dynamic-tool"?h({toolCallId:n.toolCallId,toolName:u.toolName,state:"output-available",input:u.input,output:n.output,preliminary:n.preliminary,providerExecuted:n.providerExecuted,title:u.title}):g({toolCallId:n.toolCallId,toolName:qt(u),state:"output-available",input:u.input,output:n.output,providerExecuted:n.providerExecuted,preliminary:n.preliminary,title:u.title}),p();break}case"tool-output-error":{const u=b(n.toolCallId);u.type==="dynamic-tool"?h({toolCallId:n.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:n.errorText,providerExecuted:n.providerExecuted,title:u.title}):g({toolCallId:n.toolCallId,toolName:qt(u),state:"output-error",input:u.input,rawInput:u.rawInput,errorText:n.errorText,providerExecuted:n.providerExecuted,title:u.title}),p();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{n.messageId!=null&&(l.message.id=n.messageId),await _(n.messageMetadata),(n.messageId!=null||n.messageMetadata!=null)&&p();break}case"finish":{n.finishReason!=null&&(l.finishReason=n.finishReason),await _(n.messageMetadata),n.messageMetadata!=null&&p();break}case"message-metadata":{await _(n.messageMetadata),n.messageMetadata!=null&&p();break}case"error":{r?.(new Error(n.errorText));break}default:if(oo(n)){if(a?.[n.type]!=null){const A=l.message.parts.findIndex(T=>"id"in T&&"data"in T&&T.id===n.id&&T.type===n.type),N=A>=0?A:l.message.parts.length;await Vt({value:n.data,schema:a[n.type],context:{field:`message.parts[${N}].data`,entityName:n.type,entityId:n.id}})}const u=n;if(u.transient){i?.(u);break}const S=u.id!=null?l.message.parts.find(A=>u.type===A.type&&u.id===A.id):void 0;S!=null?S.data=u.data:l.message.parts.push(u),i?.(u),p()}}c.enqueue(n)})}}))}async function co({stream:t,onError:e}){const a=t.getReader();try{for(;;){const{done:s}=await a.read();if(s)break}}catch(s){e?.(s)}finally{a.releaseLock()}}Le({prefix:"aitxt",size:24});Le({prefix:"aiobj",size:24});var uo=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(t){return new Promise((e,a)=>{this.queue.push(async()=>{try{await t(),e()}catch(s){a(s)}}),this.processQueue()})}};Le({prefix:"aiobj",size:24});async function po(t){if(t==null)return[];if(!globalThis.FileList||!(t instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(t).map(async e=>{const{name:a,type:s}=e,r=await new Promise((o,i)=>{const n=new FileReader;n.onload=c=>{var l;o((l=c.target)==null?void 0:l.result)},n.onerror=c=>i(c),n.readAsDataURL(e)});return{type:"file",mediaType:s,filename:a,url:r}}))}var mo=class{constructor({api:t="/api/chat",credentials:e,headers:a,body:s,fetch:r,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:i}){this.api=t,this.credentials=e,this.headers=a,this.body=s,this.fetch=r,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:t,...e}){var a,s,r,o,i;const n=await pe(this.body),c=await pe(this.headers),l=await pe(this.credentials),p={...ve(c),...ve(e.headers)},m=await((a=this.prepareSendMessagesRequest)==null?void 0:a.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...n,...e.body},headers:p,credentials:l,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),v=(s=m?.api)!=null?s:this.api,f=m?.headers!==void 0?ve(m.headers):p,y=m?.body!==void 0?m.body:{...n,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},b=(r=m?.credentials)!=null?r:l,h=await((o=this.fetch)!=null?o:globalThis.fetch)(v,{method:"POST",headers:Zt({"Content-Type":"application/json",...f},`ai-sdk/${Bt}`,Lt()),body:JSON.stringify(y),credentials:b,signal:t});if(!h.ok)throw new Error((i=await h.text())!=null?i:"Failed to fetch the chat response.");if(!h.body)throw new Error("The response body is empty.");return this.processResponseStream(h.body)}async reconnectToStream(t){var e,a,s,r,o;const i=await pe(this.body),n=await pe(this.headers),c=await pe(this.credentials),l={...ve(n),...ve(t.headers)},p=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...i,...t.body},headers:l,credentials:c,requestMetadata:t.metadata})),m=(a=p?.api)!=null?a:`${this.api}/${t.chatId}/stream`,v=p?.headers!==void 0?ve(p.headers):l,f=(s=p?.credentials)!=null?s:c,b=await((r=this.fetch)!=null?r:globalThis.fetch)(m,{method:"GET",headers:Zt(v,`ai-sdk/${Bt}`,Lt()),credentials:f});if(b.status===204)return null;if(!b.ok)throw new Error((o=await b.text())!=null?o:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");return this.processResponseStream(b.body)}},Aa=class extends mo{constructor(t={}){super(t)}processResponseStream(t){return Dr({stream:t,schema:ro}).pipeThrough(new TransformStream({async transform(e,a){if(!e.success)throw e.error;a.enqueue(e.value)}}))}},fo=class{constructor({generateId:t=Zs,id:e=t(),transport:a=new Aa,messageMetadataSchema:s,dataPartSchemas:r,state:o,onError:i,onToolCall:n,onFinish:c,onData:l,sendAutomaticallyWhen:p}){this.activeResponse=void 0,this.jobExecutor=new uo,this.sendMessage=async(m,v)=>{var f,y,b,g;if(m==null){await this.makeRequest({trigger:"submit-message",messageId:(f=this.lastMessage)==null?void 0:f.id,...v});return}let h;if("text"in m||"files"in m?h={parts:[...Array.isArray(m.files)?m.files:await po(m.files),..."text"in m&&m.text!=null?[{type:"text",text:m.text}]:[]]}:h=m,m.messageId!=null){const _=this.state.messages.findIndex(u=>u.id===m.messageId);if(_===-1)throw new Error(`message with id ${m.messageId} not found`);if(this.state.messages[_].role!=="user")throw new Error(`message with id ${m.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,_+1),this.state.replaceMessage(_,{...h,id:m.messageId,role:(y=h.role)!=null?y:"user",metadata:m.metadata})}else this.state.pushMessage({...h,id:(b=h.id)!=null?b:this.generateId(),role:(g=h.role)!=null?g:"user",metadata:m.metadata});await this.makeRequest({trigger:"submit-message",messageId:m.messageId,...v})},this.regenerate=async({messageId:m,...v}={})=>{const f=m==null?this.state.messages.length-1:this.state.messages.findIndex(y=>y.id===m);if(f===-1)throw new Error(`message ${m} not found`);this.state.messages=this.state.messages.slice(0,this.messages[f].role==="assistant"?f:f+1),await this.makeRequest({trigger:"regenerate-message",messageId:m,...v})},this.resumeStream=async(m={})=>{await this.makeRequest({trigger:"resume-stream",...m})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:m,approved:v,reason:f})=>this.jobExecutor.run(async()=>{const y=this.state.messages,b=y[y.length-1],g=h=>Te(h)&&h.state==="approval-requested"&&h.approval.id===m?{...h,state:"approval-responded",approval:{id:m,approved:v,reason:f}}:h;this.state.replaceMessage(y.length-1,{...b,parts:b.parts.map(g)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(g)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(h=>{var _;h&&this.makeRequest({trigger:"submit-message",messageId:(_=this.lastMessage)==null?void 0:_.id})})}),this.addToolOutput=async({state:m="output-available",tool:v,toolCallId:f,output:y,errorText:b})=>this.jobExecutor.run(async()=>{const g=this.state.messages,h=g[g.length-1],_=u=>Te(u)&&u.toolCallId===f?{...u,state:m,output:y,errorText:b}:u;this.state.replaceMessage(g.length-1,{...h,parts:h.parts.map(_)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(_)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(u=>{var S;u&&this.makeRequest({trigger:"submit-message",messageId:(S=this.lastMessage)==null?void 0:S.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var m;this.status!=="streaming"&&this.status!=="submitted"||(m=this.activeResponse)!=null&&m.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=a,this.generateId=t,this.messageMetadataSchema=s,this.dataPartSchemas=r,this.state=o,this.onError=i,this.onToolCall=n,this.onFinish=c,this.onData=l,this.sendAutomaticallyWhen=p}get status(){return this.state.status}setStatus({status:t,error:e}){this.status!==t&&(this.state.status=t,this.state.error=e)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(t){this.state.messages=t}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const t=this.sendAutomaticallyWhen({messages:this.state.messages});return t&&typeof t=="object"&&"then"in t?await t:t}async makeRequest({trigger:t,metadata:e,headers:a,body:s,messageId:r}){var o,i,n;let c;if(t==="resume-stream")try{const f=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:a,body:s});if(f==null)return;c=f}catch(f){this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f});return}this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let p=!1,m=!1,v=!1;try{const f={state:io({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};f.abortController.signal.addEventListener("abort",()=>{p=!0}),this.activeResponse=f;let y;t==="resume-stream"?y=c:y=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:f.abortController.signal,metadata:e,headers:a,body:s,trigger:t,messageId:r});const b=g=>this.jobExecutor.run(()=>g({state:f.state,write:()=>{var h;this.setStatus({status:"streaming"}),f.state.message.id===((h=this.lastMessage)==null?void 0:h.id)?this.state.replaceMessage(this.state.messages.length-1,f.state.message):this.state.pushMessage(f.state.message)}}));await co({stream:lo({stream:y,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:b,onError:g=>{throw g}}),onError:g=>{throw g}}),this.setStatus({status:"ready"})}catch(f){if(p||f.name==="AbortError")return p=!0,this.setStatus({status:"ready"}),null;v=!0,f instanceof TypeError&&(f.message.toLowerCase().includes("fetch")||f.message.toLowerCase().includes("network"))&&(m=!0),this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:p,isDisconnect:m,isError:v,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(f){console.error(f)}this.activeResponse=void 0}!v&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(n=this.lastMessage)==null?void 0:n.id,metadata:e,headers:a,body:s})}};function ho({messages:t}){const e=t[t.length-1];if(!e||e.role!=="assistant")return!1;const a=e.parts.reduce((r,o,i)=>o.type==="step-start"?i:r,-1),s=e.parts.slice(a+1).filter(Te).filter(r=>!r.providerExecuted);return s.filter(r=>r.state==="approval-responded").length>0&&s.every(r=>r.state==="output-available"||r.state==="output-error"||r.state==="approval-responded")}function go({messages:t}){const e=t[t.length-1];if(!e||e.role!=="assistant")return!1;const a=e.parts.reduce((r,o,i)=>o.type==="step-start"?i:r,-1),s=e.parts.slice(a+1).filter(Te).filter(r=>!r.providerExecuted);return s.length>0&&s.every(r=>r.state==="output-available"||r.state==="output-error")}var at,Ht;function vo(){if(Ht)return at;Ht=1;function t(e,a){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let s,r=0;return function(...i){clearTimeout(s);const n=Date.now(),c=n-r,l=a-c;l<=0?(r=n,e.apply(this,i)):s=setTimeout(()=>{r=Date.now(),e.apply(this,i)},l)}}return at=t,at}var yo=vo();const xo=ns(yo);var Ma=(t,e,a)=>{if(!e.has(t))throw TypeError("Cannot "+a)},O=(t,e,a)=>(Ma(t,e,"read from private field"),a?a.call(t):e.get(t)),X=(t,e,a)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,a)},de=(t,e,a,s)=>(Ma(t,e,"write to private field"),e.set(t,a),a);function bo(t,e){return e!=null?xo(t,e):t}var J,ze,Ve,Ae,Me,Re,Ie,ut,dt,_o=class{constructor(t=[]){X(this,J,void 0),X(this,ze,"ready"),X(this,Ve,void 0),X(this,Ae,new Set),X(this,Me,new Set),X(this,Re,new Set),this.pushMessage=e=>{de(this,J,O(this,J).concat(e)),O(this,Ie).call(this)},this.popMessage=()=>{de(this,J,O(this,J).slice(0,-1)),O(this,Ie).call(this)},this.replaceMessage=(e,a)=>{de(this,J,[...O(this,J).slice(0,e),this.snapshot(a),...O(this,J).slice(e+1)]),O(this,Ie).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,a)=>{const s=a?bo(e,a):e;return O(this,Ae).add(s),()=>{O(this,Ae).delete(s)}},this["~registerStatusCallback"]=e=>(O(this,Me).add(e),()=>{O(this,Me).delete(e)}),this["~registerErrorCallback"]=e=>(O(this,Re).add(e),()=>{O(this,Re).delete(e)}),X(this,Ie,()=>{O(this,Ae).forEach(e=>e())}),X(this,ut,()=>{O(this,Me).forEach(e=>e())}),X(this,dt,()=>{O(this,Re).forEach(e=>e())}),de(this,J,t)}get status(){return O(this,ze)}set status(t){de(this,ze,t),O(this,ut).call(this)}get error(){return O(this,Ve)}set error(t){de(this,Ve,t),O(this,dt).call(this)}get messages(){return O(this,J)}set messages(t){de(this,J,[...t]),O(this,Ie).call(this)}};J=new WeakMap;ze=new WeakMap;Ve=new WeakMap;Ae=new WeakMap;Me=new WeakMap;Re=new WeakMap;Ie=new WeakMap;ut=new WeakMap;dt=new WeakMap;var we,Wt=class extends fo{constructor({messages:t,...e}){const a=new _o(t);super({...e,state:a}),X(this,we,void 0),this["~registerMessagesCallback"]=(s,r)=>O(this,we)["~registerMessagesCallback"](s,r),this["~registerStatusCallback"]=s=>O(this,we)["~registerStatusCallback"](s),this["~registerErrorCallback"]=s=>O(this,we)["~registerErrorCallback"](s),de(this,we,a)}};we=new WeakMap;function Eo({experimental_throttle:t,resume:e=!1,...a}={}){const s=I.useRef("chat"in a?{}:{onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});"chat"in a||(s.current={onToolCall:a.onToolCall,onData:a.onData,onFinish:a.onFinish,onError:a.onError,sendAutomaticallyWhen:a.sendAutomaticallyWhen});const r={...a,onToolCall:v=>{var f,y;return(y=(f=s.current).onToolCall)==null?void 0:y.call(f,v)},onData:v=>{var f,y;return(y=(f=s.current).onData)==null?void 0:y.call(f,v)},onFinish:v=>{var f,y;return(y=(f=s.current).onFinish)==null?void 0:y.call(f,v)},onError:v=>{var f,y;return(y=(f=s.current).onError)==null?void 0:y.call(f,v)},sendAutomaticallyWhen:v=>{var f,y,b;return(b=(y=(f=s.current).sendAutomaticallyWhen)==null?void 0:y.call(f,v))!=null?b:!1}},o=I.useRef("chat"in a?a.chat:new Wt(r));("chat"in a&&a.chat!==o.current||"id"in a&&o.current.id!==a.id)&&(o.current="chat"in a?a.chat:new Wt(r));const n=I.useCallback(v=>o.current["~registerMessagesCallback"](v,t),[t,o.current.id]),c=I.useSyncExternalStore(n,()=>o.current.messages,()=>o.current.messages),l=I.useSyncExternalStore(o.current["~registerStatusCallback"],()=>o.current.status,()=>o.current.status),p=I.useSyncExternalStore(o.current["~registerErrorCallback"],()=>o.current.error,()=>o.current.error),m=I.useCallback(v=>{typeof v=="function"&&(v=v(o.current.messages)),o.current.messages=v},[o]);return I.useEffect(()=>{e&&o.current.resumeStream()},[e,o]),{id:o.current.id,messages:c,setMessages:m,sendMessage:o.current.sendMessage,regenerate:o.current.regenerate,clearError:o.current.clearError,stop:o.current.stop,error:p,resumeStream:o.current.resumeStream,status:l,addToolResult:o.current.addToolOutput,addToolOutput:o.current.addToolOutput,addToolApprovalResponse:o.current.addToolApprovalResponse}}function So(t){const{buildUrl:e,eventTypes:a}=t,s=new Map;function r(o){let i=s.get(o);if(!i){const n=new EventSource(e(o));i={es:n,refCount:0},s.set(o,i),n.onerror=()=>{n.readyState===EventSource.CLOSED&&s.delete(o)}}return i}return{subscribe(o,i){const n=r(o);n.refCount++;for(const l of a)n.es.addEventListener(l,i);let c=!1;return()=>{if(!c){c=!0;for(const l of a)n.es.removeEventListener(l,i);n.refCount--,n.refCount<=0&&(n.es.close(),s.delete(o))}}}}}const Io=So({buildUrl:t=>{const e=Nt.join(",");return`/org/${t}/watch?types=${e}`},eventTypes:[...Nt]}),Jt=()=>0;function wo(t){const{orgId:e,threadId:a,enabled:s=!0,onStep:r,onFinish:o,onThreadStatus:i}=t,n=I.useRef({threadId:a,onStep:r,onFinish:o,onThreadStatus:i});n.current={threadId:a,onStep:r,onFinish:o,onThreadStatus:i};const c=I.useRef(null),l=I.useRef(s),p=I.useRef(e);(!c.current||l.current!==s||p.current!==e)&&(l.current=s,p.current=e,c.current=m=>{if(!s||!e)return()=>{};const v=f=>{let y;try{y=JSON.parse(f.data)}catch{return}const b=n.current;if(!(b.threadId&&y.subject!==b.threadId)){switch(y.type){case Ke.STEP:b.onStep?.(y);break;case Ke.FINISH:b.onFinish?.(y);break;case Ke.THREAD_STATUS:b.onThreadStatus?.(y);break}m()}};return Io.subscribe(e,v)}),I.useSyncExternalStore(c.current,Jt,Jt)}function Ra(){const t=D.c(21),{locator:e,org:a}=be();let s;t[0]!==e?(s=ye.allowedModels(e),t[0]=e,t[1]=s):s=t[1];let r;t[2]!==a?(r=async()=>{const g=await fetch(`/api/${a.slug}/decopilot/allowed-models`,{credentials:"include"});return g.ok?g.json():{allowAll:!0,models:{}}},t[2]=a,t[3]=r):r=t[3];let o;t[4]!==s||t[5]!==r?(o={queryKey:s,queryFn:r,staleTime:3e4},t[4]=s,t[5]=r,t[6]=o):o=t[6];const{data:i,isLoading:n}=ms(o),c=i?.allowAll??!0;let l;t[7]!==i?.models?(l=i?.models??{},t[7]=i?.models,t[8]=l):l=t[8];const p=l;let m;t[9]!==c||t[10]!==p?(m=(g,h)=>{if(c)return!0;const _=p[g];return _?_.includes("*")||_.includes(h):p["*"]?.includes("*")??!1},t[9]=c,t[10]=p,t[11]=m):m=t[11];const v=m;let f;t[12]!==c||t[13]!==p?(f=g=>{if(c)return!0;const h=p[g];if(h&&h.length>0)return!0;const _=p["*"];return _?_.length>0:!1},t[12]=c,t[13]=p,t[14]=f):f=t[14];const y=f;let b;return t[15]!==c||t[16]!==y||t[17]!==n||t[18]!==v||t[19]!==p?(b={allowAll:c,models:p,isLoading:n,isModelAllowed:v,hasConnectionModels:y},t[15]=c,t[16]=y,t[17]=n,t[18]=v,t[19]=p,t[20]=b):b=t[20],b}function No(t){const e=D.c(10);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const s=Qt(a);let r;if(e[1]!==s.collectionName||e[2]!==s.connectionId||e[3]!==s.itemId||e[4]!==t){r=[],t&&r.push(`### Selected Agent
12
+ - ID: ${t}`);let o;e[6]!==s.collectionName||e[7]!==s.connectionId||e[8]!==s.itemId?(o=[],s.connectionId&&o.push(`- Connection ID: ${s.connectionId}`),s.collectionName&&o.push(`- Collection: ${s.collectionName}`),s.itemId&&o.push(`- Item ID: ${s.itemId}`),e[6]=s.collectionName,e[7]=s.connectionId,e[8]=s.itemId,e[9]=o):o=e[9],o.length>0&&r.push(`### Current Resource
13
+ The user is viewing the following resource:
14
+ ${o.join(`
15
+ `)}
16
+
17
+ Help the user understand and work with this resource.`),e[1]=s.collectionName,e[2]=s.connectionId,e[3]=s.itemId,e[4]=t,e[5]=r}else r=e[5];return r.join(`
18
+
19
+ `)}function To(){const t=D.c(5),e=We(),{org:a}=be();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const r=Qt(s);let o;return t[1]!==a||t[2]!==r||t[3]!==e?(o=i=>{const c=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!c||!c[1])return;const l=c[1],p=r.connectionId;if(!p)return;e.invalidateQueries({queryKey:ye.collection(a.slug,p,l)});const m=l.toLowerCase().replace(/_/g," ");ke.success(`${m} updated`)},t[1]=a,t[2]=r,t[3]=e,t[4]=o):o=t[4],o}const st=(()=>{if(typeof window>"u")return null;const t=new Audio("/sounds/notification.mp3");return t.preload="auto",t.addEventListener("error",e=>{console.warn("Failed to preload notification sound:",e)}),t.load(),t})();function Co(){return{showNotification:async e=>{const{title:a,body:s,icon:r="/favicon.svg",tag:o}=e;if(typeof Notification>"u")return;if(Notification.permission!=="granted"){Notification.requestPermission().then(n=>{n==="denied"&&ke.error("Notifications denied. Please enable them in your browser settings.")});return}if(document?.hasFocus())return;st&&(st.currentTime=0,st.play().catch(n=>{console.warn("Failed to play notification sound:",n)}));const i=new Notification(a,{body:s,icon:r,tag:o});i.onclick=()=>{window.focus(),i.close()}}}}const Ao=["x-ai/grok-code-fast-1","anthropic/claude-sonnet-4.5","google/gemini-2.5-flash","xiaomi/mimo-v2-flash:free","google/gemini-3-flash-preview","deepseek/deepseek-v3.2","anthropic/claude-opus-4.5","x-ai/grok-4.1-fast","google/gemini-2.5-flash-lite","google/gemini-2.0-flash-001"],pt=new Map;Ao.forEach((t,e)=>{pt.set(t,e)});function _t(t){const e=D.c(3);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={pageSize:999},e[0]=a):a=e[0];const s=ps(t??void 0,a);let r;return e[1]!==s?(r=s.filter(Ro).sort(Mo),e[1]=s,e[2]=r):r=e[2],r}function Mo(t,e){const a=pt.get(t.id),s=pt.get(e.id);return a!==void 0&&s!==void 0?a-s:a!==void 0?-1:s!==void 0?1:t.title.localeCompare(e.title)}function Ro(t){return t.limits?.contextWindow&&t.limits?.maxOutputTokens}const jo={reasoning:{icon:d.jsx(sa,{className:"size-4"}),label:"Reasoning"},"image-upload":{icon:d.jsx(Ts,{className:"size-4"}),label:"Can analyze images"},"file-upload":{icon:d.jsx(ws,{className:"size-4"}),label:"Can analyze files"},"web-search":{icon:d.jsx(Kt,{className:"size-4"}),label:"Can search the web to answer questions"}};function ja(t){const e=D.c(10),{capability:a}=t,s=jo[a];let r,o;e[0]!==a||e[1]!==s?(r=s||{icon:null,label:a},o=r.label.split("-").map(ko).join(" "),e[0]=a,e[1]=s,e[2]=r,e[3]=o):(r=e[2],o=e[3]);const i=o;let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n={backgroundColor:"color-mix(in oklch, var(--chart-1) 15%, transparent)",color:"var(--chart-1)"},e[4]=n):n=e[4];let c;e[5]!==i?(c=d.jsx("span",{children:i}),e[5]=i,e[6]=c):c=e[6];let l;return e[7]!==r.icon||e[8]!==c?(l=d.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md text-xs font-medium",style:n,children:[r.icon,c]}),e[7]=r.icon,e[8]=c,e[9]=l):l=e[9],l}function ko(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Oo(t){const e=D.c(53),{model:a,compact:s}=t,r=s===void 0?!1:s;if(!a){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=d.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=g):g=e[0],g}const o=a.limits?.contextWindow||a.costs?.input||a.costs?.output||a.limits?.maxOutputTokens;if(!o&&!r){let g;e[1]!==a.logo||e[2]!==a.title?(g=a.logo&&d.jsx("img",{src:a.logo,className:"w-6 h-6",alt:a.title}),e[1]=a.logo,e[2]=a.title,e[3]=g):g=e[3];let h;e[4]!==a.title?(h=d.jsx("p",{className:"text-lg font-medium leading-7",children:a.title}),e[4]=a.title,e[5]=h):h=e[5];let _;e[6]!==g||e[7]!==h?(_=d.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[g,h]}),e[6]=g,e[7]=h,e[8]=_):_=e[8];let u;e[9]!==a.description?(u=a.description&&d.jsx("p",{className:"text-sm text-muted-foreground",children:a.description}),e[9]=a.description,e[10]=u):u=e[10];let S;return e[11]!==_||e[12]!==u?(S=d.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[_,u]}),e[11]=_,e[12]=u,e[13]=S):S=e[13],S}if(!o&&r)return null;if(r){let g;e[14]!==a.limits?(g=a.limits?.contextWindow&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Context"}),d.jsxs("span",{className:"text-foreground font-medium",children:[a.limits.contextWindow.toLocaleString()," tokens"]})]}),e[14]=a.limits,e[15]=g):g=e[15];let h;e[16]!==a.costs?(h=a.costs?.input&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),d.jsxs("span",{className:"text-foreground font-medium",children:["$",(a.costs.input*1e6).toFixed(2)," / 1M"]})]}),e[16]=a.costs,e[17]=h):h=e[17];let _;e[18]!==a.costs?(_=a.costs?.output&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),d.jsxs("span",{className:"text-foreground font-medium",children:["$",(a.costs.output*1e6).toFixed(2)," / 1M"]})]}),e[18]=a.costs,e[19]=_):_=e[19];let u;e[20]!==a.limits?(u=a.limits?.maxOutputTokens&&d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),d.jsxs("span",{className:"text-foreground font-medium",children:[a.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[20]=a.limits,e[21]=u):u=e[21];let S;return e[22]!==g||e[23]!==h||e[24]!==_||e[25]!==u?(S=d.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[g,h,_,u]}),e[22]=g,e[23]=h,e[24]=_,e[25]=u,e[26]=S):S=e[26],S}let i;e[27]!==a.logo||e[28]!==a.title?(i=a.logo&&d.jsx("img",{src:a.logo,className:"w-6 h-6 shrink-0",alt:a.title}),e[27]=a.logo,e[28]=a.title,e[29]=i):i=e[29];let n;e[30]!==a.title?(n=d.jsx("p",{className:"text-lg font-medium leading-7 wrap-break-word min-w-0",children:a.title}),e[30]=a.title,e[31]=n):n=e[31];let c;e[32]!==i||e[33]!==n?(c=d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[i,n]}),e[32]=i,e[33]=n,e[34]=c):c=e[34];let l;e[35]!==a.capabilities?(l=a.capabilities&&a.capabilities.length>0&&d.jsx("div",{className:"flex items-center gap-2",children:a.capabilities.map(Po)}),e[35]=a.capabilities,e[36]=l):l=e[36];let p;e[37]!==c||e[38]!==l?(p=d.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[c,l]}),e[37]=c,e[38]=l,e[39]=p):p=e[39];let m;e[40]!==a.limits?(m=a.limits?.contextWindow&&d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(Ns,{className:"w-3.5 h-3.5 text-muted-foreground"}),d.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),d.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.limits.contextWindow.toLocaleString()," tokens"]})]}),e[40]=a.limits,e[41]=m):m=e[41];let v;e[42]!==a.costs?(v=(a.costs?.input||a.costs?.output)&&d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(ta,{className:"w-3.5 h-3.5 text-muted-foreground"}),d.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),d.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.costs?.input!==null&&a.costs?.input!==void 0&&d.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",(a.costs.input*1e6).toFixed(2)," / 1M tokens (input)"]}),a.costs?.output!==null&&a.costs?.output!==void 0&&d.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",(a.costs.output*1e6).toFixed(2)," / 1M tokens (output)"]})]})]}),e[42]=a.costs,e[43]=v):v=e[43];let f;e[44]!==a.limits?(f=a.limits?.maxOutputTokens&&d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(aa,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),d.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),d.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.limits.maxOutputTokens.toLocaleString()," token limit"]})]}),e[44]=a.limits,e[45]=f):f=e[45];let y;e[46]!==m||e[47]!==v||e[48]!==f?(y=d.jsxs("div",{className:"flex flex-col gap-4",children:[m,v,f]}),e[46]=m,e[47]=v,e[48]=f,e[49]=y):y=e[49];let b;return e[50]!==y||e[51]!==p?(b=d.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[p,y]}),e[50]=y,e[51]=p,e[52]=b):b=e[52],b}function Po(t){return d.jsx(ja,{capability:t},t)}function Do(t){const e=D.c(15),{model:a,onHover:s}=t;let r;e[0]!==a||e[1]!==s?(r=()=>s(a),e[0]=a,e[1]=s,e[2]=r):r=e[2];let o;e[3]!==a.logo||e[4]!==a.title?(o=a.logo&&d.jsx("img",{src:a.logo,className:"w-5 h-5 shrink-0",alt:a.title}),e[3]=a.logo,e[4]=a.title,e[5]=o):o=e[5];let i;e[6]!==a.title?(i=d.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:a.title}),e[6]=a.title,e[7]=i):i=e[7];let n;e[8]!==a.capabilities?(n=a.capabilities&&a.capabilities.length>0&&d.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:a.capabilities.slice(0,2).map($o)}),e[8]=a.capabilities,e[9]=n):n=e[9];let c;return e[10]!==r||e[11]!==o||e[12]!==i||e[13]!==n?(c=d.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:r,children:[o,i,n]}),e[10]=r,e[11]=o,e[12]=i,e[13]=n,e[14]=c):c=e[14],c}function $o(t){return d.jsx(ja,{capability:t},t)}function Lo(t){const e=D.c(21),{error:a,onRetry:s,connectionId:r,orgSlug:o}=t,i=is();let n;e[0]!==r||e[1]!==i||e[2]!==o?(n=()=>{!r||!o||i({to:"/$org/$project/mcps/$connectionId",params:{org:o,project:ls,connectionId:r}})},e[0]=r,e[1]=i,e[2]=o,e[3]=n):n=e[3];const c=n;let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=d.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:d.jsx(Is,{className:"size-5 text-destructive"})}),e[4]=l):l=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=d.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[5]=p):p=e[5];const m=a?.message||"Could not fetch models from this provider.";let v;e[6]!==m?(v=d.jsxs("div",{className:"flex flex-col gap-1",children:[p,d.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[m," Try another provider or retry."]})]}),e[6]=m,e[7]=v):v=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=d.jsx(Cs,{className:"size-3.5"}),e[8]=f):f=e[8];let y;e[9]!==s?(y=d.jsxs(rt,{variant:"outline",size:"sm",onClick:s,className:"gap-1.5",children:[f,"Retry"]}),e[9]=s,e[10]=y):y=e[10];let b;e[11]!==r||e[12]!==c||e[13]!==o?(b=r&&o&&d.jsxs(rt,{variant:"outline",size:"sm",onClick:c,className:"gap-1.5",children:[d.jsx(As,{className:"size-3.5"}),"Configure"]}),e[11]=r,e[12]=c,e[13]=o,e[14]=b):b=e[14];let g;e[15]!==y||e[16]!==b?(g=d.jsxs("div",{className:"flex items-center gap-2",children:[y,b]}),e[15]=y,e[16]=b,e[17]=g):g=e[17];let h;return e[18]!==v||e[19]!==g?(h=d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,v,g]}),e[18]=v,e[19]=g,e[20]=h):h=e[20],h}function Zo(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2 space-y-1",children:Array.from({length:6}).map(Fo)}),t[0]=e):e=t[0],e}function Fo(t,e){return d.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[d.jsx(U,{className:"size-5 shrink-0 rounded-sm"}),d.jsx(U,{className:"flex-1 h-4"}),d.jsx(U,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Uo(t){const e=D.c(20),{connectionId:a,allowAll:s,isModelAllowed:r,searchTerm:o,selectedModel:i,onModelSelect:n,onHover:c}=t,l=_t(a??void 0);let p;e[0]!==l||e[1]!==s||e[2]!==a||e[3]!==r?(p=s?l:l.filter(g=>a&&r(a,g.id)),e[0]=l,e[1]=s,e[2]=a,e[3]=r,e[4]=p):p=e[4];const m=p;let v;e[5]!==m||e[6]!==o?(v=o.trim()?m.filter(g=>{const h=o.toLowerCase();return g.title.toLowerCase().includes(h)||g.provider?.toLowerCase().includes(h)||g.description?.toLowerCase().includes(h)}):m,e[5]=m,e[6]=o,e[7]=v):v=e[7];const f=v;if(f.length===0){let g;return e[8]===Symbol.for("react.memo_cache_sentinel")?(g=d.jsx("div",{className:"flex-1 flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[8]=g):g=e[8],g}let y;if(e[9]!==f||e[10]!==c||e[11]!==n||e[12]!==i?.thinking){let g;e[14]!==c||e[15]!==n||e[16]!==i?.thinking?(g=h=>{const _=h.id===i?.thinking.id;return d.jsx("div",{onClick:()=>n(h),className:Xt("rounded-lg mb-1",_&&"bg-accent"),children:d.jsx(Do,{model:h,onHover:c})},h.id)},e[14]=c,e[15]=n,e[16]=i?.thinking,e[17]=g):g=e[17],y=f.map(g),e[9]=f,e[10]=c,e[11]=n,e[12]=i?.thinking,e[13]=y}else y=e[13];let b;return e[18]!==y?(b=d.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2",children:y}),e[18]=y,e[19]=b):b=e[19],b}function Et(t){const e=D.c(14),{model:a,placeholder:s}=t,r=s===void 0?"Select model":s;if(!a){let l;e[0]!==r?(l=d.jsx("span",{className:"text-sm text-muted-foreground",children:r}),e[0]=r,e[1]=l):l=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=d.jsx(ot,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[2]=p):p=e[2];let m;return e[3]!==l?(m=d.jsxs("div",{className:"flex items-center gap-1.5",children:[l,p]}),e[3]=l,e[4]=m):m=e[4],m}let o;e[5]!==a.logo||e[6]!==a.title?(o=a.logo&&d.jsx("img",{src:a.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:a.title}),e[5]=a.logo,e[6]=a.title,e[7]=o):o=e[7];let i;e[8]!==a.title?(i=d.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground group-data-[state=open]:text-foreground truncate whitespace-nowrap max-w-0 opacity-0 group-hover:max-w-[150px] group-hover:opacity-100 group-data-[state=open]:max-w-[150px] group-data-[state=open]:opacity-100 transition-all duration-200 ease-in-out overflow-hidden",children:a.title}),e[8]=a.title,e[9]=i):i=e[9];let n;e[10]===Symbol.for("react.memo_cache_sentinel")?(n=d.jsx(ot,{size:14,className:"text-muted-foreground opacity-0 max-w-0 group-hover:opacity-50 group-hover:max-w-[14px] group-data-[state=open]:opacity-50 group-data-[state=open]:max-w-[14px] shrink-0 transition-all duration-200 ease-in-out overflow-hidden"}),e[10]=n):n=e[10];let c;return e[11]!==o||e[12]!==i?(c=d.jsxs("div",{className:"flex items-center gap-0 group-hover:gap-2 group-data-[state=open]:gap-2 min-w-0 overflow-hidden transition-all duration-200",children:[o,i,n]}),e[11]=o,e[12]=i,e[13]=c):c=e[13],c}function zn(t){return t?.thinking?.capabilities?.vision===!0}function zo(){const t=D.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=d.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:d.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[d.jsx(U,{className:"size-4 shrink-0"}),d.jsx(U,{className:"flex-1 h-6"}),d.jsx(U,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[e,d.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2 space-y-1",children:Array.from({length:6}).map(Vo)})]}),t[1]=a):a=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx(U,{className:"size-6 shrink-0"}),d.jsx(U,{className:"h-6 w-32"})]}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[s,d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(U,{className:"h-6 w-20 rounded-md"}),d.jsx(U,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=r):r=t[3];let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx(U,{className:"h-4 w-24"}),d.jsx(U,{className:"h-4 w-32"})]}),t[4]=o):o=t[4];let i;return t[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[a,d.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:d.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[r,d.jsxs("div",{className:"flex flex-col gap-4",children:[o,d.jsxs("div",{className:"flex flex-col gap-1.5",children:[d.jsx(U,{className:"h-4 w-16"}),d.jsx(U,{className:"h-4 w-40"})]})]})]})})]}),t[5]=i):i=t[5],i}function Vo(t,e){return d.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[d.jsx(U,{className:"size-5 shrink-0 rounded-sm"}),d.jsx(U,{className:"flex-1 h-4"}),d.jsx(U,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Bo(t){const e=D.c(44),{selectedModel:a,onModelChange:s,onClose:r,modelsConnections:o}=t,[i,n]=I.useState(null),[c,l]=I.useState(""),p=I.useRef(null),{org:m}=be(),v=ht(),f=o??v,{isModelAllowed:y,allowAll:b,hasConnectionModels:g}=Ra();let h;e[0]!==f||e[1]!==b||e[2]!==g?(h=b?f:f.filter(L=>g(L.id)),e[0]=f,e[1]=b,e[2]=g,e[3]=h):h=e[3];const _=h,[u,S]=I.useState(a?.connectionId??_[0]?.id??null);let A,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(A=()=>{setTimeout(()=>{p.current?.focus()},0)},N=[],e[4]=A,e[5]=N):(A=e[4],N=e[5]),I.useEffect(A,N);let T;e[6]===Symbol.for("react.memo_cache_sentinel")?(T=L=>{S(L),n(null)},e[6]=T):T=e[6];const $=T;let z;e[7]!==r||e[8]!==s||e[9]!==u?(z=L=>{u&&(s({id:L.id,connectionId:u,provider:L.provider??void 0,capabilities:L.capabilities,limits:L.limits??void 0}),l(""),r())},e[7]=r,e[8]=s,e[9]=u,e[10]=z):z=e[10];const Q=z;let _e;e[11]===Symbol.for("react.memo_cache_sentinel")?(_e=d.jsx(Kt,{size:16,className:"text-muted-foreground shrink-0"}),e[11]=_e):_e=e[11];let fe;e[12]===Symbol.for("react.memo_cache_sentinel")?(fe=L=>l(L.target.value),e[12]=fe):fe=e[12];let ae;e[13]!==c?(ae=d.jsx(hs,{ref:p,type:"text",placeholder:"Search for a model...",value:c,onChange:fe,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[13]=c,e[14]=ae):ae=e[14];let se;e[15]!==_||e[16]!==u?(se=_.length>0&&d.jsxs(xs,{value:u??"",onValueChange:$,children:[d.jsxs(bs,{size:"sm",className:"w-auto min-w-[140px] h-8 shrink-0 [&>svg:last-child]:hidden",onClick:Ho,children:[d.jsx(_s,{placeholder:"Select connection"}),d.jsx(ea,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),d.jsx(Es,{children:_.map(qo)})]}),e[15]=_,e[16]=u,e[17]=se):se=e[17];let re;e[18]!==ae||e[19]!==se?(re=d.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:d.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[_e,ae,se]})}),e[18]=ae,e[19]=se,e[20]=re):re=e[20];let oe;e[21]!==m.slug||e[22]!==u?(oe=L=>{const{error:ce,resetError:he}=L;return d.jsx(Lo,{error:ce,onRetry:he,connectionId:u,orgSlug:m.slug})},e[21]=m.slug,e[22]=u,e[23]=oe):oe=e[23];let Z;e[24]===Symbol.for("react.memo_cache_sentinel")?(Z=d.jsx(Zo,{}),e[24]=Z):Z=e[24];let H;e[25]!==b||e[26]!==Q||e[27]!==y||e[28]!==c||e[29]!==u||e[30]!==a?(H=d.jsx(I.Suspense,{fallback:Z,children:d.jsx(Uo,{connectionId:u,allowAll:b,isModelAllowed:y,searchTerm:c,selectedModel:a,onModelSelect:Q,onHover:n})}),e[25]=b,e[26]=Q,e[27]=y,e[28]=c,e[29]=u,e[30]=a,e[31]=H):H=e[31];let ne;e[32]!==u||e[33]!==oe||e[34]!==H?(ne=d.jsx(vt,{fallback:oe,children:H},u),e[32]=u,e[33]=oe,e[34]=H,e[35]=ne):ne=e[35];let ie;e[36]!==re||e[37]!==ne?(ie=d.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[re,ne]}),e[36]=re,e[37]=ne,e[38]=ie):ie=e[38];let ee;e[39]!==i?(ee=d.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:d.jsx(Oo,{model:i})}),e[39]=i,e[40]=ee):ee=e[40];let le;return e[41]!==ie||e[42]!==ee?(le=d.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[ie,ee]}),e[41]=ie,e[42]=ee,e[43]=le):le=e[43],le}function qo(t){return d.jsx(Ss,{value:t.id,children:d.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?d.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):d.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),d.jsx("span",{children:t.title})]})},t.id)}function Ho(t){return t.stopPropagation()}function Wo(t){const e=D.c(6),{selectedModel:a,placeholder:s}=t,r=a?.connectionId??void 0,o=_t(r);let i;e[0]!==o||e[1]!==a?(i=a?o.find(l=>l.id===a.thinking.id):void 0,e[0]=o,e[1]=a,e[2]=i):i=e[2];const n=i;let c;return e[3]!==n||e[4]!==s?(c=d.jsx(Et,{model:n,placeholder:s}),e[3]=n,e[4]=s,e[5]=c):c=e[5],c}function Jo(t){const e=D.c(9),{selectedModel:a,placeholder:s}=t;if(!a){let p;return e[0]!==s?(p=d.jsx(Et,{model:void 0,placeholder:s}),e[0]=s,e[1]=p):p=e[1],p}const r=a.thinking.id;let o;e[2]!==r?(o=r.split("/").pop()??r,e[2]=r,e[3]=o):o=e[3];const i=o;let n;e[4]!==i?(n=d.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground group-data-[state=open]:text-foreground truncate whitespace-nowrap max-w-0 opacity-0 group-hover:max-w-[150px] group-hover:opacity-100 group-data-[state=open]:max-w-[150px] group-data-[state=open]:opacity-100 transition-all duration-200 ease-in-out overflow-hidden",children:i}),e[4]=i,e[5]=n):n=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(ot,{size:14,className:"text-muted-foreground opacity-0 max-w-0 group-hover:opacity-50 group-hover:max-w-[14px] group-data-[state=open]:opacity-50 group-data-[state=open]:max-w-[14px] shrink-0 transition-all duration-200 ease-in-out overflow-hidden"}),e[6]=c):c=e[6];let l;return e[7]!==n?(l=d.jsxs("div",{className:"flex items-center gap-0 group-hover:gap-2 group-data-[state=open]:gap-2 min-w-0 overflow-hidden transition-all duration-200",children:[n,c]}),e[7]=n,e[8]=l):l=e[8],l}function Vn(t){const e=D.c(31),{selectedModel:a,onModelChange:s,modelsConnections:r,variant:o,className:i,placeholder:n}=t,c=o===void 0?"borderless":o,l=n===void 0?"Select model":n,[p,m]=I.useState(!1),v=ht(),f=r??v;if(f.length===0)return null;const y=c==="borderless"?"ghost":"outline",b=c==="borderless"&&"md:border-none";let g;e[0]!==i||e[1]!==b?(g=Xt("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",b,i),e[0]=i,e[1]=b,e[2]=g):g=e[2];let h;e[3]!==l||e[4]!==a?(h=d.jsx(Jo,{selectedModel:a,placeholder:l}),e[3]=l,e[4]=a,e[5]=h):h=e[5];let _;e[6]!==l?(_=d.jsx(Et,{model:void 0,placeholder:l}),e[6]=l,e[7]=_):_=e[7];let u;e[8]!==l||e[9]!==a?(u=d.jsx(Wo,{selectedModel:a,placeholder:l}),e[8]=l,e[9]=a,e[10]=u):u=e[10];let S;e[11]!==_||e[12]!==u?(S=d.jsx(I.Suspense,{fallback:_,children:u}),e[11]=_,e[12]=u,e[13]=S):S=e[13];let A;e[14]!==h||e[15]!==S?(A=d.jsx(vt,{fallback:h,children:S}),e[14]=h,e[15]=S,e[16]=A):A=e[16];let N;e[17]!==A||e[18]!==y||e[19]!==g?(N=d.jsx(gs,{asChild:!0,children:d.jsx(rt,{variant:y,size:"sm",className:g,children:A})}),e[17]=A,e[18]=y,e[19]=g,e[20]=N):N=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=d.jsx(zo,{}),e[21]=T):T=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=()=>m(!1),e[22]=$):$=e[22];let z;e[23]!==f||e[24]!==s||e[25]!==a?(z=d.jsx(vs,{className:"w-full md:w-auto p-0",align:"start",side:"bottom",sideOffset:8,children:d.jsx(I.Suspense,{fallback:T,children:d.jsx(Bo,{selectedModel:a,onModelChange:s,onClose:$,modelsConnections:f})})}),e[23]=f,e[24]=s,e[25]=a,e[26]=z):z=e[26];let Q;return e[27]!==p||e[28]!==N||e[29]!==z?(Q=d.jsxs(ys,{open:p,onOpenChange:m,children:[N,z]}),e[27]=p,e[28]=N,e[29]=z,e[30]=Q):Q=e[30],Q}function Go(){const t=D.c(2),e=We();let a;return t[0]!==e?(a={prefillCollectionCache:(r,o,i,n)=>{if(!r)return;const c=yt(r,o,i,n);if(e.getQueryData(c))return;const p={structuredContent:{items:[]},isError:!1};e.setQueryData(c,p)}},t[0]=e,t[1]=a):a=t[1],a}const te={THREAD_MESSAGES_PAGE_SIZE:100,THREADS_PAGE_SIZE:50,QUERY_STALE_TIME:3e4};function Gt(t,e,a,s){const r=ye.threads(e),o=t.getQueryData(r);if(!o)return;const i=o.pages.map(c=>{const l=c.items.findIndex(f=>f.id===a);if(l===-1)return c;const p=[...c.items],m=p[l];if(!m)return c;const v={id:m.id,title:s.title??m.title,created_at:m.created_at,updated_at:s.updated_at??m.updated_at,hidden:s.hidden??m.hidden,status:s.status??m.status};return p[l]=v,{...c,items:p}});i.some((c,l)=>c.items.length!==o.pages[l]?.items.length||c.items.some((p,m)=>p.id===a&&p!==o.pages[l]?.items[m]))&&t.setQueryData(r,{...o,pages:i})}function Yo(t,e,a){const s=ye.threads(e),r=t.getQueryData(s);if(!r){t.setQueryData(s,{pages:[{items:[a],hasMore:!1,totalCount:1}],pageParams:[0]});return}if(r.pages.some(n=>n.items.some(c=>c.id===a.id)))return;const i=r.pages[0];if(i){const n={...i,items:[a,...i.items],totalCount:(i.totalCount??i.items.length)+1};t.setQueryData(s,{...r,pages:[n,...r.pages.slice(1)]})}else t.setQueryData(s,{...r,pages:[{items:[a],hasMore:!1,totalCount:1}]})}async function Qo(t,e,a,s){if(!e)return;const r=yt(e,"THREAD_MESSAGES",a,{filters:[{column:"thread_id",value:s}],pageSize:te.THREAD_MESSAGES_PAGE_SIZE});if(!r||t.getQueryData(r))return;const i="COLLECTION_THREAD_MESSAGES_LIST",n=Ms(void 0,[{column:"thread_id",value:s}],[]),c=Rs(void 0,void 0,"updated_at"),l={...n&&{where:n},...c&&{orderBy:c},limit:te.THREAD_MESSAGES_PAGE_SIZE,offset:0};await t.fetchQuery({queryKey:r,queryFn:async()=>await e.callTool({name:i,arguments:l}),staleTime:te.QUERY_STALE_TIME,retry:!1})}function Xo(t,e,a,s,r){if(!e)return;const o=yt(e,"THREAD_MESSAGES",a,{filters:[{column:"thread_id",value:s}],pageSize:te.THREAD_MESSAGES_PAGE_SIZE});o&&t.setQueryData(o,{structuredContent:{items:r},isError:!1})}async function Ko(t,e,a){if(!t)throw new Error("MCP client is not available");const s=await t.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:e,data:a}});return(s.structuredContent??s).item}function en(t){const e=new Date().toISOString();return{id:t,title:"New chat",created_at:e,updated_at:e}}function tn(t,e){return t.find(a=>a.id!==e)??null}function an(){const t=D.c(17),{locator:e,org:a}=be();let s;t[0]!==a.id?(s={connectionId:ft,orgId:a.id},t[0]=a.id,t[1]=s):s=t[1];const r=mt(s);let o;t[2]!==e?(o=ye.threads(e),t[2]=e,t[3]=o):o=t[3];let i;t[4]!==r?(i=async g=>{const{pageParam:h}=g,_=h===void 0?0:h;if(!r)throw new Error("MCP client is not available");const u={limit:te.THREADS_PAGE_SIZE,offset:_},S=await r.callTool({name:"COLLECTION_THREADS_LIST",arguments:u}),A=S.structuredContent??S;return{items:A.items??[],hasMore:A.hasMore??!1,totalCount:A.totalCount}},t[4]=r,t[5]=i):i=t[5];let n;t[6]!==o||t[7]!==i?(n={queryKey:o,queryFn:i,getNextPageParam:rn,initialPageParam:0,staleTime:te.QUERY_STALE_TIME},t[6]=o,t[7]=i,t[8]=n):n=t[8];const{data:c,fetchNextPage:l,hasNextPage:p,isFetchingNextPage:m,refetch:v}=ks(n);let f;t[9]!==c?.pages?(f=c?.pages.flatMap(sn)??[],t[9]=c?.pages,t[10]=f):f=t[10];const y=f;let b;return t[11]!==l||t[12]!==p||t[13]!==m||t[14]!==v||t[15]!==y?(b={threads:y,refetch:v,hasNextPage:p,isFetchingNextPage:m,fetchNextPage:l},t[11]=l,t[12]=p,t[13]=m,t[14]=v,t[15]=y,t[16]=b):b=t[16],b}function sn(t){return t.items}function rn(t,e){if(t.hasMore)return e.length*te.THREADS_PAGE_SIZE}function on(t){const e=D.c(6),{org:a}=be();let s;e[0]!==a.id?(s={connectionId:ft,orgId:a.id},e[0]=a.id,e[1]=s):s=e[1];const r=mt(s);let o;e[2]!==t?(o={filters:t?[{column:"thread_id",value:t}]:[],pageSize:te.THREAD_MESSAGES_PAGE_SIZE},e[2]=t,e[3]=o):o=e[3];const i=js(a.id,"THREAD_MESSAGES",r,o);let n;return e[4]!==i?(n=i??[],e[4]=i,e[5]=n):n=e[5],n}function nn(){const{locator:t,org:e}=be(),a=We(),{prefillCollectionCache:s}=Go(),{threads:r,hasNextPage:o,isFetchingNextPage:i,fetchNextPage:n}=an(),c=mt({connectionId:ft,orgId:e.id}),[l,p]=qe(gt.assistantChatActiveThread(t),r[0]?.id??crypto.randomUUID()),m=on(l),v=()=>{const h=crypto.randomUUID(),_=en(h);Yo(a,t,_),c&&s(c,"THREAD_MESSAGES",e.id,{filters:[{column:"thread_id",value:h}],pageSize:te.THREAD_MESSAGES_PAGE_SIZE}),p(h)},f=async h=>{await Qo(a,c,e.id,h),p(h)};return{threads:r,activeThreadId:l,messages:m,hasNextPage:o,isFetchingNextPage:i,fetchNextPage:n,createThread:v,switchThread:f,updateThread:(h,_)=>{Gt(a,t,h,_)},hideThread:async h=>{try{const _=await Ko(c,h,{hidden:!0});if(_){if(h===l){const S=tn(r,h);S?await f(S.id):v()}Gt(a,t,h,{hidden:!0,updated_at:_.updated_at??new Date().toISOString()})}}catch(_){const u=_;ke.error(`Failed to update thread: ${u.message}`),console.error("[chat] Failed to update thread:",_)}},updateMessagesCache:(h,_)=>{Xo(a,c,e.id,h,_)}}}const ka={parentThread:null,finishReason:null};function ln(t,e){switch(e.type){case"START_BRANCH":return{...t,parentThread:e.payload};case"CLEAR_BRANCH":return{...t,parentThread:null};case"SET_FINISH_REASON":return t.finishReason===e.payload?t:{...t,finishReason:e.payload};case"CLEAR_FINISH_REASON":return{...t,finishReason:null};case"RESET":return ka;default:return t}}const cn=(t,e)=>new Aa({api:`/api/${t}/decopilot/stream`,credentials:"include",prepareReconnectToStreamRequest:({id:a})=>({api:`/api/${t}/decopilot/attach/${a}`}),prepareSendMessagesRequest:({messages:a,requestMetadata:s={}})=>{const{system:r,tiptapDoc:o,toolApprovalLevel:i,...n}=s,c=r?{id:crypto.randomUUID(),role:"system",parts:[{type:"text",text:r}]}:null,l=a.slice(-1).filter(Boolean),p=c?[c,...l]:l,m=a.at(-1)?.metadata??{},v=a.findLast(b=>b.role==="user")?.metadata??{},f={...n,agent:n.agent??m.agent,models:n.models??m.models,thread_id:n.thread_id??m.thread_id},y=i??m.toolApprovalLevel??v.toolApprovalLevel??e.current;return{body:{messages:p,...f,...y&&{toolApprovalLevel:y}}}}}),un=(t,e)=>t?.find(a=>a.id===e)??t?.[0]??null,dn=(t,e)=>{const a=D.c(11);let s;a[0]!==t?(s=gt.chatSelectedModel(t),a[0]=t,a[1]=s):s=a[1];const[r,o]=qe(s,null),i=r?.connectionId;let n;a[2]!==e||a[3]!==i?(n=un(e,i),a[2]=e,a[3]=i,a[4]=n):n=a[4];const c=n;let l;a[5]!==r||a[6]!==c?(l=r&&c?{connectionId:c.id,thinking:{id:r.id,provider:r.provider,capabilities:r.capabilities?{vision:r.capabilities.includes("vision")?!0:void 0,text:r.capabilities.includes("text")?!0:void 0,tools:r.capabilities.includes("tools")?!0:void 0}:void 0,limits:r.limits}}:null,a[5]=r,a[6]=c,a[7]=l):l=a[7];const p=l;let m;return a[8]!==p||a[9]!==o?(m=[p,o],a[8]=p,a[9]=o,a[10]=m):m=a[10],m};function pn(t,e){const a=[];for(const s of t)"text"in s&&s.text?a.push({type:"text",text:`[${e}]
20
+ ${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&a.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return a}function mn(t,e){const a=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const r=Array.isArray(s.content)?s.content:[s.content];for(const o of r)switch(o.type){case"text":{const i=o.text?.trim();if(!i)continue;a.push({type:"text",text:`[${e}]
21
+ ${i}`});break}case"image":case"audio":{if(!o.data||!o.mimeType)continue;a.push({type:"file",url:`data:${o.mimeType};base64,${o.data}`,mediaType:o.mimeType});break}case"resource":{const i=o.resource;if(!i||!i.mimeType)continue;i&&("text"in i&&i.text?a.push({type:"text",text:`[${e}]
22
+ ${i.text}`}):"blob"in i&&i.blob&&i.mimeType&&a.push({type:"file",url:`data:${i.mimeType};base64,${i.blob}`,filename:String(i.uri),mediaType:String(i.mimeType)}));break}}}return a}function fn(t,e){const{mimeType:a,data:s}=t;if(a.startsWith("text/"))try{const r=atob(s);return[{type:"text",text:`${e}
23
+ ${r}`}]}catch(r){console.error("Failed to decode text file:",r)}return[{type:"file",url:`data:${a};base64,${s}`,filename:e,mediaType:a}]}function hn(t){if(!t)return[];const e=[];let a="";const s=r=>{if(r){if(r.type==="text"&&"text"in r&&typeof r.text=="string")a+=r.text;else if(r.type==="mention"&&r.attrs){const o=r.attrs.char??"/",i=`${o}${r.attrs.name}`;if(a+=i,o==="@"){const n=r.attrs.metadata||[];e.push(...pn(n,i))}else{const n=r.attrs.metadata||r.attrs.prompts||[];e.push(...mn(n,i))}}else if(r.type==="file"&&r.attrs){const o=r.attrs,i=`[file:://${encodeURIComponent(o.name)}]`;a+=i,e.push(...fn(o,i))}if("content"in r&&Array.isArray(r.content))for(const o of r.content)s(o)}};return s(t),a.trim()&&e.unshift({type:"text",text:a.trim()}),e}const Oa=I.createContext(null),Pa=I.createContext(null);function gn(t){const e=D.c(8),{modelsConnections:a,currentConfig:s,onAutoSelect:r,allowAll:o,isModelAllowed:i}=t,n=a[0],c=_t(n?.id);let l,p;return e[0]!==o||e[1]!==s||e[2]!==n||e[3]!==i||e[4]!==c||e[5]!==r?(l=()=>{if(s||!n||c.length===0)return;const v=(o?c:c.filter(f=>i(n.id,f.id)))[0];v&&r({id:v.id,connectionId:n.id,provider:v.provider??void 0,capabilities:v.capabilities??void 0,limits:v.limits??void 0})},p=[c,s,n,r,o,i],e[0]=o,e[1]=s,e[2]=n,e[3]=i,e[4]=c,e[5]=r,e[6]=l,e[7]=p):(l=e[6],p=e[7]),I.useEffect(l,p),null}function Bn({children:t}){const{locator:e,org:a}=be(),s=We(),r=nn(),{data:o}=cs.useSession(),i=o?.user??null,[n]=fs(),[c,l]=I.useReducer(ln,ka),p=I.useRef(void 0),m=I.useRef(n.toolApprovalLevel);m.current=n.toolApprovalLevel;const v=ds(),[f,y]=qe(`${e}:selected-virtual-mcp-id`,null),b=ht(),{hasConnectionModels:g,isModelAllowed:h,allowAll:_}=Ra(),u=b.filter(C=>g(C.id)),[S,A]=dn(e,u),[N,T]=qe(gt.chatSelectedMode(e),"code_execution"),$=r.messages,z=No(f),Q=To(),{showNotification:_e}=Co(),fe=f?v.find(C=>C.id===f)??null:null,ae=us(a.id).id,se=cn(a.slug,m),re=async({finishReason:C,isAbort:P,isDisconnect:F,isError:Fe,message:Xe,messages:Ue})=>{l({type:"SET_FINISH_REASON",payload:C??null});const Ee=Xe.metadata?.thread_id??r.activeThreadId;if(P||F||Fe){Ee&&Ue.length>0&&r.updateMessagesCache(Ee,Ue);return}Ee&&(Ue.length>0&&r.updateMessagesCache(Ee,Ue),n.enableNotifications&&_e({tag:`chat-${Ee}`,title:"Decopilot is waiting for your input at",body:r.threads.find(Qa=>Qa.id===Ee)?.title??"New chat"}))},oe=C=>{console.error("[chat] Error",C)},Z=Eo({id:r.activeThreadId,messages:$,transport:se,sendAutomaticallyWhen:({messages:C})=>go({messages:C})||ho({messages:C}),onFinish:re,onToolCall:Q,onError:oe,onData:({data:C,type:P})=>{if(P==="data-thread-title"){const{title:F}=C;if(!F)return;r.updateThread(r.activeThreadId,{title:F,updated_at:new Date().toISOString()})}}}),H=Z.status==="submitted"||Z.status==="streaming",ne=(()=>{const C=Z.messages.at(-1);return!C||C.role!=="assistant"?!1:C.parts.some(P=>"state"in P&&P.state==="approval-requested")})(),ie=Z.messages.length===0&&r.messages.length===0,ee=r.threads.find(C=>C.id===r.activeThreadId),le=(ee?.status==="in_progress"||ee?.status==="expired")&&!H,L=I.useRef(Z);L.current=Z;const ce=I.useRef(null),he=I.useRef(0),Da=3,Ce=()=>{s.invalidateQueries({queryKey:ye.threads(e)});const C=r.activeThreadId;C&&s.invalidateQueries({predicate:P=>{const F=P.queryKey;return F[3]!=="collection"||F[4]!=="THREAD_MESSAGES"?!1:(typeof F[6]=="string"?F[6]:"").includes(C)}})},Ge=C=>{const P=r.activeThreadId;!P||ce.current===P||he.current>=Da||(ce.current=P,console.log(`[chat] resumeStream (${C})`,P),L.current.resumeStream().catch(F=>{console.error("[chat] resumeStream error",F),he.current++,ce.current=null,Ce()}))},Ye=I.useRef(Ce);Ye.current=Ce;const St=I.useRef(Ge);St.current=Ge,wo({orgId:a.id,threadId:r.activeThreadId,onStep:()=>Ge("sse-step"),onFinish:()=>{ce.current=null,he.current=0,H||Ce()},onThreadStatus:()=>{H||Ce()}});const It=I.useRef(r.activeThreadId);It.current!==r.activeThreadId&&(It.current=r.activeThreadId,ce.current=null,he.current=0);const $a=3e4;I.useEffect(()=>{if(!le)return;St.current("page-load"),Ye.current();const C=setInterval(()=>Ye.current(),$a);return()=>{clearInterval(C)}},[le]);const La=H?Z.messages:r.messages,Za=()=>{Qe(),r.createThread()},Fa=r.switchThread,Ua=r.hideThread,Qe=()=>l({type:"RESET"}),za=C=>{y(C)},Va=C=>{A({id:C.id,connectionId:C.connectionId,provider:C.provider,capabilities:C.capabilities,limits:C.limits})},Ba=async C=>{if(!S){ke.error("No model configured");return}const P=hn(C);if(P.length===0)return;r.messages.length>0&&L.current.setMessages(r.messages),Qe();const F={tiptapDoc:C,created_at:new Date().toISOString(),thread_id:r.activeThreadId,toolApprovalLevel:n.toolApprovalLevel,agent:{id:fe?.id??ae,mode:N},user:{avatar:i?.image??void 0,name:i?.name??"you"}},Fe={...F,system:z,models:S},Xe={id:crypto.randomUUID(),role:"user",parts:P,metadata:F};await L.current.sendMessage(Xe,{metadata:Fe})},wt=async()=>{const C=r.activeThreadId;if(C){ce.current=null,he.current=0,L.current.messages.length>0&&r.updateMessagesCache(C,L.current.messages),L.current.stop();try{const P=await fetch(`/api/${a.slug}/decopilot/cancel/${C}`,{method:"POST",credentials:"include"});if(!P.ok){const F=await P.json().catch(()=>({}));throw new Error(F.message??`Cancel failed: ${P.status}`)}await s.invalidateQueries({queryKey:ye.threads(e)})}catch(P){const F=P instanceof Error?P.message:"Failed to cancel";ke.error(F),console.error("[chat] cancelRun",P)}}},qa=()=>{H&&wt(),Z.stop()},Ha=()=>(qa(),Promise.resolve()),Wa=()=>l({type:"CLEAR_FINISH_REASON"}),Ja=I.useDeferredValue(La),Ga={tiptapDocRef:p,resetInteraction:Qe,activeThreadId:r.activeThreadId,threads:r.threads,createThread:Za,switchToThread:Fa,hideThread:Ua,hasNextPage:r.hasNextPage,isFetchingNextPage:r.isFetchingNextPage,fetchNextPage:r.fetchNextPage,virtualMcps:v,selectedVirtualMcp:fe,setVirtualMcpId:za,modelsConnections:u,selectedModel:S,setSelectedModel:Va,selectedMode:N,setSelectedMode:T,sendMessage:Ba,cancelRun:wt},Ya={messages:Ja,status:Z.status,setMessages:Z.setMessages,error:Z.error,clearError:Z.clearError,stop:Ha,addToolOutput:Z.addToolOutput,addToolApprovalResponse:Z.addToolApprovalResponse,isStreaming:H,isChatEmpty:ie,finishReason:c.finishReason,clearFinishReason:Wa,isWaitingForApprovals:ne,isRunInProgress:le};return d.jsx(Oa.Provider,{value:Ga,children:d.jsxs(Pa.Provider,{value:Ya,children:[d.jsx(vt,{fallback:null,children:d.jsx(I.Suspense,{fallback:null,children:d.jsx(gn,{modelsConnections:u,currentConfig:S,onAutoSelect:A,allowAll:_,isModelAllowed:h})})}),t]})})}function vn(){const t=I.useContext(Oa);if(!t)throw new Error("useChatStable must be used within a ChatProvider");return t}function yn(){const t=I.useContext(Pa);if(!t)throw new Error("useChatStream must be used within a ChatProvider");return t}function qn(){const t=D.c(3),e=vn(),a=yn();let s;return t[0]!==e||t[1]!==a?(s={...e,...a},t[0]=e,t[1]=a,t[2]=s):s=t[2],s}export{Bn as C,Vn as M,wo as a,qn as b,So as c,ea as i,zn as m,sa as t,vn as u};
@@ -1 +1 @@
1
- import{o as A,s as D,c as O,k as v,l as E,j as r,d as N}from"./index-Chdo1wOf.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-DG1mgLiN.js";import{B}from"./button-BlFVi9O-.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-DdvC8UfL.js";import{I as P}from"./input-C2bYHqSZ.js";import{S as Q}from"./spinner-DeIV40-d.js";import{u as W}from"./useMutation-BTkDU0tp.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
1
+ import{o as A,s as D,c as O,k as v,l as E,j as r,d as N}from"./index-DQipirM0.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-K0UnFp_v.js";import{B}from"./button-BxOn_P7A.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-Dn5Ilwyi.js";import{I as P}from"./input-D3a40-af.js";import{S as Q}from"./spinner-BL4ZMZYA.js";import{u as W}from"./useMutation-8rEyObWg.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
@@ -1 +1 @@
1
- import{c as A,j as e,u as L,b as R,m as k,r as z,l as M,t as B,K as T,O as j,o as V,s as f}from"./index-Chdo1wOf.js";import{u as $}from"./useMutation-BTkDU0tp.js";import{u as q,a as O}from"./constants-DS4O9R8r.js";import{D as K,a as U,b as G,c as J,d as Q,e as Y}from"./dialog-BED3woG1.js";import{c as H,B as D}from"./button-BlFVi9O-.js";import{a as W,F as v,b as F,c as N,d as S,f as w}from"./form-DdvC8UfL.js";import{I}from"./input-C2bYHqSZ.js";import{T as X}from"./textarea-B5CEImaf.js";import{L as Z}from"./label-Cz00Hk_C.js";import{i as ee}from"./Check-ebSdGxZp.js";function se(l){return l.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(l){return/^[a-z0-9-]+$/.test(l)&&l.length>0&&l.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function re(l){const s=A.c(16),{value:n,onChange:i}=l;let c;s[0]!==i||s[1]!==n?(c=te.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:H("size-8 rounded-lg transition-all",n===o&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:o},children:n===o&&e.jsx(ee,{className:"size-4 text-white mx-auto"})},o)),s[0]=i,s[1]=n,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=n??"#3B82F6";let d;s[5]!==i?(d=o=>i(o.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}V({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function xe({open:l,onOpenChange:s}){const{org:n}=L(),i=R(),c=k(),[u,g]=z.useState(!1),d=q({connectionId:O,orgId:n.id}),t=M({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=$({mutationFn:async r=>{const h=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:n.id,slug:r.slug,name:r.name,description:r.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:r.bannerColor??null,icon:null,themeColor:r.bannerColor??null}}});return h.structuredContent??h},onSuccess:r=>{c.invalidateQueries({queryKey:T.projects(n.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:n.slug,project:r.project.slug}})},onError:r=>{B.error("Failed to create project: "+(r instanceof Error?r.message:"Unknown error"))}}),m=async r=>{if(!_(r.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(r.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(r)},x=r=>{const h=r.target.value;if(t.setValue("name",h),!u){const P=se(h);t.setValue("slug",P)}},o=r=>{g(!0),t.setValue("slug",r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),p=t.watch("slug"),b=t.watch("name"),y=p===j,E=p.length>0&&!_(p);return e.jsx(K,{open:l,onOpenChange:s,children:e.jsxs(U,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(G,{children:[e.jsx(J,{children:"Create New Project"}),e.jsxs(Q,{children:["Set up a new project in ",n.name,". You can configure plugins and settings after creation."]})]}),e.jsx(W,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(Z,{children:"Banner Color"}),e.jsx(re,{value:C??null,onChange:r=>t.setValue("bannerColor",r)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",n.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:p,onChange:o,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:r})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(X,{...r,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(Y,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!p,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{xe as C};
1
+ import{c as A,j as e,u as L,b as R,m as k,r as z,l as M,t as B,K as T,O as j,o as V,s as f}from"./index-DQipirM0.js";import{u as $}from"./useMutation-8rEyObWg.js";import{u as q,a as O}from"./constants-9bKBT988.js";import{D as K,a as U,b as G,c as J,d as Q,e as Y}from"./dialog-8Qx5GCEw.js";import{c as H,B as D}from"./button-BxOn_P7A.js";import{a as W,F as v,b as F,c as N,d as S,f as w}from"./form-Dn5Ilwyi.js";import{I}from"./input-D3a40-af.js";import{T as X}from"./textarea-DX9d61Sr.js";import{L as Z}from"./label-_-PuJzKE.js";import{i as ee}from"./Check-BEIYk4IG.js";function se(l){return l.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(l){return/^[a-z0-9-]+$/.test(l)&&l.length>0&&l.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function re(l){const s=A.c(16),{value:n,onChange:i}=l;let c;s[0]!==i||s[1]!==n?(c=te.map(o=>e.jsx("button",{type:"button",onClick:()=>i(o),className:H("size-8 rounded-lg transition-all",n===o&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:o},children:n===o&&e.jsx(ee,{className:"size-4 text-white mx-auto"})},o)),s[0]=i,s[1]=n,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=n??"#3B82F6";let d;s[5]!==i?(d=o=>i(o.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}V({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function xe({open:l,onOpenChange:s}){const{org:n}=L(),i=R(),c=k(),[u,g]=z.useState(!1),d=q({connectionId:O,orgId:n.id}),t=M({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=$({mutationFn:async r=>{const h=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:n.id,slug:r.slug,name:r.name,description:r.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:r.bannerColor??null,icon:null,themeColor:r.bannerColor??null}}});return h.structuredContent??h},onSuccess:r=>{c.invalidateQueries({queryKey:T.projects(n.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:n.slug,project:r.project.slug}})},onError:r=>{B.error("Failed to create project: "+(r instanceof Error?r.message:"Unknown error"))}}),m=async r=>{if(!_(r.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(r.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(r)},x=r=>{const h=r.target.value;if(t.setValue("name",h),!u){const P=se(h);t.setValue("slug",P)}},o=r=>{g(!0),t.setValue("slug",r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),p=t.watch("slug"),b=t.watch("name"),y=p===j,E=p.length>0&&!_(p);return e.jsx(K,{open:l,onOpenChange:s,children:e.jsxs(U,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(G,{children:[e.jsx(J,{children:"Create New Project"}),e.jsxs(Q,{children:["Set up a new project in ",n.name,". You can configure plugins and settings after creation."]})]}),e.jsx(W,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(Z,{children:"Banner Color"}),e.jsx(re,{value:C??null,onChange:r=>t.setValue("bannerColor",r)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",n.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:p,onChange:o,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:r})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(X,{...r,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(Y,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!p,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{xe as C};
@@ -0,0 +1 @@
1
+ import{r as s}from"./index-DQipirM0.js";const c=({size:e=24,color:t="currentColor",...o})=>s.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},s.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="Coins01";const p="https://sites-openrouter.decocache.com/mcp",a="https://sites-deco-ai-gateway.decocache.com/mcp",n=[a];function d(e){if(!e)return!1;try{const t=new URL(e);return n.some(o=>{const r=new URL(o);return t.origin===r.origin&&t.pathname.replace(/\/$/,"")===r.pathname})}catch{return!1}}const h="https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg";export{h as O,c as a,p as b,d as i};
@@ -1 +1 @@
1
- import{c as n,j as i,I as m,J as g,T as u,M as x,Q as j,U as N,W as b,X as D}from"./index-Chdo1wOf.js";import{i as h}from"./tooltip-BWW8lvJo.js";import{c}from"./button-BlFVi9O-.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("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/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(g,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,T as a,R as b,E as c,O as d,B as e,w as f};
1
+ import{c as n,j as i,I as m,J as g,T as u,M as x,Q as j,U as N,W as b,X as D}from"./index-DQipirM0.js";import{i as h}from"./tooltip-B7RjBzxU.js";import{c}from"./button-BxOn_P7A.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("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/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(b,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(g,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,T as a,R as b,E as c,O as d,B as e,w as f};
@@ -1 +1 @@
1
- import{c,j as d,Y as p,Z as f,_ as m,$ as g,a0 as x,a1 as v,a2 as b,a3 as h,a4 as w,a5 as j,a6 as N,a7 as z}from"./index-Chdo1wOf.js";import{i as _}from"./Check-ebSdGxZp.js";import{i as $}from"./ChevronRight-D1zpPr9G.js";import{c as u}from"./button-BlFVi9O-.js";function k(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(g,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function C(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(p,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function I(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,sideOffset:a,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const o=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==o||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:o,className:r,...s})}),e[6]=s,e[7]=o,e[8]=r,e[9]=i):i=e[9],i}function T(n){const e=c.c(12);let t,s,a,o;e[0]!==n?({className:t,inset:s,variant:o,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);const r=o===void 0?"default":o;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==a||e[9]!==i||e[10]!==r?(l=d.jsx(m,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...a}),e[7]=s,e[8]=a,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function R(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:a,children:s,checked:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),e[5]=a,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(w,{children:d.jsx(_,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==o||e[11]!==r?(l=d.jsxs(f,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...o,children:[i,s]}),e[8]=t,e[9]=s,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function E(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,inset:s,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let o;e[4]!==t?(o=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=o):o=e[5];let r;return e[6]!==s||e[7]!==a||e[8]!==o?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:o,...a}),e[6]=s,e[7]=a,e[8]=o,e[9]=r):r=e[9],r}function L(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:s,inset:a,children:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx($,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==o||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...o,children:[t,i]}),e[8]=t,e[9]=a,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function Y(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,C as a,I as b,T as c,O as d,P as e,Y as f,L as g,R as h,E as i};
1
+ import{c,j as d,Y as p,Z as f,_ as m,$ as g,a0 as x,a1 as v,a2 as b,a3 as h,a4 as w,a5 as j,a6 as N,a7 as z}from"./index-DQipirM0.js";import{i as _}from"./Check-BEIYk4IG.js";import{i as $}from"./ChevronRight-dj0VUAfs.js";import{c as u}from"./button-BxOn_P7A.js";function k(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(g,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function C(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(p,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function I(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,sideOffset:a,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);const o=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==o||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:o,className:r,...s})}),e[6]=s,e[7]=o,e[8]=r,e[9]=i):i=e[9],i}function T(n){const e=c.c(12);let t,s,a,o;e[0]!==n?({className:t,inset:s,variant:o,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);const r=o===void 0?"default":o;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==a||e[9]!==i||e[10]!==r?(l=d.jsx(m,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...a}),e[7]=s,e[8]=a,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function R(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:a,children:s,checked:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==a?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),e[5]=a,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(w,{children:d.jsx(_,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==o||e[11]!==r?(l=d.jsxs(f,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...o,children:[i,s]}),e[8]=t,e[9]=s,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function E(n){const e=c.c(10);let t,s,a;e[0]!==n?({className:t,inset:s,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let o;e[4]!==t?(o=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=o):o=e[5];let r;return e[6]!==s||e[7]!==a||e[8]!==o?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:o,...a}),e[6]=s,e[7]=a,e[8]=o,e[9]=r):r=e[9],r}function L(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(n){const e=c.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(n){const e=c.c(13);let t,s,a,o;e[0]!==n?({className:s,inset:a,children:t,...o}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx($,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==o||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...o,children:[t,i]}),e[8]=t,e[9]=a,e[10]=o,e[11]=r,e[12]=l):l=e[12],l}function Y(n){const e=c.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,C as a,I as b,T as c,O as d,P as e,Y as f,L as g,R as h,E as i};
@@ -1 +1 @@
1
- import{c as R,u as W,e as A,d as X,K as Z,j as n,r as $,aD as J,aE as ee,aF as te}from"./index-Chdo1wOf.js";import{i as v}from"./Loading01-BZRHfswB.js";import{c as ne}from"./binder-Yx0eVQL7.js";import{P as O}from"./topbar-portal-m9wB0x-E.js";import{u as ie}from"./useQuery-C0AkqYB7.js";import{h as se}from"./use-connection-O4z2Mc_F.js";import{a as oe,u as le,j as re}from"./constants-DS4O9R8r.js";import{t as ae}from"./Settings01-hHMZndAB.js";import{B as ce}from"./button-BlFVi9O-.js";import{P as E}from"./index-6Tp9fsVX.js";import"./useMutation-BTkDU0tp.js";import"./use-mobile-ziAtnWz2.js";import"./tooltip-BWW8lvJo.js";function de(t,e){return t?t.filter(m=>ne(m,e)):[]}function K(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=R.c(35),{binding:m,renderHeader:f,renderEmptyState:i}=t,{org:o,project:l}=W();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const{org:r,project:g,pluginId:u}=A(c),Q=se(),{data:y}=X.useSession();let _;e[1]!==o.id?(_={connectionId:oe,orgId:o.id},e[1]=o.id,e[2]=_):_=e[2];const H=le(_);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const s=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return s.structuredContent??s},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let b;e[10]!==x||e[11]!==p||e[12]!==T?(b={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=b):b=e[13];const{data:U,isLoading:Y}=ie(b),q=de(Q,m),D=U?.config?.connectionId,j=D?q.find(s=>s.id===D):null,P=re({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=s):s=e[14],s}if(q.length===0){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let a;e[15]!==i?(a=i(),e[15]=i,e[16]=a):a=e[16];let d;return e[17]!==a?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:a}),e[17]=a,e[18]=d):d=e[18],n.jsx(O,{value:s,children:d})}if(!j){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let a;e[19]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=a):a=e[19];const d=r??o.slug,M=g??l.slug??"";let L;return e[20]!==d||e[21]!==M?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[a,n.jsx(ce,{asChild:!0,children:n.jsx(ee,{to:"/$org/$project/settings",params:{org:d,project:M},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=M,e[22]=L):L=e[22],n.jsx(O,{value:s,children:L})}let S;e[23]!==P?(S=(s,a)=>P?P.callTool({name:s,arguments:a}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:K(j),toolCaller:S,org:z,session:w},B=E,G=E,k=E,F=f({connections:[K(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==F||e[26]!==k.Header.Left?(h=n.jsx(k.Header.Left,{children:F}),e[25]=F,e[26]=k.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx($.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx(O,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Le(){const t=R.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=A(e);let f;t[1]!==m?(f=te.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const i=f;if(i?.renderHeader&&i?.renderEmptyState&&i?.binding){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==i.binding||t[5]!==i.renderEmptyState||t[6]!==i.renderHeader?(g=n.jsx($.Suspense,{fallback:r,children:n.jsx(me,{binding:i.binding,renderHeader:i.renderHeader,renderEmptyState:i.renderEmptyState})}),t[4]=i.binding,t[5]=i.renderEmptyState,t[6]=i.renderHeader,t[7]=g):g=t[7],g}const o=i?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let c;return t[10]!==o?(c=n.jsx($.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=c):c=t[11],c}export{Le as default};
1
+ import{c as R,u as W,e as A,d as X,K as Z,j as n,r as q,aC as J,aD as ee,aE as te}from"./index-DQipirM0.js";import{i as v}from"./Loading01-BFMhWWtD.js";import{c as ne}from"./binder-BeV9Iq0g.js";import{P as $}from"./topbar-portal-D44GN90b.js";import{u as ie}from"./useQuery-CqT-L2b-.js";import{h as se}from"./use-connection-DXequUdB.js";import{a as oe,u as le,j as re}from"./constants-9bKBT988.js";import{t as ae}from"./Settings01-CE-2gHzf.js";import{B as ce}from"./button-BxOn_P7A.js";import{P as E}from"./index-DlglR7Dv.js";import"./useMutation-8rEyObWg.js";import"./use-mobile-CYG2M3Mj.js";import"./tooltip-B7RjBzxU.js";function de(t,e){return t?t.filter(m=>ne(m,e)):[]}function K(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=R.c(35),{binding:m,renderHeader:f,renderEmptyState:i}=t,{org:o,project:l}=W();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const{org:r,project:g,pluginId:u}=A(c),Q=se(),{data:y}=X.useSession();let _;e[1]!==o.id?(_={connectionId:oe,orgId:o.id},e[1]=o.id,e[2]=_):_=e[2];const H=le(_);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const s=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return s.structuredContent??s},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let b;e[10]!==x||e[11]!==p||e[12]!==T?(b={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=b):b=e[13];const{data:U,isLoading:Y}=ie(b),D=de(Q,m),F=U?.config?.connectionId,j=F?D.find(s=>s.id===F):null,P=re({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=s):s=e[14],s}if(D.length===0){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let a;e[15]!==i?(a=i(),e[15]=i,e[16]=a):a=e[16];let d;return e[17]!==a?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:a}),e[17]=a,e[18]=d):d=e[18],n.jsx($,{value:s,children:d})}if(!j){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let a;e[19]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=a):a=e[19];const d=r??o.slug,O=g??l.slug??"";let L;return e[20]!==d||e[21]!==O?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[a,n.jsx(ce,{asChild:!0,children:n.jsx(ee,{to:"/$org/$project/settings",params:{org:d,project:O},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=O,e[22]=L):L=e[22],n.jsx($,{value:s,children:L})}let S;e[23]!==P?(S=(s,a)=>P?P.callTool({name:s,arguments:a}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:K(j),toolCaller:S,org:z,session:w},B=E,G=E,k=E,M=f({connections:[K(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==M||e[26]!==k.Header.Left?(h=n.jsx(k.Header.Left,{children:M}),e[25]=M,e[26]=k.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx(q.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx($,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Le(){const t=R.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=A(e);let f;t[1]!==m?(f=te.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const i=f;if(i?.renderHeader&&i?.renderEmptyState&&i?.binding){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==i.binding||t[5]!==i.renderEmptyState||t[6]!==i.renderHeader?(g=n.jsx(q.Suspense,{fallback:r,children:n.jsx(me,{binding:i.binding,renderHeader:i.renderHeader,renderEmptyState:i.renderEmptyState})}),t[4]=i.binding,t[5]=i.renderEmptyState,t[6]=i.renderHeader,t[7]=g):g=t[7],g}const o=i?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let c;return t[10]!==o?(c=n.jsx(q.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=c):c=t[11],c}export{Le as default};
@@ -0,0 +1 @@
1
+ import{c as v,j as t}from"./index-DQipirM0.js";import{c as N}from"./button-BxOn_P7A.js";function y(){const f=v.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),f[0]=e):e=f[0],e}function S(f){const e=v.c(24),{image:o,title:p,description:u,actions:x,className:h,descriptionClassName:j,actionsClassName:g}=f;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==o?(l=o!==null&&t.jsx("div",{className:"flex items-center justify-center",children:o??t.jsx(y,{})}),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let r;e[11]!==i||e[12]!==a?(r=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=r):r=e[13];let n;e[14]!==x||e[15]!==g?(n=x&&t.jsx("div",{className:N("flex items-center gap-2",g),children:x}),e[14]=x,e[15]=g,e[16]=n):n=e[16];let m;e[17]!==r||e[18]!==n?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r,n]}),e[17]=r,e[18]=n,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{S as E};
@@ -1 +1 @@
1
- import{c as b,j as t}from"./index-Chdo1wOf.js";import{c as h,B as g}from"./button-BlFVi9O-.js";function E(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{E};
1
+ import{c as b,j as t}from"./index-DQipirM0.js";import{c as h,B as g}from"./button-BxOn_P7A.js";function E(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{E};
@@ -1 +1 @@
1
- import{c as V,j as o}from"./index-Chdo1wOf.js";import{B as C}from"./button-BlFVi9O-.js";import{I as P}from"./input-C2bYHqSZ.js";import{s as A}from"./Plus-YlJja9E2.js";import{s as R}from"./Trash01-DjSET-_p.js";function z(i){const e=i.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function T(i){const e=V.c(34),{value:t,onChange:s,keyPlaceholder:j,valuePlaceholder:l,className:E}=i,p=j===void 0?"VARIABLE_NAME":j,h=l===void 0?"value...":l;let k;e[0]!==s||e[1]!==t?(k=()=>{s([...t,{key:"",value:""}])},e[0]=s,e[1]=t,e[2]=k):k=e[2];const N=k;let y;e[3]!==s||e[4]!==t?(y=n=>{s(t.filter((c,r)=>r!==n))},e[3]=s,e[4]=t,e[5]=y):y=e[5];const m=y;let g;e[6]!==s||e[7]!==t?(g=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:c,value:a.value},s(r))},e[6]=s,e[7]=t,e[8]=g):g=e[8];const _=g;let x;e[9]!==s||e[10]!==t?(x=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:a.key,value:c},s(r))},e[9]=s,e[10]=t,e[11]=x):x=e[11];const v=x;let u;if(e[12]!==_||e[13]!==m||e[14]!==v||e[15]!==p||e[16]!==t||e[17]!==h){let n;e[19]!==_||e[20]!==m||e[21]!==v||e[22]!==p||e[23]!==h?(n=(c,r)=>o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx(P,{placeholder:p,value:c.key,onChange:a=>_(r,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),o.jsx(P,{type:z(c.key)?"password":"text",placeholder:h,value:c.value,onChange:a=>v(r,a.target.value),className:"h-10 rounded-lg flex-1"}),o.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>m(r),children:o.jsx(R,{size:16})})]},r),e[19]=_,e[20]=m,e[21]=v,e[22]=p,e[23]=h,e[24]=n):n=e[24],u=t.map(n),e[12]=_,e[13]=m,e[14]=v,e[15]=p,e[16]=t,e[17]=h,e[18]=u}else u=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==N?(f=o.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=f):f=e[27];let d;e[28]!==u||e[29]!==f?(d=o.jsxs("div",{className:"flex flex-col gap-2",children:[u,f]}),e[28]=u,e[29]=f,e[30]=d):d=e[30];let b;return e[31]!==E||e[32]!==d?(b=o.jsx("div",{className:E,children:d}),e[31]=E,e[32]=d,e[33]=b):b=e[33],b}function W(i){const e={};for(const{key:t,value:s}of i)t.trim()&&(e[t.trim()]=s);return e}function $(i){return i?Object.entries(i).map(([e,t])=>({key:e,value:t})):[]}export{T as E,W as e,$ as r};
1
+ import{c as V,j as o}from"./index-DQipirM0.js";import{B as C}from"./button-BxOn_P7A.js";import{I as P}from"./input-D3a40-af.js";import{s as A}from"./Plus-Ck954sGm.js";import{s as R}from"./Trash01-BC7PAlKV.js";function z(i){const e=i.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function T(i){const e=V.c(34),{value:t,onChange:s,keyPlaceholder:j,valuePlaceholder:l,className:E}=i,p=j===void 0?"VARIABLE_NAME":j,h=l===void 0?"value...":l;let k;e[0]!==s||e[1]!==t?(k=()=>{s([...t,{key:"",value:""}])},e[0]=s,e[1]=t,e[2]=k):k=e[2];const N=k;let y;e[3]!==s||e[4]!==t?(y=n=>{s(t.filter((c,r)=>r!==n))},e[3]=s,e[4]=t,e[5]=y):y=e[5];const m=y;let g;e[6]!==s||e[7]!==t?(g=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:c,value:a.value},s(r))},e[6]=s,e[7]=t,e[8]=g):g=e[8];const _=g;let x;e[9]!==s||e[10]!==t?(x=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:a.key,value:c},s(r))},e[9]=s,e[10]=t,e[11]=x):x=e[11];const v=x;let u;if(e[12]!==_||e[13]!==m||e[14]!==v||e[15]!==p||e[16]!==t||e[17]!==h){let n;e[19]!==_||e[20]!==m||e[21]!==v||e[22]!==p||e[23]!==h?(n=(c,r)=>o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx(P,{placeholder:p,value:c.key,onChange:a=>_(r,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),o.jsx(P,{type:z(c.key)?"password":"text",placeholder:h,value:c.value,onChange:a=>v(r,a.target.value),className:"h-10 rounded-lg flex-1"}),o.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>m(r),children:o.jsx(R,{size:16})})]},r),e[19]=_,e[20]=m,e[21]=v,e[22]=p,e[23]=h,e[24]=n):n=e[24],u=t.map(n),e[12]=_,e[13]=m,e[14]=v,e[15]=p,e[16]=t,e[17]=h,e[18]=u}else u=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==N?(f=o.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=f):f=e[27];let d;e[28]!==u||e[29]!==f?(d=o.jsxs("div",{className:"flex flex-col gap-2",children:[u,f]}),e[28]=u,e[29]=f,e[30]=d):d=e[30];let b;return e[31]!==E||e[32]!==d?(b=o.jsx("div",{className:E,children:d}),e[31]=E,e[32]=d,e[33]=b):b=e[33],b}function W(i){const e={};for(const{key:t,value:s}of i)t.trim()&&(e[t.trim()]=s);return e}function $(i){return i?Object.entries(i).map(([e,t])=>({key:e,value:t})):[]}export{T as E,W as e,$ as r};
@@ -1 +1 @@
1
- import{r as s,j as e}from"./index-Chdo1wOf.js";import{B as o}from"./button-BlFVi9O-.js";import{i as a}from"./AlertTriangle-BR7J9Jvh.js";class u extends s.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,t){console.error("Uncaught error:",r,t)}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:r}=this.props;return typeof r=="function"?r({error:this.state.error,resetError:this.resetError}):r!==void 0?r:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(a,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(o,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}export{u as E};
1
+ import{r as s,j as e}from"./index-DQipirM0.js";import{B as o}from"./button-BxOn_P7A.js";import{i as a}from"./AlertTriangle-Cag6cydu.js";class u extends s.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,t){console.error("Uncaught error:",r,t)}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:r}=this.props;return typeof r=="function"?r({error:this.state.error,resetError:this.resetError}):r!==void 0?r:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(a,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(o,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}export{u as E};
@@ -1 +1 @@
1
- import"./constants-0nWmzfAq.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-BL6Np0uD.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
1
+ import"./constants-CS_UcM7e.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-DSUIffwE.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};