decocms 4.243.0 → 4.243.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/client/assets/{AlertCircle-BrgoLEQ0.js → AlertCircle-DUlfht_8.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BDc6ixlR.js → AreaChart-Cb6V67gW.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-CDofidAY.js → ArrowLeft-xr5VbHB2.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-0JXWlMPw.js → ArrowUp-CsCHH_fH.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-Rz1YqMGK.js → ArrowUpRight-M9WAVHfb.js} +1 -1
  6. package/dist/client/assets/{Check-B3WXWYSz.js → Check-BXav60Vy.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CWxxQPXv.js → CheckCircle-C2PmPe-o.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-B14qTkyv.js → ChevronDown-CauLatdX.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-Aaat-zPl.js → ChevronRight-BGcGReEM.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-3I23HxSc.js → ChevronSelectorVertical-CvdZht1v.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-IZz2eGQ-.js → ChevronUp-D_tIdiJb.js} +1 -1
  12. package/dist/client/assets/{Copy01-sqwxFb53.js → Copy01-CV1JugLX.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DbuX0MzE.js → CreditCard01-B_w5eexh.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-B_d1BqGN.js → DotsVertical-fn24sGZC.js} +1 -1
  15. package/dist/client/assets/{Download01-8o7f8ha3.js → Download01-D3eJDAEO.js} +1 -1
  16. package/dist/client/assets/{Eye-B2eaOo-B.js → Eye-BhHZY2CZ.js} +1 -1
  17. package/dist/client/assets/{FilterLines-BhNBwBEx.js → FilterLines-BWjLIxVc.js} +1 -1
  18. package/dist/client/assets/{Globe01-Dzsrjekj.js → Globe01-DdUoMsv3.js} +1 -1
  19. package/dist/client/assets/{Globe04-DGlluzNX.js → Globe04-B-w3WEq9.js} +1 -1
  20. package/dist/client/assets/{HardDrive-Br7GP1Y0.js → HardDrive-BFP4nRun.js} +1 -1
  21. package/dist/client/assets/{Key01-BQwobAw2.js → Key01-Cfe0Tudx.js} +1 -1
  22. package/dist/client/assets/{LayoutLeft-C5bEG-Yu.js → LayoutLeft-BEpfII_o.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-DL7sD62z.js → LinkExternal01-D25gdGqj.js} +1 -1
  24. package/dist/client/assets/{LockUnlocked01-5khio-0j.js → LockUnlocked01-P_wfDROK.js} +1 -1
  25. package/dist/client/assets/{LogOut01-B84tbGgl.js → LogOut01-DBKmS50y.js} +1 -1
  26. package/dist/client/assets/{Monitor01-BDodWDfh.js → Monitor01-BhLjoS2b.js} +1 -1
  27. package/dist/client/assets/{Palette-CqQ0uw84.js → Palette-aeV8tQ28.js} +1 -1
  28. package/dist/client/assets/{Play-BmbGeXli.js → Play-BdOAMmIp.js} +1 -1
  29. package/dist/client/assets/{Plus-ANFCmNBC.js → Plus-D1J2FK4h.js} +1 -1
  30. package/dist/client/assets/{SearchLg-Bhod71Pp.js → SearchLg-BzCLzG8R.js} +1 -1
  31. package/dist/client/assets/{SearchMd-DaUX4bqr.js → SearchMd-xpLLk_pA.js} +1 -1
  32. package/dist/client/assets/{Settings02-BR1pfUoq.js → Settings02-DjFkLPe4.js} +1 -1
  33. package/dist/client/assets/{Share07-DMD6arE7.js → Share07-Caa0Im56.js} +1 -1
  34. package/dist/client/assets/{Shield01-CE38_tJy.js → Shield01-D5NbAsUv.js} +1 -1
  35. package/dist/client/assets/{Stars01-BeJY7M9x.js → Stars01-CCBcRCds.js} +1 -1
  36. package/dist/client/assets/{Stars02-BxQmMBsd.js → Stars02-DtoiSIcu.js} +1 -1
  37. package/dist/client/assets/{Sun-bQIMS-df.js → Sun-Dpvmek-4.js} +1 -1
  38. package/dist/client/assets/{SwitchHorizontal01-CQeaa4s0.js → SwitchHorizontal01-C5wQU73g.js} +1 -1
  39. package/dist/client/assets/{Tool01-3U4lZ0ql.js → Tool01-XzYGP86W.js} +1 -1
  40. package/dist/client/assets/{Tool02-WLcNYFEm.js → Tool02-CE2ZdUr1.js} +1 -1
  41. package/dist/client/assets/{Trash01-D1tBKt57.js → Trash01-BnQQflAa.js} +1 -1
  42. package/dist/client/assets/{TrendUp01-BdJ3w75n.js → TrendUp01-BdIQtpYk.js} +1 -1
  43. package/dist/client/assets/{Upload01-B89gb6cs.js → Upload01-Bhqh3Tbq.js} +1 -1
  44. package/dist/client/assets/{User01-BkUay2ek.js → User01-C1NHQ-ZR.js} +1 -1
  45. package/dist/client/assets/{Users01-BA4DPXUj.js → Users01-CMhcYnus.js} +1 -1
  46. package/dist/client/assets/{Users03-CrEwye6I.js → Users03-BNksnLQf.js} +1 -1
  47. package/dist/client/assets/{X-Bn5dnt4Y.js → X-DY9FeXqi.js} +1 -1
  48. package/dist/client/assets/{XCircle-BWEvFrPt.js → XCircle-_aQH9vJz.js} +1 -1
  49. package/dist/client/assets/{XClose-Dxm1AFZT.js → XClose-DdNRdfWH.js} +1 -1
  50. package/dist/client/assets/{YAxis-BfjjKnsh.js → YAxis-DLOWdC_A.js} +1 -1
  51. package/dist/client/assets/{Zap-BRrVrhlx.js → Zap-DDihnv3P.js} +1 -1
  52. package/dist/client/assets/{ZapSquare-BoJs5BxD.js → ZapSquare-Bv6t7Fg1.js} +1 -1
  53. package/dist/client/assets/{access-gate-Cs3BTnxj.js → access-gate-wLBW4P-Z.js} +1 -1
  54. package/dist/client/assets/{agent-icon-DBTWnOQq.js → agent-icon-5ZYno8Im.js} +1 -1
  55. package/dist/client/assets/{agents-list-BpgA3ynY.js → agents-list-7wqeXOXn.js} +1 -1
  56. package/dist/client/assets/{ai-providers-xyC85E3V.js → ai-providers-BJDhlXiK.js} +1 -1
  57. package/dist/client/assets/{alert-rptVdkhI.js → alert-B6Fmol8n.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-vU3RDB6N.js → alert-dialog-BOUVk-xM.js} +1 -1
  59. package/dist/client/assets/{api-keys-CB-b9U1V.js → api-keys-DGMyGe_V.js} +1 -1
  60. package/dist/client/assets/{app-editor-BiIlX8jr.js → app-editor-BQTeUJlT.js} +1 -1
  61. package/dist/client/assets/{auth-DF9dNCmv.js → auth-Clf3KXjv.js} +1 -1
  62. package/dist/client/assets/{auth-catchall-duUIz-Ep.js → auth-catchall-CPPqDGgA.js} +1 -1
  63. package/dist/client/assets/{auth-entry-D42MbHN4.js → auth-entry-PFcfNCN7.js} +1 -1
  64. package/dist/client/assets/{auth-split-layout-D_bUTQUp.js → auth-split-layout-5_o-m_dm.js} +1 -1
  65. package/dist/client/assets/{authenticate-and-persist-oauth-BvJ__4OQ.js → authenticate-and-persist-oauth-BUQ1Xi6C.js} +1 -1
  66. package/dist/client/assets/{automation-list-row-CWPbfvGY.js → automation-list-row-DRZedCha.js} +1 -1
  67. package/dist/client/assets/{automation-runs-CodtZRH7.js → automation-runs-DaNWyAAB.js} +1 -1
  68. package/dist/client/assets/{automations-BTel9p1a.js → automations-BBd2nZBY.js} +1 -1
  69. package/dist/client/assets/{avatar-CJo_O7ud.js → avatar-CsESGb5P.js} +1 -1
  70. package/dist/client/assets/{badge-DVdFuH3v.js → badge-BtBZ1HPJ.js} +1 -1
  71. package/dist/client/assets/{billing-Bl-NIc7d.js → billing-Bgr3WIC0.js} +1 -1
  72. package/dist/client/assets/{block-document-6bFPsXgq.js → block-document-BKnVO5ZG.js} +1 -1
  73. package/dist/client/assets/{buckets-BsR3AeUh.js → buckets-Cg0MlwAj.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-DqtOxYn3.js → bulk-category-panel-BHhnBX-y.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-COB0oCD2.js → capability-load-error-BasK1UyG.js} +1 -1
  76. package/dist/client/assets/{card-CtLNe5Qx.js → card-CKXxuGX6.js} +1 -1
  77. package/dist/client/assets/{cards-D3JgaUCj.js → cards-BIJ-5lG1.js} +1 -1
  78. package/dist/client/assets/{category-editor-C1d1MiGz.js → category-editor-BInGd-ra.js} +1 -1
  79. package/dist/client/assets/{chart-C4uJp2sq.js → chart-CkOpSzxv.js} +1 -1
  80. package/dist/client/assets/{chat-context-B5XcYK7Q.js → chat-context-DAVuFXb-.js} +1 -1
  81. package/dist/client/assets/{checkbox-RaVG15-H.js → checkbox-BmMgY8o7.js} +1 -1
  82. package/dist/client/assets/{choose-editor-BC67Qw28.js → choose-editor-BGZ5cx6T.js} +1 -1
  83. package/dist/client/assets/{cli-auth-success-uKwawqrq.js → cli-auth-success-CRaZ-XOY.js} +1 -1
  84. package/dist/client/assets/{collection-detail-BEVwITBz.js → collection-detail-CjMlAcj7.js} +1 -1
  85. package/dist/client/assets/{collection-display-button-jdQAMsZr.js → collection-display-button-C5Ypy8cN.js} +1 -1
  86. package/dist/client/assets/{collection-search-CkxMY4PG.js → collection-search-Dc8oos2w.js} +1 -1
  87. package/dist/client/assets/{collection-table-wrapper-CGDwgnLT.js → collection-table-wrapper-BqCUWVdp.js} +1 -1
  88. package/dist/client/assets/{collection-tabs-C7isr8pg.js → collection-tabs-DQs6Id7F.js} +1 -1
  89. package/dist/client/assets/{command-BiOiOU66.js → command-CckioSee.js} +1 -1
  90. package/dist/client/assets/{commerce-onboarding-ByyCjjtX.js → commerce-onboarding-D33mAwVV.js} +1 -1
  91. package/dist/client/assets/{connect-CC_EzxyT.js → connect-B2Kdp8ut.js} +1 -1
  92. package/dist/client/assets/{connection-BaA6OCzM.js → connection-DawcOkII.js} +1 -1
  93. package/dist/client/assets/{connection-card-BPiCJvzC.js → connection-card-JINQJoK5.js} +1 -1
  94. package/dist/client/assets/{connection-detail-C2biE7AV.js → connection-detail-Db3nTX8u.js} +1 -1
  95. package/dist/client/assets/{connection-form-helpers-CsaqSN7W.js → connection-form-helpers-Shqj1MAl.js} +1 -1
  96. package/dist/client/assets/{connections-DUWMVqiD.js → connections-BcEtHf8S.js} +1 -1
  97. package/dist/client/assets/{decopilot-sse-pool--ck4nwtj.js → decopilot-sse-pool-DLTV1od0.js} +1 -1
  98. package/dist/client/assets/{dialog-BS0vrn2L.js → dialog-U03ZiuXk.js} +1 -1
  99. package/dist/client/assets/{domain-settings-n6fz7Pyw.js → domain-settings-CDI7Fjmq.js} +1 -1
  100. package/dist/client/assets/{drawer-BaCYYHlG.js → drawer-qjynKTFN.js} +1 -1
  101. package/dist/client/assets/{dropdown-menu-BOPvnnQd.js → dropdown-menu-BmoCpvnT.js} +1 -1
  102. package/dist/client/assets/{empty-state-D2koIBhr.js → empty-state-PrJglZio.js} +1 -1
  103. package/dist/client/assets/{extract-connection-data-BBeYQYw-.js → extract-connection-data-GB3welMi.js} +1 -1
  104. package/dist/client/assets/{file-explorer-DYm4oS7Z.js → file-explorer-BUj_Z3iJ.js} +1 -1
  105. package/dist/client/assets/{file-type-icon-B0DZabiD.js → file-type-icon-DNO6EG6W.js} +1 -1
  106. package/dist/client/assets/{form-DMJ-qg4h.js → form-BlkhuHf9.js} +1 -1
  107. package/dist/client/assets/{general-CV9n7mfY.js → general-BSW7_Voe.js} +1 -1
  108. package/dist/client/assets/{github-repo-picker-oxcrEhk7.js → github-repo-picker-D56QHlTy.js} +1 -1
  109. package/dist/client/assets/{hooks-CybMa7sq.js → hooks-B2woSXLe.js} +1 -1
  110. package/dist/client/assets/{index-D09jjQ2g.js → index-AXIuo6hf.js} +1 -1
  111. package/dist/client/assets/{index-CLFms9Kb.js → index-CToZ4kbL.js} +1 -1
  112. package/dist/client/assets/{index-DM-TT-A-.js → index-CY3hVAON.js} +1 -1
  113. package/dist/client/assets/{index-sCu4mSVJ.js → index-Chdg8Asw.js} +1 -1
  114. package/dist/client/assets/{index-zg41rH3q.js → index-D-cW_7z2.js} +1 -1
  115. package/dist/client/assets/{index-C3mx3_21.js → index-D5A_cbaj.js} +1 -1
  116. package/dist/client/assets/{index-ChNbonqj.js → index-DLyxjIYw.js} +3 -3
  117. package/dist/client/assets/{index-D7IC2bc9.js → index-Djodm3GI.js} +1 -1
  118. package/dist/client/assets/{index-CkrEasD3.js → index-DlSq7kji.js} +1 -1
  119. package/dist/client/assets/{index-SxNf16kQ.js → index-j097lZOT.js} +6 -6
  120. package/dist/client/assets/{index-redirect-g8c3YIPq.js → index-redirect-C__5RhjR.js} +1 -1
  121. package/dist/client/assets/{infra-billing-D2DzSfz8.js → infra-billing-CI8pxTWO.js} +1 -1
  122. package/dist/client/assets/{input-C7yzxoyt.js → input-BH7zyD0i.js} +1 -1
  123. package/dist/client/assets/{integration-icon-D-qP5ZLw.js → integration-icon-BolSFCMJ.js} +1 -1
  124. package/dist/client/assets/{invite-member-dialog-xxza5ifo.js → invite-member-dialog-Cfb_Sthq.js} +1 -1
  125. package/dist/client/assets/{label-BUQxzK6e.js → label-Cwuc9phK.js} +1 -1
  126. package/dist/client/assets/{layout-DwiEl33n.js → layout-BEPQVUxl.js} +1 -1
  127. package/dist/client/assets/{login-C2wbAOet.js → login-C2AFfDb-.js} +1 -1
  128. package/dist/client/assets/{mcp-oauth-gwq9pHSc.js → mcp-oauth-BmzTS1ua.js} +1 -1
  129. package/dist/client/assets/{members-CKVCFP8J.js → members-D7MXmyE1.js} +1 -1
  130. package/dist/client/assets/{monaco-editor-CN0WiJ4m.js → monaco-editor-DBmhJ8Ys.js} +1 -1
  131. package/dist/client/assets/{monitoring-stats-row-hXHH_Qzm.js → monitoring-stats-row-DfEDCsLl.js} +1 -1
  132. package/dist/client/assets/{multi-select-DTBcmDmv.js → multi-select-C2Dia25c.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-YpbbWUYc.js → oauth-callback-D_WAqpRo.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-ai-provider-Bf8e53OZ.js → oauth-callback-ai-provider-BhA1cp1j.js} +1 -1
  135. package/dist/client/assets/{onboarding-BL9qfKT1.js → onboarding-uuvWd04L.js} +1 -1
  136. package/dist/client/assets/{org-layout-B4BHpF4S.js → org-layout-D-9MtDux.js} +1 -1
  137. package/dist/client/assets/{organization-choice-vJ48X6tx.js → organization-choice-YKPoOAc0.js} +1 -1
  138. package/dist/client/assets/{orgs-CCMlat2A.js → orgs-DgzYCdTa.js} +1 -1
  139. package/dist/client/assets/{page-seo-form-f-hVr85G.js → page-seo-form-GRyqYD3q.js} +1 -1
  140. package/dist/client/assets/{popover-CUB5B6Fg.js → popover-9hL99Gs4.js} +1 -1
  141. package/dist/client/assets/{post-editor-D06ApXAF.js → post-editor-B2P499Gv.js} +1 -1
  142. package/dist/client/assets/{primitives-BgxLdlTf.js → primitives-5VVvVXDP.js} +1 -1
  143. package/dist/client/assets/{profile-BSAPfGMQ.js → profile-CyKGXLmf.js} +1 -1
  144. package/dist/client/assets/{project-app-view-gqdvdVzv.js → project-app-view-kVyS_ky4.js} +1 -1
  145. package/dist/client/assets/record-editor-DHsX7f85.js +1 -0
  146. package/dist/client/assets/{redirect-editor-DH3YRmju.js → redirect-editor-wh6KUQar.js} +1 -1
  147. package/dist/client/assets/registry-BCU9YbQl.js +2 -0
  148. package/dist/client/assets/{registry-layout-BysSARbI.js → registry-layout-BqclQM58.js} +1 -1
  149. package/dist/client/assets/{reports-7dxPaRv0.js → reports-ezYEoj8-.js} +1 -1
  150. package/dist/client/assets/{require-capability-Brg3b3WC.js → require-capability-daZd2Avq.js} +1 -1
  151. package/dist/client/assets/{required-auth-layout-3kqwvomq.js → required-auth-layout-tPpYmfR1.js} +1 -1
  152. package/dist/client/assets/{reset-password-CXRdZjRI.js → reset-password-B_cu2DBW.js} +1 -1
  153. package/dist/client/assets/{roles-Dq7uN6ct.js → roles-CnMuEzXy.js} +1 -1
  154. package/dist/client/assets/{search-input-DrjuWiKa.js → search-input-Dlrgn3SA.js} +1 -1
  155. package/dist/client/assets/{secrets-BNY_fQqn.js → secrets-DHhUnvN3.js} +1 -1
  156. package/dist/client/assets/{sections-editor-CevgmZWu.js → sections-editor-D2V-U5oa.js} +1 -1
  157. package/dist/client/assets/{select-BoWvSZwe.js → select-BhNhFGIm.js} +1 -1
  158. package/dist/client/assets/{select-model-BRL3AkBY.js → select-model-BbkxZygk.js} +1 -1
  159. package/dist/client/assets/{self-tool-result-CjNsVq8n.js → self-tool-result-Bjns9v-D.js} +1 -1
  160. package/dist/client/assets/{seo-editor-UAGnCXyh.js → seo-editor-_sQ6ViyP.js} +1 -1
  161. package/dist/client/assets/{settings-layout-DFc4BtIO.js → settings-layout-CihM6Z5f.js} +1 -1
  162. package/dist/client/assets/{settings-section-DhQpgpfA.js → settings-section-BIT7uWjs.js} +1 -1
  163. package/dist/client/assets/{settings-subnav-DQDlSCqd.js → settings-subnav-DobJGu7Z.js} +1 -1
  164. package/dist/client/assets/{shell-controls-DCOUB95S.js → shell-controls-BOR8V5VI.js} +1 -1
  165. package/dist/client/assets/{shell-layout-CtVK6QP7.js → shell-layout-Dpz4gldn.js} +1 -1
  166. package/dist/client/assets/{sidebar-C1S8e866.js → sidebar-_myHCEzH.js} +1 -1
  167. package/dist/client/assets/{skeleton-D5WFiATz.js → skeleton-CfDgtd5M.js} +1 -1
  168. package/dist/client/assets/{spinner-CpJFHR4J.js → spinner-CgvhsPnS.js} +1 -1
  169. package/dist/client/assets/{sso-t4sP4P0n.js → sso-CzK_Pk8F.js} +1 -1
  170. package/dist/client/assets/{store-C_XBJ-i7.js → store-Cu4INizs.js} +1 -1
  171. package/dist/client/assets/store-registry-OC_7xuUK.js +2 -0
  172. package/dist/client/assets/{studio-tools-9YEAucUH.js → studio-tools-ThQ_rcsF.js} +1 -1
  173. package/dist/client/assets/{switch-BJLPF8PK.js → switch-BCRtcgA0.js} +1 -1
  174. package/dist/client/assets/{synced-repos-CgQ_cGAZ.js → synced-repos-DkuvF9QR.js} +1 -1
  175. package/dist/client/assets/{tab-id-BEc2tty8.js → tab-id-DM8k_HA-.js} +1 -1
  176. package/dist/client/assets/{table-D02muAc_.js → table-C5eCsrvC.js} +1 -1
  177. package/dist/client/assets/{tabs-CGqVCYyt.js → tabs-D-zNditx.js} +1 -1
  178. package/dist/client/assets/{tasks-BjHKZPZu.js → tasks-CwCxAFhU.js} +1 -1
  179. package/dist/client/assets/{textarea-DjlJ6d8C.js → textarea-BfUIS--d.js} +1 -1
  180. package/dist/client/assets/{toggle-group-BqIMvBlD.js → toggle-group-DvojD61A.js} +1 -1
  181. package/dist/client/assets/{toolbar-C0xZ_v3e.js → toolbar-C6N7bX1O.js} +1 -1
  182. package/dist/client/assets/{tooltip-Cj4mvkkR.js → tooltip-B-y9isox.js} +1 -1
  183. package/dist/client/assets/{track-CqU3IgFZ.js → track-Bwp-FwAP.js} +1 -1
  184. package/dist/client/assets/{types-CAX3bqHp.js → types-D6tOWfuo.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-B9kWiPxx.js → use-ai-providers-Bb772HOL.js} +1 -1
  186. package/dist/client/assets/{use-api-keys-DSfqRc6H.js → use-api-keys-CX7vmPa_.js} +1 -1
  187. package/dist/client/assets/{use-automations-CfL33HY2.js → use-automations-DyLBCDVI.js} +1 -1
  188. package/dist/client/assets/{use-autosave-Bpyt1Z28.js → use-autosave-DnhwLkb4.js} +1 -1
  189. package/dist/client/assets/{use-capability-DwzdlNfB.js → use-capability-DxO7qy1z.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-A4kYSp_I.js → use-clock-tick-DS1Jl_N9.js} +1 -1
  191. package/dist/client/assets/{use-commerce-diagnostic-Cwbtii-G.js → use-commerce-diagnostic-DtF4_mte.js} +1 -1
  192. package/dist/client/assets/{use-connection-DUGNH57G.js → use-connection-DmmNo1LM.js} +1 -1
  193. package/dist/client/assets/{use-copy-_y6zwPE1.js → use-copy-CSIcq8z_.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-BV6lMF9Y.js → use-create-virtual-mcp-CR_IUdwo.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-DTYR1u_f.js → use-debounced-autosave-DjJh5yYH.js} +1 -1
  196. package/dist/client/assets/{use-debounced-value-Bo9IMGku.js → use-debounced-value-19BtC7Bb.js} +1 -1
  197. package/dist/client/assets/{use-decopilot-events-yNhzbNrQ.js → use-decopilot-events-Bb_7qSC-.js} +1 -1
  198. package/dist/client/assets/{use-delete-connection-C8vffg6C.js → use-delete-connection-keAeE1I9.js} +1 -1
  199. package/dist/client/assets/{use-deployment-admin-D8c8yTiB.js → use-deployment-admin-GvqoWv58.js} +1 -1
  200. package/dist/client/assets/{use-file-configs-ASBON7-j.js → use-file-configs-IFt3zoqI.js} +1 -1
  201. package/dist/client/assets/{use-infinite-scroll-IZ_BZ9sF.js → use-infinite-scroll-C1T3wjaO.js} +1 -1
  202. package/dist/client/assets/{use-join-requests-ColY4XtI.js → use-join-requests-BeMEoip1.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-DGiEqhWW.js → use-mcp-client-_o9o88xf.js} +1 -1
  204. package/dist/client/assets/{use-mcp-tools-BiU5POb9.js → use-mcp-tools-CRMPw5o_.js} +1 -1
  205. package/dist/client/assets/{use-members-pOIdSM2x.js → use-members-BeAeYksa.js} +1 -1
  206. package/dist/client/assets/{use-mobile-Caz6aOTC.js → use-mobile-H1cEPaVS.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-xz8e6g3j.js → use-navigate-to-agent-BqMCqmam.js} +1 -1
  208. package/dist/client/assets/{use-open-billing-url-D_P6BXEt.js → use-open-billing-url-BWzY_VeB.js} +1 -1
  209. package/dist/client/assets/{use-org-auth-client-BlmJUHTc.js → use-org-auth-client-A_fhg4VK.js} +1 -1
  210. package/dist/client/assets/{use-org-repo-syncs-efo6UZtd.js → use-org-repo-syncs-DboNdEwi.js} +1 -1
  211. package/dist/client/assets/{use-org-sso-DJp-v4Zx.js → use-org-sso-D-BEPABI.js} +1 -1
  212. package/dist/client/assets/{use-organization-roles-Dvr4kP4J.js → use-organization-roles-ABd_zIJY.js} +1 -1
  213. package/dist/client/assets/{use-organization-settings-Wtwifcf8.js → use-organization-settings-DPRJ0ATL.js} +1 -1
  214. package/dist/client/assets/{use-registry-connections-D-AvB9Bj.js → use-registry-connections-Y17SLNHX.js} +1 -1
  215. package/dist/client/assets/{use-secrets-CMqfk8sk.js → use-secrets-DH31aTTe.js} +1 -1
  216. package/dist/client/assets/{use-section-preview-base-D2SU5xAy.js → use-section-preview-base-Csrv-VqV.js} +1 -1
  217. package/dist/client/assets/{use-settings-tabs-D7UnYZYf.js → use-settings-tabs-CGwARRFk.js} +1 -1
  218. package/dist/client/assets/{use-status-sounds-DGVtZMR4.js → use-status-sounds-BeFWP6sc.js} +1 -1
  219. package/dist/client/assets/{use-tags-C8enWop_.js → use-tags-BkefASeN.js} +1 -1
  220. package/dist/client/assets/{use-view-mode-C7l3j_az.js → use-view-mode-BLj18CVK.js} +1 -1
  221. package/dist/client/assets/{use-virtual-mcp-3E0X8Qho.js → use-virtual-mcp-B0LtGhD8.js} +1 -1
  222. package/dist/client/assets/useInfiniteQuery-BTBdPVyZ.js +1 -0
  223. package/dist/client/assets/{useRouterState-Cf6ilWg1.js → useRouterState-um8-mtPt.js} +1 -1
  224. package/dist/client/assets/useSuspenseInfiniteQuery-C3uzz_IX.js +1 -0
  225. package/dist/client/assets/{users-C7a-yzcW.js → users-CWvqMFcP.js} +1 -1
  226. package/dist/client/assets/{variant-calendar-C9V9V-xS.js → variant-calendar-B1xj6WY-.js} +1 -1
  227. package/dist/client/assets/{view-mode-toggle-CzB7A8mV.js → view-mode-toggle-B1CxI2v1.js} +1 -1
  228. package/dist/client/index.html +1 -1
  229. package/dist/server/cli.js +2 -2
  230. package/dist/server/server.js +2 -2
  231. package/package.json +1 -1
  232. package/dist/client/assets/record-editor-DMIY9fHf.js +0 -1
  233. package/dist/client/assets/registry-60JJaFGK.js +0 -2
  234. package/dist/client/assets/store-registry-CQMoiJZP.js +0 -2
  235. package/dist/client/assets/useInfiniteQuery-DMuMqK5u.js +0 -1
  236. package/dist/client/assets/useSuspenseInfiniteQuery-BypMBt7A.js +0 -1
