decocms 4.367.7 → 4.368.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/dist/client/assets/{AlertCircle-CMdkAjxQ.js → AlertCircle-_dpPH4gp.js} +1 -1
  2. package/dist/client/assets/{AreaChart-jIv2Q0sS.js → AreaChart-D3UNwAze.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DGJWLWaL.js → ArrowLeft-D5BILPql.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-D_1DZN2N.js → ArrowRight-CeIfu-_Z.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Bx3jqyJU.js → ArrowUp-D3IJVwy-.js} +1 -1
  6. package/dist/client/assets/{Check-HvrCGvlV.js → Check-BrCocVFB.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CQTpywHl.js → CheckCircle-BC0FabXU.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-dkkIYuGe.js → ChevronRight-B8w28Rs0.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BANcOZ09.js → ChevronUp-BZtOj4Ay.js} +1 -1
  10. package/dist/client/assets/{Copy01-D4tr9F1r.js → Copy01-8HlwnVL4.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CX8hLF54.js → CreditCard01-BuU2-7Xz.js} +1 -1
  12. package/dist/client/assets/{Database01-C6v3VKBC.js → Database01-CbAnK_KP.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-DEpQR8Rs.js → DotsVertical-wpNLDjEw.js} +1 -1
  14. package/dist/client/assets/{Download01-G8ZhNqF3.js → Download01-DGABlNWv.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-DNwZJRAX.js → ErrorBarContext-BlJtJ6et.js} +1 -1
  16. package/dist/client/assets/{Eye-wRiP-IKY.js → Eye-DXMWNy9I.js} +1 -1
  17. package/dist/client/assets/{File02-C5Axd7Wg.js → File02-6XspF3iG.js} +1 -1
  18. package/dist/client/assets/{GitBranch01-xiI7ahmy.js → GitBranch01-DdWI6T46.js} +1 -1
  19. package/dist/client/assets/{Globe01-BJfrzyV2.js → Globe01-LbDP9lO6.js} +1 -1
  20. package/dist/client/assets/{HardDrive-BtlNN50l.js → HardDrive-DtG-DEiB.js} +1 -1
  21. package/dist/client/assets/{Image01-ZQpSr40Q.js → Image01-rPrP47_j.js} +1 -1
  22. package/dist/client/assets/{Key01-TUQZiePT.js → Key01-CJUZ2anZ.js} +1 -1
  23. package/dist/client/assets/{Link01-Dubdh0XV.js → Link01-B0bN5v1C.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-DsoIvXMf.js → LinkExternal01-k2QYzvNX.js} +1 -1
  25. package/dist/client/assets/{MessageCircle01-DrVOv17x.js → MessageCircle01-CjlDn3qL.js} +1 -1
  26. package/dist/client/assets/{Monitor01-8akol8yD.js → Monitor01-BWhdvhYh.js} +1 -1
  27. package/dist/client/assets/{Package-6pCyxdj-.js → Package-CUFEWgH0.js} +1 -1
  28. package/dist/client/assets/{Palette-8_jSprTt.js → Palette-D8sq7zSJ.js} +1 -1
  29. package/dist/client/assets/{Play-B2WDpGm-.js → Play-CaXzttX1.js} +1 -1
  30. package/dist/client/assets/{Plus-B6iViyXP.js → Plus-B76Mdzta.js} +1 -1
  31. package/dist/client/assets/{Printer-1AF1IGx9.js → Printer-CilcBFsl.js} +1 -1
  32. package/dist/client/assets/{SearchLg-o3jjSP_H.js → SearchLg-UbmzRtIb.js} +1 -1
  33. package/dist/client/assets/{SearchMd-BFooCWLz.js → SearchMd-Cz88FNXR.js} +1 -1
  34. package/dist/client/assets/{Sector-D27lvJUl.js → Sector-CupdVPpd.js} +1 -1
  35. package/dist/client/assets/{Settings02-11lXkxuh.js → Settings02-DCxh89vV.js} +1 -1
  36. package/dist/client/assets/{Share07-2izyqHpD.js → Share07-CNlETPcr.js} +1 -1
  37. package/dist/client/assets/{Shield01-C_NSoVzs.js → Shield01-UHqavRD7.js} +1 -1
  38. package/dist/client/assets/{Stars01-dQ6_BPZ3.js → Stars01-BPm_Roon.js} +1 -1
  39. package/dist/client/assets/{Sun-DqCbyuBS.js → Sun-BukuAUTA.js} +1 -1
  40. package/dist/client/assets/{SwitchHorizontal01-Chrl4_cZ.js → SwitchHorizontal01-DDZJCKkC.js} +1 -1
  41. package/dist/client/assets/{Tool01-DekOr9OW.js → Tool01-txvCBUcI.js} +1 -1
  42. package/dist/client/assets/{Tool02-CgXadMFZ.js → Tool02-DUdKhOIL.js} +1 -1
  43. package/dist/client/assets/{Trash01-DwLqZ5iv.js → Trash01-CeNVn9va.js} +1 -1
  44. package/dist/client/assets/{TrendUp01-BJ6ZxGib.js → TrendUp01-pvT8-WFv.js} +1 -1
  45. package/dist/client/assets/{Upload01-zIaNWjGg.js → Upload01-CdWOLhzl.js} +1 -1
  46. package/dist/client/assets/{User01-Cuc8TQ2e.js → User01-BFd06Lzl.js} +1 -1
  47. package/dist/client/assets/{UserSquare-DO483pcO.js → UserSquare-VWJ4b2Nu.js} +1 -1
  48. package/dist/client/assets/{Users01-C_FX7NZW.js → Users01-CSkRDmMq.js} +1 -1
  49. package/dist/client/assets/{Users03-CBIUviMz.js → Users03-CKweEAHJ.js} +1 -1
  50. package/dist/client/assets/{X-BbEHf0ox.js → X-Ch9pdqUF.js} +1 -1
  51. package/dist/client/assets/{XCircle-CIpucXWN.js → XCircle-CRFE9Sxc.js} +1 -1
  52. package/dist/client/assets/{XClose-D9lEUPrO.js → XClose-nb8sU8Mf.js} +1 -1
  53. package/dist/client/assets/{Zap-FJBBk1lb.js → Zap-cGv6CHKy.js} +1 -1
  54. package/dist/client/assets/{ZoomOut-DR5p3Py1.js → ZoomOut-kKuBc-4q.js} +1 -1
  55. package/dist/client/assets/{access-gate-BGLq5_fD.js → access-gate-Dna5j1xg.js} +1 -1
  56. package/dist/client/assets/{add-connection-dialog-CP-mB4l0.js → add-connection-dialog-Dv940sel.js} +1 -1
  57. package/dist/client/assets/{agent-analytics-CwkHNxxG.js → agent-analytics-BUFhTNrz.js} +1 -1
  58. package/dist/client/assets/agent-app-CwiQy74t.js +1 -0
  59. package/dist/client/assets/agent-assets-DBUnPpmJ.js +1 -0
  60. package/dist/client/assets/agent-automation-BUKjRQ0s.js +20 -0
  61. package/dist/client/assets/{agent-automations-BUDch-j3.js → agent-automations-CkHa31mG.js} +1 -1
  62. package/dist/client/assets/{agent-connect-sources-LY53id1I.js → agent-connect-sources-aEQ5U5Ys.js} +1 -1
  63. package/dist/client/assets/agent-deck-DZdDIvkK.js +1 -0
  64. package/dist/client/assets/{agent-e2e-CnVObhl4.js → agent-e2e-CVvHLDWr.js} +1 -1
  65. package/dist/client/assets/agent-file-B3z9GSFG.js +1 -0
  66. package/dist/client/assets/{agent-git-C-KtJQOB.js → agent-git-Xu4xVp7K.js} +2 -2
  67. package/dist/client/assets/{agent-hosting-Dr-g2CXP.js → agent-hosting-CqeGjFKK.js} +1 -1
  68. package/dist/client/assets/{agent-icon-CL_nl9mo.js → agent-icon-TqAwQbws.js} +1 -1
  69. package/dist/client/assets/agent-library-file-CyW6BWlf.js +1 -0
  70. package/dist/client/assets/{agent-monitor-SvCw0nUy.js → agent-monitor-CQJNHyJU.js} +1 -1
  71. package/dist/client/assets/{agent-overview-lLErih75.js → agent-overview-BMNsRpT6.js} +1 -1
  72. package/dist/client/assets/agent-settings-DW9H-Dv0.js +1 -0
  73. package/dist/client/assets/{agent-site-editor-BukowFNy.js → agent-site-editor-CIwfwhaR.js} +2 -2
  74. package/dist/client/assets/agent-site-editor-code-DerDfcPo.js +2 -0
  75. package/dist/client/assets/{agent-site-editor-content-DtzkoDLB.js → agent-site-editor-content-gT4XwcZF.js} +2 -2
  76. package/dist/client/assets/{agent-site-editor-preview-DX7U6V5V.js → agent-site-editor-preview-BxCHHAmi.js} +3 -3
  77. package/dist/client/assets/{agent-view-guard-BMN6ThUt.js → agent-view-guard-B9uu0uNy.js} +1 -1
  78. package/dist/client/assets/agent-view-mE-ErsH1.js +1 -0
  79. package/dist/client/assets/{agents-list-C6ZSW07I.js → agents-list-DEcIxmc7.js} +1 -1
  80. package/dist/client/assets/{ai-providers-D2C1qlv0.js → ai-providers-4TWNzC8y.js} +2 -2
  81. package/dist/client/assets/{alert-0Lc8v4N7.js → alert-B054apY1.js} +1 -1
  82. package/dist/client/assets/{alert-dialog-BcLnZa7A.js → alert-dialog-BQcocmj1.js} +1 -1
  83. package/dist/client/assets/api-keys-Dfv4dEMM.js +1 -0
  84. package/dist/client/assets/{api-keys-Cf6bK86U.js → api-keys-EFdKngWA.js} +1 -1
  85. package/dist/client/assets/app-editor-DAPu7E0g.js +1 -0
  86. package/dist/client/assets/{asset-utils-DIsXFmtL.js → asset-utils-D8QOLQKI.js} +1 -1
  87. package/dist/client/assets/{auth-DqeCOVzg.js → auth-CZC2Ujtf.js} +1 -1
  88. package/dist/client/assets/{auth-catchall-BNIBQ_XR.js → auth-catchall-CdCofhcq.js} +1 -1
  89. package/dist/client/assets/{auth-entry-Bq32N4lt.js → auth-entry-D76qGMln.js} +1 -1
  90. package/dist/client/assets/{auth-split-layout-DliwYz65.js → auth-split-layout-BqkQ5MRI.js} +1 -1
  91. package/dist/client/assets/{authenticate-and-persist-oauth-Eoth2qMz.js → authenticate-and-persist-oauth-CHdcX4lx.js} +1 -1
  92. package/dist/client/assets/{automation-list-row-CpdfZzhf.js → automation-list-row-CDBc0L1r.js} +1 -1
  93. package/dist/client/assets/{automation-runs-DIEXu2AA.js → automation-runs-BQLbZ_hL.js} +1 -1
  94. package/dist/client/assets/{automations-BpBth9hu.js → automations-CFVXwFqr.js} +1 -1
  95. package/dist/client/assets/{autosend-2Y4HgA_T.js → autosend-BA2WDHKH.js} +1 -1
  96. package/dist/client/assets/{avatar-YOwDvuCo.js → avatar-U_W3DOyI.js} +1 -1
  97. package/dist/client/assets/{badge-CKy1DnEV.js → badge-CTjh9J7T.js} +1 -1
  98. package/dist/client/assets/{block-document-aP19FM_M.js → block-document-DCeQa0yI.js} +1 -1
  99. package/dist/client/assets/{blocks-preview-workspace-context-DP5_u2Xp.js → blocks-preview-workspace-context-BdOEiss-.js} +1 -1
  100. package/dist/client/assets/{breadcrumb-BY8W5NfH.js → breadcrumb-DhYRM7a2.js} +1 -1
  101. package/dist/client/assets/{buckets-Bhe2phyM.js → buckets-DyboX_DE.js} +1 -1
  102. package/dist/client/assets/{build-improve-prompt-doc-DVZMfB_k.js → build-improve-prompt-doc-CVdAljgW.js} +1 -1
  103. package/dist/client/assets/{bulk-category-panel-dbBPINFu.js → bulk-category-panel-BLBAwogB.js} +1 -1
  104. package/dist/client/assets/{calendar-O0niDXgD.js → calendar-C3g1HVYe.js} +1 -1
  105. package/dist/client/assets/{capability-load-error-JtYpAIDC.js → capability-load-error-DsSoc04a.js} +1 -1
  106. package/dist/client/assets/{cards-CljnVFGF.js → cards-D3kB6iIj.js} +1 -1
  107. package/dist/client/assets/category-editor-CC0PdtIK.js +1 -0
  108. package/dist/client/assets/{chart-DjxuH9z1.js → chart-D_loKaX9.js} +1 -1
  109. package/dist/client/assets/{chat-context-DT13Ns9e.js → chat-context-Cor1QyQv.js} +1 -1
  110. package/dist/client/assets/{chat-draft-Bp7WKsio.js → chat-draft-DCJe5CEL.js} +1 -1
  111. package/dist/client/assets/{checkbox-BAc6ON84.js → checkbox-W4oibM4M.js} +1 -1
  112. package/dist/client/assets/{choose-editor-Db-m1tPL.js → choose-editor-CEzDxdDD.js} +1 -1
  113. package/dist/client/assets/{cli-auth-success-ORnUB4EZ.js → cli-auth-success-C_CF3b7k.js} +1 -1
  114. package/dist/client/assets/{client-icons-DH-s5V8p.js → client-icons-Bzg5KJqo.js} +1 -1
  115. package/dist/client/assets/{collapsible-Cfc5GOq6.js → collapsible-Q7VW373b.js} +1 -1
  116. package/dist/client/assets/{collection-detail-tLNt3mFd.js → collection-detail-Do-V1iEU.js} +1 -1
  117. package/dist/client/assets/{collection-display-button-Q83lUSRW.js → collection-display-button-DoWqp-k5.js} +1 -1
  118. package/dist/client/assets/{collection-search-DOotlcr-.js → collection-search-Ve8Od1Ze.js} +1 -1
  119. package/dist/client/assets/{collection-table-wrapper-L7fq3Ewq.js → collection-table-wrapper-CQd2BlgT.js} +1 -1
  120. package/dist/client/assets/{collection-tabs-77YTqRx_.js → collection-tabs-B31cxzhl.js} +1 -1
  121. package/dist/client/assets/{command-BbfSNpjK.js → command-BTJsPyoV.js} +1 -1
  122. package/dist/client/assets/{command-palette-store-CDXRiKfb.js → command-palette-store-B3FjlwOX.js} +1 -1
  123. package/dist/client/assets/{companion-mcps-section-B3OT3fvW.js → companion-mcps-section-BJrWJNrw.js} +1 -1
  124. package/dist/client/assets/{connect-DYMJSd71.js → connect-Dk6GxqPK.js} +2 -2
  125. package/dist/client/assets/{connect-layout-Cb-8wVa_.js → connect-layout-CJdyGLIg.js} +1 -1
  126. package/dist/client/assets/{connection-C0h_riCe.js → connection-BYgVvaQ-.js} +1 -1
  127. package/dist/client/assets/{connection-card-BnHVqPYb.js → connection-card-BlyShat1.js} +1 -1
  128. package/dist/client/assets/{connection-detail-BukOET2K.js → connection-detail-CtIhDsnP.js} +1 -1
  129. package/dist/client/assets/{connection-form-helpers-BGarejHH.js → connection-form-helpers-DfdZqD7N.js} +1 -1
  130. package/dist/client/assets/{connections-C94wvfI_.js → connections-DxJKDsbg.js} +1 -1
  131. package/dist/client/assets/{create-organization-dialog-BeMHfEec.js → create-organization-dialog-CiZy-ZG6.js} +1 -1
  132. package/dist/client/assets/{decofile-api-D5P6O-Yb.js → decofile-api-drrGQg3A.js} +1 -1
  133. package/dist/client/assets/{decopilot-DEim_pMB.js → decopilot-DB30hM5k.js} +1 -1
  134. package/dist/client/assets/{dialog-DIO2BT5L.js → dialog-FbeViKhV.js} +1 -1
  135. package/dist/client/assets/{discover-zXR45UVE.js → discover-Bkm8Ppdq.js} +1 -1
  136. package/dist/client/assets/{domain-settings-CoxAhG8y.js → domain-settings-di4lhBEH.js} +1 -1
  137. package/dist/client/assets/{download-app-dialog-B-5SSg-B.js → download-app-dialog-B0wRR8XY.js} +1 -1
  138. package/dist/client/assets/{drawer-Dp27hT9C.js → drawer-BFLllOI5.js} +1 -1
  139. package/dist/client/assets/{dropdown-menu-BzAnwSL0.js → dropdown-menu-Cg7EtBKr.js} +1 -1
  140. package/dist/client/assets/{editor-Dm21YC6a.js → editor-DfIJZemH.js} +3 -3
  141. package/dist/client/assets/{empty-state-F709JYnF.js → empty-state-B73golk2.js} +1 -1
  142. package/dist/client/assets/{empty-state-CvrLm3VU.js → empty-state-BUjKoJeI.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-Cfd0L2y0.js → extract-connection-data-OymVW05I.js} +1 -1
  144. package/dist/client/assets/{feature-gate-CSQct_zD.js → feature-gate-BtTiJvHf.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-Cd5ZGlWk.js → feature-paywall-CxRYlO85.js} +1 -1
  146. package/dist/client/assets/{file-explorer-B6MMR_br.js → file-explorer-ChhaUDkc.js} +1 -1
  147. package/dist/client/assets/{file-preview-B3un6Sja.js → file-preview-B-3X414G.js} +1 -1
  148. package/dist/client/assets/{file-share-button-BXZcNnFk.js → file-share-button-BCcqyHI3.js} +1 -1
  149. package/dist/client/assets/{file-type-icon-CzM4dKXx.js → file-type-icon-CgjUbvA5.js} +1 -1
  150. package/dist/client/assets/{folder-icon-Bjs4wWQI.js → folder-icon-DIKFMRjx.js} +1 -1
  151. package/dist/client/assets/{form-DGoweIp4.js → form-ZSFKpKuR.js} +1 -1
  152. package/dist/client/assets/{gateway-client-BKFdOqFV.js → gateway-client-DDB4Jo5d.js} +1 -1
  153. package/dist/client/assets/{general-BER62NBk.js → general-B89BsePD.js} +1 -1
  154. package/dist/client/assets/{github-icon-D5mzGkJ1.js → github-icon-DvBRseH_.js} +1 -1
  155. package/dist/client/assets/home-EgbfGXHT.js +1 -0
  156. package/dist/client/assets/{hooks-DW28Wv6W.js → hooks-CY6XZOHF.js} +1 -1
  157. package/dist/client/assets/{hooks-DOi6gVdi.js → hooks-Czb0EjQM.js} +2 -2
  158. package/dist/client/assets/{index-BqEX4CxD.js → index-B8SDzCvY.js} +1 -1
  159. package/dist/client/assets/{index-26VXD9YQ.js → index-BLoGenx5.js} +1 -1
  160. package/dist/client/assets/{index-BiIMwVbK.js → index-BWW-QUD7.js} +1 -1
  161. package/dist/client/assets/{index-CLBWHxV4.js → index-B_q9xGDu.js} +1 -1
  162. package/dist/client/assets/{index-BKjzqVX4.js → index-BwNv0_X1.js} +1 -1
  163. package/dist/client/assets/{index-ebCjSNwh.js → index-C2PjpIk5.js} +39 -39
  164. package/dist/client/assets/{index-D3hBrAe3.js → index-CaeHd-kX.js} +1 -1
  165. package/dist/client/assets/{index-C7nGODiq.js → index-CbVT0Wha.js} +1 -1
  166. package/dist/client/assets/{index-D9Pa20nR.js → index-CiQ8AEuv.js} +1 -1
  167. package/dist/client/assets/{index-kzbDuxts.js → index-CyayjuN4.js} +1 -1
  168. package/dist/client/assets/{index-BVdPTogP.js → index-DDWK4S9N.js} +1 -1
  169. package/dist/client/assets/{index-Ch3pSh1a.js → index-DQH0Frt9.js} +1 -1
  170. package/dist/client/assets/{index-DDHop146.js → index-DgDEDYFd.js} +1 -1
  171. package/dist/client/assets/{index-C9jQATHx.js → index-bq82HRdX.js} +7 -7
  172. package/dist/client/assets/{index-DX88U1Fe.js → index-mL_OEvyk.js} +2 -2
  173. package/dist/client/assets/{index-redirect-bdPeOdFP.js → index-redirect-Cl5ECm8S.js} +1 -1
  174. package/dist/client/assets/{infiniteQueryObserver-CrlFqUXS.js → infiniteQueryObserver-Dk7f60ge.js} +1 -1
  175. package/dist/client/assets/{infra-billing-DBRnO5Xv.js → infra-billing-D-zABnxC.js} +1 -1
  176. package/dist/client/assets/{input-BfoQkl5k.js → input-B62UEC6S.js} +1 -1
  177. package/dist/client/assets/{input-DxpPAL6X.js → input-C4xdJkO9.js} +2 -2
  178. package/dist/client/assets/{input-DCAbperr.js → input-DYrUDn-6.js} +1 -1
  179. package/dist/client/assets/{integration-icon-DLbXRirx.js → integration-icon-DWVAXJ5W.js} +1 -1
  180. package/dist/client/assets/{label-BZvBRfsC.js → label-DHlCjoX-.js} +1 -1
  181. package/dist/client/assets/{last-preview-page-DgNuT4mN.js → last-preview-page-g2Wt-_qP.js} +1 -1
  182. package/dist/client/assets/{layout-D_2jgeSQ.js → layout-DvNX7Jhc.js} +1 -1
  183. package/dist/client/assets/{legacy-agents-deep-D9-8wOwe.js → legacy-agents-deep-B4F7_80Y.js} +1 -1
  184. package/dist/client/assets/{legacy-main-redirect-U48xVXg3.js → legacy-main-redirect-DLvBqWxl.js} +1 -1
  185. package/dist/client/assets/{library-DCHuYHcg.js → library-CceZemOg.js} +2 -2
  186. package/dist/client/assets/{login-DLU4Kv--.js → login-CX3-ibA4.js} +1 -1
  187. package/dist/client/assets/{markdown-BxIxTFHX.js → markdown-qqEQfcng.js} +33 -33
  188. package/dist/client/assets/{mcp-app-renderer-C5_SSFlp.js → mcp-app-renderer-Cj43EsNL.js} +1 -1
  189. package/dist/client/assets/{mcp-oauth-Cj16tOMc.js → mcp-oauth-lrCnpZRU.js} +1 -1
  190. package/dist/client/assets/{members-B8ghL5vq.js → members-BKOir_Pt.js} +1 -1
  191. package/dist/client/assets/{message-templates-C0k0djOm.js → message-templates-0mKRx1r7.js} +1 -1
  192. package/dist/client/assets/{mini-report-page-DPr8miDS.js → mini-report-page-CfZCYEQQ.js} +1 -1
  193. package/dist/client/assets/mock-board-CqCYQnTw.js +90 -0
  194. package/dist/client/assets/{monaco-editor-D7KtEG80.js → monaco-editor-BbS-xHlo.js} +1 -1
  195. package/dist/client/assets/{monitoring-stats-row-C8qE8vIX.js → monitoring-stats-row-CGLZvQvq.js} +1 -1
  196. package/dist/client/assets/{multi-select-PUmjNPLo.js → multi-select-DHogVRlv.js} +1 -1
  197. package/dist/client/assets/{mustache-DoPKkDOt.js → mustache-CaTcgxFU.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-yzNiiBZS.js → oauth-callback-BDR5owZa.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ai-provider-BkPGppSA.js → oauth-callback-ai-provider-DSX_mvvw.js} +1 -1
  200. package/dist/client/assets/{onboarding-DNDx-VJt.js → onboarding-_X5jFwXg.js} +1 -1
  201. package/dist/client/assets/{optimistic-project-sidebar-views-DQAcmOUC.js → optimistic-project-sidebar-views-prl2BiPv.js} +1 -1
  202. package/dist/client/assets/org-file-open-context-CY-h563L.js +1 -0
  203. package/dist/client/assets/{organization-choice-X5fcp7VC.js → organization-choice-C7qy14tx.js} +1 -1
  204. package/dist/client/assets/{orgs-C71bHZfS.js → orgs-CgMPvHkg.js} +1 -1
  205. package/dist/client/assets/{page-seo-form-CJ5C4DO5.js → page-seo-form-CmXwxqgr.js} +1 -1
  206. package/dist/client/assets/{pair-D4JmcK-t.js → pair-CoC4CuoZ.js} +1 -1
  207. package/dist/client/assets/{plan-ladder-CQ1a44li.js → plan-ladder-DpgC6kIZ.js} +1 -1
  208. package/dist/client/assets/{popover-cYfVOF_J.js → popover-DJmzS7mv.js} +1 -1
  209. package/dist/client/assets/post-calendar-Dz5zavXp.js +1 -0
  210. package/dist/client/assets/post-editor-DWfeh8M1.js +1 -0
  211. package/dist/client/assets/{preview-content-DlgGWAMY.js → preview-content-C0VkspNR.js} +1 -1
  212. package/dist/client/assets/{preview-dialog-DMVdVz_V.js → preview-dialog-BZOqzTG2.js} +1 -1
  213. package/dist/client/assets/{primitives-7Kw_jkKz.js → primitives-jHhmgAQ9.js} +1 -1
  214. package/dist/client/assets/{profile-fIXgfLVj.js → profile-fLPl9mHC.js} +1 -1
  215. package/dist/client/assets/{project-app-view-DpkzCjxR.js → project-app-view-B7QzqtQA.js} +1 -1
  216. package/dist/client/assets/{project-feed-D1Rnls8q.js → project-feed-B--J89zr.js} +1 -1
  217. package/dist/client/assets/{project-icon-CWg_rHTZ.js → project-icon-BRc_SYWu.js} +1 -1
  218. package/dist/client/assets/project-reports-DeYwugwl.js +1 -0
  219. package/dist/client/assets/project-tasks-D7RrtRzg.js +1 -0
  220. package/dist/client/assets/{prompts-D1i8e1V8.js → prompts-C5wKMcEi.js} +1 -1
  221. package/dist/client/assets/record-editor-BMFTazO_.js +1 -0
  222. package/dist/client/assets/redirect-editor-Bz1hNhc-.js +1 -0
  223. package/dist/client/assets/registry-CBVz5tUq.js +2 -0
  224. package/dist/client/assets/{registry-layout-r2D039nl.js → registry-layout-B8hxuLqC.js} +1 -1
  225. package/dist/client/assets/{reports-TdOY4KuN.js → reports-BNMMk57f.js} +1 -1
  226. package/dist/client/assets/reports-BVwrD4fa.js +1 -0
  227. package/dist/client/assets/{reports-onboarding-s05s2vjv.js → reports-onboarding-Cvd1ByZr.js} +1 -1
  228. package/dist/client/assets/{reports-tab-D0Xwzbct.js → reports-tab-B1GRtFON.js} +2 -2
  229. package/dist/client/assets/{repositories-JDvNAhI8.js → repositories-CrrctYRd.js} +1 -1
  230. package/dist/client/assets/{repository-import-picker-BNluAY2V.js → repository-import-picker-CwyID9Hr.js} +1 -1
  231. package/dist/client/assets/{repository-picker-D9agNhNi.js → repository-picker-nA1fPR0i.js} +1 -1
  232. package/dist/client/assets/{require-capability-DjYcyxbJ.js → require-capability-Dq_uftSz.js} +1 -1
  233. package/dist/client/assets/{required-auth-layout-C3o3t9X1.js → required-auth-layout-bRQ8Relk.js} +1 -1
  234. package/dist/client/assets/{reset-password-DOQza5N6.js → reset-password-9EzqJ9Aj.js} +1 -1
  235. package/dist/client/assets/{resizable-BHYHfZY5.js → resizable-CHa_EJdX.js} +1 -1
  236. package/dist/client/assets/{review-settings-zUGfHLOe.js → review-settings-CuYs2gkJ.js} +1 -1
  237. package/dist/client/assets/{rich-text-link-control-BMZBKHAS.js → rich-text-link-control-BhNjJjUI.js} +1 -1
  238. package/dist/client/assets/{roles-CbYdUx8a.js → roles-DOIPyEeu.js} +1 -1
  239. package/dist/client/assets/{route--XOZLXQj.js → route-BJZVtvXD.js} +1 -1
  240. package/dist/client/assets/{route-BMqM-gRN.js → route-DVbh_JIM.js} +1 -1
  241. package/dist/client/assets/route-DXTx8B1o.js +1 -0
  242. package/dist/client/assets/{runnable-block-editor-eIl1ZAUD.js → runnable-block-editor-NBss0rGv.js} +1 -1
  243. package/dist/client/assets/{sandbox-lifecycle-context-dIh2VE9T.js → sandbox-lifecycle-context-Cwag3ZuW.js} +1 -1
  244. package/dist/client/assets/{schema-DLCqAhaO.js → schema-Difu_0cd.js} +1 -1
  245. package/dist/client/assets/{scroll-area-B6yfQzTQ.js → scroll-area-DizJqsMb.js} +1 -1
  246. package/dist/client/assets/{search-input-B9FxoKon.js → search-input-BFvnqi9T.js} +1 -1
  247. package/dist/client/assets/{secrets-Ckg8Rd0M.js → secrets-mAWyIyIG.js} +1 -1
  248. package/dist/client/assets/{sections-editor-DfusxW9l.js → sections-editor-BS-czeQw.js} +2 -2
  249. package/dist/client/assets/{select-BemZ3-RS.js → select-CQk1UktB.js} +1 -1
  250. package/dist/client/assets/{select-model-Dt_mcRLi.js → select-model-V6Ahwt40.js} +1 -1
  251. package/dist/client/assets/seo-editor-DqOS74Wa.js +1 -0
  252. package/dist/client/assets/{settings-tab-W9gLVP9Y.js → settings-tab-DgFFWLKL.js} +1 -1
  253. package/dist/client/assets/{sheet-CAYJdNnO.js → sheet-XW3igMAp.js} +1 -1
  254. package/dist/client/assets/{shell-layout-BZ9RU057.js → shell-layout-lFmUNyF7.js} +1 -1
  255. package/dist/client/assets/{sidebar-kfvz7bzl.js → sidebar-CaDkomsf.js} +1 -1
  256. package/dist/client/assets/{skill-preview-DKoageod.js → skill-preview-haMHuu3V.js} +1 -1
  257. package/dist/client/assets/skills-CQVB1v99.js +1 -0
  258. package/dist/client/assets/{sso-aIkFrBYs.js → sso-BguB6oWk.js} +1 -1
  259. package/dist/client/assets/{store-PyPRbE--.js → store-DfwhNMsh.js} +1 -1
  260. package/dist/client/assets/store-registry-k7nLI4El.js +2 -0
  261. package/dist/client/assets/{switch-CwYc17c1.js → switch-C44BHJ4_.js} +1 -1
  262. package/dist/client/assets/{synced-repos-LBwJXWce.js → synced-repos-CfvjXlOq.js} +1 -1
  263. package/dist/client/assets/{table-Dk8JamWN.js → table-vs5PY6MV.js} +1 -1
  264. package/dist/client/assets/{tabs-CScSsCn-.js → tabs-Be7MjhEn.js} +1 -1
  265. package/dist/client/assets/{task-board-WxptS5oC.js → task-board-NCKWK-L3.js} +1 -1
  266. package/dist/client/assets/{task-route-CgUDYaF5.js → task-route-BoHR4cN4.js} +1 -1
  267. package/dist/client/assets/{task-status-DYV2rHq2.js → task-status-DsfqndTm.js} +1 -1
  268. package/dist/client/assets/{tasks-Dyp4w1ZL.js → tasks-C_VDG237.js} +4 -4
  269. package/dist/client/assets/tasks-DjG_h180.js +1 -0
  270. package/dist/client/assets/{textarea-C-rDHIo4.js → textarea-Dt5uzYAk.js} +1 -1
  271. package/dist/client/assets/{thread-intent-Dqbb6tX6.js → thread-intent-BBez6nif.js} +1 -1
  272. package/dist/client/assets/{thread-route-DGpNj7En.js → thread-route-B0O5tMmh.js} +1 -1
  273. package/dist/client/assets/{thread-route-B7ApJPMo.js → thread-route-DhLwmRkM.js} +1 -1
  274. package/dist/client/assets/{thread-sheet-body-CXERmuvO.js → thread-sheet-body-qD1pkorX.js} +1 -1
  275. package/dist/client/assets/{toggle-group-BwAc-516.js → toggle-group-DXrH4GGv.js} +1 -1
  276. package/dist/client/assets/{toolbar-icon-button-D5CIjxUn.js → toolbar-icon-button-DkmObRsV.js} +1 -1
  277. package/dist/client/assets/{tooltip-D5dIOzcQ.js → tooltip-BbRZqSqs.js} +1 -1
  278. package/dist/client/assets/{track-CfasnexS.js → track-Cq81o3eA.js} +1 -1
  279. package/dist/client/assets/{types-BKgDxdgt.js → types-DfRui0tk.js} +1 -1
  280. package/dist/client/assets/{usage-stats-CzjkHtFz.js → usage-stats-CIfcRmIQ.js} +1 -1
  281. package/dist/client/assets/{use-ai-providers-DHpBr525.js → use-ai-providers-CzWjKGEV.js} +1 -1
  282. package/dist/client/assets/{use-automations-D8fUWM0i.js → use-automations-B1g8BCjF.js} +1 -1
  283. package/dist/client/assets/{use-autosave-BcXFrygg.js → use-autosave-zCYjHp0Q.js} +1 -1
  284. package/dist/client/assets/{use-connect-companion-BI8_ITvf.js → use-connect-companion-CSsGFFTC.js} +1 -1
  285. package/dist/client/assets/{use-connection-1DEAzFaJ.js → use-connection-D_iAIgTV.js} +1 -1
  286. package/dist/client/assets/{use-copy-CrTQ1bFc.js → use-copy-CXvvMCCk.js} +1 -1
  287. package/dist/client/assets/{use-create-virtual-mcp-6onzYx_V.js → use-create-virtual-mcp-wa9JpFSa.js} +1 -1
  288. package/dist/client/assets/{use-date-fns-locale-CKJk6bHw.js → use-date-fns-locale-DAtfdqMB.js} +1 -1
  289. package/dist/client/assets/{use-debounced-autosave-CscEX7LB.js → use-debounced-autosave-CGfqMI_2.js} +1 -1
  290. package/dist/client/assets/{use-debounced-value-Cd1Twr6w.js → use-debounced-value-BjFoL1TN.js} +1 -1
  291. package/dist/client/assets/{use-deco-credits-DXbh8RF9.js → use-deco-credits-KfquqRSe.js} +1 -1
  292. package/dist/client/assets/{use-decopilot-events-BorkAE1x.js → use-decopilot-events-3_YSe3LA.js} +1 -1
  293. package/dist/client/assets/{use-delete-connection-D14lo6hH.js → use-delete-connection-4mVlUDap.js} +1 -1
  294. package/dist/client/assets/{use-deployment-admin-CnWMkexv.js → use-deployment-admin-DiOvR37Z.js} +1 -1
  295. package/dist/client/assets/{use-entitlements-CW1G9reZ.js → use-entitlements-CZtG5Aw4.js} +1 -1
  296. package/dist/client/assets/{use-fast-preview-draft-url-C6GlSiLC.js → use-fast-preview-draft-url-tdElS5FG.js} +1 -1
  297. package/dist/client/assets/{use-file-configs-CIuxe_Ni.js → use-file-configs-BTKu0ddn.js} +1 -1
  298. package/dist/client/assets/{use-infinite-scroll-C3V6bChR.js → use-infinite-scroll-CqfaxXN1.js} +1 -1
  299. package/dist/client/assets/{use-join-requests-D9RxS7KW.js → use-join-requests-B4yW6raK.js} +1 -1
  300. package/dist/client/assets/{use-main-panel-tabs-DXkaeHMV.js → use-main-panel-tabs-Ch6v5oL2.js} +1 -1
  301. package/dist/client/assets/{use-mcp-auth-status-BH9IDFQ1.js → use-mcp-auth-status-BHDkqk7b.js} +1 -1
  302. package/dist/client/assets/{use-mcp-client-2uEIRhaM.js → use-mcp-client-oEME4UuR.js} +1 -1
  303. package/dist/client/assets/{use-mcp-prompts-CoIIHF5C.js → use-mcp-prompts-C3OTryE-.js} +1 -1
  304. package/dist/client/assets/{use-mcp-tools-BEXh2Dal.js → use-mcp-tools-5nC74C22.js} +1 -1
  305. package/dist/client/assets/{use-members-B9Bp6K2N.js → use-members-69QDyex7.js} +1 -1
  306. package/dist/client/assets/{use-mobile-CpN-x3jP.js → use-mobile-DAKfge6F.js} +1 -1
  307. package/dist/client/assets/{use-navigate-to-agent-D91bju80.js → use-navigate-to-agent-DxF2NRC6.js} +1 -1
  308. package/dist/client/assets/{use-open-billing-url-BerGO0rw.js → use-open-billing-url-B38x35SM.js} +1 -1
  309. package/dist/client/assets/{use-org-auth-client-r5wiYH2P.js → use-org-auth-client-DscVB01a.js} +1 -1
  310. package/dist/client/assets/{use-org-fs-Bts9OSaP.js → use-org-fs-fnC2xvX1.js} +1 -1
  311. package/dist/client/assets/{use-org-notice-CoJcS75H.js → use-org-notice-B1I6Lz9G.js} +1 -1
  312. package/dist/client/assets/{use-org-sso-dhAsVLFb.js → use-org-sso-Bkoh1g8c.js} +1 -1
  313. package/dist/client/assets/{use-organization-roles-kAP23ZDQ.js → use-organization-roles-BfyEvouz.js} +1 -1
  314. package/dist/client/assets/{use-organization-settings-OP1vKLQc.js → use-organization-settings-822MAvzA.js} +1 -1
  315. package/dist/client/assets/{use-panel-navigate-DArr9jKh.js → use-panel-navigate-CfBqSRJx.js} +1 -1
  316. package/dist/client/assets/{use-project-native-view-presence-7Bqoz-C1.js → use-project-native-view-presence-D8gp5jYC.js} +1 -1
  317. package/dist/client/assets/{use-project-scope-DUmb12wa.js → use-project-scope-UolqDpiW.js} +1 -1
  318. package/dist/client/assets/{use-registry-connections-T5KGR_Hv.js → use-registry-connections-fPqqwJHB.js} +1 -1
  319. package/dist/client/assets/{use-releases-C3yM6r03.js → use-releases-Cbg5_HwT.js} +1 -1
  320. package/dist/client/assets/{use-reports-diagnostic-vTs5yUh0.js → use-reports-diagnostic-Dlm42p32.js} +1 -1
  321. package/dist/client/assets/{use-route-default-main-D6cfsdMd.js → use-route-default-main-Dxf67Gay.js} +1 -1
  322. package/dist/client/assets/{use-secrets-CVFKBXHe.js → use-secrets-CPAFHAxr.js} +1 -1
  323. package/dist/client/assets/{use-section-preview-base-YyD8NP1s.js → use-section-preview-base-kMBmEGDx.js} +1 -1
  324. package/dist/client/assets/{use-session-runtime-Dg7Dw6FF.js → use-session-runtime-BBfRxqis.js} +1 -1
  325. package/dist/client/assets/{use-tags-yE947YEK.js → use-tags-BbWkKH-n.js} +1 -1
  326. package/dist/client/assets/{use-task-metadata-Cxd6otqh.js → use-task-metadata-C4b2me4e.js} +1 -1
  327. package/dist/client/assets/{use-thread-outputs-HjlkcFr2.js → use-thread-outputs-BBZhcvEI.js} +1 -1
  328. package/dist/client/assets/{use-view-mode-BsvAwGGR.js → use-view-mode-nKImchJM.js} +1 -1
  329. package/dist/client/assets/{use-virtual-mcp-De5-1hZU.js → use-virtual-mcp-Dd6It4Gy.js} +1 -1
  330. package/dist/client/assets/useInfiniteQuery-jh1wgrcQ.js +1 -0
  331. package/dist/client/assets/{useQueries-Dg8jJOK1.js → useQueries-Bz_0VuN2.js} +1 -1
  332. package/dist/client/assets/useSuspenseInfiniteQuery-B8nGcnhH.js +1 -0
  333. package/dist/client/assets/{users-DmBfcg5F.js → users-Bl2iF4g-.js} +1 -1
  334. package/dist/client/assets/{utils-Bx7x03n7.js → utils-8GjS8YYu.js} +1 -1
  335. package/dist/client/assets/variant-calendar-BGrVKKIo.js +1 -0
  336. package/dist/client/assets/{variant-matcher-override-DyHDH8Wv.js → variant-matcher-override-Dlsp2B8I.js} +1 -1
  337. package/dist/client/assets/{view-mode-toggle-Cr1ou40b.js → view-mode-toggle-BcLNRkIj.js} +1 -1
  338. package/dist/client/assets/{virtual-mcp-BvoWP1mU.js → virtual-mcp-KhrhV1xQ.js} +1 -1
  339. package/dist/client/index.html +1 -1
  340. package/dist/server/cli.js +59 -59
  341. package/dist/server/server.js +55 -55
  342. package/package.json +1 -1
  343. package/dist/client/assets/agent-app-DOZj_KNh.js +0 -1
  344. package/dist/client/assets/agent-assets-COVC5lPr.js +0 -1
  345. package/dist/client/assets/agent-automation-BWSPNjim.js +0 -20
  346. package/dist/client/assets/agent-deck-Ci4o3-Qm.js +0 -1
  347. package/dist/client/assets/agent-file-cFbD0OqV.js +0 -1
  348. package/dist/client/assets/agent-library-file-DXMpRwGw.js +0 -1
  349. package/dist/client/assets/agent-settings-BDT_wIMj.js +0 -1
  350. package/dist/client/assets/agent-site-editor-code-CaFMcCwi.js +0 -2
  351. package/dist/client/assets/agent-view-BOmW_Ep_.js +0 -1
  352. package/dist/client/assets/api-keys-C2lfrWiE.js +0 -1
  353. package/dist/client/assets/app-editor-Cbs0w-F0.js +0 -1
  354. package/dist/client/assets/category-editor-B984VME1.js +0 -1
  355. package/dist/client/assets/home-9LhFhaJr.js +0 -1
  356. package/dist/client/assets/mock-board-CLCjiMWY.js +0 -90
  357. package/dist/client/assets/post-calendar-DW1nVDLh.js +0 -1
  358. package/dist/client/assets/post-editor-C5j6zvkW.js +0 -1
  359. package/dist/client/assets/project-reports-BcpuMQY2.js +0 -1
  360. package/dist/client/assets/project-tasks-Cbu0gYbc.js +0 -1
  361. package/dist/client/assets/record-editor-CQeidmi2.js +0 -1
  362. package/dist/client/assets/redirect-editor-BL101gtT.js +0 -1
  363. package/dist/client/assets/registry-Dkgi61cL.js +0 -2
  364. package/dist/client/assets/reports-StG6MJZE.js +0 -1
  365. package/dist/client/assets/route-DJ7DRiHo.js +0 -1
  366. package/dist/client/assets/seo-editor-BEgFLCyp.js +0 -1
  367. package/dist/client/assets/skills-DZXynXjf.js +0 -1
  368. package/dist/client/assets/store-registry-mk4k386L.js +0 -2
  369. package/dist/client/assets/tasks-CwnRPaEK.js +0 -1
  370. package/dist/client/assets/useInfiniteQuery-TmIWCfQ-.js +0 -1
  371. package/dist/client/assets/useSuspenseInfiniteQuery-C8wrcyHJ.js +0 -1
  372. package/dist/client/assets/variant-calendar-DPR_CnEY.js +0 -1
