decocms 4.358.7 → 4.358.9

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 (260) hide show
  1. package/dist/client/assets/{AlertCircle-CmSNkMzR.js → AlertCircle-DM1wOTV-.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CkQ2fA7o.js → AreaChart-C5Hnj1Lj.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Bu94Ii5M.js → ArrowLeft-9dpHwu9-.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-mDGbrugB.js → ArrowRight-B-LgiGJk.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DSV_iaE8.js → ArrowUp-OudgxKkt.js} +1 -1
  6. package/dist/client/assets/{Check-Dg3ccedM.js → Check-B_YxhG30.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CXvhBSH9.js → CheckCircle-dm6kQxSf.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CTynsPcA.js → ChevronRight-CHv3VYgp.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-CXzhk4X8.js → ChevronSelectorVertical-DE7kv4Kd.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-bmYG6LkB.js → ChevronUp-t8t4fwnR.js} +1 -1
  11. package/dist/client/assets/{Copy01-C_pD92sU.js → Copy01-Cka2uFEv.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-DZSvJ623.js → CreditCard01-BRxvnKr_.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-DERxV0IT.js → DotsVertical-BrftgIDe.js} +1 -1
  14. package/dist/client/assets/{Download01-BrJcEIOJ.js → Download01-ytOYmKSZ.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-D8Z1Ht69.js → ErrorBarContext-xi0yNR5E.js} +1 -1
  16. package/dist/client/assets/{Eye-DtzSWYJp.js → Eye-Cze9SkdO.js} +1 -1
  17. package/dist/client/assets/{GitBranch01-CNkrChzn.js → GitBranch01-Dv92hLUV.js} +1 -1
  18. package/dist/client/assets/{Globe01-DSqDXciw.js → Globe01-CFZdQViA.js} +1 -1
  19. package/dist/client/assets/{HardDrive-C33hwgdT.js → HardDrive-B6O4Lzvt.js} +1 -1
  20. package/dist/client/assets/{Image01-CSSIg-V1.js → Image01-DPhR8WEz.js} +1 -1
  21. package/dist/client/assets/{Key01-BArMmeeh.js → Key01-CnMMlNjM.js} +1 -1
  22. package/dist/client/assets/{Link01-D9m0U2Ta.js → Link01-BT9hUC6n.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-_yUVYhsR.js → LinkExternal01-Dd9_oVMY.js} +1 -1
  24. package/dist/client/assets/{Monitor01-TbxGy4uJ.js → Monitor01-lCN_Uznr.js} +1 -1
  25. package/dist/client/assets/{Package-CIgjd15K.js → Package-Pjoambo8.js} +1 -1
  26. package/dist/client/assets/{Palette-BJjA93OF.js → Palette-CPWVOo_O.js} +1 -1
  27. package/dist/client/assets/{Play-CuabQ6V5.js → Play-DUteIsFY.js} +1 -1
  28. package/dist/client/assets/{Plus-CLw8nshS.js → Plus-DsoHS1s-.js} +1 -1
  29. package/dist/client/assets/{SearchLg-B_uG9UNP.js → SearchLg-DVGtsQMZ.js} +1 -1
  30. package/dist/client/assets/{SearchMd-CvoyvhDO.js → SearchMd-DBtIEQFG.js} +1 -1
  31. package/dist/client/assets/{Sector-D84p_AF-.js → Sector-B56duS3-.js} +1 -1
  32. package/dist/client/assets/{Settings02-B-LW8mkp.js → Settings02-nB2LBjem.js} +1 -1
  33. package/dist/client/assets/{Share07-DzwLu6Js.js → Share07-DxFaah4G.js} +1 -1
  34. package/dist/client/assets/{Shield01-CHOtU8tO.js → Shield01-YkTEmRCE.js} +1 -1
  35. package/dist/client/assets/{Stars01-CQM502gA.js → Stars01-XqGB97Zv.js} +1 -1
  36. package/dist/client/assets/{Sun-BeFqPYZz.js → Sun-Cf4BP4WB.js} +1 -1
  37. package/dist/client/assets/{Tool01-DN82p4SK.js → Tool01-BfzgVlWE.js} +1 -1
  38. package/dist/client/assets/{Tool02-Cnm0LDZR.js → Tool02-DJ6ebzoK.js} +1 -1
  39. package/dist/client/assets/{Trash01-D3glACCY.js → Trash01-CdmAHj_X.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-Du_0IpAS.js → TrendUp01-CbspxXI2.js} +1 -1
  41. package/dist/client/assets/{Upload01-D8T1C7P0.js → Upload01-Bhk_UoPj.js} +1 -1
  42. package/dist/client/assets/{User01-ChUO6wNS.js → User01-BkT796JC.js} +1 -1
  43. package/dist/client/assets/{UserSquare-CMhNzA5S.js → UserSquare-BSLxGup_.js} +1 -1
  44. package/dist/client/assets/{Users01-BkdRerkJ.js → Users01-Dyo9ZzPj.js} +1 -1
  45. package/dist/client/assets/{Users03-CxjX2yOG.js → Users03-BX6ICswR.js} +1 -1
  46. package/dist/client/assets/{XCircle-Q_FzfXfM.js → XCircle-CJuCeBSM.js} +1 -1
  47. package/dist/client/assets/{XClose-B2yo755N.js → XClose-C3LO4RAn.js} +1 -1
  48. package/dist/client/assets/{Zap-Dp5FptyY.js → Zap-DNjSZhAl.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-CzL3lV9f.js → ZoomOut-vW_y2VPH.js} +1 -1
  50. package/dist/client/assets/{access-gate-BZEI0Ppn.js → access-gate-CsjPwmbX.js} +1 -1
  51. package/dist/client/assets/{agent-icon-Dy2jpds_.js → agent-icon-7Ul-3CFr.js} +1 -1
  52. package/dist/client/assets/{agents-list-h87ZNcgJ.js → agents-list-C3jwjn4u.js} +1 -1
  53. package/dist/client/assets/{ai-providers-vwKflTho.js → ai-providers-C8FU-ETD.js} +1 -1
  54. package/dist/client/assets/{alert-ByJ8AkFR.js → alert-1SFaWtG7.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-CfLTHal2.js → alert-dialog-KXEmr_A6.js} +1 -1
  56. package/dist/client/assets/analytics-tab-B2s4PZqh.js +2 -0
  57. package/dist/client/assets/{api-keys-BI4U3OFV.js → api-keys-BtqlUWaN.js} +1 -1
  58. package/dist/client/assets/api-keys-DMaVxeam.js +1 -0
  59. package/dist/client/assets/{app-editor-DvQrswh0.js → app-editor-DfKghIRC.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-ZheHiaNX.js → auth-catchall-DE1giVB4.js} +1 -1
  61. package/dist/client/assets/{auth-entry-wjih1rgO.js → auth-entry-lo3TAtpl.js} +1 -1
  62. package/dist/client/assets/{auth-BRCvCyvK.js → auth-jEXOVJdJ.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-CeDEhY76.js → auth-split-layout-BgmqQbTN.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-eUo-h56q.js → authenticate-and-persist-oauth-C9jOdAvp.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-oRD34d51.js → automation-list-row-DvZQrXCp.js} +1 -1
  66. package/dist/client/assets/{automation-runs-CvRx2s0y.js → automation-runs-aPXD_uTZ.js} +2 -2
  67. package/dist/client/assets/{automations-DkxpvUP4.js → automations-CskLVFMr.js} +1 -1
  68. package/dist/client/assets/{autosend-C5-piDIA.js → autosend-mKs95JqV.js} +1 -1
  69. package/dist/client/assets/{avatar-B93oLzxy.js → avatar-BPVI4atE.js} +1 -1
  70. package/dist/client/assets/{badge-BDgqklMs.js → badge-CLI8BJXF.js} +1 -1
  71. package/dist/client/assets/{block-document-B9S_7VZV.js → block-document-rK9gmLgc.js} +1 -1
  72. package/dist/client/assets/{breadcrumb-CtpPA7Rf.js → breadcrumb-DzQvHKGE.js} +1 -1
  73. package/dist/client/assets/{buckets-ByvDEjty.js → buckets-bSO6V5oa.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-CbE9Fh9p.js → bulk-category-panel-DlgEKp--.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-BJ_jcKAV.js → capability-load-error-Ewp013Fw.js} +1 -1
  76. package/dist/client/assets/{cards-Dxj0WXQa.js → cards-CTM_z6JU.js} +1 -1
  77. package/dist/client/assets/{category-editor-13ULlzrv.js → category-editor-55W8BV7D.js} +1 -1
  78. package/dist/client/assets/{cdn-tab-D1IKX-5q.js → cdn-tab-DtO_62LW.js} +1 -1
  79. package/dist/client/assets/{chart-BiOppEJ3.js → chart-CfRLS9xT.js} +1 -1
  80. package/dist/client/assets/{chat-context-DB2h4osD.js → chat-context-Cnf8ag8e.js} +1 -1
  81. package/dist/client/assets/{checkbox-BoFs553Q.js → checkbox-DT8c2BIN.js} +1 -1
  82. package/dist/client/assets/{choose-editor-DPWErb-7.js → choose-editor-CwFAKCCH.js} +1 -1
  83. package/dist/client/assets/{cli-auth-success-CaiITPtM.js → cli-auth-success-CQci1-No.js} +1 -1
  84. package/dist/client/assets/{client-icons-DFuiJ80A.js → client-icons-DcCbGBcw.js} +1 -1
  85. package/dist/client/assets/{collection-detail-DA1BxkQ_.js → collection-detail-DfaKMGP2.js} +1 -1
  86. package/dist/client/assets/{collection-display-button-DFwk7HqF.js → collection-display-button-ESAZgPL0.js} +1 -1
  87. package/dist/client/assets/{collection-search-CWpQkN_Z.js → collection-search-B2UtpzT2.js} +1 -1
  88. package/dist/client/assets/{collection-table-wrapper-5iNy3BEg.js → collection-table-wrapper-BASvvH9a.js} +1 -1
  89. package/dist/client/assets/{collection-tabs-Czo7NLaO.js → collection-tabs-b6io6wfY.js} +1 -1
  90. package/dist/client/assets/{command-B6uncQvS.js → command-CALmXOXE.js} +1 -1
  91. package/dist/client/assets/{commerce-onboarding-Bz9kNl4w.js → commerce-onboarding-JQkLXz3m.js} +1 -1
  92. package/dist/client/assets/{connect-B9IbKpH0.js → connect-BZsIEi1o.js} +1 -1
  93. package/dist/client/assets/{connect-layout-D6s3gNlo.js → connect-layout-ByjvsYEz.js} +1 -1
  94. package/dist/client/assets/{connection-C7-gff1D.js → connection-B7GAvn4a.js} +1 -1
  95. package/dist/client/assets/{connection-card-CO42dC4k.js → connection-card-BIzeMrZG.js} +1 -1
  96. package/dist/client/assets/{connection-detail-BP8gSuaf.js → connection-detail-RTSEdP1X.js} +1 -1
  97. package/dist/client/assets/{connection-form-helpers-ptQ77JH2.js → connection-form-helpers-DDJ72RqH.js} +1 -1
  98. package/dist/client/assets/{connections-CHtcnGgH.js → connections-DKevs0dE.js} +1 -1
  99. package/dist/client/assets/{create-organization-dialog-DDOozMUI.js → create-organization-dialog-YKR8Vlp2.js} +1 -1
  100. package/dist/client/assets/{decopilot-sse-pool-BV-nZdw9.js → decopilot-sse-pool-CciVCe4h.js} +1 -1
  101. package/dist/client/assets/{dialog-DUEME7DJ.js → dialog-DBF7H4cU.js} +1 -1
  102. package/dist/client/assets/{domain-settings-CrOy6YME.js → domain-settings-BWFxKHvI.js} +1 -1
  103. package/dist/client/assets/{drawer-BPAaqlqm.js → drawer-49fZ3NcG.js} +1 -1
  104. package/dist/client/assets/{dropdown-menu-BdAGNhae.js → dropdown-menu-C2_-PA0d.js} +1 -1
  105. package/dist/client/assets/e2e-tab-BGkU9tzm.js +1 -0
  106. package/dist/client/assets/{editor-CbtcAvCg.js → editor-huY6kt2_.js} +1 -1
  107. package/dist/client/assets/{empty-state-Dtwkb-iN.js → empty-state-Cm5_JlLy.js} +1 -1
  108. package/dist/client/assets/{empty-state-UuH9Il0J.js → empty-state-D1sYtfoS.js} +1 -1
  109. package/dist/client/assets/{extract-connection-data-oTtb1BaN.js → extract-connection-data-Bc1gK_oh.js} +1 -1
  110. package/dist/client/assets/{file-explorer-DO9bb6wZ.js → file-explorer-DLXlCaB9.js} +1 -1
  111. package/dist/client/assets/{file-type-icon-27-E6Qdl.js → file-type-icon-CGvcwfte.js} +1 -1
  112. package/dist/client/assets/{folder-icon-CKMNLNfS.js → folder-icon-D_jwJiQ0.js} +1 -1
  113. package/dist/client/assets/{form-r05b-I6X.js → form-D5aJ2R1e.js} +1 -1
  114. package/dist/client/assets/{general-BZK_31jo.js → general-BXYUpmQg.js} +1 -1
  115. package/dist/client/assets/{github-icon-EWgLsKjp.js → github-icon-CqsUvwtZ.js} +1 -1
  116. package/dist/client/assets/{hooks-DxiN--jI.js → hooks-DpCU1UBz.js} +1 -1
  117. package/dist/client/assets/{index-C803x1XG.js → index-BB4x_gPK.js} +1 -1
  118. package/dist/client/assets/{index-BAedCESS.js → index-BbDu2xq3.js} +2 -2
  119. package/dist/client/assets/{index-BDHc__VT.js → index-Bl9g0J7w.js} +1 -1
  120. package/dist/client/assets/{index-BA9swz3B.js → index-CmmEYCmQ.js} +1 -1
  121. package/dist/client/assets/{index-BlLPD0rg.js → index-DClNZMTN.js} +6 -6
  122. package/dist/client/assets/{index-B5fJ_jRf.js → index-DFIU7OfS.js} +1 -1
  123. package/dist/client/assets/{index-BwI3Edgw.js → index-DLPAbVTv.js} +1 -1
  124. package/dist/client/assets/{index-MxN6W3Rg.js → index-DTHoNV5y.js} +1 -1
  125. package/dist/client/assets/{index-CSR8RjAB.js → index-DYCMd9af.js} +1 -1
  126. package/dist/client/assets/{index-CQwdWcoq.js → index-Dp8VyMSk.js} +1 -1
  127. package/dist/client/assets/{index-CO2mZC5x.js → index-E9nvagxo.js} +1 -1
  128. package/dist/client/assets/{index-BItxgHFJ.js → index-F19mJ8_N.js} +1 -1
  129. package/dist/client/assets/{index-redirect-G-aJbUS9.js → index-redirect-41OhTjna.js} +1 -1
  130. package/dist/client/assets/{infiniteQueryObserver-a1irpNBf.js → infiniteQueryObserver-BQw5N_tk.js} +1 -1
  131. package/dist/client/assets/{infra-billing-0q8_17Cl.js → infra-billing-BRWmwXxq.js} +1 -1
  132. package/dist/client/assets/{input-TuiIIqH6.js → input-2a-tqySq.js} +1 -1
  133. package/dist/client/assets/{integration-icon-JdG4xh_j.js → integration-icon-BY9o6bXu.js} +1 -1
  134. package/dist/client/assets/{invite-member-dialog-BiVatLIt.js → invite-member-dialog-BjBLqi6k.js} +1 -1
  135. package/dist/client/assets/{label-WUiqx2WK.js → label-Bw3LAQ_7.js} +1 -1
  136. package/dist/client/assets/{layout-Chr9Vtej.js → layout-UTo5bLEd.js} +1 -1
  137. package/dist/client/assets/{login-D8uTK94O.js → login-BMF-G7K6.js} +1 -1
  138. package/dist/client/assets/{markdown-CNtWUp-j.js → markdown-DUDS1ORg.js} +1 -1
  139. package/dist/client/assets/{mcp-app-renderer-Bwxfrw0h.js → mcp-app-renderer-D7KTrdiy.js} +1 -1
  140. package/dist/client/assets/{mcp-oauth-Cg840wbY.js → mcp-oauth-DjBAF6Mn.js} +1 -1
  141. package/dist/client/assets/{members-BnJH1AGH.js → members-EfhqjbXN.js} +1 -1
  142. package/dist/client/assets/{monaco-editor-CFtlqgKG.js → monaco-editor-CQBFoghF.js} +1 -1
  143. package/dist/client/assets/{monitoring-stats-row-BbaBgzqv.js → monitoring-stats-row-ddTONEb4.js} +1 -1
  144. package/dist/client/assets/{multi-select-BAixkxBR.js → multi-select-Ctpcz_8m.js} +1 -1
  145. package/dist/client/assets/{oauth-callback-CFGjLMN9.js → oauth-callback-K9qYFmrD.js} +1 -1
  146. package/dist/client/assets/{oauth-callback-ai-provider-B2Fj4AlA.js → oauth-callback-ai-provider-CtAl4uAr.js} +1 -1
  147. package/dist/client/assets/{onboarding-BVqaYGqg.js → onboarding-xfLGSHPu.js} +1 -1
  148. package/dist/client/assets/{org-layout-CyofguTT.js → org-layout-XNRDbDzA.js} +1 -1
  149. package/dist/client/assets/{organization-choice-UtAuDgsl.js → organization-choice-Crsdzh3H.js} +1 -1
  150. package/dist/client/assets/{orgs-BA9FXBu5.js → orgs-xS8UVNgJ.js} +1 -1
  151. package/dist/client/assets/{page-seo-form-CjYRnEyu.js → page-seo-form-zl8f_p5D.js} +1 -1
  152. package/dist/client/assets/{popover-CSwDoJWv.js → popover-VJSdSyV6.js} +1 -1
  153. package/dist/client/assets/{post-calendar-BJH0mUgs.js → post-calendar-BhIz7N7-.js} +1 -1
  154. package/dist/client/assets/{post-editor-Dx5eKpsQ.js → post-editor-DbAORW9R.js} +1 -1
  155. package/dist/client/assets/{primitives-DD-UxZ0K.js → primitives-CYgZUNfX.js} +1 -1
  156. package/dist/client/assets/{profile-BnISBpst.js → profile-eYQPOj60.js} +1 -1
  157. package/dist/client/assets/{project-app-view-BPqLEHUx.js → project-app-view-voAX5XmM.js} +1 -1
  158. package/dist/client/assets/{project-icon-eA-nQusH.js → project-icon-CmWzfvVM.js} +1 -1
  159. package/dist/client/assets/{prompts-C160yWe8.js → prompts-BpFmw-L7.js} +1 -1
  160. package/dist/client/assets/record-editor-zneDMAxr.js +1 -0
  161. package/dist/client/assets/redirect-editor-C7D2vad7.js +1 -0
  162. package/dist/client/assets/registry-BWLPQoOd.js +2 -0
  163. package/dist/client/assets/{registry-layout-_mSuHnlf.js → registry-layout-CdVDyJvL.js} +1 -1
  164. package/dist/client/assets/{reports-D1Tbe2id.js → reports-BslOEc6P.js} +1 -1
  165. package/dist/client/assets/{repositories-CHGfv1rO.js → repositories-tRDlN6-J.js} +1 -1
  166. package/dist/client/assets/{repository-import-picker-gzz61js_.js → repository-import-picker-CSbM9sb0.js} +1 -1
  167. package/dist/client/assets/{repository-picker-CCOAxXyS.js → repository-picker-BNZ7b3Oi.js} +1 -1
  168. package/dist/client/assets/{require-capability-B2N02pbD.js → require-capability-CmB8qaJ4.js} +1 -1
  169. package/dist/client/assets/{required-auth-layout-lCk5RtRt.js → required-auth-layout-BhMyFWdP.js} +1 -1
  170. package/dist/client/assets/{reset-password-CMX4eAbb.js → reset-password-D0uP8U49.js} +1 -1
  171. package/dist/client/assets/{review-settings-4DWQSl88.js → review-settings-CnMZFUWw.js} +1 -1
  172. package/dist/client/assets/{roles-CDKRwwF5.js → roles-CC20KgEl.js} +1 -1
  173. package/dist/client/assets/{schema-bn-nczrm.js → schema-BCMlOSyV.js} +1 -1
  174. package/dist/client/assets/{scroll-area-khQdmnJm.js → scroll-area-C4BXuFg6.js} +1 -1
  175. package/dist/client/assets/{search-input-NP3xLzdZ.js → search-input-Dg-G_3ZW.js} +1 -1
  176. package/dist/client/assets/{secrets-C3Xsgj9o.js → secrets-Tw7wlLs8.js} +1 -1
  177. package/dist/client/assets/{sections-editor-UGzw9l9W.js → sections-editor-DN1UJdxb.js} +1 -1
  178. package/dist/client/assets/{select-Cs6cmusu.js → select-FSMMPzsI.js} +1 -1
  179. package/dist/client/assets/{select-model-HZpjX99E.js → select-model-BnRpD5qa.js} +1 -1
  180. package/dist/client/assets/{self-tool-result-DMwc2p5N.js → self-tool-result-D79dnlsl.js} +1 -1
  181. package/dist/client/assets/{seo-editor-D-auq7-j.js → seo-editor-DgD5pi5-.js} +1 -1
  182. package/dist/client/assets/settings-layout-BM_T9cjW.js +1 -0
  183. package/dist/client/assets/{settings-sidebar-Dner6t5H.js → settings-sidebar-VshDUdHD.js} +1 -1
  184. package/dist/client/assets/{shell-controls-DtNm_Atn.js → shell-controls-CeFoLZda.js} +1 -1
  185. package/dist/client/assets/{shell-layout-8XPciKoI.js → shell-layout-CjwLOLgP.js} +1 -1
  186. package/dist/client/assets/{skill-preview-CCu_7jUM.js → skill-preview-BV5FFdjf.js} +1 -1
  187. package/dist/client/assets/{skills-mobmS0Cu.js → skills-_3m8uTz-.js} +1 -1
  188. package/dist/client/assets/{sso-CFnzyayZ.js → sso--7F-_CVe.js} +1 -1
  189. package/dist/client/assets/{store-QWQEJkmz.js → store-R-M6rYbT.js} +1 -1
  190. package/dist/client/assets/store-registry-CikLmiwt.js +2 -0
  191. package/dist/client/assets/{switch-CTIrbdkL.js → switch-skcieNrk.js} +1 -1
  192. package/dist/client/assets/{synced-repos-g09eTVU1.js → synced-repos-C_Jq3kxm.js} +1 -1
  193. package/dist/client/assets/{table-CPMYpTul.js → table-B5Vs3GY1.js} +1 -1
  194. package/dist/client/assets/{tabs-08DxzxY_.js → tabs-BES7zN53.js} +1 -1
  195. package/dist/client/assets/{task-board-DhERAZm4.js → task-board-ztfxGGkb.js} +1 -1
  196. package/dist/client/assets/{task-route-BwOuH1kk.js → task-route-BnxI9DH0.js} +1 -1
  197. package/dist/client/assets/{tasks-CA-QGnOj.js → tasks-D47DMyGg.js} +1 -1
  198. package/dist/client/assets/{textarea-BpbE_kY0.js → textarea-CLacFrbn.js} +1 -1
  199. package/dist/client/assets/{thread-intent-C60z1Ups.js → thread-intent-CMg782e5.js} +1 -1
  200. package/dist/client/assets/{thread-route-AF4fUXAb.js → thread-route-YcEgAyO3.js} +1 -1
  201. package/dist/client/assets/{toggle-group-DHFTyRQw.js → toggle-group-D-1pHmtF.js} +1 -1
  202. package/dist/client/assets/{toolbar-8bik0Syp.js → toolbar-CQH-_Amz.js} +1 -1
  203. package/dist/client/assets/{toolbar-icon-button-E_4R6vvs.js → toolbar-icon-button-DstnJ2VV.js} +1 -1
  204. package/dist/client/assets/{track-DJIS7Ijr.js → track-DSESTI7a.js} +1 -1
  205. package/dist/client/assets/{types-DIUb1_Md.js → types-DejsVxb8.js} +1 -1
  206. package/dist/client/assets/{use-ai-providers-CPqinilp.js → use-ai-providers-B7KRAXK1.js} +1 -1
  207. package/dist/client/assets/{use-automations-DiccRABG.js → use-automations-BdYWhhm1.js} +1 -1
  208. package/dist/client/assets/{use-autosave-favfxUE8.js → use-autosave-CL8XjGub.js} +1 -1
  209. package/dist/client/assets/{use-connection-CQ7bQ-r6.js → use-connection-C2nO_AVv.js} +1 -1
  210. package/dist/client/assets/{use-copy-DbTeee2Q.js → use-copy-BBc3d83z.js} +1 -1
  211. package/dist/client/assets/{use-create-virtual-mcp-COEAaJiL.js → use-create-virtual-mcp-C6aRNtOe.js} +1 -1
  212. package/dist/client/assets/{use-date-fns-locale-Bw8LkRGs.js → use-date-fns-locale-wkJRogd2.js} +1 -1
  213. package/dist/client/assets/{use-debounced-autosave-BoUtyVR9.js → use-debounced-autosave-Li8rNiA_.js} +1 -1
  214. package/dist/client/assets/{use-debounced-value-BsmwA_bi.js → use-debounced-value-DSll33a0.js} +1 -1
  215. package/dist/client/assets/{use-decopilot-events-Bm9EUklJ.js → use-decopilot-events-BRjyeJJo.js} +1 -1
  216. package/dist/client/assets/{use-delete-connection-CMlLvOz1.js → use-delete-connection-GnyECS3l.js} +1 -1
  217. package/dist/client/assets/{use-deployment-admin-C9j4OUB5.js → use-deployment-admin-D2Td-HJz.js} +1 -1
  218. package/dist/client/assets/{use-destination-route-B0lMhqr-.js → use-destination-route-UJWTmz4J.js} +1 -1
  219. package/dist/client/assets/{use-file-configs-BSImuLcM.js → use-file-configs-Cw4K3Ikl.js} +1 -1
  220. package/dist/client/assets/{use-infinite-scroll-hYhzTevO.js → use-infinite-scroll-ClPXgDIl.js} +1 -1
  221. package/dist/client/assets/{use-join-requests-BeY7TwRa.js → use-join-requests-CHTNpd-L.js} +1 -1
  222. package/dist/client/assets/{use-mcp-auth-status-CcJ30wHQ.js → use-mcp-auth-status-CW1JSYmQ.js} +1 -1
  223. package/dist/client/assets/{use-mcp-client-DRbjI6tX.js → use-mcp-client-BPlXnENu.js} +1 -1
  224. package/dist/client/assets/{use-mcp-prompts-BIzsd0iZ.js → use-mcp-prompts-D5jv-rPf.js} +1 -1
  225. package/dist/client/assets/{use-mcp-tools-BM8OmaVn.js → use-mcp-tools-Dfar9HaU.js} +1 -1
  226. package/dist/client/assets/{use-members-CvMoH-iF.js → use-members-BeBhwrLZ.js} +1 -1
  227. package/dist/client/assets/{use-navigate-to-agent-CGLdpa0F.js → use-navigate-to-agent-874sGcUI.js} +1 -1
  228. package/dist/client/assets/{use-org-auth-client-DnRe-g1g.js → use-org-auth-client-CbGygSUB.js} +1 -1
  229. package/dist/client/assets/{use-org-notice-BxLLlDC5.js → use-org-notice-Dw__a7L-.js} +1 -1
  230. package/dist/client/assets/{use-org-sso-D3yIS-8J.js → use-org-sso-BHwfvM7l.js} +1 -1
  231. package/dist/client/assets/{use-organization-roles-ktHRdCrw.js → use-organization-roles-wkqRpeS-.js} +1 -1
  232. package/dist/client/assets/{use-organization-settings-tIS8xJQP.js → use-organization-settings-B59Uxf99.js} +1 -1
  233. package/dist/client/assets/{use-panel-navigate-DdBCZnsD.js → use-panel-navigate-BSB806-r.js} +1 -1
  234. package/dist/client/assets/{use-registry-connections-CpCOrqJZ.js → use-registry-connections-C3vf-j5B.js} +1 -1
  235. package/dist/client/assets/{use-secrets-GY3e_So0.js → use-secrets-DFq1lqOb.js} +1 -1
  236. package/dist/client/assets/{use-section-preview-base-EGUCuSYn.js → use-section-preview-base-BIWaaxNi.js} +1 -1
  237. package/dist/client/assets/{use-status-sounds-Dr5PODZ9.js → use-status-sounds-cvKo7fIi.js} +1 -1
  238. package/dist/client/assets/{use-tags-P8XJaTzT.js → use-tags-WgYTilH4.js} +1 -1
  239. package/dist/client/assets/{use-view-mode-BbAbqvz6.js → use-view-mode-CcItG9tS.js} +1 -1
  240. package/dist/client/assets/{use-virtual-mcp-C4XUTl0E.js → use-virtual-mcp-DaOGpnoF.js} +1 -1
  241. package/dist/client/assets/useInfiniteQuery-DHse_DiU.js +1 -0
  242. package/dist/client/assets/useSuspenseInfiniteQuery-DnuTSRTu.js +1 -0
  243. package/dist/client/assets/{users-CS5WQkaQ.js → users-0Elt2Qa1.js} +1 -1
  244. package/dist/client/assets/{variant-calendar-ehJVqgLU.js → variant-calendar-CAmxdOVL.js} +1 -1
  245. package/dist/client/assets/{view-mode-toggle-x5dJlEQb.js → view-mode-toggle-fkLwhK4U.js} +1 -1
  246. package/dist/client/index.html +1 -1
  247. package/dist/server/cli.js +568 -568
  248. package/dist/server/migrate.js +168 -168
  249. package/dist/server/server.js +389 -389
  250. package/package.json +1 -1
  251. package/dist/client/assets/analytics-tab-OB0WOBW7.js +0 -2
  252. package/dist/client/assets/api-keys-93oBHhP-.js +0 -1
  253. package/dist/client/assets/e2e-tab-WBs4Ry3_.js +0 -1
  254. package/dist/client/assets/record-editor-BA60nhWY.js +0 -1
  255. package/dist/client/assets/redirect-editor-XRwNClGT.js +0 -1
  256. package/dist/client/assets/registry-BpSMi978.js +0 -2
  257. package/dist/client/assets/settings-layout-KTbN_kWx.js +0 -1
  258. package/dist/client/assets/store-registry-CJcS99FJ.js +0 -2
  259. package/dist/client/assets/useInfiniteQuery-Bto9KSSl.js +0 -1
  260. package/dist/client/assets/useSuspenseInfiniteQuery-Df-vkKBB.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as L,c as _,b as J,ar as m1,j as p,h as hf,B as Ln,ag as Uc,ae as g1,aq as y1,cG as pf,cH as x1,aB as b1,be as $n,cI as v1,l as G,o as k1,a1 as _n,a2 as Bn,a4 as zn,bu as S1,br as pl,by as C1,bx as w1,cJ as N1,bv as M1,cK as T1,bt as E1,G as xt,n as mf,a7 as gf,e as D1,K as ht,t as fa,m as ni,E as yf,bb as xf,a9 as O1,cL as bf,p as A1,bl as vf,bm as kf,bn as Sf,bo as Cf,d as ml,cM as I1,cN as j1,bB as qc,b6 as R1}from"./index-BAedCESS.js";import{aJ as P1,b0 as L1,b1 as $1,C as _1,k as B1,u as ha,aq as z1,i as Kc,aC as F1,m as H1,b2 as W1,a_ as wf,b3 as V1,j as pa,b4 as Nf,A as Mf,b5 as wt,b6 as U1,W as q1,h as K1,z as J1,b7 as Y1,b8 as G1}from"./agent-icon-Dy2jpds_.js";import{i as ma}from"./ChevronRight-CTynsPcA.js";import{u as X1}from"./useInfiniteQuery-Bto9KSSl.js";import{a as Tf,u as Q1}from"./use-connection-CQ7bQ-r6.js";import{h as Z1,u as gl,p as e0,i as Ef,a as Df,S as t0}from"./use-mcp-client-DRbjI6tX.js";import{a as n0}from"./use-virtual-mcp-C4XUTl0E.js";import{c as r0,e as s0,a as Of,d as Tr,b as o0,T as Er}from"./table-CPMYpTul.js";import{E as Jc}from"./empty-state-Dtwkb-iN.js";import{u as Af}from"./use-infinite-scroll-hYhzTevO.js";import{a as i0}from"./use-members-CvMoH-iF.js";import{i as yl}from"./AlertCircle-CmSNkMzR.js";import{i as a0}from"./CheckCircle-CXvhBSH9.js";import{a as l0}from"./DotsVertical-DERxV0IT.js";import{i as c0}from"./XCircle-Q_FzfXfM.js";import{e as u0}from"./use-automations-DiccRABG.js";import{u as d0}from"./useSuspenseInfiniteQuery-Df-vkKBB.js";import{A as f0}from"./avatar-B93oLzxy.js";import{t as If,n as h0}from"./ChevronUp-bmYG6LkB.js";import{t as p0,b as jf,n as Rf}from"./Tool02-Cnm0LDZR.js";import{t as ri}from"./Stars01-CQM502gA.js";import{i as Pf}from"./ArrowRight-mDGbrugB.js";import{i as xl}from"./Check-Dg3ccedM.js";import{a as Lf}from"./Copy01-C_pD92sU.js";import{b as Fn,t as bl,c as Yc}from"./format-time-BtXRrtv4.js";import{u as $f}from"./use-copy-DbTeee2Q.js";import{M as vl,I as m0}from"./markdown-CNtWUp-j.js";import{g as g0,a as y0,r as x0,d as b0}from"./hooks-DxiN--jI.js";import{k as wr,q as v0,b as vs,a as k0,D as S0}from"./chat-context-DB2h4osD.js";import{c as C0}from"./monaco-editor-CFtlqgKG.js";import{M as w0}from"./mcp-app-renderer-Bwxfrw0h.js";import{g as _f}from"./types-DIUb1_Md.js";import{s as N0}from"./Eye-DtzSWYJp.js";import{s as M0}from"./XClose-B2yo755N.js";import{b as T0,a as E0}from"./Tool01-DN82p4SK.js";import{i as D0}from"./Share07-DzwLu6Js.js";import{i as O0}from"./SearchMd-CvoyvhDO.js";import{u as A0,a as I0}from"./shell-layout-8XPciKoI.js";import{a as kl}from"./use-panel-navigate-DdBCZnsD.js";import{a as Ps}from"./Image01-CSSIg-V1.js";import{n as Bf}from"./LinkExternal01-_yUVYhsR.js";import{I as Kn}from"./integration-icon-JdG4xh_j.js";import{b as Sl}from"./Users03-CxjX2yOG.js";import{a as Nt}from"./Palette-BJjA93OF.js";import{u as zf}from"./use-navigate-to-agent-CGLdpa0F.js";import{i as Ls}from"./Link01-D9m0U2Ta.js";import{g as j0}from"./use-mcp-prompts-BIzsd0iZ.js";import{d as R0,c as P0,e as L0,b as $0,D as _0}from"./dialog-DUEME7DJ.js";import{F as B0,d as z0,a as F0,e as H0,b as W0,c as V0}from"./form-r05b-I6X.js";import{I as U0}from"./input-TuiIIqH6.js";import{i as q0}from"./Globe01-DSqDXciw.js";import{i as K0}from"./Monitor01-TbxGy4uJ.js";import{n as J0}from"./Download01-BrJcEIOJ.js";import{F as Y0}from"./file-type-icon-27-E6Qdl.js";import{u as G0}from"./use-decopilot-events-Bm9EUklJ.js";const X0={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 Ff(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(X0)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function Hf(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Wf(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+Ff(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function Cl(t){const e=Math.max(t.inputTokens,t.cacheReadTokens+t.cacheWriteTokens);return e>0?t.cacheReadTokens/e:0}function KO(t){return t.reduce((e,n)=>Wf(e,n.metadata?.usage),Hf())}const Q0={damping:.7,stiffness:.05,mass:1.25},Z0=70,ey=1e3/60,ty=350;let si=!1;globalThis.document?.addEventListener("mousedown",()=>{si=!0});globalThis.document?.addEventListener("mouseup",()=>{si=!1});globalThis.document?.addEventListener("click",()=>{si=!1});const ny=(t={})=>{const[e,n]=L.useState(!1),[r,s]=L.useState(t.initial!==!1),[o,i]=L.useState(!1),a=L.useRef(null);a.current=t;const l=L.useCallback(()=>{if(!si)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const v=b.getRangeAt(0);return v.commonAncestorContainer.contains(g.current)||g.current?.contains(v.commonAncestorContainer)},[]),c=L.useCallback(b=>{d.isAtBottom=b,s(b)},[]),u=L.useCallback(b=>{d.escapedFromLock=b,n(b)},[]),d=L.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(v){if(g.current){const{scrollBehavior:k}=getComputedStyle(g.current);k!=="auto"&&(g.current.style.scrollBehavior="auto"),g.current.scrollTop=v,d.ignoreScrollToTop=g.current.scrollTop,k!=="auto"&&(g.current.style.scrollBehavior=k)}},get targetScrollTop(){return!g.current||!x.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!x.current)return 0;const{targetScrollTop:v}=this;if(!t.targetScrollTop)return v;if(b?.targetScrollTop===v)return b.calculatedScrollTop;const k=Math.max(Math.min(t.targetScrollTop(v,{scrollElement:g.current,contentElement:x.current}),v),0);return b={targetScrollTop:v,calculatedScrollTop:k},requestAnimationFrame(()=>{b=void 0}),k},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Z0}}},[]),f=L.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const v=Date.now()+(Number(b.wait)||0),k=Mi(a.current,b.animation),{ignoreEscapes:N=!1}=b;let C,S=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{C=Date.now()}):C=v+(b.duration??0);const w=async()=>{const M=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:T}=d,O=performance.now(),A=(O-(d.lastTick??O))/ey;if(d.animation||(d.animation={behavior:k,promise:M,ignoreEscapes:N}),d.animation.behavior===k&&(d.lastTick=O),l()||v>Date.now())return w();if(T<Math.min(S,d.calculatedTargetScrollTop)){if(d.animation?.behavior===k){if(k==="instant")return d.scrollTop=d.calculatedTargetScrollTop,w();d.velocity=(k.damping*d.velocity+k.stiffness*d.scrollDifference)/k.mass,d.accumulated+=d.velocity*A,d.scrollTop+=d.accumulated,d.scrollTop!==T&&(d.accumulated=0)}return w()}return C>Date.now()?(S=d.calculatedTargetScrollTop,w()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Mi(a.current,a.current.resize),ignoreEscapes:N,duration:Math.max(0,C-Date.now())||void 0}):d.isAtBottom)});return M.then(T=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),T))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===k?d.animation.promise:w()},[c,l,d]),h=L.useCallback(()=>{u(!0),c(!1)},[u,c]),m=L.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:v,ignoreScrollToTop:k}=d;let{lastScrollTop:N=v}=d;d.lastScrollTop=v,d.ignoreScrollToTop=void 0,k&&k>v&&(N=k),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||v===k)return;if(l()){u(!0),c(!1);return}const C=v>N,S=v<N;if(d.animation?.ignoreEscapes){d.scrollTop=N;return}S&&(u(!0),c(!1)),C&&u(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[u,c,l,d]),y=L.useCallback(({target:b,deltaY:v})=>{let k=b;for(;!["scroll","auto"].includes(getComputedStyle(k).overflow);){if(!k.parentElement)return;k=k.parentElement}k===g.current&&v<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),c(!1))},[u,c,d]),g=Gc(b=>{g.current?.removeEventListener("scroll",m),g.current?.removeEventListener("wheel",y),b?.addEventListener("scroll",m,{passive:!0}),b?.addEventListener("wheel",y,{passive:!0})},[]),x=Gc(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let v;d.resizeObserver=new ResizeObserver(([k])=>{const{height:N}=k.contentRect,C=N-(v??N);if(d.resizeDifference=C,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),C>=0){const S=Mi(a.current,v?a.current.resize:a.current.initial);f({animation:S,wait:!0,preserveScrollPosition:!0,duration:S==="instant"?void 0:ty})}else d.isNearBottom&&(u(!1),c(!0));v=N,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===C&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:x,scrollRef:g,scrollToBottom:f,stopScroll:h,isAtBottom:r||o,isNearBottom:o,escapedFromLock:e,state:d}};function Gc(t,e){const n=L.useCallback(r=>(n.current=r,t(r)),e);return n}const Ni=new Map;function Mi(...t){const e={...Q0};let n=!1;for(const s of t){if(s==="instant"){n=!0;continue}typeof s=="object"&&(n=!1,e.damping=s.damping??e.damping,e.stiffness=s.stiffness??e.stiffness,e.mass=s.mass??e.mass)}const r=JSON.stringify(e);return Ni.has(r)||Ni.set(r,Object.freeze(e)),n?"instant":Ni.get(r)}function ry(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 wl(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Nl(t,e){if(!e)return t;const n=`${ry(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function sy(t,e){return Nl(t,e).replace(/[_-]/g," ").toLowerCase()}function oy(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?Uc().min(1,e):Uc();return g1(n)}function iy(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function ay(t){const e=_.c(74),{prompt:n,setPrompt:r,onSubmit:s,defaultValues:o}=t,i=L.useId(),a=J();let l,c;if(e[0]!==n||e[1]!==a){const W=oy(n,a("chat.dialogPromptArguments.required"));c=y1,l=m1(W),e[0]=n,e[1]=a,e[2]=l,e[3]=c}else l=e[2],c=e[3];let u;e[4]!==o||e[5]!==n?(u=n?iy(n,o):{},e[4]=o,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==l||e[8]!==u?(d={resolver:l,defaultValues:u,mode:"onChange"},e[7]=l,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const m=h;let y;e[12]!==f||e[13]!==s||e[14]!==r?(y=async W=>{await s(W),r(null),f.reset()},e[12]=f,e[13]=s,e[14]=r,e[15]=y):y=e[15];const g=y;let x;e[16]!==f||e[17]!==r?(x=W=>{W||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=x):x=e[18];const b=x;if(!n)return null;let v;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(v=n.title||sy(n.name,wl(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=v):v=e[22];let k;e[23]!==v?(k=p.jsx(R0,{children:p.jsx("span",{className:"capitalize",children:v})}),e[23]=v,e[24]=k):k=e[24];let N;e[25]!==n.description?(N=n.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=N):N=e[26];let C;e[27]!==N||e[28]!==k?(C=p.jsxs(P0,{children:[k,N]}),e[27]=N,e[28]=k,e[29]=C):C=e[29];let S;e[30]!==f||e[31]!==g?(S=W=>{W.stopPropagation(),f.handleSubmit(g)(W)},e[30]=f,e[31]=g,e[32]=S):S=e[32];let w;if(e[33]!==m||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==a){let W;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==a?(W=q=>p.jsx(z0,{control:f.control,name:q.name,render:X=>{const{field:te}=X;return p.jsxs(F0,{children:[p.jsxs(H0,{className:"text-xs",children:[q.name,q.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",a("chat.dialogPromptArguments.optional")]})]}),p.jsx(W0,{children:p.jsx(U0,{...te,value:te.value??"",required:q.required,placeholder:q.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),p.jsx(V0,{})]})}},q.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=a,e[41]=W):W=e[41],w=m.map(W),e[33]=m,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=a,e[37]=w}else w=e[37];let M;e[42]!==b?(M=()=>b(!1),e[42]=b,e[43]=M):M=e[43];const T=f.formState.isSubmitting;let O;e[44]!==a?(O=a("chat.dialogPromptArguments.cancel"),e[44]=a,e[45]=O):O=e[45];let A;e[46]!==f.formState.isSubmitting||e[47]!==M||e[48]!==O?(A=p.jsx(Ln,{type:"button",variant:"ghost",onClick:M,disabled:T,children:O}),e[46]=f.formState.isSubmitting,e[47]=M,e[48]=O,e[49]=A):A=e[49];let P;e[50]!==f.formState.isSubmitting||e[51]!==a?(P=f.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(hf,{size:"xs"}),a("chat.dialogPromptArguments.loading")]}):a("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=a,e[52]=P):P=e[52];let D;e[53]!==f.formState.isSubmitting||e[54]!==i||e[55]!==P?(D=p.jsx(Ln,{type:"submit",form:i,disabled:f.formState.isSubmitting,children:P}),e[53]=f.formState.isSubmitting,e[54]=i,e[55]=P,e[56]=D):D=e[56];let E;e[57]!==A||e[58]!==D?(E=p.jsxs(L0,{children:[A,D]}),e[57]=A,e[58]=D,e[59]=E):E=e[59];let j;e[60]!==i||e[61]!==S||e[62]!==w||e[63]!==E?(j=p.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[w,E]}),e[60]=i,e[61]=S,e[62]=w,e[63]=E,e[64]=j):j=e[64];let I;e[65]!==f||e[66]!==j?(I=p.jsx(B0,{...f,children:j}),e[65]=f,e[66]=j,e[67]=I):I=e[67];let R;e[68]!==C||e[69]!==I?(R=p.jsxs($0,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[C,I]}),e[68]=C,e[69]=I,e[70]=R):R=e[70];let z;return e[71]!==b||e[72]!==R?(z=p.jsx(_0,{open:!0,onOpenChange:b,children:R}),e[71]=b,e[72]=R,e[73]=z):z=e[73],z}function ga(t){return t?t.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function It(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 Nr(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}var Xc=Object.defineProperty,ly=(t,e)=>{let n={};for(var r in t)Xc(n,r,{get:t[r],enumerable:!0});return Xc(n,Symbol.toStringTag,{value:"Module"}),n};function Ie(t){this.content=t}Ie.prototype={constructor:Ie,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,s=r.find(t),o=r.content.slice();return s==-1?o.push(n||t,e):(o[s+1]=e,n&&(o[s]=n)),new Ie(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ie(n)},addToStart:function(t,e){return new Ie([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ie(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),o=r.find(t);return s.splice(o==-1?s.length:o,0,e,n),new Ie(s)},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=Ie.from(t),t.size?new Ie(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ie.from(t),t.size?new Ie(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ie.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}};Ie.from=function(t){if(t instanceof Ie)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ie(e)};function Vf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),o=e.child(r);if(s==o){n+=s.nodeSize;continue}if(!s.sameMarkup(o))return n;if(s.isText&&s.text!=o.text){let i=s.text,a=o.text,l=0;for(;i[l]==a[l];l++)n++;return l&&l<i.length&&l<a.length&&Kf(i.charCodeAt(l-1))&&qf(i.charCodeAt(l))&&n--,n}if(s.content.size||o.content.size){let i=Vf(s.content,o.content,n+1);if(i!=null)return i}n+=s.nodeSize}}function Uf(t,e,n,r){for(let s=t.childCount,o=e.childCount;;){if(s==0||o==0)return s==o?null:{a:n,b:r};let i=t.child(--s),a=e.child(--o),l=i.nodeSize;if(i==a){n-=l,r-=l;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let c=i.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&Kf(c.charCodeAt(d-1))&&qf(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(i.content.size||a.content.size){let c=Uf(i.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function qf(t){return t>=56320&&t<57344}function Kf(t){return t>=55296&&t<56320}class ${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,s=0,o){for(let i=0,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;if(c>e&&r(l,s+a,o||null,i)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,s+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let o="",i=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(i?i=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)s.push(e.content[o]);return new $(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let o=0,i=0;i<n;o++){let a=this.content[o],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),s+=a.nodeSize),i=l}return new $(r,s)}cutByIndex(e,n){return e==n?$.empty:e==0&&n==this.content.length?this:new $(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new $(s,o)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(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 s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Vf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Uf(this,e,n,r)}findIndex(e){if(e==0)return $s(0,e);if(e==this.size)return $s(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 s=this.child(n),o=r+s.nodeSize;if(o>=e)return o==e?$s(n+1,o):$s(n,r);r=o}}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 $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return $.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let n,r=0;for(let s=0;s<e.length;s++){let o=e[s];r+=o.nodeSize,s&&o.isText&&e[s-1].sameMarkup(o)?(n||(n=e.slice(0,s)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new $(n||e,r)}static from(e){if(!e)return $.empty;if(e instanceof $)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new $([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const Ti={index:0,offset:0};function $s(t,e){return Ti.index=t,Ti.offset=e,Ti}function io(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(!io(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!io(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let le=class ya{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let o=e[s];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,s));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(o)}}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&&io(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 s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}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 ya.none;if(e instanceof ya)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};le.none=[];class ss extends Error{}class F{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=Yf(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Jf(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 F.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F($.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)s++;return new F(e,r,s)}}F.empty=new F($.empty,0,0);function Jf(t,e,n){let{index:r,offset:s}=t.findIndex(e),o=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(s==e||o.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Jf(o.content,e-s-1,n-s-1)))}function Yf(t,e,n,r,s,o){let{index:i,offset:a}=t.findIndex(e),l=t.maybeChild(i);if(a==e||l.isText)return o&&r<=0&&s<=0&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=Yf(l.content,e-a-1,n,i==0?r-1:0,i==t.childCount-1?s-1:0,l);return c&&t.replaceChild(i,l.copy(c))}function cy(t,e,n){if(n.openStart>t.depth)throw new ss("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ss("Inconsistent open depths");return Gf(t,e,n,0)}function Gf(t,e,n,r){let s=t.index(r),o=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let i=Gf(t,e,n,r+1);return o.copy(o.content.replaceChild(s,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,a=i.content;return Dn(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=uy(n,t);return Dn(o,Qf(t,i,a,e,r))}else return Dn(o,ao(t,e,r))}function Xf(t,e){if(!e.type.compatibleContent(t.type))throw new ss("Cannot join "+e.type.name+" onto "+t.type.name)}function xa(t,e,n){let r=t.node(n);return Xf(r,e.node(n)),r}function En(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 Wr(t,e,n,r){let s=(e||t).node(n),o=0,i=e?e.index(n):s.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(En(t.nodeAfter,r),o++));for(let a=o;a<i;a++)En(s.child(a),r);e&&e.depth==n&&e.textOffset&&En(e.nodeBefore,r)}function Dn(t,e){if(!t.type.validContent(e))throw new ss("Invalid content for node "+t.type.name);return t.copy(e)}function Qf(t,e,n,r,s){let o=t.depth>s&&xa(t,e,s+1),i=r.depth>s&&xa(n,r,s+1),a=[];return Wr(null,t,s,a),o&&i&&e.index(s)==n.index(s)?(Xf(o,i),En(Dn(o,Qf(t,e,n,r,s+1)),a)):(o&&En(Dn(o,ao(t,e,s+1)),a),Wr(e,n,s,a),i&&En(Dn(i,ao(n,r,s+1)),a)),Wr(r,null,s,a),new $(a)}function ao(t,e,n){let r=[];if(Wr(null,t,n,r),t.depth>n){let s=xa(t,e,n+1);En(Dn(s,ao(t,e,n+1)),r)}return Wr(e,null,n,r),new $(r)}function uy(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)s=e.node(o).copy($.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class is{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],s=e.child(n);return r?e.child(n).cut(r):s}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],s=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)s+=r.child(o).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return le.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let a=r;r=s,s=a}let o=r.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!s||!o[i].isInSet(s.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].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 lo(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=[],s=0,o=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(o),c=o-l;if(r.push(i,a,s+l),!c||(i=i.child(a),i.isText))break;o=c-1,s+=l+1}return new is(n,r,o)}static resolveCached(e,n){let r=Qc.get(e);if(r)for(let o=0;o<r.elts.length;o++){let i=r.elts[o];if(i.pos==n)return i}else Qc.set(e,r=new dy);let s=r.elts[r.i]=is.resolve(e,n);return r.i=(r.i+1)%fy,s}}class dy{constructor(){this.elts=[],this.i=0}}const fy=12,Qc=new WeakMap;class lo{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 hy=Object.create(null);let On=class ba{constructor(e,n,r,s=le.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||$.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,s=0){this.content.nodesBetween(e,n,r,s,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,s){return this.content.textBetween(e,n,r,s)}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&&io(this.attrs,n||e.defaultAttrs||hy)&&le.sameSet(this.marks,r||le.none)}copy(e=null){return e==this.content?this:new ba(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ba(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 F.empty;let s=this.resolve(e),o=this.resolve(n),i=r?0:s.sharedDepth(n),a=s.start(i),c=s.node(i).content.cut(s.pos-a,o.pos-a);return new F(c,s.depth-i,o.depth-i)}replace(e,n,r){return cy(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+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 s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return is.resolveCached(this,e)}resolveNoCache(e){return is.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(s=!0),!s)),s}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()+")"),Zf(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=$.empty,s=0,o=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,s,o),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=s;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(e).matchType(r),i=o&&o.matchFragment(this.content,n);return i?i.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=le.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(!le.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 s=$.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,s,r);return o.type.checkAttrs(o.attrs),o}};On.prototype.text=void 0;class co extends On{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zf(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 co(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new co(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 Zf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Hn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new py(e,n);if(r.next==null)return Hn.empty;let s=eh(r);r.next&&r.err("Unexpected trailing text");let o=ky(vy(s));return Sy(o,r),o}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 s=this;for(let o=n;s&&o<r;o++)s=s.matchType(e.child(o).type);return s}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 s=[this];function o(i,a){let l=i.matchFragment(e,r);if(l&&(!n||l.validEnd))return $.from(a.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=o(d,a.concat(u));if(f)return f}}return null}return o(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 s=r.shift(),o=s.match;if(o.matchType(e)){let i=[];for(let a=s;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:a,next:l}=o.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!s.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:s}),n[a.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 s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let o=s+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)o+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return o}).join(`
1
+ import{r as L,c as _,b as J,ar as m1,j as p,h as hf,B as Ln,ag as Uc,ae as g1,aq as y1,cG as pf,cH as x1,aB as b1,be as $n,cI as v1,l as G,o as k1,a1 as _n,a2 as Bn,a4 as zn,bu as S1,br as pl,by as C1,bx as w1,cJ as N1,bv as M1,cK as T1,bt as E1,G as xt,n as mf,a7 as gf,e as D1,K as ht,t as fa,m as ni,E as yf,bb as xf,a9 as O1,cL as bf,p as A1,bl as vf,bm as kf,bn as Sf,bo as Cf,d as ml,cM as I1,cN as j1,bB as qc,b6 as R1}from"./index-BbDu2xq3.js";import{aJ as P1,b0 as L1,b1 as $1,C as _1,k as B1,u as ha,aq as z1,i as Kc,aC as F1,m as H1,b2 as W1,a_ as wf,b3 as V1,j as pa,b4 as Nf,A as Mf,b5 as wt,b6 as U1,W as q1,h as K1,z as J1,b7 as Y1,b8 as G1}from"./agent-icon-7Ul-3CFr.js";import{i as ma}from"./ChevronRight-CHv3VYgp.js";import{u as X1}from"./useInfiniteQuery-DHse_DiU.js";import{a as Tf,u as Q1}from"./use-connection-C2nO_AVv.js";import{h as Z1,u as gl,p as e0,i as Ef,a as Df,S as t0}from"./use-mcp-client-BPlXnENu.js";import{a as n0}from"./use-virtual-mcp-DaOGpnoF.js";import{c as r0,e as s0,a as Of,d as Tr,b as o0,T as Er}from"./table-B5Vs3GY1.js";import{E as Jc}from"./empty-state-Cm5_JlLy.js";import{u as Af}from"./use-infinite-scroll-ClPXgDIl.js";import{a as i0}from"./use-members-BeBhwrLZ.js";import{i as yl}from"./AlertCircle-DM1wOTV-.js";import{i as a0}from"./CheckCircle-dm6kQxSf.js";import{a as l0}from"./DotsVertical-BrftgIDe.js";import{i as c0}from"./XCircle-CJuCeBSM.js";import{e as u0}from"./use-automations-BdYWhhm1.js";import{u as d0}from"./useSuspenseInfiniteQuery-DnuTSRTu.js";import{A as f0}from"./avatar-BPVI4atE.js";import{t as If,n as h0}from"./ChevronUp-t8t4fwnR.js";import{t as p0,b as jf,n as Rf}from"./Tool02-DJ6ebzoK.js";import{t as ri}from"./Stars01-XqGB97Zv.js";import{i as Pf}from"./ArrowRight-B-LgiGJk.js";import{i as xl}from"./Check-B_YxhG30.js";import{a as Lf}from"./Copy01-Cka2uFEv.js";import{b as Fn,t as bl,c as Yc}from"./format-time-BtXRrtv4.js";import{u as $f}from"./use-copy-BBc3d83z.js";import{M as vl,I as m0}from"./markdown-DUDS1ORg.js";import{g as g0,a as y0,r as x0,d as b0}from"./hooks-DpCU1UBz.js";import{k as wr,q as v0,b as vs,a as k0,D as S0}from"./chat-context-Cnf8ag8e.js";import{c as C0}from"./monaco-editor-CQBFoghF.js";import{M as w0}from"./mcp-app-renderer-D7KTrdiy.js";import{g as _f}from"./types-DejsVxb8.js";import{s as N0}from"./Eye-Cze9SkdO.js";import{s as M0}from"./XClose-C3LO4RAn.js";import{b as T0,a as E0}from"./Tool01-BfzgVlWE.js";import{i as D0}from"./Share07-DxFaah4G.js";import{i as O0}from"./SearchMd-DBtIEQFG.js";import{u as A0,a as I0}from"./shell-layout-CjwLOLgP.js";import{a as kl}from"./use-panel-navigate-BSB806-r.js";import{a as Ps}from"./Image01-DPhR8WEz.js";import{n as Bf}from"./LinkExternal01-Dd9_oVMY.js";import{I as Kn}from"./integration-icon-BY9o6bXu.js";import{b as Sl}from"./Users03-BX6ICswR.js";import{a as Nt}from"./Palette-CPWVOo_O.js";import{u as zf}from"./use-navigate-to-agent-874sGcUI.js";import{i as Ls}from"./Link01-BT9hUC6n.js";import{g as j0}from"./use-mcp-prompts-D5jv-rPf.js";import{d as R0,c as P0,e as L0,b as $0,D as _0}from"./dialog-DBF7H4cU.js";import{F as B0,d as z0,a as F0,e as H0,b as W0,c as V0}from"./form-D5aJ2R1e.js";import{I as U0}from"./input-2a-tqySq.js";import{i as q0}from"./Globe01-CFZdQViA.js";import{i as K0}from"./Monitor01-lCN_Uznr.js";import{n as J0}from"./Download01-ytOYmKSZ.js";import{F as Y0}from"./file-type-icon-CGvcwfte.js";import{u as G0}from"./use-decopilot-events-BRjyeJJo.js";const X0={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 Ff(t){if(!t?.providerMetadata)return 0;for(const e of Object.values(X0)){const n=e(t.providerMetadata);if(n!==null)return n}return 0}function Hf(){return{inputTokens:0,outputTokens:0,reasoningTokens:0,totalTokens:0,cost:0,cacheReadTokens:0,cacheWriteTokens:0}}function Wf(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+Ff(e),cacheReadTokens:t.cacheReadTokens+n,cacheWriteTokens:t.cacheWriteTokens+r}}function Cl(t){const e=Math.max(t.inputTokens,t.cacheReadTokens+t.cacheWriteTokens);return e>0?t.cacheReadTokens/e:0}function KO(t){return t.reduce((e,n)=>Wf(e,n.metadata?.usage),Hf())}const Q0={damping:.7,stiffness:.05,mass:1.25},Z0=70,ey=1e3/60,ty=350;let si=!1;globalThis.document?.addEventListener("mousedown",()=>{si=!0});globalThis.document?.addEventListener("mouseup",()=>{si=!1});globalThis.document?.addEventListener("click",()=>{si=!1});const ny=(t={})=>{const[e,n]=L.useState(!1),[r,s]=L.useState(t.initial!==!1),[o,i]=L.useState(!1),a=L.useRef(null);a.current=t;const l=L.useCallback(()=>{if(!si)return!1;const b=window.getSelection();if(!b||!b.rangeCount)return!1;const v=b.getRangeAt(0);return v.commonAncestorContainer.contains(g.current)||g.current?.contains(v.commonAncestorContainer)},[]),c=L.useCallback(b=>{d.isAtBottom=b,s(b)},[]),u=L.useCallback(b=>{d.escapedFromLock=b,n(b)},[]),d=L.useMemo(()=>{let b;return{escapedFromLock:e,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(v){if(g.current){const{scrollBehavior:k}=getComputedStyle(g.current);k!=="auto"&&(g.current.style.scrollBehavior="auto"),g.current.scrollTop=v,d.ignoreScrollToTop=g.current.scrollTop,k!=="auto"&&(g.current.style.scrollBehavior=k)}},get targetScrollTop(){return!g.current||!x.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!x.current)return 0;const{targetScrollTop:v}=this;if(!t.targetScrollTop)return v;if(b?.targetScrollTop===v)return b.calculatedScrollTop;const k=Math.max(Math.min(t.targetScrollTop(v,{scrollElement:g.current,contentElement:x.current}),v),0);return b={targetScrollTop:v,calculatedScrollTop:k},requestAnimationFrame(()=>{b=void 0}),k},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Z0}}},[]),f=L.useCallback((b={})=>{typeof b=="string"&&(b={animation:b}),b.preserveScrollPosition||c(!0);const v=Date.now()+(Number(b.wait)||0),k=Mi(a.current,b.animation),{ignoreEscapes:N=!1}=b;let C,S=d.calculatedTargetScrollTop;b.duration instanceof Promise?b.duration.finally(()=>{C=Date.now()}):C=v+(b.duration??0);const w=async()=>{const M=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;const{scrollTop:T}=d,O=performance.now(),A=(O-(d.lastTick??O))/ey;if(d.animation||(d.animation={behavior:k,promise:M,ignoreEscapes:N}),d.animation.behavior===k&&(d.lastTick=O),l()||v>Date.now())return w();if(T<Math.min(S,d.calculatedTargetScrollTop)){if(d.animation?.behavior===k){if(k==="instant")return d.scrollTop=d.calculatedTargetScrollTop,w();d.velocity=(k.damping*d.velocity+k.stiffness*d.scrollDifference)/k.mass,d.accumulated+=d.velocity*A,d.scrollTop+=d.accumulated,d.scrollTop!==T&&(d.accumulated=0)}return w()}return C>Date.now()?(S=d.calculatedTargetScrollTop,w()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Mi(a.current,a.current.resize),ignoreEscapes:N,duration:Math.max(0,C-Date.now())||void 0}):d.isAtBottom)});return M.then(T=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),T))};return b.wait!==!0&&(d.animation=void 0),d.animation?.behavior===k?d.animation.promise:w()},[c,l,d]),h=L.useCallback(()=>{u(!0),c(!1)},[u,c]),m=L.useCallback(({target:b})=>{if(b!==g.current)return;const{scrollTop:v,ignoreScrollToTop:k}=d;let{lastScrollTop:N=v}=d;d.lastScrollTop=v,d.ignoreScrollToTop=void 0,k&&k>v&&(N=k),i(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||v===k)return;if(l()){u(!0),c(!1);return}const C=v>N,S=v<N;if(d.animation?.ignoreEscapes){d.scrollTop=N;return}S&&(u(!0),c(!1)),C&&u(!1),!d.escapedFromLock&&d.isNearBottom&&c(!0)},1)},[u,c,l,d]),y=L.useCallback(({target:b,deltaY:v})=>{let k=b;for(;!["scroll","auto"].includes(getComputedStyle(k).overflow);){if(!k.parentElement)return;k=k.parentElement}k===g.current&&v<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),c(!1))},[u,c,d]),g=Gc(b=>{g.current?.removeEventListener("scroll",m),g.current?.removeEventListener("wheel",y),b?.addEventListener("scroll",m,{passive:!0}),b?.addEventListener("wheel",y,{passive:!0})},[]),x=Gc(b=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!b)return;let v;d.resizeObserver=new ResizeObserver(([k])=>{const{height:N}=k.contentRect,C=N-(v??N);if(d.resizeDifference=C,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),i(d.isNearBottom),C>=0){const S=Mi(a.current,v?a.current.resize:a.current.initial);f({animation:S,wait:!0,preserveScrollPosition:!0,duration:S==="instant"?void 0:ty})}else d.isNearBottom&&(u(!1),c(!0));v=N,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===C&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(b)},[]);return{contentRef:x,scrollRef:g,scrollToBottom:f,stopScroll:h,isAtBottom:r||o,isNearBottom:o,escapedFromLock:e,state:d}};function Gc(t,e){const n=L.useCallback(r=>(n.current=r,t(r)),e);return n}const Ni=new Map;function Mi(...t){const e={...Q0};let n=!1;for(const s of t){if(s==="instant"){n=!0;continue}typeof s=="object"&&(n=!1,e.damping=s.damping??e.damping,e.stiffness=s.stiffness??e.stiffness,e.mass=s.mass??e.mass)}const r=JSON.stringify(e);return Ni.has(r)||Ni.set(r,Object.freeze(e)),n?"instant":Ni.get(r)}function ry(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 wl(t){if(t&&typeof t=="object"&&"gatewayClientId"in t&&typeof t.gatewayClientId=="string")return t.gatewayClientId}function Nl(t,e){if(!e)return t;const n=`${ry(e)}_`;return t.startsWith(n)?t.slice(n.length):t}function sy(t,e){return Nl(t,e).replace(/[_-]/g," ").toLowerCase()}function oy(t,e){const n={};for(const r of t?.arguments??[])n[r.name]=r.required?Uc().min(1,e):Uc();return g1(n)}function iy(t,e){const n={};for(const r of t.arguments??[])n[r.name]=e?.[r.name]??"";return n}function ay(t){const e=_.c(74),{prompt:n,setPrompt:r,onSubmit:s,defaultValues:o}=t,i=L.useId(),a=J();let l,c;if(e[0]!==n||e[1]!==a){const W=oy(n,a("chat.dialogPromptArguments.required"));c=y1,l=m1(W),e[0]=n,e[1]=a,e[2]=l,e[3]=c}else l=e[2],c=e[3];let u;e[4]!==o||e[5]!==n?(u=n?iy(n,o):{},e[4]=o,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==l||e[8]!==u?(d={resolver:l,defaultValues:u,mode:"onChange"},e[7]=l,e[8]=u,e[9]=d):d=e[9];const f=c(d);let h;e[10]!==n?.arguments?(h=n?.arguments??[],e[10]=n?.arguments,e[11]=h):h=e[11];const m=h;let y;e[12]!==f||e[13]!==s||e[14]!==r?(y=async W=>{await s(W),r(null),f.reset()},e[12]=f,e[13]=s,e[14]=r,e[15]=y):y=e[15];const g=y;let x;e[16]!==f||e[17]!==r?(x=W=>{W||(f.reset(),r(null))},e[16]=f,e[17]=r,e[18]=x):x=e[18];const b=x;if(!n)return null;let v;e[19]!==n._meta||e[20]!==n.name||e[21]!==n.title?(v=n.title||sy(n.name,wl(n._meta)),e[19]=n._meta,e[20]=n.name,e[21]=n.title,e[22]=v):v=e[22];let k;e[23]!==v?(k=p.jsx(R0,{children:p.jsx("span",{className:"capitalize",children:v})}),e[23]=v,e[24]=k):k=e[24];let N;e[25]!==n.description?(N=n.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[25]=n.description,e[26]=N):N=e[26];let C;e[27]!==N||e[28]!==k?(C=p.jsxs(P0,{children:[k,N]}),e[27]=N,e[28]=k,e[29]=C):C=e[29];let S;e[30]!==f||e[31]!==g?(S=W=>{W.stopPropagation(),f.handleSubmit(g)(W)},e[30]=f,e[31]=g,e[32]=S):S=e[32];let w;if(e[33]!==m||e[34]!==f.control||e[35]!==f.formState.isSubmitting||e[36]!==a){let W;e[38]!==f.control||e[39]!==f.formState.isSubmitting||e[40]!==a?(W=q=>p.jsx(z0,{control:f.control,name:q.name,render:X=>{const{field:te}=X;return p.jsxs(F0,{children:[p.jsxs(H0,{className:"text-xs",children:[q.name,q.required?null:p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" ",a("chat.dialogPromptArguments.optional")]})]}),p.jsx(W0,{children:p.jsx(U0,{...te,value:te.value??"",required:q.required,placeholder:q.description??"",className:"h-9",disabled:f.formState.isSubmitting})}),p.jsx(V0,{})]})}},q.name),e[38]=f.control,e[39]=f.formState.isSubmitting,e[40]=a,e[41]=W):W=e[41],w=m.map(W),e[33]=m,e[34]=f.control,e[35]=f.formState.isSubmitting,e[36]=a,e[37]=w}else w=e[37];let M;e[42]!==b?(M=()=>b(!1),e[42]=b,e[43]=M):M=e[43];const T=f.formState.isSubmitting;let O;e[44]!==a?(O=a("chat.dialogPromptArguments.cancel"),e[44]=a,e[45]=O):O=e[45];let A;e[46]!==f.formState.isSubmitting||e[47]!==M||e[48]!==O?(A=p.jsx(Ln,{type:"button",variant:"ghost",onClick:M,disabled:T,children:O}),e[46]=f.formState.isSubmitting,e[47]=M,e[48]=O,e[49]=A):A=e[49];let P;e[50]!==f.formState.isSubmitting||e[51]!==a?(P=f.formState.isSubmitting?p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(hf,{size:"xs"}),a("chat.dialogPromptArguments.loading")]}):a("chat.dialogPromptArguments.usePrompt"),e[50]=f.formState.isSubmitting,e[51]=a,e[52]=P):P=e[52];let D;e[53]!==f.formState.isSubmitting||e[54]!==i||e[55]!==P?(D=p.jsx(Ln,{type:"submit",form:i,disabled:f.formState.isSubmitting,children:P}),e[53]=f.formState.isSubmitting,e[54]=i,e[55]=P,e[56]=D):D=e[56];let E;e[57]!==A||e[58]!==D?(E=p.jsxs(L0,{children:[A,D]}),e[57]=A,e[58]=D,e[59]=E):E=e[59];let j;e[60]!==i||e[61]!==S||e[62]!==w||e[63]!==E?(j=p.jsxs("form",{id:i,className:"space-y-4 py-4",autoComplete:"off",onSubmit:S,children:[w,E]}),e[60]=i,e[61]=S,e[62]=w,e[63]=E,e[64]=j):j=e[64];let I;e[65]!==f||e[66]!==j?(I=p.jsx(B0,{...f,children:j}),e[65]=f,e[66]=j,e[67]=I):I=e[67];let R;e[68]!==C||e[69]!==I?(R=p.jsxs($0,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[C,I]}),e[68]=C,e[69]=I,e[70]=R):R=e[70];let z;return e[71]!==b||e[72]!==R?(z=p.jsx(_0,{open:!0,onOpenChange:b,children:R}),e[71]=b,e[72]=R,e[73]=z):z=e[73],z}function ga(t){return t?t.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function It(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 Nr(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}var Xc=Object.defineProperty,ly=(t,e)=>{let n={};for(var r in t)Xc(n,r,{get:t[r],enumerable:!0});return Xc(n,Symbol.toStringTag,{value:"Module"}),n};function Ie(t){this.content=t}Ie.prototype={constructor:Ie,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,s=r.find(t),o=r.content.slice();return s==-1?o.push(n||t,e):(o[s+1]=e,n&&(o[s]=n)),new Ie(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ie(n)},addToStart:function(t,e){return new Ie([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ie(n)},addBefore:function(t,e,n){var r=this.remove(e),s=r.content.slice(),o=r.find(t);return s.splice(o==-1?s.length:o,0,e,n),new Ie(s)},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=Ie.from(t),t.size?new Ie(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ie.from(t),t.size?new Ie(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ie.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}};Ie.from=function(t){if(t instanceof Ie)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ie(e)};function Vf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),o=e.child(r);if(s==o){n+=s.nodeSize;continue}if(!s.sameMarkup(o))return n;if(s.isText&&s.text!=o.text){let i=s.text,a=o.text,l=0;for(;i[l]==a[l];l++)n++;return l&&l<i.length&&l<a.length&&Kf(i.charCodeAt(l-1))&&qf(i.charCodeAt(l))&&n--,n}if(s.content.size||o.content.size){let i=Vf(s.content,o.content,n+1);if(i!=null)return i}n+=s.nodeSize}}function Uf(t,e,n,r){for(let s=t.childCount,o=e.childCount;;){if(s==0||o==0)return s==o?null:{a:n,b:r};let i=t.child(--s),a=e.child(--o),l=i.nodeSize;if(i==a){n-=l,r-=l;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let c=i.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,n--,r--;return d&&f&&d<c.length&&Kf(c.charCodeAt(d-1))&&qf(c.charCodeAt(d))&&(n++,r++),{a:n,b:r}}if(i.content.size||a.content.size){let c=Uf(i.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}function qf(t){return t>=56320&&t<57344}function Kf(t){return t>=55296&&t<56320}class ${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,s=0,o){for(let i=0,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;if(c>e&&r(l,s+a,o||null,i)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,s+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let o="",i=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(i?i=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)s.push(e.content[o]);return new $(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],s=0;if(n>e)for(let o=0,i=0;i<n;o++){let a=this.content[o],l=i+a.nodeSize;l>e&&((i<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),s+=a.nodeSize),i=l}return new $(r,s)}cutByIndex(e,n){return e==n?$.empty:e==0&&n==this.content.length?this:new $(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new $(s,o)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(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 s=this.content[n];e(s,r,n),r+=s.nodeSize}}findDiffStart(e,n=0){return Vf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Uf(this,e,n,r)}findIndex(e){if(e==0)return $s(0,e);if(e==this.size)return $s(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 s=this.child(n),o=r+s.nodeSize;if(o>=e)return o==e?$s(n+1,o):$s(n,r);r=o}}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 $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return $.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let n,r=0;for(let s=0;s<e.length;s++){let o=e[s];r+=o.nodeSize,s&&o.isText&&e[s-1].sameMarkup(o)?(n||(n=e.slice(0,s)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new $(n||e,r)}static from(e){if(!e)return $.empty;if(e instanceof $)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new $([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const Ti={index:0,offset:0};function $s(t,e){return Ti.index=t,Ti.offset=e,Ti}function io(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(!io(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!io(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let le=class ya{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let s=0;s<e.length;s++){let o=e[s];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,s));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(o)}}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&&io(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 s=r.create(n.attrs);return r.checkAttrs(s.attrs),s}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 ya.none;if(e instanceof ya)return[e];let n=e.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};le.none=[];class ss extends Error{}class F{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=Yf(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Jf(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 F.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F($.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)s++;return new F(e,r,s)}}F.empty=new F($.empty,0,0);function Jf(t,e,n){let{index:r,offset:s}=t.findIndex(e),o=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(s==e||o.isText){if(a!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Jf(o.content,e-s-1,n-s-1)))}function Yf(t,e,n,r,s,o){let{index:i,offset:a}=t.findIndex(e),l=t.maybeChild(i);if(a==e||l.isText)return o&&r<=0&&s<=0&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=Yf(l.content,e-a-1,n,i==0?r-1:0,i==t.childCount-1?s-1:0,l);return c&&t.replaceChild(i,l.copy(c))}function cy(t,e,n){if(n.openStart>t.depth)throw new ss("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ss("Inconsistent open depths");return Gf(t,e,n,0)}function Gf(t,e,n,r){let s=t.index(r),o=t.node(r);if(s==e.index(r)&&r<t.depth-n.openStart){let i=Gf(t,e,n,r+1);return o.copy(o.content.replaceChild(s,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,a=i.content;return Dn(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=uy(n,t);return Dn(o,Qf(t,i,a,e,r))}else return Dn(o,ao(t,e,r))}function Xf(t,e){if(!e.type.compatibleContent(t.type))throw new ss("Cannot join "+e.type.name+" onto "+t.type.name)}function xa(t,e,n){let r=t.node(n);return Xf(r,e.node(n)),r}function En(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 Wr(t,e,n,r){let s=(e||t).node(n),o=0,i=e?e.index(n):s.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(En(t.nodeAfter,r),o++));for(let a=o;a<i;a++)En(s.child(a),r);e&&e.depth==n&&e.textOffset&&En(e.nodeBefore,r)}function Dn(t,e){if(!t.type.validContent(e))throw new ss("Invalid content for node "+t.type.name);return t.copy(e)}function Qf(t,e,n,r,s){let o=t.depth>s&&xa(t,e,s+1),i=r.depth>s&&xa(n,r,s+1),a=[];return Wr(null,t,s,a),o&&i&&e.index(s)==n.index(s)?(Xf(o,i),En(Dn(o,Qf(t,e,n,r,s+1)),a)):(o&&En(Dn(o,ao(t,e,s+1)),a),Wr(e,n,s,a),i&&En(Dn(i,ao(n,r,s+1)),a)),Wr(r,null,s,a),new $(a)}function ao(t,e,n){let r=[];if(Wr(null,t,n,r),t.depth>n){let s=xa(t,e,n+1);En(Dn(s,ao(t,e,n+1)),r)}return Wr(e,null,n,r),new $(r)}function uy(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)s=e.node(o).copy($.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class is{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],s=e.child(n);return r?e.child(n).cut(r):s}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],s=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)s+=r.child(o).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return le.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),s=e.maybeChild(n);if(!r){let a=r;r=s,s=a}let o=r.marks;for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!s||!o[i].isInSet(s.marks))&&(o=o[i--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].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 lo(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=[],s=0,o=n;for(let i=e;;){let{index:a,offset:l}=i.content.findIndex(o),c=o-l;if(r.push(i,a,s+l),!c||(i=i.child(a),i.isText))break;o=c-1,s+=l+1}return new is(n,r,o)}static resolveCached(e,n){let r=Qc.get(e);if(r)for(let o=0;o<r.elts.length;o++){let i=r.elts[o];if(i.pos==n)return i}else Qc.set(e,r=new dy);let s=r.elts[r.i]=is.resolve(e,n);return r.i=(r.i+1)%fy,s}}class dy{constructor(){this.elts=[],this.i=0}}const fy=12,Qc=new WeakMap;class lo{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 hy=Object.create(null);let On=class ba{constructor(e,n,r,s=le.none){this.type=e,this.attrs=n,this.marks=s,this.content=r||$.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,s=0){this.content.nodesBetween(e,n,r,s,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,s){return this.content.textBetween(e,n,r,s)}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&&io(this.attrs,n||e.defaultAttrs||hy)&&le.sameSet(this.marks,r||le.none)}copy(e=null){return e==this.content?this:new ba(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ba(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 F.empty;let s=this.resolve(e),o=this.resolve(n),i=r?0:s.sharedDepth(n),a=s.start(i),c=s.node(i).content.cut(s.pos-a,o.pos-a);return new F(c,s.depth-i,o.depth-i)}replace(e,n,r){return cy(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(s==e||n.isText)return n;e-=s+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 s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(e){return is.resolveCached(this,e)}resolveNoCache(e){return is.resolve(this,e)}rangeHasMark(e,n,r){let s=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(s=!0),!s)),s}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()+")"),Zf(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=$.empty,s=0,o=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,s,o),a=i&&i.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=s;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(e).matchType(r),i=o&&o.matchFragment(this.content,n);return i?i.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=le.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(!le.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 s=$.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,s,r);return o.type.checkAttrs(o.attrs),o}};On.prototype.text=void 0;class co extends On{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Zf(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 co(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new co(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 Zf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Hn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new py(e,n);if(r.next==null)return Hn.empty;let s=eh(r);r.next&&r.err("Unexpected trailing text");let o=ky(vy(s));return Sy(o,r),o}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 s=this;for(let o=n;s&&o<r;o++)s=s.matchType(e.child(o).type);return s}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 s=[this];function o(i,a){let l=i.matchFragment(e,r);if(l&&(!n||l.validEnd))return $.from(a.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=o(d,a.concat(u));if(f)return f}}return null}return o(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 s=r.shift(),o=s.match;if(o.matchType(e)){let i=[];for(let a=s;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<o.next.length;i++){let{type:a,next:l}=o.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!s.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:s}),n[a.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 s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),e.map((r,s)=>{let o=s+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)o+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return o}).join(`
2
2
  `)}}Hn.empty=new Hn(!0);class py{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 eh(t){let e=[];do e.push(my(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function my(t){let e=[];do e.push(gy(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function gy(t){let e=by(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=yy(t,e);else break;return e}function Zc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function yy(t,e){let n=Zc(t),r=n;return t.eat(",")&&(t.next!="}"?r=Zc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function xy(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let o in n){let i=n[o];i.isInGroup(e)&&s.push(i)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function by(t){if(t.eat("(")){let e=eh(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=xy(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 vy(t){let e=[[]];return s(o(t,0),n()),e;function n(){return e.push([])-1}function r(i,a,l){let c={term:l,to:a};return e[i].push(c),c}function s(i,a){i.forEach(l=>l.to=a)}function o(i,a){if(i.type=="choice")return i.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(i.type=="seq")for(let l=0;;l++){let c=o(i.exprs[l],a);if(l==i.exprs.length-1)return c;s(c,a=n())}else if(i.type=="star"){let l=n();return r(a,l),s(o(i.expr,l),l),[r(l)]}else if(i.type=="plus"){let l=n();return s(o(i.expr,a),l),s(o(i.expr,l),l),[r(l)]}else{if(i.type=="opt")return[r(a)].concat(o(i.expr,a));if(i.type=="range"){let l=a;for(let c=0;c<i.min;c++){let u=n();s(o(i.expr,l),u),l=u}if(i.max==-1)s(o(i.expr,l),l);else for(let c=i.min;c<i.max;c++){let u=n();r(l,u),s(o(i.expr,l),u),l=u}return[r(l)]}else{if(i.type=="name")return[r(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function th(t,e){return e-t}function eu(t,e){let n=[];return r(e),n.sort(th);function r(s){let o=t[s];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(s);for(let i=0;i<o.length;i++){let{term:a,to:l}=o[i];!a&&n.indexOf(l)==-1&&r(l)}}}function ky(t){let e=Object.create(null);return n(eu(t,0));function n(r){let s=[];r.forEach(i=>{t[i].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<s.length;u++)s[u][0]==a&&(c=s[u][1]);eu(t,l).forEach(u=>{c||s.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new Hn(r.indexOf(t.length-1)>-1);for(let i=0;i<s.length;i++){let a=s[i][1].sort(th);o.next.push({type:s[i][0],next:e[a.join(",")]||n(a)})}return o}}function Sy(t,e){for(let n=0,r=[t];n<r.length;n++){let s=r[n],o=!s.validEnd,i=[];for(let a=0;a<s.next.length;a++){let{type:l,next:c}=s.next[a];i.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function nh(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 rh(t,e){let n=Object.create(null);for(let r in t){let s=e&&e[r];if(s===void 0){let o=t[r];if(o.hasDefault)s=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=s}return n}function sh(t,e,n,r){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${r}`);for(let s in t)t[s].validate&&t[s].validate(e[s])}function oh(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new wy(t,r,e[r]);return n}let tu=class ih{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=oh(e,r.attrs),this.defaultAttrs=nh(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==Hn.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:rh(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new On(this,this.computeAttrs(e),$.from(n),le.setFrom(r))}createChecked(e=null,n,r){return n=$.from(n),this.checkContent(n),new On(this,this.computeAttrs(e),n,le.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=$.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let s=this.contentMatch.matchFragment(n),o=s&&s.fillBefore($.empty,!0);return o?new On(this,e,n.append(o),le.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){sh(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:le.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,i)=>r[o]=new ih(o,n,i));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Cy(t,e,n){let r=n.split("|");return s=>{let o=s===null?"null":typeof s;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class wy{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Cy(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class oi{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=oh(e,s.attrs),this.excluded=null;let o=nh(this.attrs);this.instance=o?new le(this,o):null}create(e=null){return!e&&this.instance?this.instance:new le(this,rh(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((o,i)=>r[o]=new oi(o,s++,n,i)),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){sh(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class ah{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=Ie.from(e.nodes),n.marks=Ie.from(e.marks||{}),this.nodes=tu.compile(this.spec.nodes,this),this.marks=oi.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let o=this.nodes[s],i=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[i]||(r[i]=Hn.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?nu(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let s in this.marks){let o=this.marks[s],i=o.spec.excludes;o.excluded=i==null?[o]:i==""?[]:nu(this,i.split(" "))}this.nodeFromJSON=s=>On.fromJSON(this,s),this.markFromJSON=s=>le.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof tu){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,s)}text(e,n){let r=this.nodes.text;return new co(r,r.defaultAttrs,e,le.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 nu(t,e){let n=[];for(let r=0;r<e.length;r++){let s=e[r],o=t.marks[s],i=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(s=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(s)>-1)&&n.push(i=l)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Ny(t){return t.tag!=null}function My(t){return t.style!=null}class Et{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(Ny(s))this.tags.push(s);else if(My(s)){let o=/[^=]*/.exec(s.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let o=e.nodes[s.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new su(this,n,!1);return r.addAll(e,le.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new su(this,n,!0);return r.addAll(e,le.none,n.from,n.to),F.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let o=this.tags[s];if(Dy(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let i=o.getAttrs(e);if(i===!1)continue;o.attrs=i||void 0}return o}}}matchStyle(e,n,r,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let i=this.styles[o],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(i.getAttrs){let l=i.getAttrs(n);if(l===!1)continue;i.attrs=l||void 0}return i}}}static schemaRules(e){let n=[];function r(s){let o=s.priority==null?50:s.priority,i=0;for(;i<n.length;i++){let a=n[i];if((a.priority==null?50:a.priority)<o)break}n.splice(i,0,s)}for(let s in e.marks){let o=e.marks[s].spec.parseDOM;o&&o.forEach(i=>{r(i=ou(i)),i.mark||i.ignore||i.clearMark||(i.mark=s)})}for(let s in e.nodes){let o=e.nodes[s].spec.parseDOM;o&&o.forEach(i=>{r(i=ou(i)),i.node||i.ignore||i.mark||(i.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Et(e,Et.schemaRules(e)))}}const lh={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Ty={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ch={ol:!0,ul:!0},as=1,va=2,Vr=4;function ru(t,e,n){return e!=null?(e?as:0)|(e==="full"?va:0):t&&t.whitespace=="pre"?as|va:n&~Vr}class _s{constructor(e,n,r,s,o,i){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=i,this.content=[],this.activeMarks=le.none,this.match=o||(i&Vr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore($.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&as)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-s[0].length))}}let n=$.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore($.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&&!lh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class su{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,o,i=ru(null,n.preserveWhitespace,0)|(r?Vr:0);s?o=new _s(s.type,s.attrs,le.none,!0,n.topMatch||s.type.contentMatch,i):r?o=new _s(null,null,le.none,!0,null,i):o=new _s(e.schema.topNodeType,null,le.none,!0,null,i),this.nodes=[o],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,s=this.top,o=s.options&va?"full":this.localPreserveWS||(s.options&as)>0,{schema:i}=this.parser;if(o==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(i.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(i.text(a[l]),n,!/\S/.test(a[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 a=s.content[s.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(i.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let s=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),a;ch.hasOwnProperty(i)&&this.parser.normalizeLists&&Ey(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Ty.hasOwnProperty(i))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 c,u=this.needsBlock;if(lh.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.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),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=s}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 s=0;s<this.parser.matchedStyles.length;s++){let o=this.parser.matchedStyles[s],i=r.getPropertyValue(o);if(i)for(let a=void 0;;){let l=this.parser.matchStyle(o,i,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,s){let o,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(i,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);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)}o&&this.sync(a)&&this.open--}addAll(e,n,r,s){let o=r||0;for(let i=r?e.childNodes[r]:e.firstChild,a=s==null?null:e.childNodes[s];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,n);this.findAtPoint(e,o)}findPlace(e,n,r){let s,o;for(let i=this.open,a=0;i>=0;i--){let l=this.nodes[i],c=l.findWrapping(e);if(c&&(!s||s.length>c.length+a)&&(s=c,o=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!s)return null;this.sync(o);for(let i=0;i<s.length;i++)n=this.enterInner(s[i],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let s=this.findPlace(e,n,r);if(s){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=le.none;for(let a of s.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):iu(a.type,e.type))&&(i=a.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,n,r,s){let o=this.findPlace(e.create(n),r,!1);return o&&(o=this.enterInner(e,n,r,!0,s)),o}enterInner(e,n,r,s=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let a=ru(e,o,i.options);i.options&Vr&&i.content.length==0&&(a|=Vr);let l=le.none;return r=r.filter(c=>(i.type?i.type.allowsMarkType(c.type):iu(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new _s(e,n,l,s,null,a)),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|=as)}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 s=r.length-1;s>=0;s--)e+=r[s].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 s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].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,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(s?0:1),i=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(i(a-1,l))return!0;return!1}else{let u=l>0||l==0&&s?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return i(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 Ey(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ch.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Dy(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ou(t){let e={};for(let n in t)e[n]=t[n];return e}function iu(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let o=[],i=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||o.indexOf(u)<0&&i(u))return!0}};if(i(s.contentMatch))return!0}}class qt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Bs(n).createDocumentFragment());let s=r,o=[];return e.forEach(i=>{if(o.length||i.marks.length){let a=0,l=0;for(;a<o.length&&l<i.marks.length;){let c=i.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)s=o.pop()[1];for(;l<i.marks.length;){let c=i.marks[l++],u=this.serializeMark(c,i.isInline,n);u&&(o.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){if(e.isText)return Bs(n).createTextNode(e.text);let{dom:r,contentDOM:s}=Zs(Bs(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let o=this.serializeMark(e.marks[s],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&Zs(Bs(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return typeof n=="string"?{dom:e.createTextNode(n)}:Zs(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new qt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=au(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return au(e.marks)}}function au(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Bs(t){return t.document||window.document}const lu=new WeakMap;function Oy(t){let e=lu.get(t);return e===void 0&&lu.set(t,e=Ay(t)),e}function Ay(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 s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(t),e}function Zs(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let s=e[0],o;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=Oy(r))&&o.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 i=s.indexOf(" ");i>0&&(n=s.slice(0,i),s=s.slice(i+1));let a,l=n?t.createElementNS(n,s):t.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:h,contentDOM:m}=Zs(t,f,n,r);if(l.appendChild(h),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const uh=65535,dh=Math.pow(2,16);function Iy(t,e){return t+e*dh}function cu(t){return t&uh}function jy(t){return(t-(t&uh))/dh}const fh=1,hh=2,eo=4,ph=8;class ka{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&ph)>0}get deletedBefore(){return(this.delInfo&(fh|eo))>0}get deletedAfter(){return(this.delInfo&(hh|eo))>0}get deletedAcross(){return(this.delInfo&eo)>0}}class et{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&et.empty)return et.empty}recover(e){let n=0,r=cu(e);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+jy(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 s=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?s:0);if(l>e)break;let c=this.ranges[a+o],u=this.ranges[a+i],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,h=l+s+(f<0?0:u);if(r)return h;let m=e==(n<0?l:d)?null:Iy(a/3,e-l),y=e==l?hh:e==d?fh:eo;return(n<0?e!=l:e!=d)&&(y|=ph),new ka(h,y,m)}s+=u-c}return r?e+s:new ka(e+s,0,null)}touches(e,n){let r=0,s=cu(n),o=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==s*3)return!0;r+=this.ranges[a+i]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let i=this.ranges[s],a=i-(this.inverted?o:0),l=i+(this.inverted?0:o),c=this.ranges[s+n],u=this.ranges[s+r];e(a,a+c,l,l+u),o+=u-c}}invert(){return new et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?et.empty:new et(e<0?[0,-e,0]:[0,0,e])}}et.empty=new et([]);class ls{constructor(e,n,r=0,s=e?e.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new ls(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 s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?r+s: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 s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new ls;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 s=0;for(let o=this.from;o<this.to;o++){let i=this._maps[o],a=i.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return r?e:new ka(e,s,null)}}const Ei=Object.create(null);class Fe{getMap(){return et.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ei[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 Ei)throw new RangeError("Duplicate use of step JSON ID "+e);return Ei[e]=n,n.prototype.jsonID=e,n}}class ke{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new ke(e,null)}static fail(e){return new ke(null,e)}static fromReplace(e,n,r,s){try{return ke.ok(e.replace(n,r,s))}catch(o){if(o instanceof ss)return ke.fail(o.message);throw o}}}function Ml(t,e,n){let r=[];for(let s=0;s<t.childCount;s++){let o=t.child(s);o.content.size&&(o=o.copy(Ml(o.content,e,o))),o.isInline&&(o=e(o,n,s)),r.push(o)}return $.fromArray(r)}class sn extends Fe{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),s=r.node(r.sharedDepth(this.to)),o=new F(Ml(n.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),s),n.openStart,n.openEnd);return ke.fromReplace(e,this.from,this.to,o)}invert(){return new pt(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 sn(n.pos,r.pos,this.mark)}merge(e){return e instanceof sn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new sn(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 sn(n.from,n.to,e.markFromJSON(n.mark))}}Fe.jsonID("addMark",sn);class pt extends Fe{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 F(Ml(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return ke.fromReplace(e,this.from,this.to,r)}invert(){return new sn(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 pt(n.pos,r.pos,this.mark)}merge(e){return e instanceof pt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pt(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 pt(n.from,n.to,e.markFromJSON(n.mark))}}Fe.jsonID("removeMark",pt);class on extends Fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ke.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ke.fromReplace(e,this.pos,this.pos+1,new F($.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 s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new on(this.pos,n.marks[s]);return new on(this.pos,this.mark)}}return new Wn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new on(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 on(n.pos,e.markFromJSON(n.mark))}}Fe.jsonID("addNodeMark",on);class Wn extends Fe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ke.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ke.fromReplace(e,this.pos,this.pos+1,new F($.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new on(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Wn(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 Wn(n.pos,e.markFromJSON(n.mark))}}Fe.jsonID("removeNodeMark",Wn);class ve extends Fe{constructor(e,n,r,s=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=s}apply(e){return this.structure&&Sa(e,this.from,this.to)?ke.fail("Structure replace would overwrite content"):ke.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new et([this.from,this.to-this.from,this.slice.size])}invert(e){return new ve(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&&ve.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new ve(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ve)||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?F.empty:new F(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ve(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?F.empty:new F(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ve(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 ve(n.from,n.to,F.fromJSON(e,n.slice),!!n.structure)}}ve.MAP_BIAS=1;Fe.jsonID("replace",ve);class Oe extends Fe{constructor(e,n,r,s,o,i,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=o,this.insert=i,this.structure=a}apply(e){if(this.structure&&(Sa(e,this.from,this.gapFrom)||Sa(e,this.gapTo,this.to)))return ke.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ke.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ke.fromReplace(e,this.from,this.to,r):ke.fail("Content does not fit in gap")}getMap(){return new et([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 Oe(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),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||o>r.pos?null:new Oe(n.pos,r.pos,s,o,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 Oe(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(e,n.slice),n.insert,!!n.structure)}}Fe.jsonID("replaceAround",Oe);function Sa(t,e,n){let r=t.resolve(e),s=n-e,o=r.depth;for(;s>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,s--;if(s>0){let i=r.node(o).maybeChild(r.indexAfter(o));for(;s>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,s--}}return!1}function Ry(t,e,n,r){let s=[],o=[],i,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let y=0;y<d.length;y++)d[y].isInSet(m)||(i&&i.to==f&&i.mark.eq(d[y])?i.to=h:s.push(i=new pt(f,h,d[y])));a&&a.to==f?a.to=h:o.push(a=new sn(f,h,r))}}),s.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function Py(t,e,n,r){let s=[],o=0;t.doc.nodesBetween(e,n,(i,a)=>{if(!i.isInline)return;o++;let l=null;if(r instanceof oi){let c=i.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(i.marks)&&(l=[r]):l=i.marks;if(l&&l.length){let c=Math.min(a+i.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<s.length;h++){let m=s[h];m.step==o-1&&d.eq(s[h].style)&&(f=m)}f?(f.to=c,f.step=o):s.push({style:d,from:Math.max(a,e),to:c,step:o})}}}),s.forEach(i=>t.step(new pt(i.from,i.to,i.style)))}function Tl(t,e,n,r=n.contentMatch,s=!0){let o=t.doc.nodeAt(e),i=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)i.push(new ve(a,u,F.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new pt(a,u,c.marks[f]));if(s&&c.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(c.text);)m||(m=new F($.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),i.push(new ve(a+f.index,a+f.index+f[0].length,m))}}a=u}if(!r.validEnd){let l=r.fillBefore($.empty,!0);t.replace(a,a,new F(l,0,0))}for(let l=i.length-1;l>=0;l--)t.step(i[l])}function Ly(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Mr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,o=0;;--r){let i=t.$from.node(r),a=t.$from.index(r)+s,l=t.$to.indexAfter(r)-o;if(r<t.depth&&i.canReplace(a,l,n))return r;if(r==0||i.type.spec.isolating||!Ly(i,a,l))break;a&&(s=1),l<i.childCount&&(o=1)}return null}function $y(t,e,n){let{$from:r,$to:s,depth:o}=e,i=r.before(o+1),a=s.after(o+1),l=i,c=a,u=$.empty,d=0;for(let m=o,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,u=$.from(r.node(m).copy(u)),d++):l--;let f=$.empty,h=0;for(let m=o,y=!1;m>n;m--)y||s.after(m+1)<s.end(m)?(y=!0,f=$.from(s.node(m).copy(f)),h++):c++;t.step(new Oe(l,c,i,a,new F(u.append(f),d,h),u.size-d,!0))}function El(t,e,n=null,r=t){let s=_y(t,e),o=s&&By(r,e);return o?s.map(uu).concat({type:e,attrs:n}).concat(o.map(uu)):null}function uu(t){return{type:t,attrs:null}}function _y(t,e){let{parent:n,startIndex:r,endIndex:s}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let i=o.length?o[0]:e;return n.canReplaceWith(r,s,i)?o:null}function By(t,e){let{parent:n,startIndex:r,endIndex:s}=t,o=n.child(r),i=e.contentMatch.findWrapping(o.type);if(!i)return null;let l=(i.length?i[i.length-1]:e).contentMatch;for(let c=r;l&&c<s;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:i}function zy(t,e,n){let r=$.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let a=n[i].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=$.from(n[i].type.create(n[i].attrs,r))}let s=e.start,o=e.end;t.step(new Oe(s,o,s,o,new F(r,0,0),n.length,!0))}function Fy(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(i,a)=>{let l=typeof s=="function"?s(i):s;if(i.isTextblock&&!i.hasMarkup(r,l)&&Hy(t.doc,t.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&gh(t,i,a,o),Tl(t,t.mapping.slice(o).map(a,1),r,void 0,c===null);let u=t.mapping.slice(o),d=u.map(a,1),f=u.map(a+i.nodeSize,1);return t.step(new Oe(d,f,d+1,f-1,new F($.from(r.create(l,null,i.marks)),0,0),1,!0)),c===!0&&mh(t,i,a,o),!1}})}function mh(t,e,n,r){e.forEach((s,o)=>{if(s.isText){let i,a=/\r?\n|\r/g;for(;i=a.exec(s.text);){let l=t.mapping.slice(r).map(n+1+o+i.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function gh(t,e,n,r){e.forEach((s,o)=>{if(s.type==s.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text(`
@@ -138,7 +138,7 @@ ${n}
138
138
  `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,s;const o=t.split(`
139
139
  `),[i,a]=HN(o);if(i.length===0)return;const l=xg(i,i[0].indent,n);if(l.length!==0)return{type:"list",ordered:!0,start:((r=i[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(s=i[0])===null||s===void 0?void 0:s.type,items:l,raw:o.slice(0,a).join(`
140
140
  `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(qN,this.editor.getAttributes(Ud)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new pe({props:{handlePaste:(t,e)=>{var n,r;const s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(s?.trim())return!1;const o=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!o)return!1;const i=VN(o);if(!i)return!1;try{const a=t.state.schema.nodeFromJSON(i),l=t.state.tr.replaceSelectionWith(a);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let e=Sr({find:qd,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Sr({find:qd,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(Ud)}),joinPredicate:t,editor:this.editor})),[e]}}),KN=/^\s*(\[([( |x])?\])\s$/,JN="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",YN=(t,e,n)=>{var r;return(n==null||(r=n.checkboxLabel)===null||r===void 0?void 0:r.call(n,t,e))||`Task item checkbox for ${t.textContent||"empty task item"}`},GN=qe.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector("div"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Se(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const r=`- [${!((n=t.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return Yp(t,e,r)},addExtensions(){return this.options.nested?[dg(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const s=document.createElement("li"),o=document.createElement("label"),i=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");i.style.cssText=JN;const c=d=>{const f=YN(d,d.attrs.checked,this.options.a11y);a.setAttribute("aria-label",f),i.textContent=f};c(t),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const m=n();if(typeof m!="number")return!1;const y=h.doc.nodeAt(m);return h.setNodeMarkup(m,void 0,{...y?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{s.setAttribute(d,f)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,o.append(a,i),s.append(o,l),Object.entries(e).forEach(([d,f])=>{s.setAttribute(d,f)});let u=new Set(Object.keys(e));return{dom:s,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;s.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d);const f=r.extensionManager.attributes,h=kr(d,f),m=new Set(Object.keys(h)),y=this.options.HTMLAttributes;return u.forEach(g=>{m.has(g)||(g in y?s.setAttribute(g,y[g]):s.removeAttribute(g))}),Object.entries(h).forEach(([g,x])=>{x==null?g in y?s.setAttribute(g,y[g]):s.removeAttribute(g):s.setAttribute(g,x)}),u=m,!0}}}},addInputRules(){return[Sr({find:KN,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),XN=qe.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Se(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
141
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=o=>{const i=ad(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(i){const a={type:"taskList",raw:i.raw,items:i.items},l=o.slice(i.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(o)},s=ad(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,i)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:i}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});be.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(ug.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(mg.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(yg.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(bg.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(GN.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(XN.configure(this.options.taskList)),t}});const Gs="&nbsp;",ta=" ",QN=qe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Se(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Gs||n[0].text===Gs||n[0].raw===ta||n[0].text===ta)&&r.length===1&&r[0].type==="text"&&(r[0].text===Gs||r[0].text===ta)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{if(!t)return"";const r=Array.isArray(t.content)?t.content:[];if(r.length===0){var s,o;const i=Array.isArray(n==null||(s=n.previousNode)===null||s===void 0?void 0:s.content)?n.previousNode.content:[];return(n==null||(o=n.previousNode)===null||o===void 0?void 0:o.type)==="paragraph"&&i.length===0?Gs:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ZN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,eM=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tM=Jn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Se(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Un({find:ZN,type:this.type})]},addPasteRules(){return[hn({find:eM,type:this.type})]}}),nM=qe.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),rM=Jn.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Se(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),sM=be.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(Tw.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(Sw.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(ug.configure(this.options.bulletList)),this.options.code!==!1&&t.push(Ow.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(jw.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(Rw.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(rw.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(sw.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(Pw.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(Lw.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(xw.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push($w.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(Hw.configure(this.options.italic)),this.options.listItem!==!1&&t.push(mg.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(yg.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var n;t.push(cg.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&t.push(bg.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(QN.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(tM.configure(this.options.strike)),this.options.text!==!1&&t.push(nM.configure(this.options.text)),this.options.underline!==!1){var r;t.push(rM.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var s;t.push(yw.configure((s=this.options)===null||s===void 0?void 0:s.trailingNode))}return t}});var oM=sM;const bn=16,sl=2.5,ol=(bn-sl)/2,na=2*Math.PI*ol;function vg(t){const e=_.c(29),{usage:n}=t;if(!n)return null;const{totalTokens:r,inputTokens:s,outputTokens:o,cost:i}=n;if(!r&&!s&&!o)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx(P1,{size:12}),e[0]=a):a=e[0];let l;e[1]!==i||e[2]!==r?(l=i>0?`$${i.toFixed(4)}`:r.toLocaleString(),e[1]=i,e[2]=r,e[3]=l):l=e[3];let c;e[4]!==l?(c=p.jsx(_n,{asChild:!0,children:p.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[a,p.jsx("span",{className:"text-sm font-mono tabular-nums",children:l})]})}),e[4]=l,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsx("span",{className:"text-muted",children:"in"}),e[7]=d):d=e[7];let f;e[8]!==s?(f=s.toLocaleString(),e[8]=s,e[9]=f):f=e[9];let h;e[10]!==f?(h=p.jsx("span",{className:"text-right tabular-nums",children:f}),e[10]=f,e[11]=h):h=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx("span",{className:"text-muted",children:"out"}),e[12]=m):m=e[12];const y=o-(n.reasoningTokens??0);let g;e[13]!==y?(g=y.toLocaleString(),e[13]=y,e[14]=g):g=e[14];let x;e[15]!==g?(x=p.jsx("span",{className:"text-right tabular-nums",children:g}),e[15]=g,e[16]=x):x=e[16];let b;e[17]!==n?(b=(n.cacheReadTokens>0||n.cacheWriteTokens>0)&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cache hit"}),p.jsx("span",{className:"text-right tabular-nums",children:`${(Cl(n)*100).toFixed(0)}%`})]}),e[17]=n,e[18]=b):b=e[18];let v;e[19]!==i?(v=i>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cost"}),p.jsxs("span",{className:"text-right tabular-nums",children:["$",i.toFixed(4)]})]}),e[19]=i,e[20]=v):v=e[20];let k;e[21]!==x||e[22]!==b||e[23]!==v||e[24]!==h?(k=p.jsxs(Bn,{side:"top",className:"font-mono text-[11px]",children:[u,p.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[d,h,m,x,b,v]})]}),e[21]=x,e[22]=b,e[23]=v,e[24]=h,e[25]=k):k=e[25];let N;return e[26]!==k||e[27]!==c?(N=p.jsxs(zn,{children:[c,k]}),e[26]=k,e[27]=c,e[28]=N):N=e[28],N}function iM(t){const e=_.c(19),{usage:n,duration:r}=t,s=r!=null&&r>0,o=n!=null&&(n.cost??0)>0,i=n!=null&&(n.totalTokens??0)>0;if(!s&&!o&&!i)return null;let a;e[0]!==r||e[1]!==s?(a=s?Fn(r/1e3):null,e[0]=r,e[1]=s,e[2]=a):a=e[2];const l=a;let c;e[3]!==r||e[4]!==l||e[5]!==n?(c=l&&p.jsxs(zn,{children:[p.jsx(_n,{asChild:!0,children:p.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:l})}),p.jsxs(Bn,{side:"top",className:"font-mono text-[11px]",children:[p.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),p.jsx("span",{className:"tabular-nums",children:Fn(r/1e3)}),(n?.reasoningTokens??0)>0&&p.jsxs("span",{className:"ml-2 opacity-50",children:[n.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=r,e[4]=l,e[5]=n,e[6]=c):c=e[6];let u;e[7]!==o||e[8]!==s||e[9]!==i?(u=s&&(o||i)&&p.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=o,e[8]=s,e[9]=i,e[10]=u):u=e[10];let d;e[11]!==o||e[12]!==i||e[13]!==n?(d=(o||i)&&p.jsxs(zn,{children:[p.jsx(_n,{asChild:!0,children:p.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:o?`$${n.cost.toFixed(4)}`:`${n.totalTokens.toLocaleString()} tok`})}),p.jsxs(Bn,{side:"top",className:"font-mono text-[11px]",children:[p.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),p.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p.jsx("span",{className:"opacity-60",children:"in"}),p.jsx("span",{className:"text-right tabular-nums",children:(n.inputTokens??0).toLocaleString()}),p.jsx("span",{className:"opacity-60",children:"out"}),p.jsx("span",{className:"text-right tabular-nums",children:((n.outputTokens??0)-(n?.reasoningTokens??0)).toLocaleString()}),(n?.reasoningTokens??0)>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"opacity-60",children:"think"}),p.jsx("span",{className:"text-right tabular-nums",children:n.reasoningTokens.toLocaleString()})]}),((n?.cacheReadTokens??0)>0||(n?.cacheWriteTokens??0)>0)&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"opacity-60",children:"cache hit"}),p.jsx("span",{className:"text-right tabular-nums",children:`${(Cl(n)*100).toFixed(0)}%`})]})]})]})]}),e[11]=o,e[12]=i,e[13]=n,e[14]=d):d=e[14];let f;return e[15]!==c||e[16]!==u||e[17]!==d?(f=p.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,u,d]}),e[15]=c,e[16]=u,e[17]=d,e[18]=f):f=e[18],f}function uA(t){const e=_.c(49),{usage:n,totalTokens:r,contextWindow:s,onOpenContextPanel:o}=t,i=Math.min(r/s*100,100),a=na-i/100*na,l=n?.cost??0,c=n?.inputTokens??0,u=n?.outputTokens??0;let d;e[0]!==i?(d=i.toFixed(0),e[0]=i,e[1]=d):d=e[1];let f;e[2]!==l?(f=l>0?`, $${l.toFixed(2)}`:"",e[2]=l,e[3]=f):f=e[3];const h=`Context usage: ${d}%${f}`,m=o?"cursor-pointer":"cursor-default";let y;e[4]!==m?(y=G("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",m),e[4]=m,e[5]=y):y=e[5];let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=p.jsx("circle",{cx:bn/2,cy:bn/2,r:ol,fill:"none",stroke:"currentColor",strokeWidth:sl,className:"opacity-15"}),e[6]=g):g=e[6];const x=i>90?"text-destructive":i>70?"text-warning":"text-muted-foreground";let b;e[7]!==x?(b=G(x),e[7]=x,e[8]=b):b=e[8];let v;e[9]!==a||e[10]!==b?(v=p.jsxs("svg",{width:bn,height:bn,className:"-rotate-90",children:[g,p.jsx("circle",{cx:bn/2,cy:bn/2,r:ol,fill:"none",stroke:"currentColor",strokeWidth:sl,strokeDasharray:na,strokeDashoffset:a,strokeLinecap:"round",className:b})]}),e[9]=a,e[10]=b,e[11]=v):v=e[11];let k;e[12]!==i?(k=i.toFixed(0),e[12]=i,e[13]=k):k=e[13];let N;e[14]!==l?(N=l>0?` · $${l.toFixed(2)}`:"",e[14]=l,e[15]=N):N=e[15];let C;e[16]!==k||e[17]!==N?(C=p.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[k,"%",N]}),e[16]=k,e[17]=N,e[18]=C):C=e[18];let S;e[19]!==o||e[20]!==C||e[21]!==h||e[22]!==y||e[23]!==v?(S=p.jsx(_n,{asChild:!0,children:p.jsxs("button",{type:"button",onClick:o,"aria-label":h,className:y,children:[v,C]})}),e[19]=o,e[20]=C,e[21]=h,e[22]=y,e[23]=v,e[24]=S):S=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=p.jsx("span",{className:"text-muted",children:"context"}),e[25]=w):w=e[25];let M;e[26]!==r?(M=r.toLocaleString(),e[26]=r,e[27]=M):M=e[27];let T;e[28]!==s?(T=s.toLocaleString(),e[28]=s,e[29]=T):T=e[29];let O;e[30]!==i?(O=i.toFixed(1),e[30]=i,e[31]=O):O=e[31];let A;e[32]!==M||e[33]!==T||e[34]!==O?(A=p.jsxs("span",{className:"text-right tabular-nums",children:[M," / ",T," (",O,"%)"]}),e[32]=M,e[33]=T,e[34]=O,e[35]=A):A=e[35];let P;e[36]!==l||e[37]!==c||e[38]!==u?(P=l>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cost"}),p.jsxs("span",{className:"text-right tabular-nums",children:["$",l.toFixed(4)]}),p.jsx("span",{className:"text-muted",children:"in"}),p.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),p.jsx("span",{className:"text-muted",children:"out"}),p.jsx("span",{className:"text-right tabular-nums",children:u.toLocaleString()})]}),e[36]=l,e[37]=c,e[38]=u,e[39]=P):P=e[39];let D;e[40]!==n?(D=((n?.cacheReadTokens??0)>0||(n?.cacheWriteTokens??0)>0)&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cache hit"}),p.jsx("span",{className:"text-right tabular-nums",children:`${(Cl(n)*100).toFixed(0)}%`})]}),e[40]=n,e[41]=D):D=e[41];let E;e[42]!==A||e[43]!==P||e[44]!==D?(E=p.jsx(Bn,{side:"top",className:"font-mono text-[11px]",children:p.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[w,A,P,D]})}),e[42]=A,e[43]=P,e[44]=D,e[45]=E):E=e[45];let j;return e[46]!==S||e[47]!==E?(j=p.jsxs(zn,{children:[S,E]}),e[46]=S,e[47]=E,e[48]=j):j=e[48],j}var Si="Collapsible",[aM,dA]=E1(Si),[lM,vc]=aM(Si),kg=L.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...a}=t,[l,c]=S1({prop:r,defaultProp:s??!1,onChange:i,caller:Si});return p.jsx(lM,{scope:n,disabled:o,contentId:C1(),open:l,onOpenToggle:L.useCallback(()=>c(u=>!u),[c]),children:p.jsx(pl.div,{"data-state":wc(l),"data-disabled":o?"":void 0,...a,ref:e})})});kg.displayName=Si;var Sg="CollapsibleTrigger",kc=L.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=vc(Sg,n);return p.jsx(pl.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":wc(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:w1(t.onClick,s.onOpenToggle)})});kc.displayName=Sg;var Sc="CollapsibleContent",Cc=L.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=vc(Sc,t.__scopeCollapsible);return p.jsx(N1,{present:n||s.open,children:({present:o})=>p.jsx(cM,{...r,ref:e,present:o})})});Cc.displayName=Sc;var cM=L.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=t,i=vc(Sc,n),[a,l]=L.useState(r),c=L.useRef(null),u=M1(e,c),d=L.useRef(0),f=d.current,h=L.useRef(0),m=h.current,y=i.open||a,g=L.useRef(y),x=L.useRef(void 0);return L.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),T1(()=>{const b=c.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const v=b.getBoundingClientRect();d.current=v.height,h.current=v.width,g.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),l(r)}},[i.open,r]),p.jsx(pl.div,{"data-state":wc(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!y,...o,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...t.style},children:y&&s})});function wc(t){return t?"open":"closed"}var uM=kg,fA=kc,hA=Cc;function dM(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=p.jsx(uM,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function fM(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=p.jsx(kc,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function hM(t){const e=_.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let s;e[3]!==n?(s=G("overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down motion-reduce:animate-none",n),e[3]=n,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx(Cc,{"data-slot":"collapsible-content",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function ne({icon:t,title:e,usage:n,summary:r,state:s,detail:o,detailVariant:i="code",forceOpen:a,variant:l="default",trailing:c,iconDestructive:u,alwaysChevron:d,defaultOpen:f,children:h}){const m=J(),[y,g]=L.useState(f??!1),{handleCopy:x,copied:b}=$f(),v=s==="loading",k=s==="error",C=!!(o&&o.trim())||!!h,S=l==="subtask",w=(a??!1)||y,M=ny({initial:v?"instant":!1}),T=p.jsxs(dM,{open:w,onOpenChange:a?void 0:g,className:"min-w-0",children:[p.jsxs(fM,{disabled:!C,className:G("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",C&&"[@media(hover:hover)]:hover:bg-accent/30",!C&&"cursor-default",v&&"shimmer"),"aria-disabled":!C,children:[p.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?p.jsx(ma,{className:G("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",w&&"rotate-90")}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:G("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",u?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",C&&(w?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),C&&p.jsx("div",{className:G("absolute inset-0 flex items-center justify-center transition-opacity duration-150",w?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:p.jsx(ma,{className:G("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",w&&"rotate-90")})})]})}),p.jsx("span",{className:G("shrink-0 text-[14px] font-normal",k?"text-warning/80":"text-foreground"),children:e}),r?p.jsx("span",{className:"min-w-0 flex-1 truncate",children:p.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:r})}):p.jsx("div",{className:"flex-1"}),c&&p.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:c}),p.jsx(vg,{usage:n})]}),C&&p.jsx(hM,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:h||(i==="prose"?p.jsx("div",{className:"mt-1 mb-1",children:p.jsx("div",{ref:M.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:p.jsx("p",{ref:M.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:o})})}):p.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:p.jsx("div",{ref:M.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:p.jsxs("div",{ref:M.contentRef,className:"flex items-start justify-between gap-2",children:[p.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:p.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:o})}),p.jsx("button",{type:"button",onClick:()=>x(o),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":m("common.copy"),children:b?p.jsx(xl,{className:"size-3.5"}):p.jsx(Lf,{className:"size-3.5"})})]})})}))})]});return S?p.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:T}):T}function Le(t){const e=_.c(4),{latency:n}=t;if(n==null||n<=0)return null;let r;e[0]!==n?(r=Fn(n),e[0]=n,e[1]=r):r=e[1];let s;return e[2]!==r?(s=p.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:r}),e[2]=r,e[3]=s):s=e[3],s}const Cg=4;function wg(t){const e=_.c(8),{count:n,noun:r,onClick:s}=t,o=J();let i;e[0]!==n||e[1]!==r||e[2]!==o?(i=o("common.seeAll",{count:n,noun:r}),e[0]=n,e[1]=r,e[2]=o,e[3]=i):i=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx(Pf,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==i?(l=p.jsxs("button",{type:"button",onClick:s,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[i,a]}),e[5]=s,e[6]=i,e[7]=l):l=e[7],l}function Ng(t){const e=_.c(12),{message:n,className:r}=t,s=n.created_at??n.metadata?.created_at??null;let o,i,a,l;if(e[0]!==r||e[1]!==s){l=Symbol.for("react.early_return_sentinel");e:{const u=bl(s);if(u===null){l=null;break e}const d=new Date(u);o=d.toLocaleString(),e[6]!==r?(i=G("text-[11px] text-muted-foreground/60 select-none",r),e[6]=r,e[7]=i):i=e[7],a=d.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=r,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=l}else o=e[2],i=e[3],a=e[4],l=e[5];if(l!==Symbol.for("react.early_return_sentinel"))return l;let c;return e[8]!==o||e[9]!==i||e[10]!==a?(c=p.jsx("span",{title:o,className:i,children:a}),e[8]=o,e[9]=i,e[10]=a,e[11]=c):c=e[11],c}function il(t){const e=_.c(9),{since:n}=t;let r;e[0]!==n?(r=()=>Yc(n,Date.now()),e[0]=n,e[1]=r):r=e[1];const[s,o]=L.useState(r);let i,a;e[2]!==n?(i=()=>{const d=setInterval(()=>o(Yc(n,Date.now())),100);return()=>clearInterval(d)},a=[n],e[2]=n,e[3]=i,e[4]=a):(i=e[3],a=e[4]),L.useEffect(i,a);const l=s/1e3;let c;e[5]!==l?(c=Fn(l),e[5]=l,e[6]=c):c=e[6];let u;return e[7]!==c?(u=p.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:c}),e[7]=c,e[8]=u):u=e[8],u}const Mg=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function pM(){const t=_.c(5),[e]=L.useState(mM);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},t[0]=n):n=t[0];let r;t[1]!==e?(r=Mg.map((o,i)=>{const{delay:a}=o;return p.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[i],animation:"grid-ripple 1s ease infinite",animationDelay:`${a}ms`}},i)}),t[1]=e,t[2]=r):r=t[2];let s;return t[3]!==r?(s=p.jsx("div",{className:"grid",style:n,children:r}),t[3]=r,t[4]=s):s=t[4],s}function mM(){const t=`var(--chart-${Math.ceil(Math.random()*5)})`;return Mg.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":t)}const Jd=new Map;function Tg(t){let e=Jd.get(t);return e||(e={tick:0,subscribers:new Set,intervalId:null},Jd.set(t,e)),e}function gM(t,e){const n=Tg(t);return n.subscribers.add(e),n.intervalId===null&&(n.intervalId=setInterval(()=>{n.tick+=1;for(const r of n.subscribers)r()},t)),()=>{n.subscribers.delete(e),n.subscribers.size===0&&n.intervalId!==null&&(clearInterval(n.intervalId),n.intervalId=null)}}function Nc(t){const e=_.c(3),n=t===void 0?6e4:t;let r,s;return e[0]!==n?(r=o=>gM(n,o),s=()=>Tg(n).tick,e[0]=n,e[1]=r,e[2]=s):(r=e[1],s=e[2]),L.useSyncExternalStore(r,s,yM)}function yM(){return 0}function xM(t){return{planning:{icon:p.jsx($1,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:t("chat.thinkingIndicator.planningLabel"),detail:t("chat.thinkingIndicator.planningDetail")},thinking:{icon:p.jsx(ri,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:t("chat.thinkingIndicator.thinkingLabel"),detail:t("chat.thinkingIndicator.thinkingDetail")}}}const bM=1200;function al(t){const e=_.c(8),{icon:n,title:r,summary:s,detail:o,state:i,detailVariant:a,trailing:l}=t,c=a===void 0?"prose":a;let u;return e[0]!==o||e[1]!==c||e[2]!==n||e[3]!==i||e[4]!==s||e[5]!==r||e[6]!==l?(u=p.jsx(ne,{icon:n,title:r,summary:s,detail:o,state:i,detailVariant:c,trailing:l}),e[0]=o,e[1]=c,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=l,e[7]=u):u=e[7],u}function vM(t){const e=_.c(22),{startedAt:n}=t,r=J(),s=wr()?.runStatusStage??null,[o,i]=L.useState("planning");let a,l;if(e[0]!==s?(a=()=>{if(s!==null)return;const y=setTimeout(()=>{i("thinking")},bM);return()=>{clearTimeout(y)}},l=[s],e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]),L.useEffect(a,l),s!==null){let y;e[3]!==s||e[4]!==r?(y=g0(r,s),e[3]=s,e[4]=r,e[5]=y):y=e[5];const g=y;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=p.jsx(ri,{className:"size-4"}),e[6]=x):x=e[6];const b=`${g.label}...`;let v;e[7]!==n?(v=n!==null&&p.jsx(il,{since:n}),e[7]=n,e[8]=v):v=e[8];let k;return e[9]!==g.detail||e[10]!==b||e[11]!==v?(k=p.jsx(al,{icon:x,title:b,summary:g.detail,state:"loading",trailing:v}),e[9]=g.detail,e[10]=b,e[11]=v,e[12]=k):k=e[12],k}let c;e[13]!==r?(c=xM(r),e[13]=r,e[14]=c):c=e[14];const d=c[o],f=`${d.label}...`;let h;e[15]!==n?(h=n!==null&&p.jsx(il,{since:n}),e[15]=n,e[16]=h):h=e[16];let m;return e[17]!==d.detail||e[18]!==d.icon||e[19]!==f||e[20]!==h?(m=p.jsx(al,{icon:d.icon,title:f,summary:d.detail,state:"loading",trailing:h}),e[17]=d.detail,e[18]=d.icon,e[19]=f,e[20]=h,e[21]=m):m=e[21],m}function kM(t){const e=_.c(3),{startedAt:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx(pM,{}),e[0]=r):r=e[0];let s;return e[1]!==n?(s=p.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[r,p.jsx(il,{since:n})]}),e[1]=n,e[2]=s):s=e[2],s}const SM=2e4;function CM(t){const e=_.c(9),{startedAt:n}=t,r=J();Nc(1e3);const s=wr(),i=(n!==null?Date.now()-n:0)>=SM;let a;e[0]!==n?(a=p.jsx(vM,{startedAt:n}),e[0]=n,e[1]=a):a=e[1];let l;e[2]!==i||e[3]!==s||e[4]!==r?(l=i&&s?.stop&&p.jsxs("div",{className:"flex items-center gap-2 pb-1 text-[13px] text-muted-foreground/60",children:[p.jsx("span",{children:r("chat.thinkingIndicator.takingLonger")}),p.jsx("button",{type:"button",onClick:()=>s.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:r("chat.thinkingIndicator.cancel")})]}),e[2]=i,e[3]=s,e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==a||e[7]!==l?(c=p.jsxs("div",{className:"flex flex-col gap-0.5",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8],c}function wM(t){const e=_.c(24),{duration:n,parts:r,isStreaming:s}=t,o=J();let i;e[0]!==r?(i=r.every(TM),e[0]=r,e[1]=i):i=e[1];const a=i;let l;e[2]!==n||e[3]!==o?(l=n&&n/1e3>1?o("chat.thinkingIndicator.thoughtFor",{duration:Fn(n/1e3)}):o("chat.thinkingIndicator.thought"),e[2]=n,e[3]=o,e[4]=l):l=e[4];const c=l;let u;if(e[5]!==a||e[6]!==s||e[7]!==r){const v=r.map(MM).join(`
141
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=o=>{const i=ad(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(i){const a={type:"taskList",raw:i.raw,items:i.items},l=o.slice(i.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(o)},s=ad(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,i)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:i}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});be.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(ug.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(mg.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(yg.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(bg.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(GN.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(XN.configure(this.options.taskList)),t}});const Gs="&nbsp;",ta=" ",QN=qe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Se(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===Gs||n[0].text===Gs||n[0].raw===ta||n[0].text===ta)&&r.length===1&&r[0].type==="text"&&(r[0].text===Gs||r[0].text===ta)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{if(!t)return"";const r=Array.isArray(t.content)?t.content:[];if(r.length===0){var s,o;const i=Array.isArray(n==null||(s=n.previousNode)===null||s===void 0?void 0:s.content)?n.previousNode.content:[];return(n==null||(o=n.previousNode)===null||o===void 0?void 0:o.type)==="paragraph"&&i.length===0?Gs:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ZN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,eM=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,tM=Jn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Se(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Un({find:ZN,type:this.type})]},addPasteRules(){return[hn({find:eM,type:this.type})]}}),nM=qe.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),rM=Jn.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Se(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),sM=be.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(Tw.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(Sw.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(ug.configure(this.options.bulletList)),this.options.code!==!1&&t.push(Ow.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(jw.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(Rw.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(rw.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(sw.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(Pw.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(Lw.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(xw.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push($w.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(Hw.configure(this.options.italic)),this.options.listItem!==!1&&t.push(mg.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(yg.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var n;t.push(cg.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&t.push(bg.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(QN.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(tM.configure(this.options.strike)),this.options.text!==!1&&t.push(nM.configure(this.options.text)),this.options.underline!==!1){var r;t.push(rM.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var s;t.push(yw.configure((s=this.options)===null||s===void 0?void 0:s.trailingNode))}return t}});var oM=sM;const bn=16,sl=2.5,ol=(bn-sl)/2,na=2*Math.PI*ol;function vg(t){const e=_.c(29),{usage:n}=t;if(!n)return null;const{totalTokens:r,inputTokens:s,outputTokens:o,cost:i}=n;if(!r&&!s&&!o)return null;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx(P1,{size:12}),e[0]=a):a=e[0];let l;e[1]!==i||e[2]!==r?(l=i>0?`$${i.toFixed(4)}`:r.toLocaleString(),e[1]=i,e[2]=r,e[3]=l):l=e[3];let c;e[4]!==l?(c=p.jsx(_n,{asChild:!0,children:p.jsxs("span",{className:"inline-flex items-center text-muted-foreground [@media(hover:hover)]:hover:text-foreground pl-1 h-6 gap-1 whitespace-nowrap shrink-0 cursor-default",children:[a,p.jsx("span",{className:"text-sm font-mono tabular-nums",children:l})]})}),e[4]=l,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("p",{className:"text-muted text-[10px] mb-1",children:"tokens"}),e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsx("span",{className:"text-muted",children:"in"}),e[7]=d):d=e[7];let f;e[8]!==s?(f=s.toLocaleString(),e[8]=s,e[9]=f):f=e[9];let h;e[10]!==f?(h=p.jsx("span",{className:"text-right tabular-nums",children:f}),e[10]=f,e[11]=h):h=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx("span",{className:"text-muted",children:"out"}),e[12]=m):m=e[12];const y=o-(n.reasoningTokens??0);let g;e[13]!==y?(g=y.toLocaleString(),e[13]=y,e[14]=g):g=e[14];let x;e[15]!==g?(x=p.jsx("span",{className:"text-right tabular-nums",children:g}),e[15]=g,e[16]=x):x=e[16];let b;e[17]!==n?(b=(n.cacheReadTokens>0||n.cacheWriteTokens>0)&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cache hit"}),p.jsx("span",{className:"text-right tabular-nums",children:`${(Cl(n)*100).toFixed(0)}%`})]}),e[17]=n,e[18]=b):b=e[18];let v;e[19]!==i?(v=i>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cost"}),p.jsxs("span",{className:"text-right tabular-nums",children:["$",i.toFixed(4)]})]}),e[19]=i,e[20]=v):v=e[20];let k;e[21]!==x||e[22]!==b||e[23]!==v||e[24]!==h?(k=p.jsxs(Bn,{side:"top",className:"font-mono text-[11px]",children:[u,p.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[d,h,m,x,b,v]})]}),e[21]=x,e[22]=b,e[23]=v,e[24]=h,e[25]=k):k=e[25];let N;return e[26]!==k||e[27]!==c?(N=p.jsxs(zn,{children:[c,k]}),e[26]=k,e[27]=c,e[28]=N):N=e[28],N}function iM(t){const e=_.c(19),{usage:n,duration:r}=t,s=r!=null&&r>0,o=n!=null&&(n.cost??0)>0,i=n!=null&&(n.totalTokens??0)>0;if(!s&&!o&&!i)return null;let a;e[0]!==r||e[1]!==s?(a=s?Fn(r/1e3):null,e[0]=r,e[1]=s,e[2]=a):a=e[2];const l=a;let c;e[3]!==r||e[4]!==l||e[5]!==n?(c=l&&p.jsxs(zn,{children:[p.jsx(_n,{asChild:!0,children:p.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:l})}),p.jsxs(Bn,{side:"top",className:"font-mono text-[11px]",children:[p.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"thinking"}),p.jsx("span",{className:"tabular-nums",children:Fn(r/1e3)}),(n?.reasoningTokens??0)>0&&p.jsxs("span",{className:"ml-2 opacity-50",children:[n.reasoningTokens.toLocaleString()," tok"]})]})]}),e[3]=r,e[4]=l,e[5]=n,e[6]=c):c=e[6];let u;e[7]!==o||e[8]!==s||e[9]!==i?(u=s&&(o||i)&&p.jsx("span",{className:"text-muted-foreground/40 select-none",children:"·"}),e[7]=o,e[8]=s,e[9]=i,e[10]=u):u=e[10];let d;e[11]!==o||e[12]!==i||e[13]!==n?(d=(o||i)&&p.jsxs(zn,{children:[p.jsx(_n,{asChild:!0,children:p.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground cursor-default [@media(hover:hover)]:hover:text-foreground transition-colors select-none",children:o?`$${n.cost.toFixed(4)}`:`${n.totalTokens.toLocaleString()} tok`})}),p.jsxs(Bn,{side:"top",className:"font-mono text-[11px]",children:[p.jsx("p",{className:"opacity-60 text-[10px] mb-1",children:"tokens"}),p.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[p.jsx("span",{className:"opacity-60",children:"in"}),p.jsx("span",{className:"text-right tabular-nums",children:(n.inputTokens??0).toLocaleString()}),p.jsx("span",{className:"opacity-60",children:"out"}),p.jsx("span",{className:"text-right tabular-nums",children:((n.outputTokens??0)-(n?.reasoningTokens??0)).toLocaleString()}),(n?.reasoningTokens??0)>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"opacity-60",children:"think"}),p.jsx("span",{className:"text-right tabular-nums",children:n.reasoningTokens.toLocaleString()})]}),((n?.cacheReadTokens??0)>0||(n?.cacheWriteTokens??0)>0)&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"opacity-60",children:"cache hit"}),p.jsx("span",{className:"text-right tabular-nums",children:`${(Cl(n)*100).toFixed(0)}%`})]})]})]})]}),e[11]=o,e[12]=i,e[13]=n,e[14]=d):d=e[14];let f;return e[15]!==c||e[16]!==u||e[17]!==d?(f=p.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c,u,d]}),e[15]=c,e[16]=u,e[17]=d,e[18]=f):f=e[18],f}function uA(t){const e=_.c(49),{usage:n,totalTokens:r,contextWindow:s,onOpenContextPanel:o}=t,i=Math.min(r/s*100,100),a=na-i/100*na,l=n?.cost??0,c=n?.inputTokens??0,u=n?.outputTokens??0;let d;e[0]!==i?(d=i.toFixed(0),e[0]=i,e[1]=d):d=e[1];let f;e[2]!==l?(f=l>0?`, $${l.toFixed(2)}`:"",e[2]=l,e[3]=f):f=e[3];const h=`Context usage: ${d}%${f}`,m=o?"cursor-pointer":"cursor-default";let y;e[4]!==m?(y=G("flex items-center gap-1.5 text-muted-foreground hover:text-foreground h-6 px-1 shrink-0",m),e[4]=m,e[5]=y):y=e[5];let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=p.jsx("circle",{cx:bn/2,cy:bn/2,r:ol,fill:"none",stroke:"currentColor",strokeWidth:sl,className:"opacity-15"}),e[6]=g):g=e[6];const x=i>90?"text-destructive":i>70?"text-warning":"text-muted-foreground";let b;e[7]!==x?(b=G(x),e[7]=x,e[8]=b):b=e[8];let v;e[9]!==a||e[10]!==b?(v=p.jsxs("svg",{width:bn,height:bn,className:"-rotate-90","aria-hidden":"true",children:[g,p.jsx("circle",{cx:bn/2,cy:bn/2,r:ol,fill:"none",stroke:"currentColor",strokeWidth:sl,strokeDasharray:na,strokeDashoffset:a,strokeLinecap:"round",className:b})]}),e[9]=a,e[10]=b,e[11]=v):v=e[11];let k;e[12]!==i?(k=i.toFixed(0),e[12]=i,e[13]=k):k=e[13];let N;e[14]!==l?(N=l>0?` · $${l.toFixed(2)}`:"",e[14]=l,e[15]=N):N=e[15];let C;e[16]!==k||e[17]!==N?(C=p.jsxs("span",{className:"inline-block overflow-hidden whitespace-nowrap max-w-0 opacity-0 transition-[max-width,opacity] duration-200 ease-out @[320px]/chat-bottom:max-w-32 @[320px]/chat-bottom:opacity-100 text-[11px] font-mono tabular-nums",children:[k,"%",N]}),e[16]=k,e[17]=N,e[18]=C):C=e[18];let S;e[19]!==o||e[20]!==C||e[21]!==h||e[22]!==y||e[23]!==v?(S=p.jsx(_n,{asChild:!0,children:p.jsxs("button",{type:"button",onClick:o,"aria-label":h,className:y,children:[v,C]})}),e[19]=o,e[20]=C,e[21]=h,e[22]=y,e[23]=v,e[24]=S):S=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=p.jsx("span",{className:"text-muted",children:"context"}),e[25]=w):w=e[25];let M;e[26]!==r?(M=r.toLocaleString(),e[26]=r,e[27]=M):M=e[27];let T;e[28]!==s?(T=s.toLocaleString(),e[28]=s,e[29]=T):T=e[29];let O;e[30]!==i?(O=i.toFixed(1),e[30]=i,e[31]=O):O=e[31];let A;e[32]!==M||e[33]!==T||e[34]!==O?(A=p.jsxs("span",{className:"text-right tabular-nums",children:[M," / ",T," (",O,"%)"]}),e[32]=M,e[33]=T,e[34]=O,e[35]=A):A=e[35];let P;e[36]!==l||e[37]!==c||e[38]!==u?(P=l>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cost"}),p.jsxs("span",{className:"text-right tabular-nums",children:["$",l.toFixed(4)]}),p.jsx("span",{className:"text-muted",children:"in"}),p.jsx("span",{className:"text-right tabular-nums",children:c.toLocaleString()}),p.jsx("span",{className:"text-muted",children:"out"}),p.jsx("span",{className:"text-right tabular-nums",children:u.toLocaleString()})]}),e[36]=l,e[37]=c,e[38]=u,e[39]=P):P=e[39];let D;e[40]!==n?(D=((n?.cacheReadTokens??0)>0||(n?.cacheWriteTokens??0)>0)&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cache hit"}),p.jsx("span",{className:"text-right tabular-nums",children:`${(Cl(n)*100).toFixed(0)}%`})]}),e[40]=n,e[41]=D):D=e[41];let E;e[42]!==A||e[43]!==P||e[44]!==D?(E=p.jsx(Bn,{side:"top",className:"font-mono text-[11px]",children:p.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",children:[w,A,P,D]})}),e[42]=A,e[43]=P,e[44]=D,e[45]=E):E=e[45];let j;return e[46]!==S||e[47]!==E?(j=p.jsxs(zn,{children:[S,E]}),e[46]=S,e[47]=E,e[48]=j):j=e[48],j}var Si="Collapsible",[aM,dA]=E1(Si),[lM,vc]=aM(Si),kg=L.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...a}=t,[l,c]=S1({prop:r,defaultProp:s??!1,onChange:i,caller:Si});return p.jsx(lM,{scope:n,disabled:o,contentId:C1(),open:l,onOpenToggle:L.useCallback(()=>c(u=>!u),[c]),children:p.jsx(pl.div,{"data-state":wc(l),"data-disabled":o?"":void 0,...a,ref:e})})});kg.displayName=Si;var Sg="CollapsibleTrigger",kc=L.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=vc(Sg,n);return p.jsx(pl.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":wc(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:w1(t.onClick,s.onOpenToggle)})});kc.displayName=Sg;var Sc="CollapsibleContent",Cc=L.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=vc(Sc,t.__scopeCollapsible);return p.jsx(N1,{present:n||s.open,children:({present:o})=>p.jsx(cM,{...r,ref:e,present:o})})});Cc.displayName=Sc;var cM=L.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=t,i=vc(Sc,n),[a,l]=L.useState(r),c=L.useRef(null),u=M1(e,c),d=L.useRef(0),f=d.current,h=L.useRef(0),m=h.current,y=i.open||a,g=L.useRef(y),x=L.useRef(void 0);return L.useEffect(()=>{const b=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(b)},[]),T1(()=>{const b=c.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const v=b.getBoundingClientRect();d.current=v.height,h.current=v.width,g.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),l(r)}},[i.open,r]),p.jsx(pl.div,{"data-state":wc(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!y,...o,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...t.style},children:y&&s})});function wc(t){return t?"open":"closed"}var uM=kg,fA=kc,hA=Cc;function dM(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=p.jsx(uM,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function fM(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=p.jsx(kc,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function hM(t){const e=_.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let s;e[3]!==n?(s=G("overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down motion-reduce:animate-none",n),e[3]=n,e[4]=s):s=e[4];let o;return e[5]!==r||e[6]!==s?(o=p.jsx(Cc,{"data-slot":"collapsible-content",className:s,...r}),e[5]=r,e[6]=s,e[7]=o):o=e[7],o}function ne({icon:t,title:e,usage:n,summary:r,state:s,detail:o,detailVariant:i="code",forceOpen:a,variant:l="default",trailing:c,iconDestructive:u,alwaysChevron:d,defaultOpen:f,children:h}){const m=J(),[y,g]=L.useState(f??!1),{handleCopy:x,copied:b}=$f(),v=s==="loading",k=s==="error",C=!!(o&&o.trim())||!!h,S=l==="subtask",w=(a??!1)||y,M=ny({initial:v?"instant":!1}),T=p.jsxs(dM,{open:w,onOpenChange:a?void 0:g,className:"min-w-0",children:[p.jsxs(fM,{disabled:!C,className:G("group/tool flex items-center gap-2 w-full py-2.5 text-left transition-colors",C&&"[@media(hover:hover)]:hover:bg-accent/30",!C&&"cursor-default",v&&"shimmer"),"aria-disabled":!C,children:[p.jsx("div",{className:"relative shrink-0 size-4 flex items-center justify-center",children:d?p.jsx(ma,{className:G("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",w&&"rotate-90")}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:G("absolute inset-0 flex items-center justify-center [&>svg]:size-4 transition-opacity duration-150",u?"[&>svg]:text-destructive/70":k?"[&>svg]:text-warning/70":"[&>svg]:text-muted-foreground/75",C&&(w?"opacity-0":"[@media(hover:hover)]:group-hover/tool:opacity-0")),children:t}),C&&p.jsx("div",{className:G("absolute inset-0 flex items-center justify-center transition-opacity duration-150",w?"opacity-100":"opacity-0 [@media(hover:hover)]:group-hover/tool:opacity-100"),children:p.jsx(ma,{className:G("size-4 text-foreground/60 transition-transform duration-200 ease-in-out",w&&"rotate-90")})})]})}),p.jsx("span",{className:G("shrink-0 text-[14px] font-normal",k?"text-warning/80":"text-foreground"),children:e}),r?p.jsx("span",{className:"min-w-0 flex-1 truncate",children:p.jsx("span",{className:"text-[12px] text-muted-foreground/60 bg-muted/50 rounded-[3px] px-1 py-px leading-none",children:r})}):p.jsx("div",{className:"flex-1"}),c&&p.jsx("div",{className:"shrink-0 flex items-center gap-1 [&_svg]:size-3.5 [&_svg]:text-muted-foreground/50",children:c}),p.jsx(vg,{usage:n})]}),C&&p.jsx(hM,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:h||(i==="prose"?p.jsx("div",{className:"mt-1 mb-1",children:p.jsx("div",{ref:M.scrollRef,className:"max-h-[150px] overflow-y-auto rounded-md bg-muted/30 px-3 py-2",children:p.jsx("p",{ref:M.contentRef,className:"text-xs text-muted-foreground/70 whitespace-pre-wrap leading-relaxed wrap-break-word",children:o})})}):p.jsx("div",{className:"ml-[20px] pl-3 border-l border-border/30 mt-0.5 pb-1",children:p.jsx("div",{ref:M.scrollRef,className:"flex flex-col max-h-48 overflow-y-auto",children:p.jsxs("div",{ref:M.contentRef,className:"flex items-start justify-between gap-2",children:[p.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:p.jsx("pre",{className:"text-xs font-mono text-muted-foreground/70 whitespace-pre-wrap wrap-break-word",children:o})}),p.jsx("button",{type:"button",onClick:()=>x(o),className:"shrink-0 p-1.5 rounded-md text-muted-foreground/50 [@media(hover:hover)]:hover:text-foreground [@media(hover:hover)]:hover:bg-accent/50 transition-colors active:scale-[0.97]","aria-label":m("common.copy"),children:b?p.jsx(xl,{className:"size-3.5"}):p.jsx(Lf,{className:"size-3.5"})})]})})}))})]});return S?p.jsx("div",{className:"pl-4 border-l border-border/40 ml-1.5",children:T}):T}function Le(t){const e=_.c(4),{latency:n}=t;if(n==null||n<=0)return null;let r;e[0]!==n?(r=Fn(n),e[0]=n,e[1]=r):r=e[1];let s;return e[2]!==r?(s=p.jsx("span",{className:"text-[11px] font-mono tabular-nums text-muted-foreground",children:r}),e[2]=r,e[3]=s):s=e[3],s}const Cg=4;function wg(t){const e=_.c(8),{count:n,noun:r,onClick:s}=t,o=J();let i;e[0]!==n||e[1]!==r||e[2]!==o?(i=o("common.seeAll",{count:n,noun:r}),e[0]=n,e[1]=r,e[2]=o,e[3]=i):i=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx(Pf,{className:"size-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"}),e[4]=a):a=e[4];let l;return e[5]!==s||e[6]!==i?(l=p.jsxs("button",{type:"button",onClick:s,className:"group flex w-full items-center justify-center gap-1.5 rounded-lg border border-border bg-card px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[i,a]}),e[5]=s,e[6]=i,e[7]=l):l=e[7],l}function Ng(t){const e=_.c(12),{message:n,className:r}=t,s=n.created_at??n.metadata?.created_at??null;let o,i,a,l;if(e[0]!==r||e[1]!==s){l=Symbol.for("react.early_return_sentinel");e:{const u=bl(s);if(u===null){l=null;break e}const d=new Date(u);o=d.toLocaleString(),e[6]!==r?(i=G("text-[11px] text-muted-foreground/60 select-none",r),e[6]=r,e[7]=i):i=e[7],a=d.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}e[0]=r,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=l}else o=e[2],i=e[3],a=e[4],l=e[5];if(l!==Symbol.for("react.early_return_sentinel"))return l;let c;return e[8]!==o||e[9]!==i||e[10]!==a?(c=p.jsx("span",{title:o,className:i,children:a}),e[8]=o,e[9]=i,e[10]=a,e[11]=c):c=e[11],c}function il(t){const e=_.c(9),{since:n}=t;let r;e[0]!==n?(r=()=>Yc(n,Date.now()),e[0]=n,e[1]=r):r=e[1];const[s,o]=L.useState(r);let i,a;e[2]!==n?(i=()=>{const d=setInterval(()=>o(Yc(n,Date.now())),100);return()=>clearInterval(d)},a=[n],e[2]=n,e[3]=i,e[4]=a):(i=e[3],a=e[4]),L.useEffect(i,a);const l=s/1e3;let c;e[5]!==l?(c=Fn(l),e[5]=l,e[6]=c):c=e[6];let u;return e[7]!==c?(u=p.jsx("span",{className:"tabular-nums text-sm font-mono text-muted-foreground/50",children:c}),e[7]=c,e[8]=u):u=e[8],u}const Mg=[{delay:0},{delay:100},{delay:200},{delay:100},{delay:200},{delay:200},{delay:300},{delay:300},{delay:400}];function pM(){const t=_.c(5),[e]=L.useState(mM);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={gridTemplateColumns:"repeat(3, 3px)",gap:"1.5px",width:"fit-content"},t[0]=n):n=t[0];let r;t[1]!==e?(r=Mg.map((o,i)=>{const{delay:a}=o;return p.jsx("div",{className:"rounded-[1px]",style:{width:3,height:3,"--cell-color":e[i],animation:"grid-ripple 1s ease infinite",animationDelay:`${a}ms`}},i)}),t[1]=e,t[2]=r):r=t[2];let s;return t[3]!==r?(s=p.jsx("div",{className:"grid",style:n,children:r}),t[3]=r,t[4]=s):s=t[4],s}function mM(){const t=`var(--chart-${Math.ceil(Math.random()*5)})`;return Mg.map(()=>Math.random()<.6?"color-mix(in srgb, var(--muted-foreground) 25%, transparent)":t)}const Jd=new Map;function Tg(t){let e=Jd.get(t);return e||(e={tick:0,subscribers:new Set,intervalId:null},Jd.set(t,e)),e}function gM(t,e){const n=Tg(t);return n.subscribers.add(e),n.intervalId===null&&(n.intervalId=setInterval(()=>{n.tick+=1;for(const r of n.subscribers)r()},t)),()=>{n.subscribers.delete(e),n.subscribers.size===0&&n.intervalId!==null&&(clearInterval(n.intervalId),n.intervalId=null)}}function Nc(t){const e=_.c(3),n=t===void 0?6e4:t;let r,s;return e[0]!==n?(r=o=>gM(n,o),s=()=>Tg(n).tick,e[0]=n,e[1]=r,e[2]=s):(r=e[1],s=e[2]),L.useSyncExternalStore(r,s,yM)}function yM(){return 0}function xM(t){return{planning:{icon:p.jsx($1,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:t("chat.thinkingIndicator.planningLabel"),detail:t("chat.thinkingIndicator.planningDetail")},thinking:{icon:p.jsx(ri,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:t("chat.thinkingIndicator.thinkingLabel"),detail:t("chat.thinkingIndicator.thinkingDetail")}}}const bM=1200;function al(t){const e=_.c(8),{icon:n,title:r,summary:s,detail:o,state:i,detailVariant:a,trailing:l}=t,c=a===void 0?"prose":a;let u;return e[0]!==o||e[1]!==c||e[2]!==n||e[3]!==i||e[4]!==s||e[5]!==r||e[6]!==l?(u=p.jsx(ne,{icon:n,title:r,summary:s,detail:o,state:i,detailVariant:c,trailing:l}),e[0]=o,e[1]=c,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=l,e[7]=u):u=e[7],u}function vM(t){const e=_.c(22),{startedAt:n}=t,r=J(),s=wr()?.runStatusStage??null,[o,i]=L.useState("planning");let a,l;if(e[0]!==s?(a=()=>{if(s!==null)return;const y=setTimeout(()=>{i("thinking")},bM);return()=>{clearTimeout(y)}},l=[s],e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]),L.useEffect(a,l),s!==null){let y;e[3]!==s||e[4]!==r?(y=g0(r,s),e[3]=s,e[4]=r,e[5]=y):y=e[5];const g=y;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=p.jsx(ri,{className:"size-4"}),e[6]=x):x=e[6];const b=`${g.label}...`;let v;e[7]!==n?(v=n!==null&&p.jsx(il,{since:n}),e[7]=n,e[8]=v):v=e[8];let k;return e[9]!==g.detail||e[10]!==b||e[11]!==v?(k=p.jsx(al,{icon:x,title:b,summary:g.detail,state:"loading",trailing:v}),e[9]=g.detail,e[10]=b,e[11]=v,e[12]=k):k=e[12],k}let c;e[13]!==r?(c=xM(r),e[13]=r,e[14]=c):c=e[14];const d=c[o],f=`${d.label}...`;let h;e[15]!==n?(h=n!==null&&p.jsx(il,{since:n}),e[15]=n,e[16]=h):h=e[16];let m;return e[17]!==d.detail||e[18]!==d.icon||e[19]!==f||e[20]!==h?(m=p.jsx(al,{icon:d.icon,title:f,summary:d.detail,state:"loading",trailing:h}),e[17]=d.detail,e[18]=d.icon,e[19]=f,e[20]=h,e[21]=m):m=e[21],m}function kM(t){const e=_.c(3),{startedAt:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx(pM,{}),e[0]=r):r=e[0];let s;return e[1]!==n?(s=p.jsxs("div",{className:"flex items-center gap-2.5 mt-1 pb-1 text-muted-foreground/40 select-none",children:[r,p.jsx(il,{since:n})]}),e[1]=n,e[2]=s):s=e[2],s}const SM=2e4;function CM(t){const e=_.c(9),{startedAt:n}=t,r=J();Nc(1e3);const s=wr(),i=(n!==null?Date.now()-n:0)>=SM;let a;e[0]!==n?(a=p.jsx(vM,{startedAt:n}),e[0]=n,e[1]=a):a=e[1];let l;e[2]!==i||e[3]!==s||e[4]!==r?(l=i&&s?.stop&&p.jsxs("div",{className:"flex items-center gap-2 pb-1 text-[13px] text-muted-foreground/60",children:[p.jsx("span",{children:r("chat.thinkingIndicator.takingLonger")}),p.jsx("button",{type:"button",onClick:()=>s.stop(),className:"text-muted-foreground hover:text-foreground underline underline-offset-2",children:r("chat.thinkingIndicator.cancel")})]}),e[2]=i,e[3]=s,e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==a||e[7]!==l?(c=p.jsxs("div",{className:"flex flex-col gap-0.5",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8],c}function wM(t){const e=_.c(24),{duration:n,parts:r,isStreaming:s}=t,o=J();let i;e[0]!==r?(i=r.every(TM),e[0]=r,e[1]=i):i=e[1];const a=i;let l;e[2]!==n||e[3]!==o?(l=n&&n/1e3>1?o("chat.thinkingIndicator.thoughtFor",{duration:Fn(n/1e3)}):o("chat.thinkingIndicator.thought"),e[2]=n,e[3]=o,e[4]=l):l=e[4];const c=l;let u;if(e[5]!==a||e[6]!==s||e[7]!==r){const v=r.map(MM).join(`
142
142
  `).trim().split(`
143
143
  `).filter(Boolean),k=s?v[v.length-1]??"":v[0]??"";u=!a&&k?k.length>100?k.slice(0,100)+"…":k:void 0,e[5]=a,e[6]=s,e[7]=r,e[8]=u}else u=e[8];const d=u;let f;if(e[9]!==a||e[10]!==r){const b=r.map(NM).join(`
144
144
 
@@ -1 +1 @@
1
- import{c as B,j as o,b as $,G as D,d as M,r as q,P as d,B as G,o as R}from"./index-BAedCESS.js";import{s as V}from"./Plus-CLw8nshS.js";import{i as S}from"./Zap-Dp5FptyY.js";import{S as F}from"./search-input-NP3xLzdZ.js";import{E as T}from"./empty-state-Dtwkb-iN.js";import{c as H}from"./use-automations-DiccRABG.js";import{u as J}from"./use-navigate-to-agent-CGLdpa0F.js";import{A as K}from"./automation-list-row-oRD34d51.js";import{s as O}from"./use-mcp-client-DRbjI6tX.js";import{a as Q}from"./use-virtual-mcp-C4XUTl0E.js";import{R as U}from"./require-capability-B2N02pbD.js";import"./SearchMd-CvoyvhDO.js";import"./use-destination-route-B0lMhqr-.js";import"./hooks-DxiN--jI.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BV-nZdw9.js";import"./task-board-DhERAZm4.js";import"./schema-bn-nczrm.js";import"./thread-intent-C60z1Ups.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-CTPv5ZM2.js";import"./alert-dialog-CfLTHal2.js";import"./dropdown-menu-BdAGNhae.js";import"./Check-Dg3ccedM.js";import"./ChevronRight-CTynsPcA.js";import"./DotsVertical-DERxV0IT.js";import"./agent-icon-Dy2jpds_.js";import"./AlertCircle-CmSNkMzR.js";import"./Tool01-DN82p4SK.js";import"./ArrowUp-DSV_iaE8.js";import"./ArrowLeft-Bu94Ii5M.js";import"./Tool02-Cnm0LDZR.js";import"./ArrowRight-mDGbrugB.js";import"./TrendUp01-Du_0IpAS.js";import"./ZoomOut-CzL3lV9f.js";import"./Users03-CxjX2yOG.js";import"./CheckCircle-CXvhBSH9.js";import"./ChevronUp-bmYG6LkB.js";import"./ChevronSelectorVertical-CXzhk4X8.js";import"./UserSquare-CMhNzA5S.js";import"./Copy01-C_pD92sU.js";import"./CreditCard01-DZSvJ623.js";import"./Download01-BrJcEIOJ.js";import"./Settings02-B-LW8mkp.js";import"./Eye-DtzSWYJp.js";import"./Share07-DzwLu6Js.js";import"./GitBranch01-CNkrChzn.js";import"./Globe01-DSqDXciw.js";import"./XClose-B2yo755N.js";import"./HardDrive-C33hwgdT.js";import"./Image01-CSSIg-V1.js";import"./Key01-BArMmeeh.js";import"./Link01-D9m0U2Ta.js";import"./LinkExternal01-_yUVYhsR.js";import"./Monitor01-TbxGy4uJ.js";import"./Sun-BeFqPYZz.js";import"./Package-CIgjd15K.js";import"./Palette-BJjA93OF.js";import"./Play-CuabQ6V5.js";import"./SearchLg-B_uG9UNP.js";import"./Shield01-CHOtU8tO.js";import"./Stars01-CQM502gA.js";import"./Trash01-D3glACCY.js";import"./Upload01-D8T1C7P0.js";import"./User01-ChUO6wNS.js";import"./Users01-BkdRerkJ.js";import"./XCircle-Q_FzfXfM.js";import"./auth-BRCvCyvK.js";import"./access-gate-BZEI0Ppn.js";import"./capability-load-error-BJ_jcKAV.js";function W(){const t=B.c(20),e=$(),{org:l}=D(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=M(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(F,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(G,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function fo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{fo as default};
1
+ import{c as B,j as o,b as $,G as D,d as M,r as q,P as d,B as G,o as R}from"./index-BbDu2xq3.js";import{s as V}from"./Plus-DsoHS1s-.js";import{i as S}from"./Zap-DNjSZhAl.js";import{S as F}from"./search-input-Dg-G_3ZW.js";import{E as T}from"./empty-state-Cm5_JlLy.js";import{c as H}from"./use-automations-BdYWhhm1.js";import{u as J}from"./use-navigate-to-agent-874sGcUI.js";import{A as K}from"./automation-list-row-DvZQrXCp.js";import{s as O}from"./use-mcp-client-BPlXnENu.js";import{a as Q}from"./use-virtual-mcp-DaOGpnoF.js";import{R as U}from"./require-capability-CmB8qaJ4.js";import"./SearchMd-DBtIEQFG.js";import"./use-destination-route-UJWTmz4J.js";import"./hooks-DpCU1UBz.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CciVCe4h.js";import"./task-board-ztfxGGkb.js";import"./schema-BCMlOSyV.js";import"./thread-intent-CMg782e5.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-CTPv5ZM2.js";import"./alert-dialog-KXEmr_A6.js";import"./dropdown-menu-C2_-PA0d.js";import"./Check-B_YxhG30.js";import"./ChevronRight-CHv3VYgp.js";import"./DotsVertical-BrftgIDe.js";import"./agent-icon-7Ul-3CFr.js";import"./AlertCircle-DM1wOTV-.js";import"./Tool01-BfzgVlWE.js";import"./ArrowUp-OudgxKkt.js";import"./ArrowLeft-9dpHwu9-.js";import"./Tool02-DJ6ebzoK.js";import"./ArrowRight-B-LgiGJk.js";import"./TrendUp01-CbspxXI2.js";import"./ZoomOut-vW_y2VPH.js";import"./Users03-BX6ICswR.js";import"./CheckCircle-dm6kQxSf.js";import"./ChevronUp-t8t4fwnR.js";import"./ChevronSelectorVertical-DE7kv4Kd.js";import"./UserSquare-BSLxGup_.js";import"./Copy01-Cka2uFEv.js";import"./CreditCard01-BRxvnKr_.js";import"./Download01-ytOYmKSZ.js";import"./Settings02-nB2LBjem.js";import"./Eye-Cze9SkdO.js";import"./Share07-DxFaah4G.js";import"./GitBranch01-Dv92hLUV.js";import"./Globe01-CFZdQViA.js";import"./XClose-C3LO4RAn.js";import"./HardDrive-B6O4Lzvt.js";import"./Image01-DPhR8WEz.js";import"./Key01-CnMMlNjM.js";import"./Link01-BT9hUC6n.js";import"./LinkExternal01-Dd9_oVMY.js";import"./Monitor01-lCN_Uznr.js";import"./Sun-Cf4BP4WB.js";import"./Package-Pjoambo8.js";import"./Palette-CPWVOo_O.js";import"./Play-DUteIsFY.js";import"./SearchLg-DVGtsQMZ.js";import"./Shield01-YkTEmRCE.js";import"./Stars01-XqGB97Zv.js";import"./Trash01-CdmAHj_X.js";import"./Upload01-Bhk_UoPj.js";import"./User01-BkT796JC.js";import"./Users01-Dyo9ZzPj.js";import"./XCircle-CJuCeBSM.js";import"./auth-jEXOVJdJ.js";import"./access-gate-CsjPwmbX.js";import"./capability-load-error-Ewp013Fw.js";function W(){const t=B.c(20),e=$(),{org:l}=D(),{data:C}=H(void 0),g=C===void 0?[]:C,k=Q(),P=J(),f=M(),[x,E]=q.useState(""),h=x.toLowerCase(),A=new Map(k.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const p=A.get(i.virtual_mcp_id);if(p&&p.title.toLowerCase().includes(h))return!0}return!1}),z=(i,p)=>{const N=p&&A.has(p)?p:O(l.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let c;t[0]!==f||t[1]!==l.slug?(c=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/agents",params:{org:l.slug}})},t[0]=f,t[1]=l.slug,t[2]=c):c=t[2];const L=c,j=d,v=d,w=d;let s;t[3]!==e?(s=e("settings.automations.pageTitle"),t[3]=e,t[4]=s):s=t[4];let r;t[5]!==s?(r=o.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const _=g.length>0&&o.jsx(F,{value:x,onChange:E,placeholder:e("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let m;t[7]!==r||t[8]!==_?(m=o.jsxs("div",{className:"flex flex-col gap-6",children:[r,_]}),t[7]=r,t[8]=_,t[9]=m):m=t[9];const y=g.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.emptyTitle"),description:e("settings.automations.emptyDescription"),actions:o.jsxs(G,{size:"sm",onClick:L,children:[o.jsx(V,{size:14}),e("settings.automations.browseAgentsButton")]})})}):b.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(T,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:e("settings.automations.noResultsTitle"),description:e("settings.automations.noResultsDescription",{search:x})})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:b.map(i=>o.jsx(K,{automation:i,showAgent:!0,onClick:()=>z(i.id,i.virtual_mcp_id)},i.id))});let n;t[10]!==w.Body||t[11]!==m||t[12]!==y?(n=o.jsxs(w.Body,{children:[m,y]}),t[10]=w.Body,t[11]=m,t[12]=y,t[13]=n):n=t[13];let a;t[14]!==v.Content||t[15]!==n?(a=o.jsx(v.Content,{children:n}),t[14]=v.Content,t[15]=n,t[16]=a):a=t[16];let u;return t[17]!==j||t[18]!==a?(u=o.jsx(j,{children:a}),t[17]=j,t[18]=a,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function fo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx(U,{capability:"automations:manage",area:"automations",children:o.jsx(W,{})}),t[0]=e):e=t[0],e}export{fo as default};
@@ -1 +1 @@
1
- import{M as d}from"./index-BAedCESS.js";const m=1e4,y="true",i=2;function a(t,n){return d.chatAutosend(t,n)}function l(t){return t==="pending"||t==="sending"}function f(t){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!="object")return null;const e=n;let o=0;e.status==="sending"?o=e.retryAt===void 0?1:i:e.retryAt!==void 0&&(o=1);const r=e.attempt===void 0?o:e.attempt;return typeof e.createdAt!="number"||typeof e.message!="object"||!l(e.status)||e.retryAt!==void 0&&typeof e.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>i?null:{...n,attempt:r}}function S(t,n,e,o,r=Date.now()){const s={message:o,createdAt:r,status:"pending",attempt:0};return t.setItem(a(n,e),JSON.stringify(s)),s}function p(t,n,e){const o=a(n,e),r=f(t.getItem(o));return r||(t.removeItem(o),null)}function g(t,n,e,o=Date.now()){const r=a(n,e),s=p(t,n,e);if(!s||s.status!=="pending")return null;if(s.attempt>=i)return t.removeItem(r),null;const c=s.retryAt??s.createdAt;if(o-c>=m)return t.removeItem(r),null;const u={...s,status:"sending",attempt:s.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function T(t,n,e){t.removeItem(a(n,e))}export{y as A,T as a,g as c,S as w};
1
+ import{M as d}from"./index-BbDu2xq3.js";const m=1e4,y="true",i=2;function a(t,n){return d.chatAutosend(t,n)}function l(t){return t==="pending"||t==="sending"}function f(t){if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!n||typeof n!="object")return null;const e=n;let o=0;e.status==="sending"?o=e.retryAt===void 0?1:i:e.retryAt!==void 0&&(o=1);const r=e.attempt===void 0?o:e.attempt;return typeof e.createdAt!="number"||typeof e.message!="object"||!l(e.status)||e.retryAt!==void 0&&typeof e.retryAt!="number"||typeof r!="number"||!Number.isInteger(r)||r<0||r>i?null:{...n,attempt:r}}function S(t,n,e,o,r=Date.now()){const s={message:o,createdAt:r,status:"pending",attempt:0};return t.setItem(a(n,e),JSON.stringify(s)),s}function p(t,n,e){const o=a(n,e),r=f(t.getItem(o));return r||(t.removeItem(o),null)}function g(t,n,e,o=Date.now()){const r=a(n,e),s=p(t,n,e);if(!s||s.status!=="pending")return null;if(s.attempt>=i)return t.removeItem(r),null;const c=s.retryAt??s.createdAt;if(o-c>=m)return t.removeItem(r),null;const u={...s,status:"sending",attempt:s.attempt+1};return t.setItem(r,JSON.stringify(u)),{message:u.message,createdAt:u.createdAt,attempt:u.attempt}}function T(t,n,e){t.removeItem(a(n,e))}export{y as A,T as a,g as c,S as w};
@@ -1 +1 @@
1
- import{c as k,j as i,l as m,bH as R,dS as V,dT as I,dU as U}from"./index-BAedCESS.js";import{s as $}from"./User01-ChUO6wNS.js";function O(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],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)%C.length;return C[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=T;break e}if(typeof t=="string"){let c;e[11]!==t?(c=L(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx($,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function W(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(H,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}W.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{W as A};
1
+ import{c as k,j as i,l as m,bH as R,dS as V,dT as I,dU as U}from"./index-BbDu2xq3.js";import{s as $}from"./User01-BkT796JC.js";function O(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("relative flex size-8 shrink-0 overflow-hidden rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(U,{"data-slot":"avatar",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function E(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("aspect-square size-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(V,{"data-slot":"avatar-image",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}function M(r){const e=k.c(8);let s,t;e[0]!==r?({className:s,...t}=r,e[0]=r,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let o;e[3]!==s?(o=m("bg-muted flex size-full items-center justify-center rounded-full",s),e[3]=s,e[4]=o):o=e[4];let a;return e[5]!==t||e[6]!==o?(a=i.jsx(I,{"data-slot":"avatar-fallback",className:o,...t}),e[5]=t,e[6]=o,e[7]=a):a=e[7],a}const C=["drop-shadow-lg bg-gradient-to-br from-red-100 to-red-300 text-red-800 shadow-lg shadow-red-300/40 ring-1 ring-red-300/30","drop-shadow-lg bg-gradient-to-br from-lime-100 to-lime-300 text-lime-800 shadow-lg shadow-lime-300/40 ring-1 ring-lime-300/30","drop-shadow-lg bg-gradient-to-br from-emerald-100 to-emerald-300 text-emerald-800 shadow-lg shadow-emerald-300/40 ring-1 ring-emerald-300/30","drop-shadow-lg bg-gradient-to-br from-orange-100 to-orange-300 text-orange-800 shadow-lg shadow-orange-300/40 ring-1 ring-orange-300/30","drop-shadow-lg bg-gradient-to-br from-amber-100 to-amber-300 text-amber-800 shadow-lg shadow-amber-300/40 ring-1 ring-amber-300/30","drop-shadow-lg bg-gradient-to-br from-yellow-100 to-yellow-300 text-yellow-800 shadow-lg shadow-yellow-300/40 ring-1 ring-yellow-300/30","drop-shadow-lg bg-gradient-to-br from-green-100 to-green-300 text-green-800 shadow-lg shadow-green-300/40 ring-1 ring-green-300/30","drop-shadow-lg bg-gradient-to-br from-teal-100 to-teal-300 text-teal-800 shadow-lg shadow-teal-300/40 ring-1 ring-teal-300/30","drop-shadow-lg bg-gradient-to-br from-cyan-100 to-cyan-300 text-cyan-800 shadow-lg shadow-cyan-300/40 ring-1 ring-cyan-300/30","drop-shadow-lg bg-gradient-to-br from-sky-100 to-sky-300 text-sky-800 shadow-lg shadow-sky-300/40 ring-1 ring-sky-300/30","drop-shadow-lg bg-gradient-to-br from-blue-100 to-blue-300 text-blue-800 shadow-lg shadow-blue-300/40 ring-1 ring-blue-300/30","drop-shadow-lg bg-gradient-to-br from-indigo-100 to-indigo-300 text-indigo-800 shadow-lg shadow-indigo-300/40 ring-1 ring-indigo-300/30","drop-shadow-lg bg-gradient-to-br from-violet-100 to-violet-300 text-violet-800 shadow-lg shadow-violet-300/40 ring-1 ring-violet-300/30","drop-shadow-lg bg-gradient-to-br from-purple-100 to-purple-300 text-purple-800 shadow-lg shadow-purple-300/40 ring-1 ring-purple-300/30","drop-shadow-lg bg-gradient-to-br from-fuchsia-100 to-fuchsia-300 text-fuchsia-800 shadow-lg shadow-fuchsia-300/40 ring-1 ring-fuchsia-300/30","drop-shadow-lg bg-gradient-to-br from-pink-100 to-pink-300 text-pink-800 shadow-lg shadow-pink-300/40 ring-1 ring-pink-300/30","drop-shadow-lg bg-gradient-to-br from-rose-100 to-rose-300 text-rose-800 shadow-lg shadow-rose-300/40 ring-1 ring-rose-300/30"],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)%C.length;return C[s]}const S=R("border border-border",{variants:{shape:{circle:"rounded-full",square:""},size:{"3xs":"w-3 h-3 text-[7px] font-semibold","2xs":"w-4 h-4 text-[9px] font-semibold",xs:"w-6 h-6 text-sm font-semibold",sm:"w-8 h-8 text-lg font-semibold",base:"w-10 h-10 text-2xl font-semibold",lg:"w-12 h-12 text-3xl font-semibold",xl:"w-16 h-16 text-4xl font-semibold","2xl":"w-20 h-20 text-5xl font-semibold","3xl":"w-32 h-32 text-7xl font-semibold"}},compoundVariants:[{shape:"square",size:"xs",class:"rounded-lg"},{shape:"square",size:"sm",class:"rounded-xl"},{shape:"square",size:"base",class:"rounded-xl"},{shape:"square",size:"lg",class:"rounded-xl"},{shape:"square",size:"xl",class:"rounded-2xl"},{shape:"square",size:"2xl",class:"rounded-3xl"},{shape:"square",size:"3xl",class:"rounded-[40px]"}],defaultVariants:{shape:"square",size:"base"}}),_=R("",{variants:{objectFit:{contain:"object-contain",cover:"object-cover"}},defaultVariants:{objectFit:"cover"}}),D=r=>{const e={"3xs":8,"2xs":8,xs:12,sm:16,base:24,lg:28,xl:36,"2xl":48,"3xl":80};return e[r]||e.base};function H(r){const e=k.c(34);let s,t,o,a,n,d,g,l;e[0]!==r?({url:l,fallback:t,shape:a,size:n,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g;let x;e:{if(typeof t=="string"){let c;e[9]!==t?(c=t.trim().slice(0,2).toUpperCase(),e[9]=t,e[10]=c):c=e[10],x=c;break e}x=t}const f=x;let y;e:{if(j){y=T;break e}if(typeof t=="string"){let c;e[11]!==t?(c=L(t),e[11]=t,e[12]=c):c=e[12],y=c;break e}y=C[0]}const z=y;let N;e[13]!==l?(N=l?.startsWith("icon://"),e[13]=l,e[14]=N):N=e[14];const p=N;let q;e[15]!==p||e[16]!==l?(q=p?l?.replace("icon://",""):void 0,e[15]=p,e[16]=l,e[17]=q):q=e[17];const F=q;let w;e[18]!==s||e[19]!==b||e[20]!==h?(w=m(S({shape:b,size:h}),s),e[18]=s,e[19]=b,e[20]=h,e[21]=w):w=e[21];let v;e[22]!==z||e[23]!==f||e[24]!==F||e[25]!==p||e[26]!==u||e[27]!==h||e[28]!==l?(v=p&&F?i.jsx("div",{className:m("flex items-center justify-center w-full h-full",z),children:i.jsx($,{size:D(h)})}):i.jsxs(i.Fragment,{children:[l&&i.jsx(E,{src:l,loading:"lazy",alt:"Avatar",className:m(_({objectFit:u}))}),i.jsx(M,{className:m(z,"rounded-none"),delayMs:l?600:0,children:f})]}),e[22]=z,e[23]=f,e[24]=F,e[25]=p,e[26]=u,e[27]=h,e[28]=l,e[29]=v):v=e[29];let A;return e[30]!==o||e[31]!==v||e[32]!==w?(A=i.jsx(O,{className:w,...o,children:v}),e[30]=o,e[31]=v,e[32]=w,e[33]=A):A=e[33],A}function W(r){const e=k.c(18);let s,t,o,a,n,d,g,l;e[0]!==r?({shape:a,size:n,url:l,fallback:t,objectFit:d,className:s,muted:g,...o}=r,e[0]=r,e[1]=s,e[2]=t,e[3]=o,e[4]=a,e[5]=n,e[6]=d,e[7]=g,e[8]=l):(s=e[1],t=e[2],o=e[3],a=e[4],n=e[5],d=e[6],g=e[7],l=e[8]);const b=a===void 0?"square":a,h=n===void 0?"base":n,u=d===void 0?"cover":d,j=g===void 0?!1:g,x=h??"base";let f;return e[9]!==s||e[10]!==t||e[11]!==j||e[12]!==u||e[13]!==o||e[14]!==b||e[15]!==x||e[16]!==l?(f=i.jsx(H,{shape:b,url:l,fallback:t,size:x,objectFit:u,className:s,muted:j,...o}),e[9]=s,e[10]=t,e[11]=j,e[12]=u,e[13]=o,e[14]=b,e[15]=x,e[16]=l,e[17]=f):f=e[17],f}W.Skeleton=function({shape:e="square",size:s="base",className:t}){return i.jsx("div",{className:m(S({shape:e,size:s}),"bg-muted animate-pulse",t)})};export{W as A};
@@ -1 +1 @@
1
- import{c as l,l as u,j as g,cf as v,bH as b}from"./index-BAedCESS.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};
1
+ import{c as l,l as u,j as g,cf as v,bH as b}from"./index-BbDu2xq3.js";const f=b("inline-flex items-center justify-center rounded-full border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",success:"border-transparent bg-success text-success-foreground [a&]:hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40",warning:"border-transparent bg-warning text-warning-foreground [a&]:hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"},size:{default:"px-2 py-0.5",icon:"size-5"}},defaultVariants:{variant:"default",size:"default"}});function h(c){const e=l.c(14);let r,s,i,n,t;e[0]!==c?({className:r,variant:t,size:i,asChild:n,...s}=c,e[0]=c,e[1]=r,e[2]=s,e[3]=i,e[4]=n,e[5]=t):(r=e[1],s=e[2],i=e[3],n=e[4],t=e[5]);const d=(n===void 0?!1:n)?v:"span";let a;e[6]!==r||e[7]!==i||e[8]!==t?(a=u(f({variant:t,size:i}),r),e[6]=r,e[7]=i,e[8]=t,e[9]=a):a=e[9];let o;return e[10]!==d||e[11]!==s||e[12]!==a?(o=g.jsx(d,{"data-slot":"badge",className:a,...s}),e[10]=d,e[11]=s,e[12]=a,e[13]=o):o=e[13],o}export{h as B};