decocms 4.280.0 → 4.280.2

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 (227) hide show
  1. package/dist/client/assets/{AlertCircle-CkPwmuKt.js → AlertCircle-q-ha89N3.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CAeU7k3C.js → AreaChart-DJcPJJSF.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Cj7J7Py6.js → ArrowLeft-BAk90rdd.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BACYFmW2.js → ArrowUp-BAyh6hn8.js} +1 -1
  5. package/dist/client/assets/{Check-C7msqNgq.js → Check-8BnM7tpC.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-Byfr8GRo.js → CheckCircle-COyRqpAc.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BqUHNjui.js → ChevronDown-BDPQaZqS.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-KbHVuEl0.js → ChevronRight-BoCweSJs.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-C-TawfyU.js → ChevronSelectorVertical-CbFyIO58.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-DFNYR7MJ.js → ChevronUp-Ce84NoHt.js} +1 -1
  11. package/dist/client/assets/{Copy01-C4YK8X63.js → Copy01-zUJb2qyi.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-CTvH4Ctz.js → CreditCard01-Dd3kG7iY.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-BP5Z780D.js → DotsVertical-1JhgmWFz.js} +1 -1
  14. package/dist/client/assets/{Download01-qJq3S2UO.js → Download01-sTnZ9m_H.js} +1 -1
  15. package/dist/client/assets/{Eye-Dud-kvJl.js → Eye-DBZt4RJc.js} +1 -1
  16. package/dist/client/assets/{FilterLines-CxBKxAWQ.js → FilterLines-nlgwxkLs.js} +1 -1
  17. package/dist/client/assets/{Globe01-CC5rliZ8.js → Globe01-B7mCeRBx.js} +1 -1
  18. package/dist/client/assets/{Globe04-I9PluRSe.js → Globe04-CW7pEZaX.js} +1 -1
  19. package/dist/client/assets/{HardDrive-CzaU-JSr.js → HardDrive-Bd0W1jdP.js} +1 -1
  20. package/dist/client/assets/{Key01-DYVtQyL5.js → Key01-CYjm13lf.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-DhwE_K6h.js → LinkExternal01-eB2fHbU5.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-mNM_ZGJe.js → LockUnlocked01-DFl-OJ7R.js} +1 -1
  23. package/dist/client/assets/{LogOut01-DcZ2xT-g.js → LogOut01-D3UNWCpS.js} +1 -1
  24. package/dist/client/assets/{Monitor01-BGi_X3fN.js → Monitor01-vLem4C3L.js} +1 -1
  25. package/dist/client/assets/{Palette-1yBLD0Lj.js → Palette-cc7S-N3h.js} +1 -1
  26. package/dist/client/assets/{Play-BzaZWqgV.js → Play-Dse4KZ1O.js} +1 -1
  27. package/dist/client/assets/{Plus-_clBcs48.js → Plus-CAe31wl2.js} +1 -1
  28. package/dist/client/assets/{SearchLg-BfZy6LE_.js → SearchLg-DGzbK_iQ.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BwZ89rxP.js → SearchMd-CqROzn8s.js} +1 -1
  30. package/dist/client/assets/{Settings02-Br92bn2T.js → Settings02-BxdfBQ5Y.js} +1 -1
  31. package/dist/client/assets/{Share07-h4b9M9kE.js → Share07-w7mz_Iae.js} +1 -1
  32. package/dist/client/assets/{Shield01-DXyKRgwg.js → Shield01-B50p-i9H.js} +1 -1
  33. package/dist/client/assets/{Stars01-D3NIP1DL.js → Stars01-C3_YhsfM.js} +1 -1
  34. package/dist/client/assets/{Stars02-KNF7k5Ai.js → Stars02-Dz2PYLs6.js} +1 -1
  35. package/dist/client/assets/{Sun-CRHdy0qz.js → Sun-D5dGjwS7.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-CzZQAHji.js → SwitchHorizontal01-DgxuO6JI.js} +1 -1
  37. package/dist/client/assets/{Tool01-CKdFlI5A.js → Tool01-Cr7gkqqy.js} +1 -1
  38. package/dist/client/assets/{Tool02-WEPKOeaj.js → Tool02-CoTv5i2i.js} +1 -1
  39. package/dist/client/assets/{Trash01-CeIegB-4.js → Trash01-DbfWjlZd.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-Vk6dCOd4.js → TrendUp01-DzptB_l4.js} +1 -1
  41. package/dist/client/assets/{Upload01-Dm5XIZAF.js → Upload01-CvzK6gz-.js} +1 -1
  42. package/dist/client/assets/{User01-BHSfVgcn.js → User01-BdqBw1KN.js} +1 -1
  43. package/dist/client/assets/{UserSquare-Cha_Xug_.js → UserSquare-C2vbnCn3.js} +1 -1
  44. package/dist/client/assets/{Users01-BdGucJTC.js → Users01-BsgBtJMH.js} +1 -1
  45. package/dist/client/assets/{Users03-DkrxpUck.js → Users03-DB9-i9hs.js} +1 -1
  46. package/dist/client/assets/{XCircle-_Uz-e0XH.js → XCircle-CENboZHz.js} +1 -1
  47. package/dist/client/assets/{XClose-CytrgB6q.js → XClose-DYwCESGN.js} +1 -1
  48. package/dist/client/assets/{YAxis-BYHBYWhx.js → YAxis-j0S-Movh.js} +1 -1
  49. package/dist/client/assets/{Zap-CQV84apV.js → Zap-C_NQbDwT.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-BxrLuLwY.js → ZapSquare-C_gg8DXd.js} +1 -1
  51. package/dist/client/assets/{access-gate-CsBTprll.js → access-gate-B-oxihSz.js} +1 -1
  52. package/dist/client/assets/{agent-icon-PQczz-8D.js → agent-icon-CXYig2Vh.js} +1 -1
  53. package/dist/client/assets/{agents-list-UHKfmM2N.js → agents-list-B_H7tlgD.js} +1 -1
  54. package/dist/client/assets/{ai-providers-CSfbLpOx.js → ai-providers-OQMYes8-.js} +1 -1
  55. package/dist/client/assets/{alert-4EqW2Ef2.js → alert-C-Cm1HNl.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-xAkhsUZ9.js → alert-dialog-DrDfeFyK.js} +1 -1
  57. package/dist/client/assets/{api-keys-DyfcgyTg.js → api-keys-DUv1V66z.js} +1 -1
  58. package/dist/client/assets/{app-editor-Cj9EPe1o.js → app-editor-BuZc8aHb.js} +1 -1
  59. package/dist/client/assets/{auth-4owgu1uZ.js → auth-Dg5sPbT4.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-Cy4Dgy3h.js → auth-catchall-C9xTiI-U.js} +1 -1
  61. package/dist/client/assets/{auth-entry-1CMga_dO.js → auth-entry-BFQHUJOr.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-4eec6TEX.js → auth-split-layout-CGrQ3VKW.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-C5490Jhc.js → authenticate-and-persist-oauth-CeNmdDco.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-BEb0M1Tt.js → automation-list-row-Dlr1O2UX.js} +1 -1
  65. package/dist/client/assets/{automation-runs-CAKuCn1G.js → automation-runs-Bo6be-vt.js} +1 -1
  66. package/dist/client/assets/{automations-BeW2O7Q5.js → automations-CwHDGSxK.js} +1 -1
  67. package/dist/client/assets/{avatar-Ch1MTXS-.js → avatar-BnQPHMLw.js} +1 -1
  68. package/dist/client/assets/{badge-Csyaxznr.js → badge-C8_JqgY7.js} +1 -1
  69. package/dist/client/assets/{block-document-DM132Gk1.js → block-document-zR1VJIni.js} +1 -1
  70. package/dist/client/assets/{breadcrumb-pwy4nVlX.js → breadcrumb-2vmGkBiB.js} +1 -1
  71. package/dist/client/assets/{buckets-CFfpbQtn.js → buckets-BOnyZrEO.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-DW1CBGWY.js → bulk-category-panel-cMwVJ8ED.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-CWVf5xY_.js → capability-load-error-BEeb9Z6k.js} +1 -1
  74. package/dist/client/assets/{cards-DBubZxl-.js → cards-4iJIg9Mv.js} +1 -1
  75. package/dist/client/assets/{category-editor-CbUgARQ1.js → category-editor-Cw_0Yfsv.js} +1 -1
  76. package/dist/client/assets/{chart-Drir-DML.js → chart-DnE16Ix1.js} +1 -1
  77. package/dist/client/assets/{chat-context-C4hTesgw.js → chat-context-CK0SAWg7.js} +1 -1
  78. package/dist/client/assets/{checkbox-DJVXViCm.js → checkbox-D6aL5Ben.js} +1 -1
  79. package/dist/client/assets/{choose-editor-CafV7ZgN.js → choose-editor-C3Ub0dgj.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-DtgqpO3z.js → cli-auth-success--TDUZFRP.js} +1 -1
  81. package/dist/client/assets/{collection-detail-D6bU7LUq.js → collection-detail-Cf83_OrE.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-CnPa5Nju.js → collection-display-button-7rsEyQus.js} +1 -1
  83. package/dist/client/assets/{collection-search-01_9dsYR.js → collection-search-DstNczGU.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-DdTDHnT2.js → collection-table-wrapper-4qI2R0Im.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-DRa7MJUs.js → collection-tabs-BMr5Ngme.js} +1 -1
  86. package/dist/client/assets/{command-C_dZFT4G.js → command-CjV2wNNJ.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-CshWy8LW.js → commerce-onboarding-DMZGxjOh.js} +1 -1
  88. package/dist/client/assets/{connect-BRcYE0fR.js → connect-Pvqv7G5a.js} +1 -1
  89. package/dist/client/assets/{connection-BbWM5mLn.js → connection-EsVa7rrz.js} +1 -1
  90. package/dist/client/assets/{connection-card-BJ9V0VEM.js → connection-card-C2-WEJb6.js} +1 -1
  91. package/dist/client/assets/{connection-detail-CBfXc99H.js → connection-detail-C85HFn8T.js} +1 -1
  92. package/dist/client/assets/{connection-form-helpers-B09Owiwo.js → connection-form-helpers-GRZE4630.js} +1 -1
  93. package/dist/client/assets/{connections-UNZit9OT.js → connections-o9qsANyB.js} +1 -1
  94. package/dist/client/assets/{decopilot-sse-pool-D75XD9J2.js → decopilot-sse-pool-P47eJQwa.js} +1 -1
  95. package/dist/client/assets/{dialog-O072o8Oc.js → dialog-VBR_VTpJ.js} +1 -1
  96. package/dist/client/assets/{domain-settings-BizohpDC.js → domain-settings-DLvcRKV5.js} +1 -1
  97. package/dist/client/assets/{drawer-D6TLZjdo.js → drawer-BOKsWH4_.js} +1 -1
  98. package/dist/client/assets/{dropdown-menu-CACb1c9S.js → dropdown-menu-Bnt3DOwT.js} +1 -1
  99. package/dist/client/assets/{empty-state-9FIrRrEx.js → empty-state-Db_WfMoj.js} +1 -1
  100. package/dist/client/assets/{extract-connection-data-8L2YpSby.js → extract-connection-data-G69TIOoO.js} +1 -1
  101. package/dist/client/assets/{file-explorer-CesJUjPp.js → file-explorer-BhXQiiWF.js} +1 -1
  102. package/dist/client/assets/{file-type-icon-BKg5eN6R.js → file-type-icon-kZUd9_dW.js} +1 -1
  103. package/dist/client/assets/{form-DPsMI3Lv.js → form-DYcqG-4R.js} +1 -1
  104. package/dist/client/assets/{general-r7OB2qT0.js → general-D7O-l9Fv.js} +1 -1
  105. package/dist/client/assets/{github-repo-picker-CqAOuEej.js → github-repo-picker-CJVihlv_.js} +1 -1
  106. package/dist/client/assets/{hooks-B6kpT11G.js → hooks-BEfohZqo.js} +1 -1
  107. package/dist/client/assets/{index-B00pExNP.js → index-B1TJowpP.js} +1 -1
  108. package/dist/client/assets/{index-BMq6PxM2.js → index-B215yOt2.js} +1 -1
  109. package/dist/client/assets/{index-DL7dyCTM.js → index-BTrp7Y4h.js} +1 -1
  110. package/dist/client/assets/{index-CosJ_q1O.js → index-Cg-6vNgN.js} +1 -1
  111. package/dist/client/assets/{index-C_irqqYB.js → index-CvfbdO9i.js} +1 -1
  112. package/dist/client/assets/{index-Bnq08khj.js → index-DYHs8sC_.js} +1 -1
  113. package/dist/client/assets/{index-BzVG1RMn.js → index-Dj8jGXxy.js} +1 -1
  114. package/dist/client/assets/{index-BbGRbO2s.js → index-DuKgaDRT.js} +3 -3
  115. package/dist/client/assets/{index-DChTPGRV.js → index-U2pcazmz.js} +1 -1
  116. package/dist/client/assets/{index-Bd6d6OLa.js → index-f6gC7_4x.js} +6 -6
  117. package/dist/client/assets/{index-redirect-DcHtEYVb.js → index-redirect-jePHlyPz.js} +1 -1
  118. package/dist/client/assets/{infra-billing-BRmmRtZn.js → infra-billing-D8fYUUm5.js} +1 -1
  119. package/dist/client/assets/{input-BIK5hdJU.js → input-rGj3HLrx.js} +1 -1
  120. package/dist/client/assets/{integration-icon-B074gVXs.js → integration-icon-BZS934jb.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-B65qQpMu.js → invite-member-dialog-yf8HZSYc.js} +1 -1
  122. package/dist/client/assets/{label-BplAUfvy.js → label-B0K9nJ3U.js} +1 -1
  123. package/dist/client/assets/{layout-R3JEUxy1.js → layout-BF-Q61C5.js} +1 -1
  124. package/dist/client/assets/{login-b3yPVmW1.js → login-HIWengSU.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-Z_L8Z-T6.js → mcp-oauth-DNzbrdjN.js} +1 -1
  126. package/dist/client/assets/{members-Cycs5Wq2.js → members-Cv5oh77D.js} +1 -1
  127. package/dist/client/assets/{monaco-editor-C8shR4Uy.js → monaco-editor-1iAJFSoh.js} +1 -1
  128. package/dist/client/assets/{monitoring-stats-row-tuBsDrD3.js → monitoring-stats-row-BQaJ3F1j.js} +1 -1
  129. package/dist/client/assets/{multi-select-wGAdBUU3.js → multi-select-Cda6yA9z.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-CcxNavXq.js → oauth-callback-30AwATxC.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-Zq_4S1rF.js → oauth-callback-ai-provider-DWEYgaeV.js} +1 -1
  132. package/dist/client/assets/{onboarding-D4uT93tX.js → onboarding-DIkVQlCN.js} +1 -1
  133. package/dist/client/assets/{org-layout-BTTwnSRk.js → org-layout-bATCBcIx.js} +1 -1
  134. package/dist/client/assets/{organization-choice-1h5bYDyx.js → organization-choice-CEEfPDaX.js} +1 -1
  135. package/dist/client/assets/{orgs-Bml1X0Rd.js → orgs-CM0T21UE.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-BSjej6Az.js → page-seo-form-CCHf1vNm.js} +1 -1
  137. package/dist/client/assets/{popover-BezUzMxd.js → popover-Ne5etcF4.js} +1 -1
  138. package/dist/client/assets/{post-calendar-Dseb-Zkl.js → post-calendar-BYsLadOr.js} +1 -1
  139. package/dist/client/assets/{post-editor-BFphx73k.js → post-editor-DiCfrfxw.js} +1 -1
  140. package/dist/client/assets/{primitives-Djr14DNH.js → primitives-7TOJy6_9.js} +1 -1
  141. package/dist/client/assets/{profile-CtS6UJ63.js → profile-D4FFWrJC.js} +1 -1
  142. package/dist/client/assets/{project-app-view-CYIhElTf.js → project-app-view-Bo4BBM1E.js} +1 -1
  143. package/dist/client/assets/{prompts-DBu58bEV.js → prompts-_XcIyiqm.js} +1 -1
  144. package/dist/client/assets/record-editor-LiBPk35v.js +1 -0
  145. package/dist/client/assets/{redirect-editor-Dur_b6Cg.js → redirect-editor-K4eNaU6r.js} +1 -1
  146. package/dist/client/assets/registry-Bqm-CWX8.js +2 -0
  147. package/dist/client/assets/{registry-layout-BBZAFDeV.js → registry-layout-BX0s0Dqe.js} +1 -1
  148. package/dist/client/assets/{reports-CCgU3HGz.js → reports-La3KhSjI.js} +1 -1
  149. package/dist/client/assets/{require-capability-wUMdvtTV.js → require-capability-BSF86YHK.js} +1 -1
  150. package/dist/client/assets/{required-auth-layout-BPYKj3xE.js → required-auth-layout-Dif_3ts2.js} +1 -1
  151. package/dist/client/assets/{reset-password-vYAbZs56.js → reset-password-B6OUPmCP.js} +1 -1
  152. package/dist/client/assets/{review-settings-B5FnFMPh.js → review-settings-DyDN9gfW.js} +1 -1
  153. package/dist/client/assets/{roles-Cgxpxt-9.js → roles-DdyjgZmg.js} +1 -1
  154. package/dist/client/assets/{search-input-CPxRNAUZ.js → search-input-Bc5gi1FL.js} +1 -1
  155. package/dist/client/assets/{secrets-7QMeQmRM.js → secrets-BzDgubGX.js} +1 -1
  156. package/dist/client/assets/{sections-editor-BMt9NU0A.js → sections-editor-BtNnir0Y.js} +1 -1
  157. package/dist/client/assets/{select-BgBUKtcQ.js → select-Dw0yz6R3.js} +1 -1
  158. package/dist/client/assets/{select-model-CMJQRlhd.js → select-model-DxJOIebh.js} +1 -1
  159. package/dist/client/assets/{self-tool-result-WIUgrpcH.js → self-tool-result-CfcKJ8G-.js} +1 -1
  160. package/dist/client/assets/{seo-editor-BFkrAwB4.js → seo-editor-CLMQvTRz.js} +1 -1
  161. package/dist/client/assets/{settings-layout-BgmubS30.js → settings-layout-DdcBYKNK.js} +1 -1
  162. package/dist/client/assets/{shell-controls-CQVAVXQn.js → shell-controls-Bu6K_Cyl.js} +1 -1
  163. package/dist/client/assets/{shell-layout-C7TB0sE3.js → shell-layout-h1M-Upkc.js} +1 -1
  164. package/dist/client/assets/{spinner-75C-IUje.js → spinner-DUUWxaw4.js} +1 -1
  165. package/dist/client/assets/{sso-D-YMVA4g.js → sso-DRSRsKqA.js} +1 -1
  166. package/dist/client/assets/{store-H4NF1OnW.js → store-CipcZsRS.js} +1 -1
  167. package/dist/client/assets/store-registry-DpcDBI8v.js +2 -0
  168. package/dist/client/assets/{switch-DdfQIPis.js → switch-Bogsutiu.js} +1 -1
  169. package/dist/client/assets/{synced-repos-B7OZC3Z7.js → synced-repos-9L6kfBvS.js} +1 -1
  170. package/dist/client/assets/{tab-id-Besg8sQE.js → tab-id-xRw9s49x.js} +1 -1
  171. package/dist/client/assets/{table-B6yx5A_W.js → table-Dz1UPp05.js} +1 -1
  172. package/dist/client/assets/{tabs-HJIS52i6.js → tabs-CVLCNP4p.js} +1 -1
  173. package/dist/client/assets/{tasks-BSfFLsrw.js → tasks-DNcMfQUI.js} +1 -1
  174. package/dist/client/assets/{textarea-qfkIpMCZ.js → textarea-DP7L5LCU.js} +1 -1
  175. package/dist/client/assets/{toggle-group-BsJyDLZw.js → toggle-group-D7gbO6Ao.js} +1 -1
  176. package/dist/client/assets/{toolbar-CNPK0ze4.js → toolbar-DlSLmZi5.js} +1 -1
  177. package/dist/client/assets/{track-hj2Hvt98.js → track-Bh6FnWCf.js} +1 -1
  178. package/dist/client/assets/{types-DRjR-IOc.js → types-W907-UkK.js} +1 -1
  179. package/dist/client/assets/{use-ai-providers-tkH2P36o.js → use-ai-providers-XXnxR_Zu.js} +1 -1
  180. package/dist/client/assets/{use-api-keys-CH-CKEoz.js → use-api-keys-DCLdogWr.js} +1 -1
  181. package/dist/client/assets/{use-automations-DESAfZj2.js → use-automations-V9xNGOwd.js} +1 -1
  182. package/dist/client/assets/{use-autosave-BNj1Gj-Y.js → use-autosave-Dal9yw19.js} +1 -1
  183. package/dist/client/assets/{use-clock-tick-BnbeNIUC.js → use-clock-tick-Bb14ko74.js} +1 -1
  184. package/dist/client/assets/{use-commerce-diagnostic-CSLSGoDP.js → use-commerce-diagnostic-DMlGkdtx.js} +1 -1
  185. package/dist/client/assets/{use-connection-SjIucYfF.js → use-connection-CouRoanJ.js} +1 -1
  186. package/dist/client/assets/{use-copy-St27i-aj.js → use-copy-Ddawx2RP.js} +1 -1
  187. package/dist/client/assets/{use-create-virtual-mcp-DYPlB764.js → use-create-virtual-mcp-BcPOUHVg.js} +1 -1
  188. package/dist/client/assets/{use-debounced-autosave-DbmG2nK6.js → use-debounced-autosave-BkTJ_3l3.js} +1 -1
  189. package/dist/client/assets/{use-debounced-value-Cm2qsfPc.js → use-debounced-value-B_odlUMh.js} +1 -1
  190. package/dist/client/assets/{use-decopilot-events-TMtnOnoS.js → use-decopilot-events-B9ygDv-h.js} +1 -1
  191. package/dist/client/assets/{use-delete-connection-BAmh5auV.js → use-delete-connection-BPvWexBL.js} +1 -1
  192. package/dist/client/assets/{use-deployment-admin-CcfJXV2S.js → use-deployment-admin-ChlNYFJi.js} +1 -1
  193. package/dist/client/assets/{use-file-configs-Do-4t9yE.js → use-file-configs-D1n8ru_C.js} +1 -1
  194. package/dist/client/assets/{use-infinite-scroll-DCIMGPFx.js → use-infinite-scroll-CQ0_P7dk.js} +1 -1
  195. package/dist/client/assets/{use-join-requests-B8SnALum.js → use-join-requests-DoJPSGpH.js} +1 -1
  196. package/dist/client/assets/{use-mcp-auth-status-DMcsLLPB.js → use-mcp-auth-status-CT_TMtQl.js} +1 -1
  197. package/dist/client/assets/{use-mcp-client-C9-YbjTx.js → use-mcp-client-DEWnugV9.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-CiNsIBL4.js → use-mcp-tools-WEAnrPHG.js} +1 -1
  199. package/dist/client/assets/{use-members-DU7_N-pG.js → use-members-G-zG_jza.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-WsCzoAKG.js → use-navigate-to-agent-CCf7hqC4.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-DP78AcXd.js → use-org-auth-client-CsDT0euS.js} +1 -1
  202. package/dist/client/assets/{use-org-repo-syncs-Xt_Ge_7D.js → use-org-repo-syncs-BvIV6Sw5.js} +1 -1
  203. package/dist/client/assets/{use-org-sso-BnQ7ESw_.js → use-org-sso-O4xaa8q3.js} +1 -1
  204. package/dist/client/assets/{use-organization-roles-B9NW6iv3.js → use-organization-roles-BknP4ff7.js} +1 -1
  205. package/dist/client/assets/{use-organization-settings-DxGOoKYL.js → use-organization-settings-D6-lnE8v.js} +1 -1
  206. package/dist/client/assets/{use-registry-connections-BNaCzrSd.js → use-registry-connections-DcYxqR1F.js} +1 -1
  207. package/dist/client/assets/{use-secrets-DmW9oS6u.js → use-secrets-BfNvKZpg.js} +1 -1
  208. package/dist/client/assets/{use-section-preview-base-D6NtdQxJ.js → use-section-preview-base-DbEnUJ41.js} +1 -1
  209. package/dist/client/assets/{use-status-sounds-B87a5SNq.js → use-status-sounds-DRh49aaZ.js} +1 -1
  210. package/dist/client/assets/{use-tags-ClBzSwUW.js → use-tags-C4ysHQ1s.js} +1 -1
  211. package/dist/client/assets/{use-task-board-items-C2E37Ysf.js → use-task-board-items-DtI1y7vL.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-CrC5Rog5.js → use-view-mode-CXiJrl5o.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-BIgbLEnA.js → use-virtual-mcp-Dds4BZbz.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-DfepjmLn.js +1 -0
  215. package/dist/client/assets/useSuspenseInfiniteQuery-BVLX6MQQ.js +1 -0
  216. package/dist/client/assets/{users-M4-Hpi9P.js → users-Bds58MaT.js} +1 -1
  217. package/dist/client/assets/{variant-calendar-BbFVP1Br.js → variant-calendar-B_zEenCh.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-C7ssVG3O.js → view-mode-toggle-BTeH48rm.js} +1 -1
  219. package/dist/client/index.html +1 -1
  220. package/dist/server/cli.js +2 -2
  221. package/dist/server/server.js +2 -2
  222. package/package.json +1 -1
  223. package/dist/client/assets/record-editor-D9kse-I3.js +0 -1
  224. package/dist/client/assets/registry-DdvbHXgg.js +0 -2
  225. package/dist/client/assets/store-registry-LoGhkRcz.js +0 -2
  226. package/dist/client/assets/useInfiniteQuery-DJwleBvz.js +0 -1
  227. package/dist/client/assets/useSuspenseInfiniteQuery-BnXbKlC6.js +0 -1
@@ -1 +1 @@
1
- import{c as ge,b as me,j as o,x as Ie,aX as De,bL as Le,t as le,B as re,aZ as Te,H as ye,p as Ee,a as Fe,r as Z,o as ke,K as de,e as Pe,q as Y,I as Me,n as Ge,P as ce}from"./index-BbGRbO2s.js";import{a as ee,b as we,D as ue,c as pe}from"./dropdown-menu-CACb1c9S.js";import{a as Oe}from"./Users03-DkrxpUck.js";import{G as Se,b as ze,a as Be}from"./github-repo-picker-CqAOuEej.js";import{b as _e,u as Ue,c as Re}from"./use-virtual-mcp-BIgbLEnA.js";import{a as $e}from"./DotsVertical-BP5Z780D.js";import{A as He,f as fe,b7 as Ve,b8 as Ke}from"./agent-icon-PQczz-8D.js";import{a as qe}from"./Settings02-Br92bn2T.js";import{s as Qe}from"./Trash01-CeIegB-4.js";import{p as Je,f as he}from"./pt-BR-CLy76QW2.js";import{c as ve}from"./use-navigate-to-agent-WsCzoAKG.js";import{f as Ye,i as We}from"./use-organization-settings-DxGOoKYL.js";import{h as Xe}from"./agent-capabilities-B52k7xCe.js";import{E as Ze}from"./empty-state-9FIrRrEx.js";import{u as et}from"./use-create-virtual-mcp-DYPlB764.js";import{u as tt}from"./use-connection-SjIucYfF.js";import{u as xe}from"./use-mcp-client-C9-YbjTx.js";import{S as ot}from"./constants-z9Iog-sb.js";import{b as st,c as je}from"./session-runtime-wVXsCwcJ.js";import{g as it,f as nt,b as rt,G as lt,p as at}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";import{e as ct,d as mt,a as dt,b as ut,c as pt}from"./dialog-O072o8Oc.js";import{i as gt}from"./ArrowLeft-Cj7J7Py6.js";import{C as ft}from"./collection-search-01_9dsYR.js";import{c as ht,d as xt,b as jt,f as Ct,g as bt,e as Dt,a as yt,A as wt}from"./alert-dialog-xAkhsUZ9.js";import{S as St}from"./search-input-CPxRNAUZ.js";import{s as Ce}from"./Plus-_clBcs48.js";import"./Check-C7msqNgq.js";import"./ChevronRight-KbHVuEl0.js";import"./use-debounced-value-Cm2qsfPc.js";import"./authenticate-and-persist-oauth-C5490Jhc.js";import"./mcp-oauth-Z_L8Z-T6.js";import"./auth-4owgu1uZ.js";import"./LinkExternal01-DhwE_K6h.js";import"./LockUnlocked01-mNM_ZGJe.js";import"./use-mcp-tools-CiNsIBL4.js";import"./extract-connection-data-8L2YpSby.js";import"./metadata-dUsYcpuu.js";import"./AlertCircle-CkPwmuKt.js";import"./Tool01-CKdFlI5A.js";import"./ArrowUp-BACYFmW2.js";import"./Tool02-WEPKOeaj.js";import"./XCircle-_Uz-e0XH.js";import"./TrendUp01-Vk6dCOd4.js";import"./ZapSquare-BxrLuLwY.js";import"./CheckCircle-Byfr8GRo.js";import"./ChevronDown-BqUHNjui.js";import"./ChevronSelectorVertical-C-TawfyU.js";import"./ChevronUp-DFNYR7MJ.js";import"./Stars02-KNF7k5Ai.js";import"./UserSquare-Cha_Xug_.js";import"./Copy01-C4YK8X63.js";import"./CreditCard01-CTvH4Ctz.js";import"./Download01-qJq3S2UO.js";import"./Eye-Dud-kvJl.js";import"./FilterLines-CxBKxAWQ.js";import"./Share07-h4b9M9kE.js";import"./Globe01-CC5rliZ8.js";import"./Globe04-I9PluRSe.js";import"./SwitchHorizontal01-CzZQAHji.js";import"./HardDrive-CzaU-JSr.js";import"./Key01-DYVtQyL5.js";import"./LogOut01-DcZ2xT-g.js";import"./Monitor01-BGi_X3fN.js";import"./Sun-CRHdy0qz.js";import"./Palette-1yBLD0Lj.js";import"./Play-BzaZWqgV.js";import"./SearchLg-BfZy6LE_.js";import"./SearchMd-BwZ89rxP.js";import"./Shield01-DXyKRgwg.js";import"./Stars01-D3NIP1DL.js";import"./Upload01-Dm5XIZAF.js";import"./User01-BHSfVgcn.js";import"./Users01-BdGucJTC.js";import"./XClose-CytrgB6q.js";import"./Zap-CQV84apV.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-B6kpT11G.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-D75XD9J2.js";import"./reusable-new-chat-CzvRy4Pe.js";function be(t){const e=ge.c(28),{onCreateFromScratch:s,onImportGitHub:n,onImportDeco:l,isCreating:g,align:r,side:R,showBetaBadge:h}=t,$=r===void 0?"end":r,d=me();let M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx(Oe,{size:14}),e[0]=M):M=e[0];let c;e[1]!==d?(c=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=c):c=e[2];let D;e[3]!==g||e[4]!==s||e[5]!==c?(D=o.jsxs(ee,{disabled:g,onClick:s,children:[M,c]}),e[3]=g,e[4]=s,e[5]=c,e[6]=D):D=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Se,{className:"size-3.5"}),e[7]=x):x=e[7];let _;e[8]!==d?(_=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=_):_=e[9];let m;e[10]!==h?(m=h&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=h,e[11]=m):m=e[11];let a;e[12]!==n||e[13]!==_||e[14]!==m?(a=o.jsxs(ee,{onClick:n,children:[x,_,m]}),e[12]=n,e[13]=_,e[14]=m,e[15]=a):a=e[15];let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=f):f=e[16];let v;e[17]!==d?(v=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=v):v=e[18];let y;e[19]!==l||e[20]!==v?(y=o.jsxs(ee,{onClick:l,children:[f,v]}),e[19]=l,e[20]=v,e[21]=y):y=e[21];let C;return e[22]!==$||e[23]!==R||e[24]!==y||e[25]!==D||e[26]!==a?(C=o.jsxs(we,{side:R,align:$,className:"w-48",children:[D,a,y]}),e[22]=$,e[23]=R,e[24]=y,e[25]=D,e[26]=a,e[27]=C):C=e[27],C}function _t(t){const e=ge.c(78),{project:s,lastUsedAt:n,onDeleteClick:l}=t,g=ve(),r=me(),[R]=Ie(),h=R.language==="pt-BR"?Je:void 0,{mainAgentId:$}=Ye(),d=We(),{granted:M}=De("org:manage"),c=$===s.id,D=_e(),{isPrivileged:x}=Le();let _;e[0]!==x||e[1]!==s?(_=x&&Xe(s),e[0]=x,e[1]=s,e[2]=_):_=e[2];const m=_,a=!!s.pinned;let f;e[3]!==D.update||e[4]!==a||e[5]!==s.id?(f=()=>{D.update.mutate({id:s.id,data:{pinned:!a}})},e[3]=D.update,e[4]=a,e[5]=s.id,e[6]=f):f=e[6];const v=f;let y;e[7]!==c||e[8]!==s.id||e[9]!==s.title||e[10]!==d||e[11]!==r?(y=()=>{const E=c?null:s.id;d.mutate(E,{onSuccess:()=>le.success(c?r("home.projectCard.mainAgentUnset",{title:s.title}):r("home.projectCard.mainAgentSet",{title:s.title})),onError:()=>le.error(r("home.projectCard.mainAgentError"))})},e[7]=c,e[8]=s.id,e[9]=s.title,e[10]=d,e[11]=r,e[12]=y):y=e[12];const C=y;let V;e[13]!==g||e[14]!==s.id?(V=()=>g(s.id),e[13]=g,e[14]=s.id,e[15]=V):V=e[15];let G;e[16]!==s.title||e[17]!==V?(G=o.jsx("button",{type:"button",onClick:V,className:"absolute inset-0 z-0","aria-label":s.title}),e[16]=s.title,e[17]=V,e[18]=G):G=e[18];let K;e[19]!==s.icon||e[20]!==s.title?(K=o.jsx(He,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[19]=s.icon,e[20]=s.title,e[21]=K):K=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(ue,{asChild:!0,children:o.jsx(re,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx($e,{size:20})})}),e[22]=k):k=e[22];let N;e[23]!==g||e[24]!==s.id?(N=()=>g(s.id,{search:{main:"settings"}}),e[23]=g,e[24]=s.id,e[25]=N):N=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx(qe,{size:16}),e[26]=O):O=e[26];let H;e[27]!==N?(H=o.jsxs(ee,{onClick:N,children:[O,"Settings"]}),e[27]=N,e[28]=H):H=e[28];let w;e[29]!==M||e[30]!==c||e[31]!==r||e[32]!==C?(w=M&&o.jsxs(ee,{onClick:E=>{E.stopPropagation(),C()},children:[o.jsx(fe,{size:16}),r(c?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[29]=M,e[30]=c,e[31]=r,e[32]=C,e[33]=w):w=e[33];let i;e[34]!==m||e[35]!==a||e[36]!==r||e[37]!==v?(i=m&&o.jsxs(ee,{onClick:E=>{E.stopPropagation(),v()},children:[o.jsx(Ve,{size:16}),r(a?"home.projectCard.unpinFromSidebar":"home.projectCard.pinToSidebar")]}),e[34]=m,e[35]=a,e[36]=r,e[37]=v,e[38]=i):i=e[38];let u;e[39]!==l?(u=l&&o.jsxs(ee,{variant:"destructive",onClick:E=>{E.stopPropagation(),l(E)},children:[o.jsx(Qe,{size:16}),"Delete"]}),e[39]=l,e[40]=u):u=e[40];let p;e[41]!==H||e[42]!==w||e[43]!==i||e[44]!==u?(p=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[k,o.jsxs(we,{align:"end",children:[H,w,i,u]})]})}),e[41]=H,e[42]=w,e[43]=i,e[44]=u,e[45]=p):p=e[45];let j;e[46]!==p||e[47]!==K?(j=o.jsxs("div",{className:"flex items-start justify-between",children:[K,p]}),e[46]=p,e[47]=K,e[48]=j):j=e[48];let S;e[49]!==s.title?(S=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[49]=s.title,e[50]=S):S=e[50];let A;e[51]!==c||e[52]!==r?(A=c&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),r("home.projectCard.mainAgentBadge")]}),e[51]=c,e[52]=r,e[53]=A):A=e[53];let I;e[54]!==S||e[55]!==A?(I=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[S,A]}),e[54]=S,e[55]=A,e[56]=I):I=e[56];const U=s.description||"No description";let z;e[57]!==U?(z=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:U}),e[57]=U,e[58]=z):z=e[58];let b;e[59]!==I||e[60]!==z?(b=o.jsxs("div",{className:"flex flex-col gap-1",children:[I,z]}),e[59]=I,e[60]=z,e[61]=b):b=e[61];let L;e[62]!==j||e[63]!==b?(L=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,b]}),e[62]=j,e[63]=b,e[64]=L):L=e[64];let T;e[65]!==n||e[66]!==h||e[67]!==s.updated_at||e[68]!==r?(T=n?r("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:h})}):r("home.projectCard.updated",{time:he(new Date(s.updated_at),{addSuffix:!0,locale:h})}),e[65]=n,e[66]=h,e[67]=s.updated_at,e[68]=r,e[69]=T):T=e[69];let B;e[70]!==T?(B=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[70]=T,e[71]=B):B=e[71];let P;e[72]!==L||e[73]!==B?(P=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[L,B]}),e[72]=L,e[73]=B,e[74]=P):P=e[74];let q;return e[75]!==P||e[76]!==G?(q=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[G,P]}),e[75]=P,e[76]=G,e[77]=q):q=e[77],q}const vt="deco-sites";function Nt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,n=e.repo;return typeof s!="string"||typeof n!="string"||s.length===0||n.length===0?null:{owner:s,repo:n}}function At(t,e){const s=e?Nt(e):null,n=s?.owner??vt,l=s?.repo??t;return{owner:n,name:l,url:`https://github.com/${n}/${l}`}}function It(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const n=await fetch(t,e),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error??`${s} (${n.status})`);return l}function Lt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Tt({open:t,onOpenChange:e,onBack:s}){const n=me(),{org:l}=ye(),g=ve(),r=Ee(),{data:R}=Fe.useSession(),[h,$]=Z.useState(null),[d,M]=Z.useState(null),[c,D]=Z.useState(""),x=xe({connectionId:ot,orgId:l.id,orgSlug:l.slug}),_=tt({slug:"mcp-github"}),m=it(_),a=ze({enabled:t&&m.length===0}),f=m.length===1?m[0]??null:d,v=m.length>1&&!f,y=xe({connectionId:f?.id??"",orgId:l.id,orgSlug:l.slug}),C=t&&m.length===0&&(a.status==="installing"||a.status==="authenticating"||a.status==="idle"),{data:V,isLoading:G,error:K}=ke({queryKey:de.decoSites(R?.user?.email),queryFn:()=>Lt(l.slug),enabled:t&&!!R?.user?.email,staleTime:6e4,retry:!1}),k=V?.sites??[],N=i=>{i||($(null),M(null),D("")),e(i)},O=k.filter(i=>i.name.toLowerCase().includes(c.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(c.toLowerCase())??!1)),H=!h||O.some(i=>i.name===h),w=Pe({mutationFn:async i=>{if(!f)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));Y("deco_site_import_started",{site_name:i});const{installations:u}=await nt(b=>x.callTool(b),f.id),p=k.find(b=>b.name===i);if(!p)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const j=At(i,p.metadata),S=rt(u,j.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:j.owner,installUrl:lt}));let A=null,I=null,U=null;const z=async()=>{U&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:U}}).catch(()=>{}),I&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),A&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const b=await Ne(`/api/${l.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},n("common.importFromDecoDialog.failedToCreateConnection")),L=b.connId;if(!L)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=L;const{childConnectionId:T,reused:B}=await at({orgSlug:l.slug,sourceConnection:f,installationId:S.installationId,owner:j.owner,repo:j.name,githubCallTool:J=>y.callTool(J),selfCallTool:J=>x.callTool(J)});I=B?null:T;const P=b.icon??null,q=It(i),E=i.toLowerCase(),W=st(je(p.domains)),X=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:P??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:E,previewServerUrl:W,productionUrl:W,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:S.installationId,connectionId:T},ui:{banner:null,bannerColor:"#22C55E",icon:P,themeColor:"#22C55E",slug:q,pinnedViews:[{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:L},{connection_id:T}]}}}),Q=X.structuredContent??X;if(!Q.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return U=Q.item.id,{slug:q,virtualMcpId:Q.item.id,connId:L,item:Q.item}}catch(b){throw await z(),b}},onSuccess:({slug:i,virtualMcpId:u,item:p})=>{Y("deco_site_import_succeeded",{site_name:p.title,virtual_mcp_id:u,slug:i}),r.setQueryData(de.collectionItem(x,l.id,"","VIRTUAL_MCP",u),{item:p}),r.invalidateQueries({predicate:j=>{const S=j.queryKey;return S[1]===l.id&&S[3]==="collection"&&S[4]==="VIRTUAL_MCP"}}),r.invalidateQueries({queryKey:de.projects(l.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:i})),N(!1),localStorage.setItem(Me.sidebarOpen(),JSON.stringify(!1)),g(u)},onError:i=>{Y("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(ct,{open:t,onOpenChange:N,children:o.jsxs(mt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(dt,{className:"sr-only",children:o.jsx(ut,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(gt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ft,{value:c,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[a.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:a.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(re,{variant:"outline",size:"sm",onClick:a.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),C&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),v&&!C&&a.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),m.map(i=>o.jsxs("button",{type:"button",onClick:()=>M(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),G&&!C&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!G&&!C&&!v&&a.status!=="error"&&!K&&k.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!G&&!C&&!v&&a.status!=="error"&&k.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[O.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:c})}),O.map(i=>{const u=je(i.domains),p=h===i.name;return o.jsxs("button",{type:"button",onClick:()=>$(i.name),className:Ge("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",p?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),u&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:u})]})]},i.name)})]})]}),o.jsxs(pt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(re,{variant:"outline",onClick:()=>N(!1),disabled:w.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(re,{disabled:!h||!H||w.isPending||G||C||v||!f||a.status==="error",onClick:()=>h&&w.mutate(h),children:w.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ls(){const t=ge.c(77),e=me(),{org:s}=ye(),n=Ue(),l=_e(),[g,r]=Z.useState("");let R;t[0]===Symbol.for("react.memo_cache_sentinel")?(R={navigateOnCreate:!0},t[0]=R):R=t[0];const{createVirtualMCP:h,isCreating:$}=et(R),[d,M]=Z.useState(null),[c,D]=Z.useState(!1),[x,_]=Z.useState(!1),{granted:m}=De("agents:manage"),a=g.toLowerCase(),f=n.filter(F=>F.id!==s.id&&(F.title.toLowerCase().includes(a)||F.description?.toLowerCase().includes(a))),{data:v}=Re(f.map(Et));let y;t[1]!==l||t[2]!==d||t[3]!==e?(y=async()=>{if(!d)return;const{id:F,title:Ae}=d;M(null);try{await l.delete.mutateAsync(F),Y("agent_deleted",{agent_id:F,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ae}))}catch{}},t[1]=l,t[2]=d,t[3]=e,t[4]=y):y=t[4];const C=y,V=ce,G=ce,K=ce;let k;t[5]!==e?(k=e("routes.agentsList.title"),t[5]=e,t[6]=k):k=t[6];let N;t[7]!==k?(N=o.jsx(ce.Title,{children:k}),t[7]=k,t[8]=N):N=t[8];let O;t[9]!==e?(O=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=O):O=t[10];let H;t[11]===Symbol.for("react.memo_cache_sentinel")?(H=F=>{F.key==="Escape"&&(r(""),F.target.blur())},t[11]=H):H=t[11];let w;t[12]!==g||t[13]!==O?(w=o.jsx(St,{value:g,onChange:r,placeholder:O,className:"w-full md:w-[375px]",onKeyDown:H}),t[12]=g,t[13]=O,t[14]=w):w=t[14];let i;t[15]!==m||t[16]!==h||t[17]!==$||t[18]!==e?(i=m&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(re,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{Y("agent_create_clicked",{source:"agents_list",method:"scratch"}),h()},onImportGitHub:()=>{Y("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{Y("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:$,align:"end"})]}),t[15]=m,t[16]=h,t[17]=$,t[18]=e,t[19]=i):i=t[19];let u;t[20]!==w||t[21]!==i?(u=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[w,i]}),t[20]=w,t[21]=i,t[22]=u):u=t[22];let p;t[23]!==u||t[24]!==N?(p=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,u]}),t[23]=u,t[24]=N,t[25]=p):p=t[25];const j=f.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ze,{image:o.jsx(Ke,{size:48,className:"text-muted-foreground"}),title:e(g?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:g?e("routes.agentsList.noAgentsMatchSearch",{search:g}):e(m?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!g&&m&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(re,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),h()},onImportGitHub:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:$,align:"center",showBetaBadge:!0})]})})}),S=f.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:f.map(F=>o.jsx(_t,{project:F,lastUsedAt:v?.get(F.id)?.last_used_at,onDeleteClick:m?()=>M({id:F.id,title:F.title}):void 0},F.id))})]});let A;t[26]!==p||t[27]!==j||t[28]!==S||t[29]!==K.Body?(A=o.jsxs(K.Body,{children:[p,j,S]}),t[26]=p,t[27]=j,t[28]=S,t[29]=K.Body,t[30]=A):A=t[30];let I;t[31]!==A||t[32]!==G.Content?(I=o.jsx(G.Content,{children:A}),t[31]=A,t[32]=G.Content,t[33]=I):I=t[33];let U;t[34]!==x?(U=o.jsx(Be,{open:x,onOpenChange:_}),t[34]=x,t[35]=U):U=t[35];let z;t[36]!==c?(z=o.jsx(Tt,{open:c,onOpenChange:D}),t[36]=c,t[37]=z):z=t[37];const b=!!d;let L;t[38]===Symbol.for("react.memo_cache_sentinel")?(L=F=>!F&&M(null),t[38]=L):L=t[38];let T;t[39]!==e?(T=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=T):T=t[40];let B;t[41]!==T?(B=o.jsx(ht,{children:T}),t[41]=T,t[42]=B):B=t[42];let P;t[43]!==e?(P=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=P):P=t[44];const q=d?.title;let E;t[45]!==q?(E=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[45]=q,t[46]=E):E=t[46];let W;t[47]!==P||t[48]!==E?(W=o.jsxs(xt,{children:[P," ",E,"."]}),t[47]=P,t[48]=E,t[49]=W):W=t[49];let X;t[50]!==B||t[51]!==W?(X=o.jsxs(jt,{children:[B,W]}),t[50]=B,t[51]=W,t[52]=X):X=t[52];let Q;t[53]!==e?(Q=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=Q):Q=t[54];let J;t[55]!==Q?(J=o.jsx(Ct,{children:Q}),t[55]=Q,t[56]=J):J=t[56];let te;t[57]!==e?(te=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=te):te=t[58];let oe;t[59]!==C||t[60]!==te?(oe=o.jsx(bt,{onClick:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:te}),t[59]=C,t[60]=te,t[61]=oe):oe=t[61];let se;t[62]!==J||t[63]!==oe?(se=o.jsxs(Dt,{children:[J,oe]}),t[62]=J,t[63]=oe,t[64]=se):se=t[64];let ie;t[65]!==X||t[66]!==se?(ie=o.jsxs(yt,{children:[X,se]}),t[65]=X,t[66]=se,t[67]=ie):ie=t[67];let ne;t[68]!==b||t[69]!==ie?(ne=o.jsx(wt,{open:b,onOpenChange:L,children:ie}),t[68]=b,t[69]=ie,t[70]=ne):ne=t[70];let ae;return t[71]!==V||t[72]!==I||t[73]!==U||t[74]!==z||t[75]!==ne?(ae=o.jsxs(V,{children:[I,U,z,ne]}),t[71]=V,t[72]=I,t[73]=U,t[74]=z,t[75]=ne,t[76]=ae):ae=t[76],ae}function Et(t){return t.id}export{ls as default};
1
+ import{c as ge,b as me,j as o,x as Ie,aX as De,bL as Le,t as le,B as re,aZ as Te,H as ye,p as Ee,a as Fe,r as Z,o as ke,K as de,e as Pe,q as Y,I as Me,n as Ge,P as ce}from"./index-DuKgaDRT.js";import{a as ee,b as we,D as ue,c as pe}from"./dropdown-menu-Bnt3DOwT.js";import{a as Oe}from"./Users03-DB9-i9hs.js";import{G as Se,b as ze,a as Be}from"./github-repo-picker-CJVihlv_.js";import{b as _e,u as Ue,c as Re}from"./use-virtual-mcp-Dds4BZbz.js";import{a as $e}from"./DotsVertical-1JhgmWFz.js";import{A as He,f as fe,b7 as Ve,b8 as Ke}from"./agent-icon-CXYig2Vh.js";import{a as qe}from"./Settings02-BxdfBQ5Y.js";import{s as Qe}from"./Trash01-DbfWjlZd.js";import{p as Je,f as he}from"./pt-BR-CLy76QW2.js";import{c as ve}from"./use-navigate-to-agent-CCf7hqC4.js";import{f as Ye,i as We}from"./use-organization-settings-D6-lnE8v.js";import{h as Xe}from"./agent-capabilities-B52k7xCe.js";import{E as Ze}from"./empty-state-Db_WfMoj.js";import{u as et}from"./use-create-virtual-mcp-BcPOUHVg.js";import{u as tt}from"./use-connection-CouRoanJ.js";import{u as xe}from"./use-mcp-client-DEWnugV9.js";import{S as ot}from"./constants-z9Iog-sb.js";import{b as st,c as je}from"./session-runtime-wVXsCwcJ.js";import{g as it,f as nt,b as rt,G as lt,p as at}from"./provision-repo-scoped-github-connection-CMPWtdMv.js";import{e as ct,d as mt,a as dt,b as ut,c as pt}from"./dialog-VBR_VTpJ.js";import{i as gt}from"./ArrowLeft-BAk90rdd.js";import{C as ft}from"./collection-search-DstNczGU.js";import{c as ht,d as xt,b as jt,f as Ct,g as bt,e as Dt,a as yt,A as wt}from"./alert-dialog-DrDfeFyK.js";import{S as St}from"./search-input-Bc5gi1FL.js";import{s as Ce}from"./Plus-CAe31wl2.js";import"./Check-8BnM7tpC.js";import"./ChevronRight-BoCweSJs.js";import"./use-debounced-value-B_odlUMh.js";import"./authenticate-and-persist-oauth-CeNmdDco.js";import"./mcp-oauth-DNzbrdjN.js";import"./auth-Dg5sPbT4.js";import"./LinkExternal01-eB2fHbU5.js";import"./LockUnlocked01-DFl-OJ7R.js";import"./use-mcp-tools-WEAnrPHG.js";import"./extract-connection-data-G69TIOoO.js";import"./metadata-dUsYcpuu.js";import"./AlertCircle-q-ha89N3.js";import"./Tool01-Cr7gkqqy.js";import"./ArrowUp-BAyh6hn8.js";import"./Tool02-CoTv5i2i.js";import"./XCircle-CENboZHz.js";import"./TrendUp01-DzptB_l4.js";import"./ZapSquare-C_gg8DXd.js";import"./CheckCircle-COyRqpAc.js";import"./ChevronDown-BDPQaZqS.js";import"./ChevronSelectorVertical-CbFyIO58.js";import"./ChevronUp-Ce84NoHt.js";import"./Stars02-Dz2PYLs6.js";import"./UserSquare-C2vbnCn3.js";import"./Copy01-zUJb2qyi.js";import"./CreditCard01-Dd3kG7iY.js";import"./Download01-sTnZ9m_H.js";import"./Eye-DBZt4RJc.js";import"./FilterLines-nlgwxkLs.js";import"./Share07-w7mz_Iae.js";import"./Globe01-B7mCeRBx.js";import"./Globe04-CW7pEZaX.js";import"./SwitchHorizontal01-DgxuO6JI.js";import"./HardDrive-Bd0W1jdP.js";import"./Key01-CYjm13lf.js";import"./LogOut01-D3UNWCpS.js";import"./Monitor01-vLem4C3L.js";import"./Sun-D5dGjwS7.js";import"./Palette-cc7S-N3h.js";import"./Play-Dse4KZ1O.js";import"./SearchLg-DGzbK_iQ.js";import"./SearchMd-CqROzn8s.js";import"./Shield01-B50p-i9H.js";import"./Stars01-C3_YhsfM.js";import"./Upload01-CvzK6gz-.js";import"./User01-BdqBw1KN.js";import"./Users01-BsgBtJMH.js";import"./XClose-DYwCESGN.js";import"./Zap-C_NQbDwT.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./hooks-BEfohZqo.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-P47eJQwa.js";import"./reusable-new-chat-CzvRy4Pe.js";function be(t){const e=ge.c(28),{onCreateFromScratch:s,onImportGitHub:n,onImportDeco:l,isCreating:g,align:r,side:R,showBetaBadge:h}=t,$=r===void 0?"end":r,d=me();let M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M=o.jsx(Oe,{size:14}),e[0]=M):M=e[0];let c;e[1]!==d?(c=d("common.createAgentDropdown.createFromScratch"),e[1]=d,e[2]=c):c=e[2];let D;e[3]!==g||e[4]!==s||e[5]!==c?(D=o.jsxs(ee,{disabled:g,onClick:s,children:[M,c]}),e[3]=g,e[4]=s,e[5]=c,e[6]=D):D=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Se,{className:"size-3.5"}),e[7]=x):x=e[7];let _;e[8]!==d?(_=d("common.createAgentDropdown.importFromGitHub"),e[8]=d,e[9]=_):_=e[9];let m;e[10]!==h?(m=h&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=h,e[11]=m):m=e[11];let a;e[12]!==n||e[13]!==_||e[14]!==m?(a=o.jsxs(ee,{onClick:n,children:[x,_,m]}),e[12]=n,e[13]=_,e[14]=m,e[15]=a):a=e[15];let f;e[16]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[16]=f):f=e[16];let v;e[17]!==d?(v=d("common.createAgentDropdown.importFromDeco"),e[17]=d,e[18]=v):v=e[18];let y;e[19]!==l||e[20]!==v?(y=o.jsxs(ee,{onClick:l,children:[f,v]}),e[19]=l,e[20]=v,e[21]=y):y=e[21];let C;return e[22]!==$||e[23]!==R||e[24]!==y||e[25]!==D||e[26]!==a?(C=o.jsxs(we,{side:R,align:$,className:"w-48",children:[D,a,y]}),e[22]=$,e[23]=R,e[24]=y,e[25]=D,e[26]=a,e[27]=C):C=e[27],C}function _t(t){const e=ge.c(78),{project:s,lastUsedAt:n,onDeleteClick:l}=t,g=ve(),r=me(),[R]=Ie(),h=R.language==="pt-BR"?Je:void 0,{mainAgentId:$}=Ye(),d=We(),{granted:M}=De("org:manage"),c=$===s.id,D=_e(),{isPrivileged:x}=Le();let _;e[0]!==x||e[1]!==s?(_=x&&Xe(s),e[0]=x,e[1]=s,e[2]=_):_=e[2];const m=_,a=!!s.pinned;let f;e[3]!==D.update||e[4]!==a||e[5]!==s.id?(f=()=>{D.update.mutate({id:s.id,data:{pinned:!a}})},e[3]=D.update,e[4]=a,e[5]=s.id,e[6]=f):f=e[6];const v=f;let y;e[7]!==c||e[8]!==s.id||e[9]!==s.title||e[10]!==d||e[11]!==r?(y=()=>{const E=c?null:s.id;d.mutate(E,{onSuccess:()=>le.success(c?r("home.projectCard.mainAgentUnset",{title:s.title}):r("home.projectCard.mainAgentSet",{title:s.title})),onError:()=>le.error(r("home.projectCard.mainAgentError"))})},e[7]=c,e[8]=s.id,e[9]=s.title,e[10]=d,e[11]=r,e[12]=y):y=e[12];const C=y;let V;e[13]!==g||e[14]!==s.id?(V=()=>g(s.id),e[13]=g,e[14]=s.id,e[15]=V):V=e[15];let G;e[16]!==s.title||e[17]!==V?(G=o.jsx("button",{type:"button",onClick:V,className:"absolute inset-0 z-0","aria-label":s.title}),e[16]=s.title,e[17]=V,e[18]=G):G=e[18];let K;e[19]!==s.icon||e[20]!==s.title?(K=o.jsx(He,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[19]=s.icon,e[20]=s.title,e[21]=K):K=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx(ue,{asChild:!0,children:o.jsx(re,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx($e,{size:20})})}),e[22]=k):k=e[22];let N;e[23]!==g||e[24]!==s.id?(N=()=>g(s.id,{search:{main:"settings"}}),e[23]=g,e[24]=s.id,e[25]=N):N=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx(qe,{size:16}),e[26]=O):O=e[26];let H;e[27]!==N?(H=o.jsxs(ee,{onClick:N,children:[O,"Settings"]}),e[27]=N,e[28]=H):H=e[28];let w;e[29]!==M||e[30]!==c||e[31]!==r||e[32]!==C?(w=M&&o.jsxs(ee,{onClick:E=>{E.stopPropagation(),C()},children:[o.jsx(fe,{size:16}),r(c?"home.projectCard.unsetMainAgent":"home.projectCard.setAsMainAgent")]}),e[29]=M,e[30]=c,e[31]=r,e[32]=C,e[33]=w):w=e[33];let i;e[34]!==m||e[35]!==a||e[36]!==r||e[37]!==v?(i=m&&o.jsxs(ee,{onClick:E=>{E.stopPropagation(),v()},children:[o.jsx(Ve,{size:16}),r(a?"home.projectCard.unpinFromSidebar":"home.projectCard.pinToSidebar")]}),e[34]=m,e[35]=a,e[36]=r,e[37]=v,e[38]=i):i=e[38];let u;e[39]!==l?(u=l&&o.jsxs(ee,{variant:"destructive",onClick:E=>{E.stopPropagation(),l(E)},children:[o.jsx(Qe,{size:16}),"Delete"]}),e[39]=l,e[40]=u):u=e[40];let p;e[41]!==H||e[42]!==w||e[43]!==i||e[44]!==u?(p=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(pe,{children:[k,o.jsxs(we,{align:"end",children:[H,w,i,u]})]})}),e[41]=H,e[42]=w,e[43]=i,e[44]=u,e[45]=p):p=e[45];let j;e[46]!==p||e[47]!==K?(j=o.jsxs("div",{className:"flex items-start justify-between",children:[K,p]}),e[46]=p,e[47]=K,e[48]=j):j=e[48];let S;e[49]!==s.title?(S=o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[49]=s.title,e[50]=S):S=e[50];let A;e[51]!==c||e[52]!==r?(A=c&&o.jsxs("span",{className:"shrink-0 inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:[o.jsx(fe,{size:12}),r("home.projectCard.mainAgentBadge")]}),e[51]=c,e[52]=r,e[53]=A):A=e[53];let I;e[54]!==S||e[55]!==A?(I=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[S,A]}),e[54]=S,e[55]=A,e[56]=I):I=e[56];const U=s.description||"No description";let z;e[57]!==U?(z=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:U}),e[57]=U,e[58]=z):z=e[58];let b;e[59]!==I||e[60]!==z?(b=o.jsxs("div",{className:"flex flex-col gap-1",children:[I,z]}),e[59]=I,e[60]=z,e[61]=b):b=e[61];let L;e[62]!==j||e[63]!==b?(L=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,b]}),e[62]=j,e[63]=b,e[64]=L):L=e[64];let T;e[65]!==n||e[66]!==h||e[67]!==s.updated_at||e[68]!==r?(T=n?r("home.projectCard.lastUsed",{time:he(new Date(n),{addSuffix:!0,locale:h})}):r("home.projectCard.updated",{time:he(new Date(s.updated_at),{addSuffix:!0,locale:h})}),e[65]=n,e[66]=h,e[67]=s.updated_at,e[68]=r,e[69]=T):T=e[69];let B;e[70]!==T?(B=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[70]=T,e[71]=B):B=e[71];let P;e[72]!==L||e[73]!==B?(P=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[L,B]}),e[72]=L,e[73]=B,e[74]=P):P=e[74];let q;return e[75]!==P||e[76]!==G?(q=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[G,P]}),e[75]=P,e[76]=G,e[77]=q):q=e[77],q}const vt="deco-sites";function Nt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,n=e.repo;return typeof s!="string"||typeof n!="string"||s.length===0||n.length===0?null:{owner:s,repo:n}}function At(t,e){const s=e?Nt(e):null,n=s?.owner??vt,l=s?.repo??t;return{owner:n,name:l,url:`https://github.com/${n}/${l}`}}function It(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const n=await fetch(t,e),l=await n.json().catch(()=>({}));if(!n.ok)throw new Error(l.error??`${s} (${n.status})`);return l}function Lt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Tt({open:t,onOpenChange:e,onBack:s}){const n=me(),{org:l}=ye(),g=ve(),r=Ee(),{data:R}=Fe.useSession(),[h,$]=Z.useState(null),[d,M]=Z.useState(null),[c,D]=Z.useState(""),x=xe({connectionId:ot,orgId:l.id,orgSlug:l.slug}),_=tt({slug:"mcp-github"}),m=it(_),a=ze({enabled:t&&m.length===0}),f=m.length===1?m[0]??null:d,v=m.length>1&&!f,y=xe({connectionId:f?.id??"",orgId:l.id,orgSlug:l.slug}),C=t&&m.length===0&&(a.status==="installing"||a.status==="authenticating"||a.status==="idle"),{data:V,isLoading:G,error:K}=ke({queryKey:de.decoSites(R?.user?.email),queryFn:()=>Lt(l.slug),enabled:t&&!!R?.user?.email,staleTime:6e4,retry:!1}),k=V?.sites??[],N=i=>{i||($(null),M(null),D("")),e(i)},O=k.filter(i=>i.name.toLowerCase().includes(c.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(c.toLowerCase())??!1)),H=!h||O.some(i=>i.name===h),w=Pe({mutationFn:async i=>{if(!f)throw new Error(n("common.importFromDecoDialog.githubNotConnected"));Y("deco_site_import_started",{site_name:i});const{installations:u}=await nt(b=>x.callTool(b),f.id),p=k.find(b=>b.name===i);if(!p)throw new Error(n("common.importFromDecoDialog.siteNoLongerAvailable"));const j=At(i,p.metadata),S=rt(u,j.owner);if(!S)throw new Error(n("common.importFromDecoDialog.installGithubApp",{owner:j.owner,installUrl:lt}));let A=null,I=null,U=null;const z=async()=>{U&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:U}}).catch(()=>{}),I&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:I,force:!0}}).catch(()=>{}),A&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:A,force:!0}}).catch(()=>{})};try{const b=await Ne(`/api/${l.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},n("common.importFromDecoDialog.failedToCreateConnection")),L=b.connId;if(!L)throw new Error(n("common.importFromDecoDialog.noConnectionId"));A=L;const{childConnectionId:T,reused:B}=await at({orgSlug:l.slug,sourceConnection:f,installationId:S.installationId,owner:j.owner,repo:j.name,githubCallTool:J=>y.callTool(J),selfCallTool:J=>x.callTool(J)});I=B?null:T;const P=b.icon??null,q=It(i),E=i.toLowerCase(),W=st(je(p.domains)),X=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:P??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:E,previewServerUrl:W,productionUrl:W,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:S.installationId,connectionId:T},ui:{banner:null,bannerColor:"#22C55E",icon:P,themeColor:"#22C55E",slug:q,pinnedViews:[{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:L},{connection_id:T}]}}}),Q=X.structuredContent??X;if(!Q.item?.id)throw new Error(n("common.importFromDecoDialog.failedToCreateAgent"));return U=Q.item.id,{slug:q,virtualMcpId:Q.item.id,connId:L,item:Q.item}}catch(b){throw await z(),b}},onSuccess:({slug:i,virtualMcpId:u,item:p})=>{Y("deco_site_import_succeeded",{site_name:p.title,virtual_mcp_id:u,slug:i}),r.setQueryData(de.collectionItem(x,l.id,"","VIRTUAL_MCP",u),{item:p}),r.invalidateQueries({predicate:j=>{const S=j.queryKey;return S[1]===l.id&&S[3]==="collection"&&S[4]==="VIRTUAL_MCP"}}),r.invalidateQueries({queryKey:de.projects(l.id)}),le.success(n("common.importFromDecoDialog.importSuccess",{slug:i})),N(!1),localStorage.setItem(Me.sidebarOpen(),JSON.stringify(!1)),g(u)},onError:i=>{Y("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),le.error(n("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:n("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(ct,{open:t,onOpenChange:N,children:o.jsxs(mt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(dt,{className:"sr-only",children:o.jsx(ut,{children:n("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":n("common.importFromDecoDialog.goBack"),children:o.jsx(gt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:n("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ft,{value:c,onChange:D,placeholder:n("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&D("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[a.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:a.error??n("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(re,{variant:"outline",size:"sm",onClick:a.retry,children:n("common.importFromDecoDialog.retryGithubSetup")})]}),C&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.settingUpGithub")}),v&&!C&&a.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:n("common.importFromDecoDialog.selectGithubConnection")})}),m.map(i=>o.jsxs("button",{type:"button",onClick:()=>M(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(Se,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),G&&!C&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.loadingSites")}),!G&&!C&&!v&&a.status!=="error"&&!K&&k.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:n("common.importFromDecoDialog.noSitesFound")}),!G&&!C&&!v&&a.status!=="error"&&k.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[O.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:n("common.importFromDecoDialog.noSitesMatch",{search:c})}),O.map(i=>{const u=je(i.domains),p=h===i.name;return o.jsxs("button",{type:"button",onClick:()=>$(i.name),className:Ge("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",p?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),u&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:u})]})]},i.name)})]})]}),o.jsxs(pt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(re,{variant:"outline",onClick:()=>N(!1),disabled:w.isPending,children:n("common.importFromDecoDialog.cancel")}),o.jsx(re,{disabled:!h||!H||w.isPending||G||C||v||!f||a.status==="error",onClick:()=>h&&w.mutate(h),children:w.isPending?n("common.importFromDecoDialog.importing"):n("common.importFromDecoDialog.import")})]})]})})}function ls(){const t=ge.c(77),e=me(),{org:s}=ye(),n=Ue(),l=_e(),[g,r]=Z.useState("");let R;t[0]===Symbol.for("react.memo_cache_sentinel")?(R={navigateOnCreate:!0},t[0]=R):R=t[0];const{createVirtualMCP:h,isCreating:$}=et(R),[d,M]=Z.useState(null),[c,D]=Z.useState(!1),[x,_]=Z.useState(!1),{granted:m}=De("agents:manage"),a=g.toLowerCase(),f=n.filter(F=>F.id!==s.id&&(F.title.toLowerCase().includes(a)||F.description?.toLowerCase().includes(a))),{data:v}=Re(f.map(Et));let y;t[1]!==l||t[2]!==d||t[3]!==e?(y=async()=>{if(!d)return;const{id:F,title:Ae}=d;M(null);try{await l.delete.mutateAsync(F),Y("agent_deleted",{agent_id:F,source:"agents_list"}),le.success(e("routes.agentsList.deletedAgent",{title:Ae}))}catch{}},t[1]=l,t[2]=d,t[3]=e,t[4]=y):y=t[4];const C=y,V=ce,G=ce,K=ce;let k;t[5]!==e?(k=e("routes.agentsList.title"),t[5]=e,t[6]=k):k=t[6];let N;t[7]!==k?(N=o.jsx(ce.Title,{children:k}),t[7]=k,t[8]=N):N=t[8];let O;t[9]!==e?(O=e("routes.agentsList.searchPlaceholder"),t[9]=e,t[10]=O):O=t[10];let H;t[11]===Symbol.for("react.memo_cache_sentinel")?(H=F=>{F.key==="Escape"&&(r(""),F.target.blur())},t[11]=H):H=t[11];let w;t[12]!==g||t[13]!==O?(w=o.jsx(St,{value:g,onChange:r,placeholder:O,className:"w-full md:w-[375px]",onKeyDown:H}),t[12]=g,t[13]=O,t[14]=w):w=t[14];let i;t[15]!==m||t[16]!==h||t[17]!==$||t[18]!==e?(i=m&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(re,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{Y("agent_create_clicked",{source:"agents_list",method:"scratch"}),h()},onImportGitHub:()=>{Y("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{Y("agent_create_clicked",{source:"agents_list",method:"deco"}),D(!0)},isCreating:$,align:"end"})]}),t[15]=m,t[16]=h,t[17]=$,t[18]=e,t[19]=i):i=t[19];let u;t[20]!==w||t[21]!==i?(u=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[w,i]}),t[20]=w,t[21]=i,t[22]=u):u=t[22];let p;t[23]!==u||t[24]!==N?(p=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,u]}),t[23]=u,t[24]=N,t[25]=p):p=t[25];const j=f.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ze,{image:o.jsx(Ke,{size:48,className:"text-muted-foreground"}),title:e(g?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:g?e("routes.agentsList.noAgentsMatchSearch",{search:g}):e(m?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!g&&m&&o.jsxs(pe,{children:[o.jsx(ue,{asChild:!0,children:o.jsxs(re,{size:"sm",children:[o.jsx(Ce,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(be,{onCreateFromScratch:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),h()},onImportGitHub:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{Y("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),D(!0)},isCreating:$,align:"center",showBetaBadge:!0})]})})}),S=f.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:f.map(F=>o.jsx(_t,{project:F,lastUsedAt:v?.get(F.id)?.last_used_at,onDeleteClick:m?()=>M({id:F.id,title:F.title}):void 0},F.id))})]});let A;t[26]!==p||t[27]!==j||t[28]!==S||t[29]!==K.Body?(A=o.jsxs(K.Body,{children:[p,j,S]}),t[26]=p,t[27]=j,t[28]=S,t[29]=K.Body,t[30]=A):A=t[30];let I;t[31]!==A||t[32]!==G.Content?(I=o.jsx(G.Content,{children:A}),t[31]=A,t[32]=G.Content,t[33]=I):I=t[33];let U;t[34]!==x?(U=o.jsx(Be,{open:x,onOpenChange:_}),t[34]=x,t[35]=U):U=t[35];let z;t[36]!==c?(z=o.jsx(Tt,{open:c,onOpenChange:D}),t[36]=c,t[37]=z):z=t[37];const b=!!d;let L;t[38]===Symbol.for("react.memo_cache_sentinel")?(L=F=>!F&&M(null),t[38]=L):L=t[38];let T;t[39]!==e?(T=e("routes.agentsList.deleteAgentTitle"),t[39]=e,t[40]=T):T=t[40];let B;t[41]!==T?(B=o.jsx(ht,{children:T}),t[41]=T,t[42]=B):B=t[42];let P;t[43]!==e?(P=e("routes.agentsList.deleteAgentDescription"),t[43]=e,t[44]=P):P=t[44];const q=d?.title;let E;t[45]!==q?(E=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[45]=q,t[46]=E):E=t[46];let W;t[47]!==P||t[48]!==E?(W=o.jsxs(xt,{children:[P," ",E,"."]}),t[47]=P,t[48]=E,t[49]=W):W=t[49];let X;t[50]!==B||t[51]!==W?(X=o.jsxs(jt,{children:[B,W]}),t[50]=B,t[51]=W,t[52]=X):X=t[52];let Q;t[53]!==e?(Q=e("routes.agentsList.cancelButton"),t[53]=e,t[54]=Q):Q=t[54];let J;t[55]!==Q?(J=o.jsx(Ct,{children:Q}),t[55]=Q,t[56]=J):J=t[56];let te;t[57]!==e?(te=e("routes.agentsList.deleteButton"),t[57]=e,t[58]=te):te=t[58];let oe;t[59]!==C||t[60]!==te?(oe=o.jsx(bt,{onClick:C,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:te}),t[59]=C,t[60]=te,t[61]=oe):oe=t[61];let se;t[62]!==J||t[63]!==oe?(se=o.jsxs(Dt,{children:[J,oe]}),t[62]=J,t[63]=oe,t[64]=se):se=t[64];let ie;t[65]!==X||t[66]!==se?(ie=o.jsxs(yt,{children:[X,se]}),t[65]=X,t[66]=se,t[67]=ie):ie=t[67];let ne;t[68]!==b||t[69]!==ie?(ne=o.jsx(wt,{open:b,onOpenChange:L,children:ie}),t[68]=b,t[69]=ie,t[70]=ne):ne=t[70];let ae;return t[71]!==V||t[72]!==I||t[73]!==U||t[74]!==z||t[75]!==ne?(ae=o.jsxs(V,{children:[I,U,z,ne]}),t[71]=V,t[72]=I,t[73]=U,t[74]=z,t[75]=ne,t[76]=ae):ae=t[76],ae}function Et(t){return t.id}export{ls as default};
@@ -1,4 +1,4 @@
1
- import{c as G,b as se,ay as Qe,ax as Ye,r as Q,j as s,az as gt,d9 as Te,t as ee,d8 as be,d7 as Ee,b1 as We,df as Xe,dg as xt,n as Pe,aX as ht,H as ye,ac as le,K as J,o as De,B as Z,k as $e,Y as Ie,p as Se,e as re,x as Ze,q as Fe,ak as vt,an as we,db as bt}from"./index-BbGRbO2s.js";import{i as yt}from"./AlertCircle-CkPwmuKt.js";import{u as Je,b as _e,i as jt,c as St,p as Nt,d as Re,e as Ct,f as et}from"./use-ai-providers-tkH2P36o.js";import{i as _t}from"./CheckCircle-Byfr8GRo.js";import{c as Pt,S as It,k as kt}from"./use-organization-settings-DxGOoKYL.js";import{c as Dt,u as Ue,d as tt,P as Kt,C as ze}from"./select-model-CMJQRlhd.js";import{u as wt}from"./use-debounced-autosave-DbmG2nK6.js";import{i as Be}from"./CreditCard01-CTvH4Ctz.js";import{B as Ae}from"./badge-Csyaxznr.js";import{I as je}from"./input-BIK5hdJU.js";import{a as He,T as At}from"./toggle-group-BsJyDLZw.js";import{c as st,d as it,b as lt,f as rt,g as nt,e as ot,a as at,A as ct}from"./alert-dialog-xAkhsUZ9.js";import{s as Tt}from"./Plus-_clBcs48.js";import{p as Et,f as Rt}from"./pt-BR-CLy76QW2.js";import{b as Mt}from"./Tool01-CKdFlI5A.js";import{s as Ot}from"./Trash01-CeIegB-4.js";import{A as $t}from"./avatar-Ch1MTXS-.js";import{P as Ft}from"./ai-providers-logos-DD3qZ33J.js";import{i as Ut}from"./Settings02-Br92bn2T.js";import{s as zt}from"./Eye-Dud-kvJl.js";import{b as Bt,a as Ht,d as qt,e as Lt,c as Vt}from"./dialog-O072o8Oc.js";import{S as Gt}from"./spinner-75C-IUje.js";import{R as Qt}from"./require-capability-wUMdvtTV.js";import"./constants-z9Iog-sb.js";import"./drawer-D6TLZjdo.js";import"./chat-context-C4hTesgw.js";import"./tab-id-Besg8sQE.js";import"./Check-C7msqNgq.js";import"./Copy01-C4YK8X63.js";import"./Download01-qJq3S2UO.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-B6kpT11G.js";import"./use-mcp-client-C9-YbjTx.js";import"./auth-4owgu1uZ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-D75XD9J2.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BIgbLEnA.js";import"./use-decopilot-events-TMtnOnoS.js";import"./checkbox-DJVXViCm.js";import"./select-BgBUKtcQ.js";import"./ChevronDown-BqUHNjui.js";import"./ChevronUp-DFNYR7MJ.js";import"./ArrowLeft-Cj7J7Py6.js";import"./ChevronSelectorVertical-C-TawfyU.js";import"./Key01-DYVtQyL5.js";import"./SearchMd-BwZ89rxP.js";import"./Monitor01-BGi_X3fN.js";import"./ChevronRight-KbHVuEl0.js";import"./Stars01-D3NIP1DL.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-BHSfVgcn.js";import"./access-gate-CsBTprll.js";import"./capability-load-error-CWVf5xY_.js";const Yt=e=>e.capabilities?.includes("image")===!0,Wt=e=>jt(e),Xt=e=>St(e),Zt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Yt},{key:"web_search",filter:Wt},{key:"deep_research",filter:Xt}];function Jt(e){const t=G.c(30),{slot:i,onSlotChange:r,filterModels:n,defaultKeyId:a}=e,c=Je(),l=c.some(b=>b.id===i?.keyId)?i?.keyId:null,[d,h]=Q.useState(l??a);let _,o;t[0]!==l?(_=()=>{l&&h(l)},o=[l],t[0]=l,t[1]=_,t[2]=o):(_=t[1],o=t[2]),Q.useEffect(_,o);let u;t[3]!==c||t[4]!==a||t[5]!==d?(u=c.some(b=>b.id===d)?d:a,t[3]=c,t[4]=a,t[5]=d,t[6]=u):u=t[6];const f=u;let p;t[7]!==f||t[8]!==c?(p=f?c.find(b=>b.id===f):null,t[7]=f,t[8]=c,t[9]=p):p=t[9];const y=p,{models:j,isLoading:P}=_e(n?f??void 0:void 0),x=n?P||j.some(n):!0;let C;t[10]!==i||t[11]!==y?.providerId||t[12]!==l?(C=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:y?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=y?.providerId,t[12]=l,t[13]=C):C=t[13];const k=C,g=se();if(n&&!x){let b;t[14]!==g?(b=g("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=g,t[15]=b):b=t[15];let D;return t[16]!==b?(D=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[16]=b,t[17]=D):D=t[17],D}let v;t[18]!==g?(v=g("settings.simpleModeSection.pickModel"),t[18]=g,t[19]=v):v=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=b=>h(b),t[20]=S):S=t[20];let m;t[21]!==f||t[22]!==r?(m=b=>{const D=b.keyId??f??"";h(D),r({keyId:D,modelId:b.modelId,title:b.title})},t[21]=f,t[22]=r,t[23]=m):m=t[23];let N;return t[24]!==f||t[25]!==n||t[26]!==k||t[27]!==v||t[28]!==m?(N=s.jsx(Dt,{variant:"bordered",placeholder:v,model:k,credentialId:f,filterModels:n,onCredentialChange:S,onModelChange:m}),t[24]=f,t[25]=n,t[26]=k,t[27]=v,t[28]=m,t[29]=N):N=t[29],N}function es(e){const t=G.c(10),{isPending:i,showSaved:r}=e,n=se();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(We,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(_t,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function ts(){const e=G.c(58),t=se(),i=Je(),r=Pt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Qe(It),e[0]=a):a=e[0];let c;e[1]!==r?(c={resolver:a,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Ye(c),{mutate:d,isPending:h,isSuccess:_}=kt(),o=l.formState.isDirty;let u;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(u={delayMs:250,save:async()=>{const I=l.getValues();d(I,{onSuccess:()=>l.reset(I,{keepValues:!0}),onError:T=>{l.reset(r),ee.error(t("settings.simpleModeSection.failedToSave",{error:T.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=u):u=e[7];const{schedule:f}=wt(u),p=i[0],y=i[1],j=i[2],{models:P}=_e(p?.id),{models:x}=_e(y?.id),{models:C}=_e(j?.id);let k,g;e[8]!==l||e[9]!==n?(k=()=>{n||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},g=[n,l],e[8]=l,e[9]=n,e[10]=k,e[11]=g):(k=e[10],g=e[11]),Q.useEffect(k,g);let v;e[12]!==i||e[13]!==l||e[14]!==p||e[15]!==y||e[16]!==j||e[17]!==P||e[18]!==x||e[19]!==C?(v=()=>{const I=l.getValues(),T=new Set(i.map(ss)),O={};p?.id&&(O[p.id]=P),y?.id&&(O[y.id]=x),j?.id&&(O[j.id]=C);const R=Y=>Y!=null&&!T.has(Y.keyId),K={fast:R(I.tiers.fast)?null:I.tiers.fast,smart:R(I.tiers.smart)?null:I.tiers.smart,thinking:R(I.tiers.thinking)?null:I.tiers.thinking,image:R(I.tiers.image)?null:I.tiers.image,web_search:R(I.tiers.web_search)?null:I.tiers.web_search,deep_research:R(I.tiers.deep_research)?null:I.tiers.deep_research},W=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,X=K.fast===I.tiers.fast&&K.smart===I.tiers.smart&&K.thinking===I.tiers.thinking&&K.image===I.tiers.image&&K.web_search===I.tiers.web_search&&K.deep_research===I.tiers.deep_research;if(!W&&X)return;const V=Nt(i,O);l.reset({tiers:{fast:K.fast??V.chat.fast,smart:K.smart??V.chat.smart,thinking:K.thinking??V.chat.thinking,image:K.image??V.image,web_search:K.web_search??V.webSearch,deep_research:K.deep_research??V.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=p,e[15]=y,e[16]=j,e[17]=P,e[18]=x,e[19]=C,e[20]=v):v=e[20];const S=p?.id,m=y?.id,N=j?.id;let b;e[21]!==i||e[22]!==l||e[23]!==P||e[24]!==x||e[25]!==C||e[26]!==S||e[27]!==m||e[28]!==N?(b=[l,i,P,x,C,S,m,N],e[21]=i,e[22]=l,e[23]=P,e[24]=x,e[25]=C,e[26]=S,e[27]=m,e[28]=N,e[29]=b):b=e[29],Q.useEffect(v,b);let D;e[30]!==t?(D=I=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[I]||I,e[30]=t,e[31]=D):D=e[31];const w=D;let A;e[32]!==t?(A=I=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[I]||"",e[32]=t,e[33]=A):A=e[33];const M=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let $;e[36]!==t?($=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=$):$=e[37];let H;e[38]!==$?(H=s.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=H):H=e[39];const L=_&&!o;let F;e[40]!==h||e[41]!==L?(F=s.jsx(es,{isPending:h,showSaved:L}),e[40]=h,e[41]=L,e[42]=F):F=e[42];let U;e[43]!==H||e[44]!==F?(U=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[H,F]}),e[43]=H,e[44]=F,e[45]=U):U=e[45];let z;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==M||e[49]!==w||e[50]!==f?(z=Zt.map(I=>s.jsx(gt,{control:l.control,name:`tiers.${I.key}`,render:T=>{const{field:O}=T;return s.jsx(Te,{title:w(I.key),description:M(I.key),action:s.jsx(Jt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:I.filter,onSlotChange:R=>{O.onChange(R),f()}})})}},I.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=M,e[49]=w,e[50]=f,e[51]=z):z=e[51];let B;e[52]!==z?(B=s.jsx(be,{children:z}),e[52]=z,e[53]=B):B=e[53];let q;return e[54]!==E||e[55]!==U||e[56]!==B?(q=s.jsxs(Ee,{title:E,headerClassName:"pl-0",children:[U,B]}),e[54]=E,e[55]=U,e[56]=B,e[57]=q):q=e[57],q}function ss(e){return e.id}var Me="Progress",Oe=100,[is]=xt(Me),[ls,rs]=is(Me),dt=Q.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:n,getValueLabel:a=ns,...c}=e;(n||n===0)&&!qe(n)&&console.error(os(`${n}`,"Progress"));const l=qe(n)?n:Oe;r!==null&&!Le(r,l)&&console.error(as(`${r}`,"Progress"));const d=Le(r,l)?r:null,h=ke(d)?a(d,l):void 0;return s.jsx(ls,{scope:i,value:d,max:l,children:s.jsx(Xe.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":ke(d)?d:void 0,"aria-valuetext":h,role:"progressbar","data-state":ft(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});dt.displayName=Me;var mt="ProgressIndicator",ut=Q.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,n=rs(mt,i);return s.jsx(Xe.div,{"data-state":ft(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...r,ref:t})});ut.displayName=mt;function ns(e,t){return`${Math.round(e/t*100)}%`}function ft(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ke(e){return typeof e=="number"}function qe(e){return ke(e)&&!isNaN(e)&&e>0}function Le(e,t){return ke(e)&&!isNaN(e)&&e<=t&&e>=0}function os(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Oe}\`.`}function as(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
1
+ import{c as G,b as se,ay as Qe,ax as Ye,r as Q,j as s,az as gt,d9 as Te,t as ee,d8 as be,d7 as Ee,b1 as We,df as Xe,dg as xt,n as Pe,aX as ht,H as ye,ac as le,K as J,o as De,B as Z,k as $e,Y as Ie,p as Se,e as re,x as Ze,q as Fe,ak as vt,an as we,db as bt}from"./index-DuKgaDRT.js";import{i as yt}from"./AlertCircle-q-ha89N3.js";import{u as Je,b as _e,i as jt,c as St,p as Nt,d as Re,e as Ct,f as et}from"./use-ai-providers-XXnxR_Zu.js";import{i as _t}from"./CheckCircle-COyRqpAc.js";import{c as Pt,S as It,k as kt}from"./use-organization-settings-D6-lnE8v.js";import{c as Dt,u as Ue,d as tt,P as Kt,C as ze}from"./select-model-DxJOIebh.js";import{u as wt}from"./use-debounced-autosave-BkTJ_3l3.js";import{i as Be}from"./CreditCard01-Dd3kG7iY.js";import{B as Ae}from"./badge-C8_JqgY7.js";import{I as je}from"./input-rGj3HLrx.js";import{a as He,T as At}from"./toggle-group-D7gbO6Ao.js";import{c as st,d as it,b as lt,f as rt,g as nt,e as ot,a as at,A as ct}from"./alert-dialog-DrDfeFyK.js";import{s as Tt}from"./Plus-CAe31wl2.js";import{p as Et,f as Rt}from"./pt-BR-CLy76QW2.js";import{b as Mt}from"./Tool01-Cr7gkqqy.js";import{s as Ot}from"./Trash01-DbfWjlZd.js";import{A as $t}from"./avatar-BnQPHMLw.js";import{P as Ft}from"./ai-providers-logos-DD3qZ33J.js";import{i as Ut}from"./Settings02-BxdfBQ5Y.js";import{s as zt}from"./Eye-DBZt4RJc.js";import{b as Bt,a as Ht,d as qt,e as Lt,c as Vt}from"./dialog-VBR_VTpJ.js";import{S as Gt}from"./spinner-DUUWxaw4.js";import{R as Qt}from"./require-capability-BSF86YHK.js";import"./constants-z9Iog-sb.js";import"./drawer-BOKsWH4_.js";import"./chat-context-CK0SAWg7.js";import"./tab-id-xRw9s49x.js";import"./Check-8BnM7tpC.js";import"./Copy01-zUJb2qyi.js";import"./Download01-sTnZ9m_H.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-BEfohZqo.js";import"./use-mcp-client-DEWnugV9.js";import"./auth-Dg5sPbT4.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-P47eJQwa.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Dds4BZbz.js";import"./use-decopilot-events-B9ygDv-h.js";import"./checkbox-D6aL5Ben.js";import"./select-Dw0yz6R3.js";import"./ChevronDown-BDPQaZqS.js";import"./ChevronUp-Ce84NoHt.js";import"./ArrowLeft-BAk90rdd.js";import"./ChevronSelectorVertical-CbFyIO58.js";import"./Key01-CYjm13lf.js";import"./SearchMd-CqROzn8s.js";import"./Monitor01-vLem4C3L.js";import"./ChevronRight-BoCweSJs.js";import"./Stars01-C3_YhsfM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./User01-BdqBw1KN.js";import"./access-gate-B-oxihSz.js";import"./capability-load-error-BEeb9Z6k.js";const Yt=e=>e.capabilities?.includes("image")===!0,Wt=e=>jt(e),Xt=e=>St(e),Zt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:Yt},{key:"web_search",filter:Wt},{key:"deep_research",filter:Xt}];function Jt(e){const t=G.c(30),{slot:i,onSlotChange:r,filterModels:n,defaultKeyId:a}=e,c=Je(),l=c.some(b=>b.id===i?.keyId)?i?.keyId:null,[d,h]=Q.useState(l??a);let _,o;t[0]!==l?(_=()=>{l&&h(l)},o=[l],t[0]=l,t[1]=_,t[2]=o):(_=t[1],o=t[2]),Q.useEffect(_,o);let u;t[3]!==c||t[4]!==a||t[5]!==d?(u=c.some(b=>b.id===d)?d:a,t[3]=c,t[4]=a,t[5]=d,t[6]=u):u=t[6];const f=u;let p;t[7]!==f||t[8]!==c?(p=f?c.find(b=>b.id===f):null,t[7]=f,t[8]=c,t[9]=p):p=t[9];const y=p,{models:j,isLoading:P}=_e(n?f??void 0:void 0),x=n?P||j.some(n):!0;let C;t[10]!==i||t[11]!==y?.providerId||t[12]!==l?(C=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:y?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=y?.providerId,t[12]=l,t[13]=C):C=t[13];const k=C,g=se();if(n&&!x){let b;t[14]!==g?(b=g("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=g,t[15]=b):b=t[15];let D;return t[16]!==b?(D=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[16]=b,t[17]=D):D=t[17],D}let v;t[18]!==g?(v=g("settings.simpleModeSection.pickModel"),t[18]=g,t[19]=v):v=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=b=>h(b),t[20]=S):S=t[20];let m;t[21]!==f||t[22]!==r?(m=b=>{const D=b.keyId??f??"";h(D),r({keyId:D,modelId:b.modelId,title:b.title})},t[21]=f,t[22]=r,t[23]=m):m=t[23];let N;return t[24]!==f||t[25]!==n||t[26]!==k||t[27]!==v||t[28]!==m?(N=s.jsx(Dt,{variant:"bordered",placeholder:v,model:k,credentialId:f,filterModels:n,onCredentialChange:S,onModelChange:m}),t[24]=f,t[25]=n,t[26]=k,t[27]=v,t[28]=m,t[29]=N):N=t[29],N}function es(e){const t=G.c(10),{isPending:i,showSaved:r}=e,n=se();if(i){let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(We,{size:12,className:"animate-spin"}),t[0]=a):a=t[0];let c;t[1]!==n?(c=n("settings.simpleModeSection.saving"),t[1]=n,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(_t,{size:12}),t[5]=a):a=t[5];let c;t[6]!==n?(c=n("settings.simpleModeSection.saved"),t[6]=n,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function ts(){const e=G.c(58),t=se(),i=Je(),r=Pt(),n=i.length>0;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Qe(It),e[0]=a):a=e[0];let c;e[1]!==r?(c={resolver:a,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Ye(c),{mutate:d,isPending:h,isSuccess:_}=kt(),o=l.formState.isDirty;let u;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(u={delayMs:250,save:async()=>{const I=l.getValues();d(I,{onSuccess:()=>l.reset(I,{keepValues:!0}),onError:T=>{l.reset(r),ee.error(t("settings.simpleModeSection.failedToSave",{error:T.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=u):u=e[7];const{schedule:f}=wt(u),p=i[0],y=i[1],j=i[2],{models:P}=_e(p?.id),{models:x}=_e(y?.id),{models:C}=_e(j?.id);let k,g;e[8]!==l||e[9]!==n?(k=()=>{n||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},g=[n,l],e[8]=l,e[9]=n,e[10]=k,e[11]=g):(k=e[10],g=e[11]),Q.useEffect(k,g);let v;e[12]!==i||e[13]!==l||e[14]!==p||e[15]!==y||e[16]!==j||e[17]!==P||e[18]!==x||e[19]!==C?(v=()=>{const I=l.getValues(),T=new Set(i.map(ss)),O={};p?.id&&(O[p.id]=P),y?.id&&(O[y.id]=x),j?.id&&(O[j.id]=C);const R=Y=>Y!=null&&!T.has(Y.keyId),K={fast:R(I.tiers.fast)?null:I.tiers.fast,smart:R(I.tiers.smart)?null:I.tiers.smart,thinking:R(I.tiers.thinking)?null:I.tiers.thinking,image:R(I.tiers.image)?null:I.tiers.image,web_search:R(I.tiers.web_search)?null:I.tiers.web_search,deep_research:R(I.tiers.deep_research)?null:I.tiers.deep_research},W=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,X=K.fast===I.tiers.fast&&K.smart===I.tiers.smart&&K.thinking===I.tiers.thinking&&K.image===I.tiers.image&&K.web_search===I.tiers.web_search&&K.deep_research===I.tiers.deep_research;if(!W&&X)return;const V=Nt(i,O);l.reset({tiers:{fast:K.fast??V.chat.fast,smart:K.smart??V.chat.smart,thinking:K.thinking??V.chat.thinking,image:K.image??V.image,web_search:K.web_search??V.webSearch,deep_research:K.deep_research??V.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=p,e[15]=y,e[16]=j,e[17]=P,e[18]=x,e[19]=C,e[20]=v):v=e[20];const S=p?.id,m=y?.id,N=j?.id;let b;e[21]!==i||e[22]!==l||e[23]!==P||e[24]!==x||e[25]!==C||e[26]!==S||e[27]!==m||e[28]!==N?(b=[l,i,P,x,C,S,m,N],e[21]=i,e[22]=l,e[23]=P,e[24]=x,e[25]=C,e[26]=S,e[27]=m,e[28]=N,e[29]=b):b=e[29],Q.useEffect(v,b);let D;e[30]!==t?(D=I=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[I]||I,e[30]=t,e[31]=D):D=e[31];const w=D;let A;e[32]!==t?(A=I=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[I]||"",e[32]=t,e[33]=A):A=e[33];const M=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let $;e[36]!==t?($=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=$):$=e[37];let H;e[38]!==$?(H=s.jsx("p",{className:"text-sm text-muted-foreground",children:$}),e[38]=$,e[39]=H):H=e[39];const L=_&&!o;let F;e[40]!==h||e[41]!==L?(F=s.jsx(es,{isPending:h,showSaved:L}),e[40]=h,e[41]=L,e[42]=F):F=e[42];let U;e[43]!==H||e[44]!==F?(U=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[H,F]}),e[43]=H,e[44]=F,e[45]=U):U=e[45];let z;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==M||e[49]!==w||e[50]!==f?(z=Zt.map(I=>s.jsx(gt,{control:l.control,name:`tiers.${I.key}`,render:T=>{const{field:O}=T;return s.jsx(Te,{title:w(I.key),description:M(I.key),action:s.jsx(Jt,{slot:O.value,defaultKeyId:i[0]?.id??null,filterModels:I.filter,onSlotChange:R=>{O.onChange(R),f()}})})}},I.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=M,e[49]=w,e[50]=f,e[51]=z):z=e[51];let B;e[52]!==z?(B=s.jsx(be,{children:z}),e[52]=z,e[53]=B):B=e[53];let q;return e[54]!==E||e[55]!==U||e[56]!==B?(q=s.jsxs(Ee,{title:E,headerClassName:"pl-0",children:[U,B]}),e[54]=E,e[55]=U,e[56]=B,e[57]=q):q=e[57],q}function ss(e){return e.id}var Me="Progress",Oe=100,[is]=xt(Me),[ls,rs]=is(Me),dt=Q.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:n,getValueLabel:a=ns,...c}=e;(n||n===0)&&!qe(n)&&console.error(os(`${n}`,"Progress"));const l=qe(n)?n:Oe;r!==null&&!Le(r,l)&&console.error(as(`${r}`,"Progress"));const d=Le(r,l)?r:null,h=ke(d)?a(d,l):void 0;return s.jsx(ls,{scope:i,value:d,max:l,children:s.jsx(Xe.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":ke(d)?d:void 0,"aria-valuetext":h,role:"progressbar","data-state":ft(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});dt.displayName=Me;var mt="ProgressIndicator",ut=Q.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,n=rs(mt,i);return s.jsx(Xe.div,{"data-state":ft(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...r,ref:t})});ut.displayName=mt;function ns(e,t){return`${Math.round(e/t*100)}%`}function ft(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ke(e){return typeof e=="number"}function qe(e){return ke(e)&&!isNaN(e)&&e>0}function Le(e,t){return ke(e)&&!isNaN(e)&&e<=t&&e>=0}function os(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Oe}\`.`}function as(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2
2
  - a positive number
3
3
  - less than the value passed to \`max\` (or ${Oe} if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.
@@ -1 +1 @@
1
- import{c as n,n as o,j as c,bu as d}from"./index-BbGRbO2s.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
1
+ import{c as n,n as o,j as c,bu as d}from"./index-DuKgaDRT.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{f as A,x as a,v as b};
@@ -1,4 +1,4 @@
1
- import{r as i,j as r,dH as w,dI as T,bo as m,dM as A,eK as O,J as M,bq as I,dG as L,eL as D,dJ as z,eM as F,bm as G,dL as H,dK as k,c as n,n as p,bt as v}from"./index-BbGRbO2s.js";var x="AlertDialog",[q]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var J="AlertDialogTrigger",K=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});K.displayName=J;var V="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=V;var W="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});_.displayName=W;var f="AlertDialogContent",[Y,B]=q(f),Q=F("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(Y,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=B($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
1
+ import{r as i,j as r,dH as w,dI as T,bo as m,dM as A,eK as O,J as M,bq as I,dG as L,eL as D,dJ as z,eM as F,bm as G,dL as H,dK as k,c as n,n as p,bt as v}from"./index-DuKgaDRT.js";var x="AlertDialog",[q]=G(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var J="AlertDialogTrigger",K=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});K.displayName=J;var V="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=V;var W="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(k,{...o,...a,ref:e})});_.displayName=W;var f="AlertDialogContent",[Y,B]=q(f),Q=F("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(Y,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});R.displayName=E;var U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=B($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
@@ -1 +1 @@
1
- import{c as v,j as t,db as se,b as F,r as L,B as N,t as R}from"./index-BbGRbO2s.js";import{i as ie}from"./AlertCircle-CkPwmuKt.js";import{a as le}from"./Copy01-C4YK8X63.js";import{i as J}from"./Key01-DYVtQyL5.js";import{s as M}from"./Plus-_clBcs48.js";import{s as ne}from"./Trash01-CeIegB-4.js";import{A as ae,a as re,b as oe,c as ce,d as de,e as me,f as fe,g as pe}from"./alert-dialog-xAkhsUZ9.js";import{b as Q,h as U,a as V,c as W,d as X,e as Y}from"./dialog-O072o8Oc.js";import{I as Z}from"./input-BIK5hdJU.js";import{L as ue}from"./label-BplAUfvy.js";import{a as xe,b as ge,u as ye}from"./use-api-keys-CH-CKEoz.js";import{R as he}from"./require-capability-wUMdvtTV.js";import"./use-mcp-client-C9-YbjTx.js";import"./constants-z9Iog-sb.js";import"./auth-4owgu1uZ.js";import"./access-gate-CsBTprll.js";import"./capability-load-error-CWVf5xY_.js";function je(c){const e=v.c(6),{error:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ie,{size:16}),e[0]=i):i=e[0];let s;e[1]!==d.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:d.message}),e[1]=d.message,e[2]=r,e[3]=s):s=e[3];let l;return e[4]!==s?(l=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,t.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=l):l=e[5],l}function Ke(c){const e=v.c(20),{apiKey:d,onDelete:r}=c,i=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(J,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let l;e[1]!==d.name?(l=t.jsx("span",{className:"font-medium text-sm truncate block",children:d.name}),e[1]=d.name,e[2]=l):l=e[2];let o;e[3]!==d.createdAt||e[4]!==i?(o=i("settings.apiKeys.createdAt",{date:new Date(d.createdAt).toLocaleDateString()}),e[3]=d.createdAt,e[4]=i,e[5]=o):o=e[5];let n;e[6]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o}),e[6]=o,e[7]=n):n=e[7];let m;e[8]!==l||e[9]!==n?(m=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[l,n]})]}),e[8]=l,e[9]=n,e[10]=m):m=e[10];let a;e[11]!==i?(a=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=a):a=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ne,{size:14}),e[13]=f):f=e[13];let u;e[14]!==r||e[15]!==a?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":a,children:f}),e[14]=r,e[15]=a,e[16]=u):u=e[16];let p;return e[17]!==m||e[18]!==u?(p=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=p):p=e[19],p}function be(c){const e=v.c(21),{onCreate:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(J,{size:20,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let l;e[3]!==s?(l=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=l):l=e[4];let o;e[5]!==r?(o=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=o):o=e[6];let n;e[7]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=n):n=e[8];let m;e[9]!==l||e[10]!==n?(m=t.jsxs("div",{children:[l,n]}),e[9]=l,e[10]=n,e[11]=m):m=e[11];let a;e[12]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(M,{size:14}),e[12]=a):a=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let u;e[15]!==d||e[16]!==f?(u=t.jsxs(N,{onClick:d,size:"sm",className:"mt-2",children:[a,f]}),e[15]=d,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==m||e[19]!==u?(p=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[i,m,u]}),e[18]=m,e[19]=u,e[20]=p):p=e[20],p}function H(c){const e=v.c(40),{createdKey:d,onClose:r}=c,i=F(),s=d!==null;let l;e[0]!==r?(l=A=>!A&&r(),e[0]=r,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=o):o=e[3];let n;e[4]!==o?(n=t.jsx(Q,{children:o}),e[4]=o,e[5]=n):n=e[5];let m;e[6]!==i?(m=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=m):m=e[7];let a;e[8]!==m?(a=t.jsx(U,{children:m}),e[8]=m,e[9]=a):a=e[9];let f;e[10]!==n||e[11]!==a?(f=t.jsxs(V,{children:[n,a]}),e[10]=n,e[11]=a,e[12]=f):f=e[12];const u=d?.key??"";let p;e[13]!==u?(p=t.jsx(Z,{readOnly:!0,value:u,className:"font-mono text-xs"}),e[13]=u,e[14]=p):p=e[14];let x;e[15]!==d||e[16]!==i?(x=()=>{d&&(navigator.clipboard?.writeText(d.key),R.success(i("settings.apiKeys.copied")))},e[15]=d,e[16]=i,e[17]=x):x=e[17];let g;e[18]!==i?(g=i("settings.apiKeys.copyKey"),e[18]=i,e[19]=g):g=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(le,{size:14}),e[20]=b):b=e[20];let y;e[21]!==x||e[22]!==g?(y=t.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:x,"aria-label":g,children:b}),e[21]=x,e[22]=g,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==p?(h=t.jsxs("div",{className:"flex items-center gap-2",children:[p,y]}),e[24]=y,e[25]=p,e[26]=h):h=e[26];let j;e[27]!==i?(j=i("settings.apiKeys.done"),e[27]=i,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=t.jsx(W,{children:t.jsx(N,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let C;e[32]!==h||e[33]!==K||e[34]!==f?(C=t.jsxs(X,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==l?(D=t.jsx(Y,{open:s,onOpenChange:l,children:C}),e[36]=s,e[37]=C,e[38]=l,e[39]=D):D=e[39],D}function G(c){const e=v.c(64),{open:d,onOpenChange:r,onCreated:i}=c,s=F(),[l,o]=L.useState(""),n=ye();let m;e[0]!==r?(m=function(){o(""),r(!1)},e[0]=r,e[1]=m):m=e[1];const a=m;let f;e[2]!==n||e[3]!==a||e[4]!==l||e[5]!==i||e[6]!==s?(f=async function(te){if(te.preventDefault(),!!l.trim())try{const I=await n.mutateAsync({name:l.trim()});a(),i(I)}catch(I){const q=I;R.error(q instanceof Error?q.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=n,e[3]=a,e[4]=l,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==a||e[9]!==r?(p=$=>{$?r($):a()},e[8]=a,e[9]=r,e[10]=p):p=e[10];let x;e[11]!==s?(x=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Q,{children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==s?(b=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(U,{children:b}),e[17]=b,e[18]=y):y=e[18];let h;e[19]!==g||e[20]!==y?(h=t.jsxs(V,{children:[g,y]}),e[19]=g,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=t.jsx(ue,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=$=>o($.target.value),e[26]=C):C=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let A;e[29]!==l||e[30]!==D?(A=t.jsx(Z,{id:"api-key-name",value:l,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=l,e[30]=D,e[31]=A):A=e[31];let k;e[32]!==K||e[33]!==A?(k=t.jsxs("div",{className:"space-y-1.5",children:[K,A]}),e[32]=K,e[33]=A,e[34]=k):k=e[34];const ee=n.isPending;let S;e[35]!==s?(S=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=S):S=e[36];let _;e[37]!==n.isPending||e[38]!==a||e[39]!==S?(_=t.jsx(N,{type:"button",variant:"outline",onClick:a,disabled:ee,children:S}),e[37]=n.isPending,e[38]=a,e[39]=S,e[40]=_):_=e[40];let w;e[41]!==n.isPending||e[42]!==l?(w=n.isPending||!l.trim(),e[41]=n.isPending,e[42]=l,e[43]=w):w=e[43];let P;e[44]!==n.isPending||e[45]!==s?(P=n.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=n.isPending,e[45]=s,e[46]=P):P=e[46];let z;e[47]!==w||e[48]!==P?(z=t.jsx(N,{type:"submit",disabled:w,children:P}),e[47]=w,e[48]=P,e[49]=z):z=e[49];let T;e[50]!==_||e[51]!==z?(T=t.jsxs(W,{children:[_,z]}),e[50]=_,e[51]=z,e[52]=T):T=e[52];let O;e[53]!==u||e[54]!==k||e[55]!==T?(O=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[k,T]}),e[53]=u,e[54]=k,e[55]=T,e[56]=O):O=e[56];let E;e[57]!==O||e[58]!==h?(E=t.jsxs(X,{className:"sm:max-w-lg",children:[h,O]}),e[57]=O,e[58]=h,e[59]=E):E=e[59];let B;return e[60]!==d||e[61]!==E||e[62]!==p?(B=t.jsx(Y,{open:d,onOpenChange:p,children:E}),e[60]=d,e[61]=E,e[62]=p,e[63]=B):B=e[63],B}function Ce(){const c=F(),{data:e=[]}=xe(),d=ge(),[r,i]=L.useState(!1),[s,l]=L.useState(null),[o,n]=L.useState(null);async function m(){if(o)try{await d.mutateAsync(o.id),R.success(c("settings.apiKeys.keyDeleted",{name:o.name}))}catch(a){R.error(a instanceof Error?a.message:c("settings.apiKeys.failedToDeleteKey"))}finally{n(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(be,{onCreate:()=>i(!0)}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:c(e.length===1?"settings.apiKeys.keysCountSingular":"settings.apiKeys.keysCountPlural",{count:e.length})}),t.jsxs(N,{onClick:()=>i(!0),size:"sm",children:[t.jsx(M,{size:14}),c("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(a=>t.jsx(Ke,{apiKey:a,onDelete:()=>n(a)},a.id))})}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)}),t.jsx(ae,{open:o!==null,onOpenChange:a=>{a||n(null)},children:t.jsxs(re,{children:[t.jsxs(oe,{children:[t.jsx(ce,{children:c("settings.apiKeys.deleteTitle",{name:o?.name??""})}),t.jsx(de,{children:c("settings.apiKeys.deleteDescription")})]}),t.jsxs(me,{children:[t.jsx(fe,{children:c("settings.apiKeys.cancelButton")}),t.jsx(pe,{onClick:m,children:c("settings.apiKeys.deleteKey")})]})]})})]})}function De(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(se,{group:"connect",errorFallback:Ae,children:t.jsx(Ce,{})}),c[0]=e):e=c[0],e}function Ae(c){const{error:e}=c;return t.jsx(je,{error:e??new Error("Failed to load API keys")})}function qe(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(he,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(De,{})}),c[0]=e):e=c[0],e}export{qe as default};
1
+ import{c as v,j as t,db as se,b as F,r as L,B as N,t as R}from"./index-DuKgaDRT.js";import{i as ie}from"./AlertCircle-q-ha89N3.js";import{a as le}from"./Copy01-zUJb2qyi.js";import{i as J}from"./Key01-CYjm13lf.js";import{s as M}from"./Plus-CAe31wl2.js";import{s as ne}from"./Trash01-DbfWjlZd.js";import{A as ae,a as re,b as oe,c as ce,d as de,e as me,f as fe,g as pe}from"./alert-dialog-DrDfeFyK.js";import{b as Q,h as U,a as V,c as W,d as X,e as Y}from"./dialog-VBR_VTpJ.js";import{I as Z}from"./input-rGj3HLrx.js";import{L as ue}from"./label-B0K9nJ3U.js";import{a as xe,b as ge,u as ye}from"./use-api-keys-DCLdogWr.js";import{R as he}from"./require-capability-BSF86YHK.js";import"./use-mcp-client-DEWnugV9.js";import"./constants-z9Iog-sb.js";import"./auth-Dg5sPbT4.js";import"./access-gate-B-oxihSz.js";import"./capability-load-error-BEeb9Z6k.js";function je(c){const e=v.c(6),{error:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ie,{size:16}),e[0]=i):i=e[0];let s;e[1]!==d.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:d.message}),e[1]=d.message,e[2]=r,e[3]=s):s=e[3];let l;return e[4]!==s?(l=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[i,t.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=l):l=e[5],l}function Ke(c){const e=v.c(20),{apiKey:d,onDelete:r}=c,i=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(J,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let l;e[1]!==d.name?(l=t.jsx("span",{className:"font-medium text-sm truncate block",children:d.name}),e[1]=d.name,e[2]=l):l=e[2];let o;e[3]!==d.createdAt||e[4]!==i?(o=i("settings.apiKeys.createdAt",{date:new Date(d.createdAt).toLocaleDateString()}),e[3]=d.createdAt,e[4]=i,e[5]=o):o=e[5];let n;e[6]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o}),e[6]=o,e[7]=n):n=e[7];let m;e[8]!==l||e[9]!==n?(m=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s,t.jsxs("div",{className:"min-w-0",children:[l,n]})]}),e[8]=l,e[9]=n,e[10]=m):m=e[10];let a;e[11]!==i?(a=i("settings.apiKeys.deleteKey"),e[11]=i,e[12]=a):a=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ne,{size:14}),e[13]=f):f=e[13];let u;e[14]!==r||e[15]!==a?(u=t.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":a,children:f}),e[14]=r,e[15]=a,e[16]=u):u=e[16];let p;return e[17]!==m||e[18]!==u?(p=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=p):p=e[19],p}function be(c){const e=v.c(21),{onCreate:d}=c,r=F();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(J,{size:20,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let l;e[3]!==s?(l=t.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=l):l=e[4];let o;e[5]!==r?(o=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=o):o=e[6];let n;e[7]!==o?(n=t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:o}),e[7]=o,e[8]=n):n=e[8];let m;e[9]!==l||e[10]!==n?(m=t.jsxs("div",{children:[l,n]}),e[9]=l,e[10]=n,e[11]=m):m=e[11];let a;e[12]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(M,{size:14}),e[12]=a):a=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let u;e[15]!==d||e[16]!==f?(u=t.jsxs(N,{onClick:d,size:"sm",className:"mt-2",children:[a,f]}),e[15]=d,e[16]=f,e[17]=u):u=e[17];let p;return e[18]!==m||e[19]!==u?(p=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[i,m,u]}),e[18]=m,e[19]=u,e[20]=p):p=e[20],p}function H(c){const e=v.c(40),{createdKey:d,onClose:r}=c,i=F(),s=d!==null;let l;e[0]!==r?(l=A=>!A&&r(),e[0]=r,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("settings.apiKeys.createdTitle"),e[2]=i,e[3]=o):o=e[3];let n;e[4]!==o?(n=t.jsx(Q,{children:o}),e[4]=o,e[5]=n):n=e[5];let m;e[6]!==i?(m=i("settings.apiKeys.createdDescription"),e[6]=i,e[7]=m):m=e[7];let a;e[8]!==m?(a=t.jsx(U,{children:m}),e[8]=m,e[9]=a):a=e[9];let f;e[10]!==n||e[11]!==a?(f=t.jsxs(V,{children:[n,a]}),e[10]=n,e[11]=a,e[12]=f):f=e[12];const u=d?.key??"";let p;e[13]!==u?(p=t.jsx(Z,{readOnly:!0,value:u,className:"font-mono text-xs"}),e[13]=u,e[14]=p):p=e[14];let x;e[15]!==d||e[16]!==i?(x=()=>{d&&(navigator.clipboard?.writeText(d.key),R.success(i("settings.apiKeys.copied")))},e[15]=d,e[16]=i,e[17]=x):x=e[17];let g;e[18]!==i?(g=i("settings.apiKeys.copyKey"),e[18]=i,e[19]=g):g=e[19];let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(le,{size:14}),e[20]=b):b=e[20];let y;e[21]!==x||e[22]!==g?(y=t.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:x,"aria-label":g,children:b}),e[21]=x,e[22]=g,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==p?(h=t.jsxs("div",{className:"flex items-center gap-2",children:[p,y]}),e[24]=y,e[25]=p,e[26]=h):h=e[26];let j;e[27]!==i?(j=i("settings.apiKeys.done"),e[27]=i,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=t.jsx(W,{children:t.jsx(N,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let C;e[32]!==h||e[33]!==K||e[34]!==f?(C=t.jsxs(X,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=C):C=e[35];let D;return e[36]!==s||e[37]!==C||e[38]!==l?(D=t.jsx(Y,{open:s,onOpenChange:l,children:C}),e[36]=s,e[37]=C,e[38]=l,e[39]=D):D=e[39],D}function G(c){const e=v.c(64),{open:d,onOpenChange:r,onCreated:i}=c,s=F(),[l,o]=L.useState(""),n=ye();let m;e[0]!==r?(m=function(){o(""),r(!1)},e[0]=r,e[1]=m):m=e[1];const a=m;let f;e[2]!==n||e[3]!==a||e[4]!==l||e[5]!==i||e[6]!==s?(f=async function(te){if(te.preventDefault(),!!l.trim())try{const I=await n.mutateAsync({name:l.trim()});a(),i(I)}catch(I){const q=I;R.error(q instanceof Error?q.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=n,e[3]=a,e[4]=l,e[5]=i,e[6]=s,e[7]=f):f=e[7];const u=f;let p;e[8]!==a||e[9]!==r?(p=$=>{$?r($):a()},e[8]=a,e[9]=r,e[10]=p):p=e[10];let x;e[11]!==s?(x=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=x):x=e[12];let g;e[13]!==x?(g=t.jsx(Q,{children:x}),e[13]=x,e[14]=g):g=e[14];let b;e[15]!==s?(b=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=b):b=e[16];let y;e[17]!==b?(y=t.jsx(U,{children:b}),e[17]=b,e[18]=y):y=e[18];let h;e[19]!==g||e[20]!==y?(h=t.jsxs(V,{children:[g,y]}),e[19]=g,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=t.jsx(ue,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let C;e[26]===Symbol.for("react.memo_cache_sentinel")?(C=$=>o($.target.value),e[26]=C):C=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let A;e[29]!==l||e[30]!==D?(A=t.jsx(Z,{id:"api-key-name",value:l,onChange:C,placeholder:D,autoComplete:"off",required:!0}),e[29]=l,e[30]=D,e[31]=A):A=e[31];let k;e[32]!==K||e[33]!==A?(k=t.jsxs("div",{className:"space-y-1.5",children:[K,A]}),e[32]=K,e[33]=A,e[34]=k):k=e[34];const ee=n.isPending;let S;e[35]!==s?(S=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=S):S=e[36];let _;e[37]!==n.isPending||e[38]!==a||e[39]!==S?(_=t.jsx(N,{type:"button",variant:"outline",onClick:a,disabled:ee,children:S}),e[37]=n.isPending,e[38]=a,e[39]=S,e[40]=_):_=e[40];let w;e[41]!==n.isPending||e[42]!==l?(w=n.isPending||!l.trim(),e[41]=n.isPending,e[42]=l,e[43]=w):w=e[43];let P;e[44]!==n.isPending||e[45]!==s?(P=n.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=n.isPending,e[45]=s,e[46]=P):P=e[46];let z;e[47]!==w||e[48]!==P?(z=t.jsx(N,{type:"submit",disabled:w,children:P}),e[47]=w,e[48]=P,e[49]=z):z=e[49];let T;e[50]!==_||e[51]!==z?(T=t.jsxs(W,{children:[_,z]}),e[50]=_,e[51]=z,e[52]=T):T=e[52];let O;e[53]!==u||e[54]!==k||e[55]!==T?(O=t.jsxs("form",{onSubmit:u,className:"space-y-4",children:[k,T]}),e[53]=u,e[54]=k,e[55]=T,e[56]=O):O=e[56];let E;e[57]!==O||e[58]!==h?(E=t.jsxs(X,{className:"sm:max-w-lg",children:[h,O]}),e[57]=O,e[58]=h,e[59]=E):E=e[59];let B;return e[60]!==d||e[61]!==E||e[62]!==p?(B=t.jsx(Y,{open:d,onOpenChange:p,children:E}),e[60]=d,e[61]=E,e[62]=p,e[63]=B):B=e[63],B}function Ce(){const c=F(),{data:e=[]}=xe(),d=ge(),[r,i]=L.useState(!1),[s,l]=L.useState(null),[o,n]=L.useState(null);async function m(){if(o)try{await d.mutateAsync(o.id),R.success(c("settings.apiKeys.keyDeleted",{name:o.name}))}catch(a){R.error(a instanceof Error?a.message:c("settings.apiKeys.failedToDeleteKey"))}finally{n(null)}}return e.length===0?t.jsxs(t.Fragment,{children:[t.jsx(be,{onCreate:()=>i(!0)}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:c(e.length===1?"settings.apiKeys.keysCountSingular":"settings.apiKeys.keysCountPlural",{count:e.length})}),t.jsxs(N,{onClick:()=>i(!0),size:"sm",children:[t.jsx(M,{size:14}),c("settings.apiKeys.newKey")]})]}),t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:e.map(a=>t.jsx(Ke,{apiKey:a,onDelete:()=>n(a)},a.id))})}),t.jsx(G,{open:r,onOpenChange:i,onCreated:l}),t.jsx(H,{createdKey:s,onClose:()=>l(null)}),t.jsx(ae,{open:o!==null,onOpenChange:a=>{a||n(null)},children:t.jsxs(re,{children:[t.jsxs(oe,{children:[t.jsx(ce,{children:c("settings.apiKeys.deleteTitle",{name:o?.name??""})}),t.jsx(de,{children:c("settings.apiKeys.deleteDescription")})]}),t.jsxs(me,{children:[t.jsx(fe,{children:c("settings.apiKeys.cancelButton")}),t.jsx(pe,{onClick:m,children:c("settings.apiKeys.deleteKey")})]})]})})]})}function De(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(se,{group:"connect",errorFallback:Ae,children:t.jsx(Ce,{})}),c[0]=e):e=c[0],e}function Ae(c){const{error:e}=c;return t.jsx(je,{error:e??new Error("Failed to load API keys")})}function qe(){const c=v.c(1);let e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(he,{capability:"api-keys:manage",area:"api-keys",children:t.jsx(De,{})}),c[0]=e):e=c[0],e}export{qe as default};
@@ -1 +1 @@
1
- import{c as Bt,b as jt,r as A,j as o,n as _t,k as wt,t as ht}from"./index-BbGRbO2s.js";import{b as At}from"./chat-context-C4hTesgw.js";import{i as Et}from"./ChevronRight-KbHVuEl0.js";import{S as Nt}from"./use-clock-tick-BnbeNIUC.js";import{u as Rt,A as Ct}from"./use-section-preview-base-D6NtdQxJ.js";import{B as Kt,C as Tt,D as Ft,F as Pt,G as $t,H as It,I as Ot,S as Ut,J as zt,K as Lt}from"./index-Bd6d6OLa.js";import"./tab-id-Besg8sQE.js";import"./dialog-O072o8Oc.js";import"./Check-C7msqNgq.js";import"./Copy01-C4YK8X63.js";import"./Download01-qJq3S2UO.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-B6kpT11G.js";import"./use-mcp-client-C9-YbjTx.js";import"./constants-z9Iog-sb.js";import"./auth-4owgu1uZ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-D75XD9J2.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-BIgbLEnA.js";import"./use-ai-providers-tkH2P36o.js";import"./use-decopilot-events-TMtnOnoS.js";import"./use-organization-settings-DxGOoKYL.js";import"./select-BgBUKtcQ.js";import"./ChevronDown-BqUHNjui.js";import"./ChevronUp-DFNYR7MJ.js";import"./AlertCircle-CkPwmuKt.js";import"./CheckCircle-Byfr8GRo.js";import"./DotsVertical-BP5Z780D.js";import"./agent-icon-PQczz-8D.js";import"./Tool01-CKdFlI5A.js";import"./ArrowUp-BACYFmW2.js";import"./ArrowLeft-Cj7J7Py6.js";import"./Tool02-WEPKOeaj.js";import"./XCircle-_Uz-e0XH.js";import"./TrendUp01-Vk6dCOd4.js";import"./ZapSquare-BxrLuLwY.js";import"./Users03-DkrxpUck.js";import"./ChevronSelectorVertical-C-TawfyU.js";import"./Stars02-KNF7k5Ai.js";import"./UserSquare-Cha_Xug_.js";import"./CreditCard01-CTvH4Ctz.js";import"./Settings02-Br92bn2T.js";import"./Eye-Dud-kvJl.js";import"./FilterLines-CxBKxAWQ.js";import"./Share07-h4b9M9kE.js";import"./Globe01-CC5rliZ8.js";import"./Globe04-I9PluRSe.js";import"./SwitchHorizontal01-CzZQAHji.js";import"./HardDrive-CzaU-JSr.js";import"./Key01-DYVtQyL5.js";import"./LinkExternal01-DhwE_K6h.js";import"./LockUnlocked01-mNM_ZGJe.js";import"./LogOut01-DcZ2xT-g.js";import"./Monitor01-BGi_X3fN.js";import"./Sun-CRHdy0qz.js";import"./Palette-1yBLD0Lj.js";import"./Play-BzaZWqgV.js";import"./Plus-_clBcs48.js";import"./SearchLg-BfZy6LE_.js";import"./SearchMd-BwZ89rxP.js";import"./Shield01-DXyKRgwg.js";import"./Stars01-D3NIP1DL.js";import"./Trash01-CeIegB-4.js";import"./Upload01-Dm5XIZAF.js";import"./User01-BHSfVgcn.js";import"./Users01-BdGucJTC.js";import"./XClose-CytrgB6q.js";import"./Zap-CQV84apV.js";import"./input-BIK5hdJU.js";import"./automation-runs-CAKuCn1G.js";import"./useInfiniteQuery-DJwleBvz.js";import"./use-infinite-scroll-DCIMGPFx.js";import"./use-connection-SjIucYfF.js";import"./table-B6yx5A_W.js";import"./empty-state-9FIrRrEx.js";import"./use-members-DU7_N-pG.js";import"./use-org-auth-client-DP78AcXd.js";import"./use-automations-DESAfZj2.js";import"./useSuspenseInfiniteQuery-BnXbKlC6.js";import"./avatar-Ch1MTXS-.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-St27i-aj.js";import"./monaco-editor-C8shR4Uy.js";import"./spinner-75C-IUje.js";import"./types-DRjR-IOc.js";import"./shell-layout-C7TB0sE3.js";import"./required-auth-layout-BPYKj3xE.js";import"./use-org-sso-BnQ7ESw_.js";import"./integration-icon-B074gVXs.js";import"./use-navigate-to-agent-WsCzoAKG.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-Drir-DML.js";import"./index-B00pExNP.js";import"./form-DPsMI3Lv.js";import"./label-BplAUfvy.js";import"./file-type-icon-BKg5eN6R.js";import"./drawer-D6TLZjdo.js";import"./collection-search-01_9dsYR.js";import"./tabs-HJIS52i6.js";import"./toggle-group-BsJyDLZw.js";import"./use-commerce-diagnostic-CSLSGoDP.js";import"./popover-BezUzMxd.js";import"./self-tool-result-WIUgrpcH.js";import"./alert-dialog-xAkhsUZ9.js";import"./extract-connection-data-8L2YpSby.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-Cm2qsfPc.js";import"./authenticate-and-persist-oauth-C5490Jhc.js";import"./mcp-oauth-Z_L8Z-T6.js";import"./track-hj2Hvt98.js";import"./toolbar-CNPK0ze4.js";import"./github-repo-picker-CqAOuEej.js";import"./use-mcp-tools-CiNsIBL4.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-BJ9V0VEM.js";import"./use-registry-connections-BNaCzrSd.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-qfkIpMCZ.js";import"./connection-form-helpers-B09Owiwo.js";import"./collection-tabs-DRa7MJUs.js";import"./badge-Csyaxznr.js";import"./command-C_dZFT4G.js";import"./index-DChTPGRV.js";import"./select-model-CMJQRlhd.js";import"./checkbox-DJVXViCm.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-DBubZxl-.js";import"./dropdown-menu-CACb1c9S.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B87a5SNq.js";import"./use-file-configs-Do-4t9yE.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-DbmG2nK6.js";import"./search-input-CPxRNAUZ.js";import"./use-mcp-auth-status-DMcsLLPB.js";import"./switch-DdfQIPis.js";import"./use-secrets-DmW9oS6u.js";import"./AreaChart-CAeU7k3C.js";import"./use-task-board-items-C2E37Ysf.js";import"./breadcrumb-pwy4nVlX.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-ClBzSwUW.js";import"./task-key-BCHdFiOO.js";import"./automation-list-row-BEb0M1Tt.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-Xt_Ge_7D.js";function Vt(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Kt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function Pr(n){const t=Bt.c(79),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:H,schemaPending:lt,previewBaseUrl:ct}=n,M=lt===void 0?!1:lt,Z=ct===void 0?null:ct,G=At()?.taskId??null,c=jt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Tt(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const J=C,dt=bt??(x?Ft(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:Q,isPending:W}=Pt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const X=$t(T);let F;t[17]!==S?(F=zt((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const Y=F,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,xt]=A.useState(P),[ot,d]=A.useState(!1),$=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Dt),xt([]));let I;t[20]!==x?(I=x??{},t[20]=x,t[21]=I):I=t[21];const rt=I;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let O;t[24]!==rt||t[25]!==y?(O={...rt,...y},t[24]=rt,t[25]=y,t[26]=O):O=t[26];const it=O;let U;t[27]!==p||t[28]!==v||t[29]!==S?(U=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=U):U=t[30];const st=U;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const mt=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await k(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const pt=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=It(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ot(g,r)),ft(qt)},title:f,className:_t("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let B;t[42]!==W?(B=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=B):B=t[43];let j;t[44]!==nt||t[45]!==B?(j=o.jsxs("div",{className:yt,children:[nt,B]}),t[44]=nt,t[45]=B,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==st||t[56]!==mt||t[57]!==J||t[58]!==a||t[59]!==s||t[60]!==Y||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ut,{schema:b,value:it,onChange:st,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:mt,sandbox:{orgSlug:s,virtualMcpId:i,branch:m,threadId:G}},`${p}:${et}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=st,t[56]=mt,t[57]=J,t[58]=a,t[59]=s,t[60]=Y,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=t[67];let w;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(w=h&&o.jsx(Ct,{open:ot,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=w):w=t[74];let D;return t[75]!==j||t[76]!==_||t[77]!==w?(D=o.jsxs("div",{className:gt,children:[j,_,w]}),t[75]=j,t[76]=_,t[77]=w,t[78]=D):D=t[78],D}function qt(n){return n+1}function Dt(n){return n+1}export{Pr as AppEditor};
1
+ import{c as Bt,b as jt,r as A,j as o,n as _t,k as wt,t as ht}from"./index-DuKgaDRT.js";import{b as At}from"./chat-context-CK0SAWg7.js";import{i as Et}from"./ChevronRight-BoCweSJs.js";import{S as Nt}from"./use-clock-tick-Bb14ko74.js";import{u as Rt,A as Ct}from"./use-section-preview-base-DbEnUJ41.js";import{B as Kt,C as Tt,D as Ft,F as Pt,G as $t,H as It,I as Ot,S as Ut,J as zt,K as Lt}from"./index-f6gC7_4x.js";import"./tab-id-xRw9s49x.js";import"./dialog-VBR_VTpJ.js";import"./Check-8BnM7tpC.js";import"./Copy01-zUJb2qyi.js";import"./Download01-sTnZ9m_H.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-BEfohZqo.js";import"./use-mcp-client-DEWnugV9.js";import"./constants-z9Iog-sb.js";import"./auth-Dg5sPbT4.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-P47eJQwa.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Dds4BZbz.js";import"./use-ai-providers-XXnxR_Zu.js";import"./use-decopilot-events-B9ygDv-h.js";import"./use-organization-settings-D6-lnE8v.js";import"./select-Dw0yz6R3.js";import"./ChevronDown-BDPQaZqS.js";import"./ChevronUp-Ce84NoHt.js";import"./AlertCircle-q-ha89N3.js";import"./CheckCircle-COyRqpAc.js";import"./DotsVertical-1JhgmWFz.js";import"./agent-icon-CXYig2Vh.js";import"./Tool01-Cr7gkqqy.js";import"./ArrowUp-BAyh6hn8.js";import"./ArrowLeft-BAk90rdd.js";import"./Tool02-CoTv5i2i.js";import"./XCircle-CENboZHz.js";import"./TrendUp01-DzptB_l4.js";import"./ZapSquare-C_gg8DXd.js";import"./Users03-DB9-i9hs.js";import"./ChevronSelectorVertical-CbFyIO58.js";import"./Stars02-Dz2PYLs6.js";import"./UserSquare-C2vbnCn3.js";import"./CreditCard01-Dd3kG7iY.js";import"./Settings02-BxdfBQ5Y.js";import"./Eye-DBZt4RJc.js";import"./FilterLines-nlgwxkLs.js";import"./Share07-w7mz_Iae.js";import"./Globe01-B7mCeRBx.js";import"./Globe04-CW7pEZaX.js";import"./SwitchHorizontal01-DgxuO6JI.js";import"./HardDrive-Bd0W1jdP.js";import"./Key01-CYjm13lf.js";import"./LinkExternal01-eB2fHbU5.js";import"./LockUnlocked01-DFl-OJ7R.js";import"./LogOut01-D3UNWCpS.js";import"./Monitor01-vLem4C3L.js";import"./Sun-D5dGjwS7.js";import"./Palette-cc7S-N3h.js";import"./Play-Dse4KZ1O.js";import"./Plus-CAe31wl2.js";import"./SearchLg-DGzbK_iQ.js";import"./SearchMd-CqROzn8s.js";import"./Shield01-B50p-i9H.js";import"./Stars01-C3_YhsfM.js";import"./Trash01-DbfWjlZd.js";import"./Upload01-CvzK6gz-.js";import"./User01-BdqBw1KN.js";import"./Users01-BsgBtJMH.js";import"./XClose-DYwCESGN.js";import"./Zap-C_NQbDwT.js";import"./input-rGj3HLrx.js";import"./automation-runs-Bo6be-vt.js";import"./useInfiniteQuery-DfepjmLn.js";import"./use-infinite-scroll-CQ0_P7dk.js";import"./use-connection-CouRoanJ.js";import"./table-Dz1UPp05.js";import"./empty-state-Db_WfMoj.js";import"./use-members-G-zG_jza.js";import"./use-org-auth-client-CsDT0euS.js";import"./use-automations-V9xNGOwd.js";import"./useSuspenseInfiniteQuery-BVLX6MQQ.js";import"./avatar-BnQPHMLw.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Ddawx2RP.js";import"./monaco-editor-1iAJFSoh.js";import"./spinner-DUUWxaw4.js";import"./types-W907-UkK.js";import"./shell-layout-h1M-Upkc.js";import"./required-auth-layout-Dif_3ts2.js";import"./use-org-sso-O4xaa8q3.js";import"./integration-icon-BZS934jb.js";import"./use-navigate-to-agent-CCf7hqC4.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./chart-DnE16Ix1.js";import"./index-B1TJowpP.js";import"./form-DYcqG-4R.js";import"./label-B0K9nJ3U.js";import"./file-type-icon-kZUd9_dW.js";import"./drawer-BOKsWH4_.js";import"./collection-search-DstNczGU.js";import"./tabs-CVLCNP4p.js";import"./toggle-group-D7gbO6Ao.js";import"./use-commerce-diagnostic-DMlGkdtx.js";import"./popover-Ne5etcF4.js";import"./self-tool-result-CfcKJ8G-.js";import"./alert-dialog-DrDfeFyK.js";import"./extract-connection-data-G69TIOoO.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-B_odlUMh.js";import"./authenticate-and-persist-oauth-CeNmdDco.js";import"./mcp-oauth-DNzbrdjN.js";import"./track-Bh6FnWCf.js";import"./toolbar-DlSLmZi5.js";import"./github-repo-picker-CJVihlv_.js";import"./use-mcp-tools-WEAnrPHG.js";import"./agent-capabilities-B52k7xCe.js";import"./connection-card-C2-WEJb6.js";import"./use-registry-connections-DcYxqR1F.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DP7L5LCU.js";import"./connection-form-helpers-GRZE4630.js";import"./collection-tabs-BMr5Ngme.js";import"./badge-C8_JqgY7.js";import"./command-CjV2wNNJ.js";import"./index-U2pcazmz.js";import"./select-model-DxJOIebh.js";import"./checkbox-D6aL5Ben.js";import"./ai-providers-logos-DD3qZ33J.js";import"./cards-4iJIg9Mv.js";import"./dropdown-menu-Bnt3DOwT.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DRh49aaZ.js";import"./use-file-configs-D1n8ru_C.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-BkTJ_3l3.js";import"./search-input-Bc5gi1FL.js";import"./use-mcp-auth-status-CT_TMtQl.js";import"./switch-Bogsutiu.js";import"./use-secrets-BfNvKZpg.js";import"./AreaChart-DJcPJJSF.js";import"./use-task-board-items-DtI1y7vL.js";import"./breadcrumb-2vmGkBiB.js";import"./get-initials-D-f_fDFw.js";import"./use-tags-C4ysHQ1s.js";import"./task-key-BCHdFiOO.js";import"./automation-list-row-Dlr1O2UX.js";import"./site-error--i37Vnuw.js";import"./use-org-repo-syncs-BvIV6Sw5.js";function Vt(n,t){const s=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",m=Kt(t,i);return{blockKey:m,data:{__resolveType:n.resolveType,name:m}}}function Pr(n){const t=Bt.c(79),{orgSlug:s,virtualMcpId:i,branch:m,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:H,schemaPending:lt,previewBaseUrl:ct}=n,M=lt===void 0?!1:lt,Z=ct===void 0?null:ct,G=At()?.taskId??null,c=jt();let N;t[0]!==Z||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:Z},t[0]=Z,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==H||t[4]!==a||t[5]!==v?(R=Tt(v,a,H),t[3]=H,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let C;t[7]!==b?(C=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=C):C=t[8];const J=C,dt=bt??(x?Ft(p,x,a):p);let K;t[9]!==m||t[10]!==s||t[11]!==i?(K={orgSlug:s,virtualMcpId:i,branch:m},t[9]=m,t[10]=s,t[11]=i,t[12]=K):K=t[12];const{save:S,flush:Q,isPending:W}=Pt(K);let T;t[13]!==m||t[14]!==s||t[15]!==i?(T={orgSlug:s,virtualMcpId:i,branch:m},t[13]=m,t[14]=s,t[15]=i,t[16]=T):T=t[16];const X=$t(T);let F;t[17]!==S?(F=zt((e,r)=>S(e,r)),t[17]=S,t[18]=F):F=t[18];const Y=F,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[19]=P):P=t[19];const[g,xt]=A.useState(P),[ot,d]=A.useState(!1),$=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Dt),xt([]));let I;t[20]!==x?(I=x??{},t[20]=x,t[21]=I):I=t[21];const rt=I;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let O;t[24]!==rt||t[25]!==y?(O={...rt,...y},t[24]=rt,t[25]=y,t[26]=O):O=t[26];const it=O;let U;t[27]!==p||t[28]!==v||t[29]!==S?(U=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=U):U=t[30];const st=U;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{$.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const mt=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=$.current;if(r)try{await k(e,u=>{r(u),d(!1),$.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const pt=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=It(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ot(g,r)),ft(qt)},title:f,className:_t("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let B;t[42]!==W?(B=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=B):B=t[43];let j;t[44]!==nt||t[45]!==B?(j=o.jsxs("div",{className:yt,children:[nt,B]}),t[44]=nt,t[45]=B,t[46]=j):j=t[46];let _;t[47]!==p||t[48]!==m||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==st||t[56]!==mt||t[57]!==J||t[58]!==a||t[59]!==s||t[60]!==Y||t[61]!==b||t[62]!==M||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ut,{schema:b,value:it,onChange:st,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:mt,sandbox:{orgSlug:s,virtualMcpId:i,branch:m,threadId:G}},`${p}:${et}`):M?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{size:16,className:"animate-spin"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=m,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=st,t[56]=mt,t[57]=J,t[58]=a,t[59]=s,t[60]=Y,t[61]=b,t[62]=M,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=t[67];let w;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(w=h&&o.jsx(Ct,{open:ot,onOpenChange:e=>{d(e),e||($.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=w):w=t[74];let D;return t[75]!==j||t[76]!==_||t[77]!==w?(D=o.jsxs("div",{className:gt,children:[j,_,w]}),t[75]=j,t[76]=_,t[77]=w,t[78]=D):D=t[78],D}function qt(n){return n+1}function Dt(n){return n+1}export{Pr as AppEditor};
@@ -1 +1 @@
1
- import{dn as I,dp as $,dq as W,dr as L,ds as H,dt as x,du as D,dv as V,dw as q,dx as j,dy as y,dz as N,dA as B,dB as Z,dC as F}from"./index-BbGRbO2s.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 Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(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 Q(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 x)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof D)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 P(c,{fetchFn:i}),!o)try{o=await T(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 O=!e.redirectUrl;if(n!==void 0||O){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:b,codeVerifier:v}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(b),"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 T(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 I.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 P(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 T(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 P(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 F(),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 C(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=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return V.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=C(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=C(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 Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
1
+ import{dn as I,dp as $,dq as W,dr as L,ds as H,dt as x,du as D,dv as V,dw as q,dx as j,dy as y,dz as N,dA as B,dB as Z,dC as F}from"./index-DuKgaDRT.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 Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(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 Q(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 x)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof D)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 P(c,{fetchFn:i}),!o)try{o=await T(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 O=!e.redirectUrl;if(n!==void 0||O){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:b,codeVerifier:v}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(b),"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 T(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 I.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 P(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 T(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 P(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 F(),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 C(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=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return V.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=C(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=C(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 Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
@@ -1 +1 @@
1
- import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-BbGRbO2s.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{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(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=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(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
1
+ import{c as l,f as m,j as t,A as f,S as h,g as x,h as r,i as p,N as u}from"./index-DuKgaDRT.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{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(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=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(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
@@ -1 +1 @@
1
- import{a as V,G as Fe,r as v,e as ce,q as Q,j as t,n as N,B as xe,p as Be,o as $e,K as me,c as fe,b as be,S as _e}from"./index-BbGRbO2s.js";import{I as ee}from"./input-BIK5hdJU.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-75C-IUje.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:i,email:e,password:m,name:f})=>i==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:i,redirectTo:e})=>V.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>V.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>V.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>V.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>V.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ue="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:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,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 Ge({redirectUrl:i,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}=Fe(),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,oe=C.enabled&&(g||!y.enabled&&!se),le=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!oe?S.providers:te,h=S.enabled&&le.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,z]=v.useState(""),[B,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Oe,he]=v.useState(null),n={...Ke,...u},ne=v.useId(),K=`${ne}-email`,G=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=q==="signUp",U=q==="forgotPassword",T=q==="emailOtp",ie=ce({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?n.signUpFailed:n.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(n.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(i??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)}),Q(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=ce({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||n.resetEmailFailed);return l},onSuccess:()=>{Q("password_reset_requested"),ve(!0)},onError:s=>{Q("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),Y=ce({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||n.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),Q("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ce({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||n.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(i??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),de=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!de(b)&&H(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!de(b)){H(n.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:B})},Re=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail);return}re.mutate({email:b})},De=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}Y.mutate({email:b})},Me=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(Y.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{W(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),Y.reset(),J.reset()},E=ie.isPending||re.isPending||Y.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=Y.error||J.error,$=I?b.trim()&&L.trim()&&B.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")?n.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?n.accountExists:l.includes("network")||l.includes("fetch")?n.networkError:l.includes("rate limit")||l.includes("429")?n.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=je||Ne||Ae||Oe,We=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:i??e});if(l.error)throw new Error(l.error.message||n.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),Q("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},Ue=U?n.resetPasswordTitle:T&&x?n.verificationCodeTitle:m??n.welcomeTitle,Ce=U?n.resetPasswordSubtitle:T&&x?n.codeSentTo(b):f===void 0?n.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:Ue}),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:n.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:le.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{We(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"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||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:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?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:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:n.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||!$,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?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),Y.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:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,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:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!$,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?n.sending:n.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:Re,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:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!$,className:"w-full font-semibold",size:"xl",children:E?n.sending:n.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Te,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:n.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:n.namePlaceholder,value:B,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:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,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:n.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(z),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)]",$?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!$&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!$,className:N("w-full font-semibold"),size:"xl","aria-hidden":!$,children:E?I?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ue,children:I?n.signIn:n.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:ue,children:n.signInWithEmailCode})]})]}):null})]})}async function ge(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ye(){const i=Be(),e=Ve(),m=$e({queryKey:me.desktopAuthStatus(),queryFn:async()=>(await ge()).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,i]);async function C(){p(!0),r(null);try{const o=await ge();await o.performAuthLogin();const c=await o.fetchAuthStatus();i.setQueryData(me.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 ge();await o.performAuthLogout();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await ge()}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();i.setQueryData(me.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(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Xe(){return fe.c(10),Ye(),null}function Ze(i){const e=fe.c(25),{onContinue:m,isPending:f,error:p}=i,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(i){const e=fe.c(8),{label:m,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{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(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function tt({redirectTo:i,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 ze(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 He&&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(i))}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}},[i]),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(_e,{})}function st({callbackURL:i,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:i});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,i]),t.jsx(_e,{})}function lt(i){const e=fe.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}=i,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:oe,localMode:le}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let z;e[2]!==_||e[3]!==L?(z={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=z):z=e[4];const B=z;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(le&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==B.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:B.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=B.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:oe,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||oe.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,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(Ge,{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 q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,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{lt as A,Ye as u};
1
+ import{a as V,G as Fe,r as v,e as ce,q as Q,j as t,n as N,B as xe,p as Be,o as $e,K as me,c as fe,b as be,S as _e}from"./index-DuKgaDRT.js";import{I as ee}from"./input-rGj3HLrx.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-DUUWxaw4.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:i,email:e,password:m,name:f})=>i==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:i,redirectTo:e})=>V.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>V.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>V.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>V.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>V.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ue="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:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,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 Ge({redirectUrl:i,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}=Fe(),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,oe=C.enabled&&(g||!y.enabled&&!se),le=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!oe?S.providers:te,h=S.enabled&&le.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,z]=v.useState(""),[B,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Oe,he]=v.useState(null),n={...Ke,...u},ne=v.useId(),K=`${ne}-email`,G=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=q==="signUp",U=q==="forgotPassword",T=q==="emailOtp",ie=ce({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?n.signUpFailed:n.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(n.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(i??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)}),Q(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=ce({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||n.resetEmailFailed);return l},onSuccess:()=>{Q("password_reset_requested"),ve(!0)},onError:s=>{Q("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),Y=ce({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||n.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),Q("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ce({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||n.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(i??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),de=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!de(b)&&H(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!de(b)){H(n.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:B})},Re=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail);return}re.mutate({email:b})},De=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}Y.mutate({email:b})},Me=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(Y.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{W(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),Y.reset(),J.reset()},E=ie.isPending||re.isPending||Y.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=Y.error||J.error,$=I?b.trim()&&L.trim()&&B.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")?n.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?n.accountExists:l.includes("network")||l.includes("fetch")?n.networkError:l.includes("rate limit")||l.includes("429")?n.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=je||Ne||Ae||Oe,We=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:i??e});if(l.error)throw new Error(l.error.message||n.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),Q("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},Ue=U?n.resetPasswordTitle:T&&x?n.verificationCodeTitle:m??n.welcomeTitle,Ce=U?n.resetPasswordSubtitle:T&&x?n.codeSentTo(b):f===void 0?n.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:Ue}),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:n.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:le.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{We(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"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||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:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?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:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:n.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||!$,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?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),Y.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:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,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:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!$,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?n.sending:n.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:Re,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:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!$,className:"w-full font-semibold",size:"xl",children:E?n.sending:n.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Te,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:n.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:n.namePlaceholder,value:B,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:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?G:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:G,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:n.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(z),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)]",$?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!$&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!$,className:N("w-full font-semibold"),size:"xl","aria-hidden":!$,children:E?I?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ue,children:I?n.signIn:n.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:ue,children:n.signInWithEmailCode})]})]}):null})]})}async function ge(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ye(){const i=Be(),e=Ve(),m=$e({queryKey:me.desktopAuthStatus(),queryFn:async()=>(await ge()).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,i]);async function C(){p(!0),r(null);try{const o=await ge();await o.performAuthLogin();const c=await o.fetchAuthStatus();i.setQueryData(me.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 ge();await o.performAuthLogout();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await ge()}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();i.setQueryData(me.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(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Xe(){return fe.c(10),Ye(),null}function Ze(i){const e=fe.c(25),{onContinue:m,isPending:f,error:p}=i,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(i){const e=fe.c(8),{label:m,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{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(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function tt({redirectTo:i,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 ze(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 He&&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(i))}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}},[i]),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(_e,{})}function st({callbackURL:i,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:i});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,i]),t.jsx(_e,{})}function lt(i){const e=fe.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}=i,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:oe,localMode:le}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let z;e[2]!==_||e[3]!==L?(z={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=z):z=e[4];const B=z;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(le&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==B.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:B.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=B.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:oe,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||oe.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,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(Ge,{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 q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,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{lt as A,Ye as u};
@@ -1 +1 @@
1
- import{c as g,n as p,j as f}from"./index-BbGRbO2s.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,n as p,j as f}from"./index-DuKgaDRT.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-BbGRbO2s.js";import{i as u,a as p}from"./mcp-oauth-Z_L8Z-T6.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-DuKgaDRT.js";import{i as u,a as p}from"./mcp-oauth-DNzbrdjN.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};