@@ -1 +1 @@
1
- import{aC as v,aD as $,aE as W,aF as L,aG as H,aH as D,aI as V,aJ as x,aK as q,aL as j,aM as y,aN as N,aO as B,aP as F,aQ as Z}from"./index-C9jQATHx.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
1
+ import{aC as v,aD as $,aE as W,aF as L,aG as H,aH as D,aI as V,aJ as x,aK as q,aL as j,aM as y,aN as N,aO as B,aP as F,aQ as Z}from"./index-bq82HRdX.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
@@ -1 +1 @@
1
- import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-C9jQATHx.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
1
+ import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-bq82HRdX.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
@@ -1 +1 @@
1
- import{a as V,H as _e,r as v,e as me,o as z,j as t,l as N,B as xe,n as Be,m as Ve,K as ue,c as oe,b as be,h as Fe}from"./index-C9jQATHx.js";import{I as ee}from"./input-DCAbperr.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as He,R as Qe}from"./retry-i8LvYSZg.js";const Le={submitEmailPassword:({mode:n,email:e,password:m,name:f})=>n==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:n,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=_e(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,le=C.enabled&&(g||!y.enabled&&!se),de=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!le?S.providers:te,h=S.enabled&&de.length>0,_=C.enabled&&(g||!y.enabled&&!h),[b,F]=v.useState(""),[L,H]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[W,q]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,Q]=v.useState(""),[ye,ve]=v.useState(!1),[Te,he]=v.useState(null),i={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=W==="signUp",U=W==="forgotPassword",T=W==="emailOtp",ie=me({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?i.signUpFailed:i.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(i.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),z(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=me({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||i.resetEmailFailed);return l},onSuccess:()=>{z("password_reset_requested"),ve(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||i.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||i.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&Q(i.invalidEmail)},Re=s=>{if(s.preventDefault(),!ce(b)){Q(i.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:$})},De=s=>{if(s.preventDefault(),!ce(b)){Q(i.invalidEmail);return}re.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){Q(i.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===F&&j&&Q("")},ae=s=>{q(s),O(""),a(""),M(!1),Q(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,B=I?b.trim()&&L.trim()&&$.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?i.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?i.accountExists:l.includes("network")||l.includes("fetch")?i.networkError:l.includes("rate limit")||l.includes("429")?i.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?i.invalidOrExpiredCode:s.message||i.genericError},Pe=je||Ne||Ae||Te,Ue=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:n??e});if(l.error)throw new Error(l.error.message||i.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},$e=U?i.resetPasswordTitle:T&&x?i.verificationCodeTitle:m??i.welcomeTitle,Ce=U?i.resetPasswordSubtitle:T&&x?i.codeSentTo(b):f===void 0?i.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:$e}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:i.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{Ue(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),i.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(_||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:i.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:i.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.verifying:i.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:i.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:i.emailPlaceholder,value:b,onChange:X(F),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.sending:i.sendCode})]})}),U&&_&&!ye&&t.jsxs("form",{onSubmit:De,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(F),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!B,className:"w-full font-semibold",size:"xl",children:E?i.sending:i.sendResetLink})]}),!U&&!T&&_&&t.jsxs("form",{onSubmit:Re,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:i.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:i.namePlaceholder,value:$,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(F),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:i.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:i.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(H),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!B,className:N("w-full font-semibold"),size:"xl","aria-hidden":!B,children:E?I?i.creatingAccount:i.signingIn:i.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.backToSignIn}):T&&_?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&_?t.jsxs(t.Fragment,{children:[I?i.alreadyHaveAccount:i.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ge,children:I?i.signIn:i.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ge,children:i.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const n=Be(),e=ze(),m=Ve({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await fe()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,n]);async function C(){p(!0),r(null);try{const o=await fe();await o.performAuthLogin();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await fe();await o.performAuthLogout();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await fe()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function Xe(){return oe.c(10),Ge(),null}function Ze(n){const e=oe.c(25),{onContinue:m,isPending:f,error:p}=n,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(n){const e=oe.c(8),{label:m,error:f}=n;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Fe,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function tt({redirectTo:n,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await He(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof Qe&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(n))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[n]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(Oe,{})}function Oe(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(Fe,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function st({callbackURL:n,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:n});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,n]),t.jsx(Oe,{})}function ot(n){const e=oe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=n,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=_e(),h=Xe(),_=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const F=b,L=h?.actions;let H;e[2]!==F||e[3]!==L?(H={...Le,...F,...L},e[2]=F,e[3]=L,e[4]=H):H=e[4];const $=H;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(de&&S){let a;return e[15]!==w||e[16]!==_?(a=t.jsx(tt,{redirectTo:_,onAuthEvent:w}),e[15]=w,e[16]=_,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==_||e[20]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:_,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=_,e[20]=$.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:le,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||le.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==F||e[28]!==L?(x={...F,...L},e[27]=F,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const W=M;if(!a)return W;let q;e[42]!==a?(q=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=q):q=e[43];let j;return e[44]!==W||e[45]!==q?(j=t.jsxs("div",{className:"grid gap-4",children:[q,W]}),e[44]=W,e[45]=q,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{Oe as A,ot as a,Ge as u};
1
+ import{a as V,H as _e,r as v,e as me,o as z,j as t,l as N,B as xe,n as Be,m as Ve,K as ue,c as oe,b as be,h as Fe}from"./index-bq82HRdX.js";import{I as ee}from"./input-DYrUDn-6.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as He,R as Qe}from"./retry-i8LvYSZg.js";const Le={submitEmailPassword:({mode:n,email:e,password:m,name:f})=>n==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:n,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=_e(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,le=C.enabled&&(g||!y.enabled&&!se),de=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!le?S.providers:te,h=S.enabled&&de.length>0,_=C.enabled&&(g||!y.enabled&&!h),[b,F]=v.useState(""),[L,H]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[W,q]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,Q]=v.useState(""),[ye,ve]=v.useState(!1),[Te,he]=v.useState(null),i={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=W==="signUp",U=W==="forgotPassword",T=W==="emailOtp",ie=me({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?i.signUpFailed:i.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(i.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),z(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=me({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||i.resetEmailFailed);return l},onSuccess:()=>{z("password_reset_requested"),ve(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||i.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||i.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&Q(i.invalidEmail)},Re=s=>{if(s.preventDefault(),!ce(b)){Q(i.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:$})},De=s=>{if(s.preventDefault(),!ce(b)){Q(i.invalidEmail);return}re.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){Q(i.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===F&&j&&Q("")},ae=s=>{q(s),O(""),a(""),M(!1),Q(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,B=I?b.trim()&&L.trim()&&$.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?i.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?i.accountExists:l.includes("network")||l.includes("fetch")?i.networkError:l.includes("rate limit")||l.includes("429")?i.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?i.invalidOrExpiredCode:s.message||i.genericError},Pe=je||Ne||Ae||Te,Ue=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:n??e});if(l.error)throw new Error(l.error.message||i.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},$e=U?i.resetPasswordTitle:T&&x?i.verificationCodeTitle:m??i.welcomeTitle,Ce=U?i.resetPasswordSubtitle:T&&x?i.codeSentTo(b):f===void 0?i.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:$e}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:i.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{Ue(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),i.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(_||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:i.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:i.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.verifying:i.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:i.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:i.emailPlaceholder,value:b,onChange:X(F),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.sending:i.sendCode})]})}),U&&_&&!ye&&t.jsxs("form",{onSubmit:De,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(F),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!B,className:"w-full font-semibold",size:"xl",children:E?i.sending:i.sendResetLink})]}),!U&&!T&&_&&t.jsxs("form",{onSubmit:Re,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:i.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:i.namePlaceholder,value:$,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(F),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:i.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:i.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(H),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!B,className:N("w-full font-semibold"),size:"xl","aria-hidden":!B,children:E?I?i.creatingAccount:i.signingIn:i.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.backToSignIn}):T&&_?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&_?t.jsxs(t.Fragment,{children:[I?i.alreadyHaveAccount:i.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ge,children:I?i.signIn:i.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ge,children:i.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const n=Be(),e=ze(),m=Ve({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await fe()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,n]);async function C(){p(!0),r(null);try{const o=await fe();await o.performAuthLogin();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await fe();await o.performAuthLogout();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await fe()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function Xe(){return oe.c(10),Ge(),null}function Ze(n){const e=oe.c(25),{onContinue:m,isPending:f,error:p}=n,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(n){const e=oe.c(8),{label:m,error:f}=n;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Fe,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function tt({redirectTo:n,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await He(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof Qe&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(n))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[n]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(Oe,{})}function Oe(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(Fe,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function st({callbackURL:n,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:n});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,n]),t.jsx(Oe,{})}function ot(n){const e=oe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=n,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=_e(),h=Xe(),_=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const F=b,L=h?.actions;let H;e[2]!==F||e[3]!==L?(H={...Le,...F,...L},e[2]=F,e[3]=L,e[4]=H):H=e[4];const $=H;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(de&&S){let a;return e[15]!==w||e[16]!==_?(a=t.jsx(tt,{redirectTo:_,onAuthEvent:w}),e[15]=w,e[16]=_,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==_||e[20]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:_,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=_,e[20]=$.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:le,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||le.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==F||e[28]!==L?(x={...F,...L},e[27]=F,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const W=M;if(!a)return W;let q;e[42]!==a?(q=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=q):q=e[43];let j;return e[44]!==W||e[45]!==q?(j=t.jsxs("div",{className:"grid gap-4",children:[q,W]}),e[44]=W,e[45]=q,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{Oe as A,ot as a,Ge as u};
@@ -1 +1 @@
1
- import{c as g,l as p,j as f}from"./index-C9jQATHx.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
1
+ import{c as g,l as p,j as f}from"./index-bq82HRdX.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
@@ -1 +1 @@
1
- import"./index-C9jQATHx.js";import{i as u,a as p}from"./mcp-oauth-Cj16tOMc.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
1
+ import"./index-bq82HRdX.js";import{i as u,a as p}from"./mcp-oauth-lrCnpZRU.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
@@ -1 +1 @@
1
- import{c as G,b as J,r as U,l as W,j as t,B as X}from"./index-C9jQATHx.js";import{A as Y,a as Z,b as ee,c as te,g as se,d as ie,e as ne,f as oe}from"./alert-dialog-BcLnZa7A.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-BzAnwSL0.js";import{A as me,a8 as ue}from"./agent-icon-CL_nl9mo.js";import{i as de}from"./DotsVertical-DEpQR8Rs.js";import{s as fe}from"./Trash01-DwLqZ5iv.js";import{i as ge}from"./Zap-FJBBk1lb.js";import{a as xe}from"./use-virtual-mcp-De5-1hZU.js";import{a as pe}from"./use-automations-D8fUWM0i.js";function Le(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(fe,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Le as A};
1
+ import{c as G,b as J,r as U,l as W,j as t,B as X}from"./index-bq82HRdX.js";import{A as Y,a as Z,b as ee,c as te,g as se,d as ie,e as ne,f as oe}from"./alert-dialog-BQcocmj1.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-Cg7EtBKr.js";import{A as me,a8 as ue}from"./agent-icon-TqAwQbws.js";import{i as de}from"./DotsVertical-wpNLDjEw.js";import{s as fe}from"./Trash01-CeNVn9va.js";import{i as ge}from"./Zap-cGv6CHKy.js";import{a as xe}from"./use-virtual-mcp-Dd6It4Gy.js";import{a as pe}from"./use-automations-B1g8BCjF.js";function Le(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(fe,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Le as A};
@@ -1 +1 @@
1
- import{c as B,r as lt,b as X,M as it,x as rt,_ as ct,K as tt,j as s,l as ut,m as dt,eD as mt}from"./index-C9jQATHx.js";import{u as ft}from"./useInfiniteQuery-TmIWCfQ-.js";import{u as xt}from"./use-connection-1DEAzFaJ.js";import{u as pt}from"./use-mcp-client-2uEIRhaM.js";import{b as gt}from"./use-virtual-mcp-De5-1hZU.js";import{b as ht,a as Rt}from"./sheet-CAYJdNnO.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-Dk8JamWN.js";import{E as et}from"./empty-state-F709JYnF.js";import{u as Tt}from"./use-infinite-scroll-C3V6bChR.js";import{a as St}from"./use-members-B9Bp6K2N.js";import{g as vt}from"./task-status-DYV2rHq2.js";import{e as wt}from"./use-automations-D8fUWM0i.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-CXERmuvO.js";function It(c){const t=B.c(15),[i,r]=lt.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,o=a!==-1?c[a]:null,n=o!==null;let l,w;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=u=>r(u),w=()=>r(null),t[3]=l,t[4]=w):(l=t[3],w=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let m;return t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==f||t[13]!==x?(m={selected:o,index:a,isOpen:n,select:l,close:w,prev:f,next:x},t[9]=a,t[10]=o,t[11]=n,t[12]=f,t[13]=x,t[14]=m):m=t[14],m}const W=50;function Y(c){const t=B.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let o;t[2]!==r?(o=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=o):o=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let l;return t[6]!==a||t[7]!==o||t[8]!==n?(l=s.jsxs(mt,{className:"pt-4 px-4 pb-5 gap-1",children:[a,o,n]}),t[6]=a,t[7]=o,t[8]=n,t[9]=l):l=t[9],l}function kt(c){const t=B.c(45),{automationId:i,range:r}=c,e=X(),{data:a,isLoading:o}=wt(i,r),n=a?.runs,l=a?.usage;let w;t[0]!==n?(w=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=w):w=t[1];const f=w;let x;t[2]!==e||t[3]!==l?(x=l&&l.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:l.sampledRuns}):void 0,t[2]=e,t[3]=l,t[4]=x):x=t[4];const m=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==o||t[8]!==n?.total?(g=o?"…":n?.total.toLocaleString()??"0",t[7]=o,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(Y,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const k=o?"…":f;let C;t[19]!==T||t[20]!==k?(C=s.jsx(Y,{title:T,value:k}),t[19]=T,t[20]=k,t[21]=C):C=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==o||t[25]!==l?.totalTokens?(p=o?"…":at(l?.totalTokens??0),t[24]=o,t[25]=l?.totalTokens,t[26]=p):p=t[26];let I;t[27]!==S||t[28]!==p||t[29]!==m?(I=s.jsx(Y,{title:S,value:p,subtitle:m}),t[27]=S,t[28]=p,t[29]=m,t[30]=I):I=t[30];let d;t[31]!==e?(d=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=d):d=t[32];let j;t[33]!==o||t[34]!==l?(j=o?"…":l&&l.costUsd>0?nt(l.costUsd):"—",t[33]=o,t[34]=l,t[35]=j):j=t[35];let v;t[36]!==d||t[37]!==j||t[38]!==m?(v=s.jsx(Y,{title:d,value:j,subtitle:m}),t[36]=d,t[37]=j,t[38]=m,t[39]=v):v=t[39];let N;return t[40]!==I||t[41]!==v||t[42]!==R||t[43]!==C?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,C,I,v]}),t[40]=I,t[41]=v,t[42]=R,t[43]=C,t[44]=N):N=t[44],N}function yt(c){const t=B.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,o=X();let n,l;if(t[0]!==i.created_at){const P=new Date(i.created_at);n=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=l}else n=t[1],l=t[2];const w=l;let f,x,m,u,g,h,R,T,k,C,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==o){const P=vt(i.status),U=P.icon;x=st,k=a,C="h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",S=e,t[19]!==i.title?(m=s.jsx(V,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=m):m=t[20],f=V,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:P.iconClassName}),u=ut("text-sm",P.labelColor),g=o(P.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=o,t[8]=f,t[9]=x,t[10]=m,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=k,t[17]=C,t[18]=S}else f=t[8],x=t[9],m=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],k=t[16],C=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let I;t[24]!==p||t[25]!==h||t[26]!==R?(I=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=I):I=t[27];let d;t[28]!==f||t[29]!==I||t[30]!==T?(d=s.jsx(f,{className:T,children:I}),t[28]=f,t[29]=I,t[30]=T,t[31]=d):d=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let y;t[38]!==N?(y=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=y):y=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let _;t[42]!==w?(_=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:w}),t[42]=w,t[43]=_):_=t[43];let E;t[44]!==D||t[45]!==_?(E=s.jsxs(V,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,_]}),t[44]=D,t[45]=_,t[46]=E):E=t[46];let M;return t[47]!==x||t[48]!==m||t[49]!==d||t[50]!==v||t[51]!==y||t[52]!==E||t[53]!==k||t[54]!==C||t[55]!==S?(M=s.jsxs(x,{ref:k,className:C,onClick:S,children:[m,d,v,y,E]}),t[47]=x,t[48]=m,t[49]=d,t[50]=v,t[51]=y,t[52]=E,t[53]=k,t[54]=C,t[55]=S,t[56]=M):M=t[56],M}function Qt(c){const t=B.c(73),{automationId:i,triggerIds:r,range:e}=c,a=X(),{org:o,locator:n}=it();let l;t[0]!==o.id||t[1]!==o.slug?(l={connectionId:rt,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=l):l=t[2];const w=pt(l),f=ct(),x=xt(),m=gt(),{data:u}=St(),g=r.length>0;let h;t[3]!==i||t[4]!==o.id||t[5]!==r?(h=tt.automationRuns(o.id,i,r),t[3]=i,t[4]=o.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async $=>{const{pageParam:J}=$,ot=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:W,offset:ot,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:k,fetchNextPage:C,hasNextPage:S,isFetchingNextPage:p,isLoading:I}=ft(T);let d,j,v,N;t[14]!==k?.pages||t[15]!==n||t[16]!==e?(d=(k?.pages??[]).flatMap(Dt),N=d.map(Pt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=k?.pages,t[15]=n,t[16]=e,t[17]=d,t[18]=j,t[19]=v,t[20]=N):(d=t[17],j=t[18],v=t[19],N=t[20]);let y;t[21]!==e||t[22]!==f||t[23]!==N?(y=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=y):y=t[24];const D=N.length>0;let _;t[25]!==j||t[26]!==y||t[27]!==D?(_={queryKey:j,queryFn:y,enabled:D,staleTime:3e4},t[25]=j,t[26]=y,t[27]=D,t[28]=_):_=t[28];const{data:E}=v(_);let M;t[29]!==E?.items?(M=new Map((E?.items??[]).map(_t)),t[29]=E?.items,t[30]=M):M=t[30];const P=M;let U;t[31]!==C||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&C()},t[31]=C,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Z=Tt(U,S??!1,p),b=It(d),Q=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(kt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==I||t[40]!==Z||t[41]!==d||t[42]!==b||t[43]!==a||t[44]!==P?(O=g?I?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):d.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(jt,{className:"w-full border-collapse",children:[s.jsx(Nt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(bt,{children:d.map(($,J)=>s.jsx(yt,{run:$,usage:P.get($.id),onClick:()=>b.select($.id),lastRowRef:J===d.length-1?Z:void 0},$.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=I,t[40]=Z,t[41]=d,t[42]=b,t[43]=a,t[44]=P,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=$=>{$||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==m||t[53]!==w||t[54]!==n||t[55]!==u||t[56]!==d||t[57]!==Q||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=Q&&s.jsx(Ct,{thread:Q,client:w,locator:n,connections:x,virtualMcps:m,members:u,nav:{index:b.index,total:d.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=m,t[53]=w,t[54]=n,t[55]=u,t[56]=d,t[57]=Q,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(Rt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(ht,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let z;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(z=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=z):z=t[72],z}function _t(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function Pt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<W))return r.length*W}export{Qt as A,It as u};
1
+ import{c as B,r as lt,b as X,M as it,x as rt,_ as ct,K as tt,j as s,l as ut,m as dt,eC as mt}from"./index-bq82HRdX.js";import{u as ft}from"./useInfiniteQuery-jh1wgrcQ.js";import{u as xt}from"./use-connection-D_iAIgTV.js";import{u as pt}from"./use-mcp-client-oEME4UuR.js";import{b as gt}from"./use-virtual-mcp-Dd6It4Gy.js";import{b as ht,a as Rt}from"./sheet-XW3igMAp.js";import{e as jt,a as Nt,b as st,T as G,d as bt,c as V}from"./table-vs5PY6MV.js";import{E as et}from"./empty-state-B73golk2.js";import{u as Tt}from"./use-infinite-scroll-CqfaxXN1.js";import{a as St}from"./use-members-69QDyex7.js";import{g as vt}from"./task-status-DsfqndTm.js";import{e as wt}from"./use-automations-B1g8BCjF.js";import{T as Ct,f as at,a as nt}from"./thread-sheet-body-qD1pkorX.js";function It(c){const t=B.c(15),[i,r]=lt.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,o=a!==-1?c[a]:null,n=o!==null;let l,w;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=u=>r(u),w=()=>r(null),t[3]=l,t[4]=w):(l=t[3],w=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let m;return t[9]!==a||t[10]!==o||t[11]!==n||t[12]!==f||t[13]!==x?(m={selected:o,index:a,isOpen:n,select:l,close:w,prev:f,next:x},t[9]=a,t[10]=o,t[11]=n,t[12]=f,t[13]=x,t[14]=m):m=t[14],m}const W=50;function Y(c){const t=B.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let o;t[2]!==r?(o=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=o):o=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let l;return t[6]!==a||t[7]!==o||t[8]!==n?(l=s.jsxs(mt,{className:"pt-4 px-4 pb-5 gap-1",children:[a,o,n]}),t[6]=a,t[7]=o,t[8]=n,t[9]=l):l=t[9],l}function kt(c){const t=B.c(45),{automationId:i,range:r}=c,e=X(),{data:a,isLoading:o}=wt(i,r),n=a?.runs,l=a?.usage;let w;t[0]!==n?(w=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=w):w=t[1];const f=w;let x;t[2]!==e||t[3]!==l?(x=l&&l.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:l.sampledRuns}):void 0,t[2]=e,t[3]=l,t[4]=x):x=t[4];const m=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==o||t[8]!==n?.total?(g=o?"…":n?.total.toLocaleString()??"0",t[7]=o,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(Y,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const k=o?"…":f;let C;t[19]!==T||t[20]!==k?(C=s.jsx(Y,{title:T,value:k}),t[19]=T,t[20]=k,t[21]=C):C=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==o||t[25]!==l?.totalTokens?(p=o?"…":at(l?.totalTokens??0),t[24]=o,t[25]=l?.totalTokens,t[26]=p):p=t[26];let I;t[27]!==S||t[28]!==p||t[29]!==m?(I=s.jsx(Y,{title:S,value:p,subtitle:m}),t[27]=S,t[28]=p,t[29]=m,t[30]=I):I=t[30];let d;t[31]!==e?(d=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=d):d=t[32];let j;t[33]!==o||t[34]!==l?(j=o?"…":l&&l.costUsd>0?nt(l.costUsd):"—",t[33]=o,t[34]=l,t[35]=j):j=t[35];let v;t[36]!==d||t[37]!==j||t[38]!==m?(v=s.jsx(Y,{title:d,value:j,subtitle:m}),t[36]=d,t[37]=j,t[38]=m,t[39]=v):v=t[39];let N;return t[40]!==I||t[41]!==v||t[42]!==R||t[43]!==C?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,C,I,v]}),t[40]=I,t[41]=v,t[42]=R,t[43]=C,t[44]=N):N=t[44],N}function yt(c){const t=B.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,o=X();let n,l;if(t[0]!==i.created_at){const P=new Date(i.created_at);n=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=l}else n=t[1],l=t[2];const w=l;let f,x,m,u,g,h,R,T,k,C,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==o){const P=vt(i.status),U=P.icon;x=st,k=a,C="h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",S=e,t[19]!==i.title?(m=s.jsx(V,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=m):m=t[20],f=V,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:P.iconClassName}),u=ut("text-sm",P.labelColor),g=o(P.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=o,t[8]=f,t[9]=x,t[10]=m,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=k,t[17]=C,t[18]=S}else f=t[8],x=t[9],m=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],k=t[16],C=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let I;t[24]!==p||t[25]!==h||t[26]!==R?(I=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=I):I=t[27];let d;t[28]!==f||t[29]!==I||t[30]!==T?(d=s.jsx(f,{className:T,children:I}),t[28]=f,t[29]=I,t[30]=T,t[31]=d):d=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let y;t[38]!==N?(y=s.jsx(V,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=y):y=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let _;t[42]!==w?(_=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:w}),t[42]=w,t[43]=_):_=t[43];let E;t[44]!==D||t[45]!==_?(E=s.jsxs(V,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,_]}),t[44]=D,t[45]=_,t[46]=E):E=t[46];let M;return t[47]!==x||t[48]!==m||t[49]!==d||t[50]!==v||t[51]!==y||t[52]!==E||t[53]!==k||t[54]!==C||t[55]!==S?(M=s.jsxs(x,{ref:k,className:C,onClick:S,children:[m,d,v,y,E]}),t[47]=x,t[48]=m,t[49]=d,t[50]=v,t[51]=y,t[52]=E,t[53]=k,t[54]=C,t[55]=S,t[56]=M):M=t[56],M}function Qt(c){const t=B.c(73),{automationId:i,triggerIds:r,range:e}=c,a=X(),{org:o,locator:n}=it();let l;t[0]!==o.id||t[1]!==o.slug?(l={connectionId:rt,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=l):l=t[2];const w=pt(l),f=ct(),x=xt(),m=gt(),{data:u}=St(),g=r.length>0;let h;t[3]!==i||t[4]!==o.id||t[5]!==r?(h=tt.automationRuns(o.id,i,r),t[3]=i,t[4]=o.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async $=>{const{pageParam:J}=$,ot=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:W,offset:ot,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:k,fetchNextPage:C,hasNextPage:S,isFetchingNextPage:p,isLoading:I}=ft(T);let d,j,v,N;t[14]!==k?.pages||t[15]!==n||t[16]!==e?(d=(k?.pages??[]).flatMap(Dt),N=d.map(Pt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=k?.pages,t[15]=n,t[16]=e,t[17]=d,t[18]=j,t[19]=v,t[20]=N):(d=t[17],j=t[18],v=t[19],N=t[20]);let y;t[21]!==e||t[22]!==f||t[23]!==N?(y=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=y):y=t[24];const D=N.length>0;let _;t[25]!==j||t[26]!==y||t[27]!==D?(_={queryKey:j,queryFn:y,enabled:D,staleTime:3e4},t[25]=j,t[26]=y,t[27]=D,t[28]=_):_=t[28];const{data:E}=v(_);let M;t[29]!==E?.items?(M=new Map((E?.items??[]).map(_t)),t[29]=E?.items,t[30]=M):M=t[30];const P=M;let U;t[31]!==C||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&C()},t[31]=C,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Z=Tt(U,S??!1,p),b=It(d),Q=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(kt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==I||t[40]!==Z||t[41]!==d||t[42]!==b||t[43]!==a||t[44]!==P?(O=g?I?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):d.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(jt,{className:"w-full border-collapse",children:[s.jsx(Nt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(bt,{children:d.map(($,J)=>s.jsx(yt,{run:$,usage:P.get($.id),onClick:()=>b.select($.id),lastRowRef:J===d.length-1?Z:void 0},$.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=I,t[40]=Z,t[41]=d,t[42]=b,t[43]=a,t[44]=P,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=$=>{$||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==m||t[53]!==w||t[54]!==n||t[55]!==u||t[56]!==d||t[57]!==Q||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=Q&&s.jsx(Ct,{thread:Q,client:w,locator:n,connections:x,virtualMcps:m,members:u,nav:{index:b.index,total:d.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=m,t[53]=w,t[54]=n,t[55]=u,t[56]=d,t[57]=Q,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(Rt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(ht,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let z;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(z=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=z):z=t[72],z}function _t(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function Pt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<W))return r.length*W}export{Qt as A,It as u};
@@ -1 +1 @@
1
- import{c as k,j as o,b as M,M as $,d as D,r as q,P as d,B as V,fp as F,o as R}from"./index-C9jQATHx.js";import{s as G}from"./Plus-B6iViyXP.js";import{i as S}from"./Zap-FJBBk1lb.js";import{S as H}from"./search-input-B9FxoKon.js";import{E as T}from"./empty-state-F709JYnF.js";import{u as J}from"./use-automations-D8fUWM0i.js";import{u as K}from"./use-navigate-to-agent-D91bju80.js";import{A as O}from"./automation-list-row-CpdfZzhf.js";import{b as Q}from"./use-virtual-mcp-De5-1hZU.js";import{R as U}from"./require-capability-DjYcyxbJ.js";import"./SearchMd-BFooCWLz.js";import"./use-mcp-client-2uEIRhaM.js";import"./auth-DqeCOVzg.js";import"./hooks-DW28Wv6W.js";import"./backoff-8mStPHYB.js";import"./task-board-WxptS5oC.js";import"./schema-DLCqAhaO.js";import"./thread-intent-Dqbb6tX6.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./alert-dialog-BcLnZa7A.js";import"./dropdown-menu-BzAnwSL0.js";import"./Check-HvrCGvlV.js";import"./ChevronRight-dkkIYuGe.js";import"./DotsVertical-DEpQR8Rs.js";import"./agent-icon-CL_nl9mo.js";import"./AlertCircle-CMdkAjxQ.js";import"./Tool01-DekOr9OW.js";import"./ArrowUp-Bx3jqyJU.js";import"./ArrowLeft-DGJWLWaL.js";import"./Tool02-CgXadMFZ.js";import"./ArrowRight-D_1DZN2N.js";import"./TrendUp01-BJ6ZxGib.js";import"./ZoomOut-DR5p3Py1.js";import"./Users03-CBIUviMz.js";import"./CheckCircle-CQTpywHl.js";import"./ChevronUp-BANcOZ09.js";import"./UserSquare-DO483pcO.js";import"./Copy01-D4tr9F1r.js";import"./CreditCard01-CX8hLF54.js";import"./Database01-C6v3VKBC.js";import"./MessageCircle01-DrVOv17x.js";import"./Download01-G8ZhNqF3.js";import"./Printer-1AF1IGx9.js";import"./Settings02-11lXkxuh.js";import"./Eye-wRiP-IKY.js";import"./File02-C5Axd7Wg.js";import"./Share07-2izyqHpD.js";import"./GitBranch01-xiI7ahmy.js";import"./Globe01-BJfrzyV2.js";import"./SwitchHorizontal01-Chrl4_cZ.js";import"./HardDrive-BtlNN50l.js";import"./Image01-ZQpSr40Q.js";import"./Key01-TUQZiePT.js";import"./Link01-Dubdh0XV.js";import"./LinkExternal01-DsoIvXMf.js";import"./Monitor01-8akol8yD.js";import"./Sun-DqCbyuBS.js";import"./Package-6pCyxdj-.js";import"./Palette-8_jSprTt.js";import"./Play-B2WDpGm-.js";import"./SearchLg-o3jjSP_H.js";import"./Shield01-C_NSoVzs.js";import"./Stars01-dQ6_BPZ3.js";import"./Trash01-DwLqZ5iv.js";import"./Upload01-zIaNWjGg.js";import"./User01-Cuc8TQ2e.js";import"./Users01-C_FX7NZW.js";import"./XCircle-CIpucXWN.js";import"./XClose-D9lEUPrO.js";import"./X-BbEHf0ox.js";import"./access-gate-BGLq5_fD.js";import"./capability-load-error-JtYpAIDC.js";function W(){const t=k.c(20),e=M(),{org:l}=$(),{data:y}=J(void 0),g=y===void 0?[]:y,P=Q(),E=K(),f=D(),[x,z]=q.useState(""),h=x.toLowerCase(),b=new Map(P.map(X)),A=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=b.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),B=(i,p)=>{const N=p&&b.has(p)?p:F(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),E(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,j=d,C=d,v=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const w=g.length>0&&o.jsx(H,{value:x,onChange:z,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==w?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,w]}),t[7]=r,t[8]=w,t[9]=m):m=t[9];const _=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(V,{size:"sm",onClick:L,children:[o.jsx(G,{size:14}),e("settings.automations.browseAgentsButton")]})})}):A.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:A.map(i=>o.jsx(O,{automation:i,showAgent:!0,onClick:()=>B(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==v.Container||t[11]!==m||t[12]!==_?(n=o.jsxs(v.Container,{children:[m,_]}),t[10]=v.Container,t[11]=m,t[12]=_,t[13]=n):n=t[13];let a;t[14]!==C.Content||t[15]!==n?(a=o.jsx(C.Content,{children:n}),t[14]=C.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function ho(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{ho as default};
1
+ import{c as k,j as o,b as M,M as $,d as D,r as q,P as d,B as V,fp as F,o as R}from"./index-bq82HRdX.js";import{s as G}from"./Plus-B76Mdzta.js";import{i as S}from"./Zap-cGv6CHKy.js";import{S as H}from"./search-input-BFvnqi9T.js";import{E as T}from"./empty-state-B73golk2.js";import{u as J}from"./use-automations-B1g8BCjF.js";import{u as K}from"./use-navigate-to-agent-DxF2NRC6.js";import{A as O}from"./automation-list-row-CDBc0L1r.js";import{b as Q}from"./use-virtual-mcp-Dd6It4Gy.js";import{R as U}from"./require-capability-Dq_uftSz.js";import"./SearchMd-Cz88FNXR.js";import"./use-mcp-client-oEME4UuR.js";import"./auth-CZC2Ujtf.js";import"./hooks-CY6XZOHF.js";import"./backoff-8mStPHYB.js";import"./task-board-NCKWK-L3.js";import"./schema-Difu_0cd.js";import"./thread-intent-BBez6nif.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./alert-dialog-BQcocmj1.js";import"./dropdown-menu-Cg7EtBKr.js";import"./Check-BrCocVFB.js";import"./ChevronRight-B8w28Rs0.js";import"./DotsVertical-wpNLDjEw.js";import"./agent-icon-TqAwQbws.js";import"./AlertCircle-_dpPH4gp.js";import"./Tool01-txvCBUcI.js";import"./ArrowUp-D3IJVwy-.js";import"./ArrowLeft-D5BILPql.js";import"./Tool02-DUdKhOIL.js";import"./ArrowRight-CeIfu-_Z.js";import"./TrendUp01-pvT8-WFv.js";import"./ZoomOut-kKuBc-4q.js";import"./Users03-CKweEAHJ.js";import"./CheckCircle-BC0FabXU.js";import"./ChevronUp-BZtOj4Ay.js";import"./UserSquare-VWJ4b2Nu.js";import"./Copy01-8HlwnVL4.js";import"./CreditCard01-BuU2-7Xz.js";import"./Database01-CbAnK_KP.js";import"./MessageCircle01-CjlDn3qL.js";import"./Download01-DGABlNWv.js";import"./Printer-CilcBFsl.js";import"./Settings02-DCxh89vV.js";import"./Eye-DXMWNy9I.js";import"./File02-6XspF3iG.js";import"./Share07-CNlETPcr.js";import"./GitBranch01-DdWI6T46.js";import"./Globe01-LbDP9lO6.js";import"./SwitchHorizontal01-DDZJCKkC.js";import"./HardDrive-DtG-DEiB.js";import"./Image01-rPrP47_j.js";import"./Key01-CJUZ2anZ.js";import"./Link01-B0bN5v1C.js";import"./LinkExternal01-k2QYzvNX.js";import"./Monitor01-BWhdvhYh.js";import"./Sun-BukuAUTA.js";import"./Package-CUFEWgH0.js";import"./Palette-D8sq7zSJ.js";import"./Play-CaXzttX1.js";import"./SearchLg-UbmzRtIb.js";import"./Shield01-UHqavRD7.js";import"./Stars01-BPm_Roon.js";import"./Trash01-CeNVn9va.js";import"./Upload01-CdWOLhzl.js";import"./User01-BFd06Lzl.js";import"./Users01-CSkRDmMq.js";import"./XCircle-CRFE9Sxc.js";import"./XClose-nb8sU8Mf.js";import"./X-Ch9pdqUF.js";import"./access-gate-Dna5j1xg.js";import"./capability-load-error-DsSoc04a.js";function W(){const t=k.c(20),e=M(),{org:l}=$(),{data:y}=J(void 0),g=y===void 0?[]:y,P=Q(),E=K(),f=D(),[x,z]=q.useState(""),h=x.toLowerCase(),b=new Map(P.map(X)),A=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=b.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),B=(i,p)=>{const N=p&&b.has(p)?p:F(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),E(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,j=d,C=d,v=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const w=g.length>0&&o.jsx(H,{value:x,onChange:z,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==w?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,w]}),t[7]=r,t[8]=w,t[9]=m):m=t[9];const _=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(V,{size:"sm",onClick:L,children:[o.jsx(G,{size:14}),e("settings.automations.browseAgentsButton")]})})}):A.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:A.map(i=>o.jsx(O,{automation:i,showAgent:!0,onClick:()=>B(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==v.Container||t[11]!==m||t[12]!==_?(n=o.jsxs(v.Container,{children:[m,_]}),t[10]=v.Container,t[11]=m,t[12]=_,t[13]=n):n=t[13];let a;t[14]!==C.Content||t[15]!==n?(a=o.jsx(C.Content,{children:n}),t[14]=C.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function ho(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{ho as default};
@@ -1 +1 @@
1
- import{J as d}from"./index-C9jQATHx.js";const m=1e4,y="true",i=2;function a(t,n){return d.chatAutosend(t,n)}function l(t){return t==="pending"||t==="sending"}function f(t){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!="object")return null;const e=n;let o=0;e.status==="sending"?o=e.retryAt===void 0?1:i:e.retryAt!==void 0&&(o=1);const r=e.attempt===void 0?o:e.attempt;return typeof e.createdAt!="number"||typeof e.message!="object"||!l(e.status)||e.retryAt!==void 0&&typeof e.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>i?null:{...n,attempt:r}}function S(t,n,e,o,r=Date.now()){const s={message:o,createdAt:r,status:"pending",attempt:0};return t.setItem(a(n,e),JSON.stringify(s)),s}function p(t,n,e){const o=a(n,e),r=f(t.getItem(o));return r||(t.removeItem(o),null)}function g(t,n,e,o=Date.now()){const r=a(n,e),s=p(t,n,e);if(!s||s.status!=="pending")return null;if(s.attempt>=i)return t.removeItem(r),null;const c=s.retryAt??s.createdAt;if(o-c>=m)return t.removeItem(r),null;const u={...s,status:"sending",attempt:s.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function T(t,n,e){t.removeItem(a(n,e))}export{y as A,T as a,g as c,S as w};
1
+ import{J as d}from"./index-bq82HRdX.js";const m=1e4,y="true",i=2;function a(t,n){return d.chatAutosend(t,n)}function l(t){return t==="pending"||t==="sending"}function f(t){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!="object")return null;const e=n;let o=0;e.status==="sending"?o=e.retryAt===void 0?1:i:e.retryAt!==void 0&&(o=1);const r=e.attempt===void 0?o:e.attempt;return typeof e.createdAt!="number"||typeof e.message!="object"||!l(e.status)||e.retryAt!==void 0&&typeof e.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>i?null:{...n,attempt:r}}function S(t,n,e,o,r=Date.now()){const s={message:o,createdAt:r,status:"pending",attempt:0};return t.setItem(a(n,e),JSON.stringify(s)),s}function p(t,n,e){const o=a(n,e),r=f(t.getItem(o));return r||(t.removeItem(o),null)}function g(t,n,e,o=Date.now()){const r=a(n,e),s=p(t,n,e);if(!s||s.status!=="pending")return null;if(s.attempt>=i)return t.removeItem(r),null;const c=s.retryAt??s.createdAt;if(o-c>=m)return t.removeItem(r),null;const u={...s,status:"sending",attempt:s.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function T(t,n,e){t.removeItem(a(n,e))}export{y as A,T as a,g as c,S as w};
@@ -1 +1 @@
1
- import{c as k,j as i,l as m,aq as C,aR as V,aS as I,aT as $}from"./index-C9jQATHx.js";import{s as O}from"./User01-Cuc8TQ2e.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],T="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function L(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const S=C("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=C("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=T;break e}if(typeof t=="string"){let c;e[11]!==t?(c=L(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=R[0]}const z=y;let q;e[13]!==l?(q=l?.startsWith("icon://"),e[13]=l,e[14]=q):q=e[14];const p=q;let N;e[15]!==p||e[16]!==l?(N=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=N):N=e[17];const F=N;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function B(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(W,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
1
+ import{c as k,j as i,l as m,aq as C,aR as V,aS as I,aT as $}from"./index-bq82HRdX.js";import{s as O}from"./User01-BFd06Lzl.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],T="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function L(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const S=C("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=C("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=T;break e}if(typeof t=="string"){let c;e[11]!==t?(c=L(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=R[0]}const z=y;let q;e[13]!==l?(q=l?.startsWith("icon://"),e[13]=l,e[14]=q):q=e[14];const p=q;let N;e[15]!==p||e[16]!==l?(N=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=N):N=e[17];const F=N;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function B(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(W,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
@@ -1 +1 @@
1
- import{c as l,l as u,j as g,aU as v,aq as b}from"./index-C9jQATHx.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none 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 transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
1
+ import{c as l,l as u,j as g,aU as v,aq as b}from"./index-bq82HRdX.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none 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 transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};