decocms 3.18.3 → 3.18.4

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 (230) hide show
  1. package/dist/client/assets/{AlertCircle-B-r3okdw.js → AlertCircle-DBLUz--u.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-tDPH0_4m.js → ArrowUpRight-l-GcKPYK.js} +1 -1
  3. package/dist/client/assets/{Check-BhYHl6b1.js → Check-BxIVbrMR.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CVL_FX-8.js → CheckCircle-rFqh1KDn.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CniGrT2-.js → ChevronDown-P5aorJ8-.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-kGfXoAV-.js → ChevronLeft-e8a25ahy.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-COCWmVlT.js → ChevronRight-WB5knV5A.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-DzsjrX2b.js → ChevronUp-nQBmktAW.js} +1 -1
  9. package/dist/client/assets/{Container-D1PVb_TW.js → Container-Dls_ClFq.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-_gNEu7zY.js → DotsVertical-CxHHcGx6.js} +1 -1
  11. package/dist/client/assets/{Eye-Cja82Q7U.js → Eye-EKPlnsLc.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Bel4K6qN.js → FilterLines-DqQIAzT9.js} +1 -1
  13. package/dist/client/assets/{Globe01-D39kUdoP.js → Globe01-Tm1ARX4Z.js} +1 -1
  14. package/dist/client/assets/{HardDrive-CgdcwvGL.js → HardDrive-JzeH-CyJ.js} +1 -1
  15. package/dist/client/assets/{Key01-DYyg_tnP.js → Key01-CeoBFgZd.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-CoO_xxXK.js → LayoutLeft-xp2y9xUi.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-DN-lMhNz.js → LinkExternal01-BrCQL34C.js} +1 -1
  18. package/dist/client/assets/{Monitor01-gHlWGw8m.js → Monitor01-DhIohKdB.js} +1 -1
  19. package/dist/client/assets/{Palette-D9uHHj9p.js → Palette-DcvO-xme.js} +1 -1
  20. package/dist/client/assets/{Play-RXfEurLC.js → Play-Cl-75oPS.js} +1 -1
  21. package/dist/client/assets/{Plus-7ete7Chf.js → Plus-DMk97-_x.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-BcEdc8yb.js → RefreshCcw01-BKQsxntF.js} +1 -1
  23. package/dist/client/assets/{SearchMd-CW4p_47C.js → SearchMd-D5J9uZcf.js} +1 -1
  24. package/dist/client/assets/{Settings02-BilcqWFp.js → Settings02-VViB9t6t.js} +1 -1
  25. package/dist/client/assets/{Shield01-CWDizliI.js → Shield01-D5gYDa2-.js} +1 -1
  26. package/dist/client/assets/{Star01-Bc8W2nUe.js → Star01--s8ZFg64.js} +1 -1
  27. package/dist/client/assets/{Stars01-H8xKRb3B.js → Stars01-BidgaxVI.js} +1 -1
  28. package/dist/client/assets/{Stars02-BG9BQfDN.js → Stars02-CIMeB8Tw.js} +1 -1
  29. package/dist/client/assets/{Sun-2czCa7nh.js → Sun-F5_OmHwF.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-X0-A3wlA.js → SwitchHorizontal01-BDAEnkfq.js} +1 -1
  31. package/dist/client/assets/{Tool01-C_efsdJ9.js → Tool01-BgJ0N26M.js} +1 -1
  32. package/dist/client/assets/{Trash01-D8gyPG4F.js → Trash01-C7l0NheK.js} +1 -1
  33. package/dist/client/assets/{Upload01-CeZYEoZ8.js → Upload01-BpTwEhwN.js} +1 -1
  34. package/dist/client/assets/{User01-CfhPWLkj.js → User01-61G-I9Nt.js} +1 -1
  35. package/dist/client/assets/{Users01-CwA0YZWL.js → Users01-DedWtozu.js} +1 -1
  36. package/dist/client/assets/{Users03-D_dEpKEB.js → Users03-DhyPNTfH.js} +1 -1
  37. package/dist/client/assets/{X-Dlvmz5Lj.js → X-gpy8SRoe.js} +1 -1
  38. package/dist/client/assets/{XCircle-Q3LP6RaJ.js → XCircle-B8hhQ7We.js} +1 -1
  39. package/dist/client/assets/{XClose-CMlIOxQg.js → XClose-BIl1LPyR.js} +1 -1
  40. package/dist/client/assets/{Zap-C5hsI9kw.js → Zap-DRW8v7hZ.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-OkNAvBeL.js → ZapSquare-DwVlJ80d.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-Btzzfq_K.js → ZoomOut-CTra4wHa.js} +1 -1
  43. package/dist/client/assets/{access-gate-Uv1zLF5Y.js → access-gate-uwoZnAgx.js} +1 -1
  44. package/dist/client/assets/{accordion-CoOSA6zg.js → accordion-B0fd1tnF.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-BH5ViPBB.js → add-section-modal-DiKHi0M1.js} +1 -1
  46. package/dist/client/assets/agent-capabilities-BjTqE21c.js +3 -0
  47. package/dist/client/assets/{agent-icon-BiKNgOeT.js → agent-icon-DZCJD2_a.js} +1 -1
  48. package/dist/client/assets/{agent-icons-Bt1m_ENb.js → agent-icons-jN-Zyl-6.js} +1 -1
  49. package/dist/client/assets/{agents-list-Bf5wbGTB.js → agents-list-B-auSMeU.js} +1 -1
  50. package/dist/client/assets/{ai-providers-DRIUaAzW.js → ai-providers-9z8nTePs.js} +1 -1
  51. package/dist/client/assets/{alert-BWTI9LY5.js → alert-CXw2R1J0.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-D1sXzFR6.js → alert-dialog-BEqZ9uGO.js} +1 -1
  53. package/dist/client/assets/app-editor-L6xg0gr0.js +1 -0
  54. package/dist/client/assets/{auth-catchall-p5-aZBW9.js → auth-catchall-Bfw73AGa.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-DUM0vTfJ.js → auth-split-layout-BReVBoRk.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-Cdl3j3R5.js → automation-list-row-DijFSvDw.js} +1 -1
  57. package/dist/client/assets/{automation-runs-DjKtm8sC.js → automation-runs-hCC2W9Z-.js} +1 -1
  58. package/dist/client/assets/{automations-DQdCdeIY.js → automations-CmCVzo7I.js} +1 -1
  59. package/dist/client/assets/{avatar-DcRL4WFc.js → avatar-Bcbs0fiL.js} +1 -1
  60. package/dist/client/assets/{badge-B2isb5t4.js → badge-BARx7FvE.js} +1 -1
  61. package/dist/client/assets/{brand-context-BlzqcU4f.js → brand-context-DdQzgdZa.js} +1 -1
  62. package/dist/client/assets/{buckets-CNaD-KsO.js → buckets-uoDmahjJ.js} +1 -1
  63. package/dist/client/assets/{calendar-DleQOR6C.js → calendar-B30GJXaY.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-BIabmgVZ.js → capability-load-error-ClqXQbgV.js} +1 -1
  65. package/dist/client/assets/{card-7rPQAdEb.js → card-opRPZv32.js} +1 -1
  66. package/dist/client/assets/{chat-context-BpOhQo4D.js → chat-context-BbbKc5EF.js} +1 -1
  67. package/dist/client/assets/{checkbox-DmtUHgAJ.js → checkbox-wlYL0b3G.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-C8MYWV1f.js → cli-auth-success-Bs1_vcy6.js} +1 -1
  69. package/dist/client/assets/{collection-detail-CClLQ75n.js → collection-detail-C2S9fIG-.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-CCzBk9Sy.js → collection-display-button-Cay-ZdpD.js} +1 -1
  71. package/dist/client/assets/{collection-search-CmhXzxiX.js → collection-search-C3Lp1ZRv.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-C0xQn6vd.js → collection-table-wrapper-BnCe5cyI.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CyAZqj58.js → collection-tabs-BoQd-dND.js} +1 -1
  74. package/dist/client/assets/{collections-D4J1DJ61.js → collections-BaDzxzwW.js} +1 -1
  75. package/dist/client/assets/{command-B-HknKNN.js → command-DWpPyJE7.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-wDkcQT-i.js → connect-desktop-dialog-Cy-b1jPM.js} +1 -1
  77. package/dist/client/assets/{connection-card-DiU6mNhU.js → connection-card-BI-CSazh.js} +1 -1
  78. package/dist/client/assets/{connection-detail-w_f-Stjx.js → connection-detail-OEPQ1Wwv.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-B5x3bKYp.js → connection-form-helpers-CbxXqT_u.js} +1 -1
  80. package/dist/client/assets/{connections-tTj2cPUZ.js → connections-XD7RqsTp.js} +1 -1
  81. package/dist/client/assets/{constants-DpuEAZHq.js → constants-Cee8XKoZ.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-CLAzhWPC.js → decopilot-sse-pool-DiOxs3f4.js} +1 -1
  83. package/dist/client/assets/{dialog-Co3xDPPR.js → dialog-CFcYm0YL.js} +1 -1
  84. package/dist/client/assets/{domain-settings-C-YGglFw.js → domain-settings-BeRCH_mn.js} +1 -1
  85. package/dist/client/assets/{drawer-B7pzzO8k.js → drawer-CG7DFuyM.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-cIyq0nsy.js → dropdown-menu-CKTrR8YS.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-2hRmXntY.js → dynamic-plugin-layout-7IcBH65R.js} +1 -1
  88. package/dist/client/assets/{empty-state-BVd0NO3b.js → empty-state-74R-YcQz.js} +1 -1
  89. package/dist/client/assets/{empty-state-BEKtdW4r.js → empty-state-D653N76e.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-CV_04Mqr.js → extract-connection-data-BpQPulqJ.js} +1 -1
  91. package/dist/client/assets/{features-MBg0vBXI.js → features-DC4Mx65d.js} +1 -1
  92. package/dist/client/assets/{file-explorer-DFh0G9AW.js → file-explorer-DI37WbgR.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-BUGLJdWu.js → file-type-icon-fKTDY3M7.js} +1 -1
  94. package/dist/client/assets/{files-DrFFkAhA.js → files-ermEyeeq.js} +1 -1
  95. package/dist/client/assets/{form-ngFqzDUs.js → form-BOkSmTHo.js} +1 -1
  96. package/dist/client/assets/{general-CjaqrNa3.js → general-CIbzkCUo.js} +1 -1
  97. package/dist/client/assets/{generate-id-B72e1YIz.js → generate-id-CvWg9hET.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-BYeMQGhG.js → github-repo-picker-qlUkWRPg.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-CBrvR3rT.js → header-tab-button-C4vmTyQ-.js} +1 -1
  100. package/dist/client/assets/{hover-card-HMEbmFNY.js → hover-card-BQqzA1_o.js} +1 -1
  101. package/dist/client/assets/{image-field-BxdtQ-6B.js → image-field-DKZ33h0l.js} +1 -1
  102. package/dist/client/assets/{index-Dx0tF1g4.js → index-6hdndQvf.js} +1 -1
  103. package/dist/client/assets/{index-CgH2OhoV.js → index-9yLZw74n.js} +1 -1
  104. package/dist/client/assets/{index-Bi91cUM-.js → index-B6UNbCvs.js} +1 -1
  105. package/dist/client/assets/{index-bE1s1gBY.js → index-BEJQhciB.js} +1 -1
  106. package/dist/client/assets/{index-CsEESfyT.js → index-BNRdhvYz.js} +1 -1
  107. package/dist/client/assets/{index-XIClfKQB.js → index-Bp-x4MAC.js} +1 -1
  108. package/dist/client/assets/{index-gacl_Tlu.js → index-BtYLUKbU.js} +4 -4
  109. package/dist/client/assets/{index-DSTr5vNX.js → index-BvVmJXZO.js} +1 -1
  110. package/dist/client/assets/{index-BHx2Zpbq.js → index-CcNaSzIS.js} +1 -1
  111. package/dist/client/assets/{index-B_bvlyHZ.js → index-CdECG0JX.js} +1 -1
  112. package/dist/client/assets/{index-CKvOOOxk.js → index-DAqM6n6y.js} +1 -1
  113. package/dist/client/assets/{index-CpmOG_Bg.js → index-DI_C2zjL.js} +3 -3
  114. package/dist/client/assets/{index-d6i1w1J2.js → index-DKAPjhpZ.js} +1 -1
  115. package/dist/client/assets/{index-DMh_yIhm.js → index-DcdwlrBS.js} +1 -1
  116. package/dist/client/assets/{index-NBs1GdqN.js → index-o8XwCFMV.js} +1 -1
  117. package/dist/client/assets/{index-redirect-8hjLwAwq.js → index-redirect-Db4r9v6-.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-BGllKZAR.js → infiniteQueryObserver-UtxmrGCk.js} +1 -1
  119. package/dist/client/assets/{input-CUu-drFE.js → input-D6XA36wX.js} +1 -1
  120. package/dist/client/assets/{integration-icon-D6q3hp18.js → integration-icon-CDYbzYpO.js} +1 -1
  121. package/dist/client/assets/{label-BxSv953n.js → label-DP3KsQ6l.js} +1 -1
  122. package/dist/client/assets/{layout-D9O0_n5-.js → layout-paBHZrq0.js} +1 -1
  123. package/dist/client/assets/{login-BtinjvRm.js → login-Dd5gU9xf.js} +1 -1
  124. package/dist/client/assets/{members-9bhWlLnl.js → members-DHkEbny2.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-B1H6hrQ7.js → monaco-editor-CqS2PrxS.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-CJK7nT7g.js → monitoring-stats-row-D1YkU8mA.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-12bTV2K3.js → oauth-callback-ai-provider-BXsbx5oM.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-hNERmzi5.js → oauth-callback-dhWNgkQO.js} +1 -1
  129. package/dist/client/assets/{onboarding-DjpXCG4b.js → onboarding-BeaJ_uSB.js} +1 -1
  130. package/dist/client/assets/{org-install-C84qwAhG.js → org-install-Cp2eVvRj.js} +1 -1
  131. package/dist/client/assets/{org-layout-C1IF22AV.js → org-layout-a0K80q4T.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-B-hCG8Uv.js → org-plugin-layout-BSiJYore.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-Cl71A8BB.js → page-seo-form-3l62DB_T.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-BKqm5eyl.js +1 -0
  135. package/dist/client/assets/{pair-DN3rU5fI.js → pair-d72l3oOt.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-osfTULg-.js → plugin-empty-state-DJKQIP1H.js} +1 -1
  137. package/dist/client/assets/{plugin-header-YyMZMpGs.js → plugin-header-wZ3SAPoW.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-BKOCCklg.js → plugin-layout-Bnm1d9fT.js} +1 -1
  139. package/dist/client/assets/{popover-CH95HqFo.js → popover-LMWhCL8q.js} +1 -1
  140. package/dist/client/assets/{post-editor-caWnstD2.js → post-editor-DYc1KPrG.js} +1 -1
  141. package/dist/client/assets/{primitives-CYYfaGAN.js → primitives-DKgG_RLP.js} +1 -1
  142. package/dist/client/assets/{profile-C9o-RNVI.js → profile-sY3vkifi.js} +1 -1
  143. package/dist/client/assets/project-app-view-DZbc50FT.js +1 -0
  144. package/dist/client/assets/record-editor-CQX_ONN9.js +1 -0
  145. package/dist/client/assets/registry-Z2xBxz0q.js +2 -0
  146. package/dist/client/assets/{registry-layout-TnzbGAE3.js → registry-layout-DICcLMZ-.js} +1 -1
  147. package/dist/client/assets/{require-capability-BIm35L6j.js → require-capability-BaEq85xc.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DxD0Fs_0.js → required-auth-layout-ctnrloiI.js} +1 -1
  149. package/dist/client/assets/{reset-password-BUxs2XXK.js → reset-password-QZaqz6_E.js} +1 -1
  150. package/dist/client/assets/{resizable-DELp11qo.js → resizable-Ctmig1x8.js} +1 -1
  151. package/dist/client/assets/{roles-CqFm6K9j.js → roles-l3bqeHe8.js} +1 -1
  152. package/dist/client/assets/{save-status-XWlbhoid.js → save-status-CCYbhtqv.js} +1 -1
  153. package/dist/client/assets/{schema-form-BnfXp9eD.js → schema-form-CYyNLLkP.js} +1 -1
  154. package/dist/client/assets/{scroll-area-B_wDwopu.js → scroll-area-ChLxDxAv.js} +1 -1
  155. package/dist/client/assets/{search-input-Dy32u4Yx.js → search-input-DlQucyGn.js} +1 -1
  156. package/dist/client/assets/{secrets-CwM9vgs8.js → secrets-DUz1PrMw.js} +1 -1
  157. package/dist/client/assets/{sections-editor-DOTPiLfV.js → sections-editor-CjgAxmAC.js} +1 -1
  158. package/dist/client/assets/{select-C1e50dcv.js → select-DiczE1GW.js} +1 -1
  159. package/dist/client/assets/{select-model-B7fxBb8r.js → select-model-BwFIV8qg.js} +1 -1
  160. package/dist/client/assets/{seo-editor-CywpjSiB.js → seo-editor-SK8O4TOZ.js} +1 -1
  161. package/dist/client/assets/{settings-layout-Dz5plwN0.js → settings-layout-B-mK5baR.js} +1 -1
  162. package/dist/client/assets/{settings-section-CrtDCHpp.js → settings-section-COvXOm16.js} +1 -1
  163. package/dist/client/assets/{sheet-lTSOvxho.js → sheet-B1_zl6Wy.js} +1 -1
  164. package/dist/client/assets/{shell-controls-BzKJJ-t7.js → shell-controls-F9PQTaJd.js} +1 -1
  165. package/dist/client/assets/{shell-layout-D0i8OAWU.js → shell-layout-CVo7gBu0.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-B_ai_Hb2.js → shell-route-loading-DlXSyVMe.js} +1 -1
  167. package/dist/client/assets/{sidebar-Cjaut6KM.js → sidebar-D_9iQq6y.js} +1 -1
  168. package/dist/client/assets/{skeleton-BVkQR9ek.js → skeleton-DvAAEHK-.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-CgNsuB5K.js → sortable.esm-BcW2lbKS.js} +1 -1
  170. package/dist/client/assets/{spinner-BAjOwgiW.js → spinner-CIGunEVj.js} +1 -1
  171. package/dist/client/assets/{sso-Co4mP4Ha.js → sso-BkO-JF6F.js} +1 -1
  172. package/dist/client/assets/{store-HVcQT0BU.js → store-BP-9ENq2.js} +1 -1
  173. package/dist/client/assets/store-registry-BTGA7RTa.js +2 -0
  174. package/dist/client/assets/{switch-B3N-67ht.js → switch-CvANR6OB.js} +1 -1
  175. package/dist/client/assets/{tab-id-QoM_GeD5.js → tab-id-Bjr6GpO9.js} +1 -1
  176. package/dist/client/assets/{table-CBD1Q3-l.js → table-6ZxoVDj9.js} +1 -1
  177. package/dist/client/assets/{tabs-DVFYJOQB.js → tabs-BXch7lF5.js} +1 -1
  178. package/dist/client/assets/{task-status-CG4f8Ssf.js → task-status-FrpiwVZ0.js} +1 -1
  179. package/dist/client/assets/{textarea-BBLzCLOA.js → textarea-CTP7aZSb.js} +1 -1
  180. package/dist/client/assets/{toggle-group-Bpw9J7_z.js → toggle-group-5ZT1fa--.js} +1 -1
  181. package/dist/client/assets/{toolbar-CspqzRI5.js → toolbar-Ct5Db6Po.js} +1 -1
  182. package/dist/client/assets/{tools-list-xaKK1ECj.js → tools-list-BlrRNNBe.js} +1 -1
  183. package/dist/client/assets/{tooltip-DW2J8RRA.js → tooltip-KdhQZ3ej.js} +1 -1
  184. package/dist/client/assets/{types-LM2jh-lQ.js → types-Dw4nSNDC.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-eErv1C43.js → use-ai-providers-D_ipcxZj.js} +1 -1
  186. package/dist/client/assets/{use-automations-HnokK13N.js → use-automations-ByYKrwPE.js} +1 -1
  187. package/dist/client/assets/{use-capability-FIcb8UxS.js → use-capability-DySoFAxN.js} +1 -1
  188. package/dist/client/assets/{use-collections-CqTjT3Mq.js → use-collections-XA0KebJY.js} +1 -1
  189. package/dist/client/assets/{use-connection-D6Cpeajq.js → use-connection-wp_lbmMU.js} +1 -1
  190. package/dist/client/assets/{use-copy-Cw1fcUIO.js → use-copy-BWvpIWuf.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-CJC57gOy.js → use-create-virtual-mcp-W4rKr9xF.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-CgMlJ6Br.js → use-debounced-autosave-DWajIZmJ.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-Bfeg-vSl.js → use-delete-connection-C7S2ugSQ.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-P699ZQaF.js → use-file-configs-C-sgICQR.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-DiT_tcXi.js → use-infinite-scroll-Bk8f-w0n.js} +1 -1
  196. package/dist/client/assets/{use-list-state-BNJ-tlPA.js → use-list-state-DCu2_qcV.js} +1 -1
  197. package/dist/client/assets/{use-mcp-prompts-2--n2jev.js → use-mcp-prompts-GwuiMx2k.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-BvO9OVFB.js → use-mcp-tools-BJM8Ch_b.js} +1 -1
  199. package/dist/client/assets/{use-members-B36Y5TQt.js → use-members-BFSN3QPN.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-dXmSFUhJ.js → use-navigate-to-agent-D_yYvurh.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-CAkVEUwL.js → use-org-auth-client-D8sE5x8D.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-ClqqHr-X.js → use-org-sso-CDLauwp2.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-GUTuXgpC.js → use-organization-roles-Cr7Rw0vS.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-0_8sPkX5.js → use-organization-settings-DZ2KDW5r.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-BYyCxXS_.js → use-registry-connections-CkLpetCN.js} +1 -1
  206. package/dist/client/assets/{use-secrets-WmW0rqmn.js → use-secrets-BCTkTNAt.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-DaqA5e9-.js → use-status-sounds-DuoYs6Rs.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-C3RTWiyQ.js → use-view-mode-DUw7PprD.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-Bpydv1NG.js → use-virtual-mcp-BE7Deo6L.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-DTZY836s.js +1 -0
  211. package/dist/client/assets/{useRouterState-DK-9Hx-j.js → useRouterState-nKULYO8g.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-BZcmZLll.js +1 -0
  213. package/dist/client/assets/{user-DgFB9DGX.js → user-DXVwfRLH.js} +1 -1
  214. package/dist/client/assets/{view-mode-toggle-DwClLpGQ.js → view-mode-toggle-GVqZ4OkD.js} +1 -1
  215. package/dist/client/assets/{workflow-Cfw5Ndhx.js → workflow-C6bXXXmh.js} +1 -1
  216. package/dist/client/assets/workflow-detail-B7TlrPBG.js +1 -0
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +480 -480
  219. package/dist/server/server.js +306 -306
  220. package/package.json +1 -1
  221. package/dist/client/assets/agent-capabilities-B5uA64tf.js +0 -3
  222. package/dist/client/assets/app-editor-BBElfEes.js +0 -1
  223. package/dist/client/assets/page-seo-sheet-BEHOuaNm.js +0 -1
  224. package/dist/client/assets/project-app-view-DAOiIs80.js +0 -1
  225. package/dist/client/assets/record-editor-BPzwKRSp.js +0 -1
  226. package/dist/client/assets/registry-_ZY4UYXD.js +0 -2
  227. package/dist/client/assets/store-registry-B0_EtqCG.js +0 -2
  228. package/dist/client/assets/useInfiniteQuery-8wlNRgz7.js +0 -1
  229. package/dist/client/assets/useSuspenseInfiniteQuery-Bg_jTe-C.js +0 -1
  230. package/dist/client/assets/workflow-detail-DDad04ZD.js +0 -1
@@ -1 +1 @@
1
- import{r as h}from"./index-CpmOG_Bg.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
1
+ import{r as h}from"./index-DI_C2zjL.js";var w=(o,i,l,s,c,t,m,d)=>{let r=document.documentElement,u=["light","dark"];function n(e){(Array.isArray(o)?o:[o]).forEach(a=>{let p=a==="class",S=p&&t?c.map(f=>t[f]||f):c;p?(r.classList.remove(...S),r.classList.add(t&&t[e]?t[e]:e)):r.setAttribute(a,e)}),y(e)}function y(e){d&&u.includes(e)&&(r.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)n(s);else try{let e=localStorage.getItem(i)||l,a=m&&e==="system"?g():e;n(a)}catch{}};h.createContext(void 0);h.memo(({forcedTheme:o,storageKey:i,attribute:l,enableSystem:s,enableColorScheme:c,defaultTheme:t,value:m,themes:d,nonce:r,scriptProps:u})=>{let n=JSON.stringify([l,i,t,o,d,m,s,c]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?r:"",dangerouslySetInnerHTML:{__html:`(${w.toString()})(${n})`}})});
@@ -1,4 +1,4 @@
1
- import{e3 as se,e as I,j as o,B as te,l as Yt,b5 as Ae,e4 as Gs,r as X,q as oe,c as $,g as Qs,G as Zt,e5 as Nt,e6 as es,o as Ys,v as Zs,e7 as en,e8 as tn}from"./index-CpmOG_Bg.js";import{D as sn,F as nn,B as on}from"./index-NBs1GdqN.js";import{h as De,i as rn,u as ae}from"./constants-DpuEAZHq.js";import{a as ts}from"./use-virtual-mcp-Bpydv1NG.js";import{M as Oe}from"./monaco-editor-B1H6hrQ7.js";import{b as ln,R as zt,a as cn}from"./resizable-DELp11qo.js";import{B as le}from"./badge-B2isb5t4.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-C1e50dcv.js";import{S as et}from"./spinner-BAjOwgiW.js";import{V as an}from"./view-mode-toggle-DwClLpGQ.js";import{ai as un,o as dn,i as fn,z as ss,aj as mn,a3 as pn,u as xn,ak as ns,a9 as hn,N as os,al as gn,am as bn,a5 as ft,an as jn}from"./agent-icon-BiKNgOeT.js";import{i as rs}from"./Play-RXfEurLC.js";import{b as Sn,a as yn,V as Ge}from"./layout-D9O0_n5-.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-DW2J8RRA.js";import{u as wn,a as vn}from"./use-connection-D6Cpeajq.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-BvO9OVFB.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-Co3xDPPR.js";import"./index-XIClfKQB.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-B_wDwopu.js";import{S as Fn}from"./index-B_bvlyHZ.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-HMEbmFNY.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-cIyq0nsy.js";import{s as Un}from"./Plus-7ete7Chf.js";import{b as ps}from"./Tool01-C_efsdJ9.js";import{i as Fe}from"./Check-BhYHl6b1.js";import{s as _t}from"./XClose-CMlIOxQg.js";import{I as Ct}from"./integration-icon-D6q3hp18.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-CoOSA6zg.js";import"./index-d6i1w1J2.js";import{i as xs}from"./X-Dlvmz5Lj.js";import{u as hs,a as Gn}from"./use-collections-CqTjT3Mq.js";import{E as gs}from"./empty-state-BVd0NO3b.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as Wt}from"./input-CUu-drFE.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
1
+ import{e3 as se,e as I,j as o,B as te,l as Yt,b5 as Ae,e4 as Gs,r as X,q as oe,c as $,g as Qs,G as Zt,e5 as Nt,e6 as es,o as Ys,v as Zs,e7 as en,e8 as tn}from"./index-DI_C2zjL.js";import{D as sn,F as nn,B as on}from"./index-o8XwCFMV.js";import{h as De,i as rn,u as ae}from"./constants-Cee8XKoZ.js";import{a as ts}from"./use-virtual-mcp-BE7Deo6L.js";import{M as Oe}from"./monaco-editor-CqS2PrxS.js";import{b as ln,R as zt,a as cn}from"./resizable-Ctmig1x8.js";import{B as le}from"./badge-BARx7FvE.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-DiczE1GW.js";import{S as et}from"./spinner-CIGunEVj.js";import{V as an}from"./view-mode-toggle-GVqZ4OkD.js";import{ai as un,o as dn,i as fn,z as ss,aj as mn,a3 as pn,u as xn,ak as ns,a9 as hn,N as os,al as gn,am as bn,a5 as ft,an as jn}from"./agent-icon-DZCJD2_a.js";import{i as rs}from"./Play-Cl-75oPS.js";import{b as Sn,a as yn,V as Ge}from"./layout-paBHZrq0.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-KdhQZ3ej.js";import{u as wn,a as vn}from"./use-connection-wp_lbmMU.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-BJM8Ch_b.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-CFcYm0YL.js";import"./index-Bp-x4MAC.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-ChLxDxAv.js";import{S as Fn}from"./index-CdECG0JX.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-BQqzA1_o.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-CKTrR8YS.js";import{s as Un}from"./Plus-DMk97-_x.js";import{b as ps}from"./Tool01-BgJ0N26M.js";import{i as Fe}from"./Check-BxIVbrMR.js";import{s as _t}from"./XClose-BIl1LPyR.js";import{I as Ct}from"./integration-icon-CDYbzYpO.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-B0fd1tnF.js";import"./index-DKAPjhpZ.js";import{i as xs}from"./X-gpy8SRoe.js";import{u as hs,a as Gn}from"./use-collections-XA0KebJY.js";import{E as gs}from"./empty-state-74R-YcQz.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as Wt}from"./input-D6XA36wX.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
2
  ${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
3
3
  `:""} ${u}${f}: ${n(d)};`}).join(`
4
4
  `)}
@@ -1,4 +1,4 @@
1
- import{dU as Fe,bV as Os,W as oe,U as ge,aK as ti,ct as _i,aH as Ie,bT as mt,bp as Ve,aI as mr,dV as rn,T as _e,dW as Ii,dX as ws,dY as ec,cr as tc,dZ as ia,d_ as nc,d$ as rc,e0 as ic,d8 as fn,d9 as Cr,da as xs,ch as sa,c9 as sc,ba as ze,cs as oc,aJ as On,bC as Ti,e1 as ac,r as N,j as w,e2 as oa,cX as lc}from"./index-CpmOG_Bg.js";import{d as cc,e as uc,n as fc,f as dc,C as hc,A as pc}from"./constants-DpuEAZHq.js";import{B as Ci,c as Pi}from"./collections-D4J1DJ61.js";import{R as Es}from"./index-XIClfKQB.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=Ve(n):typeof n=="number"?e.number=Ve(n):typeof n=="boolean"?e.boolean=Ve(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return Ve(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([Ve(n),Ve(r),...i.map(s=>Ve(s))])}return t==="boolean"?mt([Ve(!0),Ve(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Tc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Cc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Cn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Cn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Cn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Cn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},Vc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},qc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Cn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Cn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Tc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Cc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new Vc,new qc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Te,Et,kt,Qn,ur,wn,Vt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Te),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,Vt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Te)===this.CLOSED)return;he(this,Te,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,Vt,void 0),G(this,Te)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Te,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Te)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,Vt)&&clearTimeout(G(this,Vt)),G(this,Te)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Te,this.CLOSED),he(this,ct,void 0))}}Te=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,Vt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Te,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Te)!==this.CLOSED&&he(this,Te,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Te)===this.CLOSED)return;he(this,Te,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,Vt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Cr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Ts=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Cs=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Ts(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Ts(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Cs(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Cs(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
1
+ import{dU as Fe,bV as Os,W as oe,U as ge,aK as ti,ct as _i,aH as Ie,bT as mt,bp as Ve,aI as mr,dV as rn,T as _e,dW as Ii,dX as ws,dY as ec,cr as tc,dZ as ia,d_ as nc,d$ as rc,e0 as ic,d8 as fn,d9 as Cr,da as xs,ch as sa,c9 as sc,ba as ze,cs as oc,aJ as On,bC as Ti,e1 as ac,r as N,j as w,e2 as oa,cX as lc}from"./index-DI_C2zjL.js";import{d as cc,e as uc,n as fc,f as dc,C as hc,A as pc}from"./constants-Cee8XKoZ.js";import{B as Ci,c as Pi}from"./collections-BaDzxzwW.js";import{R as Es}from"./index-Bp-x4MAC.js";var mc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},yc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=Ve(n):typeof n=="number"?e.number=Ve(n):typeof n=="boolean"?e.boolean=Ve(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},gc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return Ve(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([Ve(n),Ve(r),...i.map(s=>Ve(s))])}return t==="boolean"?mt([Ve(!0),Ve(!1)]):!1}},bc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=ic();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Sc=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},vc=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},Oc=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},wc=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},xc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Ec=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Ac=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},_c=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},Ic=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},Tc=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Cc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Pc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Fc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof ec){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},jc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},$c=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},Dc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Nc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Rc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Cn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Cn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Cn(e[i],t[i]))}return!1}function Mc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Cn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Uc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},kc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Mc(),{message:"Array items must be unique"})}},Lc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Bc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Wc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},Vc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},qc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof nc||e instanceof rc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Hc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Cn(r,i)),{message:"Value must match one of the enum values"})}},Kc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Cn(r,n),{message:"Value must equal the const value"})}},Gc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},zc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},Yc=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},Jc=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},Zc=[new yc,new gc,new mc,new bc,new Sc,new Tc,new Dc,new vc,new Oc,new wc,new xc,new Ec,new Ac,new _c,new Ic,new jc,new Cc,new Pc,new Fc,new Nc,new Rc,new $c],Xc=[new zc,new Hc,new Kc,new Lc,new Bc,new Wc,new Vc,new qc,new Yc,new Uc,new kc,new Jc,new Gc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of Zc)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=tc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of Xc)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function Qc(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var aa=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||aa("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?aa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Te,Et,kt,Qn,ur,wn,Vt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Te),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,Vt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Te)===this.CLOSED)return;he(this,Te,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,Vt,void 0),G(this,Te)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,eu()));else throw new Error("Invalid URL")}catch{throw Qc("An invalid or illegal string was specified")}he(this,Lt,cc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Te,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Te)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,Vt)&&clearTimeout(G(this,Vt)),G(this,Te)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Te,this.CLOSED),he(this,ct,void 0))}}Te=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,Vt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Te,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Te)!==this.CLOSED&&he(this,Te,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Te)===this.CLOSED)return;he(this,Te,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,Vt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function eu(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class tu extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class nu{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=uc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=fc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new tu(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Cr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const ru="mcp";class iu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,ru),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class su extends dc{constructor(t,n){super(t,n)}send(t,n){const r=ou(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function ou(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class au extends hc{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},sc,n)}}const lu=async(e,t,n)=>{const r=cu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new au({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},cu=(e,t,n)=>{if(e.type==="Websocket")return new iu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new nu(new URL(e.url),s)}return new su(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Ts=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Cs=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function uu(e){const t=n=>"connection"in e?lu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Ts(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Ts(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Cs(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Cs(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>fu({connection:n}):global[t]}});function fu(e){return uu(e)}const du=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),hu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
2
2
  The stepInput is the resolved value of the references in the input field. Example:
3
3
  {
4
4
  "input": {
@@ -1 +1 @@
1
- import{e as c,g as p,j as s,l as u,N as a}from"./index-CpmOG_Bg.js";import{a as x}from"./use-capability-FIcb8UxS.js";import{C as j}from"./capability-load-error-BIabmgVZ.js";function v(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:g}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(g){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
1
+ import{e as c,g as p,j as s,l as u,N as a}from"./index-DI_C2zjL.js";import{a as x}from"./use-capability-DySoFAxN.js";import{C as j}from"./capability-load-error-ClqXQbgV.js";function v(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:g}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(g){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
@@ -1 +1 @@
1
- import{av as g,dC as d,dD as v}from"./index-CpmOG_Bg.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:u,isError:c,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",f=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
1
+ import{av as g,dC as d,dD as v}from"./index-DI_C2zjL.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:u,isError:c,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",f=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
@@ -1 +1 @@
1
- import{e as s,c as a,j as d}from"./index-CpmOG_Bg.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
1
+ import{e as s,c as a,j as d}from"./index-DI_C2zjL.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
@@ -1 +1 @@
1
- import{e as A,j as h,r as z,c as _}from"./index-CpmOG_Bg.js";import{n as L}from"./Container-D1PVb_TW.js";import{A as k}from"./agent-icon-BiKNgOeT.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
1
+ import{e as A,j as h,r as z,c as _}from"./index-DI_C2zjL.js";import{n as L}from"./Container-Dls_ClFq.js";import{A as k}from"./agent-icon-DZCJD2_a.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
@@ -1 +1 @@
1
- import{e as n,c as r,j as i,bw as p}from"./index-CpmOG_Bg.js";function c(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=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
1
+ import{e as n,c as r,j as i,bw as p}from"./index-DI_C2zjL.js";function c(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=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
@@ -1 +1 @@
1
- import{e as C,r as i,c as A,j as a,aU as V}from"./index-CpmOG_Bg.js";import{P as E}from"./index-CsEESfyT.js";const H=i.createContext(null);function q(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function D(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const z=D;function B(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=A(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{B as V,z as a,q as b};
1
+ import{e as C,r as i,c as A,j as a,aU as V}from"./index-DI_C2zjL.js";import{P as E}from"./index-BNRdhvYz.js";const H=i.createContext(null);function q(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function D(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const z=D;function B(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=A(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{B as V,z as a,q as b};
@@ -1 +1 @@
1
- import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-CpmOG_Bg.js";import{I}from"./input-CUu-drFE.js";import{A as de}from"./auth-split-layout-DUM0vTfJ.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
1
+ import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-DI_C2zjL.js";import{I}from"./input-D6XA36wX.js";import{A as de}from"./auth-split-layout-BReVBoRk.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
@@ -1,3 +1,3 @@
1
- import{W as $t,r as ce,q as fe,G as $e,b as Dt,H as kt,a as pe,t as ue,o as G,K as ie,j as s,B as _e,e as Y,s as Ft,n as Tt,c as ze,l as Xe,E as Lt}from"./index-CpmOG_Bg.js";import{C as Ot}from"./collection-display-button-CCzBk9Sy.js";import{S as qt}from"./search-input-Dy32u4Yx.js";import{P as Ee}from"./index-CsEESfyT.js";import{C as Bt}from"./collection-table-wrapper-C0xQn6vd.js";import{E as We}from"./empty-state-BEKtdW4r.js";import{D as Kt,i as Vt,a as Qt,b as Ut,c as Gt,d as Ht}from"./dialog-Co3xDPPR.js";import{a as Jt,F as rt,b as ct,c as Wt,d as mt,f as dt}from"./form-ngFqzDUs.js";import{d as et,S as tt,a as st,b as nt,c as it}from"./select-C1e50dcv.js";import{T as Yt}from"./textarea-BBLzCLOA.js";import{u as at}from"./use-org-auth-client-CAkVEUwL.js";import{u as It}from"./use-organization-roles-GUTuXgpC.js";import{u as Zt}from"./use-members-B36Y5TQt.js";import{S as De,u as ke}from"./constants-DpuEAZHq.js";import{T as Xt,a as es,c as ts,b as ss}from"./tooltip-DW2J8RRA.js";import{a as ut,e as ft,g as gt,b as ht,c as pt,d as xt,f as bt,A as jt}from"./alert-dialog-D1sXzFR6.js";import{A as Ve}from"./avatar-DcRL4WFc.js";import{B as Ue}from"./badge-B2isb5t4.js";import{C as vt}from"./card-7rPQAdEb.js";import{D as At,a as Mt,b as Et,e as ns,f as is,g as ls,c as lt,d as as}from"./dropdown-menu-cIyq0nsy.js";import{i as _t}from"./DotsVertical-_gNEu7zY.js";import{i as os}from"./Key01-DYyg_tnP.js";import{i as rs}from"./Shield01-CWDizliI.js";import{a as cs}from"./SwitchHorizontal01-X0-A3wlA.js";import{s as ms}from"./Trash01-D8gyPG4F.js";import{s as Pt}from"./XClose-CMlIOxQg.js";import{C as Ct}from"./checkbox-DmtUHgAJ.js";import{a as Ye,e as Ze,f as yt,C as ds,d as us,b as fs,c as gs}from"./command-B-HknKNN.js";import{b as hs,P as ps,a as xs}from"./popover-CH95HqFo.js";import{t as bs}from"./ChevronDown-CniGrT2-.js";import{s as js}from"./Plus-7ete7Chf.js";import{R as vs}from"./require-capability-BIm35L6j.js";import"./Check-BhYHl6b1.js";import"./view-mode-toggle-DwClLpGQ.js";import"./SearchMd-CW4p_47C.js";import"./sidebar-Cjaut6KM.js";import"./LayoutLeft-CoO_xxXK.js";import"./sheet-lTSOvxho.js";import"./X-Dlvmz5Lj.js";import"./table-CBD1Q3-l.js";import"./label-BxSv953n.js";import"./ChevronUp-DzsjrX2b.js";import"./User01-CfhPWLkj.js";import"./ChevronRight-COCWmVlT.js";import"./index-Bi91cUM-.js";import"./use-capability-FIcb8UxS.js";import"./access-gate-Uv1zLF5Y.js";import"./capability-load-error-BIabmgVZ.js";const Cs=$t().email("Invalid email address");function ys(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function Ss({trigger:t}){const[e,n]=ce.useState(!1),{locator:o}=fe(),r=at(),l=$e(),{data:i}=Dt.useSession(),a=i?.user?.email,{roles:m,isLoading:g}=It(),h=m.filter(d=>d.role!=="owner"),p=kt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),j=p.watch("emailsText"),I=p.watch("role"),v=ys(j).filter(d=>{const c=Cs.safeParse(d).success,x=!a||d!==a.toLowerCase();return c&&x}),N=pe({mutationFn:async({emails:d,role:c})=>{if(!c)throw new Error("Please select a role");const x=await Promise.allSettled(d.map(async w=>{const M=await r.organization.inviteMember({email:w,role:c});if(M.error)throw new Error(M.error.message);return M.data})),A=x.filter(w=>w.status==="rejected");if(A.length>0)throw new Error(`Failed to invite ${A.length} member${A.length>1?"s":""}`);return x},onSuccess:(d,{emails:c,role:x})=>{ue("member_invited",{count:c.length,role:x}),l.invalidateQueries({queryKey:ie.members(o)}),l.invalidateQueries({queryKey:ie.invitations(o)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(d,{emails:c,role:x})=>{ue("member_invite_failed",{count:c.length,role:x,error:d instanceof Error?d.message:String(d)}),G.error(d instanceof Error?d.message:"Failed to invite members")}}),y=d=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!d.role){G.error("Please select a role");return}N.mutate({emails:v,role:d.role})},$=v.length>0&&!!I;return s.jsxs(Kt,{open:e,onOpenChange:n,children:[s.jsx(Vt,{asChild:!0,children:t}),s.jsxs(Qt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Gt,{children:"Invite members"})}),s.jsx(Jt,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(rt,{control:p.control,name:"emailsText",render:({field:d})=>s.jsxs(ct,{children:[s.jsx(Wt,{children:"Email addresses"}),s.jsx(mt,{children:s.jsx(Yt,{...d,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
1
+ import{W as $t,r as ce,q as fe,G as $e,b as Dt,H as kt,a as pe,t as ue,o as G,K as ie,j as s,B as _e,e as Y,s as Ft,n as Tt,c as ze,l as Xe,E as Lt}from"./index-DI_C2zjL.js";import{C as Ot}from"./collection-display-button-Cay-ZdpD.js";import{S as qt}from"./search-input-DlQucyGn.js";import{P as Ee}from"./index-BNRdhvYz.js";import{C as Bt}from"./collection-table-wrapper-BnCe5cyI.js";import{E as We}from"./empty-state-D653N76e.js";import{D as Kt,i as Vt,a as Qt,b as Ut,c as Gt,d as Ht}from"./dialog-CFcYm0YL.js";import{a as Jt,F as rt,b as ct,c as Wt,d as mt,f as dt}from"./form-BOkSmTHo.js";import{d as et,S as tt,a as st,b as nt,c as it}from"./select-DiczE1GW.js";import{T as Yt}from"./textarea-CTP7aZSb.js";import{u as at}from"./use-org-auth-client-D8sE5x8D.js";import{u as It}from"./use-organization-roles-Cr7Rw0vS.js";import{u as Zt}from"./use-members-BFSN3QPN.js";import{S as De,u as ke}from"./constants-Cee8XKoZ.js";import{T as Xt,a as es,c as ts,b as ss}from"./tooltip-KdhQZ3ej.js";import{a as ut,e as ft,g as gt,b as ht,c as pt,d as xt,f as bt,A as jt}from"./alert-dialog-BEqZ9uGO.js";import{A as Ve}from"./avatar-Bcbs0fiL.js";import{B as Ue}from"./badge-BARx7FvE.js";import{C as vt}from"./card-opRPZv32.js";import{D as At,a as Mt,b as Et,e as ns,f as is,g as ls,c as lt,d as as}from"./dropdown-menu-CKTrR8YS.js";import{i as _t}from"./DotsVertical-CxHHcGx6.js";import{i as os}from"./Key01-CeoBFgZd.js";import{i as rs}from"./Shield01-D5gYDa2-.js";import{a as cs}from"./SwitchHorizontal01-BDAEnkfq.js";import{s as ms}from"./Trash01-C7l0NheK.js";import{s as Pt}from"./XClose-BIl1LPyR.js";import{C as Ct}from"./checkbox-wlYL0b3G.js";import{a as Ye,e as Ze,f as yt,C as ds,d as us,b as fs,c as gs}from"./command-DWpPyJE7.js";import{b as hs,P as ps,a as xs}from"./popover-LMWhCL8q.js";import{t as bs}from"./ChevronDown-P5aorJ8-.js";import{s as js}from"./Plus-DMk97-_x.js";import{R as vs}from"./require-capability-BaEq85xc.js";import"./Check-BxIVbrMR.js";import"./view-mode-toggle-GVqZ4OkD.js";import"./SearchMd-D5J9uZcf.js";import"./sidebar-D_9iQq6y.js";import"./LayoutLeft-xp2y9xUi.js";import"./sheet-B1_zl6Wy.js";import"./X-gpy8SRoe.js";import"./table-6ZxoVDj9.js";import"./label-DP3KsQ6l.js";import"./ChevronUp-nQBmktAW.js";import"./User01-61G-I9Nt.js";import"./ChevronRight-WB5knV5A.js";import"./index-B6UNbCvs.js";import"./use-capability-DySoFAxN.js";import"./access-gate-uwoZnAgx.js";import"./capability-load-error-ClqXQbgV.js";const Cs=$t().email("Invalid email address");function ys(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function Ss({trigger:t}){const[e,n]=ce.useState(!1),{locator:o}=fe(),r=at(),l=$e(),{data:i}=Dt.useSession(),a=i?.user?.email,{roles:m,isLoading:g}=It(),h=m.filter(d=>d.role!=="owner"),p=kt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),j=p.watch("emailsText"),I=p.watch("role"),v=ys(j).filter(d=>{const c=Cs.safeParse(d).success,x=!a||d!==a.toLowerCase();return c&&x}),N=pe({mutationFn:async({emails:d,role:c})=>{if(!c)throw new Error("Please select a role");const x=await Promise.allSettled(d.map(async w=>{const M=await r.organization.inviteMember({email:w,role:c});if(M.error)throw new Error(M.error.message);return M.data})),A=x.filter(w=>w.status==="rejected");if(A.length>0)throw new Error(`Failed to invite ${A.length} member${A.length>1?"s":""}`);return x},onSuccess:(d,{emails:c,role:x})=>{ue("member_invited",{count:c.length,role:x}),l.invalidateQueries({queryKey:ie.members(o)}),l.invalidateQueries({queryKey:ie.invitations(o)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(d,{emails:c,role:x})=>{ue("member_invite_failed",{count:c.length,role:x,error:d instanceof Error?d.message:String(d)}),G.error(d instanceof Error?d.message:"Failed to invite members")}}),y=d=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!d.role){G.error("Please select a role");return}N.mutate({emails:v,role:d.role})},$=v.length>0&&!!I;return s.jsxs(Kt,{open:e,onOpenChange:n,children:[s.jsx(Vt,{asChild:!0,children:t}),s.jsxs(Qt,{className:"sm:max-w-lg",children:[s.jsx(Ut,{children:s.jsx(Gt,{children:"Invite members"})}),s.jsx(Jt,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(rt,{control:p.control,name:"emailsText",render:({field:d})=>s.jsxs(ct,{children:[s.jsx(Wt,{children:"Email addresses"}),s.jsx(mt,{children:s.jsx(Yt,{...d,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
2
2
  e.g. user1@example.com, user2@example.com
3
3
  or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(dt,{})]})}),s.jsx(rt,{control:p.control,name:"role",render:({field:d})=>s.jsxs(ct,{children:[s.jsx(mt,{children:s.jsxs(et,{value:d.value,onValueChange:d.onChange,disabled:N.isPending||g,children:[s.jsx(tt,{className:"w-full",children:s.jsx(st,{placeholder:"Select a role"})}),s.jsx(nt,{children:h.map(c=>{const x=[];return c.isBuiltin||(c.allowsAllStaticPermissions?x.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&x.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?x.push("All connections"):c.connectionCount&&c.connectionCount>0&&x.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?x.push("all tools"):c.toolCount&&c.toolCount>0&&x.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsx(it,{value:c.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&x.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:x.join(", ")})]})},c.role)})})]})}),s.jsx(dt,{})]})}),s.jsxs(Ht,{children:[s.jsx(_e,{variant:"outline",onClick:()=>{p.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:N.isPending,children:"Cancel"}),s.jsx(_e,{type:"submit",disabled:N.isPending||!$,children:N.isPending?"Inviting...":`Invite ${v.length||0} Member${v.length!==1?"s":""}`})]})]})})]})]})}function ws(){const t=Y.c(10),{org:e,locator:n}=fe();let o;t[0]!==e.id||t[1]!==e.slug?(o={connectionId:De,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=o):o=t[2];const r=ke(o);let l;t[3]!==n?(l=ie.invitations(n),t[3]=n,t[4]=l):l=t[4];let i;t[5]!==r?(i=async()=>{const m=await r.callTool({name:"ORGANIZATION_GET",arguments:{}});return(m.structuredContent??m)?.invitations??[]},t[5]=r,t[6]=i):i=t[6];let a;return t[7]!==l||t[8]!==i?(a={queryKey:l,queryFn:i},t[7]=l,t[8]=i,t[9]=a):a=t[9],Ft(a)}function Ns(){const t=Y.c(10),{locator:e}=fe(),n=at(),o=$e();let r;t[0]!==n?(r=async g=>{const h=await n.organization.cancelInvitation({invitationId:g});if(h?.error)throw new Error(h.error.message);return h.data},t[0]=n,t[1]=r):r=t[1];let l;t[2]!==e||t[3]!==o?(l=()=>{o.invalidateQueries({queryKey:ie.invitations(e)}),G.success("Invitation cancelled")},t[2]=e,t[3]=o,t[4]=l):l=t[4];let i;t[5]!==r||t[6]!==l?(i={mutationFn:r,onSuccess:l,onError:Ts},t[5]=r,t[6]=l,t[7]=i):i=t[7];const a=pe(i);let m;return t[8]!==a?(m={cancel:a},t[8]=a,t[9]=m):m=t[9],m}function Ts(t){G.error(t instanceof Error?t.message:"Failed to cancel invitation")}function Is(){const t=Y.c(10),{org:e,locator:n}=fe();let o;t[0]!==e.id||t[1]!==e.slug?(o={connectionId:De,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=o):o=t[2];const r=ke(o);let l;t[3]!==n?(l=ie.tags(n),t[3]=n,t[4]=l):l=t[4];let i;t[5]!==r?(i=async()=>{const m=await r.callTool({name:"TAGS_LIST",arguments:{}});return(m.structuredContent??m).tags},t[5]=r,t[6]=i):i=t[6];let a;return t[7]!==l||t[8]!==i?(a={queryKey:l,queryFn:i,staleTime:3e4},t[7]=l,t[8]=i,t[9]=a):a=t[9],Tt(a)}function As(){const t=Y.c(11),e=$e(),{org:n,locator:o}=fe();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:De,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const l=ke(r);let i;t[3]!==l?(i=async g=>{const h=await l.callTool({name:"TAGS_CREATE",arguments:{name:g}});return(h.structuredContent??h).tag},t[3]=l,t[4]=i):i=t[4];let a;t[5]!==o||t[6]!==e?(a=()=>{e.invalidateQueries({queryKey:ie.tags(o)})},t[5]=o,t[6]=e,t[7]=a):a=t[7];let m;return t[8]!==i||t[9]!==a?(m={mutationFn:i,onSuccess:a,onError:Ms},t[8]=i,t[9]=a,t[10]=m):m=t[10],pe(m)}function Ms(t){G.error(t instanceof Error?t.message:"Failed to create tag")}function Es(t){const e=Y.c(13),{org:n,locator:o}=fe();let r;e[0]!==n.id||e[1]!==n.slug?(r={connectionId:De,orgId:n.id,orgSlug:n.slug},e[0]=n.id,e[1]=n.slug,e[2]=r):r=e[2];const l=ke(r);let i;e[3]!==o||e[4]!==t?(i=ie.memberTags(o,t),e[3]=o,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==l||e[7]!==t?(a=async()=>{const h=await l.callTool({name:"MEMBER_TAGS_GET",arguments:{memberId:t}});return(h.structuredContent??h).tags},e[6]=l,e[7]=t,e[8]=a):a=e[8];const m=!!t;let g;return e[9]!==i||e[10]!==a||e[11]!==m?(g={queryKey:i,queryFn:a,staleTime:3e4,enabled:m},e[9]=i,e[10]=a,e[11]=m,e[12]=g):g=e[12],Tt(g)}function _s(){const t=Y.c(11),e=$e(),{org:n,locator:o}=fe();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:De,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const l=ke(r);let i;t[3]!==l?(i=async g=>{const{memberId:h,tagIds:p}=g,j=await l.callTool({name:"MEMBER_TAGS_SET",arguments:{memberId:h,tagIds:p}});return j.structuredContent??j},t[3]=l,t[4]=i):i=t[4];let a;t[5]!==o||t[6]!==e?(a=(g,h)=>{e.invalidateQueries({queryKey:ie.memberTags(o,h.memberId)})},t[5]=o,t[6]=e,t[7]=a):a=t[7];let m;return t[8]!==i||t[9]!==a?(m={mutationFn:i,onSuccess:a,onError:Ps},t[8]=i,t[9]=a,t[10]=m):m=t[10],pe(m)}function Ps(t){G.error(t instanceof Error?t.message:"Failed to update member tags")}function Rt(t){const e=Y.c(44),{memberId:n,className:o,disabled:r,placeholder:l,maxDisplay:i}=t,a=r===void 0?!1:r,m=l===void 0?"Add tags...":l,g=i===void 0?2:i,[h,p]=ce.useState(!1),[j,I]=ce.useState(""),{data:R,isLoading:v}=Is(),N=R===void 0?[]:R,{data:y,isLoading:$}=Es(n),d=y===void 0?[]:y,c=As(),x=_s(),A=v||$,w=d.map(zs);let M;e[0]!==j?(M=S=>S.name.toLowerCase().includes(j.toLowerCase()),e[0]=j,e[1]=M):M=e[1];const z=N.filter(M);let T;e[2]!==j?(T=S=>S.name.toLowerCase()===j.toLowerCase(),e[2]=j,e[3]=T):T=e[3];const K=N.find(T),E=j.trim()&&!K,k=async S=>{const he=w.includes(S.id)?w.filter(je=>je!==S.id):[...w,S.id];await x.mutateAsync({memberId:n,tagIds:he})},_=async()=>{if(!j.trim())return;const S=await c.mutateAsync(j.trim());await x.mutateAsync({memberId:n,tagIds:[...w,S.id]}),I("")},u=async S=>{const ne=w.filter(he=>he!==S);await x.mutateAsync({memberId:n,tagIds:ne})},C=c.isPending||x.isPending,O=ps;let D;e[4]!==h?(D=()=>p(!h),e[4]=h,e[5]=D):D=e[5];let F;e[6]!==o?(F=ze("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",o),e[6]=o,e[7]=F):F=e[7];const V=a||A,L=A?s.jsx(Xe,{size:14,className:"animate-spin text-muted-foreground"}):d.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[d.slice(0,g).map(Rs),d.length>g&&s.jsxs(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",d.length-g]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:m});let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(bs,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=Q):Q=e[8];let q;e[9]!==V||e[10]!==L||e[11]!==D||e[12]!==F?(q=s.jsx(xs,{asChild:!0,children:s.jsxs(_e,{variant:"ghost",size:"sm",onClick:D,className:F,disabled:V,children:[L,Q]})}),e[9]=V,e[10]=L,e[11]=D,e[12]=F,e[13]=q):q=e[13];const U=hs,H="w-56 p-0",J="start";let W;e[14]===Symbol.for("react.memo_cache_sentinel")?(W=()=>p(!1),e[14]=W):W=e[14];const le=fs,xe=!1;let Z;e[15]!==j?(Z=s.jsx(gs,{placeholder:"Search or create...",value:j,onValueChange:I,className:"h-9"}),e[15]=j,e[16]=Z):Z=e[16];const ae=us,me=d.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{heading:"Selected",children:d.map(S=>s.jsx(Ze,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]}),s.jsx("button",{onClick:ne=>{ne.stopPropagation(),u(S.id)},className:"opacity-50 hover:opacity-100",disabled:C,children:s.jsx(Pt,{size:14})})]})},S.id))}),s.jsx(yt,{})]}),Pe=Ye,be="Available",Re=z.length===0&&!E&&s.jsx(ds,{children:"No tags found."}),ge=z.filter(S=>!w.includes(S.id)).map(S=>s.jsx(Ze,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ct,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]})},S.id));let oe;e[17]!==Pe||e[18]!==Re||e[19]!==ge?(oe=s.jsxs(Pe,{heading:be,children:[Re,ge]}),e[17]=Pe,e[18]=Re,e[19]=ge,e[20]=oe):oe=e[20];let re;e[21]!==_||e[22]!==C||e[23]!==j||e[24]!==E?(re=E&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{}),s.jsx(Ye,{children:s.jsx(Ze,{onSelect:_,className:"cursor-pointer",disabled:C,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[C?s.jsx(Xe,{size:14,className:"animate-spin"}):s.jsx(js,{size:14}),s.jsxs("span",{children:['Create "',j.trim(),'"']})]})})})]}),e[21]=_,e[22]=C,e[23]=j,e[24]=E,e[25]=re):re=e[25];let X;e[26]!==ae||e[27]!==me||e[28]!==oe||e[29]!==re?(X=s.jsxs(ae,{children:[me,oe,re]}),e[26]=ae,e[27]=me,e[28]=oe,e[29]=re,e[30]=X):X=e[30];let ee;e[31]!==le||e[32]!==Z||e[33]!==X?(ee=s.jsxs(le,{shouldFilter:xe,children:[Z,X]}),e[31]=le,e[32]=Z,e[33]=X,e[34]=ee):ee=e[34];let te;e[35]!==U||e[36]!==W||e[37]!==ee?(te=s.jsx(U,{className:H,align:J,onEscapeKeyDown:W,children:ee}),e[35]=U,e[36]=W,e[37]=ee,e[38]=te):te=e[38];let se;return e[39]!==O||e[40]!==h||e[41]!==q||e[42]!==te?(se=s.jsxs(O,{open:h,onOpenChange:p,children:[q,te]}),e[39]=O,e[40]=h,e[41]=q,e[42]=te,e[43]=se):se=e[43],se}function Rs(t){return s.jsx(Ue,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function zs(t){return t.id}const St=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],$s={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Qe(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Ds(t){const e=new Map;for(const[n,o]of Object.entries($s))e.set(n,o);for(let n=0;n<t.length;n++){const o=t[n];o&&!e.has(o.role)&&e.set(o.role,St[n%St.length]??"bg-neutral-400")}return e}function ks(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Ke(t){const e=Y.c(79),{role:n,memberId:o,isOwner:r,roleColorMap:l,selectableRoles:i,onRoleChange:a,size:m,className:g}=t,h=m===void 0?"xs":m;let p,j,I,R,v,N,y,$,d,c,x;if(e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==a||e[4]!==n||e[5]!==l||e[6]!==i||e[7]!==h){x=Symbol.for("react.early_return_sentinel");e:{const _=l.get(n)??"bg-neutral-400";if(r){let u;e[19]!==o||e[20]!==a?(u=H=>a(o,H),e[19]=o,e[20]=a,e[21]=u):u=e[21];let C;e[22]!==n?(C=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=C):C=e[23];const O=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:ze("size-2 rounded-full shrink-0",_)}),C]});let D;e[24]!==O?(D=s.jsx(st,{children:O}),e[24]=O,e[25]=D):D=e[25];let F;e[26]!==g||e[27]!==h||e[28]!==D?(F=s.jsx(tt,{size:h,className:g,children:D}),e[26]=g,e[27]=h,e[28]=D,e[29]=F):F=e[29];let V;if(e[30]!==l||e[31]!==i){let H;e[33]!==l?(H=J=>{const W=l.get(J.role)??"bg-neutral-400";return s.jsx(it,{value:J.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ze("size-3 rounded-full",W)}),s.jsx("span",{className:"capitalize",children:J.label})]})},J.role)},e[33]=l,e[34]=H):H=e[34],V=i.map(H),e[30]=l,e[31]=i,e[32]=V}else V=e[32];let L;e[35]!==V?(L=s.jsx(nt,{children:V}),e[35]=V,e[36]=L):L=e[36];let Q;e[37]!==r||e[38]!==n||e[39]!==u||e[40]!==F||e[41]!==L?(Q=s.jsx(Xt,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(et,{value:n,onValueChange:u,disabled:r,children:[F,L]})})}),e[37]=r,e[38]=n,e[39]=u,e[40]=F,e[41]=L,e[42]=Q):Q=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(es,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=q):q=e[43];let U;e[44]!==Q?(U=s.jsx(ts,{children:s.jsxs(ss,{children:[Q,q]})}),e[44]=Q,e[45]=U):U=e[45],x=U;break e}I=et,$=n,e[46]!==o||e[47]!==a?(d=u=>a(o,u),e[46]=o,e[47]=a,e[48]=d):d=e[48],c=r,j=tt,N=h,y=g,p=st,v="flex items-center gap-2 min-w-0",R=ze("size-2 rounded-full shrink-0",_)}e[0]=g,e[1]=r,e[2]=o,e[3]=a,e[4]=n,e[5]=l,e[6]=i,e[7]=h,e[8]=p,e[9]=j,e[10]=I,e[11]=R,e[12]=v,e[13]=N,e[14]=y,e[15]=$,e[16]=d,e[17]=c,e[18]=x}else p=e[8],j=e[9],I=e[10],R=e[11],v=e[12],N=e[13],y=e[14],$=e[15],d=e[16],c=e[17],x=e[18];if(x!==Symbol.for("react.early_return_sentinel"))return x;let A;e[49]!==R?(A=s.jsx("div",{className:R}),e[49]=R,e[50]=A):A=e[50];let w;e[51]!==n?(w=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let M;e[53]!==A||e[54]!==w||e[55]!==v?(M=s.jsxs("div",{className:v,children:[A,w]}),e[53]=A,e[54]=w,e[55]=v,e[56]=M):M=e[56];let z;e[57]!==p||e[58]!==M?(z=s.jsx(p,{children:M}),e[57]=p,e[58]=M,e[59]=z):z=e[59];let T;e[60]!==j||e[61]!==z||e[62]!==N||e[63]!==y?(T=s.jsx(j,{size:N,className:y,children:z}),e[60]=j,e[61]=z,e[62]=N,e[63]=y,e[64]=T):T=e[64];let K;if(e[65]!==l||e[66]!==i){let _;e[68]!==l?(_=u=>{const C=l.get(u.role)??"bg-neutral-400";return s.jsx(it,{value:u.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ze("size-3 rounded-full",C)}),s.jsx("span",{className:"capitalize",children:u.label})]})},u.role)},e[68]=l,e[69]=_):_=e[69],K=i.map(_),e[65]=l,e[66]=i,e[67]=K}else K=e[67];let E;e[70]!==K?(E=s.jsx(nt,{children:K}),e[70]=K,e[71]=E):E=e[71];let k;return e[72]!==I||e[73]!==T||e[74]!==E||e[75]!==$||e[76]!==d||e[77]!==c?(k=s.jsxs(I,{value:$,onValueChange:d,disabled:c,children:[T,E]}),e[72]=I,e[73]=T,e[74]=E,e[75]=$,e[76]=d,e[77]=c,e[78]=k):k=e[78],k}function wt(t){const e=Y.c(51),{member:n,roles:o,onChangeRole:r,onRemove:l,isUpdating:i}=t,a=i===void 0?!1:i,m=n.role==="owner";let g,h,p,j,I,R,v,N,y;if(e[0]!==m||e[1]!==a||e[2]!==n.id||e[3]!==n.role||e[4]!==r||e[5]!==o){let T;e[15]!==n.role?(T=u=>u.role!==n.role&&u.role!=="owner",e[15]=n.role,e[16]=T):T=e[16];const K=o.filter(T);j=At;let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(_t,{size:20}),e[17]=E):E=e[17],e[18]!==m?(y=s.jsx(Mt,{asChild:!0,children:s.jsx(_e,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:m,onClick:Ls,children:E})}),e[18]=m,e[19]=y):y=e[19],p=Et,v="end",N=Fs,h=ns;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(cs,{size:16}),e[20]=k):k=e[20],e[21]!==a?(R=s.jsxs(is,{disabled:a,children:[k,"Change Role"]}),e[21]=a,e[22]=R):R=e[22],g=ls;let _;e[23]!==a||e[24]!==n.id||e[25]!==r?(_=u=>{const C=[];return u.isBuiltin||(u.allowsAllStaticPermissions?C.push("Full org access"):u.staticPermissionCount&&u.staticPermissionCount>0&&C.push(`${u.staticPermissionCount} org perm${u.staticPermissionCount!==1?"s":""}`),u.allowsAllConnections?C.push("All connections"):u.connectionCount&&u.connectionCount>0&&C.push(`${u.connectionCount} connection${u.connectionCount!==1?"s":""}`),(u.connectionCount!==0||u.allowsAllConnections)&&(u.allowsAllTools?C.push("all tools"):u.toolCount&&u.toolCount>0&&C.push(`${u.toolCount} tool${u.toolCount!==1?"s":""}`))),s.jsxs(lt,{onClick:O=>{O.stopPropagation(),r(n.id,u.role)},disabled:a,children:[u.isBuiltin?s.jsx(rs,{size:16}):s.jsx(os,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:u.label}),!u.isBuiltin&&C.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:C.join(", ")})]})]},u.role)},e[23]=a,e[24]=n.id,e[25]=r,e[26]=_):_=e[26],I=K.map(_),e[0]=m,e[1]=a,e[2]=n.id,e[3]=n.role,e[4]=r,e[5]=o,e[6]=g,e[7]=h,e[8]=p,e[9]=j,e[10]=I,e[11]=R,e[12]=v,e[13]=N,e[14]=y}else g=e[6],h=e[7],p=e[8],j=e[9],I=e[10],R=e[11],v=e[12],N=e[13],y=e[14];let $;e[27]!==g||e[28]!==I?($=s.jsx(g,{children:I}),e[27]=g,e[28]=I,e[29]=$):$=e[29];let d;e[30]!==h||e[31]!==R||e[32]!==$?(d=s.jsxs(h,{children:[R,$]}),e[30]=h,e[31]=R,e[32]=$,e[33]=d):d=e[33];let c;e[34]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(as,{}),e[34]=c):c=e[34];let x;e[35]!==n.id||e[36]!==l?(x=T=>{T.stopPropagation(),l(n.id)},e[35]=n.id,e[36]=l,e[37]=x):x=e[37];let A;e[38]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ms,{size:16}),e[38]=A):A=e[38];let w;e[39]!==x?(w=s.jsxs(lt,{variant:"destructive",onClick:x,children:[A,"Remove Member"]}),e[39]=x,e[40]=w):w=e[40];let M;e[41]!==p||e[42]!==w||e[43]!==v||e[44]!==N||e[45]!==d?(M=s.jsxs(p,{align:v,onClick:N,children:[d,c,w]}),e[41]=p,e[42]=w,e[43]=v,e[44]=N,e[45]=d,e[46]=M):M=e[46];let z;return e[47]!==j||e[48]!==M||e[49]!==y?(z=s.jsxs(j,{children:[y,M]}),e[47]=j,e[48]=M,e[49]=y,e[50]=z):z=e[50],z}function Fs(t){return t.stopPropagation()}function Ls(t){return t.stopPropagation()}function Nt(t){const e=Y.c(8),{invitationId:n,onCancel:o,isCancelling:r}=t,l=r===void 0?!1:r;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Mt,{asChild:!0,children:s.jsx(_e,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qs,children:s.jsx(_t,{size:20})})}),e[0]=i):i=e[0];let a;e[1]!==n||e[2]!==o?(a=h=>{h.stopPropagation(),o(n)},e[1]=n,e[2]=o,e[3]=a):a=e[3];let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Pt,{size:16}),e[4]=m):m=e[4];let g;return e[5]!==l||e[6]!==a?(g=s.jsxs(At,{children:[i,s.jsx(Et,{align:"end",onClick:Os,children:s.jsxs(lt,{variant:"destructive",onClick:a,disabled:l,children:[m,"Cancel Invitation"]})})]}),e[5]=l,e[6]=a,e[7]=g):g=e[7],g}function Os(t){return t.stopPropagation()}function qs(t){return t.stopPropagation()}function Bs(){const t=Y.c(101),{data:e}=Zt(),{data:n}=ws(),o=Ns(),r=$e(),{locator:l}=fe(),i=at(),[a,m]=ce.useState(null),[g,h]=ce.useState(null),[p,j]=ce.useState(""),[I,R]=ce.useState("table"),[v,N]=ce.useState("member"),[y,$]=ce.useState("asc"),d=e?.data?.members;let c;t[0]!==v?(c=f=>{v===f?$(Xs):(N(f),$("asc"))},t[0]=v,t[1]=c):c=t[1];const x=c;let A=d??[],w=n??[];if(p){const f=p.toLowerCase();A=A.filter(b=>b.user?.name?.toLowerCase().includes(f)||b.user?.email?.toLowerCase().includes(f)||b.role?.toLowerCase().includes(f)),w=w.filter(b=>b.email?.toLowerCase().includes(f)||b.role?.toLowerCase().includes(f))}if(v&&y){let f;t[2]!==y||t[3]!==v?(f=(b,P)=>{let B,de;e:switch(v){case"member":{B=b.user?.name||"",de=P.user?.name||"";break e}case"role":{B=b.role||"",de=P.role||"";break e}case"joined":{B=b.createdAt?typeof b.createdAt=="string"?b.createdAt:b.createdAt.toISOString():"",de=P.createdAt?typeof P.createdAt=="string"?P.createdAt:P.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=y,t[3]=v,t[4]=f):f=t[4],A=[...A].sort(f)}const M=A;let z;t[5]!==i?(z=async f=>{const b=await i.organization.removeMember({memberIdOrEmail:f});if(b?.error)throw new Error(b.error.message)},t[5]=i,t[6]=z):z=t[6];let T;t[7]!==l||t[8]!==r?(T=()=>{ue("member_removed"),r.invalidateQueries({queryKey:ie.members(l)}),G.success("Member has been removed from the organization"),m(null)},t[7]=l,t[8]=r,t[9]=T):T=t[9];let K;t[10]!==z||t[11]!==T?(K={mutationFn:z,onSuccess:T,onError:Zs},t[10]=z,t[11]=T,t[12]=K):K=t[12];const E=pe(K);let k;t[13]!==i?(k=async f=>{const{memberId:b,role:P}=f,B=await i.organization.updateMemberRole({memberId:b,role:[P]});if(B?.error)throw new Error(B.error.message)},t[13]=i,t[14]=k):k=t[14];let _;t[15]!==l||t[16]!==r?(_=(f,b)=>{ue("member_role_updated",{new_role:b.role}),r.invalidateQueries({queryKey:ie.members(l)}),G.success("Member's role has been updated")},t[15]=l,t[16]=r,t[17]=_):_=t[17];let u;t[18]!==k||t[19]!==_?(u={mutationFn:k,onSuccess:_,onError:Ys},t[18]=k,t[19]=_,t[20]=u):u=t[20];const C=pe(u);let O;t[21]!==i?(O=async f=>{const{invitationId:b,role:P,email:B}=f,de=await i.organization.cancelInvitation({invitationId:b});if(de?.error)throw new Error(de.error.message);const ot=await i.organization.inviteMember({email:B,role:P});if(ot?.error)throw new Error(ot.error.message)},t[21]=i,t[22]=O):O=t[22];let D;t[23]!==l||t[24]!==r?(D=(f,b)=>{ue("invitation_role_updated",{new_role:b.role}),r.invalidateQueries({queryKey:ie.invitations(l)}),G.success("Invitation role has been updated")},t[23]=l,t[24]=r,t[25]=D):D=t[25];let F;t[26]!==O||t[27]!==D?(F={mutationFn:O,onSuccess:D,onError:Ws},t[26]=O,t[27]=D,t[28]=F):F=t[28];const V=pe(F),{roles:L,customRoles:Q}=It();let q;t[29]!==Q?(q=Ds(Q),t[29]=Q,t[30]=q):q=t[30];const U=q;let H;t[31]!==L?(H=L.filter(Js),t[31]=L,t[32]=H):H=t[32];const J=H;let W;t[33]===Symbol.for("react.memo_cache_sentinel")?(W={id:"member",header:"Member",render:Hs,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=W):W=t[33];let le;t[34]!==U||t[35]!==J||t[36]!==V||t[37]!==C?(le={id:"role",header:"Role",render:f=>f.type==="member"?s.jsx(Ke,{role:f.data.role,memberId:f.data.id,isOwner:f.data.role==="owner",roleColorMap:U,selectableRoles:J,onRoleChange:(b,P)=>C.mutate({memberId:b,role:P}),className:"w-36"}):s.jsx(Ke,{role:f.data.role,memberId:f.data.id,isOwner:!1,roleColorMap:U,selectableRoles:J,onRoleChange:(b,P)=>V.mutate({invitationId:b,role:P,email:f.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=U,t[35]=J,t[36]=V,t[37]=C,t[38]=le):le=t[38];let xe,Z;t[39]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"tags",header:"Tags",render:Gs,cellClassName:"w-40 shrink-0"},Z={id:"joined",header:"Joined",render:Us,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=xe,t[40]=Z):(xe=t[39],Z=t[40]);let ae;t[41]!==o.cancel.isPending||t[42]!==L||t[43]!==C?(ae={id:"actions",header:"",render:f=>f.type==="member"?s.jsx(wt,{member:f.data,roles:L,onChangeRole:(b,P)=>C.mutate({memberId:b,role:P}),onRemove:m,isUpdating:C.isPending}):s.jsx(Nt,{invitationId:f.data.id,onCancel:h,isCancelling:o.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=o.cancel.isPending,t[42]=L,t[43]=C,t[44]=ae):ae=t[44];let me;t[45]!==le||t[46]!==ae?(me=[W,le,xe,Z,ae],t[45]=le,t[46]=ae,t[47]=me):me=t[47];const Pe=me;let be;t[48]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ss,{trigger:s.jsx(_e,{children:"Invite Member"})})}),t[48]=be):be=t[48];const Re=be,ge=[...M.map(Qs),...w.filter(Vs).map(Ks)],oe=Ee,re=!!g;let X;t[49]===Symbol.for("react.memo_cache_sentinel")?(X=()=>h(null),t[49]=X):X=t[49];let ee;t[50]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsxs(ht,{children:[s.jsx(pt,{children:"Cancel Invitation"}),s.jsx(xt,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=ee):ee=t[50];let te;t[51]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(bt,{children:"Keep Invitation"}),t[51]=te):te=t[51];let se;t[52]!==o.cancel||t[53]!==g?(se=()=>{g&&(o.cancel.mutate(g),h(null))},t[52]=o.cancel,t[53]=g,t[54]=se):se=t[54];let S;t[55]!==o.cancel.isPending||t[56]!==se?(S=s.jsxs(ut,{children:[ee,s.jsxs(ft,{children:[te,s.jsx(gt,{onClick:se,disabled:o.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=o.cancel.isPending,t[56]=se,t[57]=S):S=t[57];let ne;t[58]!==re||t[59]!==S?(ne=s.jsx(jt,{open:re,onOpenChange:X,children:S}),t[58]=re,t[59]=S,t[60]=ne):ne=t[60];const he=!!a;let je;t[61]===Symbol.for("react.memo_cache_sentinel")?(je=()=>m(null),t[61]=je):je=t[61];let Fe;t[62]===Symbol.for("react.memo_cache_sentinel")?(Fe=s.jsxs(ht,{children:[s.jsx(pt,{children:"Remove Member"}),s.jsx(xt,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=Fe):Fe=t[62];let Le;t[63]===Symbol.for("react.memo_cache_sentinel")?(Le=s.jsx(bt,{children:"Cancel"}),t[63]=Le):Le=t[63];let ve;t[64]!==a||t[65]!==E?(ve=()=>a&&E.mutate(a),t[64]=a,t[65]=E,t[66]=ve):ve=t[66];let Ce;t[67]!==E.isPending||t[68]!==ve?(Ce=s.jsxs(ut,{children:[Fe,s.jsxs(ft,{children:[Le,s.jsx(gt,{onClick:ve,disabled:E.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=E.isPending,t[68]=ve,t[69]=Ce):Ce=t[69];let ye;t[70]!==he||t[71]!==Ce?(ye=s.jsx(jt,{open:he,onOpenChange:je,children:Ce}),t[70]=he,t[71]=Ce,t[72]=ye):ye=t[72];const Ge=Ee,He=Ee,zt="flex flex-col gap-6";let Se;t[73]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(Ee.Title,{children:"Members"}),t[73]=Se):Se=t[73];let Oe;t[74]===Symbol.for("react.memo_cache_sentinel")?(Oe=f=>{f.key==="Escape"&&(j(""),f.target.blur())},t[74]=Oe):Oe=t[74];let we;t[75]!==p?(we=s.jsx(qt,{value:p,onChange:j,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:Oe}),t[75]=p,t[76]=we):we=t[76];let qe;t[77]===Symbol.for("react.memo_cache_sentinel")?(qe=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[77]=qe):qe=t[77];let Ne;t[78]!==x||t[79]!==y||t[80]!==v||t[81]!==I?(Ne=s.jsx(Ot,{viewMode:I,onViewModeChange:R,sortKey:v,sortDirection:y,onSort:x,sortOptions:qe}),t[78]=x,t[79]=y,t[80]=v,t[81]=I,t[82]=Ne):Ne=t[82];let Te;t[83]!==we||t[84]!==Ne?(Te=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[we,Ne]}),Re]}),t[83]=we,t[84]=Ne,t[85]=Te):Te=t[85];const Je=I==="cards"?s.jsx("div",{children:ge.length===0?s.jsx(We,{title:"No members found",description:p?`No members match "${p}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:ge.map(f=>{if(f.type==="invitation")return s.jsxs(vt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(Nt,{invitationId:f.data.id,onCancel:h,isCancelling:o.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ve,{fallback:Qe(f.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ue,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Ke,{role:f.data.role,memberId:f.data.id,isOwner:!1,roleColorMap:U,selectableRoles:J,onRoleChange:(P,B)=>V.mutate({invitationId:P,role:B,email:f.data.email}),className:"w-fit"})]})]})]},`inv-${f.data.id}`);const b=f.data;return s.jsxs(vt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(wt,{member:b,roles:L,onChangeRole:(P,B)=>C.mutate({memberId:P,role:B}),onRemove:m,isUpdating:C.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ve,{url:b.user?.image??void 0,fallback:Qe(b.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:b.user?.email}),s.jsx(Ke,{role:b.role,memberId:b.id,isOwner:b.role==="owner",roleColorMap:U,selectableRoles:J,onRoleChange:(P,B)=>C.mutate({memberId:P,role:B}),className:"w-fit"}),s.jsx(Rt,{memberId:b.id,maxDisplay:3})]})]})]},b.id)})})}):s.jsx(Bt,{columns:Pe,data:ge,isLoading:!1,sortKey:v,sortDirection:y,onSort:x,emptyState:p?s.jsx(We,{title:"No members found",description:`No members match "${p}"`}):s.jsx(We,{title:"No members found",description:"Invite members to get started."})});let Ie;t[86]!==Se||t[87]!==Te||t[88]!==Je?(Ie=s.jsxs("div",{className:zt,children:[Se,Te,Je]}),t[86]=Se,t[87]=Te,t[88]=Je,t[89]=Ie):Ie=t[89];let Ae;t[90]!==He.Body||t[91]!==Ie?(Ae=s.jsx(He.Body,{children:Ie}),t[90]=He.Body,t[91]=Ie,t[92]=Ae):Ae=t[92];let Me;t[93]!==Ge.Content||t[94]!==Ae?(Me=s.jsx(Ge.Content,{children:Ae}),t[93]=Ge.Content,t[94]=Ae,t[95]=Me):Me=t[95];let Be;return t[96]!==oe||t[97]!==ne||t[98]!==ye||t[99]!==Me?(Be=s.jsxs(oe,{children:[ne,ye,Me]}),t[96]=oe,t[97]=ne,t[98]=ye,t[99]=Me,t[100]=Be):Be=t[100],Be}function Ks(t){return{type:"invitation",data:t}}function Vs(t){return t.status==="pending"}function Qs(t){return{type:"member",data:t}}function Us(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?ks(t.data.createdAt):"N/A"}):s.jsx(Ue,{variant:"outline",children:"Pending"})}function Gs(t){return t.type==="member"?s.jsx(Rt,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Hs(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ve,{url:t.data.user?.image??void 0,fallback:Qe(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ve,{fallback:Qe(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Js(t){return t.role!=="owner"}function Ws(t,e){ue("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update invitation role")}function Ys(t,e){ue("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update role")}function Zs(t){ue("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to remove member")}function Xs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function en(){const t=Y.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ee,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Lt,{fallback:e,children:s.jsx(ce.Suspense,{fallback:s.jsx(Ee,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(Bs,{})})}),t[1]=n):n=t[1],n}function Wn(){const t=Y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(vs,{capability:"members:manage",area:"members",children:s.jsx(en,{})}),t[0]=e):e=t[0],e}export{Wn as default};
@@ -1,4 +1,4 @@
1
- import{r as c,e as $,j as f,_ as O}from"./index-CpmOG_Bg.js";import{l as I,F as K}from"./index-Dx0tF1g4.js";import{S as N}from"./spinner-BAjOwgiW.js";async function A(t){const e=t.getModel();if(!e)throw new Error("[Monaco] No model found in editor");const r=e.getValue(),i=r.replace(/export default (async )?function/,"export default $1function __default")+`
1
+ import{r as c,e as $,j as f,_ as O}from"./index-DI_C2zjL.js";import{l as I,F as K}from"./index-6hdndQvf.js";import{S as N}from"./spinner-CIGunEVj.js";async function A(t){const e=t.getModel();if(!e)throw new Error("[Monaco] No model found in editor");const r=e.getValue(),i=r.replace(/export default (async )?function/,"export default $1function __default")+`
2
2
  type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
3
3
  ? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
4
4
  : T extends object