decocms 4.430.1 → 4.430.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 (401) hide show
  1. package/dist/client/assets/{AlertCircle-BUkWQfB_.js → AlertCircle-CVYthSXp.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DNVY-5xH.js → AreaChart-qNgHWHyJ.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-C_Aui1-t.js → ArrowLeft-CyFyBJmn.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-dUCC1h4R.js → ArrowUp-CeSPU7QT.js} +1 -1
  5. package/dist/client/assets/{CartesianChart-BJS29ety.js → CartesianChart-B5tlzKMt.js} +1 -1
  6. package/dist/client/assets/{Check-D53o53z1.js → Check-DN3fVKj8.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CiGc92II.js → CheckCircle-BsdvfhEK.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-C0R59WlW.js → ChevronUp-xWbDxNSk.js} +1 -1
  9. package/dist/client/assets/{Copy01-Bc_ajdkn.js → Copy01-Dv7sipLd.js} +1 -1
  10. package/dist/client/assets/{CreditCard01-kOAv1J_D.js → CreditCard01-Dk07lq-0.js} +1 -1
  11. package/dist/client/assets/{DotsVertical-COvSpfVi.js → DotsVertical-DhmK4qgN.js} +1 -1
  12. package/dist/client/assets/{ErrorBarContext-DT3_OZEr.js → ErrorBarContext-gSfovbHF.js} +1 -1
  13. package/dist/client/assets/{Image01-BOx8LVbG.js → Image01-Y9Scw-o_.js} +1 -1
  14. package/dist/client/assets/{Key01-CmosOv0s.js → Key01-CtWEwt_r.js} +1 -1
  15. package/dist/client/assets/{Line-CComtnBD.js → Line-DBvwF3QX.js} +1 -1
  16. package/dist/client/assets/{Link01-B-BcpSea.js → Link01-CsZgPYpl.js} +1 -1
  17. package/dist/client/assets/LinkBroken01-DGoMMKbF.js +1 -0
  18. package/dist/client/assets/{LinkExternal01-BOhmrkdK.js → LinkExternal01-B-WvSbZy.js} +1 -1
  19. package/dist/client/assets/{Monitor01-CqmqvaJt.js → Monitor01-kmeIS50B.js} +1 -1
  20. package/dist/client/assets/{Palette-Dn80uz2_.js → Palette-CmpIZcQI.js} +1 -1
  21. package/dist/client/assets/{Plus-B0T7sCOu.js → Plus-CGgnB9yV.js} +1 -1
  22. package/dist/client/assets/{SearchMd-BjiZq5Ss.js → SearchMd-B7WxOr73.js} +1 -1
  23. package/dist/client/assets/{Sector-WjC96jsi.js → Sector-CEcu8yPs.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-mLNM1PWh.js → ShoppingBag01-BG3AWGBS.js} +1 -1
  25. package/dist/client/assets/{Sun--68QpCgd.js → Sun-Be_v4SgI.js} +1 -1
  26. package/dist/client/assets/{Tool01-UwOdqleo.js → Tool01-U6VAdTvK.js} +1 -1
  27. package/dist/client/assets/{Trash01-CzavZmmt.js → Trash01-d2ldPDpp.js} +1 -1
  28. package/dist/client/assets/{Upload01-BWIuH341.js → Upload01-vuUJE-Un.js} +1 -1
  29. package/dist/client/assets/{User01-CUsG_6c_.js → User01-DrdqUOnb.js} +1 -1
  30. package/dist/client/assets/{UserSquare-BMQF7dC1.js → UserSquare-zqtxIeMd.js} +1 -1
  31. package/dist/client/assets/{Users01-Bbfu9MdC.js → Users01-BSNk1mAx.js} +1 -1
  32. package/dist/client/assets/{X-CtohJRXR.js → X-MCJw_lkE.js} +1 -1
  33. package/dist/client/assets/{XAxis-Depi7ZOt.js → XAxis-CUk_D47K.js} +1 -1
  34. package/dist/client/assets/{XClose-Bg9Zp2j0.js → XClose-DJWS3DCR.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-C_zus5H2.js → ZoomOut-DxgRaJHf.js} +1 -1
  36. package/dist/client/assets/{access-gate-BSw0CcmD.js → access-gate-buHLOhRt.js} +1 -1
  37. package/dist/client/assets/add-connection-dialog-b2gPK4A2.js +1 -0
  38. package/dist/client/assets/agent-analytics-CkHKK2sI.js +2 -0
  39. package/dist/client/assets/agent-app-xUbOx1nA.js +1 -0
  40. package/dist/client/assets/agent-assets-BLWW7tSV.js +1 -0
  41. package/dist/client/assets/{agent-automation-CWPvYNFY.js → agent-automation-C585Dco7.js} +2 -2
  42. package/dist/client/assets/agent-automations-DipmSooi.js +1 -0
  43. package/dist/client/assets/agent-connect-sources-Cg-rDHA_.js +1 -0
  44. package/dist/client/assets/agent-deck-BOFjOn39.js +1 -0
  45. package/dist/client/assets/agent-e2e-BF3tKvyc.js +1 -0
  46. package/dist/client/assets/agent-experiments-fsdGMiOY.js +1 -0
  47. package/dist/client/assets/agent-file-BbcJd6HM.js +1 -0
  48. package/dist/client/assets/{agent-git-C1jtwOs1.js → agent-git-vy54BjiV.js} +2 -2
  49. package/dist/client/assets/agent-hosting-Bnd-xqY4.js +1 -0
  50. package/dist/client/assets/agent-icon-DQhX6pyL.js +1 -0
  51. package/dist/client/assets/agent-library-CoQDyojP.js +1 -0
  52. package/dist/client/assets/agent-library-file-Bp-seD91.js +1 -0
  53. package/dist/client/assets/agent-monitor-DIqqvckJ.js +1 -0
  54. package/dist/client/assets/agent-overview-DIPsKuHn.js +1 -0
  55. package/dist/client/assets/agent-settings-CuSkQv6E.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-DQ9aUQOK.js → agent-site-editor-C_9Sp-ko.js} +2 -2
  57. package/dist/client/assets/agent-site-editor-code-BWwVQZ5b.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-D62zi8Ka.js → agent-site-editor-content-BIULxMT9.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-BFe9L8ZC.js → agent-site-editor-preview-CA1JSDGo.js} +3 -3
  60. package/dist/client/assets/agent-view-bJuK5JMH.js +1 -0
  61. package/dist/client/assets/{agent-view-guard-DvkFRuT1.js → agent-view-guard-CRvRYAMg.js} +1 -1
  62. package/dist/client/assets/agents-list-BguEBZWs.js +1 -0
  63. package/dist/client/assets/{ai-providers-BKaAhkKr.js → ai-providers-DQfBdh-5.js} +1 -1
  64. package/dist/client/assets/{alert-hHCCxPrm.js → alert-BxbrJMD6.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-DPE6kDht.js → alert-dialog-BYJnmaQz.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-BaLMxjIR.js → analytics-sections-BupuHkrr.js} +1 -1
  67. package/dist/client/assets/{api-keys-Cs2lX4sa.js → api-keys-9ma74-9W.js} +1 -1
  68. package/dist/client/assets/api-keys-CgI6_AMK.js +1 -0
  69. package/dist/client/assets/app-editor-Cw0XiLbp.js +1 -0
  70. package/dist/client/assets/{asset-utils-6K_UaEMl.js → asset-utils-Qk5h-wqe.js} +1 -1
  71. package/dist/client/assets/{auth-yZ0dbxiQ.js → auth-BA3Q_TJo.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-C2FsnDrX.js → auth-catchall-knLcWJNd.js} +1 -1
  73. package/dist/client/assets/{auth-entry-BVb_LGQt.js → auth-entry-DJOJ8Rs7.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-DCczOAkV.js → auth-split-layout-Dt6Lr3jy.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-DSfbaJXn.js → authenticate-and-persist-oauth-BTuznNbi.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-BX95wnlk.js → automation-list-row-DGBpkMxN.js} +1 -1
  77. package/dist/client/assets/{automation-runs-rMXYly96.js → automation-runs-CgYsY8Ss.js} +1 -1
  78. package/dist/client/assets/automations-CB7gLMbz.js +1 -0
  79. package/dist/client/assets/{autosend-DaQ0WgM_.js → autosend-D_HIQJhP.js} +1 -1
  80. package/dist/client/assets/{avatar-qgmN1uFW.js → avatar-DnckqjGp.js} +1 -1
  81. package/dist/client/assets/{badge-Bjr6roKX.js → badge-BeT90Jfh.js} +1 -1
  82. package/dist/client/assets/{block-document-CmPQoPil.js → block-document-g-hQygUE.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-Bt2a6bTr.js → blocks-preview-workspace-context-CIl38gkx.js} +1 -1
  84. package/dist/client/assets/{buckets-CUvpxamI.js → buckets-0BdD_fJX.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-DVZptWMu.js → build-improve-prompt-doc-C5i29eyt.js} +1 -1
  86. package/dist/client/assets/{calendar-hWMukXvu.js → calendar-DwEcUKGe.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-BhEiGFSy.js → capability-load-error-BwY99ChM.js} +1 -1
  88. package/dist/client/assets/category-editor-BPnM7ZcX.js +1 -0
  89. package/dist/client/assets/{chart-CpCJ5a7h.js → chart-DzZFGD1z.js} +1 -1
  90. package/dist/client/assets/{chat-context-CG9Mp_L-.js → chat-context-CSREXmZ-.js} +1 -1
  91. package/dist/client/assets/{chat-draft-DApZt_La.js → chat-draft-BYIogZvi.js} +1 -1
  92. package/dist/client/assets/{checkbox-DoT4yq3W.js → checkbox-VSFOqgpI.js} +1 -1
  93. package/dist/client/assets/choose-editor-BhFFcEad.js +1 -0
  94. package/dist/client/assets/{claim-phase-copy-BVJw-2Sg.js → claim-phase-copy-DMl_wfzl.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-B4d0MFu9.js → cli-auth-success-rCzd61IP.js} +1 -1
  96. package/dist/client/assets/{client-icons-B2Ky8xii.js → client-icons-DQokRtPQ.js} +1 -1
  97. package/dist/client/assets/{collapsible-D2a3Inov.js → collapsible-hh2QeFQx.js} +1 -1
  98. package/dist/client/assets/collection-detail-CZHU581t.js +1 -0
  99. package/dist/client/assets/{collection-display-button-YClOnQnk.js → collection-display-button-BHhyBowf.js} +1 -1
  100. package/dist/client/assets/{collection-search-B5LfgGj5.js → collection-search-Be2s73S6.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-1_pTlxny.js → collection-table-wrapper-CZd1WcSO.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-CYKC6woL.js → collection-tabs-B1fc3hEx.js} +1 -1
  103. package/dist/client/assets/{combobox-Bi0f4g0J.js → combobox-DJXjtyos.js} +1 -1
  104. package/dist/client/assets/{command-DcCoSxh3.js → command-i-VcjjfU.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section-Dk-qAE2Z.js → companion-mcps-section-BNGcJQ5q.js} +1 -1
  106. package/dist/client/assets/{config-bRaSZ6ZI.js → config-B-PocAul.js} +1 -1
  107. package/dist/client/assets/{connect-CDe5uHFz.js → connect-CJrfrNOc.js} +1 -1
  108. package/dist/client/assets/{connect-layout-6lDDk3bO.js → connect-layout-Ck9_7bFy.js} +1 -1
  109. package/dist/client/assets/{connection-DLRl6H0w.js → connection-DWKQsiJ1.js} +1 -1
  110. package/dist/client/assets/{connection-card-BMfy_L46.js → connection-card-BxTTbMjg.js} +1 -1
  111. package/dist/client/assets/connection-detail-CwaF40yO.js +1 -0
  112. package/dist/client/assets/{connection-form-helpers-DyGM93YP.js → connection-form-helpers-UQvDnJ_o.js} +1 -1
  113. package/dist/client/assets/connections-BLQ5SqNN.js +1 -0
  114. package/dist/client/assets/context-BkyMYnN6.js +1 -0
  115. package/dist/client/assets/{context-menu-BWEhojhE.js → context-menu-D2E2BNSJ.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-D2gREUUr.js → create-organization-dialog-BPnp8P72.js} +1 -1
  117. package/dist/client/assets/daily-pulse-BmnQTDoG.js +1 -0
  118. package/dist/client/assets/{decopilot-Cp1gF-AT.js → decopilot-CaWhcF5x.js} +1 -1
  119. package/dist/client/assets/{dialog-D1MsBTH7.js → dialog-DwOXW4AO.js} +1 -1
  120. package/dist/client/assets/discover-DakQJU5_.js +1 -0
  121. package/dist/client/assets/{domain-settings-CVSAVAoV.js → domain-settings-CrCw_lIY.js} +1 -1
  122. package/dist/client/assets/{download-app-dialog-CI6vYgNV.js → download-app-dialog-CZZmW5dI.js} +1 -1
  123. package/dist/client/assets/{drawer-DQ1B0U-G.js → drawer-DYVK-Yxy.js} +1 -1
  124. package/dist/client/assets/{editor-CXgFNygO.js → editor-fs_-xqtP.js} +1 -1
  125. package/dist/client/assets/{empty-state-CwnTG9Vu.js → empty-state-B8AHzTIo.js} +1 -1
  126. package/dist/client/assets/{empty-state-zFf02K5-.js → empty-state-GPBYJgGv.js} +1 -1
  127. package/dist/client/assets/{extract-connection-data-CD-3Cduz.js → extract-connection-data-DwhEeit2.js} +1 -1
  128. package/dist/client/assets/{feature-gate-DxAWWJZd.js → feature-gate-CitKKOE2.js} +1 -1
  129. package/dist/client/assets/{feature-paywall-C7fyZx2V.js → feature-paywall-DweqAdFr.js} +1 -1
  130. package/dist/client/assets/file-explorer-DCrNzMRJ.js +2 -0
  131. package/dist/client/assets/{file-preview-WwyFKcds.js → file-preview-CUNQwIMu.js} +1 -1
  132. package/dist/client/assets/{file-share-button-0thUGHHJ.js → file-share-button-DVNdVkoS.js} +2 -2
  133. package/dist/client/assets/{file-type-icon-TH99y45i.js → file-type-icon-BKMgh7vP.js} +1 -1
  134. package/dist/client/assets/flat-project-BzPFVO8c.js +1 -0
  135. package/dist/client/assets/{folder-icon-Dmxyn26B.js → folder-icon-DFC1tMoz.js} +1 -1
  136. package/dist/client/assets/{form-CelWRzw5.js → form-CBqY_Qj5.js} +1 -1
  137. package/dist/client/assets/{gateway-client-B5Pd686Y.js → gateway-client-BgWzL4m_.js} +1 -1
  138. package/dist/client/assets/{general-DeFJH4BS.js → general-CpwupPfh.js} +1 -1
  139. package/dist/client/assets/home-DL5QzWnK.js +1 -0
  140. package/dist/client/assets/icon-button-BtLKyT7m.js +1 -0
  141. package/dist/client/assets/{index-CMZSUEgF.js → index-BbS4gDnQ.js} +1 -1
  142. package/dist/client/assets/{index-CtnFCw07.js → index-BeeQz6mt.js} +1 -1
  143. package/dist/client/assets/{index-COzII8Rl.js → index-BzcY0Rd6.js} +1 -1
  144. package/dist/client/assets/{index-CdVv5PyR.js → index-BznQH_sl.js} +1 -1
  145. package/dist/client/assets/{index-BBMMcl5D.js → index-C8jZ4bpw.js} +1 -1
  146. package/dist/client/assets/{index-CyQyr88p.js → index-CWzlOAQX.js} +46 -46
  147. package/dist/client/assets/{index-9e8H03cs.js → index-Cy0Tj9zL.js} +1 -1
  148. package/dist/client/assets/{index-De2ebevC.js → index-DCYp09DY.js} +1 -1
  149. package/dist/client/assets/{index-3gIKLZj9.css → index-DDkAv5gF.css} +1 -1
  150. package/dist/client/assets/{index-xqiApMBX.js → index-DSVDaqXP.js} +1 -1
  151. package/dist/client/assets/{index-DXD6LtMh.js → index-DYrWEQp-.js} +1 -1
  152. package/dist/client/assets/index-Dh5O1uzF.js +1 -0
  153. package/dist/client/assets/{index-Bp8O3HWE.js → index-DrVMQFyO.js} +1 -1
  154. package/dist/client/assets/index-HhorfmmF.js +1 -0
  155. package/dist/client/assets/{index-POiEXzT7.js → index-Qp03HhfC.js} +1 -1
  156. package/dist/client/assets/{index-DbPTqP1k.js → index-h4lVf9qd.js} +4 -4
  157. package/dist/client/assets/{index-redirect-XX1RPnFl.js → index-redirect-BzVBOYpG.js} +1 -1
  158. package/dist/client/assets/{infiniteQueryObserver-Bm7kObFT.js → infiniteQueryObserver-z6KpeaXk.js} +1 -1
  159. package/dist/client/assets/{infra-billing-Wd0aWcPF.js → infra-billing-Dm9O0MpT.js} +1 -1
  160. package/dist/client/assets/{input-CeDoO_Rr.js → input-BT8saI27.js} +1 -1
  161. package/dist/client/assets/{input-D-tRfEUe.js → input-CJK7pC9G.js} +1 -1
  162. package/dist/client/assets/{input-C19kkoiF.js → input-bivLuh-1.js} +3 -3
  163. package/dist/client/assets/integration-icon-B95GPMKQ.js +1 -0
  164. package/dist/client/assets/{label-DO3jRcdx.js → label-0TZ28Umz.js} +1 -1
  165. package/dist/client/assets/{last-preview-page-CI8sVa42.js → last-preview-page-ZNVmf1EU.js} +1 -1
  166. package/dist/client/assets/{layout-C3JP2G-I.js → layout-j1X96Ggx.js} +1 -1
  167. package/dist/client/assets/{legacy-agents-deep-BJqv5541.js → legacy-agents-deep-cacTD8f_.js} +1 -1
  168. package/dist/client/assets/{legacy-main-redirect-CXYH487V.js → legacy-main-redirect--cYJW20n.js} +1 -1
  169. package/dist/client/assets/library-DtGn3FJA.js +1 -0
  170. package/dist/client/assets/{library-tab-vy9WBvuU.js → library-tab-CTkh7nfn.js} +1 -1
  171. package/dist/client/assets/{login-DZytsZWm.js → login-c8HNUl_C.js} +1 -1
  172. package/dist/client/assets/{markdown-CD9qrdS_.js → markdown-Bqzss8Ii.js} +1 -1
  173. package/dist/client/assets/{mcp-app-renderer-C_mTIe3Q.js → mcp-app-renderer-BXwhxgcp.js} +1 -1
  174. package/dist/client/assets/{mcp-oauth-BHkP1C2P.js → mcp-oauth-C0PojFFt.js} +1 -1
  175. package/dist/client/assets/{members-BXW762DS.js → members-CyyrlPEt.js} +1 -1
  176. package/dist/client/assets/{message-templates-Y1dkPYIa.js → message-templates-BDPyGA1f.js} +1 -1
  177. package/dist/client/assets/{mini-report-page-BBWmfTbX.js → mini-report-page-BNC-xTjm.js} +1 -1
  178. package/dist/client/assets/{mock-board-DAh526hI.js → mock-board-DovrLxym.js} +1 -1
  179. package/dist/client/assets/{monaco-editor-1WiLwMoS.js → monaco-editor-DCqxqYSj.js} +1 -1
  180. package/dist/client/assets/{monitoring-stats-row-DvfsN9_z.js → monitoring-stats-row-OA16NnfT.js} +1 -1
  181. package/dist/client/assets/{multi-select-CUTVdKAC.js → multi-select-tRlT3L5z.js} +1 -1
  182. package/dist/client/assets/{mustache-BoM8yvOe.js → mustache-BP7du7Zy.js} +1 -1
  183. package/dist/client/assets/{new-project-dialog-_BSkwB51.js → new-project-dialog-I6QtJuZt.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-DsCdusXE.js → oauth-callback-MJTjt1We.js} +1 -1
  185. package/dist/client/assets/{oauth-callback-ai-provider-C5T-VDKL.js → oauth-callback-ai-provider-B0EhyPGD.js} +1 -1
  186. package/dist/client/assets/{onboarding-DetvWDKL.js → onboarding-X4AYCK_N.js} +1 -1
  187. package/dist/client/assets/openai-conversation-BrI4LVLa.js +3 -0
  188. package/dist/client/assets/{optimistic-project-sidebar-views-DVSvifkv.js → optimistic-project-sidebar-views-B35k6512.js} +1 -1
  189. package/dist/client/assets/{org-file-open-context-vlnvSapQ.js → org-file-open-context-W094eyab.js} +1 -1
  190. package/dist/client/assets/{organization-choice-Bl7AK6HJ.js → organization-choice-BLsuyEtq.js} +1 -1
  191. package/dist/client/assets/{orgs-_O4TUqxu.js → orgs-Y9G8A5Ph.js} +1 -1
  192. package/dist/client/assets/{page-seo-form--aiitwzb.js → page-seo-form-CJW4yq3f.js} +1 -1
  193. package/dist/client/assets/{pair-Bjle9-b6.js → pair-csGGOkx1.js} +7 -7
  194. package/dist/client/assets/{plan-ladder-C9iTCEoq.js → plan-ladder-C4roHlM5.js} +1 -1
  195. package/dist/client/assets/{popover-BlirYmOQ.js → popover-Cd3ISjs_.js} +1 -1
  196. package/dist/client/assets/post-calendar-CAWS2Vmq.js +1 -0
  197. package/dist/client/assets/{post-editor-QaOkF5FX.js → post-editor-D2xBHjct.js} +1 -1
  198. package/dist/client/assets/{preview-content-C4Rard2P.js → preview-content-CzVZuXbr.js} +1 -1
  199. package/dist/client/assets/{preview-dialog-Cz9jaB0z.js → preview-dialog-8lnbKA_n.js} +1 -1
  200. package/dist/client/assets/{profile-C-BPCyIp.js → profile-BgxkafeL.js} +1 -1
  201. package/dist/client/assets/project-app-view-icxI7Rov.js +1 -0
  202. package/dist/client/assets/project-feed-BgMHYF1Z.js +1 -0
  203. package/dist/client/assets/{project-icon-C1d9Z0m5.js → project-icon-BfkDVtEt.js} +1 -1
  204. package/dist/client/assets/project-reports-BFfWvANX.js +1 -0
  205. package/dist/client/assets/project-tasks-C64LpTAA.js +1 -0
  206. package/dist/client/assets/projects-BUTz1MMd.js +1 -0
  207. package/dist/client/assets/{projects-empty-state-Bdo_Rhj-.js → projects-empty-state-D4QNY6yf.js} +1 -1
  208. package/dist/client/assets/{prompts-BsB5FTPC.js → prompts-_wvcaZiq.js} +1 -1
  209. package/dist/client/assets/record-editor-6OpzvMEF.js +1 -0
  210. package/dist/client/assets/redirect-editor-D7uptbDW.js +1 -0
  211. package/dist/client/assets/reports-DLhsthYj.js +1 -0
  212. package/dist/client/assets/{reports-Chj5li8_.js → reports-KcjvDixJ.js} +1 -1
  213. package/dist/client/assets/reports-onboarding-Zp49oKKp.js +1 -0
  214. package/dist/client/assets/reports-tab-BbyRBNRf.js +2 -0
  215. package/dist/client/assets/repositories-EkSR0y55.js +1 -0
  216. package/dist/client/assets/{repository-binding-Dgq5OsMA.js → repository-binding-3gizJnq4.js} +1 -1
  217. package/dist/client/assets/{repository-import-picker-D2pzrWr6.js → repository-import-picker-DG_yM72C.js} +1 -1
  218. package/dist/client/assets/{repository-picker-STEm8zmF.js → repository-picker-BR_sMkOw.js} +1 -1
  219. package/dist/client/assets/{require-capability-BH1WwajD.js → require-capability-C2Nda3jm.js} +1 -1
  220. package/dist/client/assets/{required-auth-layout-Cy0atFVL.js → required-auth-layout-CtzgnDx3.js} +1 -1
  221. package/dist/client/assets/{reset-password-BwPcMGPY.js → reset-password-D2Alw1H7.js} +1 -1
  222. package/dist/client/assets/{resizable-BU4a2PvY.js → resizable-DqYE28tG.js} +1 -1
  223. package/dist/client/assets/{resolve-tab-icon-c84JJRcB.js → resolve-tab-icon-liQGha1g.js} +1 -1
  224. package/dist/client/assets/{review-settings-iEyMCfp2.js → review-settings-B0nVs037.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-DlGKoKEw.js → rich-text-link-control-U94G_E0v.js} +1 -1
  226. package/dist/client/assets/roles-B_4b_QUD.js +1 -0
  227. package/dist/client/assets/route-16Qzmh2H.js +1 -0
  228. package/dist/client/assets/route-B3tjN4Zg.js +1 -0
  229. package/dist/client/assets/route-C_Hs1TIL.js +1 -0
  230. package/dist/client/assets/{runnable-block-editor-R-_6elGy.js → runnable-block-editor-Dx2bIxdz.js} +1 -1
  231. package/dist/client/assets/{sandbox-lifecycle-context-BEIzLgKJ.js → sandbox-lifecycle-context-BxUTEul4.js} +1 -1
  232. package/dist/client/assets/{schema-Gtjoj1mV.js → schema-BKdAxrjN.js} +1 -1
  233. package/dist/client/assets/{scroll-area-BItWkZyD.js → scroll-area-Cay3wJhN.js} +1 -1
  234. package/dist/client/assets/{search-input-2HqPa1gU.js → search-input-B_YmmZHV.js} +1 -1
  235. package/dist/client/assets/{search-toggle-TwxL51Rq.js → search-toggle-B17M6kpS.js} +1 -1
  236. package/dist/client/assets/{secret-picker-LUd97qaj.js → secret-picker-DaCIoDrN.js} +1 -1
  237. package/dist/client/assets/{secrets-C-fl25hO.js → secrets-2PSicqyQ.js} +1 -1
  238. package/dist/client/assets/sections-editor-DBJwN3fQ.js +1 -0
  239. package/dist/client/assets/{select-BqcGTWMZ.js → select-CF6Gp6z2.js} +1 -1
  240. package/dist/client/assets/{select-model-UIikOcTl.js → select-model-BfrFqNKL.js} +1 -1
  241. package/dist/client/assets/seo-editor-DWB8ATJr.js +1 -0
  242. package/dist/client/assets/{separator-Cfi478VR.js → separator-7nNJ8bt3.js} +1 -1
  243. package/dist/client/assets/{settings-tab-32WTJPDU.js → settings-tab-BjVbMHuj.js} +1 -1
  244. package/dist/client/assets/{sheet-jXYhJY1b.js → sheet-BxvcwNse.js} +1 -1
  245. package/dist/client/assets/{shell-layout-CqQIq2hS.js → shell-layout-CzhXAO9S.js} +1 -1
  246. package/dist/client/assets/{skills-DoXVf8Lu.js → skills-DgHWYsVv.js} +1 -1
  247. package/dist/client/assets/{sso-CkmBYFtO.js → sso-Be79miIa.js} +1 -1
  248. package/dist/client/assets/{suggestion-DKXZWHaN.js → suggestion-RCbdRB_3.js} +1 -1
  249. package/dist/client/assets/{switch-Dcx0z8yf.js → switch-CAhfktTZ.js} +1 -1
  250. package/dist/client/assets/{synced-repos-BmYDHZBR.js → synced-repos-Cfc_noHz.js} +1 -1
  251. package/dist/client/assets/{tab-icon-glyph-CJeQz4Ym.js → tab-icon-glyph-C3JncEmv.js} +1 -1
  252. package/dist/client/assets/{table-2Z24Uf7A.js → table-BiIyEc6M.js} +1 -1
  253. package/dist/client/assets/{tabs-Dcs_wljk.js → tabs-MJcU_hz5.js} +1 -1
  254. package/dist/client/assets/{task-board-BZQiH6lk.js → task-board-ZOkVjFfb.js} +1 -1
  255. package/dist/client/assets/{task-route-Y6qsNyYg.js → task-route-2jOSkzR_.js} +1 -1
  256. package/dist/client/assets/{task-status-DJtE9wAV.js → task-status-DnIsBsG3.js} +1 -1
  257. package/dist/client/assets/taskboard-analytics-CagGkIPc.js +1 -0
  258. package/dist/client/assets/{tasks-CMIeA9v4.js → tasks-BYfXzj9g.js} +1 -1
  259. package/dist/client/assets/tasks-C59QR4O_.js +1 -0
  260. package/dist/client/assets/{textarea-Crpj1sFF.js → textarea-DPzgPhO0.js} +1 -1
  261. package/dist/client/assets/thread-analytics-D4ZCwT01.js +1 -0
  262. package/dist/client/assets/thread-button-KYXikVLO.js +1 -0
  263. package/dist/client/assets/{thread-intent-CCZj7A0k.js → thread-intent-uQTUqJNN.js} +1 -1
  264. package/dist/client/assets/thread-route-D1S383-w.js +1 -0
  265. package/dist/client/assets/{thread-route-BnMz_7UO.js → thread-route-D9Gbeij-.js} +1 -1
  266. package/dist/client/assets/thread-sheet-body-CywQ9hos.js +1 -0
  267. package/dist/client/assets/{toggle-group-C6K0IvrN.js → toggle-group-Ddc-8H1o.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-xv3yPHM9.js → toolbar-icon-button-ByY5u7GY.js} +1 -1
  269. package/dist/client/assets/{tooltip-MkmbJW_K.js → tooltip-BqndO78a.js} +1 -1
  270. package/dist/client/assets/{track-DiI841S7.js → track-hlVnSAov.js} +1 -1
  271. package/dist/client/assets/{types-CRa6H_aI.js → types-sBzHo8Ih.js} +1 -1
  272. package/dist/client/assets/{usage-stats-D9M3mjk5.js → usage-stats-yhYX0e5G.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-CkGkm3q3.js → use-ai-providers-BYo-eRGm.js} +1 -1
  274. package/dist/client/assets/{use-automations-Ln-ZgedH.js → use-automations-ChYX58CC.js} +1 -1
  275. package/dist/client/assets/{use-autosave-DCbYTwqE.js → use-autosave-Bex7Xrty.js} +1 -1
  276. package/dist/client/assets/{use-chat-layout-state-BPeSMGIC.js → use-chat-layout-state-TqbwuuZk.js} +1 -1
  277. package/dist/client/assets/{use-connect-companion-DB9iKUcO.js → use-connect-companion-BRtgSb9P.js} +1 -1
  278. package/dist/client/assets/{use-connection-DpAJRH1j.js → use-connection-CI6FQy3s.js} +1 -1
  279. package/dist/client/assets/{use-copy-C7mYE0cr.js → use-copy-PnkEhrhy.js} +1 -1
  280. package/dist/client/assets/{use-create-virtual-mcp-YtxQuBqL.js → use-create-virtual-mcp-BziW--Xo.js} +1 -1
  281. package/dist/client/assets/{use-date-fns-locale-b7C9_zv4.js → use-date-fns-locale-DvDfBLBf.js} +1 -1
  282. package/dist/client/assets/{use-debounced-autosave-Dl2BkZfj.js → use-debounced-autosave-BesgsSGy.js} +1 -1
  283. package/dist/client/assets/{use-debounced-value-Csr5jCDV.js → use-debounced-value-DfLnstW7.js} +1 -1
  284. package/dist/client/assets/{use-deco-credits-CjSuIvCj.js → use-deco-credits-vsffD2IB.js} +1 -1
  285. package/dist/client/assets/{use-decopilot-events-1ymO_vHG.js → use-decopilot-events-jyM4oYaJ.js} +1 -1
  286. package/dist/client/assets/{use-delete-connection-DIl-WTwH.js → use-delete-connection-B9XzXBHi.js} +1 -1
  287. package/dist/client/assets/{use-deployment-admin-Bln500bu.js → use-deployment-admin-DnuvCNsE.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-BVH9ntfX.js → use-fast-preview-draft-url-D4k5eZ2W.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-BmM3RnWT.js → use-file-configs-DXe1xU9a.js} +1 -1
  290. package/dist/client/assets/{use-infinite-scroll-DKthVIzG.js → use-infinite-scroll-DViN6YmU.js} +1 -1
  291. package/dist/client/assets/{use-join-requests-CMXs54Gp.js → use-join-requests-BAj95XYz.js} +1 -1
  292. package/dist/client/assets/{use-main-panel-tabs-D9AQTjhM.js → use-main-panel-tabs-CASquBgs.js} +1 -1
  293. package/dist/client/assets/{use-mcp-auth-status-BzOtb6NF.js → use-mcp-auth-status-W5VgXonZ.js} +1 -1
  294. package/dist/client/assets/{use-mcp-client-BuS_j4o-.js → use-mcp-client-Ct2vdUoM.js} +1 -1
  295. package/dist/client/assets/{use-mcp-prompts-BBHmJESk.js → use-mcp-prompts-Dk_d3SlG.js} +1 -1
  296. package/dist/client/assets/{use-mcp-tools-DMDsoga2.js → use-mcp-tools-Bnl7RrzG.js} +1 -1
  297. package/dist/client/assets/{use-members-oDlXNVCE.js → use-members-9XNbNa6j.js} +1 -1
  298. package/dist/client/assets/{use-mobile-BCh8YRo6.js → use-mobile--np6aWAG.js} +1 -1
  299. package/dist/client/assets/{use-navigate-to-agent-4LkoL-j8.js → use-navigate-to-agent-0Fvf2Lpw.js} +1 -1
  300. package/dist/client/assets/use-new-blocks-editor-BXR_sYex.js +1 -0
  301. package/dist/client/assets/{use-open-billing-url-BXuHuuOL.js → use-open-billing-url-BMXuqlhP.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-C-MfZ94G.js → use-org-auth-client-CN0iwzUb.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-CmBvsBMY.js → use-org-fs-k5NldW-7.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-d4JgzgQp.js → use-org-repo-syncs-EkZ_pjWr.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-DUqEoTxr.js → use-org-sso-B__Yf47H.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-C_c0eWOx.js → use-organization-roles-B3rV1LLK.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-Cm1vewr9.js → use-organization-settings-B0MM1DlS.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-CiX_5778.js → use-panel-navigate-Dk1Ye1GR.js} +1 -1
  309. package/dist/client/assets/{use-project-scope-BxTK_qgl.js → use-project-scope-C9VWhN8V.js} +1 -1
  310. package/dist/client/assets/{use-releases-BQ508TNB.js → use-releases-DN0A-Kpr.js} +1 -1
  311. package/dist/client/assets/{use-reports-diagnostic-CuugPiuf.js → use-reports-diagnostic-DHXQZUvd.js} +1 -1
  312. package/dist/client/assets/{use-secrets-TLJHLrLj.js → use-secrets-C2MxSlcA.js} +1 -1
  313. package/dist/client/assets/{use-section-preview-base-gSStkCYp.js → use-section-preview-base-BYyvYPZ7.js} +1 -1
  314. package/dist/client/assets/{use-session-runtime-BVWXx-Hx.js → use-session-runtime-DsnbbYN7.js} +1 -1
  315. package/dist/client/assets/{use-tags-CuAeOwml.js → use-tags-CjTVjQFf.js} +1 -1
  316. package/dist/client/assets/{use-task-board-analytics-DpORgpIb.js → use-task-board-analytics-CCzrdEy3.js} +1 -1
  317. package/dist/client/assets/{use-task-board-events-1XpVNJEd.js → use-task-board-events-BHC_8phf.js} +1 -1
  318. package/dist/client/assets/{use-task-metadata-o5vDdJtC.js → use-task-metadata-BzPIvyyo.js} +1 -1
  319. package/dist/client/assets/{use-thread-analytics-CpdUNsgX.js → use-thread-analytics-B0VguZq2.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-qbmnSZLU.js → use-thread-outputs-DCJFafqq.js} +1 -1
  321. package/dist/client/assets/useInfiniteQuery-Dxc2v4r4.js +1 -0
  322. package/dist/client/assets/{useQueries-Cp9cPmFE.js → useQueries-JVjEwDAw.js} +1 -1
  323. package/dist/client/assets/useSuspenseInfiniteQuery-C8qiUH4q.js +1 -0
  324. package/dist/client/assets/{users-BysYiEd8.js → users-CfobUiGt.js} +1 -1
  325. package/dist/client/assets/{utils-BkJACT4F.js → utils-C39wfwww.js} +1 -1
  326. package/dist/client/assets/variant-calendar-Bjori3kc.js +1 -0
  327. package/dist/client/assets/{variant-matcher-override-CDsPfWCr.js → variant-matcher-override-C3oDv2Ac.js} +1 -1
  328. package/dist/client/assets/{view-mode-toggle-DPCA9Xp0.js → view-mode-toggle-7tgTSsST.js} +1 -1
  329. package/dist/client/assets/{virtual-mcp-gaJd4WQ5.js → virtual-mcp-BoM8jJW7.js} +1 -1
  330. package/dist/client/index.html +2 -2
  331. package/dist/server/cli.js +1 -1
  332. package/dist/server/server.js +1 -1
  333. package/package.json +1 -1
  334. package/dist/client/assets/ArrowRight-Q7Kpem3P.js +0 -1
  335. package/dist/client/assets/add-connection-dialog-B13l82-x.js +0 -1
  336. package/dist/client/assets/agent-analytics-Bg7OGjPz.js +0 -2
  337. package/dist/client/assets/agent-app-CYu2vHrt.js +0 -1
  338. package/dist/client/assets/agent-assets-PeHArOTz.js +0 -1
  339. package/dist/client/assets/agent-automations-CG4WPLmg.js +0 -1
  340. package/dist/client/assets/agent-connect-sources-DBVMs9Oh.js +0 -1
  341. package/dist/client/assets/agent-deck-CnP02u1J.js +0 -1
  342. package/dist/client/assets/agent-e2e-CKp4ujG6.js +0 -1
  343. package/dist/client/assets/agent-experiments-B_K8GWFz.js +0 -1
  344. package/dist/client/assets/agent-file-DCWTkVS7.js +0 -1
  345. package/dist/client/assets/agent-hosting-CyJCp9zC.js +0 -1
  346. package/dist/client/assets/agent-icon-DyICUp-0.js +0 -1
  347. package/dist/client/assets/agent-library-C9HW9AGH.js +0 -1
  348. package/dist/client/assets/agent-library-file-BhPllWzW.js +0 -1
  349. package/dist/client/assets/agent-monitor-DE6uc-Yc.js +0 -1
  350. package/dist/client/assets/agent-overview-D2xoxQj1.js +0 -1
  351. package/dist/client/assets/agent-settings-DWsqVjSl.js +0 -1
  352. package/dist/client/assets/agent-site-editor-code-9ugnawPt.js +0 -2
  353. package/dist/client/assets/agent-view-QI30T6v_.js +0 -1
  354. package/dist/client/assets/agents-list-Cve154Hx.js +0 -1
  355. package/dist/client/assets/api-keys-i59HI6Dn.js +0 -1
  356. package/dist/client/assets/app-editor-DRm1-NGV.js +0 -1
  357. package/dist/client/assets/automations-C4ySvzYV.js +0 -1
  358. package/dist/client/assets/category-editor-BZufyouv.js +0 -1
  359. package/dist/client/assets/choose-editor-Bm8A4VvY.js +0 -1
  360. package/dist/client/assets/collection-detail-DvYBq4qN.js +0 -1
  361. package/dist/client/assets/connection-detail-kRlYCz4f.js +0 -1
  362. package/dist/client/assets/connections-5gKP9SMR.js +0 -1
  363. package/dist/client/assets/context-DukDU2Rq.js +0 -1
  364. package/dist/client/assets/daily-pulse-B5jGavJp.js +0 -1
  365. package/dist/client/assets/discover-CUlGD-kG.js +0 -1
  366. package/dist/client/assets/file-explorer-BacigDk4.js +0 -2
  367. package/dist/client/assets/flat-project-TSS3UcZe.js +0 -1
  368. package/dist/client/assets/home-DscOh6R0.js +0 -1
  369. package/dist/client/assets/icon-button-a92J-8vv.js +0 -1
  370. package/dist/client/assets/index-DqGHQkvC.js +0 -1
  371. package/dist/client/assets/index-vBm2nEpb.js +0 -1
  372. package/dist/client/assets/integration-icon--cgW91vt.js +0 -1
  373. package/dist/client/assets/library-CRn84l2y.js +0 -1
  374. package/dist/client/assets/openai-conversation-DB0maE3r.js +0 -3
  375. package/dist/client/assets/post-calendar-BQ6EJh_c.js +0 -1
  376. package/dist/client/assets/project-app-view-DNZzY5H1.js +0 -1
  377. package/dist/client/assets/project-feed-CpIs1E9q.js +0 -1
  378. package/dist/client/assets/project-reports-vXhY3Phe.js +0 -1
  379. package/dist/client/assets/project-tasks-Cq_ycqFh.js +0 -1
  380. package/dist/client/assets/projects-BS00BQBL.js +0 -1
  381. package/dist/client/assets/record-editor-DxsPRjbm.js +0 -1
  382. package/dist/client/assets/redirect-editor-CYq4KwMq.js +0 -1
  383. package/dist/client/assets/reports-BAxcoVP6.js +0 -1
  384. package/dist/client/assets/reports-onboarding-CVv2rrQL.js +0 -1
  385. package/dist/client/assets/reports-tab-B_N3nqkf.js +0 -2
  386. package/dist/client/assets/repositories-Bg9oubuI.js +0 -1
  387. package/dist/client/assets/roles-BMSsHGlS.js +0 -1
  388. package/dist/client/assets/route-B-A-TKed.js +0 -1
  389. package/dist/client/assets/route-BbGr0Fmz.js +0 -1
  390. package/dist/client/assets/route-CKffRuty.js +0 -1
  391. package/dist/client/assets/sections-editor-Ua2U9XX8.js +0 -1
  392. package/dist/client/assets/seo-editor-C3FxnQ4B.js +0 -1
  393. package/dist/client/assets/taskboard-analytics-Cxz6IAs5.js +0 -1
  394. package/dist/client/assets/tasks-zUoRMh__.js +0 -1
  395. package/dist/client/assets/thread-analytics-D8Oxt_vz.js +0 -1
  396. package/dist/client/assets/thread-route-CTg48XGa.js +0 -1
  397. package/dist/client/assets/thread-sheet-body-BQ5QR1zb.js +0 -1
  398. package/dist/client/assets/use-new-blocks-editor-C9Lf0NAr.js +0 -1
  399. package/dist/client/assets/useInfiniteQuery-CucDp1Bl.js +0 -1
  400. package/dist/client/assets/useSuspenseInfiniteQuery-Bv9C99VC.js +0 -1
  401. package/dist/client/assets/variant-calendar-BDehoemX.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as V,b as Q,as as Oe,at as Fe,r as G,j as s,aU as st,ee as Le,t as X,ed as de,ec as ae,aJ as Be,X as se,a2 as te,o as oe,e as ie,x as he,B as W,K as Z,m as pe,aS as ue,l as ne,da as He,fI as it,e_ as ve,ad as lt,ak as nt,L as rt,q as Ke,h as at,au as ot,av as xe,fH as ct}from"./index-CyQyr88p.js";import{i as dt}from"./AlertCircle-BUkWQfB_.js";import{u as qe,a as me,i as ut,b as mt,p as ft,f as be,g as pt,d as ze}from"./use-ai-providers-CkGkm3q3.js";import{i as gt}from"./CheckCircle-CiGc92II.js";import{c as xt,j as ht}from"./use-organization-settings-Cm1vewr9.js";import{S as vt}from"./schema-Gtjoj1mV.js";import{M as bt}from"./select-model-UIikOcTl.js";import{u as yt}from"./use-debounced-autosave-Dl2BkZfj.js";import{I as ce}from"./input-CeDoO_Rr.js";import{T as Ae,a as jt}from"./toggle-group-C6K0IvrN.js";import{A as ye,a as je,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-DPE6kDht.js";import{u as ge,e as we,a as Ve,f as Nt}from"./use-decopilot-events-1ymO_vHG.js";import{u as Ge}from"./use-open-billing-url-BXuHuuOL.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-C9iTCEoq.js";import{i as It}from"./Check-D53o53z1.js";import{d as wt,b as kt,c as Dt}from"./Tool01-UwOdqleo.js";import{s as Kt}from"./Plus-B0T7sCOu.js";import{s as At}from"./Trash01-CzavZmmt.js";import{A as Et}from"./avatar-qgmN1uFW.js";import{u as Tt,f as Rt}from"./use-date-fns-locale-b7C9_zv4.js";import{c as We,P as Ut,C as Ee}from"./decopilot-Cp1gF-AT.js";import{P as Mt}from"./ai-providers-logos-DD3qZ33J.js";import{s as $t}from"./Image01-BOx8LVbG.js";import{d as Ot,c as Ft,b as Lt,D as Bt,e as Ht}from"./dialog-D1MsBTH7.js";import{R as qt}from"./require-capability-BH1WwajD.js";import"./task-board-BZQiH6lk.js";import"./drawer-DQ1B0U-G.js";import"./use-mobile-BCh8YRo6.js";import"./chat-context-CG9Mp_L-.js";import"./use-panel-navigate-CiX_5778.js";import"./thread-route-BnMz_7UO.js";import"./use-project-scope-BxTK_qgl.js";import"./repository-binding-Dgq5OsMA.js";import"./use-mcp-client-BuS_j4o-.js";import"./auth-yZ0dbxiQ.js";import"./autosend-DaQ0WgM_.js";import"./thread-intent-CCZj7A0k.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-DPIrGNp7.js";import"./index-CMZSUEgF.js";import"./User01-CUsG_6c_.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-DoT4yq3W.js";import"./select-BqcGTWMZ.js";import"./index-POiEXzT7.js";import"./ChevronUp-C0R59WlW.js";import"./ArrowLeft-C_Aui1-t.js";import"./Key01-CmosOv0s.js";import"./SearchMd-BjiZq5Ss.js";import"./Monitor01-CqmqvaJt.js";import"./download-app-dialog-CI6vYgNV.js";import"./Copy01-Bc_ajdkn.js";import"./X-CtohJRXR.js";import"./access-gate-BSw0CcmD.js";import"./capability-load-error-BhEiGFSy.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>ut(e),Gt=e=>mt(e),Qt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:zt},{key:"web_search",filter:Vt},{key:"deep_research",filter:Gt}];function Yt(e){const t=V.c(27),{slot:i,onSlotChange:n,filterModels:a,defaultKeyId:r}=e,c=qe(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??r),[f,o]=G.useState(l);f!==l&&(o(l),l&&g(l));let x;t[0]!==c||t[1]!==r||t[2]!==d?(x=c.some(I=>I.id===d)?d:r,t[0]=c,t[1]=r,t[2]=d,t[3]=x):x=t[3];const u=x;let v;t[4]!==u||t[5]!==c?(v=u?c.find(I=>I.id===u):null,t[4]=u,t[5]=c,t[6]=v):v=t[6];const C=v,{models:j,isLoading:h}=me(a?u??void 0:void 0),y=a?h||j.some(a):!0;let N;t[7]!==i||t[8]!==C?.providerId||t[9]!==l?(N=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=C?.providerId,t[9]=l,t[10]=N):N=t[10];const w=N,m=Q();if(a&&!y){let I;t[11]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=m,t[12]=I):I=t[12];let k;return t[13]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[13]=I,t[14]=k):k=t[14],k}let b;t[15]!==m?(b=m("settings.simpleModeSection.pickModel"),t[15]=m,t[16]=b):b=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[17]=S):S=t[17];let p;t[18]!==u||t[19]!==n?(p=I=>{const k=I.keyId??u??"";g(k),n({keyId:k,modelId:I.modelId,title:I.title})},t[18]=u,t[19]=n,t[20]=p):p=t[20];let P;return t[21]!==u||t[22]!==a||t[23]!==w||t[24]!==b||t[25]!==p?(P=s.jsx(bt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:a,onCredentialChange:S,onModelChange:p}),t[21]=u,t[22]=a,t[23]=w,t[24]=b,t[25]=p,t[26]=P):P=t[26],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:n}=e,a=Q();if(i){let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=r):r=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,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:[r,c]}),t[3]=c,t[4]=l):l=t[4],l}if(n){let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(gt,{size:12}),t[5]=r):r=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,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:[r,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Xt(){const e=V.c(58),t=Q(),i=qe(),n=xt(),a=i.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Oe(vt),e[0]=r):r=e[0];let c;e[1]!==n?(c={resolver:r,values:n,mode:"onChange"},e[1]=n,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=ht(),o=l.formState.isDirty;let x;e[3]!==l||e[4]!==n||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(n),X.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=n,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=yt(x),v=i[0],C=i[1],j=i[2],{models:h}=me(v?.id),{models:y}=me(C?.id),{models:N}=me(j?.id);let w,m;e[8]!==l||e[9]!==a?(w=()=>{a||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[a,l],e[8]=l,e[9]=a,e[10]=w,e[11]=m):(w=e[10],m=e[11]),G.useEffect(w,m);let b;e[12]!==i||e[13]!==l||e[14]!==v||e[15]!==C||e[16]!==j||e[17]!==h||e[18]!==y||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Zt)),H={};v?.id&&(H[v.id]=h),C?.id&&(H[C.id]=y),j?.id&&(H[j.id]=N);const z=le=>le!=null&&!M.has(le.keyId),K={fast:z(_.tiers.fast)?null:_.tiers.fast,smart:z(_.tiers.smart)?null:_.tiers.smart,thinking:z(_.tiers.thinking)?null:_.tiers.thinking,image:z(_.tiers.image)?null:_.tiers.image,web_search:z(_.tiers.web_search)?null:_.tiers.web_search,deep_research:z(_.tiers.deep_research)?null:_.tiers.deep_research},Y=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,J=K.fast===_.tiers.fast&&K.smart===_.tiers.smart&&K.thinking===_.tiers.thinking&&K.image===_.tiers.image&&K.web_search===_.tiers.web_search&&K.deep_research===_.tiers.deep_research;if(!Y&&J)return;const ee=ft(i,H);l.reset({tiers:{fast:K.fast??ee.chat.fast,smart:K.smart??ee.chat.smart,thinking:K.thinking??ee.chat.thinking,image:K.image??ee.image,web_search:K.web_search??ee.webSearch,deep_research:K.deep_research??ee.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=v,e[15]=C,e[16]=j,e[17]=h,e[18]=y,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=j?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==y||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,y,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=y,e[25]=N,e[26]=S,e[27]=p,e[28]=P,e[29]=I):I=e[29],G.useEffect(b,I);let k;e[30]!==t?(k=_=>({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")})[_]||_,e[30]=t,e[31]=k):k=e[31];const T=k;let A;e[32]!==t?(A=_=>({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")})[_]||"",e[32]=t,e[33]=A):A=e[33];const U=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let R;e[36]!==t?(R=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=R):R=e[37];let $;e[38]!==R?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:R}),e[38]=R,e[39]=$):$=e[39];const B=f&&!o;let O;e[40]!==g||e[41]!==B?(O=s.jsx(Wt,{isPending:g,showSaved:B}),e[40]=g,e[41]=B,e[42]=O):O=e[42];let F;e[43]!==$||e[44]!==O?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[$,O]}),e[43]=$,e[44]=O,e[45]=F):F=e[45];let L;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==U||e[49]!==T||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:H}=M;return s.jsx(Le,{title:T(_.key),description:U(_.key),action:s.jsx(Yt,{slot:H.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{H.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=T,e[50]=u,e[51]=L):L=e[51];let q;e[52]!==L?(q=s.jsx(de,{children:L}),e[52]=L,e[53]=q):q=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==q?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,q]}),e[54]=E,e[55]=F,e[56]=q,e[57]=D):D=e[57],D}function Zt(e){return e.id}const Jt={usd:[10,20,100],brl:[50,100,500]};function Xe(){const e=V.c(30),t=Q(),i=te(),[n]=he(),[a,r]=G.useState(!1);let c;e[0]!==t?(c=p=>{X.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=ie({mutationFn:async p=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:u});return P},onSuccess:es,onError:c}),[g,f]=G.useState(""),[o,x]=G.useState(n.language==="pt-BR"?"brl":"usd"),u=o,v=parseFloat(g),C=!isNaN(v)&&v>=1,j=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let y,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ae,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),N=s.jsx(Ae,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=y,e[5]=N):(y=e[4],N=e[5]);let w;e[6]!==u||e[7]!==h?(w=s.jsxs(jt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:h,children:[y,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==j||e[11]!==a||e[12]!==d||e[13]!==t||e[14]!==l?(m=!a&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[j,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>r(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=j,e[11]=a,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==j||e[17]!==g||e[18]!==v||e[19]!==a||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=a&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:j}),s.jsx(ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:g,onChange:p=>f(p.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!C||d,onClick:()=>l(Math.round(v*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{r(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=j,e[17]=g,e[18]=v,e[19]=a,e[20]=C,e[21]=d,e[22]=f,e[23]=t,e[24]=l,e[25]=b):b=e[25];let S;return e[26]!==w||e[27]!==m||e[28]!==b?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w,m,b]})}),e[26]=w,e[27]=m,e[28]=b,e[29]=S):S=e[29],S}function es(e){e&&window.open(e,"_blank","noopener,noreferrer")}function ts(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function ss(e){const t=V.c(38),{enabled:i}=e,n=Q(),{org:a}=se(),r=te();let c;t[0]!==a.id?(c=Z.aiProviderCredits(a.id,"deco"),t[0]=a.id,t[1]=c):c=t[1];let l;t[2]!==r?(l=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=r,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:g,isLoading:f,refetch:o,isFetching:x}=pe(d);if(!i)return null;const u=g?.balanceCents!=null?g.balanceCents/100:null;let v;t[8]!==u?(v=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=v):v=t[9];const C=v;let j;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(j=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:ne("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&ts(u)),children:C}),t[10]=u,t[11]=C,t[12]=x,t[13]=f,t[14]=j):j=t[14];let h;t[15]!==o?(h=()=>o(),t[15]=o,t[16]=h):h=t[16];let y;t[17]!==n?(y=n("settings.decoCreditsHero.refreshBalance"),t[17]=n,t[18]=y):y=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=ne(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(Be,{size:14,className:w}),t[21]=w,t[22]=m):m=t[22];let b;t[23]!==x||t[24]!==m||t[25]!==h||t[26]!==y?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-lg hover:bg-muted/50","aria-label":y,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=y,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==j?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[j,b]}),t[28]=b,t[29]=j,t[30]=S):S=t[30];let p;t[31]!==n?(p=n("settings.decoCreditsHero.availableBalance"),t[31]=n,t[32]=p):p=t[32];let P;t[33]!==p?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[33]=p,t[34]=P):P=t[34];let I;return t[35]!==S||t[36]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[S,P]}),t[35]=S,t[36]=P,t[37]=I):I=t[37],I}function is(){const e=V.c(74),t=Q(),{org:i}=se(),n=te(),a=oe(),r=be();let c;e[0]!==r?(c=r.find(ls),e[0]=r,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,o]=G.useState(!1);let x;e[2]!==l||e[3]!==n?(x=async()=>{l&&await n.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=n,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==a||e[7]!==t?(u=()=>{a.invalidateQueries({queryKey:Z.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:Z.aiProviders(i.id)}),X.success(t("settings.decoCreditsHero.disconnectSuccess")),o(!1)},e[5]=i,e[6]=a,e[7]=t,e[8]=u):u=e[8];let v;e[9]!==t?(v=z=>{X.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==u||e[13]!==v?(C={mutationFn:x,onSuccess:u,onError:v},e[11]=x,e[12]=u,e[13]=v,e[14]=C):C=e[14];const{mutate:j,isPending:h}=ie(C);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=e[16];let N;e[17]!==t?(N=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=N):N=e[18];let w;e[19]!==N?(w=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:N,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=N,e[20]=w):w=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=()=>o(!0),e[21]=m):m=e[21];let b;e[22]!==t?(b=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=b):b=e[23];let S;e[24]!==h||e[25]!==b?(S=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:m,disabled:h,children:b}),e[24]=h,e[25]=b,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==w?(p=s.jsxs("div",{className:"flex items-center justify-between",children:[w,S]}),e[27]=S,e[28]=w,e[29]=p):p=e[29];let P;e[30]!==t?(P=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=P):P=e[31];let I;e[32]!==P?(I=s.jsx(ye,{children:P}),e[32]=P,e[33]=I):I=e[33];let k;e[34]!==t?(k=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=k):k=e[35];let T;e[36]!==k?(T=s.jsx(je,{children:k}),e[36]=k,e[37]=T):T=e[37];let A;e[38]!==I||e[39]!==T?(A=s.jsxs(Ne,{children:[I,T]}),e[38]=I,e[39]=T,e[40]=A):A=e[40];let U;e[41]!==t?(U=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=U):U=e[42];let E;e[43]!==U?(E=s.jsx(Se,{children:U}),e[43]=U,e[44]=E):E=e[44];let R;e[45]!==j?(R=()=>j(),e[45]=j,e[46]=R):R=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let B;e[49]!==R||e[50]!==$?(B=s.jsx(Ce,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=R,e[50]=$,e[51]=B):B=e[51];let O;e[52]!==E||e[53]!==B?(O=s.jsxs(Pe,{children:[E,B]}),e[52]=E,e[53]=B,e[54]=O):O=e[54];let F;e[55]!==A||e[56]!==O?(F=s.jsxs(_e,{children:[A,O]}),e[55]=A,e[56]=O,e[57]=F):F=e[57];let L;e[58]!==f||e[59]!==F?(L=s.jsx(Ie,{open:f,onOpenChange:o,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const q=!d;let D;e[61]!==q?(D=s.jsx(ss,{enabled:q}),e[61]=q,e[62]=D):D=e[62];let _;e[63]!==g||e[64]!==t?(_=g?s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:t("settings.decoCreditsHero.addCredits")}),s.jsx(Xe,{})]}):null,e[63]=g,e[64]=t,e[65]=_):_=e[65];let M;e[66]!==p||e[67]!==L||e[68]!==D||e[69]!==_?(M=s.jsx(de,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[p,L,D,_]})}),e[66]=p,e[67]=L,e[68]=D,e[69]=_,e[70]=M):M=e[70];let H;return e[71]!==M||e[72]!==y?(H=s.jsx(ae,{title:y,children:M}),e[71]=M,e[72]=y,e[73]=H):H=e[73],H}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[ns]=it(ke),[rs,as]=ns(ke),Ze=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:n=null,max:a,getValueLabel:r=os,...c}=e;(a||a===0)&&!Te(a)&&console.error(cs(`${a}`,"Progress"));const l=Te(a)?a:De;n!==null&&!Re(n,l)&&console.error(ds(`${n}`,"Progress"));const d=Re(n,l)?n:null,g=fe(d)?r(d,l):void 0;return s.jsx(rs,{scope:i,value:d,max:l,children:s.jsx(He.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":fe(d)?d:void 0,"aria-valuetext":g,role:"progressbar","data-state":tt(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});Ze.displayName=ke;var Je="ProgressIndicator",et=G.forwardRef((e,t)=>{const{__scopeProgress:i,...n}=e,a=as(Je,i);return s.jsx(He.div,{"data-state":tt(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:t})});et.displayName=Je;function os(e,t){return`${Math.round(e/t*100)}%`}function tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function fe(e){return typeof e=="number"}function Te(e){return fe(e)&&!isNaN(e)&&e>0}function Re(e,t){return fe(e)&&!isNaN(e)&&e<=t&&e>=0}function cs(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${De}\`.`}function ds(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
1
+ import{c as V,b as Q,as as Oe,at as Fe,r as G,j as s,aU as st,ee as Le,t as X,ed as de,ec as ae,aJ as Be,X as se,a2 as te,o as oe,e as ie,x as he,B as W,K as Z,m as pe,aS as ue,l as ne,da as He,fI as it,e_ as ve,ad as lt,ak as nt,L as rt,q as Ke,h as at,au as ot,av as xe,fH as ct}from"./index-CWzlOAQX.js";import{i as dt}from"./AlertCircle-CVYthSXp.js";import{u as qe,a as me,i as ut,b as mt,p as ft,f as be,g as pt,d as ze}from"./use-ai-providers-BYo-eRGm.js";import{i as gt}from"./CheckCircle-BsdvfhEK.js";import{c as xt,j as ht}from"./use-organization-settings-B0MM1DlS.js";import{S as vt}from"./schema-BKdAxrjN.js";import{M as bt}from"./select-model-BfrFqNKL.js";import{u as yt}from"./use-debounced-autosave-BesgsSGy.js";import{I as ce}from"./input-BT8saI27.js";import{T as Ae,a as jt}from"./toggle-group-Ddc-8H1o.js";import{A as ye,a as je,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-BYJnmaQz.js";import{u as ge,e as we,a as Ve,f as Nt}from"./use-decopilot-events-jyM4oYaJ.js";import{u as Ge}from"./use-open-billing-url-BMXuqlhP.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-C4roHlM5.js";import{i as It}from"./Check-DN3fVKj8.js";import{d as wt,b as kt,c as Dt}from"./Tool01-U6VAdTvK.js";import{s as Kt}from"./Plus-CGgnB9yV.js";import{s as At}from"./Trash01-d2ldPDpp.js";import{A as Et}from"./avatar-DnckqjGp.js";import{u as Tt,f as Rt}from"./use-date-fns-locale-DvDfBLBf.js";import{c as We,P as Ut,C as Ee}from"./decopilot-CaWhcF5x.js";import{P as Mt}from"./ai-providers-logos-DD3qZ33J.js";import{s as $t}from"./Image01-Y9Scw-o_.js";import{d as Ot,c as Ft,b as Lt,D as Bt,e as Ht}from"./dialog-DwOXW4AO.js";import{R as qt}from"./require-capability-C2Nda3jm.js";import"./task-board-ZOkVjFfb.js";import"./drawer-DYVK-Yxy.js";import"./use-mobile--np6aWAG.js";import"./chat-context-CSREXmZ-.js";import"./use-panel-navigate-Dk1Ye1GR.js";import"./thread-route-D9Gbeij-.js";import"./use-project-scope-C9VWhN8V.js";import"./repository-binding-3gizJnq4.js";import"./use-mcp-client-Ct2vdUoM.js";import"./auth-BA3Q_TJo.js";import"./autosend-D_HIQJhP.js";import"./thread-intent-uQTUqJNN.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-DPIrGNp7.js";import"./index-BbS4gDnQ.js";import"./User01-DrdqUOnb.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-VSFOqgpI.js";import"./select-CF6Gp6z2.js";import"./index-Qp03HhfC.js";import"./ChevronUp-xWbDxNSk.js";import"./ArrowLeft-CyFyBJmn.js";import"./Key01-CtWEwt_r.js";import"./SearchMd-B7WxOr73.js";import"./Monitor01-kmeIS50B.js";import"./download-app-dialog-CZZmW5dI.js";import"./Copy01-Dv7sipLd.js";import"./X-MCJw_lkE.js";import"./access-gate-buHLOhRt.js";import"./capability-load-error-BwY99ChM.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>ut(e),Gt=e=>mt(e),Qt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:zt},{key:"web_search",filter:Vt},{key:"deep_research",filter:Gt}];function Yt(e){const t=V.c(27),{slot:i,onSlotChange:n,filterModels:a,defaultKeyId:r}=e,c=qe(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??r),[f,o]=G.useState(l);f!==l&&(o(l),l&&g(l));let x;t[0]!==c||t[1]!==r||t[2]!==d?(x=c.some(I=>I.id===d)?d:r,t[0]=c,t[1]=r,t[2]=d,t[3]=x):x=t[3];const u=x;let v;t[4]!==u||t[5]!==c?(v=u?c.find(I=>I.id===u):null,t[4]=u,t[5]=c,t[6]=v):v=t[6];const C=v,{models:j,isLoading:h}=me(a?u??void 0:void 0),y=a?h||j.some(a):!0;let N;t[7]!==i||t[8]!==C?.providerId||t[9]!==l?(N=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=C?.providerId,t[9]=l,t[10]=N):N=t[10];const w=N,m=Q();if(a&&!y){let I;t[11]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=m,t[12]=I):I=t[12];let k;return t[13]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[13]=I,t[14]=k):k=t[14],k}let b;t[15]!==m?(b=m("settings.simpleModeSection.pickModel"),t[15]=m,t[16]=b):b=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[17]=S):S=t[17];let p;t[18]!==u||t[19]!==n?(p=I=>{const k=I.keyId??u??"";g(k),n({keyId:k,modelId:I.modelId,title:I.title})},t[18]=u,t[19]=n,t[20]=p):p=t[20];let P;return t[21]!==u||t[22]!==a||t[23]!==w||t[24]!==b||t[25]!==p?(P=s.jsx(bt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:a,onCredentialChange:S,onModelChange:p}),t[21]=u,t[22]=a,t[23]=w,t[24]=b,t[25]=p,t[26]=P):P=t[26],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:n}=e,a=Q();if(i){let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=r):r=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,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:[r,c]}),t[3]=c,t[4]=l):l=t[4],l}if(n){let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(gt,{size:12}),t[5]=r):r=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,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:[r,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Xt(){const e=V.c(58),t=Q(),i=qe(),n=xt(),a=i.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Oe(vt),e[0]=r):r=e[0];let c;e[1]!==n?(c={resolver:r,values:n,mode:"onChange"},e[1]=n,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=ht(),o=l.formState.isDirty;let x;e[3]!==l||e[4]!==n||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(n),X.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=n,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=yt(x),v=i[0],C=i[1],j=i[2],{models:h}=me(v?.id),{models:y}=me(C?.id),{models:N}=me(j?.id);let w,m;e[8]!==l||e[9]!==a?(w=()=>{a||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[a,l],e[8]=l,e[9]=a,e[10]=w,e[11]=m):(w=e[10],m=e[11]),G.useEffect(w,m);let b;e[12]!==i||e[13]!==l||e[14]!==v||e[15]!==C||e[16]!==j||e[17]!==h||e[18]!==y||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Zt)),H={};v?.id&&(H[v.id]=h),C?.id&&(H[C.id]=y),j?.id&&(H[j.id]=N);const z=le=>le!=null&&!M.has(le.keyId),K={fast:z(_.tiers.fast)?null:_.tiers.fast,smart:z(_.tiers.smart)?null:_.tiers.smart,thinking:z(_.tiers.thinking)?null:_.tiers.thinking,image:z(_.tiers.image)?null:_.tiers.image,web_search:z(_.tiers.web_search)?null:_.tiers.web_search,deep_research:z(_.tiers.deep_research)?null:_.tiers.deep_research},Y=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,J=K.fast===_.tiers.fast&&K.smart===_.tiers.smart&&K.thinking===_.tiers.thinking&&K.image===_.tiers.image&&K.web_search===_.tiers.web_search&&K.deep_research===_.tiers.deep_research;if(!Y&&J)return;const ee=ft(i,H);l.reset({tiers:{fast:K.fast??ee.chat.fast,smart:K.smart??ee.chat.smart,thinking:K.thinking??ee.chat.thinking,image:K.image??ee.image,web_search:K.web_search??ee.webSearch,deep_research:K.deep_research??ee.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=v,e[15]=C,e[16]=j,e[17]=h,e[18]=y,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=j?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==y||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,y,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=y,e[25]=N,e[26]=S,e[27]=p,e[28]=P,e[29]=I):I=e[29],G.useEffect(b,I);let k;e[30]!==t?(k=_=>({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")})[_]||_,e[30]=t,e[31]=k):k=e[31];const T=k;let A;e[32]!==t?(A=_=>({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")})[_]||"",e[32]=t,e[33]=A):A=e[33];const U=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let R;e[36]!==t?(R=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=R):R=e[37];let $;e[38]!==R?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:R}),e[38]=R,e[39]=$):$=e[39];const B=f&&!o;let O;e[40]!==g||e[41]!==B?(O=s.jsx(Wt,{isPending:g,showSaved:B}),e[40]=g,e[41]=B,e[42]=O):O=e[42];let F;e[43]!==$||e[44]!==O?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[$,O]}),e[43]=$,e[44]=O,e[45]=F):F=e[45];let L;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==U||e[49]!==T||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:H}=M;return s.jsx(Le,{title:T(_.key),description:U(_.key),action:s.jsx(Yt,{slot:H.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{H.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=T,e[50]=u,e[51]=L):L=e[51];let q;e[52]!==L?(q=s.jsx(de,{children:L}),e[52]=L,e[53]=q):q=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==q?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,q]}),e[54]=E,e[55]=F,e[56]=q,e[57]=D):D=e[57],D}function Zt(e){return e.id}const Jt={usd:[10,20,100],brl:[50,100,500]};function Xe(){const e=V.c(30),t=Q(),i=te(),[n]=he(),[a,r]=G.useState(!1);let c;e[0]!==t?(c=p=>{X.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=ie({mutationFn:async p=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:u});return P},onSuccess:es,onError:c}),[g,f]=G.useState(""),[o,x]=G.useState(n.language==="pt-BR"?"brl":"usd"),u=o,v=parseFloat(g),C=!isNaN(v)&&v>=1,j=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let y,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ae,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),N=s.jsx(Ae,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=y,e[5]=N):(y=e[4],N=e[5]);let w;e[6]!==u||e[7]!==h?(w=s.jsxs(jt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:h,children:[y,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==j||e[11]!==a||e[12]!==d||e[13]!==t||e[14]!==l?(m=!a&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[j,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>r(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=j,e[11]=a,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==j||e[17]!==g||e[18]!==v||e[19]!==a||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=a&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:j}),s.jsx(ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:g,onChange:p=>f(p.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!C||d,onClick:()=>l(Math.round(v*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{r(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=j,e[17]=g,e[18]=v,e[19]=a,e[20]=C,e[21]=d,e[22]=f,e[23]=t,e[24]=l,e[25]=b):b=e[25];let S;return e[26]!==w||e[27]!==m||e[28]!==b?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w,m,b]})}),e[26]=w,e[27]=m,e[28]=b,e[29]=S):S=e[29],S}function es(e){e&&window.open(e,"_blank","noopener,noreferrer")}function ts(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function ss(e){const t=V.c(38),{enabled:i}=e,n=Q(),{org:a}=se(),r=te();let c;t[0]!==a.id?(c=Z.aiProviderCredits(a.id,"deco"),t[0]=a.id,t[1]=c):c=t[1];let l;t[2]!==r?(l=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=r,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:g,isLoading:f,refetch:o,isFetching:x}=pe(d);if(!i)return null;const u=g?.balanceCents!=null?g.balanceCents/100:null;let v;t[8]!==u?(v=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=v):v=t[9];const C=v;let j;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(j=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:ne("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&ts(u)),children:C}),t[10]=u,t[11]=C,t[12]=x,t[13]=f,t[14]=j):j=t[14];let h;t[15]!==o?(h=()=>o(),t[15]=o,t[16]=h):h=t[16];let y;t[17]!==n?(y=n("settings.decoCreditsHero.refreshBalance"),t[17]=n,t[18]=y):y=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=ne(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(Be,{size:14,className:w}),t[21]=w,t[22]=m):m=t[22];let b;t[23]!==x||t[24]!==m||t[25]!==h||t[26]!==y?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-lg hover:bg-muted/50","aria-label":y,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=y,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==j?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[j,b]}),t[28]=b,t[29]=j,t[30]=S):S=t[30];let p;t[31]!==n?(p=n("settings.decoCreditsHero.availableBalance"),t[31]=n,t[32]=p):p=t[32];let P;t[33]!==p?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[33]=p,t[34]=P):P=t[34];let I;return t[35]!==S||t[36]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[S,P]}),t[35]=S,t[36]=P,t[37]=I):I=t[37],I}function is(){const e=V.c(74),t=Q(),{org:i}=se(),n=te(),a=oe(),r=be();let c;e[0]!==r?(c=r.find(ls),e[0]=r,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,o]=G.useState(!1);let x;e[2]!==l||e[3]!==n?(x=async()=>{l&&await n.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=n,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==a||e[7]!==t?(u=()=>{a.invalidateQueries({queryKey:Z.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:Z.aiProviders(i.id)}),X.success(t("settings.decoCreditsHero.disconnectSuccess")),o(!1)},e[5]=i,e[6]=a,e[7]=t,e[8]=u):u=e[8];let v;e[9]!==t?(v=z=>{X.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==u||e[13]!==v?(C={mutationFn:x,onSuccess:u,onError:v},e[11]=x,e[12]=u,e[13]=v,e[14]=C):C=e[14];const{mutate:j,isPending:h}=ie(C);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=e[16];let N;e[17]!==t?(N=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=N):N=e[18];let w;e[19]!==N?(w=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:N,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=N,e[20]=w):w=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=()=>o(!0),e[21]=m):m=e[21];let b;e[22]!==t?(b=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=b):b=e[23];let S;e[24]!==h||e[25]!==b?(S=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:m,disabled:h,children:b}),e[24]=h,e[25]=b,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==w?(p=s.jsxs("div",{className:"flex items-center justify-between",children:[w,S]}),e[27]=S,e[28]=w,e[29]=p):p=e[29];let P;e[30]!==t?(P=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=P):P=e[31];let I;e[32]!==P?(I=s.jsx(ye,{children:P}),e[32]=P,e[33]=I):I=e[33];let k;e[34]!==t?(k=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=k):k=e[35];let T;e[36]!==k?(T=s.jsx(je,{children:k}),e[36]=k,e[37]=T):T=e[37];let A;e[38]!==I||e[39]!==T?(A=s.jsxs(Ne,{children:[I,T]}),e[38]=I,e[39]=T,e[40]=A):A=e[40];let U;e[41]!==t?(U=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=U):U=e[42];let E;e[43]!==U?(E=s.jsx(Se,{children:U}),e[43]=U,e[44]=E):E=e[44];let R;e[45]!==j?(R=()=>j(),e[45]=j,e[46]=R):R=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let B;e[49]!==R||e[50]!==$?(B=s.jsx(Ce,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=R,e[50]=$,e[51]=B):B=e[51];let O;e[52]!==E||e[53]!==B?(O=s.jsxs(Pe,{children:[E,B]}),e[52]=E,e[53]=B,e[54]=O):O=e[54];let F;e[55]!==A||e[56]!==O?(F=s.jsxs(_e,{children:[A,O]}),e[55]=A,e[56]=O,e[57]=F):F=e[57];let L;e[58]!==f||e[59]!==F?(L=s.jsx(Ie,{open:f,onOpenChange:o,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const q=!d;let D;e[61]!==q?(D=s.jsx(ss,{enabled:q}),e[61]=q,e[62]=D):D=e[62];let _;e[63]!==g||e[64]!==t?(_=g?s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:t("settings.decoCreditsHero.addCredits")}),s.jsx(Xe,{})]}):null,e[63]=g,e[64]=t,e[65]=_):_=e[65];let M;e[66]!==p||e[67]!==L||e[68]!==D||e[69]!==_?(M=s.jsx(de,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[p,L,D,_]})}),e[66]=p,e[67]=L,e[68]=D,e[69]=_,e[70]=M):M=e[70];let H;return e[71]!==M||e[72]!==y?(H=s.jsx(ae,{title:y,children:M}),e[71]=M,e[72]=y,e[73]=H):H=e[73],H}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[ns]=it(ke),[rs,as]=ns(ke),Ze=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:n=null,max:a,getValueLabel:r=os,...c}=e;(a||a===0)&&!Te(a)&&console.error(cs(`${a}`,"Progress"));const l=Te(a)?a:De;n!==null&&!Re(n,l)&&console.error(ds(`${n}`,"Progress"));const d=Re(n,l)?n:null,g=fe(d)?r(d,l):void 0;return s.jsx(rs,{scope:i,value:d,max:l,children:s.jsx(He.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":fe(d)?d:void 0,"aria-valuetext":g,role:"progressbar","data-state":tt(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});Ze.displayName=ke;var Je="ProgressIndicator",et=G.forwardRef((e,t)=>{const{__scopeProgress:i,...n}=e,a=as(Je,i);return s.jsx(He.div,{"data-state":tt(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:t})});et.displayName=Je;function os(e,t){return`${Math.round(e/t*100)}%`}function tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function fe(e){return typeof e=="number"}function Te(e){return fe(e)&&!isNaN(e)&&e>0}function Re(e,t){return fe(e)&&!isNaN(e)&&e<=t&&e>=0}function cs(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${De}\`.`}function ds(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 ${De} if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.
@@ -1 +1 @@
1
- import{c as n,l as o,j as c,aH as d}from"./index-CyQyr88p.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{v as A,f as a,x as b};
1
+ import{c as n,l as o,j as c,aH as d}from"./index-CWzlOAQX.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{v as A,f as a,x as b};
@@ -1,4 +1,4 @@
1
- import{j as r,bf as w,r as i,bm as m,di as T,aw as O,bp as M,bg as I,bh as z,bl as A,dj as D,bi as F,dd as L,bF as k,bj as G,bk as H,c as n,l as p,az as v}from"./index-CyQyr88p.js";var x="AlertDialog",[V]=k(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var W="AlertDialogTrigger",Y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});Y.displayName=W;var q="AlertDialogPortal",b=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};b.displayName=q;var B="AlertDialogOverlay",y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});y.displayName=B;var f="AlertDialogContent",[J,K]=V(f),Q=L("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(T,{contentName:f,titleName:_,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(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 _="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=_;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...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}=K($,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{j as r,bf as w,r as i,bm as m,di as T,aw as O,bp as M,bg as I,bh as z,bl as A,dj as D,bi as F,dd as L,bF as k,bj as G,bk as H,c as n,l as p,az as v}from"./index-CWzlOAQX.js";var x="AlertDialog",[V]=k(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var W="AlertDialogTrigger",Y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});Y.displayName=W;var q="AlertDialogPortal",b=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};b.displayName=q;var B="AlertDialogOverlay",y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});y.displayName=B;var f="AlertDialogContent",[J,K]=V(f),Q=L("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(T,{contentName:f,titleName:_,docsSlug:"alert-dialog",children:r.jsx(J,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(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 _="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=_;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...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}=K($,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{r as L,c as N,j as s,b as E}from"./index-CyQyr88p.js";import{b as D,c as M,d as F,C as I,a as A}from"./chart-CpCJ5a7h.js";import{T as B,a as H,b as _,c as K,d as U,e as z}from"./table-2Z24Uf7A.js";import{a0 as P,a1 as V,C as W,Y as X}from"./CartesianChart-BJS29ety.js";import{L as Y}from"./Line-CComtnBD.js";import{X as G}from"./XAxis-Depi7ZOt.js";var q=["axis"],J=L.forwardRef((r,e)=>L.createElement(P,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:q,tooltipPayloadSearcher:V,categoricalChartProps:r,ref:e}));const v=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function R(r){const e=Math.abs(r);return e<60?`${Math.round(r)}s`:e<3600?`${Math.round(r/60)}m`:e<86400?`${(r/3600).toFixed(1)}h`:`${(r/86400).toFixed(1)}d`}function O(r,e){return r===null||Number.isNaN(r)?"—":e==="s"?R(r):e==="%"?`${r}%`:e==="USD"?`$${r.toFixed(2)}`:r.toLocaleString()}function Q(r){const e=N.c(4),{section:t}=r;let o;e[0]!==t.values?(o=t.values.map(Z),e[0]=t.values,e[1]=o):o=e[1];let a;return e[2]!==o?(a=s.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:o}),e[2]=o,e[3]=a):a=e[3],a}function Z(r){return s.jsxs("div",{className:"rounded-lg border border-border p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:r.label}),s.jsx("div",{className:"mt-1 text-2xl font-medium text-foreground tabular-nums",children:O(r.value,r.unit)})]},r.label)}function ee(r){return Array.from(new Set(r.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function te(r){const e=N.c(30),{section:t}=r,o=ee(t.points),a=Object.fromEntries(o.map(ne));let n;e[0]!==t.points?(n=t.points.map(se),e[0]=t.points,e[1]=n):n=e[1];const l=n,c=E();if(l.length===0){let m;e[2]!==c?(m=c("taskBoard.analytics.noDataInRange"),e[2]=c,e[3]=m):m=e[3];let T;return e[4]!==m?(T=s.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:m}),e[4]=m,e[5]=T):T=e[5],T}const d=F,x="img",p=t.title,b="h-64 w-full",g=J;let i,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(i={left:0,right:8,top:8,bottom:8},f=s.jsx(W,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[6]=i,e[7]=f):(i=e[6],f=e[7]);let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(G,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),e[8]=j):j=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h={fontSize:11,fill:"var(--muted-foreground)"},e[9]=h):h=e[9];let u;e[10]!==t.unit?(u=s.jsx(X,{axisLine:!1,tickLine:!1,tick:h,tickFormatter:m=>t.unit==="s"?R(m):String(m),width:48}),e[10]=t.unit,e[11]=u):u=e[11];let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k={stroke:"var(--border)",strokeDasharray:"4 4"},e[12]=k):k=e[12];let S;e[13]!==t.unit?(S=s.jsx(I,{cursor:k,content:s.jsx(A,{formatter:m=>O(Number(m),t.unit??void 0)})}),e[13]=t.unit,e[14]=S):S=e[14];const w=o.length>1&&s.jsx(D,{content:s.jsx(M,{})}),$=o.map(re);let C;e[15]!==g||e[16]!==l||e[17]!==S||e[18]!==w||e[19]!==$||e[20]!==i||e[21]!==f||e[22]!==j||e[23]!==u?(C=s.jsxs(g,{data:l,margin:i,children:[f,j,u,S,w,$]}),e[15]=g,e[16]=l,e[17]=S,e[18]=w,e[19]=$,e[20]=i,e[21]=f,e[22]=j,e[23]=u,e[24]=C):C=e[24];let y;return e[25]!==d||e[26]!==a||e[27]!==t.title||e[28]!==C?(y=s.jsx(d,{role:x,"aria-label":p,className:b,config:a,children:C}),e[25]=d,e[26]=a,e[27]=t.title,e[28]=C,e[29]=y):y=e[29],y}function re(r,e){return s.jsx(Y,{type:"linear",dataKey:r,stroke:v[e%v.length],strokeWidth:2,dot:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},animationDuration:300},r)}function se(r){return{...r,label:String(r.t??"").slice(0,10)}}function ne(r,e){return[r,{label:r,color:v[e%v.length]}]}function ae(r,e){return`/${encodeURIComponent(r)}/${encodeURIComponent(e)}`}function oe(r){const e=N.c(28),{section:t,threadLinks:o}=r,a=E(),n=t.columns.indexOf("Org");let l;e[0]!==n||e[1]!==t.columns||e[2]!==o?(l=o&&n>=0?t.columns.indexOf("Thread"):-1,e[0]=n,e[1]=t.columns,e[2]=o,e[3]=l):l=e[3];const c=l;if(t.rows.length===0){let i;e[4]!==a?(i=a("taskBoard.analytics.nothingToShow"),e[4]=a,e[5]=i):i=e[5];let f;return e[6]!==i?(f=s.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=f):f=e[7],f}let d;e[8]!==t.columns?(d=t.columns.map(ie),e[8]=t.columns,e[9]=d):d=e[9];let x;e[10]!==d?(x=s.jsx(H,{children:s.jsx(_,{children:d})}),e[10]=d,e[11]=x):x=e[11];let p;if(e[12]!==n||e[13]!==t.columns||e[14]!==t.rows||e[15]!==t.title||e[16]!==c){let i;e[18]!==n||e[19]!==t.columns||e[20]!==t.title||e[21]!==c?(i=(f,j)=>s.jsx(_,{children:f.map((h,u)=>s.jsx(K,{className:"max-w-md truncate text-sm tabular-nums",children:h===null?"—":u===c?s.jsx("a",{href:ae(String(f[n]),String(h)),target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-2 hover:underline",children:String(h)}):String(h)},t.columns[u]??String(u)))},`${t.title}-${j}`),e[18]=n,e[19]=t.columns,e[20]=t.title,e[21]=c,e[22]=i):i=e[22],p=t.rows.map(i),e[12]=n,e[13]=t.columns,e[14]=t.rows,e[15]=t.title,e[16]=c,e[17]=p}else p=e[17];let b;e[23]!==p?(b=s.jsx(U,{children:p}),e[23]=p,e[24]=b):b=e[24];let g;return e[25]!==x||e[26]!==b?(g=s.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:s.jsxs(z,{children:[x,b]})}),e[25]=x,e[26]=b,e[27]=g):g=e[27],g}function ie(r){return s.jsx(B,{className:"whitespace-nowrap",children:r},r)}function he(r){const e=N.c(14),{section:t,threadLinks:o}=r;let a;e[0]!==t.title?(a=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.title}),e[0]=t.title,e[1]=a):a=e[1];let n;e[2]!==t?(n=t.kind==="stat"&&s.jsx(Q,{section:t}),e[2]=t,e[3]=n):n=e[3];let l;e[4]!==t?(l=t.kind==="series"&&s.jsx(te,{section:t}),e[4]=t,e[5]=l):l=e[5];let c;e[6]!==t||e[7]!==o?(c=t.kind==="table"&&s.jsx(oe,{section:t,threadLinks:o}),e[6]=t,e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==n||e[11]!==l||e[12]!==c?(d=s.jsxs("section",{className:"flex flex-col gap-3",children:[a,n,l,c]}),e[9]=a,e[10]=n,e[11]=l,e[12]=c,e[13]=d):d=e[13],d}export{he as S};
1
+ import{r as L,c as N,j as s,b as E}from"./index-CWzlOAQX.js";import{b as D,c as M,d as F,C as I,a as A}from"./chart-DzZFGD1z.js";import{T as B,a as H,b as _,c as K,d as U,e as z}from"./table-BiIyEc6M.js";import{a0 as P,a1 as V,C as W,Y as X}from"./CartesianChart-B5tlzKMt.js";import{L as Y}from"./Line-DBvwF3QX.js";import{X as G}from"./XAxis-CUk_D47K.js";var q=["axis"],J=L.forwardRef((r,e)=>L.createElement(P,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:q,tooltipPayloadSearcher:V,categoricalChartProps:r,ref:e}));const v=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function R(r){const e=Math.abs(r);return e<60?`${Math.round(r)}s`:e<3600?`${Math.round(r/60)}m`:e<86400?`${(r/3600).toFixed(1)}h`:`${(r/86400).toFixed(1)}d`}function O(r,e){return r===null||Number.isNaN(r)?"—":e==="s"?R(r):e==="%"?`${r}%`:e==="USD"?`$${r.toFixed(2)}`:r.toLocaleString()}function Q(r){const e=N.c(4),{section:t}=r;let o;e[0]!==t.values?(o=t.values.map(Z),e[0]=t.values,e[1]=o):o=e[1];let a;return e[2]!==o?(a=s.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:o}),e[2]=o,e[3]=a):a=e[3],a}function Z(r){return s.jsxs("div",{className:"rounded-lg border border-border p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:r.label}),s.jsx("div",{className:"mt-1 text-2xl font-medium text-foreground tabular-nums",children:O(r.value,r.unit)})]},r.label)}function ee(r){return Array.from(new Set(r.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function te(r){const e=N.c(30),{section:t}=r,o=ee(t.points),a=Object.fromEntries(o.map(ne));let n;e[0]!==t.points?(n=t.points.map(se),e[0]=t.points,e[1]=n):n=e[1];const l=n,c=E();if(l.length===0){let m;e[2]!==c?(m=c("taskBoard.analytics.noDataInRange"),e[2]=c,e[3]=m):m=e[3];let T;return e[4]!==m?(T=s.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:m}),e[4]=m,e[5]=T):T=e[5],T}const d=F,x="img",p=t.title,b="h-64 w-full",g=J;let i,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(i={left:0,right:8,top:8,bottom:8},f=s.jsx(W,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[6]=i,e[7]=f):(i=e[6],f=e[7]);let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(G,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),e[8]=j):j=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h={fontSize:11,fill:"var(--muted-foreground)"},e[9]=h):h=e[9];let u;e[10]!==t.unit?(u=s.jsx(X,{axisLine:!1,tickLine:!1,tick:h,tickFormatter:m=>t.unit==="s"?R(m):String(m),width:48}),e[10]=t.unit,e[11]=u):u=e[11];let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k={stroke:"var(--border)",strokeDasharray:"4 4"},e[12]=k):k=e[12];let S;e[13]!==t.unit?(S=s.jsx(I,{cursor:k,content:s.jsx(A,{formatter:m=>O(Number(m),t.unit??void 0)})}),e[13]=t.unit,e[14]=S):S=e[14];const w=o.length>1&&s.jsx(D,{content:s.jsx(M,{})}),$=o.map(re);let C;e[15]!==g||e[16]!==l||e[17]!==S||e[18]!==w||e[19]!==$||e[20]!==i||e[21]!==f||e[22]!==j||e[23]!==u?(C=s.jsxs(g,{data:l,margin:i,children:[f,j,u,S,w,$]}),e[15]=g,e[16]=l,e[17]=S,e[18]=w,e[19]=$,e[20]=i,e[21]=f,e[22]=j,e[23]=u,e[24]=C):C=e[24];let y;return e[25]!==d||e[26]!==a||e[27]!==t.title||e[28]!==C?(y=s.jsx(d,{role:x,"aria-label":p,className:b,config:a,children:C}),e[25]=d,e[26]=a,e[27]=t.title,e[28]=C,e[29]=y):y=e[29],y}function re(r,e){return s.jsx(Y,{type:"linear",dataKey:r,stroke:v[e%v.length],strokeWidth:2,dot:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},animationDuration:300},r)}function se(r){return{...r,label:String(r.t??"").slice(0,10)}}function ne(r,e){return[r,{label:r,color:v[e%v.length]}]}function ae(r,e){return`/${encodeURIComponent(r)}/${encodeURIComponent(e)}`}function oe(r){const e=N.c(28),{section:t,threadLinks:o}=r,a=E(),n=t.columns.indexOf("Org");let l;e[0]!==n||e[1]!==t.columns||e[2]!==o?(l=o&&n>=0?t.columns.indexOf("Thread"):-1,e[0]=n,e[1]=t.columns,e[2]=o,e[3]=l):l=e[3];const c=l;if(t.rows.length===0){let i;e[4]!==a?(i=a("taskBoard.analytics.nothingToShow"),e[4]=a,e[5]=i):i=e[5];let f;return e[6]!==i?(f=s.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=f):f=e[7],f}let d;e[8]!==t.columns?(d=t.columns.map(ie),e[8]=t.columns,e[9]=d):d=e[9];let x;e[10]!==d?(x=s.jsx(H,{children:s.jsx(_,{children:d})}),e[10]=d,e[11]=x):x=e[11];let p;if(e[12]!==n||e[13]!==t.columns||e[14]!==t.rows||e[15]!==t.title||e[16]!==c){let i;e[18]!==n||e[19]!==t.columns||e[20]!==t.title||e[21]!==c?(i=(f,j)=>s.jsx(_,{children:f.map((h,u)=>s.jsx(K,{className:"max-w-md truncate text-sm tabular-nums",children:h===null?"—":u===c?s.jsx("a",{href:ae(String(f[n]),String(h)),target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-2 hover:underline",children:String(h)}):String(h)},t.columns[u]??String(u)))},`${t.title}-${j}`),e[18]=n,e[19]=t.columns,e[20]=t.title,e[21]=c,e[22]=i):i=e[22],p=t.rows.map(i),e[12]=n,e[13]=t.columns,e[14]=t.rows,e[15]=t.title,e[16]=c,e[17]=p}else p=e[17];let b;e[23]!==p?(b=s.jsx(U,{children:p}),e[23]=p,e[24]=b):b=e[24];let g;return e[25]!==x||e[26]!==b?(g=s.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:s.jsxs(z,{children:[x,b]})}),e[25]=x,e[26]=b,e[27]=g):g=e[27],g}function ie(r){return s.jsx(B,{className:"whitespace-nowrap",children:r},r)}function he(r){const e=N.c(14),{section:t,threadLinks:o}=r;let a;e[0]!==t.title?(a=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.title}),e[0]=t.title,e[1]=a):a=e[1];let n;e[2]!==t?(n=t.kind==="stat"&&s.jsx(Q,{section:t}),e[2]=t,e[3]=n):n=e[3];let l;e[4]!==t?(l=t.kind==="series"&&s.jsx(te,{section:t}),e[4]=t,e[5]=l):l=e[5];let c;e[6]!==t||e[7]!==o?(c=t.kind==="table"&&s.jsx(oe,{section:t,threadLinks:o}),e[6]=t,e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==n||e[11]!==l||e[12]!==c?(d=s.jsxs("section",{className:"flex flex-col gap-3",children:[a,n,l,c]}),e[9]=a,e[10]=n,e[11]=l,e[12]=c,e[13]=d):d=e[13],d}export{he as S};
@@ -1 +1 @@
1
- import{c as A,X as Q,z as R,K as Y,m as ce,o as J,e as U,j as i,fH as de,b as F,r as O,ec as me,e_ as X,B as v,t as q}from"./index-CyQyr88p.js";import{i as fe}from"./AlertCircle-BUkWQfB_.js";import{a as ue}from"./Copy01-Bc_ajdkn.js";import{i as V}from"./Key01-CmosOv0s.js";import{s as W}from"./Plus-B0T7sCOu.js";import{s as ge}from"./Trash01-CzavZmmt.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-DPE6kDht.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-D1MsBTH7.js";import{I as le}from"./input-CeDoO_Rr.js";import{L as De}from"./label-DO3jRcdx.js";import{u as H}from"./use-mcp-client-BuS_j4o-.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(V,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function _e(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(V,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(W,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.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:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function we(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=L=>{L?r(L):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,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=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=L=>c(L.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let _;e[35]!==s?(_=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=_):_=e[36];let w;e[37]!==o.isPending||e[38]!==m||e[39]!==_?(w=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:_}),e[37]=o.isPending,e[38]=m,e[39]=_,e[40]=w):w=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==w||e[51]!==T?(k=i.jsxs(se,{children:[w,T]}),e[50]=w,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let z;e[57]!==I||e[58]!==h?(z=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=z):z=e[59];let $;return e[60]!==a||e[61]!==z||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:z}),e[60]=a,e[61]=z,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(W,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(X,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(_e,{onCreate:()=>n(!0)}):i.jsx(X,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(we,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
1
+ import{c as A,X as Q,z as R,K as Y,m as ce,o as J,e as U,j as i,fH as de,b as F,r as O,ec as me,e_ as X,B as v,t as q}from"./index-CWzlOAQX.js";import{i as fe}from"./AlertCircle-CVYthSXp.js";import{a as ue}from"./Copy01-Dv7sipLd.js";import{i as V}from"./Key01-CtWEwt_r.js";import{s as W}from"./Plus-CGgnB9yV.js";import{s as ge}from"./Trash01-d2ldPDpp.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-BYJnmaQz.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-DwOXW4AO.js";import{I as le}from"./input-BT8saI27.js";import{L as De}from"./label-0TZ28Umz.js";import{u as H}from"./use-mcp-client-Ct2vdUoM.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(V,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function _e(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(V,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(W,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.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:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function we(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=L=>{L?r(L):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,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=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=L=>c(L.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let _;e[35]!==s?(_=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=_):_=e[36];let w;e[37]!==o.isPending||e[38]!==m||e[39]!==_?(w=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:_}),e[37]=o.isPending,e[38]=m,e[39]=_,e[40]=w):w=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==w||e[51]!==T?(k=i.jsxs(se,{children:[w,T]}),e[50]=w,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let z;e[57]!==I||e[58]!==h?(z=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=z):z=e[59];let $;return e[60]!==a||e[61]!==z||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:z}),e[60]=a,e[61]=z,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(W,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(X,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(_e,{onCreate:()=>n(!0)}):i.jsx(X,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(Ne,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(we,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
@@ -0,0 +1 @@
1
+ import{c as o,j as r}from"./index-CWzlOAQX.js";import{O as m}from"./api-keys-9ma74-9W.js";import{R as p}from"./require-capability-C2Nda3jm.js";import"./AlertCircle-CVYthSXp.js";import"./Copy01-Dv7sipLd.js";import"./Key01-CtWEwt_r.js";import"./Plus-CGgnB9yV.js";import"./Trash01-d2ldPDpp.js";import"./alert-dialog-BYJnmaQz.js";import"./dialog-DwOXW4AO.js";import"./X-MCJw_lkE.js";import"./input-BT8saI27.js";import"./label-0TZ28Umz.js";import"./use-mcp-client-Ct2vdUoM.js";import"./auth-BA3Q_TJo.js";import"./access-gate-buHLOhRt.js";import"./capability-load-error-BwY99ChM.js";function A(){const t=o.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(p,{capability:"api-keys:manage",area:"api-keys",children:r.jsx(m,{})}),t[0]=i):i=t[0],i}export{A as default};
@@ -0,0 +1 @@
1
+ import{c as jt,b as Bt,r as A,j as o,ak as _t,l as wt,h as At,t as ht}from"./index-CWzlOAQX.js";import{u as Et}from"./chat-context-CSREXmZ-.js";import{S as Nt}from"./scroll-area-Cay3wJhN.js";import{u as Rt,A as Tt}from"./use-section-preview-base-BYyvYPZ7.js";import{q as Ct}from"./claim-phase-copy-DMl_wfzl.js";import{j as Kt,u as Pt,x as Ft,aZ as Ot,y as Ut,d as $t,a_ as It}from"./runnable-block-editor-Dx2bIxdz.js";import{n as qt,r as zt}from"./agent-site-editor-content-BIULxMT9.js";import"./use-panel-navigate-Dk1Ye1GR.js";import"./thread-route-D9Gbeij-.js";import"./use-project-scope-C9VWhN8V.js";import"./repository-binding-3gizJnq4.js";import"./use-mcp-client-Ct2vdUoM.js";import"./auth-BA3Q_TJo.js";import"./autosend-D_HIQJhP.js";import"./thread-intent-uQTUqJNN.js";import"./backoff-8mStPHYB.js";import"./task-board-ZOkVjFfb.js";import"./schema-BKdAxrjN.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-jyM4oYaJ.js";import"./use-ai-providers-BYo-eRGm.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-B0MM1DlS.js";import"./select-CF6Gp6z2.js";import"./index-Qp03HhfC.js";import"./Check-DN3fVKj8.js";import"./ChevronUp-xWbDxNSk.js";import"./UserSquare-zqtxIeMd.js";import"./agent-icon-DQhX6pyL.js";import"./AlertCircle-CVYthSXp.js";import"./Tool01-U6VAdTvK.js";import"./ArrowUp-CeSPU7QT.js";import"./ArrowLeft-CyFyBJmn.js";import"./LinkBroken01-DGoMMKbF.js";import"./ShoppingBag01-BG3AWGBS.js";import"./ZoomOut-DxgRaJHf.js";import"./Palette-CmpIZcQI.js";import"./CheckCircle-BsdvfhEK.js";import"./Copy01-Dv7sipLd.js";import"./CreditCard01-Dk07lq-0.js";import"./DotsVertical-DhmK4qgN.js";import"./Image01-Y9Scw-o_.js";import"./XClose-DJWS3DCR.js";import"./Key01-CtWEwt_r.js";import"./Link01-CsZgPYpl.js";import"./LinkExternal01-B-WvSbZy.js";import"./Monitor01-kmeIS50B.js";import"./Sun-Be_v4SgI.js";import"./Plus-CGgnB9yV.js";import"./SearchMd-B7WxOr73.js";import"./Trash01-d2ldPDpp.js";import"./Upload01-vuUJE-Un.js";import"./User01-DrdqUOnb.js";import"./Users01-BSNk1mAx.js";import"./X-MCJw_lkE.js";import"./dialog-DwOXW4AO.js";import"./input-BT8saI27.js";import"./use-new-blocks-editor-BXR_sYex.js";import"./section-preview-url-Csj0_ZDg.js";import"./use-session-runtime-DsnbbYN7.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-csGGOkx1.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-hh2QeFQx.js";import"./use-copy-PnkEhrhy.js";import"./usage-stats-yhYX0e5G.js";import"./markdown-Bqzss8Ii.js";import"./org-file-open-context-W094eyab.js";import"./use-mobile--np6aWAG.js";import"./tooltip-BqndO78a.js";import"./shell-layout-CzhXAO9S.js";import"./avatar-DnckqjGp.js";import"./download-app-dialog-CZZmW5dI.js";import"./command-i-VcjjfU.js";import"./index-C8jZ4bpw.js";import"./integration-icon-B95GPMKQ.js";import"./project-icon-BfkDVtEt.js";import"./new-project-dialog-I6QtJuZt.js";import"./label-0TZ28Umz.js";import"./repository-import-picker-DG_yM72C.js";import"./use-navigate-to-agent-0Fvf2Lpw.js";import"./repository-picker-BR_sMkOw.js";import"./useInfiniteQuery-Dxc2v4r4.js";import"./infiniteQueryObserver-z6KpeaXk.js";import"./collection-search-Be2s73S6.js";import"./use-debounced-value-DfLnstW7.js";import"./required-auth-layout-CtzgnDx3.js";import"./use-org-sso-B__Yf47H.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BXwhxgcp.js";import"./types-sBzHo8Ih.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-BgWzL4m_.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./sheet-BxvcwNse.js";import"./use-connection-CI6FQy3s.js";import"./use-mcp-prompts-Dk_d3SlG.js";import"./index-BeeQz6mt.js";import"./form-CBqY_Qj5.js";import"./use-thread-outputs-DCJFafqq.js";import"./file-type-icon-BKMgh7vP.js";import"./popover-Cd3ISjs_.js";import"./utils-C39wfwww.js";import"./monaco-editor-DCqxqYSj.js";import"./editor-fs_-xqtP.js";import"./calendar-DwEcUKGe.js";import"./textarea-DPzgPhO0.js";import"./rich-text-link-control-U94G_E0v.js";import"./switch-CAhfktTZ.js";import"./combobox-DJXjtyos.js";import"./alert-dialog-BYJnmaQz.js";import"./sandbox-url-D3mC8qhT.js";import"./search-input-B_YmmZHV.js";import"./tabs-MJcU_hz5.js";import"./use-file-configs-DXe1xU9a.js";import"./asset-utils-Qk5h-wqe.js";import"./use-chat-layout-state-TqbwuuZk.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-Ddc-8H1o.js";import"./sandbox-git-api-B1R0585s.js";import"./agent-view-guard-CRvRYAMg.js";import"./use-main-panel-tabs-CASquBgs.js";import"./use-mcp-tools-Bnl7RrzG.js";import"./index-Dh5O1uzF.js";import"./drawer-DYVK-Yxy.js";import"./input-bivLuh-1.js";import"./chat-draft-BYIogZvi.js";import"./use-deco-credits-vsffD2IB.js";import"./use-open-billing-url-BMXuqlhP.js";import"./decopilot-CaWhcF5x.js";import"./checkbox-VSFOqgpI.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-BbS4gDnQ.js";import"./input-CJK7pC9G.js";import"./suggestion-RCbdRB_3.js";import"./use-org-fs-k5NldW-7.js";import"./question-004-sINsf4GQ.js";import"./use-members-9XNbNa6j.js";import"./use-org-auth-client-CN0iwzUb.js";import"./feature-paywall-DweqAdFr.js";import"./plan-ladder-C4roHlM5.js";import"./add-connection-dialog-b2gPK4A2.js";import"./extract-connection-data-DwhEeit2.js";import"./metadata-D72DunRR.js";import"./connection-DWKQsiJ1.js";import"./connection-card-BxTTbMjg.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-UQvDnJ_o.js";import"./authenticate-and-persist-oauth-BTuznNbi.js";import"./mcp-oauth-C0PojFFt.js";import"./collection-tabs-B1fc3hEx.js";import"./badge-BeT90Jfh.js";import"./use-infinite-scroll-DViN6YmU.js";import"./useSuspenseInfiniteQuery-C8qiUH4q.js";import"./use-task-board-events-BHC_8phf.js";import"./sandbox-lifecycle-context-BxUTEul4.js";import"./resolve-tab-icon-liQGha1g.js";import"./use-task-metadata-BzPIvyyo.js";import"./virtual-mcp-BoM8jJW7.js";import"./feature-gate-CitKKOE2.js";import"./mustache-BP7du7Zy.js";import"./empty-state-GPBYJgGv.js";import"./empty-state-B8AHzTIo.js";function Lt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",s=qt(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function Qr(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:s,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:M,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=Et()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==M||t[4]!==a||t[5]!==v?(R=zt(v,a,M),t[3]=M,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Ct(p,x,a):p);let C;t[9]!==s||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Kt(C);let K;t[13]!==s||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=Pt(K);let P;t[17]!==S?(P=$t((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),O=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Zt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==p||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let q;t[31]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{xt(e)},t[31]=q):q=t[31];const E=q;let z;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(z=async(e,r)=>{try{const{blockKey:u,data:f}=Lt(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]=z):z=t[36];const k=z;let L;t[37]!==d?(L=e=>{O.current=e.append,d(!0)},t[37]=d,t[38]=L):L=t[38];const st=L;let V;t[39]!==k||t[40]!==d?(V=async e=>{const r=O.current;if(r)try{await k(e,u=>{r(u),d(!1),O.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=V):V=t[41];const pt=V,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=Ft(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ot(g,r)),ft(Vt)},title:f,className:wt("min-w-0 truncate rounded-lg 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 j;t[42]!==W?(j=o.jsx(It,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let _;t[47]!==p||t[48]!==s||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==st||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||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:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:st,sandbox:{orgSlug:m,virtualMcpId:i,branch:s,threadId:G}},`${p}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(At,{className:"size-4"}),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]=s,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=st,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,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(Tt,{open:ot,onOpenChange:e=>{d(e),e||(O.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 Z;return t[75]!==B||t[76]!==_||t[77]!==w?(Z=o.jsxs("div",{className:gt,children:[B,_,w]}),t[75]=B,t[76]=_,t[77]=w,t[78]=Z):Z=t[78],Z}function Vt(n){return n+1}function Zt(n){return n+1}export{Qr as AppEditor};
@@ -1 +1 @@
1
- import{c as u,X as d,e as g,a2 as m,K as I,o as O}from"./index-CyQyr88p.js";import{u as $}from"./useInfiniteQuery-CucDp1Bl.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,v as b,F as c,S as e,_ as f,w as i,T as u};
1
+ import{c as u,X as d,e as g,a2 as m,K as I,o as O}from"./index-CWzlOAQX.js";import{u as $}from"./useInfiniteQuery-Dxc2v4r4.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,v as b,F as c,S as e,_ as f,w as i,T as u};
@@ -1 +1 @@
1
- import{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-CyQyr88p.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 X(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 K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(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 Q(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=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[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 $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)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 H(`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 D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"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 q.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"?V.parse(await o.json()):x.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 N(),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 b(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=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.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=b(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=b(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 j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
1
+ import{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-CWzlOAQX.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 X(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 K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(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 Q(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=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[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 $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)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 H(`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 D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"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 q.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"?V.parse(await o.json()):x.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 N(),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 b(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=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.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=b(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=b(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 j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
@@ -1 +1 @@
1
- import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-CyQyr88p.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
1
+ import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-CWzlOAQX.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
@@ -1 +1 @@
1
- import{a as z,R as Fe,r as w,e as ue,q as V,j as t,l as I,B as te,o as ze,m as Ve,K as ge,c as le,b as be,h as _e}from"./index-CyQyr88p.js";import{I as ee}from"./input-CeDoO_Rr.js";import{i as Qe}from"./use-is-desktop-app-BNujXJc_.js";import{d as He,e as Ke}from"./backoff-8mStPHYB.js";class Le extends Error{constructor(e,a){super(`Retrying exceeded the maxAttempts (${a}).`),this.name="RetryError",this.cause=e}}async function Ye(n,e){const{multiplier:a=2,maxTimeout:u=6e4,maxAttempts:f=5,minTimeout:o=1e3,jitter:i=1,isRetriable:m=()=>!0,signal:g}=e??{};if(!Number.isInteger(f)||f<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${f}`);if(!Number.isFinite(a)||a<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${a}`);if(Number.isNaN(u)||u<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${u}`);if(Number.isNaN(o)||o<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${o}`);if(o>u)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${o}', 'maxTimeout=${u}'`);if(Number.isNaN(i)||i<0||i>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${i}`);let N=0;for(;;){g?.throwIfAborted();try{return await n()}catch(v){if(!m(v))throw v;if(N+1>=f)throw new Le(v,f);const P=Ke(u,o,N,a,i);await He(P,g?{signal:g}:void 0)}N++}}const Oe={submitEmailPassword:({mode:n,email:e,password:a,name:u})=>n==="sign_up"?z.signUp.email({email:e,password:a,name:u||""}):z.signIn.email({email:e,password:a}),requestPasswordReset:({email:n,redirectTo:e})=>z.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>z.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>z.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>z.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>z.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},he="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ge={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Je({redirectUrl:n,callbackUrl:e="/",title:a,subtitle:u,brand:f,copy:o,variant:i="default",allowedSocialProviders:m,allowPassword:g=!0,onAuthEvent:N,actions:v}){const{emailAndPassword:P,resetPassword:E,emailOtp:y,socialProviders:A}=Fe(),d={...Oe,...v},h=s=>{try{N?.(s)}catch{}},j=i==="compact",se=m?A.providers.filter(s=>m.includes(s.name)):A.providers,ne=A.enabled&&se.length>0,de=P.enabled&&(g||!y.enabled&&!ne),ce=A.enabled&&A.providers.length>0&&!ne&&!y.enabled&&!de?A.providers:se,p=A.enabled&&ce.length>0,F=P.enabled&&(g||!y.enabled&&!p),[b,_]=w.useState(""),[L,Q]=w.useState(""),[U,O]=w.useState(""),[D,l]=w.useState(""),[x,$]=w.useState(!1),[M,W]=w.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[C,H]=w.useState(""),[ye,we]=w.useState(!1),[Re,pe]=w.useState(null),r={...Ge,...o},re=w.useId(),K=`${re}-email`,Y=`${re}-email-error`,ve=`${re}-name`,Ee=`${re}-password`,Se=`${re}-otp`,k=M==="signUp",q=M==="forgotPassword",T=M==="emailOtp",ie=ue({mutationFn:async({email:s,password:c,name:R})=>{try{const Z=await d.submitEmailPassword({mode:k?"sign_up":"sign_in",email:s,password:c,name:R});if(Z.error)throw new Error(Z.error.message||(k?r.signUpFailed:r.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(r.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:k?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:k?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(n??e)},onError:s=>{h({type:"failed",method:"email_password",mode:k?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),V(k?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),ae=ue({mutationFn:async({email:s})=>{const c=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(c.error)throw new Error(c.error.message||r.resetEmailFailed);return c},onSuccess:()=>{V("password_reset_requested"),we(!0)},onError:s=>{V("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=ue({mutationFn:async({email:s})=>{const c=await d.sendOtp({email:s});if(c.error)throw new Error(c.error.message||r.otpSendFailed);return c},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),V("email_otp_sent"),$(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),V("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ue({mutationFn:async({email:s,otp:c})=>{const R=await d.submitOtp({email:s,otp:c});if(R.error)throw new Error(R.error.message||r.invalidCode);return R},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(n??e)},onError:s=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),V("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),me=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),xe=()=>{b.trim()&&!me(b)&&H(r.invalidEmail)},De=s=>{if(s.preventDefault(),!me(b)){H(r.invalidEmail),h({type:"failed",method:"email_password",mode:k?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:U})},$e=s=>{if(s.preventDefault(),!me(b)){H(r.invalidEmail);return}ae.mutate({email:b})},Me=s=>{if(s.preventDefault(),!me(b)){H(r.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>c=>{s(c.target.value),je&&ie.reset(),Ne&&ae.reset(),Ae&&(G.reset(),J.reset()),s===_&&C&&H("")},oe=s=>{W(s),O(""),l(""),$(!1),H(""),we(!1),pe(null),ie.reset(),ae.reset(),G.reset(),J.reset()},S=ie.isPending||ae.isPending||G.isPending||J.isPending,je=ie.error,Ne=ae.error,Ae=G.error||J.error,B=k?b.trim()&&L.trim()&&U.trim():q?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const c=s.message.toLowerCase();return c.includes("unauthorized")||c.includes("401")?r.invalidEmailOrPassword:c.includes("already exists")||c.includes("409")?r.accountExists:c.includes("network")||c.includes("fetch")?r.networkError:c.includes("rate limit")||c.includes("429")?r.tooManyAttempts:c.includes("invalid")&&c.includes("otp")?r.invalidOrExpiredCode:s.message||r.genericError},Ce=je||Ne||Ae||Re,Ue=async s=>{h({type:"started",method:"social",provider:s}),pe(null);try{const c=await d.socialSignIn({provider:s,callbackURL:n??e});if(c.error)throw new Error(c.error.message||r.authenticationFailed)}catch(c){const R=c instanceof Error?c.message:String(c);h({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),V("social_signin_failed",{provider:s,error:R}),pe(c instanceof Error?c:new Error(R))}},Be=q?r.resetPasswordTitle:T&&x?r.verificationCodeTitle:a??r.welcomeTitle,Pe=q?r.resetPasswordSubtitle:T&&x?r.codeSentTo(b):u===void 0?r.defaultSubtitle:u;return t.jsxs("div",{className:I("grid w-full",j?"gap-5":"gap-10"),children:[f??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:I("font-medium",j?"text-xl leading-7":"text-2xl leading-8"),children:Be}),Pe&&t.jsx("p",{className:I("text-muted-foreground",j?"text-sm leading-5":"text-base leading-6"),children:Pe})]}),Ce&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Ce)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:r.resetEmailSent}),!q&&!(T&&x)&&p&&t.jsx("div",{className:"grid gap-2",children:ce.map(s=>t.jsxs(te,{type:"button",variant:"outline",size:j?"lg":"xl",disabled:S,onClick:()=>{Ue(s.name)},className:I("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 rounded-lg",j?"h-11":"h-12"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:I("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),r.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!q&&!(T&&x)&&p&&(F||y.enabled)&&t.jsxs("div",{className:I("flex items-center gap-2.5",j?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:I("text-muted-foreground",j?"text-sm":"text-base"),children:r.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:I("grid gap-2",j&&"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:I("text-sm font-medium text-foreground",j&&"sr-only"),children:r.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:r.enterCodePlaceholder,value:D,onChange:X(l),required:!0,disabled:S,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx(te,{type:"submit",size:j?"lg":"xl",disabled:S||!B,className:I(j?"sm:w-auto":"w-full"),children:S?r.verifying:r.verify}),t.jsx("button",{type:"button",onClick:()=>{$(!1),l(""),G.reset(),J.reset()},disabled:S,className:I("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",j&&"sm:col-span-2"),children:r.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:I("grid gap-2",j&&"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:I("text-sm font-medium text-foreground",j&&"sr-only"),children:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:r.emailPlaceholder,value:b,onChange:X(_),onBlur:xe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!C,"aria-describedby":C?Y:void 0,className:"h-11 rounded-lg"}),C&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:C})]}),t.jsx(te,{type:"submit",size:j?"lg":"xl",disabled:S||!B,className:I(j?"sm:w-auto":"w-full"),children:S?r.sending:r.sendCode})]})}),q&&F&&!ye&&t.jsxs("form",{onSubmit:$e,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:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:xe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!C,"aria-describedby":C?Y:void 0,className:"h-11 rounded-lg"}),C&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:C})]}),t.jsx(te,{type:"submit",disabled:S||!B,className:"w-full font-semibold",size:"xl",children:S?r.sending:r.sendResetLink})]}),!q&&!T&&F&&t.jsxs("form",{onSubmit:De,className:"grid gap-5",children:[k&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground mb-2",children:r.nameLabel}),t.jsx(ee,{id:ve,type:"text",placeholder:r.namePlaceholder,value:U,onChange:X(O),required:!0,disabled:S,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:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:xe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!C,"aria-describedby":C?Y:void 0,className:"h-11 rounded-lg"}),C&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:C})]}),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:r.passwordLabel}),!k&&E.enabled&&t.jsx("button",{type:"button",onClick:()=>oe("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),required:!0,disabled:S,autoComplete:k?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:I("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:I("p-1",!B&&"pointer-events-none"),children:t.jsx(te,{type:"submit",disabled:S||!B,className:I("w-full font-semibold"),size:"xl","aria-hidden":!B,children:S?k?r.creatingAccount:r.signingIn:r.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:q?t.jsx("button",{type:"button",onClick:()=>oe("signIn"),disabled:S,className:he,children:r.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>oe("signIn"),disabled:S,className:he,children:r.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[k?r.alreadyHaveAccount:r.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>oe(k?"signIn":"signUp"),disabled:S,className:he,children:k?r.signIn:r.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>oe("emailOtp"),disabled:S,className:he,children:r.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Xe(){const n=ze(),e=Qe(),a=Ve({queryKey:ge.desktopAuthStatus(),queryFn:async()=>(await fe()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[u,f]=w.useState(!1),[o,i]=w.useState(null),[m,g]=w.useState(!1),[N,v]=w.useState(null);w.useEffect(()=>{},[e,n]);async function P(){f(!0),i(null);try{const d=await fe();await d.performAuthLogin();const h=await d.fetchAuthStatus();n.setQueryData(ge.desktopAuthStatus(),h)}catch(d){i(d instanceof Error?d.message:"Sign-in failed")}finally{f(!1)}}async function E(){f(!0);try{const d=await fe();await d.performAuthLogout();const h=await d.fetchAuthStatus();n.setQueryData(ge.desktopAuthStatus(),h)}finally{f(!1)}}async function y(){g(!0),v(null);let d;try{d=await fe()}catch(h){v(h instanceof Error?h.message:"Sign-in failed"),g(!1);return}try{await d.performAuthCompleteSession()}catch(h){v(h instanceof Error?h.message:"Sign-in failed")}finally{try{const h=await d.fetchAuthStatus();n.setQueryData(ge.desktopAuthStatus(),h)}finally{g(!1)}}}async function A(){await a.refetch()}return{status:a.data,isChecking:a.isLoading,isRetryingStatus:a.isFetching,isPending:u,loginError:o,login:P,logout:E,isCompletingSession:m,completeSessionError:N,completeSession:y,retryStatus:A}}function Ze(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function et(){return le.c(10),Xe(),null}function tt(n){const e=le.c(25),{onContinue:a,isPending:u,error:f}=n,o=be();let i;e[0]!==o?(i=o("common.authEntry.browserOnlyTitle"),e[0]=o,e[1]=i):i=e[1];let m;e[2]!==i?(m=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:i}),e[2]=i,e[3]=m):m=e[3];let g;e[4]!==o?(g=o("common.authEntry.browserOnlyDescription"),e[4]=o,e[5]=g):g=e[5];let N;e[6]!==g?(N=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=N):N=e[7];let v;e[8]!==m||e[9]!==N?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[m,N]}),e[8]=m,e[9]=N,e[10]=v):v=e[10];let P;e[11]!==a?(P=()=>{a()},e[11]=a,e[12]=P):P=e[12];let E;e[13]!==o?(E=o("common.authEntry.browserOnlyCta"),e[13]=o,e[14]=E):E=e[14];let y;e[15]!==u||e[16]!==P||e[17]!==E?(y=t.jsx(te,{onClick:P,disabled:u,children:E}),e[15]=u,e[16]=P,e[17]=E,e[18]=y):y=e[18];let A;e[19]!==f?(A=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[19]=f,e[20]=A):A=e[20];let d;return e[21]!==v||e[22]!==y||e[23]!==A?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[v,y,A]}),e[21]=v,e[22]=y,e[23]=A,e[24]=d):d=e[24],d}function Ie(n){const e=le.c(8),{label:a,error:u}=n;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(_e,{size:"lg"}),e[0]=f):f=e[0];let o;e[1]!==a?(o=a&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a}),e[1]=a,e[2]=o):o=e[2];let i;e[3]!==u?(i=u&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:u}),e[3]=u,e[4]=i):i=e[4];let m;return e[5]!==o||e[6]!==i?(m=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[f,o,i]}),e[5]=o,e[6]=i,e[7]=m):m=e[7],m}class ke{constructor(e){this.response=e}response}function st(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function nt({redirectTo:n,onAuthEvent:e}){const a=be(),[u,f]=w.useState(null),o=w.useEffectEvent(i=>{try{e?.(i)}catch{}});return w.useEffect(()=>{let i=!1;return(async()=>{o({type:"started",method:"local"});try{let m;try{m=await Ye(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 Le&&g.cause instanceof ke)m=g.cause.response;else throw g}if(!m.ok){const g=await m.json().catch(()=>({}));throw new Error(g?.error||a("common.authEntry.autoLoginFailed"))}i||(o({type:"succeeded",method:"local"}),window.location.href=st(n))}catch(m){i||(o({type:"failed",method:"local",stage:"authenticate",error:m instanceof Error?m.message:String(m)}),f(m instanceof Error?m.message:a("common.authEntry.autoLoginFailed")))}})(),()=>{i=!0}},[n]),u?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:a("common.authEntry.autoLoginFailedWithError",{error:u})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:a("common.authEntry.tryRestartingServer")})]})}):t.jsx(Te,{})}function Te(){const n=le.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function rt({callbackURL:n,providerId:e,ssoSignIn:a,onAuthEvent:u}){const f=w.useEffectEvent(i=>{try{u?.(i)}catch{}}),o=w.useEffectEvent(a);return w.useEffect(()=>{(async()=>{f({type:"started",method:"sso",provider:e});try{const i=await o({providerId:e,callbackURL:n});if(i.error)throw new Error(i.error.message||"SSO redirect failed")}catch(i){f({type:"failed",method:"sso",provider:e,stage:"redirect",error:i instanceof Error?i.message:String(i)})}})()},[e,n]),t.jsx(Te,{})}function dt(n){const e=le.c(51),{callbackUrl:a,redirectUrl:u,allowAutoLogin:f,title:o,subtitle:i,brand:m,copy:g,variant:N,allowedSocialProviders:v,allowPassword:P,onAuthEvent:E,onAuthenticated:y}=n,A=f===void 0?!0:f,d=be(),{sso:h,emailAndPassword:j,magicLink:se,emailOtp:ne,socialProviders:de,localMode:ce}=Fe(),p=et(),F=u||a;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=p?.actions;let Q;e[2]!==_||e[3]!==L?(Q={...Oe,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const U=Q;if(p?.isPending){let l;e[5]!==d?(l=d("common.authEntry.finishSignInInBrowser"),e[5]=d,e[6]=l):l=e[6];let x;return e[7]!==p.loginError||e[8]!==l?(x=t.jsx(Ie,{label:l,error:p.loginError}),e[7]=p.loginError,e[8]=l,e[9]=x):x=e[9],x}if(p?.isCompletingSession){let l;e[10]!==d?(l=d("common.authEntry.finishingSignIn"),e[10]=d,e[11]=l):l=e[11];let x;return e[12]!==p.completeSessionError||e[13]!==l?(x=t.jsx(Ie,{label:l,error:p.completeSessionError}),e[12]=p.completeSessionError,e[13]=l,e[14]=x):x=e[14],x}if(ce&&A){let l;return e[15]!==E||e[16]!==F?(l=t.jsx(nt,{redirectTo:F,onAuthEvent:E}),e[15]=E,e[16]=F,e[17]=l):l=e[17],l}if(h.enabled){let l;return e[18]!==E||e[19]!==F||e[20]!==U.ssoSignIn||e[21]!==h.providerId?(l=t.jsx(rt,{callbackURL:F,providerId:h.providerId,ssoSignIn:U.ssoSignIn,onAuthEvent:E}),e[18]=E,e[19]=F,e[20]=U.ssoSignIn,e[21]=h.providerId,e[22]=l):l=e[22],l}if(p&&Ze({emailAndPassword:j,emailOtp:ne,socialProviders:de,magicLink:se,sso:h})){let l;return e[23]!==p.isPending||e[24]!==p.login||e[25]!==p.loginError?(l=t.jsx(tt,{onContinue:p.login,isPending:p.isPending,error:p.loginError}),e[23]=p.isPending,e[24]=p.login,e[25]=p.loginError,e[26]=l):l=e[26],l}if(j.enabled||se.enabled||ne.enabled||de.enabled){const l=p?.loginError??p?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let $;e[30]!==P||e[31]!==v||e[32]!==m||e[33]!==a||e[34]!==g||e[35]!==E||e[36]!==u||e[37]!==i||e[38]!==x||e[39]!==o||e[40]!==N?($=t.jsx(Je,{redirectUrl:u,callbackUrl:a,title:o,subtitle:i,brand:m,copy:g,variant:N,allowedSocialProviders:v,allowPassword:P,onAuthEvent:E,actions:x}),e[30]=P,e[31]=v,e[32]=m,e[33]=a,e[34]=g,e[35]=E,e[36]=u,e[37]=i,e[38]=x,e[39]=o,e[40]=N,e[41]=$):$=e[41];const M=$;if(!l)return M;let W;e[42]!==l?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:l}),e[42]=l,e[43]=W):W=e[43];let C;return e[44]!==M||e[45]!==W?(C=t.jsxs("div",{className:"grid gap-4",children:[W,M]}),e[44]=M,e[45]=W,e[46]=C):C=e[46],C}let O;e[47]!==d?(O=d("common.authEntry.noLoginOptions"),e[47]=d,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{Te as A,dt as a,Xe as u};
1
+ import{a as z,R as Fe,r as w,e as ue,q as V,j as t,l as I,B as te,o as ze,m as Ve,K as ge,c as le,b as be,h as _e}from"./index-CWzlOAQX.js";import{I as ee}from"./input-BT8saI27.js";import{i as Qe}from"./use-is-desktop-app-BNujXJc_.js";import{d as He,e as Ke}from"./backoff-8mStPHYB.js";class Le extends Error{constructor(e,a){super(`Retrying exceeded the maxAttempts (${a}).`),this.name="RetryError",this.cause=e}}async function Ye(n,e){const{multiplier:a=2,maxTimeout:u=6e4,maxAttempts:f=5,minTimeout:o=1e3,jitter:i=1,isRetriable:m=()=>!0,signal:g}=e??{};if(!Number.isInteger(f)||f<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${f}`);if(!Number.isFinite(a)||a<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${a}`);if(Number.isNaN(u)||u<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${u}`);if(Number.isNaN(o)||o<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${o}`);if(o>u)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${o}', 'maxTimeout=${u}'`);if(Number.isNaN(i)||i<0||i>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${i}`);let N=0;for(;;){g?.throwIfAborted();try{return await n()}catch(v){if(!m(v))throw v;if(N+1>=f)throw new Le(v,f);const P=Ke(u,o,N,a,i);await He(P,g?{signal:g}:void 0)}N++}}const Oe={submitEmailPassword:({mode:n,email:e,password:a,name:u})=>n==="sign_up"?z.signUp.email({email:e,password:a,name:u||""}):z.signIn.email({email:e,password:a}),requestPasswordReset:({email:n,redirectTo:e})=>z.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>z.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>z.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>z.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>z.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},he="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ge={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Je({redirectUrl:n,callbackUrl:e="/",title:a,subtitle:u,brand:f,copy:o,variant:i="default",allowedSocialProviders:m,allowPassword:g=!0,onAuthEvent:N,actions:v}){const{emailAndPassword:P,resetPassword:E,emailOtp:y,socialProviders:A}=Fe(),d={...Oe,...v},h=s=>{try{N?.(s)}catch{}},j=i==="compact",se=m?A.providers.filter(s=>m.includes(s.name)):A.providers,ne=A.enabled&&se.length>0,de=P.enabled&&(g||!y.enabled&&!ne),ce=A.enabled&&A.providers.length>0&&!ne&&!y.enabled&&!de?A.providers:se,p=A.enabled&&ce.length>0,F=P.enabled&&(g||!y.enabled&&!p),[b,_]=w.useState(""),[L,Q]=w.useState(""),[U,O]=w.useState(""),[D,l]=w.useState(""),[x,$]=w.useState(!1),[M,W]=w.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[C,H]=w.useState(""),[ye,we]=w.useState(!1),[Re,pe]=w.useState(null),r={...Ge,...o},re=w.useId(),K=`${re}-email`,Y=`${re}-email-error`,ve=`${re}-name`,Ee=`${re}-password`,Se=`${re}-otp`,k=M==="signUp",q=M==="forgotPassword",T=M==="emailOtp",ie=ue({mutationFn:async({email:s,password:c,name:R})=>{try{const Z=await d.submitEmailPassword({mode:k?"sign_up":"sign_in",email:s,password:c,name:R});if(Z.error)throw new Error(Z.error.message||(k?r.signUpFailed:r.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(r.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:k?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:k?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(n??e)},onError:s=>{h({type:"failed",method:"email_password",mode:k?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),V(k?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),ae=ue({mutationFn:async({email:s})=>{const c=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(c.error)throw new Error(c.error.message||r.resetEmailFailed);return c},onSuccess:()=>{V("password_reset_requested"),we(!0)},onError:s=>{V("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=ue({mutationFn:async({email:s})=>{const c=await d.sendOtp({email:s});if(c.error)throw new Error(c.error.message||r.otpSendFailed);return c},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),V("email_otp_sent"),$(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),V("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ue({mutationFn:async({email:s,otp:c})=>{const R=await d.submitOtp({email:s,otp:c});if(R.error)throw new Error(R.error.message||r.invalidCode);return R},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(n??e)},onError:s=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),V("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),me=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),xe=()=>{b.trim()&&!me(b)&&H(r.invalidEmail)},De=s=>{if(s.preventDefault(),!me(b)){H(r.invalidEmail),h({type:"failed",method:"email_password",mode:k?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:U})},$e=s=>{if(s.preventDefault(),!me(b)){H(r.invalidEmail);return}ae.mutate({email:b})},Me=s=>{if(s.preventDefault(),!me(b)){H(r.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>c=>{s(c.target.value),je&&ie.reset(),Ne&&ae.reset(),Ae&&(G.reset(),J.reset()),s===_&&C&&H("")},oe=s=>{W(s),O(""),l(""),$(!1),H(""),we(!1),pe(null),ie.reset(),ae.reset(),G.reset(),J.reset()},S=ie.isPending||ae.isPending||G.isPending||J.isPending,je=ie.error,Ne=ae.error,Ae=G.error||J.error,B=k?b.trim()&&L.trim()&&U.trim():q?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const c=s.message.toLowerCase();return c.includes("unauthorized")||c.includes("401")?r.invalidEmailOrPassword:c.includes("already exists")||c.includes("409")?r.accountExists:c.includes("network")||c.includes("fetch")?r.networkError:c.includes("rate limit")||c.includes("429")?r.tooManyAttempts:c.includes("invalid")&&c.includes("otp")?r.invalidOrExpiredCode:s.message||r.genericError},Ce=je||Ne||Ae||Re,Ue=async s=>{h({type:"started",method:"social",provider:s}),pe(null);try{const c=await d.socialSignIn({provider:s,callbackURL:n??e});if(c.error)throw new Error(c.error.message||r.authenticationFailed)}catch(c){const R=c instanceof Error?c.message:String(c);h({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),V("social_signin_failed",{provider:s,error:R}),pe(c instanceof Error?c:new Error(R))}},Be=q?r.resetPasswordTitle:T&&x?r.verificationCodeTitle:a??r.welcomeTitle,Pe=q?r.resetPasswordSubtitle:T&&x?r.codeSentTo(b):u===void 0?r.defaultSubtitle:u;return t.jsxs("div",{className:I("grid w-full",j?"gap-5":"gap-10"),children:[f??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:I("font-medium",j?"text-xl leading-7":"text-2xl leading-8"),children:Be}),Pe&&t.jsx("p",{className:I("text-muted-foreground",j?"text-sm leading-5":"text-base leading-6"),children:Pe})]}),Ce&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Ce)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:r.resetEmailSent}),!q&&!(T&&x)&&p&&t.jsx("div",{className:"grid gap-2",children:ce.map(s=>t.jsxs(te,{type:"button",variant:"outline",size:j?"lg":"xl",disabled:S,onClick:()=>{Ue(s.name)},className:I("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 rounded-lg",j?"h-11":"h-12"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:I("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),r.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!q&&!(T&&x)&&p&&(F||y.enabled)&&t.jsxs("div",{className:I("flex items-center gap-2.5",j?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:I("text-muted-foreground",j?"text-sm":"text-base"),children:r.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:I("grid gap-2",j&&"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:I("text-sm font-medium text-foreground",j&&"sr-only"),children:r.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:r.enterCodePlaceholder,value:D,onChange:X(l),required:!0,disabled:S,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx(te,{type:"submit",size:j?"lg":"xl",disabled:S||!B,className:I(j?"sm:w-auto":"w-full"),children:S?r.verifying:r.verify}),t.jsx("button",{type:"button",onClick:()=>{$(!1),l(""),G.reset(),J.reset()},disabled:S,className:I("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",j&&"sm:col-span-2"),children:r.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:I("grid gap-2",j&&"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:I("text-sm font-medium text-foreground",j&&"sr-only"),children:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:r.emailPlaceholder,value:b,onChange:X(_),onBlur:xe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!C,"aria-describedby":C?Y:void 0,className:"h-11 rounded-lg"}),C&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:C})]}),t.jsx(te,{type:"submit",size:j?"lg":"xl",disabled:S||!B,className:I(j?"sm:w-auto":"w-full"),children:S?r.sending:r.sendCode})]})}),q&&F&&!ye&&t.jsxs("form",{onSubmit:$e,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:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:xe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!C,"aria-describedby":C?Y:void 0,className:"h-11 rounded-lg"}),C&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:C})]}),t.jsx(te,{type:"submit",disabled:S||!B,className:"w-full font-semibold",size:"xl",children:S?r.sending:r.sendResetLink})]}),!q&&!T&&F&&t.jsxs("form",{onSubmit:De,className:"grid gap-5",children:[k&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground mb-2",children:r.nameLabel}),t.jsx(ee,{id:ve,type:"text",placeholder:r.namePlaceholder,value:U,onChange:X(O),required:!0,disabled:S,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:r.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:xe,required:!0,disabled:S,autoComplete:"email","aria-invalid":!!C,"aria-describedby":C?Y:void 0,className:"h-11 rounded-lg"}),C&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:C})]}),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:r.passwordLabel}),!k&&E.enabled&&t.jsx("button",{type:"button",onClick:()=>oe("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),required:!0,disabled:S,autoComplete:k?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:I("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:I("p-1",!B&&"pointer-events-none"),children:t.jsx(te,{type:"submit",disabled:S||!B,className:I("w-full font-semibold"),size:"xl","aria-hidden":!B,children:S?k?r.creatingAccount:r.signingIn:r.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:q?t.jsx("button",{type:"button",onClick:()=>oe("signIn"),disabled:S,className:he,children:r.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>oe("signIn"),disabled:S,className:he,children:r.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[k?r.alreadyHaveAccount:r.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>oe(k?"signIn":"signUp"),disabled:S,className:he,children:k?r.signIn:r.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>oe("emailOtp"),disabled:S,className:he,children:r.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Xe(){const n=ze(),e=Qe(),a=Ve({queryKey:ge.desktopAuthStatus(),queryFn:async()=>(await fe()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[u,f]=w.useState(!1),[o,i]=w.useState(null),[m,g]=w.useState(!1),[N,v]=w.useState(null);w.useEffect(()=>{},[e,n]);async function P(){f(!0),i(null);try{const d=await fe();await d.performAuthLogin();const h=await d.fetchAuthStatus();n.setQueryData(ge.desktopAuthStatus(),h)}catch(d){i(d instanceof Error?d.message:"Sign-in failed")}finally{f(!1)}}async function E(){f(!0);try{const d=await fe();await d.performAuthLogout();const h=await d.fetchAuthStatus();n.setQueryData(ge.desktopAuthStatus(),h)}finally{f(!1)}}async function y(){g(!0),v(null);let d;try{d=await fe()}catch(h){v(h instanceof Error?h.message:"Sign-in failed"),g(!1);return}try{await d.performAuthCompleteSession()}catch(h){v(h instanceof Error?h.message:"Sign-in failed")}finally{try{const h=await d.fetchAuthStatus();n.setQueryData(ge.desktopAuthStatus(),h)}finally{g(!1)}}}async function A(){await a.refetch()}return{status:a.data,isChecking:a.isLoading,isRetryingStatus:a.isFetching,isPending:u,loginError:o,login:P,logout:E,isCompletingSession:m,completeSessionError:N,completeSession:y,retryStatus:A}}function Ze(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function et(){return le.c(10),Xe(),null}function tt(n){const e=le.c(25),{onContinue:a,isPending:u,error:f}=n,o=be();let i;e[0]!==o?(i=o("common.authEntry.browserOnlyTitle"),e[0]=o,e[1]=i):i=e[1];let m;e[2]!==i?(m=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:i}),e[2]=i,e[3]=m):m=e[3];let g;e[4]!==o?(g=o("common.authEntry.browserOnlyDescription"),e[4]=o,e[5]=g):g=e[5];let N;e[6]!==g?(N=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=N):N=e[7];let v;e[8]!==m||e[9]!==N?(v=t.jsxs("div",{className:"flex flex-col gap-1",children:[m,N]}),e[8]=m,e[9]=N,e[10]=v):v=e[10];let P;e[11]!==a?(P=()=>{a()},e[11]=a,e[12]=P):P=e[12];let E;e[13]!==o?(E=o("common.authEntry.browserOnlyCta"),e[13]=o,e[14]=E):E=e[14];let y;e[15]!==u||e[16]!==P||e[17]!==E?(y=t.jsx(te,{onClick:P,disabled:u,children:E}),e[15]=u,e[16]=P,e[17]=E,e[18]=y):y=e[18];let A;e[19]!==f?(A=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[19]=f,e[20]=A):A=e[20];let d;return e[21]!==v||e[22]!==y||e[23]!==A?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[v,y,A]}),e[21]=v,e[22]=y,e[23]=A,e[24]=d):d=e[24],d}function Ie(n){const e=le.c(8),{label:a,error:u}=n;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(_e,{size:"lg"}),e[0]=f):f=e[0];let o;e[1]!==a?(o=a&&t.jsx("p",{className:"text-sm text-muted-foreground",children:a}),e[1]=a,e[2]=o):o=e[2];let i;e[3]!==u?(i=u&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:u}),e[3]=u,e[4]=i):i=e[4];let m;return e[5]!==o||e[6]!==i?(m=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[f,o,i]}),e[5]=o,e[6]=i,e[7]=m):m=e[7],m}class ke{constructor(e){this.response=e}response}function st(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function nt({redirectTo:n,onAuthEvent:e}){const a=be(),[u,f]=w.useState(null),o=w.useEffectEvent(i=>{try{e?.(i)}catch{}});return w.useEffect(()=>{let i=!1;return(async()=>{o({type:"started",method:"local"});try{let m;try{m=await Ye(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 Le&&g.cause instanceof ke)m=g.cause.response;else throw g}if(!m.ok){const g=await m.json().catch(()=>({}));throw new Error(g?.error||a("common.authEntry.autoLoginFailed"))}i||(o({type:"succeeded",method:"local"}),window.location.href=st(n))}catch(m){i||(o({type:"failed",method:"local",stage:"authenticate",error:m instanceof Error?m.message:String(m)}),f(m instanceof Error?m.message:a("common.authEntry.autoLoginFailed")))}})(),()=>{i=!0}},[n]),u?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:a("common.authEntry.autoLoginFailedWithError",{error:u})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:a("common.authEntry.tryRestartingServer")})]})}):t.jsx(Te,{})}function Te(){const n=le.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function rt({callbackURL:n,providerId:e,ssoSignIn:a,onAuthEvent:u}){const f=w.useEffectEvent(i=>{try{u?.(i)}catch{}}),o=w.useEffectEvent(a);return w.useEffect(()=>{(async()=>{f({type:"started",method:"sso",provider:e});try{const i=await o({providerId:e,callbackURL:n});if(i.error)throw new Error(i.error.message||"SSO redirect failed")}catch(i){f({type:"failed",method:"sso",provider:e,stage:"redirect",error:i instanceof Error?i.message:String(i)})}})()},[e,n]),t.jsx(Te,{})}function dt(n){const e=le.c(51),{callbackUrl:a,redirectUrl:u,allowAutoLogin:f,title:o,subtitle:i,brand:m,copy:g,variant:N,allowedSocialProviders:v,allowPassword:P,onAuthEvent:E,onAuthenticated:y}=n,A=f===void 0?!0:f,d=be(),{sso:h,emailAndPassword:j,magicLink:se,emailOtp:ne,socialProviders:de,localMode:ce}=Fe(),p=et(),F=u||a;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=p?.actions;let Q;e[2]!==_||e[3]!==L?(Q={...Oe,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const U=Q;if(p?.isPending){let l;e[5]!==d?(l=d("common.authEntry.finishSignInInBrowser"),e[5]=d,e[6]=l):l=e[6];let x;return e[7]!==p.loginError||e[8]!==l?(x=t.jsx(Ie,{label:l,error:p.loginError}),e[7]=p.loginError,e[8]=l,e[9]=x):x=e[9],x}if(p?.isCompletingSession){let l;e[10]!==d?(l=d("common.authEntry.finishingSignIn"),e[10]=d,e[11]=l):l=e[11];let x;return e[12]!==p.completeSessionError||e[13]!==l?(x=t.jsx(Ie,{label:l,error:p.completeSessionError}),e[12]=p.completeSessionError,e[13]=l,e[14]=x):x=e[14],x}if(ce&&A){let l;return e[15]!==E||e[16]!==F?(l=t.jsx(nt,{redirectTo:F,onAuthEvent:E}),e[15]=E,e[16]=F,e[17]=l):l=e[17],l}if(h.enabled){let l;return e[18]!==E||e[19]!==F||e[20]!==U.ssoSignIn||e[21]!==h.providerId?(l=t.jsx(rt,{callbackURL:F,providerId:h.providerId,ssoSignIn:U.ssoSignIn,onAuthEvent:E}),e[18]=E,e[19]=F,e[20]=U.ssoSignIn,e[21]=h.providerId,e[22]=l):l=e[22],l}if(p&&Ze({emailAndPassword:j,emailOtp:ne,socialProviders:de,magicLink:se,sso:h})){let l;return e[23]!==p.isPending||e[24]!==p.login||e[25]!==p.loginError?(l=t.jsx(tt,{onContinue:p.login,isPending:p.isPending,error:p.loginError}),e[23]=p.isPending,e[24]=p.login,e[25]=p.loginError,e[26]=l):l=e[26],l}if(j.enabled||se.enabled||ne.enabled||de.enabled){const l=p?.loginError??p?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let $;e[30]!==P||e[31]!==v||e[32]!==m||e[33]!==a||e[34]!==g||e[35]!==E||e[36]!==u||e[37]!==i||e[38]!==x||e[39]!==o||e[40]!==N?($=t.jsx(Je,{redirectUrl:u,callbackUrl:a,title:o,subtitle:i,brand:m,copy:g,variant:N,allowedSocialProviders:v,allowPassword:P,onAuthEvent:E,actions:x}),e[30]=P,e[31]=v,e[32]=m,e[33]=a,e[34]=g,e[35]=E,e[36]=u,e[37]=i,e[38]=x,e[39]=o,e[40]=N,e[41]=$):$=e[41];const M=$;if(!l)return M;let W;e[42]!==l?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:l}),e[42]=l,e[43]=W):W=e[43];let C;return e[44]!==M||e[45]!==W?(C=t.jsxs("div",{className:"grid gap-4",children:[W,M]}),e[44]=M,e[45]=W,e[46]=C):C=e[46],C}let O;e[47]!==d?(O=d("common.authEntry.noLoginOptions"),e[47]=d,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{Te as A,dt as a,Xe as u};
@@ -1 +1 @@
1
- import{c as g,l as p,j as f}from"./index-CyQyr88p.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
1
+ import{c as g,l as p,j as f}from"./index-CWzlOAQX.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-CyQyr88p.js";import{i as u,a as p}from"./mcp-oauth-BHkP1C2P.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-CWzlOAQX.js";import{i as u,a as p}from"./mcp-oauth-C0PojFFt.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
@@ -1 +1 @@
1
- import{c as q,b as J,r as U,l as W,j as t,F as X,B as Y,I as Z,H as ee,G as te}from"./index-CyQyr88p.js";import{A as se,a as ie,b as ne,c as oe,g as ae,d as re,e as le,f as ce}from"./alert-dialog-DPE6kDht.js";import{A as me,I as ue}from"./agent-icon-DyICUp-0.js";import{i as de}from"./DotsVertical-COvSpfVi.js";import{s as fe}from"./Trash01-CzavZmmt.js";import{i as ge}from"./ZoomOut-C_zus5H2.js";import{a as xe}from"./repository-binding-Dgq5OsMA.js";import{a as pe}from"./use-automations-Ln-ZgedH.js";function Ce(c){const e=q.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,K]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let M;e[0]!==s.id||e[1]!==o?(M=()=>{o.mutate(s.id),K(!1)},e[0]=s.id,e[1]=o,e[2]=M):M=e[2];const O=M;let S;e[3]!==n?(S=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=S):S=e[4];const H=S,G=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==G?(u=W("inline-block size-2 rounded-full shrink-0",G),e[5]=G,e[6]=u):u=e[6];const V=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==V?(d=i(V),e[7]=i,e[8]=V,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let E;e[32]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(X,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=E):E=e[32];let I,$;e[33]===Symbol.for("react.memo_cache_sentinel")?(I=m=>{m.stopPropagation(),K(!0)},$=t.jsx(fe,{size:16}),e[33]=I,e[34]=$):(I=e[33],$=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(Z,{children:[E,t.jsx(ee,{align:"end",children:t.jsxs(te,{variant:"destructive",onClick:I,children:[$,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let A;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(A=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=A):A=e[45];let b;e[46]!==i?(b=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=b):b=e[47];let D;e[48]!==b?(D=t.jsx(se,{children:b}),e[48]=b,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(ie,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ne,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(oe,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==O||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(ae,{onClick:O,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=O,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(re,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(le,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let F;e[74]!==l||e[75]!==z?(F=t.jsx(ce,{open:l,onOpenChange:K,children:z}),e[74]=l,e[75]=z,e[76]=F):F=e[76];let B;return e[77]!==A||e[78]!==F?(B=t.jsxs(t.Fragment,{children:[A,F]}),e[77]=A,e[78]=F,e[79]=B):B=e[79],B}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=q.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Ce as A};
1
+ import{c as q,b as J,r as U,l as W,j as t,F as X,B as Y,I as Z,H as ee,G as te}from"./index-CWzlOAQX.js";import{A as se,a as ie,b as ne,c as oe,g as ae,d as re,e as le,f as ce}from"./alert-dialog-BYJnmaQz.js";import{A as me,I as ue}from"./agent-icon-DQhX6pyL.js";import{i as de}from"./DotsVertical-DhmK4qgN.js";import{s as fe}from"./Trash01-d2ldPDpp.js";import{i as ge}from"./ZoomOut-DxgRaJHf.js";import{a as xe}from"./repository-binding-3gizJnq4.js";import{a as pe}from"./use-automations-ChYX58CC.js";function Ce(c){const e=q.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,K]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let M;e[0]!==s.id||e[1]!==o?(M=()=>{o.mutate(s.id),K(!1)},e[0]=s.id,e[1]=o,e[2]=M):M=e[2];const O=M;let S;e[3]!==n?(S=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=S):S=e[4];const H=S,G=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==G?(u=W("inline-block size-2 rounded-full shrink-0",G),e[5]=G,e[6]=u):u=e[6];const V=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==V?(d=i(V),e[7]=i,e[8]=V,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let E;e[32]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(X,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(de,{size:16})})}),e[32]=E):E=e[32];let I,$;e[33]===Symbol.for("react.memo_cache_sentinel")?(I=m=>{m.stopPropagation(),K(!0)},$=t.jsx(fe,{size:16}),e[33]=I,e[34]=$):(I=e[33],$=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(Z,{children:[E,t.jsx(ee,{align:"end",children:t.jsxs(te,{variant:"destructive",onClick:I,children:[$,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let A;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(A=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=A):A=e[45];let b;e[46]!==i?(b=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=b):b=e[47];let D;e[48]!==b?(D=t.jsx(se,{children:b}),e[48]=b,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(ie,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ne,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(oe,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==O||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(ae,{onClick:O,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=O,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(re,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(le,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let F;e[74]!==l||e[75]!==z?(F=t.jsx(ce,{open:l,onOpenChange:K,children:z}),e[74]=l,e[75]=z,e[76]=F):F=e[76];let B;return e[77]!==A||e[78]!==F?(B=t.jsxs(t.Fragment,{children:[A,F]}),e[77]=A,e[78]=F,e[79]=B):B=e[79],B}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=q.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Ce as A};