decocms 4.150.13 → 4.150.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/client/assets/{AlertCircle-Eoiskkdw.js → AlertCircle-B91-aNwq.js} +1 -1
  2. package/dist/client/assets/{AreaChart-D1UwNZ2i.js → AreaChart-C3lLe-TO.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-Cqu5i0aZ.js → ArrowUp-Cn7neu_D.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-CWi3fozt.js → ArrowUpRight-4ON7683p.js} +1 -1
  5. package/dist/client/assets/{Check-BdHuJuPw.js → Check-Cw5nys_P.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-myPjsJGU.js → CheckCircle-CvK6qQD1.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DEyjLxYx.js → ChevronDown-CFrsDGDp.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-BBN141em.js → ChevronRight-CSfYVYCd.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DJfqG7zj.js → ChevronUp-poM-SIFg.js} +1 -1
  10. package/dist/client/assets/{Copy01-gvtGLLcY.js → Copy01-DAfIqFmi.js} +1 -1
  11. package/dist/client/assets/{CpuChip01-kG4BiE9Y.js → CpuChip01-D-1zqWEP.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-5WbYSo6Z.js → DotsVertical-Db0Ic0C_.js} +1 -1
  13. package/dist/client/assets/{Eye-CZFxMqY9.js → Eye-B4xf2XfM.js} +1 -1
  14. package/dist/client/assets/{FilterLines-ubYrwRwC.js → FilterLines-Do81h0db.js} +1 -1
  15. package/dist/client/assets/{HardDrive-F_HbtdSs.js → HardDrive-BJwWSvdh.js} +1 -1
  16. package/dist/client/assets/{Key01-D9NzOa5l.js → Key01-CDx4-itV.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-BuxvHUKx.js → LayoutLeft-C54Zd3v3.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-DJvk8I2A.js → LinkExternal01-BMWoL9cX.js} +1 -1
  19. package/dist/client/assets/{LogOut01-DN8933ou.js → LogOut01-DnW0PXgG.js} +1 -1
  20. package/dist/client/assets/{Monitor01-Cd36dx-4.js → Monitor01-ClNoinKc.js} +1 -1
  21. package/dist/client/assets/{Palette-D0m6ZhK3.js → Palette-DrK1WdFE.js} +1 -1
  22. package/dist/client/assets/{Play-D_aQs7dj.js → Play-uJQecXtC.js} +1 -1
  23. package/dist/client/assets/{Plus-XPxaBtTZ.js → Plus-BUQ_ZClP.js} +1 -1
  24. package/dist/client/assets/{SearchLg-Dlw09bmE.js → SearchLg-D1RJLuDz.js} +1 -1
  25. package/dist/client/assets/{SearchMd-D-oUO6X0.js → SearchMd-CBewQIvn.js} +1 -1
  26. package/dist/client/assets/{Settings02-B_QAMj-P.js → Settings02-BiO67z5n.js} +1 -1
  27. package/dist/client/assets/{Shield01-m7YUf-pl.js → Shield01-_WXbYKas.js} +1 -1
  28. package/dist/client/assets/{Star01-4a_Jxita.js → Star01-ZJ4rnXKf.js} +1 -1
  29. package/dist/client/assets/{Stars01-C8PrtncY.js → Stars01-Bik9Ugxe.js} +1 -1
  30. package/dist/client/assets/{Stars02-COchQugv.js → Stars02-DaESD09_.js} +1 -1
  31. package/dist/client/assets/{Sun-Bdj4gRC5.js → Sun-Bfx3j4KE.js} +1 -1
  32. package/dist/client/assets/{SwitchHorizontal01-IoYlCupu.js → SwitchHorizontal01-C1V7p22w.js} +1 -1
  33. package/dist/client/assets/{Tool01-B96hoDFN.js → Tool01-DTGcj4gI.js} +1 -1
  34. package/dist/client/assets/{Tool02-AsfUGp__.js → Tool02-BPYivh6T.js} +1 -1
  35. package/dist/client/assets/{Trash01-g9SUeAN0.js → Trash01-Yia2FbxW.js} +1 -1
  36. package/dist/client/assets/{TrendUp01-BAGSq_YF.js → TrendUp01-RRDYPFKj.js} +1 -1
  37. package/dist/client/assets/{Upload01-L2syNbDQ.js → Upload01-BBKw6S0o.js} +1 -1
  38. package/dist/client/assets/{User01-CbL87ZBv.js → User01-XCN4nng1.js} +1 -1
  39. package/dist/client/assets/{Users01-BMwIQhmY.js → Users01-Cw6_yNSf.js} +1 -1
  40. package/dist/client/assets/{Users03-BJNH9N4K.js → Users03-dKCb2h3Y.js} +1 -1
  41. package/dist/client/assets/{X-th7ARgOR.js → X-ab3eO-rs.js} +1 -1
  42. package/dist/client/assets/{XCircle-CfjuVDux.js → XCircle-D7fA26xB.js} +1 -1
  43. package/dist/client/assets/{XClose-BV56nJYO.js → XClose-CEZC5ftU.js} +1 -1
  44. package/dist/client/assets/{Zap-Cu4-I_Ac.js → Zap-Bnq6xGd1.js} +1 -1
  45. package/dist/client/assets/{ZapSquare-k4WUcduv.js → ZapSquare-B_ajjEhK.js} +1 -1
  46. package/dist/client/assets/{access-gate-B0jUQZZH.js → access-gate-D4Hh5FVh.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-Dz_K3qJ2.js → add-section-modal-CvOwBfxj.js} +1 -1
  48. package/dist/client/assets/{agent-icon-DCQPTD-I.js → agent-icon-BUu7SJOh.js} +1 -1
  49. package/dist/client/assets/{agents-list-opUfTjSK.js → agents-list-D4CPAK9X.js} +1 -1
  50. package/dist/client/assets/{ai-providers-C3-viUvZ.js → ai-providers-EhzLkNiR.js} +1 -1
  51. package/dist/client/assets/{alert-BGIkzGI9.js → alert-DtU_bvr8.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-P11DPMoL.js → alert-dialog-zLyeS92X.js} +2 -2
  53. package/dist/client/assets/{app-editor-ccFWMS20.js → app-editor-DO1eS78p.js} +1 -1
  54. package/dist/client/assets/{auth-BqANqm0A.js → auth-IA0Wt4Bs.js} +1 -1
  55. package/dist/client/assets/{auth-catchall-BOnc_g4-.js → auth-catchall-Bi6p1Ud-.js} +1 -1
  56. package/dist/client/assets/{auth-entry-DMFjUxSN.js → auth-entry-Cf5TR3Q3.js} +1 -1
  57. package/dist/client/assets/{auth-split-layout-B07StbUi.js → auth-split-layout-QuPERvo-.js} +1 -1
  58. package/dist/client/assets/{authenticate-and-persist-oauth-sNdJBe3I.js → authenticate-and-persist-oauth-4QL_KMam.js} +1 -1
  59. package/dist/client/assets/{automation-list-row-BgdzPrn2.js → automation-list-row-CtIVsj_5.js} +1 -1
  60. package/dist/client/assets/{automation-runs-kY0Hd5bJ.js → automation-runs-BuBLPadb.js} +1 -1
  61. package/dist/client/assets/{automations-duhQRZ_h.js → automations-BhzxbiZ6.js} +1 -1
  62. package/dist/client/assets/{avatar-C7VBTxjb.js → avatar-DgcrciBf.js} +1 -1
  63. package/dist/client/assets/{badge-Bu9TYgek.js → badge-COsNQLUw.js} +1 -1
  64. package/dist/client/assets/{block-document-Dx-Kq5IV.js → block-document-T6uBj3ms.js} +1 -1
  65. package/dist/client/assets/{brand-context-CWx4XQkj.js → brand-context-CVZ_cStr.js} +1 -1
  66. package/dist/client/assets/{buckets-CW6FQIkN.js → buckets-Ds5bb2Zd.js} +1 -1
  67. package/dist/client/assets/{bulk-category-panel-Dz7CZ_Ps.js → bulk-category-panel-Pm1Yz9Zw.js} +1 -1
  68. package/dist/client/assets/{calendar-DOxmGM7p.js → calendar-Dpf15FtT.js} +1 -1
  69. package/dist/client/assets/{capability-load-error-DTwJskAo.js → capability-load-error-B5z2_UsL.js} +1 -1
  70. package/dist/client/assets/{card-B0f_2u3D.js → card-BNBA4cwH.js} +1 -1
  71. package/dist/client/assets/{category-editor-eF5ieM9X.js → category-editor-BA0Xc6on.js} +1 -1
  72. package/dist/client/assets/{chat-context-aAijaY3A.js → chat-context-BcKRD-qD.js} +1 -1
  73. package/dist/client/assets/{checkbox-d1Rt9GUt.js → checkbox-BL555xYH.js} +1 -1
  74. package/dist/client/assets/{cli-auth-success-BTkf7YGZ.js → cli-auth-success-Bd5Du6DE.js} +1 -1
  75. package/dist/client/assets/{collection-detail-XE42oRb-.js → collection-detail-Ck4V0vb_.js} +1 -1
  76. package/dist/client/assets/{collection-display-button-DUa_Df-A.js → collection-display-button-D-rssnYt.js} +1 -1
  77. package/dist/client/assets/{collection-search-DVfGAujX.js → collection-search-DGVCb7gA.js} +1 -1
  78. package/dist/client/assets/{collection-table-wrapper-BsO2CtT4.js → collection-table-wrapper-CojajOCR.js} +1 -1
  79. package/dist/client/assets/{collection-tabs-u5enzkVl.js → collection-tabs-BK4jiFiJ.js} +1 -1
  80. package/dist/client/assets/{command-uPNVzZmX.js → command-DZI3kP4g.js} +1 -1
  81. package/dist/client/assets/{commerce-onboarding-EbYviyIl.js → commerce-onboarding-DQP4ReNS.js} +1 -1
  82. package/dist/client/assets/{companions-core-Dg0TNpYb.js → companions-core-DWa4u1b0.js} +1 -1
  83. package/dist/client/assets/{connect-Da9YwgpD.js → connect-DGFBfdn3.js} +1 -1
  84. package/dist/client/assets/{connection-Du_RJnpr.js → connection-BRPkDcWg.js} +1 -1
  85. package/dist/client/assets/{connection-card-CSYIgKfu.js → connection-card-cUEom3hx.js} +1 -1
  86. package/dist/client/assets/{connection-detail-COQvrxlN.js → connection-detail-CTTCkN-R.js} +1 -1
  87. package/dist/client/assets/{connection-form-helpers-C1xXkycr.js → connection-form-helpers-B-oUsYK9.js} +1 -1
  88. package/dist/client/assets/{connections-f5IaRiLS.js → connections-BOxnUR6z.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-B-6W79yQ.js → decopilot-sse-pool-C_01nXFf.js} +1 -1
  90. package/dist/client/assets/{dialog-CJkJPlAS.js → dialog-BKADi3bx.js} +1 -1
  91. package/dist/client/assets/{domain-settings-B-OR8tCr.js → domain-settings-DgqnFb0l.js} +1 -1
  92. package/dist/client/assets/{drawer-Vmj6vj2H.js → drawer-D7Oy8gIG.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-DabrgiLz.js → dropdown-menu-CNiSo_qs.js} +1 -1
  94. package/dist/client/assets/{empty-state-fv8rbuQT.js → empty-state-DqSQaubj.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-C2XmdMG4.js → extract-connection-data-DW5ENvhS.js} +1 -1
  96. package/dist/client/assets/{file-explorer-DmkInB_B.js → file-explorer-BSNQq6hn.js} +1 -1
  97. package/dist/client/assets/{form-BNZvnkRb.js → form-Fzb0rJTW.js} +1 -1
  98. package/dist/client/assets/{general-m1pdndCH.js → general-1GBG93xy.js} +1 -1
  99. package/dist/client/assets/{github-repo-picker-BZBSEeFT.js → github-repo-picker-BYSh6D5p.js} +1 -1
  100. package/dist/client/assets/{hooks-S0-VfPJM.js → hooks-4mRuOKRy.js} +5 -5
  101. package/dist/client/assets/{index-B6ykVoku.js → index-Bts1u0J_.js} +1 -1
  102. package/dist/client/assets/{index-vAlUDtly.js → index-BztDXv-J.js} +3 -3
  103. package/dist/client/assets/{index-Bp9fmXVF.js → index-CI6Q_QAk.js} +1 -1
  104. package/dist/client/assets/{index-BR5NjjJc.js → index-CR8JsTmS.js} +1 -1
  105. package/dist/client/assets/{index-Bc4pTCDJ.js → index-CRmv56i2.js} +1 -1
  106. package/dist/client/assets/index-CWTjeYOh.js +1 -0
  107. package/dist/client/assets/{index-BAZmyVC-.css → index-CbTRSuOH.css} +1 -1
  108. package/dist/client/assets/{index-DfcOr-zj.js → index-D6eR-lCa.js} +1 -1
  109. package/dist/client/assets/{index-oCG8H3JL.js → index-DB_ltYEd.js} +6 -6
  110. package/dist/client/assets/{index-CE-pZQ5n.js → index-DWVYmT2K.js} +1 -1
  111. package/dist/client/assets/{index-CsXIUaax.js → index-cIDyPB3B.js} +41 -41
  112. package/dist/client/assets/{index-C8ZRu3O2.js → index-pf9WIzdb.js} +1 -1
  113. package/dist/client/assets/{index-redirect-ejiq3ej6.js → index-redirect-_GLliss8.js} +1 -1
  114. package/dist/client/assets/{input-B6QX4Bsc.js → input-HN_bxtAQ.js} +1 -1
  115. package/dist/client/assets/{integration-icon-CAdntIjt.js → integration-icon-BjzWQyhn.js} +1 -1
  116. package/dist/client/assets/{invite-member-dialog-34FD2jh4.js → invite-member-dialog-DAtZKWFO.js} +1 -1
  117. package/dist/client/assets/{label-CEg7qY-f.js → label-WEwHbgNa.js} +1 -1
  118. package/dist/client/assets/{layout-BzEtom0U.js → layout-CLv1bCzT.js} +1 -1
  119. package/dist/client/assets/{login-CFRyKNLt.js → login-XCWqN1gF.js} +1 -1
  120. package/dist/client/assets/{mcp-oauth-Dl2k8oDk.js → mcp-oauth-Bna-E66_.js} +1 -1
  121. package/dist/client/assets/{members-DJ1Auc8C.js → members-ovr8p4aB.js} +1 -1
  122. package/dist/client/assets/{monaco-editor-BVhG6A-M.js → monaco-editor-xaI7s5kF.js} +1 -1
  123. package/dist/client/assets/{monitoring-stats-row-SqogCnFC.js → monitoring-stats-row-CmdFUB4i.js} +1 -1
  124. package/dist/client/assets/{multi-select-UF9SWQ6e.js → multi-select-B0qocmeY.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-9-U3XUKP.js → oauth-callback-ai-provider-Cx6PyJQv.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-DZO2ZJBO.js → oauth-callback-g6ZHZC-H.js} +1 -1
  127. package/dist/client/assets/{onboarding-CyrprJFg.js → onboarding-Crb1jiVb.js} +1 -1
  128. package/dist/client/assets/{org-layout-B728gB0l.js → org-layout-DZBP-2GO.js} +1 -1
  129. package/dist/client/assets/{organization-choice-Ccuwzodh.js → organization-choice-C_akLq78.js} +1 -1
  130. package/dist/client/assets/{orgs-CPUy2U55.js → orgs-B_89Kdou.js} +1 -1
  131. package/dist/client/assets/{page-seo-form-DlEVMpaI.js → page-seo-form-D9rc6Mye.js} +1 -1
  132. package/dist/client/assets/{popover-DEaCMzZP.js → popover-Mcyd1rJW.js} +1 -1
  133. package/dist/client/assets/{post-editor-Bb5IfTCU.js → post-editor-B4wUDwBb.js} +1 -1
  134. package/dist/client/assets/{primitives-BTgHbvPp.js → primitives-Cg_9YIfi.js} +1 -1
  135. package/dist/client/assets/{profile-CxkMLIYl.js → profile-PO6imsIY.js} +1 -1
  136. package/dist/client/assets/project-app-view-DZMl5lBQ.js +1 -0
  137. package/dist/client/assets/record-editor-DD85VkKs.js +1 -0
  138. package/dist/client/assets/{redirect-editor-DD7PcldO.js → redirect-editor-DBR2nOIY.js} +1 -1
  139. package/dist/client/assets/registry-D-iopBq7.js +2 -0
  140. package/dist/client/assets/{registry-layout-CfaJe34R.js → registry-layout-DXcfcP7u.js} +1 -1
  141. package/dist/client/assets/{reports-BFgBFsZV.js → reports-DD0UMnsc.js} +2 -2
  142. package/dist/client/assets/{require-capability-BV5_KDVM.js → require-capability-Duuzb-1_.js} +1 -1
  143. package/dist/client/assets/{required-auth-layout-CWHGEbNY.js → required-auth-layout-PQuo7896.js} +1 -1
  144. package/dist/client/assets/{reset-password-cg551v26.js → reset-password-CU6E7Bhy.js} +1 -1
  145. package/dist/client/assets/{roles-DkFyVRXC.js → roles-BB2l3MZv.js} +1 -1
  146. package/dist/client/assets/{search-input-BiAm-dHP.js → search-input-BOnpigZ_.js} +1 -1
  147. package/dist/client/assets/{secrets-CbL3TEVq.js → secrets-Dqkkx2T1.js} +1 -1
  148. package/dist/client/assets/{sections-editor-YtQ-pXxY.js → sections-editor-vVXk2bQB.js} +1 -1
  149. package/dist/client/assets/{select-DWrifuH3.js → select-BNOwmKae.js} +1 -1
  150. package/dist/client/assets/{select-model-L_zaW5VV.js → select-model-Clsr7M33.js} +1 -1
  151. package/dist/client/assets/{self-tool-result-ILtZLxoN.js → self-tool-result-DfFc8ew3.js} +1 -1
  152. package/dist/client/assets/{seo-editor-7FbWYb3Z.js → seo-editor-QGR4jMSw.js} +1 -1
  153. package/dist/client/assets/{settings-layout-CAkmdzMT.js → settings-layout-DKgu9jEA.js} +1 -1
  154. package/dist/client/assets/{settings-section-CZBB9hU0.js → settings-section-CGHdGROt.js} +1 -1
  155. package/dist/client/assets/{shell-controls-llKLpxpW.js → shell-controls-BCKV1NvA.js} +1 -1
  156. package/dist/client/assets/{shell-layout-BTLWrDNT.js → shell-layout-DJnG6tBW.js} +1 -1
  157. package/dist/client/assets/sidebar-C0kiKg50.js +1 -0
  158. package/dist/client/assets/{skeleton-Dr0ihbmb.js → skeleton-BgYjZjTE.js} +1 -1
  159. package/dist/client/assets/{spinner-ChQk-fuJ.js → spinner-Dl88nySH.js} +1 -1
  160. package/dist/client/assets/{sso-CZy_Z0iZ.js → sso-JSunbF6z.js} +1 -1
  161. package/dist/client/assets/{store-yTKa6R4e.js → store-DcVw_Ezl.js} +1 -1
  162. package/dist/client/assets/store-registry-lJb1V408.js +2 -0
  163. package/dist/client/assets/{studio-tools-WL-_7DVR.js → studio-tools-BVEjmDQb.js} +1 -1
  164. package/dist/client/assets/{switch-lBLWR9-v.js → switch-_5lfqgQ6.js} +1 -1
  165. package/dist/client/assets/{tab-id-BME_CqCy.js → tab-id-BleB6Ron.js} +1 -1
  166. package/dist/client/assets/{table-DX49ZzwB.js → table-CNfTtf-n.js} +1 -1
  167. package/dist/client/assets/{tabs-EJLJDayr.js → tabs-kRgqoap0.js} +1 -1
  168. package/dist/client/assets/{textarea-C_aquDFn.js → textarea-D1aVc8E7.js} +1 -1
  169. package/dist/client/assets/{toggle-group-Q0IrBn5K.js → toggle-group-DvK-vqBY.js} +1 -1
  170. package/dist/client/assets/toolbar-CxCN0jhr.js +1 -0
  171. package/dist/client/assets/{tooltip-fIVhp5ou.js → tooltip-Cn1IcDmc.js} +1 -1
  172. package/dist/client/assets/{use-ai-providers-DEYBcyVN.js → use-ai-providers-BYGZHRPH.js} +1 -1
  173. package/dist/client/assets/{use-automations-NZO0H-p1.js → use-automations-BEOa2pC2.js} +1 -1
  174. package/dist/client/assets/{use-autosave-CUy33u2t.js → use-autosave-BIJ2p_MC.js} +1 -1
  175. package/dist/client/assets/{use-capability-Dzali0wY.js → use-capability-BxJkR1VB.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-DR9o8Vl7.js → use-clock-tick-BrU-wGRy.js} +1 -1
  177. package/dist/client/assets/{use-connection-B06hUHgo.js → use-connection-BNKQq_v1.js} +1 -1
  178. package/dist/client/assets/{use-copy-2CfnxQXo.js → use-copy-7m3Ed17j.js} +1 -1
  179. package/dist/client/assets/{use-create-virtual-mcp-DEF-DvFp.js → use-create-virtual-mcp-_D1SJTWG.js} +1 -1
  180. package/dist/client/assets/{use-debounced-autosave-ChmgSDUl.js → use-debounced-autosave-D0cLeexL.js} +1 -1
  181. package/dist/client/assets/{use-debounced-value-CFLMM6Qe.js → use-debounced-value-BY8ovYWq.js} +1 -1
  182. package/dist/client/assets/use-deco-credits-3FINi23O.js +1 -0
  183. package/dist/client/assets/{use-decopilot-events-ByGtTT-X.js → use-decopilot-events-B47pZ2AI.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-D0aJn94j.js → use-delete-connection-CyuPr25u.js} +1 -1
  185. package/dist/client/assets/{use-deployment-admin-CbjYP-TY.js → use-deployment-admin-CbEdVnhP.js} +1 -1
  186. package/dist/client/assets/{use-file-configs-Du58T_Jv.js → use-file-configs-BCgCMPp3.js} +1 -1
  187. package/dist/client/assets/{use-infinite-scroll-C3O-KBl8.js → use-infinite-scroll-INj7iNdP.js} +1 -1
  188. package/dist/client/assets/{use-join-requests-Bl54Lsyw.js → use-join-requests-DSkrOZR8.js} +1 -1
  189. package/dist/client/assets/{use-mcp-auth-status-P3A3uVfF.js → use-mcp-auth-status-C1MLJaDO.js} +1 -1
  190. package/dist/client/assets/{use-mcp-client-DpsAHhsu.js → use-mcp-client-Zm5H8-Zl.js} +2 -2
  191. package/dist/client/assets/{use-mcp-tools-D5d64p3C.js → use-mcp-tools-Do7r-2lV.js} +1 -1
  192. package/dist/client/assets/{use-members-CmlnN6Aw.js → use-members-B11q_xQz.js} +1 -1
  193. package/dist/client/assets/{use-mobile-DGf5vwNF.js → use-mobile-BengO0lS.js} +1 -1
  194. package/dist/client/assets/{use-navigate-to-agent-BtA6n79A.js → use-navigate-to-agent-DmiY1Q8V.js} +1 -1
  195. package/dist/client/assets/{use-org-auth-client-BmTFN65s.js → use-org-auth-client-C8Z6Cidd.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-DWfsG4pV.js → use-org-sso-O3jknVxq.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-DcrcrZqB.js → use-organization-roles-CQv8oHgS.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-DOeb2tV3.js → use-organization-settings-Oq0J09-V.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-CWaA6tdp.js → use-registry-connections-CI3I17-c.js} +1 -1
  200. package/dist/client/assets/{use-secrets-en8tthJo.js → use-secrets-DjYfC3W_.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-CW8S7oZ-.js → use-status-sounds-DTAB4Phc.js} +1 -1
  202. package/dist/client/assets/{use-tags-Q5fBrYNZ.js → use-tags-Dj1xCgYD.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-W11-AL0e.js → use-view-mode-CKxVad5H.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-CNAeRFsi.js → use-virtual-mcp-Cm3s396Y.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-C5nBw6Jw.js +1 -0
  206. package/dist/client/assets/{useQueries-mGQBH8qb.js → useQueries-C4YD28d8.js} +1 -1
  207. package/dist/client/assets/{useRouterState-DstVuNgC.js → useRouterState-D1i-KnUG.js} +1 -1
  208. package/dist/client/assets/useSuspenseInfiniteQuery-ClXYbJmm.js +1 -0
  209. package/dist/client/assets/{users-CcHMTpxs.js → users-BoMbND0s.js} +1 -1
  210. package/dist/client/assets/{variant-calendar-BnAhmw2x.js → variant-calendar-qTp_LhSU.js} +1 -1
  211. package/dist/client/assets/{view-mode-toggle-BjeJK31L.js → view-mode-toggle-D5GwXJYe.js} +1 -1
  212. package/dist/client/index.html +6 -16
  213. package/dist/server/cli.js +1 -1
  214. package/dist/server/server.js +1 -1
  215. package/package.json +1 -1
  216. package/dist/client/assets/index-vd6CkgrG.js +0 -1
  217. package/dist/client/assets/org-install-DGCT_s6M.js +0 -1
  218. package/dist/client/assets/project-app-view-CbsnI5_S.js +0 -1
  219. package/dist/client/assets/record-editor-CDJ26ss0.js +0 -1
  220. package/dist/client/assets/registry-Uwc000L6.js +0 -2
  221. package/dist/client/assets/sidebar-Dy1VWxxx.js +0 -1
  222. package/dist/client/assets/store-registry-C4rA423j.js +0 -2
  223. package/dist/client/assets/toolbar-DtyhtDGB.js +0 -1
  224. package/dist/client/assets/use-deco-credits-Bf0twN-A.js +0 -1
  225. package/dist/client/assets/useInfiniteQuery-BsbgCJ-c.js +0 -1
  226. package/dist/client/assets/useSuspenseInfiniteQuery-3ceZ8_NX.js +0 -1
  227. package/dist/client/icons/apple-touch-icon-180.png +0 -0
  228. package/dist/client/icons/icon-192.png +0 -0
  229. package/dist/client/icons/icon-512.png +0 -0
  230. package/dist/client/manifest.webmanifest +0 -32
@@ -1 +1 @@
1
- import{a as B,D as Ce,r as y,e as re,p as $,j as t,m as j,B as fe,o as Ue,n as Be,K as ae,c as de,b as pe,S as ke}from"./index-CsXIUaax.js";import{I as J}from"./input-B6QX4Bsc.js";import{i as $e}from"./use-is-desktop-app-BNujXJc_.js";import{S as Ve}from"./spinner-ChQk-fuJ.js";import{r as Qe,R as ze}from"./retry-CErkP7V6.js";const Fe={submitEmailPassword:({mode:i,email:e,password:c,name:f})=>i==="sign_up"?B.signUp.email({email:e,password:c,name:f||""}):B.signIn.email({email:e,password:c}),requestPasswordReset:({email:i,redirectTo:e})=>B.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>B.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>B.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>B.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>B.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},oe="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",He={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ke({redirectUrl:i,callbackUrl:e="/",title:c,subtitle:f,brand:p,copy:m,variant:r="default",allowedSocialProviders:l,allowPassword:u=!0,onAuthEvent:I,actions:N}){const{emailAndPassword:A,resetPassword:v,emailOtp:E,socialProviders:h}=Ce(),d={...Fe,...N},g=s=>{try{I?.(s)}catch{}},P=r==="compact",X=l?h.providers.filter(s=>l.includes(s.name)):h.providers,Z=h.enabled&&X.length>0,ce=A.enabled&&(u||!E.enabled&&!Z),x=h.enabled&&h.providers.length>0&&!Z&&!E.enabled&&!ce?h.providers:X,L=h.enabled&&x.length>0,k=A.enabled&&(u||!E.enabled&&!L),[b,M]=y.useState(""),[F,V]=y.useState(""),[a,S]=y.useState(""),[q,O]=y.useState(""),[_,me]=y.useState(!1),[ue,_e]=y.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[T,Q]=y.useState(""),[xe,be]=y.useState(!1),[Le,ge]=y.useState(null),n={...He,...m},ne=y.useId(),z=`${ne}-email`,ye=`${ne}-name`,ve=`${ne}-password`,we=`${ne}-otp`,C=ue==="signUp",W=ue==="forgotPassword",R=ue==="emailOtp",ee=re({mutationFn:async({email:s,password:o,name:D})=>{try{const G=await d.submitEmailPassword({mode:C?"sign_up":"sign_in",email:s,password:o,name:D});if(G.error)throw new Error(G.error.message||(C?n.signUpFailed:n.signInFailed));return G}catch(G){throw G instanceof Error?G:new Error(n.authenticationFailed)}},onMutate:()=>{g({type:"started",method:"email_password",mode:C?"sign_up":"sign_in"})},onSuccess:()=>{g({type:"succeeded",method:"email_password",mode:C?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(i??e)},onError:s=>{g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),$(C?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),te=re({mutationFn:async({email:s})=>{const o=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(o.error)throw new Error(o.error.message||n.resetEmailFailed);return o},onSuccess:()=>{$("password_reset_requested"),be(!0)},onError:s=>{$("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),H=re({mutationFn:async({email:s})=>{const o=await d.sendOtp({email:s});if(o.error)throw new Error(o.error.message||n.otpSendFailed);return o},onMutate:()=>{g({type:"started",method:"email_otp"})},onSuccess:()=>{g({type:"otp_sent",method:"email_otp"}),$("email_otp_sent"),me(!0)},onError:s=>{g({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),K=re({mutationFn:async({email:s,otp:o})=>{const D=await d.submitOtp({email:s,otp:o});if(D.error)throw new Error(D.error.message||n.invalidCode);return D},onMutate:()=>{g({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{g({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(i??e)},onError:s=>{g({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ie=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),he=()=>{b.trim()&&!ie(b)&&Q(n.invalidEmail)},Oe=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ee.mutate({email:b,password:F,name:a})},Te=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail);return}te.mutate({email:b})},Re=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}H.mutate({email:b})},De=s=>{s.preventDefault(),K.mutate({email:b,otp:q})},Y=s=>o=>{s(o.target.value),Ee&&ee.reset(),Se&&te.reset(),je&&(H.reset(),K.reset()),s===M&&T&&Q("")},se=s=>{_e(s),S(""),O(""),me(!1),Q(""),be(!1),ge(null),ee.reset(),te.reset(),H.reset(),K.reset()},w=ee.isPending||te.isPending||H.isPending||K.isPending,Ee=ee.error,Se=te.error,je=H.error||K.error,U=C?b.trim()&&F.trim()&&a.trim():W?b.trim():R?_?q.trim():b.trim():b.trim()&&F.trim(),Me=s=>{if(!s)return null;const o=s.message.toLowerCase();return o.includes("unauthorized")||o.includes("401")?n.invalidEmailOrPassword:o.includes("already exists")||o.includes("409")?n.accountExists:o.includes("network")||o.includes("fetch")?n.networkError:o.includes("rate limit")||o.includes("429")?n.tooManyAttempts:o.includes("invalid")&&o.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Ne=Ee||Se||je||Le,qe=async s=>{g({type:"started",method:"social",provider:s}),ge(null);try{const o=await d.socialSignIn({provider:s,callbackURL:i??e});if(o.error)throw new Error(o.error.message||n.authenticationFailed)}catch(o){const D=o instanceof Error?o.message:String(o);g({type:"failed",method:"social",provider:s,stage:"redirect",error:D}),$("social_signin_failed",{provider:s,error:D}),ge(o instanceof Error?o:new Error(D))}},We=W?n.resetPasswordTitle:R&&_?n.verificationCodeTitle:c??n.welcomeTitle,Pe=W?n.resetPasswordSubtitle:R&&_?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:j("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:j("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:We}),Pe&&t.jsx("p",{className:j("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Pe})]}),Ne&&t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:Me(Ne)}),xe&&t.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!W&&!(R&&_)&&L&&t.jsx("div",{className:"grid gap-2",children:x.map(s=>t.jsxs("button",{type:"button",disabled:w,onClick:()=>{qe(s.name)},className:j("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:j("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!W&&!(R&&_)&&L&&(k||E.enabled)&&t.jsxs("div",{className:j("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:j("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),R&&E.enabled&&t.jsx(t.Fragment,{children:_?t.jsxs("form",{onSubmit:De,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:we,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(J,{id:we,type:"text",placeholder:n.enterCodePlaceholder,value:q,onChange:Y(O),required:!0,disabled:w,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{me(!1),O(""),H.reset(),K.reset()},disabled:w,className:j("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Re,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:z,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(J,{id:z,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:Y(M),onBlur:he,required:!0,disabled:w,"aria-invalid":!!T,className:"h-11 rounded-lg"}),T&&t.jsx("p",{className:"text-xs text-destructive",children:T})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.sending:n.sendCode})]})}),W&&k&&!xe&&t.jsxs("form",{onSubmit:Te,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(J,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:Y(M),onBlur:he,required:!0,disabled:w,"aria-invalid":!!T,className:"h-11 rounded-lg"}),T&&t.jsx("p",{className:"text-xs text-destructive mt-1.5",children:T})]}),t.jsx(fe,{type:"submit",disabled:w||!U,className:"w-full font-semibold",size:"xl",children:w?n.sending:n.sendResetLink})]}),!W&&!R&&k&&t.jsxs("form",{onSubmit:Oe,className:"grid gap-5",children:[C&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ye,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(J,{id:ye,type:"text",placeholder:n.namePlaceholder,value:a,onChange:Y(S),required:!0,disabled:w,className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(J,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:Y(M),onBlur:he,required:!0,disabled:w,"aria-invalid":!!T,className:"h-11 rounded-lg"}),T&&t.jsx("p",{className:"text-xs text-destructive mt-1.5",children:T})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!C&&v.enabled&&t.jsx("button",{type:"button",onClick:()=>se("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(J,{id:ve,type:"password",placeholder:"••••••••",value:F,onChange:Y(V),required:!0,disabled:w,className:"h-11 rounded-lg"})]}),t.jsx("div",{className:j("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",U?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:j("p-1",!U&&"pointer-events-none"),children:t.jsx(fe,{type:"submit",disabled:w||!U,className:j("w-full font-semibold"),size:"xl","aria-hidden":!U,children:w?C?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:W?t.jsx("button",{type:"button",onClick:()=>se("signIn"),disabled:w,className:oe,children:n.backToSignIn}):R&&k?t.jsx("button",{type:"button",onClick:()=>se("signIn"),disabled:w,className:oe,children:n.signInWithPassword}):!R&&k?t.jsxs(t.Fragment,{children:[C?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>se(C?"signIn":"signUp"),disabled:w,className:oe,children:C?n.signIn:n.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>se("emailOtp"),disabled:w,className:oe,children:n.signInWithEmailCode})]})]}):null})]})}async function le(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ye(){const i=Ue(),e=$e(),c=Be({queryKey:ae.desktopAuthStatus(),queryFn:async()=>(await le()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=y.useState(!1),[m,r]=y.useState(null),[l,u]=y.useState(!1),[I,N]=y.useState(null);y.useEffect(()=>{},[e,i]);async function A(){p(!0),r(null);try{const d=await le();await d.performAuthLogin();const g=await d.fetchAuthStatus();i.setQueryData(ae.desktopAuthStatus(),g)}catch(d){r(d instanceof Error?d.message:"Sign-in failed")}finally{p(!1)}}async function v(){p(!0);try{const d=await le();await d.performAuthLogout();const g=await d.fetchAuthStatus();i.setQueryData(ae.desktopAuthStatus(),g)}finally{p(!1)}}async function E(){u(!0),N(null);let d;try{d=await le()}catch(g){N(g instanceof Error?g.message:"Sign-in failed"),u(!1);return}try{await d.performAuthCompleteSession()}catch(g){N(g instanceof Error?g.message:"Sign-in failed")}finally{try{const g=await d.fetchAuthStatus();i.setQueryData(ae.desktopAuthStatus(),g)}finally{u(!1)}}}async function h(){await c.refetch()}return{status:c.data,isChecking:c.isLoading,isRetryingStatus:c.isFetching,isPending:f,loginError:m,login:A,logout:v,isCompletingSession:l,completeSessionError:I,completeSession:E,retryStatus:h}}function Ge(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Je(){return de.c(10),Ye(),null}function Xe(i){const e=de.c(25),{onContinue:c,isPending:f,error:p}=i,m=pe();let r;e[0]!==m?(r=m("common.authEntry.browserOnlyTitle"),e[0]=m,e[1]=r):r=e[1];let l;e[2]!==r?(l=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==m?(u=m("common.authEntry.browserOnlyDescription"),e[4]=m,e[5]=u):u=e[5];let I;e[6]!==u?(I=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:u}),e[6]=u,e[7]=I):I=e[7];let N;e[8]!==l||e[9]!==I?(N=t.jsxs("div",{className:"flex flex-col gap-1",children:[l,I]}),e[8]=l,e[9]=I,e[10]=N):N=e[10];let A;e[11]!==c?(A=()=>{c()},e[11]=c,e[12]=A):A=e[12];let v;e[13]!==m?(v=m("common.authEntry.browserOnlyCta"),e[13]=m,e[14]=v):v=e[14];let E;e[15]!==f||e[16]!==A||e[17]!==v?(E=t.jsx(fe,{onClick:A,disabled:f,children:v}),e[15]=f,e[16]=A,e[17]=v,e[18]=E):E=e[18];let h;e[19]!==p?(h=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=h):h=e[20];let d;return e[21]!==N||e[22]!==E||e[23]!==h?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[N,E,h]}),e[21]=N,e[22]=E,e[23]=h,e[24]=d):d=e[24],d}function Ae(i){const e=de.c(8),{label:c,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ve,{size:"lg"}),e[0]=p):p=e[0];let m;e[1]!==c?(m=c&&t.jsx("p",{className:"text-sm text-muted-foreground",children:c}),e[1]=c,e[2]=m):m=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let l;return e[5]!==m||e[6]!==r?(l=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,m,r]}),e[5]=m,e[6]=r,e[7]=l):l=e[7],l}class Ie{constructor(e){this.response=e}response}function Ze(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function et({redirectTo:i,onAuthEvent:e}){const c=pe(),[f,p]=y.useState(null),m=y.useEffectEvent(r=>{try{e?.(r)}catch{}});return y.useEffect(()=>{let r=!1;return(async()=>{m({type:"started",method:"local"});try{let l;try{l=await Qe(async()=>{const u=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(u.status>=500)throw new Ie(u);return u},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(u){if(u instanceof ze&&u.cause instanceof Ie)l=u.cause.response;else throw u}if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u?.error||c("common.authEntry.autoLoginFailed"))}r||(m({type:"succeeded",method:"local"}),window.location.href=Ze(i))}catch(l){r||(m({type:"failed",method:"local",stage:"authenticate",error:l instanceof Error?l.message:String(l)}),p(l instanceof Error?l.message:c("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:c("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:c("common.authEntry.tryRestartingServer")})]})}):t.jsx(ke,{})}function tt({callbackURL:i,providerId:e,ssoSignIn:c,onAuthEvent:f}){const p=y.useEffectEvent(r=>{try{f?.(r)}catch{}}),m=y.useEffectEvent(c);return y.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await m({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(ke,{})}function ot(i){const e=de.c(45),{callbackUrl:c,redirectUrl:f,allowAutoLogin:p,title:m,subtitle:r,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v}=i,E=p===void 0?!0:p,h=pe(),{sso:d,emailAndPassword:g,magicLink:P,emailOtp:X,socialProviders:Z,localMode:ce}=Ce(),x=Je(),L=f||c,k=x?.actions;let b;e[0]!==k?(b={...Fe,...k},e[0]=k,e[1]=b):b=e[1];const M=b;if(x?.isPending){let a;e[2]!==h?(a=h("common.authEntry.finishSignInInBrowser"),e[2]=h,e[3]=a):a=e[3];let S;return e[4]!==x.loginError||e[5]!==a?(S=t.jsx(Ae,{label:a,error:x.loginError}),e[4]=x.loginError,e[5]=a,e[6]=S):S=e[6],S}if(x?.isCompletingSession){let a;e[7]!==h?(a=h("common.authEntry.finishingSignIn"),e[7]=h,e[8]=a):a=e[8];let S;return e[9]!==x.completeSessionError||e[10]!==a?(S=t.jsx(Ae,{label:a,error:x.completeSessionError}),e[9]=x.completeSessionError,e[10]=a,e[11]=S):S=e[11],S}if(ce&&E){let a;return e[12]!==v||e[13]!==L?(a=t.jsx(et,{redirectTo:L,onAuthEvent:v}),e[12]=v,e[13]=L,e[14]=a):a=e[14],a}if(d.enabled){let a;return e[15]!==v||e[16]!==L||e[17]!==M.ssoSignIn||e[18]!==d.providerId?(a=t.jsx(tt,{callbackURL:L,providerId:d.providerId,ssoSignIn:M.ssoSignIn,onAuthEvent:v}),e[15]=v,e[16]=L,e[17]=M.ssoSignIn,e[18]=d.providerId,e[19]=a):a=e[19],a}if(x&&Ge({emailAndPassword:g,emailOtp:X,socialProviders:Z,magicLink:P,sso:d})){let a;return e[20]!==x.isPending||e[21]!==x.login||e[22]!==x.loginError?(a=t.jsx(Xe,{onContinue:x.login,isPending:x.isPending,error:x.loginError}),e[20]=x.isPending,e[21]=x.login,e[22]=x.loginError,e[23]=a):a=e[23],a}if(g.enabled||P.enabled||X.enabled||Z.enabled){const a=x?.loginError??x?.completeSessionError??null;let S;e[24]!==A||e[25]!==N||e[26]!==l||e[27]!==c||e[28]!==u||e[29]!==v||e[30]!==k||e[31]!==f||e[32]!==r||e[33]!==m||e[34]!==I?(S=t.jsx(Ke,{redirectUrl:f,callbackUrl:c,title:m,subtitle:r,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v,actions:k}),e[24]=A,e[25]=N,e[26]=l,e[27]=c,e[28]=u,e[29]=v,e[30]=k,e[31]=f,e[32]=r,e[33]=m,e[34]=I,e[35]=S):S=e[35];const q=S;if(!a)return q;let O;e[36]!==a?(O=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[36]=a,e[37]=O):O=e[37];let _;return e[38]!==q||e[39]!==O?(_=t.jsxs("div",{className:"grid gap-4",children:[O,q]}),e[38]=q,e[39]=O,e[40]=_):_=e[40],_}let F;e[41]!==h?(F=h("common.authEntry.noLoginOptions"),e[41]=h,e[42]=F):F=e[42];let V;return e[43]!==F?(V=t.jsx("div",{children:F}),e[43]=F,e[44]=V):V=e[44],V}export{ot as A,Ye as u};
1
+ import{a as B,D as Ce,r as y,e as re,p as $,j as t,m as j,B as fe,o as Ue,n as Be,K as ae,c as de,b as pe,S as ke}from"./index-cIDyPB3B.js";import{I as J}from"./input-HN_bxtAQ.js";import{i as $e}from"./use-is-desktop-app-BNujXJc_.js";import{S as Ve}from"./spinner-Dl88nySH.js";import{r as Qe,R as ze}from"./retry-CErkP7V6.js";const Fe={submitEmailPassword:({mode:i,email:e,password:c,name:f})=>i==="sign_up"?B.signUp.email({email:e,password:c,name:f||""}):B.signIn.email({email:e,password:c}),requestPasswordReset:({email:i,redirectTo:e})=>B.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>B.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>B.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>B.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>B.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},oe="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",He={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ke({redirectUrl:i,callbackUrl:e="/",title:c,subtitle:f,brand:p,copy:m,variant:r="default",allowedSocialProviders:l,allowPassword:u=!0,onAuthEvent:I,actions:N}){const{emailAndPassword:A,resetPassword:v,emailOtp:E,socialProviders:h}=Ce(),d={...Fe,...N},g=s=>{try{I?.(s)}catch{}},P=r==="compact",X=l?h.providers.filter(s=>l.includes(s.name)):h.providers,Z=h.enabled&&X.length>0,ce=A.enabled&&(u||!E.enabled&&!Z),x=h.enabled&&h.providers.length>0&&!Z&&!E.enabled&&!ce?h.providers:X,L=h.enabled&&x.length>0,k=A.enabled&&(u||!E.enabled&&!L),[b,M]=y.useState(""),[F,V]=y.useState(""),[a,S]=y.useState(""),[q,O]=y.useState(""),[_,me]=y.useState(!1),[ue,_e]=y.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[T,Q]=y.useState(""),[xe,be]=y.useState(!1),[Le,ge]=y.useState(null),n={...He,...m},ne=y.useId(),z=`${ne}-email`,ye=`${ne}-name`,ve=`${ne}-password`,we=`${ne}-otp`,C=ue==="signUp",W=ue==="forgotPassword",R=ue==="emailOtp",ee=re({mutationFn:async({email:s,password:o,name:D})=>{try{const G=await d.submitEmailPassword({mode:C?"sign_up":"sign_in",email:s,password:o,name:D});if(G.error)throw new Error(G.error.message||(C?n.signUpFailed:n.signInFailed));return G}catch(G){throw G instanceof Error?G:new Error(n.authenticationFailed)}},onMutate:()=>{g({type:"started",method:"email_password",mode:C?"sign_up":"sign_in"})},onSuccess:()=>{g({type:"succeeded",method:"email_password",mode:C?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(i??e)},onError:s=>{g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),$(C?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),te=re({mutationFn:async({email:s})=>{const o=await d.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(o.error)throw new Error(o.error.message||n.resetEmailFailed);return o},onSuccess:()=>{$("password_reset_requested"),be(!0)},onError:s=>{$("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),H=re({mutationFn:async({email:s})=>{const o=await d.sendOtp({email:s});if(o.error)throw new Error(o.error.message||n.otpSendFailed);return o},onMutate:()=>{g({type:"started",method:"email_otp"})},onSuccess:()=>{g({type:"otp_sent",method:"email_otp"}),$("email_otp_sent"),me(!0)},onError:s=>{g({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),K=re({mutationFn:async({email:s,otp:o})=>{const D=await d.submitOtp({email:s,otp:o});if(D.error)throw new Error(D.error.message||n.invalidCode);return D},onMutate:()=>{g({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{g({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),d.onAuthenticated(i??e)},onError:s=>{g({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),$("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ie=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),he=()=>{b.trim()&&!ie(b)&&Q(n.invalidEmail)},Oe=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_password",mode:C?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ee.mutate({email:b,password:F,name:a})},Te=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail);return}te.mutate({email:b})},Re=s=>{if(s.preventDefault(),!ie(b)){Q(n.invalidEmail),g({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}H.mutate({email:b})},De=s=>{s.preventDefault(),K.mutate({email:b,otp:q})},Y=s=>o=>{s(o.target.value),Ee&&ee.reset(),Se&&te.reset(),je&&(H.reset(),K.reset()),s===M&&T&&Q("")},se=s=>{_e(s),S(""),O(""),me(!1),Q(""),be(!1),ge(null),ee.reset(),te.reset(),H.reset(),K.reset()},w=ee.isPending||te.isPending||H.isPending||K.isPending,Ee=ee.error,Se=te.error,je=H.error||K.error,U=C?b.trim()&&F.trim()&&a.trim():W?b.trim():R?_?q.trim():b.trim():b.trim()&&F.trim(),Me=s=>{if(!s)return null;const o=s.message.toLowerCase();return o.includes("unauthorized")||o.includes("401")?n.invalidEmailOrPassword:o.includes("already exists")||o.includes("409")?n.accountExists:o.includes("network")||o.includes("fetch")?n.networkError:o.includes("rate limit")||o.includes("429")?n.tooManyAttempts:o.includes("invalid")&&o.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Ne=Ee||Se||je||Le,qe=async s=>{g({type:"started",method:"social",provider:s}),ge(null);try{const o=await d.socialSignIn({provider:s,callbackURL:i??e});if(o.error)throw new Error(o.error.message||n.authenticationFailed)}catch(o){const D=o instanceof Error?o.message:String(o);g({type:"failed",method:"social",provider:s,stage:"redirect",error:D}),$("social_signin_failed",{provider:s,error:D}),ge(o instanceof Error?o:new Error(D))}},We=W?n.resetPasswordTitle:R&&_?n.verificationCodeTitle:c??n.welcomeTitle,Pe=W?n.resetPasswordSubtitle:R&&_?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:j("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:j("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:We}),Pe&&t.jsx("p",{className:j("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Pe})]}),Ne&&t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:Me(Ne)}),xe&&t.jsx("div",{className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!W&&!(R&&_)&&L&&t.jsx("div",{className:"grid gap-2",children:x.map(s=>t.jsxs("button",{type:"button",disabled:w,onClick:()=>{qe(s.name)},className:j("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:j("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!W&&!(R&&_)&&L&&(k||E.enabled)&&t.jsxs("div",{className:j("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:j("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),R&&E.enabled&&t.jsx(t.Fragment,{children:_?t.jsxs("form",{onSubmit:De,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:we,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(J,{id:we,type:"text",placeholder:n.enterCodePlaceholder,value:q,onChange:Y(O),required:!0,disabled:w,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{me(!1),O(""),H.reset(),K.reset()},disabled:w,className:j("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Re,className:j("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:z,className:j("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(J,{id:z,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:Y(M),onBlur:he,required:!0,disabled:w,"aria-invalid":!!T,className:"h-11 rounded-lg"}),T&&t.jsx("p",{className:"text-xs text-destructive",children:T})]}),t.jsx("button",{type:"submit",disabled:w||!U,className:j("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:w?n.sending:n.sendCode})]})}),W&&k&&!xe&&t.jsxs("form",{onSubmit:Te,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(J,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:Y(M),onBlur:he,required:!0,disabled:w,"aria-invalid":!!T,className:"h-11 rounded-lg"}),T&&t.jsx("p",{className:"text-xs text-destructive mt-1.5",children:T})]}),t.jsx(fe,{type:"submit",disabled:w||!U,className:"w-full font-semibold",size:"xl",children:w?n.sending:n.sendResetLink})]}),!W&&!R&&k&&t.jsxs("form",{onSubmit:Oe,className:"grid gap-5",children:[C&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:ye,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(J,{id:ye,type:"text",placeholder:n.namePlaceholder,value:a,onChange:Y(S),required:!0,disabled:w,className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:z,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(J,{id:z,type:"email",placeholder:"you@example.com",value:b,onChange:Y(M),onBlur:he,required:!0,disabled:w,"aria-invalid":!!T,className:"h-11 rounded-lg"}),T&&t.jsx("p",{className:"text-xs text-destructive mt-1.5",children:T})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:ve,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!C&&v.enabled&&t.jsx("button",{type:"button",onClick:()=>se("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(J,{id:ve,type:"password",placeholder:"••••••••",value:F,onChange:Y(V),required:!0,disabled:w,className:"h-11 rounded-lg"})]}),t.jsx("div",{className:j("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",U?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:j("p-1",!U&&"pointer-events-none"),children:t.jsx(fe,{type:"submit",disabled:w||!U,className:j("w-full font-semibold"),size:"xl","aria-hidden":!U,children:w?C?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:W?t.jsx("button",{type:"button",onClick:()=>se("signIn"),disabled:w,className:oe,children:n.backToSignIn}):R&&k?t.jsx("button",{type:"button",onClick:()=>se("signIn"),disabled:w,className:oe,children:n.signInWithPassword}):!R&&k?t.jsxs(t.Fragment,{children:[C?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>se(C?"signIn":"signUp"),disabled:w,className:oe,children:C?n.signIn:n.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>se("emailOtp"),disabled:w,className:oe,children:n.signInWithEmailCode})]})]}):null})]})}async function le(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ye(){const i=Ue(),e=$e(),c=Be({queryKey:ae.desktopAuthStatus(),queryFn:async()=>(await le()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=y.useState(!1),[m,r]=y.useState(null),[l,u]=y.useState(!1),[I,N]=y.useState(null);y.useEffect(()=>{},[e,i]);async function A(){p(!0),r(null);try{const d=await le();await d.performAuthLogin();const g=await d.fetchAuthStatus();i.setQueryData(ae.desktopAuthStatus(),g)}catch(d){r(d instanceof Error?d.message:"Sign-in failed")}finally{p(!1)}}async function v(){p(!0);try{const d=await le();await d.performAuthLogout();const g=await d.fetchAuthStatus();i.setQueryData(ae.desktopAuthStatus(),g)}finally{p(!1)}}async function E(){u(!0),N(null);let d;try{d=await le()}catch(g){N(g instanceof Error?g.message:"Sign-in failed"),u(!1);return}try{await d.performAuthCompleteSession()}catch(g){N(g instanceof Error?g.message:"Sign-in failed")}finally{try{const g=await d.fetchAuthStatus();i.setQueryData(ae.desktopAuthStatus(),g)}finally{u(!1)}}}async function h(){await c.refetch()}return{status:c.data,isChecking:c.isLoading,isRetryingStatus:c.isFetching,isPending:f,loginError:m,login:A,logout:v,isCompletingSession:l,completeSessionError:I,completeSession:E,retryStatus:h}}function Ge(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Je(){return de.c(10),Ye(),null}function Xe(i){const e=de.c(25),{onContinue:c,isPending:f,error:p}=i,m=pe();let r;e[0]!==m?(r=m("common.authEntry.browserOnlyTitle"),e[0]=m,e[1]=r):r=e[1];let l;e[2]!==r?(l=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let u;e[4]!==m?(u=m("common.authEntry.browserOnlyDescription"),e[4]=m,e[5]=u):u=e[5];let I;e[6]!==u?(I=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:u}),e[6]=u,e[7]=I):I=e[7];let N;e[8]!==l||e[9]!==I?(N=t.jsxs("div",{className:"flex flex-col gap-1",children:[l,I]}),e[8]=l,e[9]=I,e[10]=N):N=e[10];let A;e[11]!==c?(A=()=>{c()},e[11]=c,e[12]=A):A=e[12];let v;e[13]!==m?(v=m("common.authEntry.browserOnlyCta"),e[13]=m,e[14]=v):v=e[14];let E;e[15]!==f||e[16]!==A||e[17]!==v?(E=t.jsx(fe,{onClick:A,disabled:f,children:v}),e[15]=f,e[16]=A,e[17]=v,e[18]=E):E=e[18];let h;e[19]!==p?(h=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=h):h=e[20];let d;return e[21]!==N||e[22]!==E||e[23]!==h?(d=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[N,E,h]}),e[21]=N,e[22]=E,e[23]=h,e[24]=d):d=e[24],d}function Ae(i){const e=de.c(8),{label:c,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ve,{size:"lg"}),e[0]=p):p=e[0];let m;e[1]!==c?(m=c&&t.jsx("p",{className:"text-sm text-muted-foreground",children:c}),e[1]=c,e[2]=m):m=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let l;return e[5]!==m||e[6]!==r?(l=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,m,r]}),e[5]=m,e[6]=r,e[7]=l):l=e[7],l}class Ie{constructor(e){this.response=e}response}function Ze(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function et({redirectTo:i,onAuthEvent:e}){const c=pe(),[f,p]=y.useState(null),m=y.useEffectEvent(r=>{try{e?.(r)}catch{}});return y.useEffect(()=>{let r=!1;return(async()=>{m({type:"started",method:"local"});try{let l;try{l=await Qe(async()=>{const u=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(u.status>=500)throw new Ie(u);return u},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(u){if(u instanceof ze&&u.cause instanceof Ie)l=u.cause.response;else throw u}if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u?.error||c("common.authEntry.autoLoginFailed"))}r||(m({type:"succeeded",method:"local"}),window.location.href=Ze(i))}catch(l){r||(m({type:"failed",method:"local",stage:"authenticate",error:l instanceof Error?l.message:String(l)}),p(l instanceof Error?l.message:c("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:c("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:c("common.authEntry.tryRestartingServer")})]})}):t.jsx(ke,{})}function tt({callbackURL:i,providerId:e,ssoSignIn:c,onAuthEvent:f}){const p=y.useEffectEvent(r=>{try{f?.(r)}catch{}}),m=y.useEffectEvent(c);return y.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await m({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(ke,{})}function ot(i){const e=de.c(45),{callbackUrl:c,redirectUrl:f,allowAutoLogin:p,title:m,subtitle:r,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v}=i,E=p===void 0?!0:p,h=pe(),{sso:d,emailAndPassword:g,magicLink:P,emailOtp:X,socialProviders:Z,localMode:ce}=Ce(),x=Je(),L=f||c,k=x?.actions;let b;e[0]!==k?(b={...Fe,...k},e[0]=k,e[1]=b):b=e[1];const M=b;if(x?.isPending){let a;e[2]!==h?(a=h("common.authEntry.finishSignInInBrowser"),e[2]=h,e[3]=a):a=e[3];let S;return e[4]!==x.loginError||e[5]!==a?(S=t.jsx(Ae,{label:a,error:x.loginError}),e[4]=x.loginError,e[5]=a,e[6]=S):S=e[6],S}if(x?.isCompletingSession){let a;e[7]!==h?(a=h("common.authEntry.finishingSignIn"),e[7]=h,e[8]=a):a=e[8];let S;return e[9]!==x.completeSessionError||e[10]!==a?(S=t.jsx(Ae,{label:a,error:x.completeSessionError}),e[9]=x.completeSessionError,e[10]=a,e[11]=S):S=e[11],S}if(ce&&E){let a;return e[12]!==v||e[13]!==L?(a=t.jsx(et,{redirectTo:L,onAuthEvent:v}),e[12]=v,e[13]=L,e[14]=a):a=e[14],a}if(d.enabled){let a;return e[15]!==v||e[16]!==L||e[17]!==M.ssoSignIn||e[18]!==d.providerId?(a=t.jsx(tt,{callbackURL:L,providerId:d.providerId,ssoSignIn:M.ssoSignIn,onAuthEvent:v}),e[15]=v,e[16]=L,e[17]=M.ssoSignIn,e[18]=d.providerId,e[19]=a):a=e[19],a}if(x&&Ge({emailAndPassword:g,emailOtp:X,socialProviders:Z,magicLink:P,sso:d})){let a;return e[20]!==x.isPending||e[21]!==x.login||e[22]!==x.loginError?(a=t.jsx(Xe,{onContinue:x.login,isPending:x.isPending,error:x.loginError}),e[20]=x.isPending,e[21]=x.login,e[22]=x.loginError,e[23]=a):a=e[23],a}if(g.enabled||P.enabled||X.enabled||Z.enabled){const a=x?.loginError??x?.completeSessionError??null;let S;e[24]!==A||e[25]!==N||e[26]!==l||e[27]!==c||e[28]!==u||e[29]!==v||e[30]!==k||e[31]!==f||e[32]!==r||e[33]!==m||e[34]!==I?(S=t.jsx(Ke,{redirectUrl:f,callbackUrl:c,title:m,subtitle:r,brand:l,copy:u,variant:I,allowedSocialProviders:N,allowPassword:A,onAuthEvent:v,actions:k}),e[24]=A,e[25]=N,e[26]=l,e[27]=c,e[28]=u,e[29]=v,e[30]=k,e[31]=f,e[32]=r,e[33]=m,e[34]=I,e[35]=S):S=e[35];const q=S;if(!a)return q;let O;e[36]!==a?(O=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[36]=a,e[37]=O):O=e[37];let _;return e[38]!==q||e[39]!==O?(_=t.jsxs("div",{className:"grid gap-4",children:[O,q]}),e[38]=q,e[39]=O,e[40]=_):_=e[40],_}let F;e[41]!==h?(F=h("common.authEntry.noLoginOptions"),e[41]=h,e[42]=F):F=e[42];let V;return e[43]!==F?(V=t.jsx("div",{children:F}),e[43]=F,e[44]=V):V=e[44],V}export{ot as A,Ye as u};
@@ -1 +1 @@
1
- import{c as g,m as p,j as f}from"./index-CsXIUaax.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,m as p,j as f}from"./index-cIDyPB3B.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-CsXIUaax.js";import{i as u,a as p}from"./mcp-oauth-Dl2k8oDk.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-cIDyPB3B.js";import{i as u,a as p}from"./mcp-oauth-Bna-E66_.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
@@ -1 +1 @@
1
- import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-CsXIUaax.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-P11DPMoL.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-DabrgiLz.js";import{s as me}from"./Stars02-COchQugv.js";import{a as ue}from"./DotsVertical-5WbYSo6Z.js";import{s as de}from"./Trash01-g9SUeAN0.js";import{i as fe}from"./Zap-Cu4-I_Ac.js";import{u as ge}from"./use-virtual-mcp-CNAeRFsi.js";import{A as xe}from"./agent-icon-DCQPTD-I.js";import{u as pe}from"./use-automations-NZO0H-p1.js";function ke(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=ge(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(xe,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(ue,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(de,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(me,{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(fe,{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{ke as A};
1
+ import{c as G,b as J,r as U,m as W,j as t,B as X}from"./index-cIDyPB3B.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-zLyeS92X.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-CNiSo_qs.js";import{s as me}from"./Stars02-DaESD09_.js";import{a as ue}from"./DotsVertical-Db0Ic0C_.js";import{s as de}from"./Trash01-Yia2FbxW.js";import{i as fe}from"./Zap-Bnq6xGd1.js";import{u as ge}from"./use-virtual-mcp-Cm3s396Y.js";import{A as xe}from"./agent-icon-BUu7SJOh.js";import{u as pe}from"./use-automations-BEOa2pC2.js";function ke(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=ge(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(xe,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(ue,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(de,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let _;e[37]!==v?(_=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=_):_=e[38];let b;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==_||e[43]!==f||e[44]!==g?(b=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,_]}),e[39]=H,e[40]=n,e[41]=w,e[42]=_,e[43]=f,e[44]=g,e[45]=b):b=e[45];let A;e[46]!==i?(A=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=A):A=e[47];let D;e[48]!==A?(D=t.jsx(Y,{children:A}),e[48]=A,e[49]=D):D=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==D||e[56]!==R?(y=t.jsxs(ee,{children:[D,R]}),e[55]=D,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==b||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[b,M]}),e[77]=b,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(me,{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(fe,{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{ke as A};
@@ -1,4 +1,4 @@
1
- import{r as z,c as W,Z as Ux,j as m,B as tn,Y as jm,X as Hx,_ as jx,bp as lf,ax as Zt,bF as Ca,b as ue,H as $x,m as Te,d as Dn,f as zx,p as qx,aB as Gx,ay as hn,aF as Vx,aE as fn,bE as Yr,aC as Mn,bG as Iy,aA as Ny,F as $t,o as Wx,e as Yx,K as xt,t as mp,n as Kr,E as vy,aw as Cy,bH as uf,aD as Kx,bI as An}from"./index-CsXIUaax.js";import{e as Xx}from"./select-DWrifuH3.js";import{u as Ry}from"./useInfiniteQuery-BsbgCJ-c.js";import{a as wy,u as Zx}from"./use-connection-B06hUHgo.js";import{j as Qx,u as cf,f as Jx,i as ek,a as tk,S as nk}from"./use-mcp-client-DpsAHhsu.js";import{a as rk}from"./use-virtual-mcp-CNAeRFsi.js";import{C as ak}from"./card-B0f_2u3D.js";import{o as Oy,m as Ly,p as df,q as pf}from"./sidebar-Dy1VWxxx.js";import{c as Dy,e as My,a as Ti,d as yt,b as Py,T as St}from"./table-DX49ZzwB.js";import{E as hp}from"./empty-state-fv8rbuQT.js";import{u as ff}from"./use-infinite-scroll-C3O-KBl8.js";import{u as ik}from"./use-members-CmlnN6Aw.js";import{u as Fy,S as Kn}from"./use-clock-tick-DR9o8Vl7.js";import{e as sk}from"./use-automations-NZO0H-p1.js";import{u as By}from"./studio-tools-WL-_7DVR.js";import{u as ok}from"./useSuspenseInfiniteQuery-3ceZ8_NX.js";import{A as Uy}from"./avatar-C7VBTxjb.js";import{t as Ra}from"./ChevronDown-DEyjLxYx.js";import{n as gp}from"./ChevronUp-DJfqG7zj.js";import{n as mf,t as lk,c as Hy,i as uk,a as hf}from"./Tool02-AsfUGp__.js";import{aP as ck,aQ as dk,h as pk,aR as fk,aS as mk,a7 as hk,F as gk,aT as bk,ae as Ek,i as $m,aw as Tk,D as yk,m as Sk,aU as Ak,aN as jy,aV as _k,A as $y,aW as Ht,aX as xk,n as kk}from"./agent-icon-DCQPTD-I.js";import{t as yi}from"./Stars01-C8PrtncY.js";import{i as zy,b as sa}from"./XCircle-CfjuVDux.js";import{i as Xr}from"./Check-BdHuJuPw.js";import{i as zm}from"./ChevronRight-BBN141em.js";import{a as Si}from"./Copy01-gvtGLLcY.js";import{b as mn,t as gf,c as qm}from"./format-time-BnbuEtat.js";import{u as qy}from"./use-copy-2CfnxQXo.js";import{T as vn,a as Cn,c as Rn}from"./tooltip-fIVhp5ou.js";import{b as Gy,a as Ik,c as Nk,d as vk,e as Vy,g as Ck,f as Rk}from"./dialog-CJkJPlAS.js";import{u as wk}from"./use-mobile-DGf5vwNF.js";import{h as Ok,f as Lk,n as Dk,o as Mk}from"./tab-id-BME_CqCy.js";import{R as Pk,c as Fk,r as Bk,d as Uk}from"./hooks-S0-VfPJM.js";import{l as nr,D as Hk,b as bf,d as Wy,a as jk}from"./chat-context-aAijaY3A.js";import{c as $k}from"./monaco-editor-BVhG6A-M.js";import{g as Yy,M as zk}from"./index-BR5NjjJc.js";import{N as ct,R as qk,l as Gk,a as kt,m as Vk,F as Gm,S as Ky,T as kn,n as Wk,o as Ef,D as Br,j as Ai,p as Ur,P as Ct,q as Yk,f as Rt,r as Kk,s as Xk,v as Zk,w as Xy,x as Xn,y as $e,z as rr,A as wn,B as Zn,G as bp,H as Qk,I as Jk,J as eI,K as tI,L as nI,O as rI,Q as aI,U as Zy,V as Ep,W as iI,X as sI,Y as Qy,Z as oI,_ as lI,$ as Vm,t as uI,a0 as wt,a1 as ar,c as cI,u as dI,M as pI,e as fI}from"./calendar-DOxmGM7p.js";import{i as Jy}from"./AlertCircle-Eoiskkdw.js";import{s as mI}from"./Eye-CZFxMqY9.js";import{s as wa,t as eS}from"./Star01-4a_Jxita.js";import{s as hI}from"./XClose-BV56nJYO.js";import{n as Tp}from"./ZapSquare-k4WUcduv.js";import{d as gI,c as bI,a as oa}from"./Tool01-B96hoDFN.js";import{i as Ar}from"./Monitor01-Cd36dx-4.js";import{i as EI}from"./SearchMd-D-oUO6X0.js";import{i as TI}from"./Upload01-L2syNbDQ.js";import{u as yI,a as SI}from"./shell-layout-BTLWrDNT.js";import{n as tS}from"./LinkExternal01-DJvk8I2A.js";import{I as gn}from"./integration-icon-CAdntIjt.js";import{i as AI}from"./ArrowUpRight-CWi3fozt.js";import{a as Tf}from"./Users03-BJNH9N4K.js";import{a as jt}from"./Palette-D0m6ZhK3.js";import{c as nS}from"./use-navigate-to-agent-BtA6n79A.js";import{a as _I}from"./Stars02-COchQugv.js";import{g as xI}from"./AreaChart-D1UwNZ2i.js";import{a as kI,F as II,b as NI,c as vI,d as CI,e as RI}from"./form-BNZvnkRb.js";import{I as wI}from"./input-B6QX4Bsc.js";import{S as OI}from"./spinner-ChQk-fuJ.js";const LI={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function rS(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(LI)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function aS(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function iS(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+rS(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function dz(t){return t.reduce((e,n)=>iS(e,n.metadata?.usage),aS())}const DI={damping:.7,stiffness:.05,mass:1.25},MI=70,PI=1e3/60,FI=350;let _i=!1;globalThis.document?.addEventListener("mousedown",()=>{_i=!0});globalThis.document?.addEventListener("mouseup",()=>{_i=!1});globalThis.document?.addEventListener("click",()=>{_i=!1});const BI=(t={})=>{const[e,n]=z.useState(!1),[r,a]=z.useState(t.initial!==!1),[i,s]=z.useState(!1),o=z.useRef(null);o.current=t;const l=z.useCallback(()=>{if(!_i)return!1;const y=window.getSelection();if(!y||!y.rangeCount)return!1;const A=y.getRangeAt(0);return A.commonAncestorContainer.contains(T.current)||T.current?.contains(A.commonAncestorContainer)},[]),u=z.useCallback(y=>{c.isAtBottom=y,a(y)},[]),d=z.useCallback(y=>{c.escapedFromLock=y,n(y)},[]),c=z.useMemo(()=>{let y;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return T.current?.scrollTop??0},set scrollTop(A){if(T.current){const{scrollBehavior:_}=getComputedStyle(T.current);_!=="auto"&&(T.current.style.scrollBehavior="auto"),T.current.scrollTop=A,c.ignoreScrollToTop=T.current.scrollTop,_!=="auto"&&(T.current.style.scrollBehavior=_)}},get targetScrollTop(){return!T.current||!S.current?0:T.current.scrollHeight-1-T.current.clientHeight},get calculatedTargetScrollTop(){if(!T.current||!S.current)return 0;const{targetScrollTop:A}=this;if(!t.targetScrollTop)return A;if(y?.targetScrollTop===A)return y.calculatedScrollTop;const _=Math.max(Math.min(t.targetScrollTop(A,{scrollElement:T.current,contentElement:S.current}),A),0);return y={targetScrollTop:A,calculatedScrollTop:_},requestAnimationFrame(()=>{y=void 0}),_},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=MI}}},[]),p=z.useCallback((y={})=>{typeof y=="string"&&(y={animation:y}),y.preserveScrollPosition||u(!0);const A=Date.now()+(Number(y.wait)||0),_=Qi(o.current,y.animation),{ignoreEscapes:k=!1}=y;let E,x=c.calculatedTargetScrollTop;y.duration instanceof Promise?y.duration.finally(()=>{E=Date.now()}):E=A+(y.duration??0);const v=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:I}=c,L=performance.now(),M=(L-(c.lastTick??L))/PI;if(c.animation||(c.animation={behavior:_,promise:N,ignoreEscapes:k}),c.animation.behavior===_&&(c.lastTick=L),l()||A>Date.now())return v();if(I<Math.min(x,c.calculatedTargetScrollTop)){if(c.animation?.behavior===_){if(_==="instant")return c.scrollTop=c.calculatedTargetScrollTop,v();c.velocity=(_.damping*c.velocity+_.stiffness*c.scrollDifference)/_.mass,c.accumulated+=c.velocity*M,c.scrollTop+=c.accumulated,c.scrollTop!==I&&(c.accumulated=0)}return v()}return E>Date.now()?(x=c.calculatedTargetScrollTop,v()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?p({animation:Qi(o.current,o.current.resize),ignoreEscapes:k,duration:Math.max(0,E-Date.now())||void 0}):c.isAtBottom)});return N.then(I=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),I))};return y.wait!==!0&&(c.animation=void 0),c.animation?.behavior===_?c.animation.promise:v()},[u,l,c]),f=z.useCallback(()=>{d(!0),u(!1)},[d,u]),g=z.useCallback(({target:y})=>{if(y!==T.current)return;const{scrollTop:A,ignoreScrollToTop:_}=c;let{lastScrollTop:k=A}=c;c.lastScrollTop=A,c.ignoreScrollToTop=void 0,_&&_>A&&(k=_),s(c.isNearBottom),setTimeout(()=>{if(c.resizeDifference||A===_)return;if(l()){d(!0),u(!1);return}const E=A>k,x=A<k;if(c.animation?.ignoreEscapes){c.scrollTop=k;return}x&&(d(!0),u(!1)),E&&d(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[d,u,l,c]),b=z.useCallback(({target:y,deltaY:A})=>{let _=y;for(;!["scroll","auto"].includes(getComputedStyle(_).overflow);){if(!_.parentElement)return;_=_.parentElement}_===T.current&&A<0&&T.current.scrollHeight>T.current.clientHeight&&!c.animation?.ignoreEscapes&&(d(!0),u(!1))},[d,u,c]),T=Wm(y=>{T.current?.removeEventListener("scroll",g),T.current?.removeEventListener("wheel",b),y?.addEventListener("scroll",g,{passive:!0}),y?.addEventListener("wheel",b,{passive:!0})},[]),S=Wm(y=>{if(c.resizeObserver?.disconnect(),c.resizeObserver=void 0,!y)return;let A;c.resizeObserver=new ResizeObserver(([_])=>{const{height:k}=_.contentRect,E=k-(A??k);if(c.resizeDifference=E,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),s(c.isNearBottom),E>=0){const x=Qi(o.current,A?o.current.resize:o.current.initial);p({animation:x,wait:!0,preserveScrollPosition:!0,duration:x==="instant"?void 0:FI})}else c.isNearBottom&&(d(!1),u(!0));A=k,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===E&&(c.resizeDifference=0)},1)})}),c.resizeObserver?.observe(y)},[]);return{contentRef:S,scrollRef:T,scrollToBottom:p,stopScroll:f,isAtBottom:r||i,isNearBottom:i,escapedFromLock:e,state:c}};function Wm(t,e){const n=z.useCallback(r=>(n.current=r,t(r)),e);return n}const Zi=new Map;function Qi(...t){const e={...DI};let n=!1;for(const a of t){if(a==="instant"){n=!0;continue}typeof a=="object"&&(n=!1,e.damping=a.damping??e.damping,e.stiffness=a.stiffness??e.stiffness,e.mass=a.mass??e.mass)}const r=JSON.stringify(e);return Zi.has(r)||Zi.set(r,Object.freeze(e)),n?"instant":Zi.get(r)}function UI(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function yf(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Sf(t,e){if(!e)return t;const n=`${UI(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function HI(t,e){return Sf(t,e).replace(/[_-]/g," ").toLowerCase()}function jI(t){const e={};for(const n of t?.arguments??[])e[n.name]=n.required?jm().min(1,"Required"):jm();return Hx(e)}function $I(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function zI(t){const e=W.c(67),{prompt:n,setPrompt:r,onSubmit:a,defaultValues:i}=t,s=z.useId();let o,l;if(e[0]!==n){const G=jI(n);l=jx,o=Ux(G),e[0]=n,e[1]=o,e[2]=l}else o=e[1],l=e[2];let u;e[3]!==i||e[4]!==n?(u=n?$I(n,i):{},e[3]=i,e[4]=n,e[5]=u):u=e[5];let d;e[6]!==o||e[7]!==u?(d={resolver:o,defaultValues:u,mode:"onChange"},e[6]=o,e[7]=u,e[8]=d):d=e[8];const c=l(d);let p;e[9]!==n?.arguments?(p=n?.arguments??[],e[9]=n?.arguments,e[10]=p):p=e[10];const f=p;let g;e[11]!==c||e[12]!==a||e[13]!==r?(g=async G=>{await a(G),r(null),c.reset()},e[11]=c,e[12]=a,e[13]=r,e[14]=g):g=e[14];const b=g;let T;e[15]!==c||e[16]!==r?(T=G=>{G||(c.reset(),r(null))},e[15]=c,e[16]=r,e[17]=T):T=e[17];const S=T;if(!n)return null;let y;e[18]!==n._meta||e[19]!==n.name||e[20]!==n.title?(y=n.title||HI(n.name,yf(n._meta)),e[18]=n._meta,e[19]=n.name,e[20]=n.title,e[21]=y):y=e[21];let A;e[22]!==y?(A=m.jsx(Gy,{children:m.jsx("span",{className:"capitalize",children:y})}),e[22]=y,e[23]=A):A=e[23];let _;e[24]!==n.description?(_=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=_):_=e[25];let k;e[26]!==_||e[27]!==A?(k=m.jsxs(Ik,{children:[A,_]}),e[26]=_,e[27]=A,e[28]=k):k=e[28];let E;e[29]!==c||e[30]!==b?(E=G=>{G.stopPropagation(),c.handleSubmit(b)(G)},e[29]=c,e[30]=b,e[31]=E):E=e[31];let x;if(e[32]!==f||e[33]!==c.control||e[34]!==c.formState.isSubmitting){let G;e[36]!==c.control||e[37]!==c.formState.isSubmitting?(G=j=>m.jsx(II,{control:c.control,name:j.name,render:V=>{const{field:C}=V;return m.jsxs(NI,{children:[m.jsxs(vI,{className:"text-xs",children:[j.name,j.required?null:m.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),m.jsx(CI,{children:m.jsx(wI,{...C,value:C.value??"",required:j.required,placeholder:j.description??"",className:"h-9",disabled:c.formState.isSubmitting})}),m.jsx(RI,{})]})}},j.name),e[36]=c.control,e[37]=c.formState.isSubmitting,e[38]=G):G=e[38],x=f.map(G),e[32]=f,e[33]=c.control,e[34]=c.formState.isSubmitting,e[35]=x}else x=e[35];let v;e[39]!==S?(v=()=>S(!1),e[39]=S,e[40]=v):v=e[40];let N;e[41]!==c.formState.isSubmitting||e[42]!==v?(N=m.jsx(tn,{type:"button",variant:"ghost",onClick:v,disabled:c.formState.isSubmitting,children:"Cancel"}),e[41]=c.formState.isSubmitting,e[42]=v,e[43]=N):N=e[43];let I;e[44]!==c.formState.isSubmitting?(I=c.formState.isSubmitting?m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(OI,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=c.formState.isSubmitting,e[45]=I):I=e[45];let L;e[46]!==c.formState.isSubmitting||e[47]!==s||e[48]!==I?(L=m.jsx(tn,{type:"submit",form:s,disabled:c.formState.isSubmitting,children:I}),e[46]=c.formState.isSubmitting,e[47]=s,e[48]=I,e[49]=L):L=e[49];let M;e[50]!==N||e[51]!==L?(M=m.jsxs(Nk,{children:[N,L]}),e[50]=N,e[51]=L,e[52]=M):M=e[52];let B;e[53]!==s||e[54]!==E||e[55]!==x||e[56]!==M?(B=m.jsxs("form",{id:s,className:"space-y-4 py-4",autoComplete:"off",onSubmit:E,children:[x,M]}),e[53]=s,e[54]=E,e[55]=x,e[56]=M,e[57]=B):B=e[57];let F;e[58]!==c||e[59]!==B?(F=m.jsx(kI,{...c,children:B}),e[58]=c,e[59]=B,e[60]=F):F=e[60];let P;e[61]!==k||e[62]!==F?(P=m.jsxs(vk,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[k,F]}),e[61]=k,e[62]=F,e[63]=P):P=e[63];let H;return e[64]!==S||e[65]!==P?(H=m.jsx(Vy,{open:!0,onOpenChange:S,children:P}),e[64]=S,e[65]=P,e[66]=H):H=e[66],H}const qI=/^mcp__[a-zA-Z0-9_-]+__/;function sS(t){return t.replace(qI,"")}function Af(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pn=Af();function oS(t){Pn=t}var _r={exec:()=>null};function ve(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(a,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(it.caret,"$1"),n=n.replace(a,s),r},getRegex:()=>new RegExp(n,e)};return r}var it={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},GI=/^(?:[ \t]*(?:\n|$))+/,VI=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,WI=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,YI=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_f=/(?:[*+-]|\d{1,9}[.)])/,lS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uS=ve(lS).replace(/bull/g,_f).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),KI=ve(lS).replace(/bull/g,_f).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XI=/^[^\n]+/,kf=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ZI=ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),QI=ve(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_f).getRegex(),xi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",If=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,JI=ve("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",If).replace("tag",xi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cS=ve(xf).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex(),eN=ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cS).getRegex(),Nf={blockquote:eN,code:VI,def:ZI,fences:WI,heading:YI,hr:Zr,html:JI,lheading:uS,list:QI,newline:GI,paragraph:cS,table:_r,text:XI},Ym=ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex(),tN={...Nf,lheading:KI,table:Ym,paragraph:ve(xf).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ym).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex()},nN={...Nf,html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",If).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ve(xf).replace("hr",Zr).replace("heading",` *#{1,6} *[^
1
+ import{r as z,c as W,Z as Ux,j as m,B as tn,Y as jm,X as Hx,_ as jx,bn as lf,ax as Zt,bD as Ca,b as ue,H as $x,m as Te,d as Dn,f as zx,p as qx,aB as Gx,ay as hn,aF as Vx,aE as fn,bC as Yr,aC as Mn,bE as Iy,aA as Ny,F as $t,o as Wx,e as Yx,K as xt,t as mp,n as Kr,E as vy,aw as Cy,bF as uf,aD as Kx,bG as An}from"./index-cIDyPB3B.js";import{e as Xx}from"./select-BNOwmKae.js";import{u as Ry}from"./useInfiniteQuery-C5nBw6Jw.js";import{a as wy,u as Zx}from"./use-connection-BNKQq_v1.js";import{j as Qx,u as cf,f as Jx,i as ek,a as tk,S as nk}from"./use-mcp-client-Zm5H8-Zl.js";import{a as rk}from"./use-virtual-mcp-Cm3s396Y.js";import{C as ak}from"./card-BNBA4cwH.js";import{o as Oy,m as Ly,p as df,q as pf}from"./sidebar-C0kiKg50.js";import{c as Dy,e as My,a as Ti,d as yt,b as Py,T as St}from"./table-CNfTtf-n.js";import{E as hp}from"./empty-state-DqSQaubj.js";import{u as ff}from"./use-infinite-scroll-INj7iNdP.js";import{u as ik}from"./use-members-B11q_xQz.js";import{u as Fy,S as Kn}from"./use-clock-tick-BrU-wGRy.js";import{e as sk}from"./use-automations-BEOa2pC2.js";import{u as By}from"./studio-tools-BVEjmDQb.js";import{u as ok}from"./useSuspenseInfiniteQuery-ClXYbJmm.js";import{A as Uy}from"./avatar-DgcrciBf.js";import{t as Ra}from"./ChevronDown-CFrsDGDp.js";import{n as gp}from"./ChevronUp-poM-SIFg.js";import{n as mf,t as lk,c as Hy,i as uk,a as hf}from"./Tool02-BPYivh6T.js";import{aP as ck,aQ as dk,h as pk,aR as fk,aS as mk,a7 as hk,F as gk,aT as bk,ae as Ek,i as $m,aw as Tk,D as yk,m as Sk,aU as Ak,aN as jy,aV as _k,A as $y,aW as Ht,aX as xk,n as kk}from"./agent-icon-BUu7SJOh.js";import{t as yi}from"./Stars01-Bik9Ugxe.js";import{i as zy,b as sa}from"./XCircle-D7fA26xB.js";import{i as Xr}from"./Check-Cw5nys_P.js";import{i as zm}from"./ChevronRight-CSfYVYCd.js";import{a as Si}from"./Copy01-DAfIqFmi.js";import{b as mn,t as gf,c as qm}from"./format-time-BnbuEtat.js";import{u as qy}from"./use-copy-7m3Ed17j.js";import{T as vn,a as Cn,c as Rn}from"./tooltip-Cn1IcDmc.js";import{b as Gy,a as Ik,c as Nk,d as vk,e as Vy,g as Ck,f as Rk}from"./dialog-BKADi3bx.js";import{u as wk}from"./use-mobile-BengO0lS.js";import{h as Ok,f as Lk,n as Dk,o as Mk}from"./tab-id-BleB6Ron.js";import{R as Pk,c as Fk,r as Bk,d as Uk}from"./hooks-4mRuOKRy.js";import{l as nr,D as Hk,b as bf,d as Wy,a as jk}from"./chat-context-BcKRD-qD.js";import{c as $k}from"./monaco-editor-xaI7s5kF.js";import{g as Yy,M as zk}from"./index-CR8JsTmS.js";import{N as ct,R as qk,l as Gk,a as kt,m as Vk,F as Gm,S as Ky,T as kn,n as Wk,o as Ef,D as Br,j as Ai,p as Ur,P as Ct,q as Yk,f as Rt,r as Kk,s as Xk,v as Zk,w as Xy,x as Xn,y as $e,z as rr,A as wn,B as Zn,G as bp,H as Qk,I as Jk,J as eI,K as tI,L as nI,O as rI,Q as aI,U as Zy,V as Ep,W as iI,X as sI,Y as Qy,Z as oI,_ as lI,$ as Vm,t as uI,a0 as wt,a1 as ar,c as cI,u as dI,M as pI,e as fI}from"./calendar-Dpf15FtT.js";import{i as Jy}from"./AlertCircle-B91-aNwq.js";import{s as mI}from"./Eye-B4xf2XfM.js";import{s as wa,t as eS}from"./Star01-ZJ4rnXKf.js";import{s as hI}from"./XClose-CEZC5ftU.js";import{n as Tp}from"./ZapSquare-B_ajjEhK.js";import{d as gI,c as bI,a as oa}from"./Tool01-DTGcj4gI.js";import{i as Ar}from"./Monitor01-ClNoinKc.js";import{i as EI}from"./SearchMd-CBewQIvn.js";import{i as TI}from"./Upload01-BBKw6S0o.js";import{u as yI,a as SI}from"./shell-layout-DJnG6tBW.js";import{n as tS}from"./LinkExternal01-BMWoL9cX.js";import{I as gn}from"./integration-icon-BjzWQyhn.js";import{i as AI}from"./ArrowUpRight-4ON7683p.js";import{a as Tf}from"./Users03-dKCb2h3Y.js";import{a as jt}from"./Palette-DrK1WdFE.js";import{c as nS}from"./use-navigate-to-agent-DmiY1Q8V.js";import{a as _I}from"./Stars02-DaESD09_.js";import{g as xI}from"./AreaChart-C3lLe-TO.js";import{a as kI,F as II,b as NI,c as vI,d as CI,e as RI}from"./form-Fzb0rJTW.js";import{I as wI}from"./input-HN_bxtAQ.js";import{S as OI}from"./spinner-Dl88nySH.js";const LI={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function rS(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(LI)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function aS(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function iS(t,e){if(!e)return t;const n=e.inputTokenDetails?.cacheReadTokens??e.cachedInputTokens??0,r=e.inputTokenDetails?.cacheWriteTokens??0;return{inputTokens:t.inputTokens+(e.inputTokens??0),outputTokens:t.outputTokens+(e.outputTokens??0),reasoningTokens:t.reasoningTokens+(e.reasoningTokens??0),totalTokens:t.totalTokens+(e.totalTokens??0),cost:t.cost+rS(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function dz(t){return t.reduce((e,n)=>iS(e,n.metadata?.usage),aS())}const DI={damping:.7,stiffness:.05,mass:1.25},MI=70,PI=1e3/60,FI=350;let _i=!1;globalThis.document?.addEventListener("mousedown",()=>{_i=!0});globalThis.document?.addEventListener("mouseup",()=>{_i=!1});globalThis.document?.addEventListener("click",()=>{_i=!1});const BI=(t={})=>{const[e,n]=z.useState(!1),[r,a]=z.useState(t.initial!==!1),[i,s]=z.useState(!1),o=z.useRef(null);o.current=t;const l=z.useCallback(()=>{if(!_i)return!1;const y=window.getSelection();if(!y||!y.rangeCount)return!1;const A=y.getRangeAt(0);return A.commonAncestorContainer.contains(T.current)||T.current?.contains(A.commonAncestorContainer)},[]),u=z.useCallback(y=>{c.isAtBottom=y,a(y)},[]),d=z.useCallback(y=>{c.escapedFromLock=y,n(y)},[]),c=z.useMemo(()=>{let y;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return T.current?.scrollTop??0},set scrollTop(A){if(T.current){const{scrollBehavior:_}=getComputedStyle(T.current);_!=="auto"&&(T.current.style.scrollBehavior="auto"),T.current.scrollTop=A,c.ignoreScrollToTop=T.current.scrollTop,_!=="auto"&&(T.current.style.scrollBehavior=_)}},get targetScrollTop(){return!T.current||!S.current?0:T.current.scrollHeight-1-T.current.clientHeight},get calculatedTargetScrollTop(){if(!T.current||!S.current)return 0;const{targetScrollTop:A}=this;if(!t.targetScrollTop)return A;if(y?.targetScrollTop===A)return y.calculatedScrollTop;const _=Math.max(Math.min(t.targetScrollTop(A,{scrollElement:T.current,contentElement:S.current}),A),0);return y={targetScrollTop:A,calculatedScrollTop:_},requestAnimationFrame(()=>{y=void 0}),_},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=MI}}},[]),p=z.useCallback((y={})=>{typeof y=="string"&&(y={animation:y}),y.preserveScrollPosition||u(!0);const A=Date.now()+(Number(y.wait)||0),_=Qi(o.current,y.animation),{ignoreEscapes:k=!1}=y;let E,x=c.calculatedTargetScrollTop;y.duration instanceof Promise?y.duration.finally(()=>{E=Date.now()}):E=A+(y.duration??0);const v=async()=>{const N=new Promise(requestAnimationFrame).then(()=>{if(!c.isAtBottom)return c.animation=void 0,!1;const{scrollTop:I}=c,L=performance.now(),M=(L-(c.lastTick??L))/PI;if(c.animation||(c.animation={behavior:_,promise:N,ignoreEscapes:k}),c.animation.behavior===_&&(c.lastTick=L),l()||A>Date.now())return v();if(I<Math.min(x,c.calculatedTargetScrollTop)){if(c.animation?.behavior===_){if(_==="instant")return c.scrollTop=c.calculatedTargetScrollTop,v();c.velocity=(_.damping*c.velocity+_.stiffness*c.scrollDifference)/_.mass,c.accumulated+=c.velocity*M,c.scrollTop+=c.accumulated,c.scrollTop!==I&&(c.accumulated=0)}return v()}return E>Date.now()?(x=c.calculatedTargetScrollTop,v()):(c.animation=void 0,c.scrollTop<c.calculatedTargetScrollTop?p({animation:Qi(o.current,o.current.resize),ignoreEscapes:k,duration:Math.max(0,E-Date.now())||void 0}):c.isAtBottom)});return N.then(I=>(requestAnimationFrame(()=>{c.animation||(c.lastTick=void 0,c.velocity=0)}),I))};return y.wait!==!0&&(c.animation=void 0),c.animation?.behavior===_?c.animation.promise:v()},[u,l,c]),f=z.useCallback(()=>{d(!0),u(!1)},[d,u]),g=z.useCallback(({target:y})=>{if(y!==T.current)return;const{scrollTop:A,ignoreScrollToTop:_}=c;let{lastScrollTop:k=A}=c;c.lastScrollTop=A,c.ignoreScrollToTop=void 0,_&&_>A&&(k=_),s(c.isNearBottom),setTimeout(()=>{if(c.resizeDifference||A===_)return;if(l()){d(!0),u(!1);return}const E=A>k,x=A<k;if(c.animation?.ignoreEscapes){c.scrollTop=k;return}x&&(d(!0),u(!1)),E&&d(!1),!c.escapedFromLock&&c.isNearBottom&&u(!0)},1)},[d,u,l,c]),b=z.useCallback(({target:y,deltaY:A})=>{let _=y;for(;!["scroll","auto"].includes(getComputedStyle(_).overflow);){if(!_.parentElement)return;_=_.parentElement}_===T.current&&A<0&&T.current.scrollHeight>T.current.clientHeight&&!c.animation?.ignoreEscapes&&(d(!0),u(!1))},[d,u,c]),T=Wm(y=>{T.current?.removeEventListener("scroll",g),T.current?.removeEventListener("wheel",b),y?.addEventListener("scroll",g,{passive:!0}),y?.addEventListener("wheel",b,{passive:!0})},[]),S=Wm(y=>{if(c.resizeObserver?.disconnect(),c.resizeObserver=void 0,!y)return;let A;c.resizeObserver=new ResizeObserver(([_])=>{const{height:k}=_.contentRect,E=k-(A??k);if(c.resizeDifference=E,c.scrollTop>c.targetScrollTop&&(c.scrollTop=c.targetScrollTop),s(c.isNearBottom),E>=0){const x=Qi(o.current,A?o.current.resize:o.current.initial);p({animation:x,wait:!0,preserveScrollPosition:!0,duration:x==="instant"?void 0:FI})}else c.isNearBottom&&(d(!1),u(!0));A=k,requestAnimationFrame(()=>{setTimeout(()=>{c.resizeDifference===E&&(c.resizeDifference=0)},1)})}),c.resizeObserver?.observe(y)},[]);return{contentRef:S,scrollRef:T,scrollToBottom:p,stopScroll:f,isAtBottom:r||i,isNearBottom:i,escapedFromLock:e,state:c}};function Wm(t,e){const n=z.useCallback(r=>(n.current=r,t(r)),e);return n}const Zi=new Map;function Qi(...t){const e={...DI};let n=!1;for(const a of t){if(a==="instant"){n=!0;continue}typeof a=="object"&&(n=!1,e.damping=a.damping??e.damping,e.stiffness=a.stiffness??e.stiffness,e.mass=a.mass??e.mass)}const r=JSON.stringify(e);return Zi.has(r)||Zi.set(r,Object.freeze(e)),n?"instant":Zi.get(r)}function UI(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return`a${(e>>>0).toString(36).padStart(6,"0").slice(-6)}`}function yf(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Sf(t,e){if(!e)return t;const n=`${UI(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function HI(t,e){return Sf(t,e).replace(/[_-]/g," ").toLowerCase()}function jI(t){const e={};for(const n of t?.arguments??[])e[n.name]=n.required?jm().min(1,"Required"):jm();return Hx(e)}function $I(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function zI(t){const e=W.c(67),{prompt:n,setPrompt:r,onSubmit:a,defaultValues:i}=t,s=z.useId();let o,l;if(e[0]!==n){const G=jI(n);l=jx,o=Ux(G),e[0]=n,e[1]=o,e[2]=l}else o=e[1],l=e[2];let u;e[3]!==i||e[4]!==n?(u=n?$I(n,i):{},e[3]=i,e[4]=n,e[5]=u):u=e[5];let d;e[6]!==o||e[7]!==u?(d={resolver:o,defaultValues:u,mode:"onChange"},e[6]=o,e[7]=u,e[8]=d):d=e[8];const c=l(d);let p;e[9]!==n?.arguments?(p=n?.arguments??[],e[9]=n?.arguments,e[10]=p):p=e[10];const f=p;let g;e[11]!==c||e[12]!==a||e[13]!==r?(g=async G=>{await a(G),r(null),c.reset()},e[11]=c,e[12]=a,e[13]=r,e[14]=g):g=e[14];const b=g;let T;e[15]!==c||e[16]!==r?(T=G=>{G||(c.reset(),r(null))},e[15]=c,e[16]=r,e[17]=T):T=e[17];const S=T;if(!n)return null;let y;e[18]!==n._meta||e[19]!==n.name||e[20]!==n.title?(y=n.title||HI(n.name,yf(n._meta)),e[18]=n._meta,e[19]=n.name,e[20]=n.title,e[21]=y):y=e[21];let A;e[22]!==y?(A=m.jsx(Gy,{children:m.jsx("span",{className:"capitalize",children:y})}),e[22]=y,e[23]=A):A=e[23];let _;e[24]!==n.description?(_=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[24]=n.description,e[25]=_):_=e[25];let k;e[26]!==_||e[27]!==A?(k=m.jsxs(Ik,{children:[A,_]}),e[26]=_,e[27]=A,e[28]=k):k=e[28];let E;e[29]!==c||e[30]!==b?(E=G=>{G.stopPropagation(),c.handleSubmit(b)(G)},e[29]=c,e[30]=b,e[31]=E):E=e[31];let x;if(e[32]!==f||e[33]!==c.control||e[34]!==c.formState.isSubmitting){let G;e[36]!==c.control||e[37]!==c.formState.isSubmitting?(G=j=>m.jsx(II,{control:c.control,name:j.name,render:V=>{const{field:C}=V;return m.jsxs(NI,{children:[m.jsxs(vI,{className:"text-xs",children:[j.name,j.required?null:m.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ","(optional)"]})]}),m.jsx(CI,{children:m.jsx(wI,{...C,value:C.value??"",required:j.required,placeholder:j.description??"",className:"h-9",disabled:c.formState.isSubmitting})}),m.jsx(RI,{})]})}},j.name),e[36]=c.control,e[37]=c.formState.isSubmitting,e[38]=G):G=e[38],x=f.map(G),e[32]=f,e[33]=c.control,e[34]=c.formState.isSubmitting,e[35]=x}else x=e[35];let v;e[39]!==S?(v=()=>S(!1),e[39]=S,e[40]=v):v=e[40];let N;e[41]!==c.formState.isSubmitting||e[42]!==v?(N=m.jsx(tn,{type:"button",variant:"ghost",onClick:v,disabled:c.formState.isSubmitting,children:"Cancel"}),e[41]=c.formState.isSubmitting,e[42]=v,e[43]=N):N=e[43];let I;e[44]!==c.formState.isSubmitting?(I=c.formState.isSubmitting?m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(OI,{size:"xs"}),"Loading..."]}):"Use prompt",e[44]=c.formState.isSubmitting,e[45]=I):I=e[45];let L;e[46]!==c.formState.isSubmitting||e[47]!==s||e[48]!==I?(L=m.jsx(tn,{type:"submit",form:s,disabled:c.formState.isSubmitting,children:I}),e[46]=c.formState.isSubmitting,e[47]=s,e[48]=I,e[49]=L):L=e[49];let M;e[50]!==N||e[51]!==L?(M=m.jsxs(Nk,{children:[N,L]}),e[50]=N,e[51]=L,e[52]=M):M=e[52];let B;e[53]!==s||e[54]!==E||e[55]!==x||e[56]!==M?(B=m.jsxs("form",{id:s,className:"space-y-4 py-4",autoComplete:"off",onSubmit:E,children:[x,M]}),e[53]=s,e[54]=E,e[55]=x,e[56]=M,e[57]=B):B=e[57];let F;e[58]!==c||e[59]!==B?(F=m.jsx(kI,{...c,children:B}),e[58]=c,e[59]=B,e[60]=F):F=e[60];let P;e[61]!==k||e[62]!==F?(P=m.jsxs(vk,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[k,F]}),e[61]=k,e[62]=F,e[63]=P):P=e[63];let H;return e[64]!==S||e[65]!==P?(H=m.jsx(Vy,{open:!0,onOpenChange:S,children:P}),e[64]=S,e[65]=P,e[66]=H):H=e[66],H}const qI=/^mcp__[a-zA-Z0-9_-]+__/;function sS(t){return t.replace(qI,"")}function Af(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pn=Af();function oS(t){Pn=t}var _r={exec:()=>null};function ve(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(a,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(it.caret,"$1"),n=n.replace(a,s),r},getRegex:()=>new RegExp(n,e)};return r}var it={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},GI=/^(?:[ \t]*(?:\n|$))+/,VI=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,WI=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,YI=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_f=/(?:[*+-]|\d{1,9}[.)])/,lS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uS=ve(lS).replace(/bull/g,_f).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),KI=ve(lS).replace(/bull/g,_f).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XI=/^[^\n]+/,kf=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ZI=ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kf).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),QI=ve(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_f).getRegex(),xi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",If=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,JI=ve("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",If).replace("tag",xi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cS=ve(xf).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex(),eN=ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cS).getRegex(),Nf={blockquote:eN,code:VI,def:ZI,fences:WI,heading:YI,hr:Zr,html:JI,lheading:uS,list:QI,newline:GI,paragraph:cS,table:_r,text:XI},Ym=ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex(),tN={...Nf,lheading:KI,table:Ym,paragraph:ve(xf).replace("hr",Zr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ym).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xi).getRegex()},nN={...Nf,html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",If).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ve(xf).replace("hr",Zr).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",uS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rN=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,aN=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dS=/^( {2,}|\\)\n(?!\s*$)/,iN=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ki=/[\p{P}\p{S}]/u,vf=/[\s\p{P}\p{S}]/u,pS=/[^\s\p{P}\p{S}]/u,sN=ve(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,vf).getRegex(),fS=/(?!~)[\p{P}\p{S}]/u,oN=/(?!~)[\s\p{P}\p{S}]/u,lN=/(?:[^\s\p{P}\p{S}]|~)/u,uN=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,mS=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,cN=ve(mS,"u").replace(/punct/g,ki).getRegex(),dN=ve(mS,"u").replace(/punct/g,fS).getRegex(),hS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pN=ve(hS,"gu").replace(/notPunctSpace/g,pS).replace(/punctSpace/g,vf).replace(/punct/g,ki).getRegex(),fN=ve(hS,"gu").replace(/notPunctSpace/g,lN).replace(/punctSpace/g,oN).replace(/punct/g,fS).getRegex(),mN=ve("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,pS).replace(/punctSpace/g,vf).replace(/punct/g,ki).getRegex(),hN=ve(/\\(punct)/,"gu").replace(/punct/g,ki).getRegex(),gN=ve(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bN=ve(If).replace("(?:-->|$)","-->").getRegex(),EN=ve("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Oa=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,TN=ve(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Oa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gS=ve(/^!?\[(label)\]\[(ref)\]/).replace("label",Oa).replace("ref",kf).getRegex(),bS=ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",kf).getRegex(),yN=ve("reflink|nolink(?!\\()","g").replace("reflink",gS).replace("nolink",bS).getRegex(),Cf={_backpedal:_r,anyPunctuation:hN,autolink:gN,blockSkip:uN,br:dS,code:aN,del:_r,emStrongLDelim:cN,emStrongRDelimAst:pN,emStrongRDelimUnd:mN,escape:rN,link:TN,nolink:bS,punctuation:sN,reflink:gS,reflinkSearch:yN,tag:EN,text:iN,url:_r},SN={...Cf,link:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",Oa).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Oa).getRegex()},yp={...Cf,emStrongRDelimAst:fN,emStrongLDelim:dN,url:ve(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},AN={...yp,br:ve(dS).replace("{2,}","*").getRegex(),text:ve(yp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},la={normal:Nf,gfm:tN,pedantic:nN},dr={normal:Cf,gfm:yp,breaks:AN,pedantic:SN},_N={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Km=t=>_N[t];function Dt(t,e){if(e){if(it.escapeTest.test(t))return t.replace(it.escapeReplace,Km)}else if(it.escapeTestNoEncode.test(t))return t.replace(it.escapeReplaceNoEncode,Km);return t}function Xm(t){try{t=encodeURI(t).replace(it.percentDecode,"%")}catch{return null}return t}function Zm(t,e){const n=t.replace(it.findPipe,(i,s,o)=>{let l=!1,u=s;for(;--u>=0&&o[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(it.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(it.slashPipe,"|");return r}function pr(t,e,n){const r=t.length;if(r===0)return"";let a=0;for(;a<r&&t.charAt(r-a-1)===e;)a++;return t.slice(0,r-a)}function xN(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Qm(t,e,n,r,a){const i=e.href,s=e.title||null,o=t[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:s,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}function kN(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const a=r[1];return e.split(`
3
3
  `).map(i=>{const s=i.match(n.other.beginningSpace);if(s===null)return i;const[o]=s;return o.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var La=class{options;rules;lexer;constructor(t){this.options=t||Pn}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pr(n,`
@@ -1 +1 @@
1
- import{c as B,j as o,b as D,F as M,d as $,r as q,B as F,p as R}from"./index-CsXIUaax.js";import{s as V}from"./Plus-XPxaBtTZ.js";import{i as S}from"./Zap-Cu4-I_Ac.js";import{S as G}from"./search-input-BiAm-dHP.js";import{P as d}from"./index-B6ykVoku.js";import{E as T}from"./empty-state-fv8rbuQT.js";import{c as H}from"./use-automations-NZO0H-p1.js";import{c as J}from"./use-navigate-to-agent-BtA6n79A.js";import{A as K}from"./automation-list-row-BgdzPrn2.js";import{q as O}from"./use-mcp-client-DpsAHhsu.js";import{a as Q}from"./use-virtual-mcp-CNAeRFsi.js";import{R as U}from"./require-capability-BV5_KDVM.js";import"./SearchMd-D-oUO6X0.js";import"./sidebar-Dy1VWxxx.js";import"./LayoutLeft-BuxvHUKx.js";import"./use-mobile-DGf5vwNF.js";import"./X-th7ARgOR.js";import"./tooltip-fIVhp5ou.js";import"./studio-tools-WL-_7DVR.js";import"./hooks-S0-VfPJM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-B-6W79yQ.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-P11DPMoL.js";import"./dropdown-menu-DabrgiLz.js";import"./Check-BdHuJuPw.js";import"./ChevronRight-BBN141em.js";import"./DotsVertical-5WbYSo6Z.js";import"./Stars02-COchQugv.js";import"./Trash01-g9SUeAN0.js";import"./agent-icon-DCQPTD-I.js";import"./AlertCircle-Eoiskkdw.js";import"./Tool01-B96hoDFN.js";import"./ArrowUp-Cqu5i0aZ.js";import"./Settings02-B_QAMj-P.js";import"./Tool02-AsfUGp__.js";import"./XCircle-CfjuVDux.js";import"./ArrowUpRight-CWi3fozt.js";import"./TrendUp01-BAGSq_YF.js";import"./ZapSquare-k4WUcduv.js";import"./Users03-BJNH9N4K.js";import"./CheckCircle-myPjsJGU.js";import"./ChevronDown-DEyjLxYx.js";import"./ChevronUp-DJfqG7zj.js";import"./Copy01-gvtGLLcY.js";import"./CpuChip01-kG4BiE9Y.js";import"./Eye-CZFxMqY9.js";import"./FilterLines-ubYrwRwC.js";import"./Star01-4a_Jxita.js";import"./Palette-D0m6ZhK3.js";import"./SwitchHorizontal01-IoYlCupu.js";import"./HardDrive-F_HbtdSs.js";import"./Key01-D9NzOa5l.js";import"./LinkExternal01-DJvk8I2A.js";import"./LogOut01-DN8933ou.js";import"./Monitor01-Cd36dx-4.js";import"./Sun-Bdj4gRC5.js";import"./Play-D_aQs7dj.js";import"./SearchLg-Dlw09bmE.js";import"./Shield01-m7YUf-pl.js";import"./Stars01-C8PrtncY.js";import"./Upload01-L2syNbDQ.js";import"./User01-CbL87ZBv.js";import"./Users01-BMwIQhmY.js";import"./XClose-BV56nJYO.js";import"./auth-BqANqm0A.js";import"./use-capability-Dzali0wY.js";import"./access-gate-B0jUQZZH.js";import"./capability-load-error-DTwJskAo.js";function W(){const t=B.c(20),e=D(),{org:c}=M(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=$(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+i}})};let l;t[0]!==f||t[1]!==c.slug?(l=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=l):l=t[2];const L=l,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(G,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(F,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function go(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{go as default};
1
+ import{c as B,j as o,b as D,F as M,d as $,r as q,B as F,p as R}from"./index-cIDyPB3B.js";import{s as V}from"./Plus-BUQ_ZClP.js";import{i as S}from"./Zap-Bnq6xGd1.js";import{S as G}from"./search-input-BOnpigZ_.js";import{P as d}from"./index-Bts1u0J_.js";import{E as T}from"./empty-state-DqSQaubj.js";import{c as H}from"./use-automations-BEOa2pC2.js";import{c as J}from"./use-navigate-to-agent-DmiY1Q8V.js";import{A as K}from"./automation-list-row-CtIVsj_5.js";import{q as O}from"./use-mcp-client-Zm5H8-Zl.js";import{a as Q}from"./use-virtual-mcp-Cm3s396Y.js";import{R as U}from"./require-capability-Duuzb-1_.js";import"./SearchMd-CBewQIvn.js";import"./sidebar-C0kiKg50.js";import"./LayoutLeft-C54Zd3v3.js";import"./use-mobile-BengO0lS.js";import"./X-ab3eO-rs.js";import"./tooltip-Cn1IcDmc.js";import"./studio-tools-BVEjmDQb.js";import"./hooks-4mRuOKRy.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-C_01nXFf.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-zLyeS92X.js";import"./dropdown-menu-CNiSo_qs.js";import"./Check-Cw5nys_P.js";import"./ChevronRight-CSfYVYCd.js";import"./DotsVertical-Db0Ic0C_.js";import"./Stars02-DaESD09_.js";import"./Trash01-Yia2FbxW.js";import"./agent-icon-BUu7SJOh.js";import"./AlertCircle-B91-aNwq.js";import"./Tool01-DTGcj4gI.js";import"./ArrowUp-Cn7neu_D.js";import"./Settings02-BiO67z5n.js";import"./Tool02-BPYivh6T.js";import"./XCircle-D7fA26xB.js";import"./ArrowUpRight-4ON7683p.js";import"./TrendUp01-RRDYPFKj.js";import"./ZapSquare-B_ajjEhK.js";import"./Users03-dKCb2h3Y.js";import"./CheckCircle-CvK6qQD1.js";import"./ChevronDown-CFrsDGDp.js";import"./ChevronUp-poM-SIFg.js";import"./Copy01-DAfIqFmi.js";import"./CpuChip01-D-1zqWEP.js";import"./Eye-B4xf2XfM.js";import"./FilterLines-Do81h0db.js";import"./Star01-ZJ4rnXKf.js";import"./Palette-DrK1WdFE.js";import"./SwitchHorizontal01-C1V7p22w.js";import"./HardDrive-BJwWSvdh.js";import"./Key01-CDx4-itV.js";import"./LinkExternal01-BMWoL9cX.js";import"./LogOut01-DnW0PXgG.js";import"./Monitor01-ClNoinKc.js";import"./Sun-Bfx3j4KE.js";import"./Play-uJQecXtC.js";import"./SearchLg-D1RJLuDz.js";import"./Shield01-_WXbYKas.js";import"./Stars01-Bik9Ugxe.js";import"./Upload01-BBKw6S0o.js";import"./User01-XCN4nng1.js";import"./Users01-Cw6_yNSf.js";import"./XClose-CEZC5ftU.js";import"./auth-IA0Wt4Bs.js";import"./use-capability-BxJkR1VB.js";import"./access-gate-D4Hh5FVh.js";import"./capability-load-error-B5z2_UsL.js";function W(){const t=B.c(20),e=D(),{org:c}=M(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=$(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+i}})};let l;t[0]!==f||t[1]!==c.slug?(l=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=l):l=t[2];const L=l,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(G,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(F,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function go(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{go as default};
@@ -1 +1 @@
1
- import{c as k,j as i,m as f,bu as R,cG as S,cH as V,cI as $}from"./index-CsXIUaax.js";import{s as O}from"./User01-CbL87ZBv.js";function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx($,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(S,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const I=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function G(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const m=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f(I({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==m||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx(O,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(M,{className:f(z,"rounded-none"),delayMs:l?600:0,children:m})]}),e[22]=z,e[23]=m,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(U,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function H(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let m;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(m=i.jsx(G,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=m):m=e[17],m}H.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(I({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{H as A};
1
+ import{c as k,j as i,m as f,bs as R,cM as V,cN as I,cO as O}from"./index-cIDyPB3B.js";import{s as $}from"./User01-XCN4nng1.js";function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(O,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function U(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=f("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],L="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function T(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%C.length;return C[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const m=x;let y;e:{if(j){y=L;break e}if(typeof t=="string"){let c;e[11]!==t?(c=T(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=f(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==m||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:f("flex items-center justify-center w-full h-full",z),children:i.jsx($,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(U,{src:l,loading:"lazy",alt:"Avatar",className:f(_({objectFit:u}))}),i.jsx(E,{className:f(z,"rounded-none"),delayMs:l?600:0,children:m})]}),e[22]=z,e[23]=m,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(M,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function B(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let m;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(m=i.jsx(W,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=m):m=e[17],m}B.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:f(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{B as A};
@@ -1 +1 @@
1
- import{c as u,m as l,j as g,b6 as v,bu as b}from"./index-CsXIUaax.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=u.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=l(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
1
+ import{c as u,m as l,j as g,b4 as v,bs as b}from"./index-cIDyPB3B.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=u.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=l(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};