@@ -1 +1 @@
1
- import{a as V,D as Fe,r as v,e as ce,p as Q,j as t,m as N,B as xe,o as Be,n as $e,K as me,c as fe,b as be,S as _e}from"./index-ChNbonqj.js";import{I as ee}from"./input-C7yzxoyt.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-CpJFHR4J.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:i,email:e,password:m,name:f})=>i==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:i,redirectTo:e})=>V.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>V.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>V.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>V.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>V.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ue="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:i,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,oe=C.enabled&&(g||!y.enabled&&!se),le=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!oe?S.providers:te,h=S.enabled&&le.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,z]=v.useState(""),[B,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Oe,he]=v.useState(null),n={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=q==="signUp",U=q==="forgotPassword",T=q==="emailOtp",ie=ce({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?n.signUpFailed:n.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(n.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),Q(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=ce({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||n.resetEmailFailed);return l},onSuccess:()=>{Q("password_reset_requested"),ve(!0)},onError:s=>{Q("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=ce({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||n.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),Q("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ce({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||n.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),de=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!de(b)&&H(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:B})},Re=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail);return}re.mutate({email:b})},De=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},Me=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{W(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,$=I?b.trim()&&L.trim()&&B.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?n.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?n.accountExists:l.includes("network")||l.includes("fetch")?n.networkError:l.includes("rate limit")||l.includes("429")?n.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=je||Ne||Ae||Oe,We=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:i??e});if(l.error)throw new Error(l.error.message||n.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),Q("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},Ue=U?n.resetPasswordTitle:T&&x?n.verificationCodeTitle:m??n.welcomeTitle,Ce=U?n.resetPasswordSubtitle:T&&x?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:le.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{We(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:n.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.sending:n.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!$,className:"w-full font-semibold",size:"xl",children:E?n.sending:n.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:n.namePlaceholder,value:B,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(z),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",$?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!$&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!$,className:N("w-full font-semibold"),size:"xl","aria-hidden":!$,children:E?I?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ue,children:I?n.signIn:n.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ue,children:n.signInWithEmailCode})]})]}):null})]})}async function ge(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const i=Be(),e=Ve(),m=$e({queryKey:me.desktopAuthStatus(),queryFn:async()=>(await ge()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,i]);async function C(){p(!0),r(null);try{const o=await ge();await o.performAuthLogin();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await ge();await o.performAuthLogout();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await ge()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Xe(){return fe.c(10),Ge(),null}function Ze(i){const e=fe.c(25),{onContinue:m,isPending:f,error:p}=i,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(i){const e=fe.c(8),{label:m,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function tt({redirectTo:i,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await ze(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(i))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(_e,{})}function st({callbackURL:i,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(_e,{})}function lt(i){const e=fe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=i,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:oe,localMode:le}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let z;e[2]!==_||e[3]!==L?(z={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=z):z=e[4];const B=z;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(le&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==B.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:B.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=B.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:oe,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||oe.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{lt as A,Ge as u};
1
+ import{a as V,D as Fe,r as v,e as ce,p as Q,j as t,m as N,B as xe,o as Be,n as $e,K as me,c as fe,b as be,S as _e}from"./index-DLyxjIYw.js";import{I as ee}from"./input-BH7zyD0i.js";import{i as Ve}from"./use-is-desktop-app-BNujXJc_.js";import{S as Qe}from"./spinner-CgvhsPnS.js";import{r as ze,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:i,email:e,password:m,name:f})=>i==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:i,redirectTo:e})=>V.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>V.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>V.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>V.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>V.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ue="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ye({redirectUrl:i,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,oe=C.enabled&&(g||!y.enabled&&!se),le=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!oe?S.providers:te,h=S.enabled&&le.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,z]=v.useState(""),[B,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[q,W]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Oe,he]=v.useState(null),n={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=q==="signUp",U=q==="forgotPassword",T=q==="emailOtp",ie=ce({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?n.signUpFailed:n.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(n.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),Q(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=ce({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||n.resetEmailFailed);return l},onSuccess:()=>{Q("password_reset_requested"),ve(!0)},onError:s=>{Q("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=ce({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||n.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),Q("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=ce({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||n.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(i??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),Q("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),de=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!de(b)&&H(n.invalidEmail)},Te=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:B})},Re=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail);return}re.mutate({email:b})},De=s=>{if(s.preventDefault(),!de(b)){H(n.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},Me=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{W(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,$=I?b.trim()&&L.trim()&&B.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?n.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?n.accountExists:l.includes("network")||l.includes("fetch")?n.networkError:l.includes("rate limit")||l.includes("429")?n.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?n.invalidOrExpiredCode:s.message||n.genericError},Pe=je||Ne||Ae||Oe,We=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:i??e});if(l.error)throw new Error(l.error.message||n.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),Q("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},Ue=U?n.resetPasswordTitle:T&&x?n.verificationCodeTitle:m??n.welcomeTitle,Ce=U?n.resetPasswordSubtitle:T&&x?n.codeSentTo(b):f===void 0?n.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:Ue}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:n.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:le.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{We(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),n.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:n.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:n.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.verifying:n.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:n.useDifferentEmail})]}):t.jsxs("form",{onSubmit:De,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:n.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!$,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?n.sending:n.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:Re,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!$,className:"w-full font-semibold",size:"xl",children:E?n.sending:n.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Te,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:n.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:n.namePlaceholder,value:B,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:n.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:n.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:n.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(z),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",$?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!$&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!$,className:N("w-full font-semibold"),size:"xl","aria-hidden":!$,children:E?I?n.creatingAccount:n.signingIn:n.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ue,children:n.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?n.alreadyHaveAccount:n.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ue,children:I?n.signIn:n.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ue,children:n.signInWithEmailCode})]})]}):null})]})}async function ge(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const i=Be(),e=Ve(),m=$e({queryKey:me.desktopAuthStatus(),queryFn:async()=>(await ge()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,i]);async function C(){p(!0),r(null);try{const o=await ge();await o.performAuthLogin();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await ge();await o.performAuthLogout();const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await ge()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();i.setQueryData(me.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(i){return!(i.emailAndPassword.enabled||i.emailOtp.enabled||i.socialProviders.enabled)&&!i.sso.enabled&&i.magicLink.enabled}function Xe(){return fe.c(10),Ge(),null}function Ze(i){const e=fe.c(25),{onContinue:m,isPending:f,error:p}=i,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(i){const e=fe.c(8),{label:m,error:f}=i;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Qe,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(i){return i.startsWith("/")&&!i.startsWith("//")?i:"/"}function tt({redirectTo:i,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await ze(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(i))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(_e,{})}function st({callbackURL:i,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(_e,{})}function lt(i){const e=fe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=i,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:oe,localMode:le}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let z;e[2]!==_||e[3]!==L?(z={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=z):z=e[4];const B=z;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(le&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==B.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:B.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=B.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:oe,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||oe.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const q=M;if(!a)return q;let W;e[42]!==a?(W=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=W):W=e[43];let j;return e[44]!==q||e[45]!==W?(j=t.jsxs("div",{className:"grid gap-4",children:[W,q]}),e[44]=q,e[45]=W,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{lt as A,Ge as u};
@@ -1 +1 @@
1
- import{c as g,m as p,j as f}from"./index-ChNbonqj.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-DLyxjIYw.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-ChNbonqj.js";import{i as u,a as p}from"./mcp-oauth-gwq9pHSc.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-DLyxjIYw.js";import{i as u,a as p}from"./mcp-oauth-BmzTS1ua.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-ChNbonqj.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-vU3RDB6N.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-BOPvnnQd.js";import{s as me}from"./Stars02-BxQmMBsd.js";import{a as ue}from"./DotsVertical-B_d1BqGN.js";import{s as de}from"./Trash01-D1tBKt57.js";import{i as fe}from"./Zap-BRrVrhlx.js";import{a as ge}from"./use-virtual-mcp-3E0X8Qho.js";import{A as xe}from"./agent-icon-DBTWnOQq.js";import{u as pe}from"./use-automations-CfL33HY2.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-DLyxjIYw.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-BOUVk-xM.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-BmoCpvnT.js";import{s as me}from"./Stars02-DtoiSIcu.js";import{a as ue}from"./DotsVertical-fn24sGZC.js";import{s as de}from"./Trash01-BnQQflAa.js";import{i as fe}from"./Zap-DDihnv3P.js";import{a as ge}from"./use-virtual-mcp-B0LtGhD8.js";import{A as xe}from"./agent-icon-5ZYno8Im.js";import{u as pe}from"./use-automations-DyLBCDVI.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 U,c as W,b as fe,a0 as OO,j as m,B as nr,Z as DE,X as LO,$ as DO,bM as H_,bN as MO,ac as PO,au as xt,bO as FO,m as ye,bx as pb,bP as co,H as BO,d as la,f as UO,p as jO,aJ as HO,aG as Cr,aN as $O,aM as Sr,bL as ds,aK as ua,bQ as $_,aI as z_,F as Pn,o as zO,e as qO,K as dn,t as Xm,n as ps,E as q_,at as G_,bR as fb,aL as GO,bS as Ur,aQ as ME}from"./index-ChNbonqj.js";import{e as WO}from"./select-BoWvSZwe.js";import{aT as VO,aU as YO,aM as KO,aV as XO,aW as ZO,u as QO,s as po,E as JO,aX as eL,q as Zm,an as tL,i as PE,ay as nL,k as rL,aY as aL,aR as W_,aZ as iL,a_ as V_,A as Y_,a$ as In,aG as sL,l as oL,x as lL}from"./agent-icon-DBTWnOQq.js";import{i as Qm}from"./ChevronRight-Aaat-zPl.js";import{u as K_}from"./useInfiniteQuery-DMuMqK5u.js";import{a as X_,u as uL}from"./use-connection-DUGNH57G.js";import{n as cL,u as hb,f as dL,i as pL,a as fL,S as hL}from"./use-mcp-client-DGiEqhWW.js";import{u as mL}from"./use-virtual-mcp-3E0X8Qho.js";import{C as gL}from"./card-CtLNe5Qx.js";import{o as Z_,m as Q_,p as mb,q as gb}from"./sidebar-C1S8e866.js";import{c as J_,e as eN,a as gl,d as an,b as tN,T as sn}from"./table-D02muAc_.js";import{E as Jm}from"./empty-state-D2koIBhr.js";import{u as bb}from"./use-infinite-scroll-IZ_BZ9sF.js";import{a as bL}from"./use-members-pOIdSM2x.js";import{u as nN,S as Ma}from"./use-clock-tick-A4kYSp_I.js";import{e as EL}from"./use-automations-CfL33HY2.js";import{u as rN}from"./studio-tools-9YEAucUH.js";import{u as yL}from"./useSuspenseInfiniteQuery-BypMBt7A.js";import{A as aN}from"./avatar-CJo_O7ud.js";import{t as fo}from"./ChevronDown-B14qTkyv.js";import{n as eg}from"./ChevronUp-IZz2eGQ-.js";import{t as TL,a as iN,n as Eb}from"./Tool02-WLcNYFEm.js";import{t as bl}from"./Stars01-BeJY7M9x.js";import{i as sN,b as Is}from"./XCircle-BWEvFrPt.js";import{i as fs}from"./Check-B3WXWYSz.js";import{a as El}from"./Copy01-sqwxFb53.js";import{b as Ar,t as yb,c as FE}from"./format-time-BnbuEtat.js";import{u as oN}from"./use-copy-_y6zwPE1.js";import{T as Zr,a as Qr,c as Jr}from"./tooltip-Cj4mvkkR.js";import{b as lN,a as SL,c as xL,d as kL,e as uN,g as vL,f as AL}from"./dialog-BS0vrn2L.js";import{n as Tb}from"./Download01-8o7f8ha3.js";import{u as _L}from"./use-mobile-Caz6aOTC.js";import{j as NL,f as CL,q as wL,s as IL}from"./tab-id-BEc2tty8.js";import{d as RL,b as OL,r as LL,e as DL}from"./hooks-CybMa7sq.js";import{k as Ka,D as ML,b as Sb,c as cN,a as PL}from"./chat-context-B5XcYK7Q.js";import{c as FL}from"./monaco-editor-CN0WiJ4m.js";import{g as dN,M as BL}from"./types-CAX3bqHp.js";import{i as pN}from"./AlertCircle-BrgoLEQ0.js";import{s as UL}from"./Eye-B2eaOo-B.js";import{s as jL}from"./XClose-Dxm1AFZT.js";import{c as HL,b as $L,a as Rs}from"./Tool01-3U4lZ0ql.js";import{i as zL}from"./Share07-DMD6arE7.js";import{i as Ai}from"./Monitor01-BDodWDfh.js";import{i as qL}from"./SearchMd-DaUX4bqr.js";import{i as GL}from"./Upload01-B89gb6cs.js";import{u as WL,a as VL}from"./shell-layout-CtVK6QP7.js";import{n as fN}from"./LinkExternal01-DL7sD62z.js";import{I as wr}from"./integration-icon-D-qP5ZLw.js";import{i as YL}from"./ArrowUpRight-Rz1YqMGK.js";import{a as xb}from"./Users03-CrEwye6I.js";import{a as Rn}from"./Palette-CqQ0uw84.js";import{c as hN}from"./use-navigate-to-agent-xz8e6g3j.js";import{a as KL}from"./Stars02-BxQmMBsd.js";import{g as XL}from"./chart-C4uJp2sq.js";import{F as ZL,d as QL,a as JL,e as eD,b as tD,c as nD}from"./form-DMJ-qg4h.js";import{I as rD}from"./input-C7yzxoyt.js";import{S as aD}from"./spinner-CpJFHR4J.js";import{i as iD}from"./Globe01-Dzsrjekj.js";import{F as sD}from"./file-type-icon-B0DZabiD.js";const oD={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 mN(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(oD)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function gN(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function bN(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+mN(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function kb(t){const e=Math.max(t.inputTokens,t.cacheReadTokens+t.cacheWriteTokens);return e>0?t.cacheReadTokens/e:0}function Use(t){return t.reduce((e,n)=>bN(e,n.metadata?.usage),gN())}const lD={damping:.7,stiffness:.05,mass:1.25},uD=70,cD=1e3/60,dD=350;let yl=!1;globalThis.document?.addEventListener("mousedown",()=>{yl=!0});globalThis.document?.addEventListener("mouseup",()=>{yl=!1});globalThis.document?.addEventListener("click",()=>{yl=!1});const pD=(t={})=>{const[e,n]=U.useState(!1),[r,a]=U.useState(t.initial!==!1),[i,s]=U.useState(!1),o=U.useRef(null);o.current=t;const l=U.useCallback(()=>{if(!yl)return!1;const T=window.getSelection();if(!T||!T.rangeCount)return!1;const x=T.getRangeAt(0);return x.commonAncestorContainer.contains(b.current)||b.current?.contains(x.commonAncestorContainer)},[]),u=U.useCallback(T=>{d.isAtBottom=T,a(T)},[]),c=U.useCallback(T=>{d.escapedFromLock=T,n(T)},[]),d=U.useMemo(()=>{let T;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return b.current?.scrollTop??0},set scrollTop(x){if(b.current){const{scrollBehavior:k}=getComputedStyle(b.current);k!=="auto"&&(b.current.style.scrollBehavior="auto"),b.current.scrollTop=x,d.ignoreScrollToTop=b.current.scrollTop,k!=="auto"&&(b.current.style.scrollBehavior=k)}},get targetScrollTop(){return!b.current||!y.current?0:b.current.scrollHeight-1-b.current.clientHeight},get calculatedTargetScrollTop(){if(!b.current||!y.current)return 0;const{targetScrollTop:x}=this;if(!t.targetScrollTop)return x;if(T?.targetScrollTop===x)return T.calculatedScrollTop;const k=Math.max(Math.min(t.targetScrollTop(x,{scrollElement:b.current,contentElement:y.current}),x),0);return T={targetScrollTop:x,calculatedScrollTop:k},requestAnimationFrame(()=>{T=void 0}),k},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=uD}}},[]),p=U.useCallback((T={})=>{typeof T=="string"&&(T={animation:T}),T.preserveScrollPosition||u(!0);const x=Date.now()+(Number(T.wait)||0),k=uu(o.current,T.animation),{ignoreEscapes:A=!1}=T;let S,v=d.calculatedTargetScrollTop;T.duration instanceof Promise?T.duration.finally(()=>{S=Date.now()}):S=x+(T.duration??0);const N=async()=>{const _=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:C}=d,L=performance.now(),P=(L-(d.lastTick??L))/cD;if(d.animation||(d.animation={behavior:k,promise:_,ignoreEscapes:A}),d.animation.behavior===k&&(d.lastTick=L),l()||x>Date.now())return N();if(C<Math.min(v,d.calculatedTargetScrollTop)){if(d.animation?.behavior===k){if(k==="instant")return d.scrollTop=d.calculatedTargetScrollTop,N();d.velocity=(k.damping*d.velocity+k.stiffness*d.scrollDifference)/k.mass,d.accumulated+=d.velocity*P,d.scrollTop+=d.accumulated,d.scrollTop!==C&&(d.accumulated=0)}return N()}return S>Date.now()?(v=d.calculatedTargetScrollTop,N()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?p({animation:uu(o.current,o.current.resize),ignoreEscapes:A,duration:Math.max(0,S-Date.now())||void 0}):d.isAtBottom)});return _.then(C=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),C))};return T.wait!==!0&&(d.animation=void 0),d.animation?.behavior===k?d.animation.promise:N()},[u,l,d]),f=U.useCallback(()=>{c(!0),u(!1)},[c,u]),h=U.useCallback(({target:T})=>{if(T!==b.current)return;const{scrollTop:x,ignoreScrollToTop:k}=d;let{lastScrollTop:A=x}=d;d.lastScrollTop=x,d.ignoreScrollToTop=void 0,k&&k>x&&(A=k),s(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||x===k)return;if(l()){c(!0),u(!1);return}const S=x>A,v=x<A;if(d.animation?.ignoreEscapes){d.scrollTop=A;return}v&&(c(!0),u(!1)),S&&c(!1),!d.escapedFromLock&&d.isNearBottom&&u(!0)},1)},[c,u,l,d]),g=U.useCallback(({target:T,deltaY:x})=>{let k=T;for(;!["scroll","auto"].includes(getComputedStyle(k).overflow);){if(!k.parentElement)return;k=k.parentElement}k===b.current&&x<0&&b.current.scrollHeight>b.current.clientHeight&&!d.animation?.ignoreEscapes&&(c(!0),u(!1))},[c,u,d]),b=BE(T=>{b.current?.removeEventListener("scroll",h),b.current?.removeEventListener("wheel",g),T?.addEventListener("scroll",h,{passive:!0}),T?.addEventListener("wheel",g,{passive:!0})},[]),y=BE(T=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!T)return;let x;d.resizeObserver=new ResizeObserver(([k])=>{const{height:A}=k.contentRect,S=A-(x??A);if(d.resizeDifference=S,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),s(d.isNearBottom),S>=0){const v=uu(o.current,x?o.current.resize:o.current.initial);p({animation:v,wait:!0,preserveScrollPosition:!0,duration:v==="instant"?void 0:dD})}else d.isNearBottom&&(c(!1),u(!0));x=A,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===S&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(T)},[]);return{contentRef:y,scrollRef:b,scrollToBottom:p,stopScroll:f,isAtBottom:r||i,isNearBottom:i,escapedFromLock:e,state:d}};function BE(t,e){const n=U.useCallback(r=>(n.current=r,t(r)),e);return n}const lu=new Map;function uu(...t){const e={...lD};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 lu.has(r)||lu.set(r,Object.freeze(e)),n?"instant":lu.get(r)}function fD(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 vb(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Ab(t,e){if(!e)return t;const n=`${fD(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function hD(t,e){return Ab(t,e).replace(/[_-]/g," ").toLowerCase()}function mD(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?DE().min(1,e):DE();return LO(n)}function gD(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function bD(t){const e=W.c(74),{prompt:n,setPrompt:r,onSubmit:a,defaultValues:i}=t,s=U.useId(),o=fe();let l,u;if(e[0]!==n||e[1]!==o){const w=mD(n,o("chat.dialogPromptArguments.required"));u=DO,l=OO(w),e[0]=n,e[1]=o,e[2]=l,e[3]=u}else l=e[2],u=e[3];let c;e[4]!==i||e[5]!==n?(c=n?gD(n,i):{},e[4]=i,e[5]=n,e[6]=c):c=e[6];let d;e[7]!==l||e[8]!==c?(d={resolver:l,defaultValues:c,mode:"onChange"},e[7]=l,e[8]=c,e[9]=d):d=e[9];const p=u(d);let f;e[10]!==n?.arguments?(f=n?.arguments??[],e[10]=n?.arguments,e[11]=f):f=e[11];const h=f;let g;e[12]!==p||e[13]!==a||e[14]!==r?(g=async w=>{await a(w),r(null),p.reset()},e[12]=p,e[13]=a,e[14]=r,e[15]=g):g=e[15];const b=g;let y;e[16]!==p||e[17]!==r?(y=w=>{w||(p.reset(),r(null))},e[16]=p,e[17]=r,e[18]=y):y=e[18];const T=y;if(!n)return null;let x;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(x=n.title||hD(n.name,vb(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=x):x=e[22];let k;e[23]!==x?(k=m.jsx(lN,{children:m.jsx("span",{className:"capitalize",children:x})}),e[23]=x,e[24]=k):k=e[24];let A;e[25]!==n.description?(A=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=A):A=e[26];let S;e[27]!==A||e[28]!==k?(S=m.jsxs(SL,{children:[k,A]}),e[27]=A,e[28]=k,e[29]=S):S=e[29];let v;e[30]!==p||e[31]!==b?(v=w=>{w.stopPropagation(),p.handleSubmit(b)(w)},e[30]=p,e[31]=b,e[32]=v):v=e[32];let N;if(e[33]!==h||e[34]!==p.control||e[35]!==p.formState.isSubmitting||e[36]!==o){let w;e[38]!==p.control||e[39]!==p.formState.isSubmitting||e[40]!==o?(w=V=>m.jsx(QL,{control:p.control,name:V.name,render:ee=>{const{field:R}=ee;return m.jsxs(JL,{children:[m.jsxs(eD,{className:"text-xs",children:[V.name,V.required?null:m.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",o("chat.dialogPromptArguments.optional")]})]}),m.jsx(tD,{children:m.jsx(rD,{...R,value:R.value??"",required:V.required,placeholder:V.description??"",className:"h-9",disabled:p.formState.isSubmitting})}),m.jsx(nD,{})]})}},V.name),e[38]=p.control,e[39]=p.formState.isSubmitting,e[40]=o,e[41]=w):w=e[41],N=h.map(w),e[33]=h,e[34]=p.control,e[35]=p.formState.isSubmitting,e[36]=o,e[37]=N}else N=e[37];let _;e[42]!==T?(_=()=>T(!1),e[42]=T,e[43]=_):_=e[43];const C=p.formState.isSubmitting;let L;e[44]!==o?(L=o("chat.dialogPromptArguments.cancel"),e[44]=o,e[45]=L):L=e[45];let P;e[46]!==p.formState.isSubmitting||e[47]!==_||e[48]!==L?(P=m.jsx(nr,{type:"button",variant:"ghost",onClick:_,disabled:C,children:L}),e[46]=p.formState.isSubmitting,e[47]=_,e[48]=L,e[49]=P):P=e[49];let $;e[50]!==p.formState.isSubmitting||e[51]!==o?($=p.formState.isSubmitting?m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(aD,{size:"xs"}),o("chat.dialogPromptArguments.loading")]}):o("chat.dialogPromptArguments.usePrompt"),e[50]=p.formState.isSubmitting,e[51]=o,e[52]=$):$=e[52];let F;e[53]!==p.formState.isSubmitting||e[54]!==s||e[55]!==$?(F=m.jsx(nr,{type:"submit",form:s,disabled:p.formState.isSubmitting,children:$}),e[53]=p.formState.isSubmitting,e[54]=s,e[55]=$,e[56]=F):F=e[56];let M;e[57]!==P||e[58]!==F?(M=m.jsxs(xL,{children:[P,F]}),e[57]=P,e[58]=F,e[59]=M):M=e[59];let H;e[60]!==s||e[61]!==v||e[62]!==N||e[63]!==M?(H=m.jsxs("form",{id:s,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[N,M]}),e[60]=s,e[61]=v,e[62]=N,e[63]=M,e[64]=H):H=e[64];let j;e[65]!==p||e[66]!==H?(j=m.jsx(ZL,{...p,children:H}),e[65]=p,e[66]=H,e[67]=j):j=e[67];let B;e[68]!==S||e[69]!==j?(B=m.jsxs(kL,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[S,j]}),e[68]=S,e[69]=j,e[70]=B):B=e[70];let Y;return e[71]!==T||e[72]!==B?(Y=m.jsx(uN,{open:!0,onOpenChange:T,children:B}),e[71]=T,e[72]=B,e[73]=Y):Y=e[73],Y}function tg(t){return t?t.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function Sn(t,e){return t==="output-error"||t==="output-denied"?"error":t==="approval-requested"?"approval":t==="input-streaming"||t==="input-available"||t==="output-available"&&e===!0?"loading":"idle"}function Xa(t){if(t==null||typeof t!="object")return;const e=t;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const n=e.content[0];if(n?.type==="text"&&typeof n.text=="string")try{return JSON.parse(n.text)}catch{return}return}return t}function ht(t){this.content=t}ht.prototype={constructor:ht,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,a=r.find(t),i=r.content.slice();return a==-1?i.push(n||t,e):(i[a+1]=e,n&&(i[a]=n)),new ht(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ht(n)},addToStart:function(t,e){return new ht([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ht(n)},addBefore:function(t,e,n){var r=this.remove(e),a=r.content.slice(),i=r.find(t);return a.splice(i==-1?a.length:i,0,e,n),new ht(a)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=ht.from(t),t.size?new ht(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ht.from(t),t.size?new ht(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ht.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};ht.from=function(t){if(t instanceof ht)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ht(e)};function EN(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let a=t.child(r),i=e.child(r);if(a==i){n+=a.nodeSize;continue}if(!a.sameMarkup(i))return n;if(a.isText&&a.text!=i.text){for(let s=0;a.text[s]==i.text[s];s++)n++;return n}if(a.content.size||i.content.size){let s=EN(a.content,i.content,n+1);if(s!=null)return s}n+=a.nodeSize}}function yN(t,e,n,r){for(let a=t.childCount,i=e.childCount;;){if(a==0||i==0)return a==i?null:{a:n,b:r};let s=t.child(--a),o=e.child(--i),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let u=0,c=Math.min(s.text.length,o.text.length);for(;u<c&&s.text[s.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let u=yN(s.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class X{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,a=0,i){for(let s=0,o=0;o<n;s++){let l=this.content[s],u=o+l.nodeSize;if(u>e&&r(l,a+o,i||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,a+c)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,a){let i="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?a?typeof a=="function"?a(o):a:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(s?s=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,a=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(a[a.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)a.push(e.content[i]);return new X(a,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],a=0;if(n>e)for(let i=0,s=0;s<n;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),a+=o.nodeSize),s=l}return new X(r,a)}cutByIndex(e,n){return e==n?X.empty:e==0&&n==this.content.length?this:new X(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let a=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return a[e]=n,new X(a,i)}addToStart(e){return new X([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new X(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let a=this.content[n];e(a,r,n),r+=a.nodeSize}}findDiffStart(e,n=0){return EN(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return yN(this,e,n,r)}findIndex(e){if(e==0)return Os(0,e);if(e==this.size)return Os(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let a=this.child(n),i=r+a.nodeSize;if(i>=e)return i==e?Os(n+1,i):Os(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return X.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new X(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return X.empty;let n,r=0;for(let a=0;a<e.length;a++){let i=e[a];r+=i.nodeSize,a&&i.isText&&e[a-1].sameMarkup(i)?(n||(n=e.slice(0,a)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new X(n||e,r)}static from(e){if(!e)return X.empty;if(e instanceof X)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new X([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}X.empty=new X([],0);const cu={index:0,offset:0};function Os(t,e){return cu.index=t,cu.offset=e,cu}function ho(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ho(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ho(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $e=class ng{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let a=0;a<e.length;a++){let i=e[a];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,a));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,a)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ho(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let a=r.create(n.attrs);return r.checkAttrs(a.attrs),a}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ng.none;if(e instanceof ng)return[e];let n=e.slice();return n.sort((r,a)=>r.type.rank-a.type.rank),n}};$e.none=[];class mo extends Error{}class ae{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=SN(this.content,e+this.openStart,n);return r&&new ae(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ae(TN(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return ae.empty;let r=n.openStart||0,a=n.openEnd||0;if(typeof r!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(X.fromJSON(e,n.content),r,a)}static maxOpen(e,n=!0){let r=0,a=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)a++;return new ae(e,r,a)}}ae.empty=new ae(X.empty,0,0);function TN(t,e,n){let{index:r,offset:a}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(a==e||i.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(TN(i.content,e-a-1,n-a-1)))}function SN(t,e,n,r){let{index:a,offset:i}=t.findIndex(e),s=t.maybeChild(a);if(i==e||s.isText)return r&&!r.canReplace(a,a,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=SN(s.content,e-i-1,n,s);return o&&t.replaceChild(a,s.copy(o))}function ED(t,e,n){if(n.openStart>t.depth)throw new mo("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new mo("Inconsistent open depths");return xN(t,e,n,0)}function xN(t,e,n,r){let a=t.index(r),i=t.node(r);if(a==e.index(r)&&r<t.depth-n.openStart){let s=xN(t,e,n,r+1);return i.copy(i.content.replaceChild(a,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return Wr(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=yD(n,t);return Wr(i,vN(t,s,o,e,r))}else return Wr(i,go(t,e,r))}function kN(t,e){if(!e.type.compatibleContent(t.type))throw new mo("Cannot join "+e.type.name+" onto "+t.type.name)}function rg(t,e,n){let r=t.node(n);return kN(r,e.node(n)),r}function Gr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _i(t,e,n,r){let a=(e||t).node(n),i=0,s=e?e.index(n):a.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Gr(t.nodeAfter,r),i++));for(let o=i;o<s;o++)Gr(a.child(o),r);e&&e.depth==n&&e.textOffset&&Gr(e.nodeBefore,r)}function Wr(t,e){return t.type.checkContent(e),t.copy(e)}function vN(t,e,n,r,a){let i=t.depth>a&&rg(t,e,a+1),s=r.depth>a&&rg(n,r,a+1),o=[];return _i(null,t,a,o),i&&s&&e.index(a)==n.index(a)?(kN(i,s),Gr(Wr(i,vN(t,e,n,r,a+1)),o)):(i&&Gr(Wr(i,go(t,e,a+1)),o),_i(e,n,a,o),s&&Gr(Wr(s,go(n,r,a+1)),o)),_i(r,null,a,o),new X(o)}function go(t,e,n){let r=[];if(_i(null,t,n,r),t.depth>n){let a=rg(t,e,n+1);Gr(Wr(a,go(t,e,n+1)),r)}return _i(e,null,n,r),new X(r)}function yD(t,e){let n=e.depth-t.openStart,a=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)a=e.node(i).copy(X.from(a));return{start:a.resolveNoCache(t.openStart+n),end:a.resolveNoCache(a.content.size-t.openEnd-n)}}class Wi{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],a=e.child(n);return r?e.child(n).cut(r):a}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],a=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)a+=r.child(i).nodeSize;return a}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),a=e.maybeChild(n);if(!r){let o=r;r=a,a=o}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!a||!i[s].isInSet(a.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,a=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!a||!r[i].isInSet(a.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new bo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],a=0,i=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(i),u=i-l;if(r.push(s,o,a+l),!u||(s=s.child(o),s.isText))break;i=u-1,a+=l+1}return new Wi(n,r,i)}static resolveCached(e,n){let r=UE.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else UE.set(e,r=new TD);let a=r.elts[r.i]=Wi.resolve(e,n);return r.i=(r.i+1)%SD,a}}class TD{constructor(){this.elts=[],this.i=0}}const SD=12,UE=new WeakMap;class bo{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const xD=Object.create(null);class bn{constructor(e,n,r,a=$e.none){this.type=e,this.attrs=n,this.marks=a,this.content=r||X.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,a=0){this.content.nodesBetween(e,n,r,a,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,a){return this.content.textBetween(e,n,r,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ho(this.attrs,n||e.defaultAttrs||xD)&&$e.sameSet(this.marks,r||$e.none)}copy(e=null){return e==this.content?this:new bn(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new bn(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ae.empty;let a=this.resolve(e),i=this.resolve(n),s=r?0:a.sharedDepth(n),o=a.start(s),u=a.node(s).content.cut(a.pos-o,i.pos-o);return new ae(u,a.depth-s,i.depth-s)}replace(e,n,r){return ED(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:a}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(a==e||n.isText)return n;e-=a+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let a=this.content.child(n-1);return{node:a,index:n-1,offset:r-a.nodeSize}}resolve(e){return Wi.resolveCached(this,e)}resolveNoCache(e){return Wi.resolve(this,e)}rangeHasMark(e,n,r){let a=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(a=!0),!a)),a}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),AN(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=X.empty,a=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,a,i),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=a;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,a){if(a&&!this.type.allowsMarks(a))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let a=X.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,a,r);return i.type.checkAttrs(i.attrs),i}}bn.prototype.text=void 0;class Eo extends bn{constructor(e,n,r,a){if(super(e,n,null,a),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):AN(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Eo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Eo(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function AN(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ea{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kD(e,n);if(r.next==null)return ea.empty;let a=_N(r);r.next&&r.err("Unexpected trailing text");let i=ID(wD(a));return RD(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let a=this;for(let i=n;a&&i<r;i++)a=a.matchType(e.child(i).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let a=[this];function i(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return X.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&a.indexOf(d)==-1){a.push(d);let p=i(d,o.concat(c));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let a=r.shift(),i=a.match;if(i.matchType(e)){let s=[];for(let o=a;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:o,next:l}=i.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!a.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:a}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let a=0;a<r.next.length;a++)e.indexOf(r.next[a].next)==-1&&n(r.next[a].next)}return n(this),e.map((r,a)=>{let i=a+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
1
+ import{r as U,c as W,b as fe,a0 as OO,j as m,B as nr,Z as DE,X as LO,$ as DO,bM as H_,bN as MO,ac as PO,au as xt,bO as FO,m as ye,bx as pb,bP as co,H as BO,d as la,f as UO,p as jO,aJ as HO,aG as Cr,aN as $O,aM as Sr,bL as ds,aK as ua,bQ as $_,aI as z_,F as Pn,o as zO,e as qO,K as dn,t as Xm,n as ps,E as q_,at as G_,bR as fb,aL as GO,bS as Ur,aQ as ME}from"./index-DLyxjIYw.js";import{e as WO}from"./select-BhNhFGIm.js";import{aT as VO,aU as YO,aM as KO,aV as XO,aW as ZO,u as QO,s as po,E as JO,aX as eL,q as Zm,an as tL,i as PE,ay as nL,k as rL,aY as aL,aR as W_,aZ as iL,a_ as V_,A as Y_,a$ as In,aG as sL,l as oL,x as lL}from"./agent-icon-5ZYno8Im.js";import{i as Qm}from"./ChevronRight-BGcGReEM.js";import{u as K_}from"./useInfiniteQuery-BTBdPVyZ.js";import{a as X_,u as uL}from"./use-connection-DmmNo1LM.js";import{n as cL,u as hb,f as dL,i as pL,a as fL,S as hL}from"./use-mcp-client-_o9o88xf.js";import{u as mL}from"./use-virtual-mcp-B0LtGhD8.js";import{C as gL}from"./card-CKXxuGX6.js";import{o as Z_,m as Q_,p as mb,q as gb}from"./sidebar-_myHCEzH.js";import{c as J_,e as eN,a as gl,d as an,b as tN,T as sn}from"./table-C5eCsrvC.js";import{E as Jm}from"./empty-state-PrJglZio.js";import{u as bb}from"./use-infinite-scroll-C1T3wjaO.js";import{a as bL}from"./use-members-BeAeYksa.js";import{u as nN,S as Ma}from"./use-clock-tick-DS1Jl_N9.js";import{e as EL}from"./use-automations-DyLBCDVI.js";import{u as rN}from"./studio-tools-ThQ_rcsF.js";import{u as yL}from"./useSuspenseInfiniteQuery-C3uzz_IX.js";import{A as aN}from"./avatar-CsESGb5P.js";import{t as fo}from"./ChevronDown-CauLatdX.js";import{n as eg}from"./ChevronUp-D_tIdiJb.js";import{t as TL,a as iN,n as Eb}from"./Tool02-CE2ZdUr1.js";import{t as bl}from"./Stars01-CCBcRCds.js";import{i as sN,b as Is}from"./XCircle-_aQH9vJz.js";import{i as fs}from"./Check-BXav60Vy.js";import{a as El}from"./Copy01-CV1JugLX.js";import{b as Ar,t as yb,c as FE}from"./format-time-BnbuEtat.js";import{u as oN}from"./use-copy-CSIcq8z_.js";import{T as Zr,a as Qr,c as Jr}from"./tooltip-B-y9isox.js";import{b as lN,a as SL,c as xL,d as kL,e as uN,g as vL,f as AL}from"./dialog-U03ZiuXk.js";import{n as Tb}from"./Download01-D3eJDAEO.js";import{u as _L}from"./use-mobile-H1cEPaVS.js";import{j as NL,f as CL,q as wL,s as IL}from"./tab-id-DM8k_HA-.js";import{d as RL,b as OL,r as LL,e as DL}from"./hooks-B2woSXLe.js";import{k as Ka,D as ML,b as Sb,c as cN,a as PL}from"./chat-context-DAVuFXb-.js";import{c as FL}from"./monaco-editor-DBmhJ8Ys.js";import{g as dN,M as BL}from"./types-D6tOWfuo.js";import{i as pN}from"./AlertCircle-DUlfht_8.js";import{s as UL}from"./Eye-BhHZY2CZ.js";import{s as jL}from"./XClose-DdNRdfWH.js";import{c as HL,b as $L,a as Rs}from"./Tool01-XzYGP86W.js";import{i as zL}from"./Share07-Caa0Im56.js";import{i as Ai}from"./Monitor01-BhLjoS2b.js";import{i as qL}from"./SearchMd-xpLLk_pA.js";import{i as GL}from"./Upload01-Bhqh3Tbq.js";import{u as WL,a as VL}from"./shell-layout-Dpz4gldn.js";import{n as fN}from"./LinkExternal01-D25gdGqj.js";import{I as wr}from"./integration-icon-BolSFCMJ.js";import{i as YL}from"./ArrowUpRight-M9WAVHfb.js";import{a as xb}from"./Users03-BNksnLQf.js";import{a as Rn}from"./Palette-aeV8tQ28.js";import{c as hN}from"./use-navigate-to-agent-BqMCqmam.js";import{a as KL}from"./Stars02-DtoiSIcu.js";import{g as XL}from"./chart-CkOpSzxv.js";import{F as ZL,d as QL,a as JL,e as eD,b as tD,c as nD}from"./form-BlkhuHf9.js";import{I as rD}from"./input-BH7zyD0i.js";import{S as aD}from"./spinner-CgvhsPnS.js";import{i as iD}from"./Globe01-DdUoMsv3.js";import{F as sD}from"./file-type-icon-DNO6EG6W.js";const oD={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 mN(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(oD)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function gN(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function bN(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+mN(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function kb(t){const e=Math.max(t.inputTokens,t.cacheReadTokens+t.cacheWriteTokens);return e>0?t.cacheReadTokens/e:0}function Use(t){return t.reduce((e,n)=>bN(e,n.metadata?.usage),gN())}const lD={damping:.7,stiffness:.05,mass:1.25},uD=70,cD=1e3/60,dD=350;let yl=!1;globalThis.document?.addEventListener("mousedown",()=>{yl=!0});globalThis.document?.addEventListener("mouseup",()=>{yl=!1});globalThis.document?.addEventListener("click",()=>{yl=!1});const pD=(t={})=>{const[e,n]=U.useState(!1),[r,a]=U.useState(t.initial!==!1),[i,s]=U.useState(!1),o=U.useRef(null);o.current=t;const l=U.useCallback(()=>{if(!yl)return!1;const T=window.getSelection();if(!T||!T.rangeCount)return!1;const x=T.getRangeAt(0);return x.commonAncestorContainer.contains(b.current)||b.current?.contains(x.commonAncestorContainer)},[]),u=U.useCallback(T=>{d.isAtBottom=T,a(T)},[]),c=U.useCallback(T=>{d.escapedFromLock=T,n(T)},[]),d=U.useMemo(()=>{let T;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return b.current?.scrollTop??0},set scrollTop(x){if(b.current){const{scrollBehavior:k}=getComputedStyle(b.current);k!=="auto"&&(b.current.style.scrollBehavior="auto"),b.current.scrollTop=x,d.ignoreScrollToTop=b.current.scrollTop,k!=="auto"&&(b.current.style.scrollBehavior=k)}},get targetScrollTop(){return!b.current||!y.current?0:b.current.scrollHeight-1-b.current.clientHeight},get calculatedTargetScrollTop(){if(!b.current||!y.current)return 0;const{targetScrollTop:x}=this;if(!t.targetScrollTop)return x;if(T?.targetScrollTop===x)return T.calculatedScrollTop;const k=Math.max(Math.min(t.targetScrollTop(x,{scrollElement:b.current,contentElement:y.current}),x),0);return T={targetScrollTop:x,calculatedScrollTop:k},requestAnimationFrame(()=>{T=void 0}),k},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=uD}}},[]),p=U.useCallback((T={})=>{typeof T=="string"&&(T={animation:T}),T.preserveScrollPosition||u(!0);const x=Date.now()+(Number(T.wait)||0),k=uu(o.current,T.animation),{ignoreEscapes:A=!1}=T;let S,v=d.calculatedTargetScrollTop;T.duration instanceof Promise?T.duration.finally(()=>{S=Date.now()}):S=x+(T.duration??0);const N=async()=>{const _=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:C}=d,L=performance.now(),P=(L-(d.lastTick??L))/cD;if(d.animation||(d.animation={behavior:k,promise:_,ignoreEscapes:A}),d.animation.behavior===k&&(d.lastTick=L),l()||x>Date.now())return N();if(C<Math.min(v,d.calculatedTargetScrollTop)){if(d.animation?.behavior===k){if(k==="instant")return d.scrollTop=d.calculatedTargetScrollTop,N();d.velocity=(k.damping*d.velocity+k.stiffness*d.scrollDifference)/k.mass,d.accumulated+=d.velocity*P,d.scrollTop+=d.accumulated,d.scrollTop!==C&&(d.accumulated=0)}return N()}return S>Date.now()?(v=d.calculatedTargetScrollTop,N()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?p({animation:uu(o.current,o.current.resize),ignoreEscapes:A,duration:Math.max(0,S-Date.now())||void 0}):d.isAtBottom)});return _.then(C=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),C))};return T.wait!==!0&&(d.animation=void 0),d.animation?.behavior===k?d.animation.promise:N()},[u,l,d]),f=U.useCallback(()=>{c(!0),u(!1)},[c,u]),h=U.useCallback(({target:T})=>{if(T!==b.current)return;const{scrollTop:x,ignoreScrollToTop:k}=d;let{lastScrollTop:A=x}=d;d.lastScrollTop=x,d.ignoreScrollToTop=void 0,k&&k>x&&(A=k),s(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||x===k)return;if(l()){c(!0),u(!1);return}const S=x>A,v=x<A;if(d.animation?.ignoreEscapes){d.scrollTop=A;return}v&&(c(!0),u(!1)),S&&c(!1),!d.escapedFromLock&&d.isNearBottom&&u(!0)},1)},[c,u,l,d]),g=U.useCallback(({target:T,deltaY:x})=>{let k=T;for(;!["scroll","auto"].includes(getComputedStyle(k).overflow);){if(!k.parentElement)return;k=k.parentElement}k===b.current&&x<0&&b.current.scrollHeight>b.current.clientHeight&&!d.animation?.ignoreEscapes&&(c(!0),u(!1))},[c,u,d]),b=BE(T=>{b.current?.removeEventListener("scroll",h),b.current?.removeEventListener("wheel",g),T?.addEventListener("scroll",h,{passive:!0}),T?.addEventListener("wheel",g,{passive:!0})},[]),y=BE(T=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!T)return;let x;d.resizeObserver=new ResizeObserver(([k])=>{const{height:A}=k.contentRect,S=A-(x??A);if(d.resizeDifference=S,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),s(d.isNearBottom),S>=0){const v=uu(o.current,x?o.current.resize:o.current.initial);p({animation:v,wait:!0,preserveScrollPosition:!0,duration:v==="instant"?void 0:dD})}else d.isNearBottom&&(c(!1),u(!0));x=A,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===S&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(T)},[]);return{contentRef:y,scrollRef:b,scrollToBottom:p,stopScroll:f,isAtBottom:r||i,isNearBottom:i,escapedFromLock:e,state:d}};function BE(t,e){const n=U.useCallback(r=>(n.current=r,t(r)),e);return n}const lu=new Map;function uu(...t){const e={...lD};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 lu.has(r)||lu.set(r,Object.freeze(e)),n?"instant":lu.get(r)}function fD(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 vb(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Ab(t,e){if(!e)return t;const n=`${fD(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function hD(t,e){return Ab(t,e).replace(/[_-]/g," ").toLowerCase()}function mD(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?DE().min(1,e):DE();return LO(n)}function gD(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function bD(t){const e=W.c(74),{prompt:n,setPrompt:r,onSubmit:a,defaultValues:i}=t,s=U.useId(),o=fe();let l,u;if(e[0]!==n||e[1]!==o){const w=mD(n,o("chat.dialogPromptArguments.required"));u=DO,l=OO(w),e[0]=n,e[1]=o,e[2]=l,e[3]=u}else l=e[2],u=e[3];let c;e[4]!==i||e[5]!==n?(c=n?gD(n,i):{},e[4]=i,e[5]=n,e[6]=c):c=e[6];let d;e[7]!==l||e[8]!==c?(d={resolver:l,defaultValues:c,mode:"onChange"},e[7]=l,e[8]=c,e[9]=d):d=e[9];const p=u(d);let f;e[10]!==n?.arguments?(f=n?.arguments??[],e[10]=n?.arguments,e[11]=f):f=e[11];const h=f;let g;e[12]!==p||e[13]!==a||e[14]!==r?(g=async w=>{await a(w),r(null),p.reset()},e[12]=p,e[13]=a,e[14]=r,e[15]=g):g=e[15];const b=g;let y;e[16]!==p||e[17]!==r?(y=w=>{w||(p.reset(),r(null))},e[16]=p,e[17]=r,e[18]=y):y=e[18];const T=y;if(!n)return null;let x;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(x=n.title||hD(n.name,vb(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=x):x=e[22];let k;e[23]!==x?(k=m.jsx(lN,{children:m.jsx("span",{className:"capitalize",children:x})}),e[23]=x,e[24]=k):k=e[24];let A;e[25]!==n.description?(A=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=A):A=e[26];let S;e[27]!==A||e[28]!==k?(S=m.jsxs(SL,{children:[k,A]}),e[27]=A,e[28]=k,e[29]=S):S=e[29];let v;e[30]!==p||e[31]!==b?(v=w=>{w.stopPropagation(),p.handleSubmit(b)(w)},e[30]=p,e[31]=b,e[32]=v):v=e[32];let N;if(e[33]!==h||e[34]!==p.control||e[35]!==p.formState.isSubmitting||e[36]!==o){let w;e[38]!==p.control||e[39]!==p.formState.isSubmitting||e[40]!==o?(w=V=>m.jsx(QL,{control:p.control,name:V.name,render:ee=>{const{field:R}=ee;return m.jsxs(JL,{children:[m.jsxs(eD,{className:"text-xs",children:[V.name,V.required?null:m.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",o("chat.dialogPromptArguments.optional")]})]}),m.jsx(tD,{children:m.jsx(rD,{...R,value:R.value??"",required:V.required,placeholder:V.description??"",className:"h-9",disabled:p.formState.isSubmitting})}),m.jsx(nD,{})]})}},V.name),e[38]=p.control,e[39]=p.formState.isSubmitting,e[40]=o,e[41]=w):w=e[41],N=h.map(w),e[33]=h,e[34]=p.control,e[35]=p.formState.isSubmitting,e[36]=o,e[37]=N}else N=e[37];let _;e[42]!==T?(_=()=>T(!1),e[42]=T,e[43]=_):_=e[43];const C=p.formState.isSubmitting;let L;e[44]!==o?(L=o("chat.dialogPromptArguments.cancel"),e[44]=o,e[45]=L):L=e[45];let P;e[46]!==p.formState.isSubmitting||e[47]!==_||e[48]!==L?(P=m.jsx(nr,{type:"button",variant:"ghost",onClick:_,disabled:C,children:L}),e[46]=p.formState.isSubmitting,e[47]=_,e[48]=L,e[49]=P):P=e[49];let $;e[50]!==p.formState.isSubmitting||e[51]!==o?($=p.formState.isSubmitting?m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(aD,{size:"xs"}),o("chat.dialogPromptArguments.loading")]}):o("chat.dialogPromptArguments.usePrompt"),e[50]=p.formState.isSubmitting,e[51]=o,e[52]=$):$=e[52];let F;e[53]!==p.formState.isSubmitting||e[54]!==s||e[55]!==$?(F=m.jsx(nr,{type:"submit",form:s,disabled:p.formState.isSubmitting,children:$}),e[53]=p.formState.isSubmitting,e[54]=s,e[55]=$,e[56]=F):F=e[56];let M;e[57]!==P||e[58]!==F?(M=m.jsxs(xL,{children:[P,F]}),e[57]=P,e[58]=F,e[59]=M):M=e[59];let H;e[60]!==s||e[61]!==v||e[62]!==N||e[63]!==M?(H=m.jsxs("form",{id:s,className:"space-y-4 py-4",autoComplete:"off",onSubmit:v,children:[N,M]}),e[60]=s,e[61]=v,e[62]=N,e[63]=M,e[64]=H):H=e[64];let j;e[65]!==p||e[66]!==H?(j=m.jsx(ZL,{...p,children:H}),e[65]=p,e[66]=H,e[67]=j):j=e[67];let B;e[68]!==S||e[69]!==j?(B=m.jsxs(kL,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[S,j]}),e[68]=S,e[69]=j,e[70]=B):B=e[70];let Y;return e[71]!==T||e[72]!==B?(Y=m.jsx(uN,{open:!0,onOpenChange:T,children:B}),e[71]=T,e[72]=B,e[73]=Y):Y=e[73],Y}function tg(t){return t?t.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function Sn(t,e){return t==="output-error"||t==="output-denied"?"error":t==="approval-requested"?"approval":t==="input-streaming"||t==="input-available"||t==="output-available"&&e===!0?"loading":"idle"}function Xa(t){if(t==null||typeof t!="object")return;const e=t;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const n=e.content[0];if(n?.type==="text"&&typeof n.text=="string")try{return JSON.parse(n.text)}catch{return}return}return t}function ht(t){this.content=t}ht.prototype={constructor:ht,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,a=r.find(t),i=r.content.slice();return a==-1?i.push(n||t,e):(i[a+1]=e,n&&(i[a]=n)),new ht(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ht(n)},addToStart:function(t,e){return new ht([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ht(n)},addBefore:function(t,e,n){var r=this.remove(e),a=r.content.slice(),i=r.find(t);return a.splice(i==-1?a.length:i,0,e,n),new ht(a)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=ht.from(t),t.size?new ht(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ht.from(t),t.size?new ht(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ht.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};ht.from=function(t){if(t instanceof ht)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ht(e)};function EN(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let a=t.child(r),i=e.child(r);if(a==i){n+=a.nodeSize;continue}if(!a.sameMarkup(i))return n;if(a.isText&&a.text!=i.text){for(let s=0;a.text[s]==i.text[s];s++)n++;return n}if(a.content.size||i.content.size){let s=EN(a.content,i.content,n+1);if(s!=null)return s}n+=a.nodeSize}}function yN(t,e,n,r){for(let a=t.childCount,i=e.childCount;;){if(a==0||i==0)return a==i?null:{a:n,b:r};let s=t.child(--a),o=e.child(--i),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let u=0,c=Math.min(s.text.length,o.text.length);for(;u<c&&s.text[s.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let u=yN(s.content,o.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class X{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,a=0,i){for(let s=0,o=0;o<n;s++){let l=this.content[s],u=o+l.nodeSize;if(u>e&&r(l,a+o,i||null,s)!==!1&&l.content.size){let c=o+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,n-c),r,a+c)}o=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,a){let i="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let u=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?a?typeof a=="function"?a(o):a:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(s?s=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,a=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(a[a.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)a.push(e.content[i]);return new X(a,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],a=0;if(n>e)for(let i=0,s=0;s<n;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),a+=o.nodeSize),s=l}return new X(r,a)}cutByIndex(e,n){return e==n?X.empty:e==0&&n==this.content.length?this:new X(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let a=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return a[e]=n,new X(a,i)}addToStart(e){return new X([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new X(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let a=this.content[n];e(a,r,n),r+=a.nodeSize}}findDiffStart(e,n=0){return EN(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return yN(this,e,n,r)}findIndex(e){if(e==0)return Os(0,e);if(e==this.size)return Os(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let a=this.child(n),i=r+a.nodeSize;if(i>=e)return i==e?Os(n+1,i):Os(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return X.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new X(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return X.empty;let n,r=0;for(let a=0;a<e.length;a++){let i=e[a];r+=i.nodeSize,a&&i.isText&&e[a-1].sameMarkup(i)?(n||(n=e.slice(0,a)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new X(n||e,r)}static from(e){if(!e)return X.empty;if(e instanceof X)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new X([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}X.empty=new X([],0);const cu={index:0,offset:0};function Os(t,e){return cu.index=t,cu.offset=e,cu}function ho(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ho(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ho(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $e=class ng{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let a=0;a<e.length;a++){let i=e[a];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,a));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,a)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ho(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let a=r.create(n.attrs);return r.checkAttrs(a.attrs),a}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ng.none;if(e instanceof ng)return[e];let n=e.slice();return n.sort((r,a)=>r.type.rank-a.type.rank),n}};$e.none=[];class mo extends Error{}class ae{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=SN(this.content,e+this.openStart,n);return r&&new ae(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ae(TN(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return ae.empty;let r=n.openStart||0,a=n.openEnd||0;if(typeof r!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(X.fromJSON(e,n.content),r,a)}static maxOpen(e,n=!0){let r=0,a=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)a++;return new ae(e,r,a)}}ae.empty=new ae(X.empty,0,0);function TN(t,e,n){let{index:r,offset:a}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(a==e||i.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(TN(i.content,e-a-1,n-a-1)))}function SN(t,e,n,r){let{index:a,offset:i}=t.findIndex(e),s=t.maybeChild(a);if(i==e||s.isText)return r&&!r.canReplace(a,a,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=SN(s.content,e-i-1,n,s);return o&&t.replaceChild(a,s.copy(o))}function ED(t,e,n){if(n.openStart>t.depth)throw new mo("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new mo("Inconsistent open depths");return xN(t,e,n,0)}function xN(t,e,n,r){let a=t.index(r),i=t.node(r);if(a==e.index(r)&&r<t.depth-n.openStart){let s=xN(t,e,n,r+1);return i.copy(i.content.replaceChild(a,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return Wr(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=yD(n,t);return Wr(i,vN(t,s,o,e,r))}else return Wr(i,go(t,e,r))}function kN(t,e){if(!e.type.compatibleContent(t.type))throw new mo("Cannot join "+e.type.name+" onto "+t.type.name)}function rg(t,e,n){let r=t.node(n);return kN(r,e.node(n)),r}function Gr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _i(t,e,n,r){let a=(e||t).node(n),i=0,s=e?e.index(n):a.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Gr(t.nodeAfter,r),i++));for(let o=i;o<s;o++)Gr(a.child(o),r);e&&e.depth==n&&e.textOffset&&Gr(e.nodeBefore,r)}function Wr(t,e){return t.type.checkContent(e),t.copy(e)}function vN(t,e,n,r,a){let i=t.depth>a&&rg(t,e,a+1),s=r.depth>a&&rg(n,r,a+1),o=[];return _i(null,t,a,o),i&&s&&e.index(a)==n.index(a)?(kN(i,s),Gr(Wr(i,vN(t,e,n,r,a+1)),o)):(i&&Gr(Wr(i,go(t,e,a+1)),o),_i(e,n,a,o),s&&Gr(Wr(s,go(n,r,a+1)),o)),_i(r,null,a,o),new X(o)}function go(t,e,n){let r=[];if(_i(null,t,n,r),t.depth>n){let a=rg(t,e,n+1);Gr(Wr(a,go(t,e,n+1)),r)}return _i(e,null,n,r),new X(r)}function yD(t,e){let n=e.depth-t.openStart,a=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)a=e.node(i).copy(X.from(a));return{start:a.resolveNoCache(t.openStart+n),end:a.resolveNoCache(a.content.size-t.openEnd-n)}}class Wi{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],a=e.child(n);return r?e.child(n).cut(r):a}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],a=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)a+=r.child(i).nodeSize;return a}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),a=e.maybeChild(n);if(!r){let o=r;r=a,a=o}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!a||!i[s].isInSet(a.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,a=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!a||!r[i].isInSet(a.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new bo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],a=0,i=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(i),u=i-l;if(r.push(s,o,a+l),!u||(s=s.child(o),s.isText))break;i=u-1,a+=l+1}return new Wi(n,r,i)}static resolveCached(e,n){let r=UE.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else UE.set(e,r=new TD);let a=r.elts[r.i]=Wi.resolve(e,n);return r.i=(r.i+1)%SD,a}}class TD{constructor(){this.elts=[],this.i=0}}const SD=12,UE=new WeakMap;class bo{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const xD=Object.create(null);class bn{constructor(e,n,r,a=$e.none){this.type=e,this.attrs=n,this.marks=a,this.content=r||X.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,a=0){this.content.nodesBetween(e,n,r,a,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,a){return this.content.textBetween(e,n,r,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ho(this.attrs,n||e.defaultAttrs||xD)&&$e.sameSet(this.marks,r||$e.none)}copy(e=null){return e==this.content?this:new bn(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new bn(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ae.empty;let a=this.resolve(e),i=this.resolve(n),s=r?0:a.sharedDepth(n),o=a.start(s),u=a.node(s).content.cut(a.pos-o,i.pos-o);return new ae(u,a.depth-s,i.depth-s)}replace(e,n,r){return ED(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:a}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(a==e||n.isText)return n;e-=a+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let a=this.content.child(n-1);return{node:a,index:n-1,offset:r-a.nodeSize}}resolve(e){return Wi.resolveCached(this,e)}resolveNoCache(e){return Wi.resolve(this,e)}rangeHasMark(e,n,r){let a=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(a=!0),!a)),a}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),AN(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=X.empty,a=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,a,i),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=a;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,a){if(a&&!this.type.allowsMarks(a))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let a=X.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,a,r);return i.type.checkAttrs(i.attrs),i}}bn.prototype.text=void 0;class Eo extends bn{constructor(e,n,r,a){if(super(e,n,null,a),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):AN(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Eo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Eo(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function AN(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ea{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new kD(e,n);if(r.next==null)return ea.empty;let a=_N(r);r.next&&r.err("Unexpected trailing text");let i=ID(wD(a));return RD(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let a=this;for(let i=n;a&&i<r;i++)a=a.matchType(e.child(i).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let a=[this];function i(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return X.from(o.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&a.indexOf(d)==-1){a.push(d);let p=i(d,o.concat(c));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let a=r.shift(),i=a.match;if(i.matchType(e)){let s=[];for(let o=a;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:o,next:l}=i.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!a.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:a}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let a=0;a<r.next.length;a++)e.indexOf(r.next[a].next)==-1&&n(r.next[a].next)}return n(this),e.map((r,a)=>{let i=a+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
2
2
  `)}}ea.empty=new ea(!0);class kD{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function _N(t){let e=[];do e.push(vD(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function vD(t){let e=[];do e.push(AD(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function AD(t){let e=CD(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=_D(t,e);else break;return e}function jE(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function _D(t,e){let n=jE(t),r=n;return t.eat(",")&&(t.next!="}"?r=jE(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function ND(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let a=[];for(let i in n){let s=n[i];s.isInGroup(e)&&a.push(s)}return a.length==0&&t.err("No node type or group '"+e+"' found"),a}function CD(t){if(t.eat("(")){let e=_N(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=ND(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function wD(t){let e=[[]];return a(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,o,l){let u={term:l,to:o};return e[s].push(u),u}function a(s,o){s.forEach(l=>l.to=o)}function i(s,o){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(i(u,o)),[]);if(s.type=="seq")for(let l=0;;l++){let u=i(s.exprs[l],o);if(l==s.exprs.length-1)return u;a(u,o=n())}else if(s.type=="star"){let l=n();return r(o,l),a(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return a(i(s.expr,o),l),a(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(o)].concat(i(s.expr,o));if(s.type=="range"){let l=o;for(let u=0;u<s.min;u++){let c=n();a(i(s.expr,l),c),l=c}if(s.max==-1)a(i(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let c=n();r(l,c),a(i(s.expr,l),c),l=c}return[r(l)]}else{if(s.type=="name")return[r(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function NN(t,e){return e-t}function HE(t,e){let n=[];return r(e),n.sort(NN);function r(a){let i=t[a];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(a);for(let s=0;s<i.length;s++){let{term:o,to:l}=i[s];!o&&n.indexOf(l)==-1&&r(l)}}}function ID(t){let e=Object.create(null);return n(HE(t,0));function n(r){let a=[];r.forEach(s=>{t[s].forEach(({term:o,to:l})=>{if(!o)return;let u;for(let c=0;c<a.length;c++)a[c][0]==o&&(u=a[c][1]);HE(t,l).forEach(c=>{u||a.push([o,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let i=e[r.join(",")]=new ea(r.indexOf(t.length-1)>-1);for(let s=0;s<a.length;s++){let o=a[s][1].sort(NN);i.next.push({type:a[s][0],next:e[o.join(",")]||n(o)})}return i}}function RD(t,e){for(let n=0,r=[t];n<r.length;n++){let a=r[n],i=!a.validEnd,s=[];for(let o=0;o<a.next.length;o++){let{type:l,next:u}=a.next[o];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(u)==-1&&r.push(u)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function CN(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function wN(t,e){let n=Object.create(null);for(let r in t){let a=e&&e[r];if(a===void 0){let i=t[r];if(i.hasDefault)a=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=a}return n}function IN(t,e,n,r){for(let a in e)if(!(a in t))throw new RangeError(`Unsupported attribute ${a} for ${n} of type ${a}`);for(let a in t){let i=t[a];i.validate&&i.validate(e[a])}}function RN(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new LD(t,r,e[r]);return n}let $E=class ON{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=RN(e,r.attrs),this.defaultAttrs=CN(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ea.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:wN(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new bn(this,this.computeAttrs(e),X.from(n),$e.setFrom(r))}createChecked(e=null,n,r){return n=X.from(n),this.checkContent(n),new bn(this,this.computeAttrs(e),n,$e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=X.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let a=this.contentMatch.matchFragment(n),i=a&&a.fillBefore(X.empty,!0);return i?new bn(this,e,n.append(i),$e.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){IN(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:$e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new ON(i,n,s));let a=n.spec.topNode||"doc";if(!r[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function OD(t,e,n){let r=n.split("|");return a=>{let i=a===null?"null":typeof a;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class LD{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?OD(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Tl{constructor(e,n,r,a){this.name=e,this.rank=n,this.schema=r,this.spec=a,this.attrs=RN(e,a.attrs),this.excluded=null;let i=CN(this.attrs);this.instance=i?new $e(this,i):null}create(e=null){return!e&&this.instance?this.instance:new $e(this,wN(this.attrs,e))}static compile(e,n){let r=Object.create(null),a=0;return e.forEach((i,s)=>r[i]=new Tl(i,a++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){IN(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let LN=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let a in e)n[a]=e[a];n.nodes=ht.from(e.nodes),n.marks=ht.from(e.marks||{}),this.nodes=$E.compile(this.spec.nodes,this),this.marks=Tl.compile(this.spec.marks,this);let r=Object.create(null);for(let a in this.nodes){if(a in this.marks)throw new RangeError(a+" can not be both a node and a mark");let i=this.nodes[a],s=i.spec.content||"",o=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=ea.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=o=="_"?null:o?zE(this,o.split(" ")):o==""||!i.inlineContent?[]:null}for(let a in this.marks){let i=this.marks[a],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:zE(this,s.split(" "))}this.nodeFromJSON=a=>bn.fromJSON(this,a),this.markFromJSON=a=>$e.fromJSON(this,a),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,a){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof $E){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,a)}text(e,n){let r=this.nodes.text;return new Eo(r,r.defaultAttrs,e,$e.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function zE(t,e){let n=[];for(let r=0;r<e.length;r++){let a=e[r],i=t.marks[a],s=i;if(i)n.push(i);else for(let o in t.marks){let l=t.marks[o];(a=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(a)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function DD(t){return t.tag!=null}function MD(t){return t.style!=null}class Jn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(a=>{if(DD(a))this.tags.push(a);else if(MD(a)){let i=/[^=]*/.exec(a.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(a)}}),this.normalizeLists=!this.tags.some(a=>{if(!/^(ul|ol)\b/.test(a.tag)||!a.node)return!1;let i=e.nodes[a.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new GE(this,n,!1);return r.addAll(e,$e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new GE(this,n,!0);return r.addAll(e,$e.none,n.from,n.to),ae.maxOpen(r.finish())}matchTag(e,n,r){for(let a=r?this.tags.indexOf(r)+1:0;a<this.tags.length;a++){let i=this.tags[a];if(BD(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,a){for(let i=a?this.styles.indexOf(a)+1:0;i<this.styles.length;i++){let s=this.styles[i],o=s.style;if(!(o.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(a){let i=a.priority==null?50:a.priority,s=0;for(;s<n.length;s++){let o=n[s];if((o.priority==null?50:o.priority)<i)break}n.splice(s,0,a)}for(let a in e.marks){let i=e.marks[a].spec.parseDOM;i&&i.forEach(s=>{r(s=WE(s)),s.mark||s.ignore||s.clearMark||(s.mark=a)})}for(let a in e.nodes){let i=e.nodes[a].spec.parseDOM;i&&i.forEach(s=>{r(s=WE(s)),s.node||s.ignore||s.mark||(s.node=a)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Jn(e,Jn.schemaRules(e)))}}const DN={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},PD={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},MN={ol:!0,ul:!0},Vi=1,ag=2,Ni=4;function qE(t,e,n){return e!=null?(e?Vi:0)|(e==="full"?ag:0):t&&t.whitespace=="pre"?Vi|ag:n&~Ni}class Ls{constructor(e,n,r,a,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=a,this.options=s,this.content=[],this.activeMarks=$e.none,this.match=i||(s&Ni?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(X.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,a;return(a=r.findWrapping(e.type))?(this.match=r,a):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Vi)){let r=this.content[this.content.length-1],a;if(r&&r.isText&&(a=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==a[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-a[0].length))}}let n=X.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(X.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!DN.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class GE{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let a=n.topNode,i,s=qE(null,n.preserveWhitespace,0)|(r?Ni:0);a?i=new Ls(a.type,a.attrs,$e.none,!0,n.topMatch||a.type.contentMatch,s):r?i=new Ls(null,null,$e.none,!0,null,s):i=new Ls(e.schema.topNodeType,null,$e.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,a=this.top,i=a.options&ag?"full":this.localPreserveWS||(a.options&Vi)>0,{schema:s}=this.parser;if(i==="full"||a.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let l=0;l<o.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),o[l]&&this.insertNode(s.text(o[l]),n,!/\S/.test(o[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=a.content[a.content.length-1],l=e.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let a=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;MN.hasOwnProperty(s)&&this.parser.normalizeLists&&FD(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(l?l.ignore:PD.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,c=this.needsBlock;if(DN.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),u=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),u&&this.sync(i),this.needsBlock=c}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?o:void 0)}this.localPreserveWS=a}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let a=0;a<this.parser.matchedStyles.length;a++){let i=this.parser.matchedStyles[a],s=r.getPropertyValue(i);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(i,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return n}addElementByRule(e,n,r,a){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(a)this.addElement(e,r,a);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(o)&&this.open--}addAll(e,n,r,a){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,o=a==null?null:e.childNodes[a];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let a,i;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(e);if(u&&(!a||a.length>u.length+o)&&(a=u,i=l,!u.length))break;if(l.solid){if(r)break;o+=2}}if(!a)return null;this.sync(i);for(let s=0;s<a.length;s++)n=this.enterInner(a[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let a=this.findPlace(e,n,r);if(a){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=$e.none;for(let o of a.concat(e.marks))(i.type?i.type.allowsMarkType(o.type):VE(o.type,e.type))&&(s=o.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,a){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,a)),i}enterInner(e,n,r,a=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=qE(e,i,s.options);s.options&Ni&&s.content.length==0&&(o|=Ni);let l=$e.none;return r=r.filter(u=>(s.type?s.type.allowsMarkType(u.type):VE(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Ls(e,n,l,a,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Vi)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let a=r.length-1;a>=0;a--)e+=r[a].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let a=0;a<this.find.length;a++)this.find[a].pos==null&&e.nodeType==1&&e.contains(this.find[a].node)&&n.compareDocumentPosition(this.find[a].node)&(r?2:4)&&(this.find[a].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,a=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(a?0:1),s=(o,l)=>{for(;o>=0;o--){let u=n[o];if(u==""){if(o==n.length-1||o==0)continue;for(;l>=i;l--)if(s(o-1,l))return!0;return!1}else{let c=l>0||l==0&&a?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function FD(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&MN.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function BD(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function WE(t){let e={};for(let n in t)e[n]=t[n];return e}function VE(t,e){let n=e.schema.nodes;for(let r in n){let a=n[r];if(!a.allowsMarkType(t))continue;let i=[],s=o=>{i.push(o);for(let l=0;l<o.edgeCount;l++){let{type:u,next:c}=o.edge(l);if(u==e||i.indexOf(c)<0&&s(c))return!0}};if(s(a.contentMatch))return!0}}class ca{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=du(n).createDocumentFragment());let a=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let o=0,l=0;for(;o<i.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(i[o][0])||u.type.spec.spanning===!1)break;o++,l++}for(;o<i.length;)a=i.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,n);c&&(i.push([u,a]),a.appendChild(c.dom),a=c.contentDOM||c.dom)}}a.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:a}=Js(du(n),this.nodes[e.type.name](e),null,e.attrs);if(a){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,a)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let a=e.marks.length-1;a>=0;a--){let i=this.serializeMark(e.marks[a],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let a=this.marks[e.type.name];return a&&Js(du(r),a(e,n),null,e.attrs)}static renderSpec(e,n,r=null,a){return Js(e,n,r,a)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ca(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=YE(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return YE(e.marks)}}function YE(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function du(t){return t.document||window.document}const KE=new WeakMap;function UD(t){let e=KE.get(t);return e===void 0&&KE.set(t,e=jD(t)),e}function jD(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let a=0;a<r.length;a++)n(r[a]);else for(let a in r)n(r[a])}return n(t),e}function Js(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let a=e[0],i;if(typeof a!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=UD(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=a.indexOf(" ");s>0&&(n=a.slice(0,s),a=a.slice(s+1));let o,l=n?t.createElementNS(n,a):t.createElement(a),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let p=d.indexOf(" ");p>0?l.setAttributeNS(d.slice(0,p),d.slice(p+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<e.length;d++){let p=e[d];if(p===0){if(d<e.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:h}=Js(t,p,n,r);if(l.appendChild(f),h){if(o)throw new RangeError("Multiple content holes");o=h}}}return{dom:l,contentDOM:o}}const PN=65535,FN=Math.pow(2,16);function HD(t,e){return t+e*FN}function XE(t){return t&PN}function $D(t){return(t-(t&PN))/FN}const BN=1,UN=2,eo=4,jN=8;class ig{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&jN)>0}get deletedBefore(){return(this.delInfo&(BN|eo))>0}get deletedAfter(){return(this.delInfo&(UN|eo))>0}get deletedAcross(){return(this.delInfo&eo)>0}}class Xt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Xt.empty)return Xt.empty}recover(e){let n=0,r=XE(e);if(!this.inverted)for(let a=0;a<r;a++)n+=this.ranges[a*3+2]-this.ranges[a*3+1];return this.ranges[r*3]+n+$D(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let a=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?a:0);if(l>e)break;let u=this.ranges[o+i],c=this.ranges[o+s],d=l+u;if(e<=d){let p=u?e==l?-1:e==d?1:n:n,f=l+a+(p<0?0:c);if(r)return f;let h=e==(n<0?l:d)?null:HD(o/3,e-l),g=e==l?UN:e==d?BN:eo;return(n<0?e!=l:e!=d)&&(g|=jN),new ig(f,g,h)}a+=c-u}return r?e+a:new ig(e+a,0,null)}touches(e,n){let r=0,a=XE(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[o+i],c=l+u;if(e<=c&&o==a*3)return!0;r+=this.ranges[o+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let a=0,i=0;a<this.ranges.length;a+=3){let s=this.ranges[a],o=s-(this.inverted?i:0),l=s+(this.inverted?0:i),u=this.ranges[a+n],c=this.ranges[a+r];e(o,o+u,l,l+c),i+=c-u}}invert(){return new Xt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Xt.empty:new Xt(e<0?[0,-e,0]:[0,0,e])}}Xt.empty=new Xt([]);class Yi{constructor(e,n,r=0,a=e?e.length:0){this.mirror=n,this.from=r,this.to=a,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Yi(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let a=e.getMirror(n);this.appendMap(e._maps[n],a!=null&&a<n?r+a:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let a=e.getMirror(n);this.appendMap(e._maps[n].invert(),a!=null&&a>n?r-a-1:void 0)}}invert(){let e=new Yi;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let a=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],o=s.mapResult(e,n);if(o.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(o.recover);continue}}a|=o.delInfo,e=o.pos}return r?e:new ig(e,a,null)}}const pu=Object.create(null);class At{getMap(){return Xt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=pu[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in pu)throw new RangeError("Duplicate use of step JSON ID "+e);return pu[e]=n,n.prototype.jsonID=e,n}}class it{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new it(e,null)}static fail(e){return new it(null,e)}static fromReplace(e,n,r,a){try{return it.ok(e.replace(n,r,a))}catch(i){if(i instanceof mo)return it.fail(i.message);throw i}}}function _b(t,e,n){let r=[];for(let a=0;a<t.childCount;a++){let i=t.child(a);i.content.size&&(i=i.copy(_b(i.content,e,i))),i.isInline&&(i=e(i,n,a)),r.push(i)}return X.fromArray(r)}class gr extends At{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),a=r.node(r.sharedDepth(this.to)),i=new ae(_b(n.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),a),n.openStart,n.openEnd);return it.fromReplace(e,this.from,this.to,i)}invert(){return new gn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new gr(n.pos,r.pos,this.mark)}merge(e){return e instanceof gr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new gr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new gr(n.from,n.to,e.markFromJSON(n.mark))}}At.jsonID("addMark",gr);class gn extends At{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ae(_b(n.content,a=>a.mark(this.mark.removeFromSet(a.marks)),e),n.openStart,n.openEnd);return it.fromReplace(e,this.from,this.to,r)}invert(){return new gr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new gn(n.pos,r.pos,this.mark)}merge(e){return e instanceof gn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new gn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new gn(n.from,n.to,e.markFromJSON(n.mark))}}At.jsonID("removeMark",gn);class br extends At{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return it.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return it.fromReplace(e,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let a=0;a<n.marks.length;a++)if(!n.marks[a].isInSet(r))return new br(this.pos,n.marks[a]);return new br(this.pos,this.mark)}}return new ta(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new br(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new br(n.pos,e.markFromJSON(n.mark))}}At.jsonID("addNodeMark",br);class ta extends At{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return it.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return it.fromReplace(e,this.pos,this.pos+1,new ae(X.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new br(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ta(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ta(n.pos,e.markFromJSON(n.mark))}}At.jsonID("removeNodeMark",ta);class at extends At{constructor(e,n,r,a=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=a}apply(e){return this.structure&&sg(e,this.from,this.to)?it.fail("Structure replace would overwrite content"):it.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Xt([this.from,this.to-this.from,this.slice.size])}invert(e){return new at(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&at.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new at(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof at)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ae.empty:new ae(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new at(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ae.empty:new ae(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new at(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new at(n.from,n.to,ae.fromJSON(e,n.slice),!!n.structure)}}at.MAP_BIAS=1;At.jsonID("replace",at);class dt extends At{constructor(e,n,r,a,i,s,o=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=a,this.slice=i,this.insert=s,this.structure=o}apply(e){if(this.structure&&(sg(e,this.from,this.gapFrom)||sg(e,this.gapTo,this.to)))return it.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return it.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?it.fromReplace(e,this.from,this.to,r):it.fail("Content does not fit in gap")}getMap(){return new Xt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new dt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),a=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||a<n.pos||i>r.pos?null:new dt(n.pos,r.pos,a,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new dt(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(e,n.slice),n.insert,!!n.structure)}}At.jsonID("replaceAround",dt);function sg(t,e,n){let r=t.resolve(e),a=n-e,i=r.depth;for(;a>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,a--;if(a>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;a>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,a--}}return!1}function zD(t,e,n,r){let a=[],i=[],s,o;t.doc.nodesBetween(e,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let p=Math.max(u,e),f=Math.min(u+l.nodeSize,n),h=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(h)||(s&&s.to==p&&s.mark.eq(d[g])?s.to=f:a.push(s=new gn(p,f,d[g])));o&&o.to==p?o.to=f:i.push(o=new gr(p,f,r))}}),a.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function qD(t,e,n,r){let a=[],i=0;t.doc.nodesBetween(e,n,(s,o)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Tl){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(o+s.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],p;for(let f=0;f<a.length;f++){let h=a[f];h.step==i-1&&d.eq(a[f].style)&&(p=h)}p?(p.to=u,p.step=i):a.push({style:d,from:Math.max(o,e),to:u,step:i})}}}),a.forEach(s=>t.step(new gn(s.from,s.to,s.style)))}function Nb(t,e,n,r=n.contentMatch,a=!0){let i=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l<i.childCount;l++){let u=i.child(l),c=o+u.nodeSize,d=r.matchType(u.type);if(!d)s.push(new at(o,c,ae.empty));else{r=d;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||t.step(new gn(o,c,u.marks[p]));if(a&&u.isText&&n.whitespace!="pre"){let p,f=/\r?\n|\r/g,h;for(;p=f.exec(u.text);)h||(h=new ae(X.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new at(o+p.index,o+p.index+p[0].length,h))}}o=c}if(!r.validEnd){let l=r.fillBefore(X.empty,!0);t.replace(o,o,new ae(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function GD(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Za(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,a=0,i=0;;--r){let s=t.$from.node(r),o=t.$from.index(r)+a,l=t.$to.indexAfter(r)-i;if(r<t.depth&&s.canReplace(o,l,n))return r;if(r==0||s.type.spec.isolating||!GD(s,o,l))break;o&&(a=1),l<s.childCount&&(i=1)}return null}function WD(t,e,n){let{$from:r,$to:a,depth:i}=e,s=r.before(i+1),o=a.after(i+1),l=s,u=o,c=X.empty,d=0;for(let h=i,g=!1;h>n;h--)g||r.index(h)>0?(g=!0,c=X.from(r.node(h).copy(c)),d++):l--;let p=X.empty,f=0;for(let h=i,g=!1;h>n;h--)g||a.after(h+1)<a.end(h)?(g=!0,p=X.from(a.node(h).copy(p)),f++):u++;t.step(new dt(l,u,s,o,new ae(c.append(p),d,f),c.size-d,!0))}function Cb(t,e,n=null,r=t){let a=VD(t,e),i=a&&YD(r,e);return i?a.map(ZE).concat({type:e,attrs:n}).concat(i.map(ZE)):null}function ZE(t){return{type:t,attrs:null}}function VD(t,e){let{parent:n,startIndex:r,endIndex:a}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,a,s)?i:null}function YD(t,e){let{parent:n,startIndex:r,endIndex:a}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let u=r;l&&u<a;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function KD(t,e,n){let r=X.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let o=n[s].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=X.from(n[s].type.create(n[s].attrs,r))}let a=e.start,i=e.end;t.step(new dt(a,i,a,i,new ae(r,0,0),n.length,!0))}function XD(t,e,n,r,a){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,o)=>{let l=typeof a=="function"?a(s):a;if(s.isTextblock&&!s.hasMarkup(r,l)&&ZD(t.doc,t.mapping.slice(i).map(o),r)){let u=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!h?u=!1:!f&&h&&(u=!0)}u===!1&&$N(t,s,o,i),Nb(t,t.mapping.slice(i).map(o,1),r,void 0,u===null);let c=t.mapping.slice(i),d=c.map(o,1),p=c.map(o+s.nodeSize,1);return t.step(new dt(d,p,d+1,p-1,new ae(X.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&HN(t,s,o,i),!1}})}function HN(t,e,n,r){e.forEach((a,i)=>{if(a.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(a.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function $N(t,e,n,r){e.forEach((a,i)=>{if(a.type==a.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
@@ -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-ChNbonqj.js";import{s as V}from"./Plus-ANFCmNBC.js";import{i as S}from"./Zap-BRrVrhlx.js";import{S as G}from"./search-input-DrjuWiKa.js";import{P as d}from"./index-zg41rH3q.js";import{E as T}from"./empty-state-D2koIBhr.js";import{c as H}from"./use-automations-CfL33HY2.js";import{c as J}from"./use-navigate-to-agent-xz8e6g3j.js";import{A as K}from"./automation-list-row-CWPbfvGY.js";import{t as O}from"./use-mcp-client-DGiEqhWW.js";import{u as Q}from"./use-virtual-mcp-3E0X8Qho.js";import{R as U}from"./require-capability-Brg3b3WC.js";import"./SearchMd-DaUX4bqr.js";import"./sidebar-C1S8e866.js";import"./LayoutLeft-C5bEG-Yu.js";import"./use-mobile-Caz6aOTC.js";import"./X-Bn5dnt4Y.js";import"./tooltip-Cj4mvkkR.js";import"./studio-tools-9YEAucUH.js";import"./hooks-CybMa7sq.js";import"./decopilot-sse-pool--ck4nwtj.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-vU3RDB6N.js";import"./dropdown-menu-BOPvnnQd.js";import"./Check-B3WXWYSz.js";import"./ChevronRight-Aaat-zPl.js";import"./DotsVertical-B_d1BqGN.js";import"./Stars02-BxQmMBsd.js";import"./Trash01-D1tBKt57.js";import"./agent-icon-DBTWnOQq.js";import"./AlertCircle-BrgoLEQ0.js";import"./Tool01-3U4lZ0ql.js";import"./ArrowUp-0JXWlMPw.js";import"./ArrowLeft-CDofidAY.js";import"./Tool02-WLcNYFEm.js";import"./XCircle-BWEvFrPt.js";import"./ArrowUpRight-Rz1YqMGK.js";import"./TrendUp01-BdJ3w75n.js";import"./ZapSquare-BoJs5BxD.js";import"./Users03-CrEwye6I.js";import"./CheckCircle-CWxxQPXv.js";import"./ChevronDown-B14qTkyv.js";import"./ChevronSelectorVertical-3I23HxSc.js";import"./ChevronUp-IZz2eGQ-.js";import"./Copy01-sqwxFb53.js";import"./CreditCard01-DbuX0MzE.js";import"./Download01-8o7f8ha3.js";import"./Settings02-BR1pfUoq.js";import"./Eye-B2eaOo-B.js";import"./FilterLines-BhNBwBEx.js";import"./Share07-DMD6arE7.js";import"./Globe01-Dzsrjekj.js";import"./Globe04-DGlluzNX.js";import"./SwitchHorizontal01-CQeaa4s0.js";import"./HardDrive-Br7GP1Y0.js";import"./Key01-BQwobAw2.js";import"./LinkExternal01-DL7sD62z.js";import"./LockUnlocked01-5khio-0j.js";import"./LogOut01-B84tbGgl.js";import"./Monitor01-BDodWDfh.js";import"./Sun-bQIMS-df.js";import"./Palette-CqQ0uw84.js";import"./Play-BmbGeXli.js";import"./SearchLg-Bhod71Pp.js";import"./Shield01-CE38_tJy.js";import"./Stars01-BeJY7M9x.js";import"./Upload01-B89gb6cs.js";import"./User01-BkUay2ek.js";import"./Users01-BA4DPXUj.js";import"./XClose-Dxm1AFZT.js";import"./auth-DF9dNCmv.js";import"./use-capability-DwzdlNfB.js";import"./access-gate-Cs3BTnxj.js";import"./capability-load-error-COB0oCD2.js";function W(){const t=B.c(20),i=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(e=>{if(!h||e.name.toLowerCase().includes(h))return!0;if(e.virtual_mcp_id){const p=A.get(e.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(e,p)=>{const N=p&&A.has(p)?p:O(c.id);R("automations_list_row_clicked",{automation_id:e,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+e}})};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]!==i?(s=i("settings.automations.pageTitle"),t[3]=i,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:i("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:i("settings.automations.emptyTitle"),description:i("settings.automations.emptyDescription"),actions:o.jsxs(F,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),i("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:i("settings.automations.noResultsTitle"),description:i("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(e=>o.jsx(K,{automation:e,showAgent:!0,onClick:()=>z(e.id,e.virtual_mcp_id)},e.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 wo(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=i):i=t[0],i}export{wo 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-DLyxjIYw.js";import{s as V}from"./Plus-D1J2FK4h.js";import{i as S}from"./Zap-DDihnv3P.js";import{S as G}from"./search-input-Dlrgn3SA.js";import{P as d}from"./index-D-cW_7z2.js";import{E as T}from"./empty-state-PrJglZio.js";import{c as H}from"./use-automations-DyLBCDVI.js";import{c as J}from"./use-navigate-to-agent-BqMCqmam.js";import{A as K}from"./automation-list-row-DRZedCha.js";import{t as O}from"./use-mcp-client-_o9o88xf.js";import{u as Q}from"./use-virtual-mcp-B0LtGhD8.js";import{R as U}from"./require-capability-daZd2Avq.js";import"./SearchMd-xpLLk_pA.js";import"./sidebar-_myHCEzH.js";import"./LayoutLeft-BEpfII_o.js";import"./use-mobile-H1cEPaVS.js";import"./X-DY9FeXqi.js";import"./tooltip-B-y9isox.js";import"./studio-tools-ThQ_rcsF.js";import"./hooks-B2woSXLe.js";import"./decopilot-sse-pool-DLTV1od0.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./alert-dialog-BOUVk-xM.js";import"./dropdown-menu-BmoCpvnT.js";import"./Check-BXav60Vy.js";import"./ChevronRight-BGcGReEM.js";import"./DotsVertical-fn24sGZC.js";import"./Stars02-DtoiSIcu.js";import"./Trash01-BnQQflAa.js";import"./agent-icon-5ZYno8Im.js";import"./AlertCircle-DUlfht_8.js";import"./Tool01-XzYGP86W.js";import"./ArrowUp-CsCHH_fH.js";import"./ArrowLeft-xr5VbHB2.js";import"./Tool02-CE2ZdUr1.js";import"./XCircle-_aQH9vJz.js";import"./ArrowUpRight-M9WAVHfb.js";import"./TrendUp01-BdIQtpYk.js";import"./ZapSquare-Bv6t7Fg1.js";import"./Users03-BNksnLQf.js";import"./CheckCircle-C2PmPe-o.js";import"./ChevronDown-CauLatdX.js";import"./ChevronSelectorVertical-CvdZht1v.js";import"./ChevronUp-D_tIdiJb.js";import"./Copy01-CV1JugLX.js";import"./CreditCard01-B_w5eexh.js";import"./Download01-D3eJDAEO.js";import"./Settings02-DjFkLPe4.js";import"./Eye-BhHZY2CZ.js";import"./FilterLines-BWjLIxVc.js";import"./Share07-Caa0Im56.js";import"./Globe01-DdUoMsv3.js";import"./Globe04-B-w3WEq9.js";import"./SwitchHorizontal01-C5wQU73g.js";import"./HardDrive-BFP4nRun.js";import"./Key01-Cfe0Tudx.js";import"./LinkExternal01-D25gdGqj.js";import"./LockUnlocked01-P_wfDROK.js";import"./LogOut01-DBKmS50y.js";import"./Monitor01-BhLjoS2b.js";import"./Sun-Dpvmek-4.js";import"./Palette-aeV8tQ28.js";import"./Play-BdOAMmIp.js";import"./SearchLg-BzCLzG8R.js";import"./Shield01-D5NbAsUv.js";import"./Stars01-CCBcRCds.js";import"./Upload01-Bhqh3Tbq.js";import"./User01-C1NHQ-ZR.js";import"./Users01-CMhcYnus.js";import"./XClose-DdNRdfWH.js";import"./auth-Clf3KXjv.js";import"./use-capability-DxO7qy1z.js";import"./access-gate-wLBW4P-Z.js";import"./capability-load-error-BasK1UyG.js";function W(){const t=B.c(20),i=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(e=>{if(!h||e.name.toLowerCase().includes(h))return!0;if(e.virtual_mcp_id){const p=A.get(e.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(e,p)=>{const N=p&&A.has(p)?p:O(c.id);R("automations_list_row_clicked",{automation_id:e,agent_id:N,source:"settings_automations"}),P(N,{search:{main:"automation:"+e}})};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]!==i?(s=i("settings.automations.pageTitle"),t[3]=i,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:i("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:i("settings.automations.emptyTitle"),description:i("settings.automations.emptyDescription"),actions:o.jsxs(F,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),i("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:i("settings.automations.noResultsTitle"),description:i("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(e=>o.jsx(K,{automation:e,showAgent:!0,onClick:()=>z(e.id,e.virtual_mcp_id)},e.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 wo(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=i):i=t[0],i}export{wo as default};
@@ -1 +1 @@
1
- import{c as k,j as i,m as f,aR as C,cR as V,cS as I,cT as $}from"./index-ChNbonqj.js";import{s as O}from"./User01-BkUay2ek.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(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=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 R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],T="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function L(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const S=C("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=C("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const m=x;let y;e:{if(j){y=T;break e}if(typeof t=="string"){let c;e[11]!==t?(c=L(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=R[0]}const z=y;let 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(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 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
+ import{c as k,j as i,m as f,aR as C,cR as V,cS as I,cT as $}from"./index-DLyxjIYw.js";import{s as O}from"./User01-C1NHQ-ZR.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(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=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 R=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],T="drop-shadow-lg text-muted-foreground bg-muted shadow-lg";function L(r){let e=0;for(let t=0;t<r.length;t++)e=r.charCodeAt(t)+((e<<5)-e);const s=Math.abs(e)%R.length;return R[s]}const S=C("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=C("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function W(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const m=x;let y;e:{if(j){y=T;break e}if(typeof t=="string"){let c;e[11]!==t?(c=L(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=R[0]}const z=y;let 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(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 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,bd as v,aR as b}from"./index-ChNbonqj.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,bd as v,aR as b}from"./index-DLyxjIYw.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,4 +1,4 @@
1
- import{r as re,j as s,cw as le,cx as fe,c as D,m as ae,b as ge,F as xe,K as pe,n as be,B as Y,k as J}from"./index-ChNbonqj.js";import{i as W}from"./CreditCard01-DbuX0MzE.js";import{B as q}from"./badge-DVdFuH3v.js";import{S as ee}from"./skeleton-D5WFiATz.js";import{P as Q}from"./index-zg41rH3q.js";import{c as he,S as ve,a as Z,b as je}from"./settings-section-DhQpgpfA.js";import{u as Ne}from"./studio-tools-9YEAucUH.js";import{u as te}from"./use-open-billing-url-D_P6BXEt.js";import{S as Pe}from"./settings-subnav-DQDlSCqd.js";import{R as _e}from"./require-capability-Brg3b3WC.js";import"./sidebar-C1S8e866.js";import"./LayoutLeft-C5bEG-Yu.js";import"./use-mobile-Caz6aOTC.js";import"./X-Bn5dnt4Y.js";import"./tooltip-Cj4mvkkR.js";import"./card-CtLNe5Qx.js";import"./ArrowUpRight-Rz1YqMGK.js";import"./useRouterState-Cf6ilWg1.js";import"./use-settings-tabs-D7UnYZYf.js";import"./use-capability-DwzdlNfB.js";import"./access-gate-Cs3BTnxj.js";import"./capability-load-error-COB0oCD2.js";var X="Progress",H=100,[Se]=fe(X),[ye,Te]=Se(X),ne=re.forwardRef((e,t)=>{const{__scopeProgress:a,value:n=null,max:r,getValueLabel:o=Ie,...c}=e;(r||r===0)&&!se(r)&&console.error(Ee(`${r}`,"Progress"));const i=se(r)?r:H;n!==null&&!ie(n,i)&&console.error(Ae(`${n}`,"Progress"));const l=ie(n,i)?n:null,d=M(l)?o(l,i):void 0;return s.jsx(ye,{scope:a,value:l,max:i,children:s.jsx(le.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":M(l)?l:void 0,"aria-valuetext":d,role:"progressbar","data-state":ue(l,i),"data-value":l??void 0,"data-max":i,...c,ref:t})})});ne.displayName=X;var oe="ProgressIndicator",ce=re.forwardRef((e,t)=>{const{__scopeProgress:a,...n}=e,r=Te(oe,a);return s.jsx(le.div,{"data-state":ue(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...n,ref:t})});ce.displayName=oe;function Ie(e,t){return`${Math.round(e/t*100)}%`}function ue(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function M(e){return typeof e=="number"}function se(e){return M(e)&&!isNaN(e)&&e>0}function ie(e,t){return M(e)&&!isNaN(e)&&e<=t&&e>=0}function Ee(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${H}\`.`}function Ae(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
1
+ import{r as re,j as s,cw as le,cx as fe,c as D,m as ae,b as ge,F as xe,K as pe,n as be,B as Y,k as J}from"./index-DLyxjIYw.js";import{i as W}from"./CreditCard01-B_w5eexh.js";import{B as q}from"./badge-BtBZ1HPJ.js";import{S as ee}from"./skeleton-CfDgtd5M.js";import{P as Q}from"./index-D-cW_7z2.js";import{c as he,S as ve,a as Z,b as je}from"./settings-section-BIT7uWjs.js";import{u as Ne}from"./studio-tools-ThQ_rcsF.js";import{u as te}from"./use-open-billing-url-BWzY_VeB.js";import{S as Pe}from"./settings-subnav-DobJGu7Z.js";import{R as _e}from"./require-capability-daZd2Avq.js";import"./sidebar-_myHCEzH.js";import"./LayoutLeft-BEpfII_o.js";import"./use-mobile-H1cEPaVS.js";import"./X-DY9FeXqi.js";import"./tooltip-B-y9isox.js";import"./card-CKXxuGX6.js";import"./ArrowUpRight-M9WAVHfb.js";import"./useRouterState-um8-mtPt.js";import"./use-settings-tabs-CGwARRFk.js";import"./use-capability-DxO7qy1z.js";import"./access-gate-wLBW4P-Z.js";import"./capability-load-error-BasK1UyG.js";var X="Progress",H=100,[Se]=fe(X),[ye,Te]=Se(X),ne=re.forwardRef((e,t)=>{const{__scopeProgress:a,value:n=null,max:r,getValueLabel:o=Ie,...c}=e;(r||r===0)&&!se(r)&&console.error(Ee(`${r}`,"Progress"));const i=se(r)?r:H;n!==null&&!ie(n,i)&&console.error(Ae(`${n}`,"Progress"));const l=ie(n,i)?n:null,d=M(l)?o(l,i):void 0;return s.jsx(ye,{scope:a,value:l,max:i,children:s.jsx(le.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":M(l)?l:void 0,"aria-valuetext":d,role:"progressbar","data-state":ue(l,i),"data-value":l??void 0,"data-max":i,...c,ref:t})})});ne.displayName=X;var oe="ProgressIndicator",ce=re.forwardRef((e,t)=>{const{__scopeProgress:a,...n}=e,r=Te(oe,a);return s.jsx(le.div,{"data-state":ue(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...n,ref:t})});ce.displayName=oe;function Ie(e,t){return`${Math.round(e/t*100)}%`}function ue(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function M(e){return typeof e=="number"}function se(e){return M(e)&&!isNaN(e)&&e>0}function ie(e,t){return M(e)&&!isNaN(e)&&e<=t&&e>=0}function Ee(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${H}\`.`}function Ae(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2
2
  - a positive number
3
3
  - less than the value passed to \`max\` (or ${H} if no \`max\` prop is set)
4
4
  - \`null\` or \`undefined\` if the progress is indeterminate.