decocms 4.92.3 → 4.93.0

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 (274) hide show
  1. package/dist/client/assets/{AlertCircle-B9GlbKHh.js → AlertCircle-Njhn01cX.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DHN9bK0l.js → AreaChart-DRbAqxKW.js} +1 -1
  3. package/dist/client/assets/ArrowRight-esEXrLxn.js +1 -0
  4. package/dist/client/assets/{ArrowUp-DNZsq7Zt.js → ArrowUp-DxvzPWYP.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-DZZygrAi.js → ArrowUpRight-CxuPu6Tj.js} +1 -1
  6. package/dist/client/assets/Check-C8xezRP_.js +1 -0
  7. package/dist/client/assets/{CheckCircle-BEcdXH7-.js → CheckCircle-BQxAiBVq.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-BSRiDjXd.js → ChevronDown-DnZfSUpf.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-YmTewr_B.js → ChevronRight-DsMfUSaC.js} +1 -1
  10. package/dist/client/assets/ChevronUp-DGO207B8.js +1 -0
  11. package/dist/client/assets/{Copy01-BkGYkmm-.js → Copy01-BvTvgPMW.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BmTi7wpl.js → DotsVertical-Cpk8Ctc8.js} +1 -1
  13. package/dist/client/assets/{Eye-B-ZfWIGj.js → Eye-BsbSF6dM.js} +1 -1
  14. package/dist/client/assets/{FilterLines-BwWG7tAk.js → FilterLines-DBjnKQVG.js} +1 -1
  15. package/dist/client/assets/{Globe01-D3vBqhI7.js → Globe01-QTXFA3Hg.js} +1 -1
  16. package/dist/client/assets/{Globe04-pvxBukgJ.js → Globe04-Dpy9nX58.js} +1 -1
  17. package/dist/client/assets/{HardDrive-DutZPQFL.js → HardDrive-B9qgGqhY.js} +1 -1
  18. package/dist/client/assets/{Image01-PIeYnf-K.js → Image01-CMr6OOW9.js} +1 -1
  19. package/dist/client/assets/{Key01-DhLD806C.js → Key01-uLXewYdO.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-BI-sXAac.js → LayoutLeft-tArvHAmP.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-DO3QnLus.js → LinkExternal01-DXy81AX9.js} +1 -1
  22. package/dist/client/assets/{Monitor01-BOILvS2u.js → Monitor01-XHtWWQke.js} +1 -1
  23. package/dist/client/assets/{Package-DbEcG94t.js → Package-B0zWER5V.js} +1 -1
  24. package/dist/client/assets/{Palette-CyZvWKmI.js → Palette-00Ixb1J1.js} +1 -1
  25. package/dist/client/assets/{Play-B8fWmOst.js → Play-CzcsEB-0.js} +1 -1
  26. package/dist/client/assets/{Plus-2c1jULco.js → Plus-edG6Flwm.js} +1 -1
  27. package/dist/client/assets/{SearchLg-XmvudKlH.js → SearchLg-BZaz6095.js} +1 -1
  28. package/dist/client/assets/{SearchMd-lwIiBODG.js → SearchMd-CCfeLY5x.js} +1 -1
  29. package/dist/client/assets/{Settings02-DMpqOK24.js → Settings02-Bx_qgDLp.js} +1 -1
  30. package/dist/client/assets/{Shield01-gTFc9c17.js → Shield01-BiDz13pn.js} +1 -1
  31. package/dist/client/assets/{Star01-DoUbKevt.js → Star01-8Dyem59l.js} +1 -1
  32. package/dist/client/assets/{Stars01-CJsm_THn.js → Stars01-3-zqXKvS.js} +1 -1
  33. package/dist/client/assets/{Stars02-B08FvcHQ.js → Stars02-BQXVdDN3.js} +1 -1
  34. package/dist/client/assets/{Sun-nDXz4jeM.js → Sun-CB79h_pC.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-Rgis0XWf.js → SwitchHorizontal01-BvyA4hac.js} +1 -1
  36. package/dist/client/assets/{Tool01-BR3IBeV9.js → Tool01-B13YSnrO.js} +1 -1
  37. package/dist/client/assets/{Tool02-B0-a0UMl.js → Tool02-egoF7acO.js} +1 -1
  38. package/dist/client/assets/{Trash01-Ba6bCbNY.js → Trash01-DLyQDi2Y.js} +1 -1
  39. package/dist/client/assets/{TrendUp01-CeRF_789.js → TrendUp01-B_4HE6HC.js} +1 -1
  40. package/dist/client/assets/{Upload01-B14IruoN.js → Upload01-C-fdZkjY.js} +1 -1
  41. package/dist/client/assets/{User01-ByIE6k8L.js → User01-ndlF2LEv.js} +1 -1
  42. package/dist/client/assets/{Users01-BdldAr7H.js → Users01-BRUbM3mR.js} +1 -1
  43. package/dist/client/assets/{Users03-Bx4g7VTC.js → Users03-D_q12QHD.js} +1 -1
  44. package/dist/client/assets/{X-Dif5I5BD.js → X-BLwtZL0s.js} +1 -1
  45. package/dist/client/assets/XCircle-DHvjqByD.js +1 -0
  46. package/dist/client/assets/{XClose-DomD4542.js → XClose-CeJxo_5O.js} +1 -1
  47. package/dist/client/assets/{Zap-CEUVQQOc.js → Zap-Biv_hWgJ.js} +1 -1
  48. package/dist/client/assets/{ZapSquare-EvC2T9CP.js → ZapSquare-CUzmnXYD.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-BprgOfkE.js → ZoomOut-BtlatfMa.js} +1 -1
  50. package/dist/client/assets/{access-gate-NCJKEJqO.js → access-gate-DlRgf45B.js} +1 -1
  51. package/dist/client/assets/add-section-modal-Cnzkvby6.js +1 -0
  52. package/dist/client/assets/agent-icon-DpP8KzFU.js +1 -0
  53. package/dist/client/assets/agents-list-DvnAEWGc.js +1 -0
  54. package/dist/client/assets/ai-providers-CDx5RbfA.js +1 -0
  55. package/dist/client/assets/{alert-C_4AvGUo.js → alert-DiBfJ3z6.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-DDtUbhoS.js → alert-dialog-BnLog6BT.js} +2 -2
  57. package/dist/client/assets/app-editor-DTp5bYYF.js +1 -0
  58. package/dist/client/assets/{auth-CsHQFHV_.js → auth-CmoeLSjh.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-_TQy6GDd.js → auth-catchall-CyJqULXt.js} +1 -1
  60. package/dist/client/assets/{auth-entry-_ePf9_J1.js → auth-entry-oOVL70ba.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-D9UYTbxy.js → auth-split-layout-BCda3jzi.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-CEv4KtcH.js → authenticate-and-persist-oauth-CJ808iDy.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-CyDHI_uf.js → automation-list-row-BZr8L7Uh.js} +1 -1
  64. package/dist/client/assets/{automation-runs-D8v8nlly.js → automation-runs-DS0XzTMW.js} +5 -5
  65. package/dist/client/assets/automations-BrHkbwwm.js +1 -0
  66. package/dist/client/assets/{autosend-BgYoPuWD.js → autosend-CQ-47-85.js} +1 -1
  67. package/dist/client/assets/{avatar-BVdHZbMN.js → avatar-CGcwSkmr.js} +1 -1
  68. package/dist/client/assets/{badge-C_9mnuBd.js → badge-BUVU0rMR.js} +1 -1
  69. package/dist/client/assets/{block-document-CcMdXbqY.js → block-document-B2r_hLd8.js} +1 -1
  70. package/dist/client/assets/{brand-context-B-nZCoNx.js → brand-context-Bpk1Tuz_.js} +1 -1
  71. package/dist/client/assets/buckets-Ba5z9iiC.js +1 -0
  72. package/dist/client/assets/bulk-category-panel-i79BTudx.js +1 -0
  73. package/dist/client/assets/{calendar-Bxkf6gvE.js → calendar-COt9TyKT.js} +1 -1
  74. package/dist/client/assets/{capability-load-error-i6NCyxxk.js → capability-load-error-DOgFzcPM.js} +1 -1
  75. package/dist/client/assets/{card-C3gg1LtP.js → card-BoM9PVle.js} +1 -1
  76. package/dist/client/assets/category-editor-CZOD4Saa.js +1 -0
  77. package/dist/client/assets/{chat-context-DSveBxCg.js → chat-context-B5VF42iB.js} +7 -7
  78. package/dist/client/assets/checkbox-8MRm635N.js +1 -0
  79. package/dist/client/assets/{cli-auth-success-Cc2B25iW.js → cli-auth-success-CTl9Esai.js} +1 -1
  80. package/dist/client/assets/collection-detail-JnTCc17l.js +1 -0
  81. package/dist/client/assets/collection-display-button-DZt1zLnf.js +1 -0
  82. package/dist/client/assets/{collection-search-TcSAZpqK.js → collection-search-3CKEWWZt.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-H4bzUKoO.js → collection-table-wrapper-D20SVTuI.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-CIRa_M2W.js → collection-tabs-8kNejI0g.js} +1 -1
  85. package/dist/client/assets/{command-3z1R7bvy.js → command-BEYKuuWi.js} +1 -1
  86. package/dist/client/assets/commerce-onboarding-eKB7r6Ch.js +1 -0
  87. package/dist/client/assets/{companions-core-C68sN4Wc.js → companions-core-C3_LmblJ.js} +1 -1
  88. package/dist/client/assets/connect-DT6CnTMJ.js +8 -0
  89. package/dist/client/assets/connect-desktop-dialog-DwQ8Mjza.js +1 -0
  90. package/dist/client/assets/{connection-card-D_K36Swx.js → connection-card-WnbGcpbb.js} +1 -1
  91. package/dist/client/assets/connection-detail-Dd3EkXAN.js +1 -0
  92. package/dist/client/assets/{connection-form-helpers-DyOAEqE9.js → connection-form-helpers-BCcxv-0Z.js} +1 -1
  93. package/dist/client/assets/connections-CfhypjVY.js +1 -0
  94. package/dist/client/assets/{decopilot-sse-pool-CEQrv8Fn.js → decopilot-sse-pool-SXkhxj1m.js} +1 -1
  95. package/dist/client/assets/{dialog-DUqhzGiD.js → dialog-CV70WKsd.js} +1 -1
  96. package/dist/client/assets/{domain-settings-CRIqu0Bs.js → domain-settings-BwZkfjuf.js} +1 -1
  97. package/dist/client/assets/{drawer-DvhdIHph.js → drawer-DjOdYDA9.js} +1 -1
  98. package/dist/client/assets/dropdown-menu-mvaVV4Vk.js +1 -0
  99. package/dist/client/assets/{empty-state-BHuw6cM9.js → empty-state-DXghlCSF.js} +1 -1
  100. package/dist/client/assets/{extract-connection-data-_NDoBHMa.js → extract-connection-data-JVWAWvFf.js} +1 -1
  101. package/dist/client/assets/file-explorer-BHCYY9cJ.js +2 -0
  102. package/dist/client/assets/{file-type-icon-BOCZKON3.js → file-type-icon-CZv5YRkA.js} +1 -1
  103. package/dist/client/assets/{files-CelFf8dg.js → files-CxsC_UPe.js} +1 -1
  104. package/dist/client/assets/{form-C9InGmo4.js → form-DQ-7zIby.js} +1 -1
  105. package/dist/client/assets/general-CrovKb2x.js +1 -0
  106. package/dist/client/assets/{github-repo-picker-Biy9UFu8.js → github-repo-picker-BfsQbNwu.js} +1 -1
  107. package/dist/client/assets/{hooks-DU-2h9eZ.js → hooks-DQwk0XaJ.js} +1 -1
  108. package/dist/client/assets/{index-DnrPO2j2.js → index-4lUYXs_O.js} +1 -1
  109. package/dist/client/assets/{index-DivFugQC.js → index-9nw_Dv5I.js} +1 -1
  110. package/dist/client/assets/index-B7jBuFkn.css +1 -0
  111. package/dist/client/assets/{index-CbhDnqOu.js → index-BCiQIrz6.js} +1 -1
  112. package/dist/client/assets/index-C4jaN42X.js +2 -0
  113. package/dist/client/assets/{index-Du80fsxC.js → index-CF-xkULI.js} +5 -5
  114. package/dist/client/assets/{index-DBhNC4I_.js → index-COh-8QN3.js} +1 -1
  115. package/dist/client/assets/index-CSe3WpII.js +1 -0
  116. package/dist/client/assets/{index-BOgwoJjn.js → index-CdbTrQGO.js} +1 -1
  117. package/dist/client/assets/{index-CO3868Cu.js → index-Ckjl1Fry.js} +1 -1
  118. package/dist/client/assets/{index-Cs6hIS7C.js → index-Csozlno7.js} +3 -3
  119. package/dist/client/assets/index-DZseYmOn.js +1 -0
  120. package/dist/client/assets/{index-nNhZx5bw.js → index-G0zgTDdu.js} +14 -14
  121. package/dist/client/assets/{index-f6gbzJ8b.js → index-KNJ3OCd2.js} +1 -1
  122. package/dist/client/assets/{index-DmhdwAgP.js → index-cMDjfUVQ.js} +14 -14
  123. package/dist/client/assets/{index-redirect-hJFu02mm.js → index-redirect-D10_sM2p.js} +1 -1
  124. package/dist/client/assets/{input-TkvVVsQL.js → input-ChzvExXm.js} +1 -1
  125. package/dist/client/assets/{integration-icon-CWb3OXTV.js → integration-icon-Bhn0_xtP.js} +1 -1
  126. package/dist/client/assets/{invite-member-dialog-BA1mFY2X.js → invite-member-dialog-SQrGzC-z.js} +1 -1
  127. package/dist/client/assets/{label-CB2o7dZ2.js → label-CuJFo9yJ.js} +1 -1
  128. package/dist/client/assets/{layout-CqMMMVMm.js → layout-CwrVNWCG.js} +1 -1
  129. package/dist/client/assets/{login-B0EX352Z.js → login-C7gBuFYu.js} +1 -1
  130. package/dist/client/assets/{mcp-oauth-B5rKpHdd.js → mcp-oauth-BVO-f6t7.js} +1 -1
  131. package/dist/client/assets/members-Dlx5k3-8.js +1 -0
  132. package/dist/client/assets/{monaco-editor-DfuNvLfy.js → monaco-editor-CjU5L-zs.js} +1 -1
  133. package/dist/client/assets/{monitoring-stats-row-B43TP1bq.js → monitoring-stats-row-B9gtpPq-.js} +1 -1
  134. package/dist/client/assets/{multi-select-DhXl88EK.js → multi-select-De7VgXHU.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-BiKjtCpj.js → oauth-callback-ai-provider-UmcAlyJ2.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-CZ8I3e9V.js → oauth-callback-w52ryAZO.js} +1 -1
  137. package/dist/client/assets/{onboarding-U4YqP9I9.js → onboarding-BBWoRpXr.js} +1 -1
  138. package/dist/client/assets/{org-install-BYDat95r.js → org-install-ml9Q1TCX.js} +1 -1
  139. package/dist/client/assets/{org-layout-CVqWtNQa.js → org-layout-DmAo9qk4.js} +1 -1
  140. package/dist/client/assets/{organization-choice-CkG6QFWH.js → organization-choice-5F6o2RZD.js} +1 -1
  141. package/dist/client/assets/orgs-j7U5FSTV.js +1 -0
  142. package/dist/client/assets/{page-seo-form-8ToiuKnD.js → page-seo-form-CTnrck0_.js} +1 -1
  143. package/dist/client/assets/page-seo-sheet-fmIm-MrR.js +1 -0
  144. package/dist/client/assets/{popover-DwV6WXHS.js → popover-1mcOD1Dn.js} +1 -1
  145. package/dist/client/assets/post-editor-Dv_wlt7_.js +1 -0
  146. package/dist/client/assets/{primitives-RdkZFzQM.js → primitives-BaeBEsVv.js} +1 -1
  147. package/dist/client/assets/profile-CTuz7Go7.js +1 -0
  148. package/dist/client/assets/project-app-view-BtXFxvLq.js +1 -0
  149. package/dist/client/assets/record-editor-ZKO7gQiD.js +1 -0
  150. package/dist/client/assets/redirect-editor-qRjlDXct.js +1 -0
  151. package/dist/client/assets/registry-DtoSMqLy.js +2 -0
  152. package/dist/client/assets/{registry-layout-C2NoRJs0.js → registry-layout-WEtqp3AF.js} +3 -3
  153. package/dist/client/assets/{reports-J4B5GOoc.js → reports-CpbSj3oU.js} +2 -2
  154. package/dist/client/assets/{require-capability-DnfzULDW.js → require-capability-DF8ibYEg.js} +1 -1
  155. package/dist/client/assets/{required-auth-layout-ABsqitxw.js → required-auth-layout-rQ3tDKtk.js} +1 -1
  156. package/dist/client/assets/{reset-password-CbrThkFS.js → reset-password-D7FhrF53.js} +1 -1
  157. package/dist/client/assets/roles-BsYIEd1e.js +1 -0
  158. package/dist/client/assets/{search-input-B-RkAjzQ.js → search-input-75Re6Uqa.js} +1 -1
  159. package/dist/client/assets/secrets-B8bCoicB.js +1 -0
  160. package/dist/client/assets/{sections-editor-BW9cZUKJ.js → sections-editor-CM3ROkK7.js} +2 -2
  161. package/dist/client/assets/{select-model-BAk08l-M.js → select-model-CvnCrbwF.js} +1 -1
  162. package/dist/client/assets/select-sG3MQo05.js +1 -0
  163. package/dist/client/assets/self-tool-result-DR1KhJAE.js +1 -0
  164. package/dist/client/assets/seo-editor-Dz2QCY6k.js +1 -0
  165. package/dist/client/assets/settings-layout-rnH8GMkk.js +1 -0
  166. package/dist/client/assets/{settings-section-CNVe03BK.js → settings-section-DAwHE86q.js} +1 -1
  167. package/dist/client/assets/{shell-controls-5d4ZCRmi.js → shell-controls-Ck0Rc32A.js} +1 -1
  168. package/dist/client/assets/{shell-layout-6KUu0MA6.js → shell-layout-BXBrTj2H.js} +1 -1
  169. package/dist/client/assets/{sidebar-DnKMI8jz.js → sidebar-CCj6ri6x.js} +1 -1
  170. package/dist/client/assets/{skeleton-xDZ5Iwb8.js → skeleton-CoquA_ea.js} +1 -1
  171. package/dist/client/assets/sso-BOWh8JUl.js +1 -0
  172. package/dist/client/assets/store-registry-3_Y48Wu9.js +2 -0
  173. package/dist/client/assets/{store-BoCHTDSB.js → store-tszIV4qx.js} +1 -1
  174. package/dist/client/assets/{studio-tools-DIWsVaKg.js → studio-tools-Cet6XIhz.js} +1 -1
  175. package/dist/client/assets/{switch-DS9vYGS-.js → switch-DuPEp97y.js} +1 -1
  176. package/dist/client/assets/{table-DnoPpUup.js → table-LpLpROAI.js} +1 -1
  177. package/dist/client/assets/{tabs-2srR2H7A.js → tabs-CmiAgAjG.js} +1 -1
  178. package/dist/client/assets/{textarea-DjtAtA2l.js → textarea-CnNzHRRt.js} +1 -1
  179. package/dist/client/assets/{toggle-group-DGvoaiio.js → toggle-group-CKOvvRSl.js} +1 -1
  180. package/dist/client/assets/{toolbar-icon-button-Cr-N30KB.js → toolbar-icon-button-D8Ebc4H2.js} +1 -1
  181. package/dist/client/assets/{toolbar-CvkbyWaX.js → toolbar-uJC2H1eB.js} +1 -1
  182. package/dist/client/assets/{tooltip-cvFTpZ9W.js → tooltip-OGhXfeBg.js} +1 -1
  183. package/dist/client/assets/{use-ai-providers-ZLuBEaKb.js → use-ai-providers-BEU7q_EV.js} +1 -1
  184. package/dist/client/assets/use-api-keys-Bv4LYzyW.js +1 -0
  185. package/dist/client/assets/{use-automations-COcieFX-.js → use-automations-3WBbPXBU.js} +1 -1
  186. package/dist/client/assets/{use-autosave-C46oRXRb.js → use-autosave-GvQRDmC-.js} +1 -1
  187. package/dist/client/assets/{use-capability-3dRU8tE2.js → use-capability-RkVuWZII.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-BzcS25hV.js → use-clock-tick-CVs1XDyl.js} +1 -1
  189. package/dist/client/assets/{use-collections-DaXoNaLL.js → use-collections-DR_d-Teb.js} +1 -1
  190. package/dist/client/assets/{use-connection-DM1ROgj3.js → use-connection-CwuiKrFd.js} +1 -1
  191. package/dist/client/assets/{use-copy-DC217syR.js → use-copy-B6IC0gpM.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-Clu62lnk.js → use-create-virtual-mcp-sGGDSwNA.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-DYog9M6N.js → use-debounced-autosave-BwK3M221.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-CSp0_yRg.js → use-debounced-value-DLpyoptp.js} +1 -1
  195. package/dist/client/assets/use-deco-credits-q4i1Uz5r.js +1 -0
  196. package/dist/client/assets/{use-decopilot-events-CX_EuT5c.js → use-decopilot-events-BWABMe_S.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-CxGr7t4A.js → use-delete-connection-CzZLtWQx.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-C6-1CBki.js → use-deployment-admin-CMiQgY9e.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-DASxzk9O.js → use-file-configs-DzR4CKUR.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-XidGSyic.js → use-infinite-scroll-7EbHWl5i.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-CjypbTMc.js → use-join-requests-DGeGKSqv.js} +1 -1
  202. package/dist/client/assets/{use-mcp-auth-status-BpAt0IbR.js → use-mcp-auth-status-Dc0BBxuQ.js} +1 -1
  203. package/dist/client/assets/{use-mcp-client-DseZ3Mea.js → use-mcp-client-CX21NflZ.js} +4 -4
  204. package/dist/client/assets/{use-mcp-tools-DJGNLf9H.js → use-mcp-tools-BsmNzwNJ.js} +1 -1
  205. package/dist/client/assets/{use-members-CncY3QG2.js → use-members-Dg0Z4TCy.js} +1 -1
  206. package/dist/client/assets/{use-mobile-D8w2xyip.js → use-mobile-iuGXq52B.js} +1 -1
  207. package/dist/client/assets/{use-navigate-to-agent-YScxPu5L.js → use-navigate-to-agent-BGBWLfKe.js} +1 -1
  208. package/dist/client/assets/{use-org-auth-client-DjREcL_I.js → use-org-auth-client-BWQzTMi-.js} +1 -1
  209. package/dist/client/assets/{use-org-sso-diAgeADE.js → use-org-sso-C0w-Y45A.js} +1 -1
  210. package/dist/client/assets/{use-organization-roles-BuFi-QNO.js → use-organization-roles-3XOjGEsU.js} +1 -1
  211. package/dist/client/assets/{use-organization-settings-bBY4klS6.js → use-organization-settings-DVcDvmS7.js} +1 -1
  212. package/dist/client/assets/{use-registry-app-Cy7ipz7c.js → use-registry-app-9JpMfNFa.js} +1 -1
  213. package/dist/client/assets/{use-registry-connections-BZ0Z0jCg.js → use-registry-connections-hPmj3HSR.js} +1 -1
  214. package/dist/client/assets/{use-secrets-q_kPvC5B.js → use-secrets-BlieysxK.js} +1 -1
  215. package/dist/client/assets/{use-status-sounds-DG0Zyz9B.js → use-status-sounds-B7xlxGt9.js} +1 -1
  216. package/dist/client/assets/{use-t-BjZG1zRp.js → use-t-DpDrKRdg.js} +1 -1
  217. package/dist/client/assets/{use-view-mode-B02hzmMj.js → use-view-mode-DjI_33ML.js} +1 -1
  218. package/dist/client/assets/{use-virtual-mcp-urYy02xb.js → use-virtual-mcp-CMX7Masu.js} +1 -1
  219. package/dist/client/assets/useInfiniteQuery-BtjzjNju.js +1 -0
  220. package/dist/client/assets/{useRouterState-C7tRHRC7.js → useRouterState-BtVYUlaA.js} +1 -1
  221. package/dist/client/assets/useSuspenseInfiniteQuery-DzpLVyna.js +1 -0
  222. package/dist/client/assets/{users-CZVOiXsq.js → users-B-S76Gnf.js} +1 -1
  223. package/dist/client/assets/variant-calendar-C5Z-PHCg.js +1 -0
  224. package/dist/client/assets/{view-mode-toggle-DziN7a9n.js → view-mode-toggle-DT808FUj.js} +1 -1
  225. package/dist/client/index.html +2 -2
  226. package/dist/server/cli.js +488 -488
  227. package/dist/server/server.js +313 -313
  228. package/package.json +1 -1
  229. package/dist/client/assets/ChevronUp-D5F6V6Tm.js +0 -1
  230. package/dist/client/assets/XCircle-C0OdV3N_.js +0 -1
  231. package/dist/client/assets/add-section-modal-DBjaDtzc.js +0 -1
  232. package/dist/client/assets/agent-icon-DicjSkHu.js +0 -1
  233. package/dist/client/assets/agents-list-Bt1R4ueI.js +0 -1
  234. package/dist/client/assets/ai-providers-TK1CCOpK.js +0 -1
  235. package/dist/client/assets/app-editor-ptKJtHHM.js +0 -1
  236. package/dist/client/assets/automations-BoSNNWPc.js +0 -1
  237. package/dist/client/assets/buckets-DcRE1RUQ.js +0 -1
  238. package/dist/client/assets/bulk-category-panel-BkJQrEio.js +0 -1
  239. package/dist/client/assets/category-editor-CaGAyBNX.js +0 -1
  240. package/dist/client/assets/checkbox-Ba2-hx8r.js +0 -1
  241. package/dist/client/assets/collection-detail-D9ZCPDhA.js +0 -1
  242. package/dist/client/assets/collection-display-button-D_kIgil2.js +0 -1
  243. package/dist/client/assets/commerce-onboarding-DbQ0hYyA.js +0 -1
  244. package/dist/client/assets/connect-desktop-dialog-DEEL81vf.js +0 -1
  245. package/dist/client/assets/connection-detail-CKGrDl_p.js +0 -1
  246. package/dist/client/assets/connections-BJO0R_-8.js +0 -1
  247. package/dist/client/assets/dropdown-menu-D5BTIZvH.js +0 -1
  248. package/dist/client/assets/file-explorer-CUr9mfMv.js +0 -2
  249. package/dist/client/assets/general-DlHL1tW3.js +0 -1
  250. package/dist/client/assets/index-629FAmzK.js +0 -1
  251. package/dist/client/assets/index-BQK4XWOD.js +0 -2
  252. package/dist/client/assets/index-Cb_X1LK0.js +0 -1
  253. package/dist/client/assets/index-oE__K1ye.css +0 -1
  254. package/dist/client/assets/members-Ds_Onv02.js +0 -1
  255. package/dist/client/assets/orgs-B4DrO8iC.js +0 -1
  256. package/dist/client/assets/page-seo-sheet-BTyypxho.js +0 -1
  257. package/dist/client/assets/post-editor-j9JAXwQN.js +0 -1
  258. package/dist/client/assets/profile-DwVJzm_R.js +0 -1
  259. package/dist/client/assets/project-app-view-e40sJb24.js +0 -1
  260. package/dist/client/assets/record-editor-BBPLTix7.js +0 -1
  261. package/dist/client/assets/redirect-editor-C8EDxpmx.js +0 -1
  262. package/dist/client/assets/registry-CFSvMZwJ.js +0 -2
  263. package/dist/client/assets/roles-BqueMkJJ.js +0 -1
  264. package/dist/client/assets/secrets-CEZOniOS.js +0 -1
  265. package/dist/client/assets/select-AzuoAc3H.js +0 -1
  266. package/dist/client/assets/self-tool-result-C94YNykg.js +0 -1
  267. package/dist/client/assets/seo-editor-CR8P7sfk.js +0 -1
  268. package/dist/client/assets/settings-layout-9yQD_m0n.js +0 -1
  269. package/dist/client/assets/sso-DNsZ7Hie.js +0 -1
  270. package/dist/client/assets/store-registry-WZUtBjlh.js +0 -2
  271. package/dist/client/assets/use-deco-credits-Bm6Hzrca.js +0 -1
  272. package/dist/client/assets/useInfiniteQuery-nK_JPgM8.js +0 -1
  273. package/dist/client/assets/useSuspenseInfiniteQuery-_ObcRUnC.js +0 -1
  274. package/dist/client/assets/variant-calendar-DibyF3zD.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as A,bM as us,bN as Ll,j as b,at as jl,aM as ut,bO as Vl,c as ds,l as nt,bP as Fi}from"./index-DmhdwAgP.js";import{u as Wl}from"./use-t-BjZG1zRp.js";import{x as $l}from"./agent-icon-DicjSkHu.js";import{i as ql}from"./ChevronRight-YmTewr_B.js";function Hl(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function ib(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function ob(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function U(n){this.content=n}U.prototype={constructor:U,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new U(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new U(t)},addToStart:function(n,e){return new U([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new U(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new U(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=U.from(n),n.size?new U(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=U.from(n),n.size?new U(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=U.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};U.from=function(n){if(n instanceof U)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new U(e)};function fs(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=fs(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function hs(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){t-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let c=hs(s.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}class v{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new v(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new v(r,i)}cutByIndex(e,t){return e==t?v.empty:e==0&&t==this.content.length?this:new v(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new v(i,o)}addToStart(e){return new v([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new v(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return fs(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return hs(this,e,t,r)}findIndex(e){if(e==0)return mn(0,e);if(e==this.size)return mn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),o=r+i.nodeSize;if(o>=e)return o==e?mn(t+1,o):mn(t,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,t){if(!t)return v.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new v(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return v.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new v(t||e,r)}static from(e){if(!e)return v.empty;if(e instanceof v)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new v([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}v.empty=new v([],0);const ir={index:0,offset:0};function mn(n,e){return ir.index=n,ir.offset=e,ir}function Dn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Dn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Dn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let j=class Tr{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Dn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Tr.none;if(e instanceof Tr)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};j.none=[];class En extends Error{}class S{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ms(this.content,e+this.openStart,t);return r&&new S(r,this.openStart,this.openEnd)}removeBetween(e,t){return new S(ps(this.content,e+this.openStart,t+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,t){if(!t)return S.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new S(v.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new S(e,r,i)}}S.empty=new S(v.empty,0,0);function ps(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(ps(o.content,e-i-1,t-i-1)))}function ms(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=ms(s.content,e-o-1,t,s);return a&&n.replaceChild(i,s.copy(a))}function Jl(n,e,t){if(t.openStart>n.depth)throw new En("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new En("Inconsistent open depths");return gs(n,e,t,0)}function gs(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=gs(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,a=s.content;return at(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=Yl(t,n);return at(o,bs(n,s,a,e,r))}else return at(o,Tn(n,e,r))}function ys(n,e){if(!e.type.compatibleContent(n.type))throw new En("Cannot join "+e.type.name+" onto "+n.type.name)}function Or(n,e,t){let r=n.node(t);return ys(r,e.node(t)),r}function st(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Ht(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(st(n.nodeAfter,r),o++));for(let a=o;a<s;a++)st(i.child(a),r);e&&e.depth==t&&e.textOffset&&st(e.nodeBefore,r)}function at(n,e){return n.type.checkContent(e),n.copy(e)}function bs(n,e,t,r,i){let o=n.depth>i&&Or(n,e,i+1),s=r.depth>i&&Or(t,r,i+1),a=[];return Ht(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(ys(o,s),st(at(o,bs(n,e,t,r,i+1)),a)):(o&&st(at(o,Tn(n,e,i+1)),a),Ht(e,t,i,a),s&&st(at(s,Tn(t,r,i+1)),a)),Ht(r,null,i,a),new v(a)}function Tn(n,e,t){let r=[];if(Ht(null,n,t,r),n.depth>t){let i=Or(n,e,t+1);st(at(i,Tn(n,e,t+1)),r)}return Ht(e,null,t,r),new v(r)}function Yl(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(v.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Gt{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return j.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){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)&&(!t||t(this.node(r))))return new On(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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Gt(t,r,o)}static resolveCached(e,t){let r=zi.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else zi.set(e,r=new Ul);let i=r.elts[r.i]=Gt.resolve(e,t);return r.i=(r.i+1)%Kl,i}}class Ul{constructor(){this.elts=[],this.i=0}}const Kl=12,zi=new WeakMap;class On{constructor(e,t,r){this.$from=e,this.$to=t,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 Gl=Object.create(null);class be{constructor(e,t,r,i=j.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||v.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,t,r,i=0){this.content.nodesBetween(e,t,r,i,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,t,r,i){return this.content.textBetween(e,t,r,i)}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,t,r){return this.type==e&&Dn(this.attrs,t||e.defaultAttrs||Gl)&&j.sameSet(this.marks,r||j.none)}copy(e=null){return e==this.content?this:new be(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new be(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return S.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new S(c,i.depth-s,o.depth-s)}replace(e,t,r){return Jl(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Gt.resolveCached(this,e)}resolveNoCache(e){return Gt.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),xs(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=v.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=j.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!j.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t 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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=v.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}be.prototype.text=void 0;class An extends be{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xs(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new An(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new An(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function xs(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class dt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Xl(e,t);if(r.next==null)return dt.empty;let i=vs(r);r.next&&r.err("Unexpected trailing text");let o=ic(rc(i));return oc(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!t||l.validEnd))return v.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.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 t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[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 t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
1
+ import{r as A,bJ as us,bK as Ll,j as b,at as jl,aM as ut,bL as Vl,c as ds,l as nt,bM as Fi}from"./index-cMDjfUVQ.js";import{u as Wl}from"./use-t-DpDrKRdg.js";import{z as $l}from"./agent-icon-DpP8KzFU.js";import{i as ql}from"./ChevronRight-DsMfUSaC.js";function Hl(n){return n?n.replace(/[_-]/g," ").toLowerCase().split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):""}function ib(n,e){return n==="output-error"||n==="output-denied"?"error":n==="approval-requested"?"approval":n==="input-streaming"||n==="input-available"||n==="output-available"&&e===!0?"loading":"idle"}function ob(n){if(n==null||typeof n!="object")return;const e=n;if(e.structuredContent&&typeof e.structuredContent=="object")return e.structuredContent;if(Array.isArray(e.content)){const t=e.content[0];if(t?.type==="text"&&typeof t.text=="string")try{return JSON.parse(t.text)}catch{return}return}return n}function U(n){this.content=n}U.prototype={constructor:U,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new U(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new U(t)},addToStart:function(n,e){return new U([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new U(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new U(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=U.from(n),n.size?new U(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=U.from(n),n.size?new U(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=U.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};U.from=function(n){if(n instanceof U)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new U(e)};function fs(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=fs(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function hs(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){t-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let c=hs(s.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}class v{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new v(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new v(r,i)}cutByIndex(e,t){return e==t?v.empty:e==0&&t==this.content.length?this:new v(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new v(i,o)}addToStart(e){return new v([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new v(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return fs(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return hs(this,e,t,r)}findIndex(e){if(e==0)return mn(0,e);if(e==this.size)return mn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),o=r+i.nodeSize;if(o>=e)return o==e?mn(t+1,o):mn(t,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,t){if(!t)return v.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new v(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return v.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new v(t||e,r)}static from(e){if(!e)return v.empty;if(e instanceof v)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new v([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}v.empty=new v([],0);const ir={index:0,offset:0};function mn(n,e){return ir.index=n,ir.offset=e,ir}function Dn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Dn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Dn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let j=class Tr{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Dn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Tr.none;if(e instanceof Tr)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};j.none=[];class En extends Error{}class S{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ms(this.content,e+this.openStart,t);return r&&new S(r,this.openStart,this.openEnd)}removeBetween(e,t){return new S(ps(this.content,e+this.openStart,t+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,t){if(!t)return S.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new S(v.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new S(e,r,i)}}S.empty=new S(v.empty,0,0);function ps(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(ps(o.content,e-i-1,t-i-1)))}function ms(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=ms(s.content,e-o-1,t,s);return a&&n.replaceChild(i,s.copy(a))}function Jl(n,e,t){if(t.openStart>n.depth)throw new En("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new En("Inconsistent open depths");return gs(n,e,t,0)}function gs(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=gs(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,a=s.content;return at(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=Yl(t,n);return at(o,bs(n,s,a,e,r))}else return at(o,Tn(n,e,r))}function ys(n,e){if(!e.type.compatibleContent(n.type))throw new En("Cannot join "+e.type.name+" onto "+n.type.name)}function Or(n,e,t){let r=n.node(t);return ys(r,e.node(t)),r}function st(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Ht(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(st(n.nodeAfter,r),o++));for(let a=o;a<s;a++)st(i.child(a),r);e&&e.depth==t&&e.textOffset&&st(e.nodeBefore,r)}function at(n,e){return n.type.checkContent(e),n.copy(e)}function bs(n,e,t,r,i){let o=n.depth>i&&Or(n,e,i+1),s=r.depth>i&&Or(t,r,i+1),a=[];return Ht(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(ys(o,s),st(at(o,bs(n,e,t,r,i+1)),a)):(o&&st(at(o,Tn(n,e,i+1)),a),Ht(e,t,i,a),s&&st(at(s,Tn(t,r,i+1)),a)),Ht(r,null,i,a),new v(a)}function Tn(n,e,t){let r=[];if(Ht(null,n,t,r),n.depth>t){let i=Or(n,e,t+1);st(at(i,Tn(n,e,t+1)),r)}return Ht(e,null,t,r),new v(r)}function Yl(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(v.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Gt{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return j.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){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)&&(!t||t(this.node(r))))return new On(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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Gt(t,r,o)}static resolveCached(e,t){let r=zi.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else zi.set(e,r=new Ul);let i=r.elts[r.i]=Gt.resolve(e,t);return r.i=(r.i+1)%Kl,i}}class Ul{constructor(){this.elts=[],this.i=0}}const Kl=12,zi=new WeakMap;class On{constructor(e,t,r){this.$from=e,this.$to=t,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 Gl=Object.create(null);class be{constructor(e,t,r,i=j.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||v.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,t,r,i=0){this.content.nodesBetween(e,t,r,i,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,t,r,i){return this.content.textBetween(e,t,r,i)}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,t,r){return this.type==e&&Dn(this.attrs,t||e.defaultAttrs||Gl)&&j.sameSet(this.marks,r||j.none)}copy(e=null){return e==this.content?this:new be(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new be(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return S.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new S(c,i.depth-s,o.depth-s)}replace(e,t,r){return Jl(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Gt.resolveCached(this,e)}resolveNoCache(e){return Gt.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),xs(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=v.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=j.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!j.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t 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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=v.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}be.prototype.text=void 0;class An extends be{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xs(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new An(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new An(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function xs(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class dt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Xl(e,t);if(r.next==null)return dt.empty;let i=vs(r);r.next&&r.err("Unexpected trailing text");let o=ic(rc(i));return oc(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!t||l.validEnd))return v.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.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 t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[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 t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
2
2
  `)}}dt.empty=new dt(!0);class Xl{constructor(e,t){this.string=e,this.nodeTypes=t,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 vs(n){let e=[];do e.push(Ql(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Ql(n){let e=[];do e.push(Zl(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Zl(n){let e=nc(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=ec(n,e);else break;return e}function Li(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function ec(n,e){let t=Li(n),r=t;return n.eat(",")&&(n.next!="}"?r=Li(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function tc(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function nc(n){if(n.eat("(")){let e=vs(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=tc(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function rc(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=t())}else if(s.type=="star"){let l=t();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=t();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=t();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=t();r(l,u),i(o(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function ks(n,e){return e-n}function ji(n,e){let t=[];return r(e),t.sort(ks);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&t.indexOf(l)==-1&&r(l)}}}function ic(n){let e=Object.create(null);return t(ji(n,0));function t(r){let i=[];r.forEach(s=>{n[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);ji(n,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new dt(r.indexOf(n.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(ks);o.next.push({type:i[s][0],next:e[a.join(",")]||t(a)})}return o}}function oc(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ws(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Ss(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Ms(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let o=n[i];o.validate&&o.validate(e[i])}}function Cs(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ac(n,r,e[r]);return t}let Vi=class Ns{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Cs(e,r.attrs),this.defaultAttrs=ws(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==dt.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:Ss(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new be(this,this.computeAttrs(e),v.from(t),j.setFrom(r))}createChecked(e=null,t,r){return t=v.from(t),this.checkContent(t),new be(this,this.computeAttrs(e),t,j.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=v.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(v.empty,!0);return o?new be(this,e,t.append(o),j.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.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){Ms(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:j.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Ns(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");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 sc(n,e,t){let r=t.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}class ac{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?sc(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class $n{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Cs(e,i.attrs),this.excluded=null;let o=ws(this.attrs);this.instance=o?new j(this,o):null}create(e=null){return!e&&this.instance?this.instance:new j(this,Ss(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new $n(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ms(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Ds{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=U.from(e.nodes),t.marks=U.from(e.marks||{}),this.nodes=Vi.compile(this.spec.nodes,this),this.marks=$n.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=dt.parse(s,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?Wi(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Wi(this,s.split(" "))}this.nodeFromJSON=i=>be.fromJSON(this,i),this.markFromJSON=i=>j.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Vi){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(t,r,i)}text(e,t){let r=this.nodes.text;return new An(r,r.defaultAttrs,e,j.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Wi(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function lc(n){return n.tag!=null}function cc(n){return n.style!=null}class He{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(lc(i))this.tags.push(i);else if(cc(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new qi(this,t,!1);return r.addAll(e,j.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new qi(this,t,!0);return r.addAll(e,j.none,t.from,t.to),S.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(fc(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let a=t[s];if((a.priority==null?50:a.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Hi(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Hi(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new He(e,He.schemaRules(e)))}}const Es={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},uc={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ts={ol:!0,ul:!0},Xt=1,Ar=2,Jt=4;function $i(n,e,t){return e!=null?(e?Xt:0)|(e==="full"?Ar:0):n&&n.whitespace=="pre"?Xt|Ar:t&~Jt}class gn{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=j.none,this.match=o||(s&Jt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(v.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Xt)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=v.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(v.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Es.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qi{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,o,s=$i(null,t.preserveWhitespace,0)|(r?Jt:0);i?o=new gn(i.type,i.attrs,j.none,!0,t.topMatch||i.type.contentMatch,s):r?o=new gn(null,null,j.none,!0,null,s):o=new gn(e.schema.topNodeType,null,j.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=i.options&Ar?"full":this.localPreserveWS||(i.options&Xt)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(s.text(a[l]),t,!/\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=i.content[i.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(s.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Ts.hasOwnProperty(s)&&this.parser.normalizeLists&&dc(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:uc.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);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(Es.hasOwnProperty(s))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,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,t.attrs||null,r,t.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[t.mark];r=r.concat(l.create(t.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,o=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)t=this.enterInner(i[s],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let i=this.findPlace(e,t,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=j.none;for(let a of i.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):Ji(a.type,e.type))&&(s=a.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,t,r,i){let o=this.findPlace(e.create(t),r,!1);return o&&(o=this.enterInner(e,t,r,!0,i)),o}enterInner(e,t,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=$i(e,o,s.options);s.options&Jt&&s.content.length==0&&(a|=Jt);let l=j.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Ji(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new gn(e,t,l,i,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Xt)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?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 s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function dc(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ts.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function fc(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Hi(n){let e={};for(let t in n)e[t]=n[t];return e}function Ji(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=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&&s(u))return!0}};if(s(i.contentMatch))return!0}}class gt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=or(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.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;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,t);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Sn(or(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Sn(or(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return Sn(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new gt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Yi(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Yi(e.marks)}}function Yi(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function or(n){return n.document||window.document}const Ui=new WeakMap;function hc(n){let e=Ui.get(n);return e===void 0&&Ui.set(n,e=pc(n)),e}function pc(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function Sn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=hc(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 s=i.indexOf(" ");s>0&&(t=i.slice(0,s),i=i.slice(s+1));let a,l=t?n.createElementNS(t,i):n.createElement(i),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{let{dom:h,contentDOM:p}=Sn(n,f,t,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const Os=65535,As=Math.pow(2,16);function mc(n,e){return n+e*As}function Ki(n){return n&Os}function gc(n){return(n-(n&Os))/As}const Ps=1,Rs=2,Mn=4,Is=8;class Pr{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Is)>0}get deletedBefore(){return(this.delInfo&(Ps|Mn))>0}get deletedAfter(){return(this.delInfo&(Rs|Mn))>0}get deletedAcross(){return(this.delInfo&Mn)>0}}class ce{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ce.empty)return ce.empty}recover(e){let t=0,r=Ki(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+gc(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],u=this.ranges[a+s],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:t:t,h=l+i+(f<0?0:u);if(r)return h;let p=e==(t<0?l:d)?null:mc(a/3,e-l),g=e==l?Rs:e==d?Ps:Mn;return(t<0?e!=l:e!=d)&&(g|=Is),new Pr(h,g,p)}i+=u-c}return r?e+i:new Pr(e+i,0,null)}touches(e,t){let r=0,i=Ki(t),o=this.inverted?2:1,s=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==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+t],u=this.ranges[i+r];e(a,a+c,l,l+u),o+=u-c}}invert(){return new ce(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ce.empty:new ce(e<0?[0,-e,0]:[0,0,e])}}ce.empty=new ce([]);class Pn{constructor(e,t,r=0,i=e?e.length:0){this.mirror=t,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Pn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Pn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(e,t);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}}i|=a.delInfo,e=a.pos}return r?e:new Pr(e,i,null)}}const sr=Object.create(null);class ee{getMap(){return ce.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=sr[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in sr)throw new RangeError("Duplicate use of step JSON ID "+e);return sr[e]=t,t.prototype.jsonID=e,t}}class ${constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new $(e,null)}static fail(e){return new $(null,e)}static fromReplace(e,t,r,i){try{return $.ok(e.replace(t,r,i))}catch(o){if(o instanceof En)return $.fail(o.message);throw o}}}function Gr(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Gr(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return v.fromArray(r)}class We extends ee{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new S(Gr(t.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return $.fromReplace(e,this.from,this.to,o)}invert(){return new ge(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new We(t.pos,r.pos,this.mark)}merge(e){return e instanceof We&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new We(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new We(t.from,t.to,e.markFromJSON(t.mark))}}ee.jsonID("addMark",We);class ge extends ee{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new S(Gr(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return $.fromReplace(e,this.from,this.to,r)}invert(){return new We(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ge(t.pos,r.pos,this.mark)}merge(e){return e instanceof ge&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ge(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ge(t.from,t.to,e.markFromJSON(t.mark))}}ee.jsonID("removeMark",ge);class $e extends ee{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return $.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return $.fromReplace(e,this.pos,this.pos+1,new S(v.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new $e(this.pos,t.marks[i]);return new $e(this.pos,this.mark)}}return new ft(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $e(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new $e(t.pos,e.markFromJSON(t.mark))}}ee.jsonID("addNodeMark",$e);class ft extends ee{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return $.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return $.fromReplace(e,this.pos,this.pos+1,new S(v.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new $e(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ft(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ft(t.pos,e.markFromJSON(t.mark))}}ee.jsonID("removeNodeMark",ft);class W extends ee{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Rr(e,this.from,this.to)?$.fail("Structure replace would overwrite content"):$.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ce([this.from,this.to-this.from,this.slice.size])}invert(e){return new W(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&W.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new W(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof W)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?S.empty:new S(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new W(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?S.empty:new S(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new W(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new W(t.from,t.to,S.fromJSON(e,t.slice),!!t.structure)}}W.MAP_BIAS=1;ee.jsonID("replace",W);class J extends ee{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Rr(e,this.from,this.gapFrom)||Rr(e,this.gapTo,this.to)))return $.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return $.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?$.fromReplace(e,this.from,this.to,r):$.fail("Content does not fit in gap")}getMap(){return new ce([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new J(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new J(t.pos,r.pos,i,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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new J(t.from,t.to,t.gapFrom,t.gapTo,S.fromJSON(e,t.slice),t.insert,!!t.structure)}}ee.jsonID("replaceAround",J);function Rr(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function yc(n,e,t,r){let i=[],o=[],s,a;n.doc.nodesBetween(e,t,(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,t),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(s&&s.to==f&&s.mark.eq(d[g])?s.to=h:i.push(s=new ge(f,h,d[g])));a&&a.to==f?a.to=h:o.push(a=new We(f,h,r))}}),i.forEach(l=>n.step(l)),o.forEach(l=>n.step(l))}function bc(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof $n){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,t);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<i.length;h++){let p=i[h];p.step==o-1&&d.eq(i[h].style)&&(f=p)}f?(f.to=c,f.step=o):i.push({style:d,from:Math.max(a,e),to:c,step:o})}}}),i.forEach(s=>n.step(new ge(s.from,s.to,s.style)))}function Xr(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],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)s.push(new W(a,u,S.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new ge(a,u,c.marks[f]));if(i&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new S(v.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),s.push(new W(a+f.index,a+f.index+f[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(v.empty,!0);n.replace(a,a,new S(l,0,0))}for(let l=s.length-1;l>=0;l--)n.step(s[l])}function xc(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function _t(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,o=0;;--r){let s=n.$from.node(r),a=n.$from.index(r)+i,l=n.$to.indexAfter(r)-o;if(r<n.depth&&s.canReplace(a,l,t))return r;if(r==0||s.type.spec.isolating||!xc(s,a,l))break;a&&(i=1),l<s.childCount&&(o=1)}return null}function vc(n,e,t){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=v.empty,d=0;for(let p=o,g=!1;p>t;p--)g||r.index(p)>0?(g=!0,u=v.from(r.node(p).copy(u)),d++):l--;let f=v.empty,h=0;for(let p=o,g=!1;p>t;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=v.from(i.node(p).copy(f)),h++):c++;n.step(new J(l,c,s,a,new S(u.append(f),d,h),u.size-d,!0))}function Qr(n,e,t=null,r=n){let i=kc(n,e),o=i&&wc(r,e);return o?i.map(Gi).concat({type:e,attrs:t}).concat(o.map(Gi)):null}function Gi(n){return{type:n,attrs:null}}function kc(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return t.canReplaceWith(r,i,s)?o:null}function wc(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:s}function Sc(n,e,t){let r=v.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let a=t[s].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=v.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new J(i,o,i,o,new S(r,0,0),t.length,!0))}function Mc(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&Cc(n.doc,n.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Bs(n,s,a,o),Xr(n,n.mapping.slice(o).map(a,1),r,void 0,c===null);let u=n.mapping.slice(o),d=u.map(a,1),f=u.map(a+s.nodeSize,1);return n.step(new J(d,f,d+1,f-1,new S(v.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&_s(n,s,a,o),!1}})}function _s(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Bs(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{c as a,n as o,C as c,j as t,x as m,B as u,K as x}from"./index-DmhdwAgP.js";function f(){const e=a.c(5),l=o(),{locator:n}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(n)}),children:"Try again"})]}),e[2]=n,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
1
+ import{c as a,n as o,C as c,j as t,x as m,B as u,K as x}from"./index-cMDjfUVQ.js";function f(){const e=a.c(5),l=o(),{locator:n}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(n)}),children:"Try again"})]}),e[2]=n,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
@@ -1 +1 @@
1
- import{c as o,l as n,j as c}from"./index-DmhdwAgP.js";function i(a){const e=o.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function f(a){const e=o.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
1
+ import{c as o,l as n,j as c}from"./index-cMDjfUVQ.js";function i(a){const e=o.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl card-shadow",t),e[3]=t,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=c.jsx("div",{"data-slot":"card",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function f(a){const e=o.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=c.jsx("div",{"data-slot":"card-content",...t}),e[2]=t,e[3]=s):s=e[3],s}export{i as C,f as a};
@@ -0,0 +1 @@
1
+ import{c as J,r as S,l as Q,j as t,B as U,i as V,t as T}from"./index-cMDjfUVQ.js";import{i as X}from"./ArrowRight-esEXrLxn.js";import{c as I}from"./ZoomOut-BtlatfMa.js";import{n as Y}from"./LinkExternal01-DXy81AX9.js";import{aO as Z}from"./agent-icon-DpP8KzFU.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-BnLog6BT.js";import{I as L}from"./input-ChzvExXm.js";import{L as q}from"./label-CuJFo9yJ.js";import{w as at,v as mt,x as nt,$ as lt,o as pt,z as B,C as ct,a0 as dt,A as ut}from"./index-G0zgTDdu.js";import{c as gt,B as xt,a as ft}from"./block-document-B2r_hLd8.js";import{u as ht}from"./use-autosave-GvQRDmC-.js";import{t as jt}from"./ChevronDown-DnZfSUpf.js";import{p as yt,q as vt,o as bt}from"./automation-runs-DS0XzTMW.js";import{s as v,E as Ct}from"./primitives-BaeBEsVv.js";import"./AlertCircle-Njhn01cX.js";import"./Tool01-B13YSnrO.js";import"./ArrowUp-DxvzPWYP.js";import"./Settings02-Bx_qgDLp.js";import"./Tool02-egoF7acO.js";import"./ArrowUpRight-CxuPu6Tj.js";import"./TrendUp01-B_4HE6HC.js";import"./ZapSquare-CUzmnXYD.js";import"./Users03-D_q12QHD.js";import"./CheckCircle-BQxAiBVq.js";import"./Check-C8xezRP_.js";import"./ChevronRight-DsMfUSaC.js";import"./ChevronUp-DGO207B8.js";import"./DotsVertical-Cpk8Ctc8.js";import"./Stars02-BQXVdDN3.js";import"./Copy01-BvTvgPMW.js";import"./Globe01-QTXFA3Hg.js";import"./Eye-BsbSF6dM.js";import"./FilterLines-DBjnKQVG.js";import"./Star01-8Dyem59l.js";import"./Globe04-Dpy9nX58.js";import"./SwitchHorizontal01-BvyA4hac.js";import"./HardDrive-B9qgGqhY.js";import"./Image01-CMr6OOW9.js";import"./Key01-uLXewYdO.js";import"./LayoutLeft-tArvHAmP.js";import"./XCircle-DHvjqByD.js";import"./Monitor01-XHtWWQke.js";import"./Sun-CB79h_pC.js";import"./Package-B0zWER5V.js";import"./Palette-00Ixb1J1.js";import"./Play-CzcsEB-0.js";import"./Plus-edG6Flwm.js";import"./SearchLg-BZaz6095.js";import"./SearchMd-CCfeLY5x.js";import"./Shield01-BiDz13pn.js";import"./Stars01-3-zqXKvS.js";import"./Trash01-DLyQDi2Y.js";import"./Upload01-C-fdZkjY.js";import"./User01-ndlF2LEv.js";import"./Users01-BRUbM3mR.js";import"./XClose-CeJxo_5O.js";import"./X-BLwtZL0s.js";import"./Zap-Biv_hWgJ.js";import"./chat-context-B5VF42iB.js";import"./autosend-CQ-47-85.js";import"./hooks-DQwk0XaJ.js";import"./use-mcp-client-CX21NflZ.js";import"./auth-CmoeLSjh.js";import"./decopilot-sse-pool-SXkhxj1m.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Cet6XIhz.js";import"./use-virtual-mcp-CMX7Masu.js";import"./use-collections-DR_d-Teb.js";import"./use-ai-providers-BEU7q_EV.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-BWABMe_S.js";import"./use-organization-settings-DVcDvmS7.js";import"./tooltip-OGhXfeBg.js";import"./dialog-CV70WKsd.js";import"./drawer-DjOdYDA9.js";import"./collection-search-3CKEWWZt.js";import"./use-mobile-iuGXq52B.js";import"./AreaChart-DRbAqxKW.js";import"./index-KNJ3OCd2.js";import"./calendar-COt9TyKT.js";import"./use-t-DpDrKRdg.js";import"./shell-layout-BXBrTj2H.js";import"./avatar-CGcwSkmr.js";import"./required-auth-layout-rQ3tDKtk.js";import"./use-org-sso-C0w-Y45A.js";import"./index-C4jaN42X.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-9JpMfNFa.js";import"./use-mcp-tools-BsmNzwNJ.js";import"./use-connection-CwuiKrFd.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-CJ808iDy.js";import"./mcp-oauth-BVO-f6t7.js";import"./extract-connection-data-JVWAWvFf.js";import"./use-members-Dg0Z4TCy.js";import"./use-org-auth-client-BWQzTMi-.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dropdown-menu-mvaVV4Vk.js";import"./popover-1mcOD1Dn.js";import"./command-BEYKuuWi.js";import"./index-Ckjl1Fry.js";import"./use-copy-B6IC0gpM.js";import"./companions-core-C3_LmblJ.js";import"./form-DQ-7zIby.js";import"./select-sG3MQo05.js";import"./tabs-CmiAgAjG.js";import"./toggle-group-CKOvvRSl.js";import"./use-deco-credits-q4i1Uz5r.js";import"./connection-card-WnbGcpbb.js";import"./use-registry-connections-hPmj3HSR.js";import"./useInfiniteQuery-BtjzjNju.js";import"./use-infinite-scroll-7EbHWl5i.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-BoM9PVle.js";import"./integration-icon-Bhn0_xtP.js";import"./textarea-CnNzHRRt.js";import"./connection-form-helpers-BCcxv-0Z.js";import"./collection-tabs-8kNejI0g.js";import"./badge-BUVU0rMR.js";import"./useSuspenseInfiniteQuery-DzpLVyna.js";import"./connect-desktop-dialog-DwQ8Mjza.js";import"./select-model-CvnCrbwF.js";import"./checkbox-8MRm635N.js";import"./skeleton-CoquA_ea.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DAwHE86q.js";import"./index-CF-xkULI.js";import"./file-type-icon-CZv5YRkA.js";import"./toolbar-uJC2H1eB.js";import"./use-debounced-value-DLpyoptp.js";import"./index-4lUYXs_O.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-B7xlxGt9.js";import"./empty-state-DXghlCSF.js";import"./use-capability-RkVuWZII.js";import"./toolbar-icon-button-D8Ebc4H2.js";import"./use-debounced-autosave-BwK3M221.js";import"./index-COh-8QN3.js";import"./sidebar-CCj6ri6x.js";import"./search-input-75Re6Uqa.js";import"./use-mcp-auth-status-Dc0BBxuQ.js";import"./switch-DuPEp97y.js";import"./github-repo-picker-BfsQbNwu.js";import"./use-navigate-to-agent-BGBWLfKe.js";import"./reusable-new-chat-CouMjkYR.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-BlieysxK.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./monaco-editor-CjU5L-zs.js";import"./use-file-configs-DzR4CKUR.js";import"./use-automations-3WBbPXBU.js";import"./automation-list-row-BZr8L7Uh.js";import"./table-LpLpROAI.js";import"./use-clock-tick-CVs1XDyl.js";function Nt(b){const e=J.c(18),{icon:x,title:n,defaultOpen:C,children:d}=b,A=C===void 0?!1:C,[f,D]=S.useState(A);let l;e[0]!==x?(l=t.jsx(x,{size:15}),e[0]=x,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=f&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(jt,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(vt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==f||e[15]!==c||e[16]!==s?(u=t.jsxs(bt,{open:f,onOpenChange:D,className:"mt-4",children:[c,s]}),e[14]=f,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function br({orgSlug:b,virtualMcpId:e,branch:x,blockKey:n,block:C,decofile:d,meta:A,onManagePosts:f,onOpenPost:D,previewBaseUrl:l}){const i=at({orgSlug:b,virtualMcpId:e,branch:x,packagePath:mt(e)}),h=nt(C,"categories"),[r,p,c]=ht(h,o=>{i.mutate({blockKey:n,data:B(n,"categories",o)})}),s=(o,k)=>p({...r,[o]:k}),u=gt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[R,j]=S.useState(a),[m,N]=S.useState(null),[w,P]=S.useState(!1),$=a?lt(d).filter(o=>o.categorySlugs.includes(a)):[],y=$.length,H=o=>s("slug",o),M=async(o,k)=>{const G=v(r.name);P(!0);try{let g=0;for(const{key:E,payload:O}of ct(d,"posts")){const F=dt(O,o,{name:G,slug:k});F!==O&&(await i.mutateAsync({blockKey:E,data:B(E,"posts",ut(F))}),g+=1)}const z={...r,slug:k};await i.mutateAsync({blockKey:n,data:B(n,"categories",z)}),c(z),T.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),N(null)}catch(g){j(o),N(null),T.error(g instanceof Error?g.message:"Rename failed")}finally{P(!1)}},W=()=>{const o=R.trim();if(o===a){R!==o&&j(o);return}if(!o){j(a);return}if(y===0){H(o);return}N({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(pt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Y,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(Ct,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(q,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:R,onChange:o=>j(o.target.value),onBlur:W,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(q,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(Nt,{icon:Z,title:"Content",defaultOpen:!0,children:t.jsx(xt,{value:ft(r.sections),onChange:o=>s("sections",o),meta:A,sandboxRef:{orgSlug:b,virtualMcpId:e,branch:x},emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(I,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>f(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>D(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(I,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!m,onOpenChange:o=>{o||w||(j(a),N(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:w,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&M(m.oldSlug,m.newSlug)},disabled:w,children:w?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{br as CategoryEditor};
@@ -1,4 +1,4 @@
1
- import{c as oe,l as Xe,bB as Ze,j as K,C as Y,K as ue,m as Ye,cr as Je,R as Fe,u as Ee,n as qe,t as ae,G as le,D as de,b as je,e as et,r as x,p as tt,a as nt,U as st,ak as at}from"./index-DmhdwAgP.js";import{A as Ue,c as ot,a as rt,w as it}from"./autosend-BgYoPuWD.js";import{S as ct,b as lt,e as dt,u as ut}from"./hooks-DU-2h9eZ.js";import{u as pt}from"./studio-tools-DIWsVaKg.js";import{a as ft,u as ht,S as mt}from"./use-mcp-client-DseZ3Mea.js";import{a as gt}from"./use-virtual-mcp-urYy02xb.js";import{u as yt,a as ge}from"./use-ai-providers-ZLuBEaKb.js";import{o as xt,b as St}from"./location-BpLtHjTZ.js";import{d as bt,q as vt,n as It}from"./tab-id-BijBBRwE.js";import{u as kt}from"./use-decopilot-events-CX_EuT5c.js";import{e as Ct}from"./use-organization-settings-bBY4klS6.js";const Tt={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},Mt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},wt={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},Et={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},At={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},_t={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Qe(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function Rt(t){return Qe(t).includes("deepresearch")}const $t=["sonar","searchpreview","online"];function Ke(t){const e=Qe(t);return e.includes("deepresearch")?!1:$t.some(n=>e.includes(n))}function We(t){return t.asyncResearch!==!0&&Ke(t.modelId)}function Be(t){return t.asyncResearch===!0||Rt(t.modelId)||Ke(t.modelId)}function ie(t,e,n,s){for(const a of n){const o=t.find(r=>r.modelId===a);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}for(const a of n){const o=t.find(r=>r.modelId.includes(a));if(o)return{keyId:e,modelId:o.modelId,title:o.title}}if(s){const a=t.find(s);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}return null}function Pt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const a=e[s.id]??[],o=s.providerId;n.chat.fast||(n.chat.fast=ie(a,s.id,Tt[o]??[])),n.chat.smart||(n.chat.smart=ie(a,s.id,Mt[o]??[])),n.chat.thinking||(n.chat.thinking=ie(a,s.id,wt[o]??[])),n.image||(n.image=ie(a,s.id,Et[o]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=ie(a,s.id,At[o]??[],We)),n.deepResearch||(n.deepResearch=ie(a,s.id,_t[o]??[],Be))}return n}const Dt=Ze("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function Cn(t){const e=oe.c(10),{variant:n,size:s}=t;let a;e[0]!==s||e[1]!==n?(a=Xe(Dt({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=a):a=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=K.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=K.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let c;e[5]!==a?(c=K.jsxs("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=a,e[6]=c):c=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=K.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=p):p=e[7];let d;return e[8]!==c?(d=K.jsxs("div",{role:"status",children:[c,p]}),e[8]=c,e[9]=d):d=e[9],d}const Pe={online:!1,capabilities:[],ready:!1};function Ot(t){const e=oe.c(9),{org:n}=Y(),s=pt(),a=t?.fast??!1;let o;e[0]!==n.id?(o=ue.currentLink(n.id),e[0]=n.id,e[1]=o):o=e[1];let r;e[2]!==s?(r=async()=>{const b=await s.call("LINK_CURRENT_GET",{});return b?{...b,ready:!0}:{...Pe,ready:!0}},e[2]=s,e[3]=r):r=e[3];const c=a?1e3:1e4,p=a?2e3:15e3;let d;e[4]!==o||e[5]!==r||e[6]!==c||e[7]!==p?(d={queryKey:o,queryFn:r,staleTime:c,refetchInterval:p,refetchOnWindowFocus:!0},e[4]=o,e[5]=r,e[6]=c,e[7]=p,e[8]=d):d=e[8];const{data:g}=Ye(d);return g??Pe}function Lt(t,e=[]){return t==="stop"?e.filter(a=>a.type==="text"&&a.text).map(a=>a.text).join(`
1
+ import{c as oe,l as Xe,bx as Ze,j as K,C as Y,K as ue,m as Ye,cr as Je,R as Fe,u as Ee,n as qe,t as ae,G as le,D as de,b as je,e as et,r as x,p as tt,a as nt,U as st,ak as at}from"./index-cMDjfUVQ.js";import{A as Ue,c as ot,a as rt,w as it}from"./autosend-CQ-47-85.js";import{S as ct,b as lt,e as dt,u as ut}from"./hooks-DQwk0XaJ.js";import{u as pt}from"./studio-tools-Cet6XIhz.js";import{a as ft,u as ht,S as mt}from"./use-mcp-client-CX21NflZ.js";import{a as gt}from"./use-virtual-mcp-CMX7Masu.js";import{u as yt,a as ge}from"./use-ai-providers-BEU7q_EV.js";import{o as xt,b as St}from"./location-BpLtHjTZ.js";import{d as bt,q as vt,n as It}from"./tab-id-BijBBRwE.js";import{u as kt}from"./use-decopilot-events-BWABMe_S.js";import{e as Ct}from"./use-organization-settings-DVcDvmS7.js";const Tt={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},Mt={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},wt={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},Et={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},At={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},_t={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function Qe(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}function Rt(t){return Qe(t).includes("deepresearch")}const $t=["sonar","searchpreview","online"];function Ke(t){const e=Qe(t);return e.includes("deepresearch")?!1:$t.some(n=>e.includes(n))}function We(t){return t.asyncResearch!==!0&&Ke(t.modelId)}function Ve(t){return t.asyncResearch===!0||Rt(t.modelId)||Ke(t.modelId)}function ie(t,e,n,s){for(const a of n){const o=t.find(r=>r.modelId===a);if(o)return{keyId:e,modelId:o.modelId,title:o.title}}for(const a of n){const o=t.find(r=>r.modelId.includes(a));if(o)return{keyId:e,modelId:o.modelId,title:o.title}}if(s){const a=t.find(s);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}return null}function Pt(t,e){const n={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const s of t){const a=e[s.id]??[],o=s.providerId;n.chat.fast||(n.chat.fast=ie(a,s.id,Tt[o]??[])),n.chat.smart||(n.chat.smart=ie(a,s.id,Mt[o]??[])),n.chat.thinking||(n.chat.thinking=ie(a,s.id,wt[o]??[])),n.image||(n.image=ie(a,s.id,Et[o]??[],r=>r.capabilities?.includes("image")===!0)),n.webSearch||(n.webSearch=ie(a,s.id,At[o]??[],We)),n.deepResearch||(n.deepResearch=ie(a,s.id,_t[o]??[],Ve))}return n}const Dt=Ze("animate-spin",{variants:{variant:{default:"fill-primary text-gray-200",destructive:"fill-destructive text-gray-200",secondary:"fill-secondary text-gray-200",success:"fill-success text-gray-200",special:"fill-special text-background"},size:{default:"h-7 w-7",sm:"h-6 w-6",lg:"h-8 w-8",icon:"h-6 w-6",xs:"h-4 w-4"}},defaultVariants:{variant:"default",size:"default"}});function Cn(t){const e=oe.c(10),{variant:n,size:s}=t;let a;e[0]!==s||e[1]!==n?(a=Xe(Dt({variant:n,size:s})),e[0]=s,e[1]=n,e[2]=a):a=e[2];let o,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=K.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),r=K.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"}),e[3]=o,e[4]=r):(o=e[3],r=e[4]);let c;e[5]!==a?(c=K.jsxs("svg",{"aria-hidden":"true",className:a,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o,r]}),e[5]=a,e[6]=c):c=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=K.jsx("span",{className:"sr-only",children:"Loading..."}),e[7]=p):p=e[7];let d;return e[8]!==c?(d=K.jsxs("div",{role:"status",children:[c,p]}),e[8]=c,e[9]=d):d=e[9],d}const Pe={online:!1,capabilities:[],ready:!1};function Ot(t){const e=oe.c(9),{org:n}=Y(),s=pt(),a=t?.fast??!1;let o;e[0]!==n.id?(o=ue.currentLink(n.id),e[0]=n.id,e[1]=o):o=e[1];let r;e[2]!==s?(r=async()=>{const b=await s.call("LINK_CURRENT_GET",{});return b?{...b,ready:!0}:{...Pe,ready:!0}},e[2]=s,e[3]=r):r=e[3];const c=a?1e3:1e4,p=a?2e3:15e3;let d;e[4]!==o||e[5]!==r||e[6]!==c||e[7]!==p?(d={queryKey:o,queryFn:r,staleTime:c,refetchInterval:p,refetchOnWindowFocus:!0},e[4]=o,e[5]=r,e[6]=c,e[7]=p,e[8]=d):d=e[8];const{data:g}=Ye(d);return g??Pe}function Lt(t,e=[]){return t==="stop"?e.filter(a=>a.type==="text"&&a.text).map(a=>a.text).join(`
2
2
  `).replace(/https?:\/\/[^\s)>\]]+/g,"").includes("?")?"requires_action":"completed":t==="tool-calls"?e.some(s=>s.type==="tool-user_ask"&&s.state==="input-available"||s.state==="approval-requested")?"requires_action":"completed":"failed"}const ve={decopilot:{harness:"decopilot",sandbox:"agent-sandbox"},"claude-code-desktop":{harness:"claude-code",sandbox:"user-desktop"},"codex-desktop":{harness:"codex",sandbox:"user-desktop"}};function Nt(t,e){if(!t)return null;const n=e?Je(e):null;if(t==="decopilot"&&n===null)return"decopilot";for(const[s,a]of Object.entries(ve))if(a.harness===t&&a.sandbox===n)return s;return null}function Tn(t){return t.claudeCode?"claude-code-desktop":t.codex?"codex-desktop":null}function Ft(t,e){return e&&t&&ve[t].sandbox==="user-desktop"?"decopilot":t}function qt(t){return t.thread?.harness_id!=null?{}:{harnessId:t.globals.harnessId,sandboxProviderKind:t.globals.sandboxProviderKind,branch:t.globals.branch??null}}function jt(t){const e=oe.c(21);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},e[0]=n):n=e[0];const s=Fe(n);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Ee(a);let r;e[2]!==o.brand||e[3]!==o.main||e[4]!==o.preview||e[5]!==o.skill?(r=(typeof o.main=="string"?bt(o.main)?.path:void 0)??o.preview??o.skill??o.brand??null,e[2]=o.brand,e[3]=o.main,e[4]=o.preview,e[5]=o.skill,e[6]=r):r=e[6];const c=r;let p;if(e[7]!==s?.params.appSlug||e[8]!==s?.params.collectionName||e[9]!==s?.params.itemId||e[10]!==c||e[11]!==t){if(p=[],t&&p.push(`### Selected Agent
3
3
  - ID: ${t}`),c){let g;e[13]!==c?(g=xt(c),e[13]=c,e[14]=g):g=e[14];const b=g;let A;e[15]!==c?(A=St(c),e[15]=c,e[16]=A):A=e[16],p.push(`### Currently Open File
4
4
  The user has this file open in the Library and is most likely referring to it:
@@ -13,24 +13,24 @@ ${d.join(`
13
13
 
14
14
  Help the user understand and work with this resource.`),e[7]=s?.params.appSlug,e[8]=s?.params.collectionName,e[9]=s?.params.itemId,e[10]=c,e[11]=t,e[12]=p}else p=e[12];return p.join(`
15
15
 
16
- `)}function Ut(){const t=oe.c(5),e=qe(),{org:n}=Y();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const a=Fe(s);let o;return t[1]!==a?.params||t[2]!==n||t[3]!==e?(o=r=>{const p=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!p||!p[1])return;const d=p[1],g=a?.params.appSlug;if(!g)return;e.invalidateQueries({queryKey:ue.collection(n.slug,g,d)});const b=d.toLowerCase().replace(/_/g," ");ae.success(`${b} updated`)},t[1]=a?.params,t[2]=n,t[3]=e,t[4]=o):o=t[4],o}function Qt(){const t=oe.c(4),{org:e,project:n}=Y(),s=`${e.id}/${n.id}`;let a;t[0]!==s?(a=de.taskLastViewed(s),t[0]=s,t[1]=a):a=t[1];const[,o]=le(a,Kt);let r;return t[2]!==o?(r={markTaskRead:p=>{o(d=>({...d,[p]:new Date().toISOString()}))}},t[2]=o,t[3]=r):r=t[3],r}function Kt(t){return t??{}}function Ve(){const t=je(),{org:e}=Y(),n=Ee({strict:!1}),s=et({strict:!1}),a=n.virtualmcpid??ft(e.id).id,o=(p,d)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:p},search:g=>{const b={},A=d?.virtualMcpId??g.virtualmcpid;A&&(b.virtualmcpid=A);const m=g.main;return m&&typeof m=="string"&&!vt(m)&&(b.main=m),(g.sidepanel==="chat"||g.sidepanel===0)&&(b.sidepanel=g.sidepanel),d?.autosend&&(b.autosend=Ue),b}})},r=x.useRef(crypto.randomUUID()),c=s.taskId??r.current;return{virtualMcpId:a,taskId:c,navigateToTask:o}}function Wt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(s),o=>o.charCodeAt(0)));return[{type:"text",text:`${e}
16
+ `)}function Ut(){const t=oe.c(5),e=qe(),{org:n}=Y();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId",shouldThrow:!1},t[0]=s):s=t[0];const a=Fe(s);let o;return t[1]!==a?.params||t[2]!==n||t[3]!==e?(o=r=>{const p=r.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!p||!p[1])return;const d=p[1],g=a?.params.appSlug;if(!g)return;e.invalidateQueries({queryKey:ue.collection(n.slug,g,d)});const b=d.toLowerCase().replace(/_/g," ");ae.success(`${b} updated`)},t[1]=a?.params,t[2]=n,t[3]=e,t[4]=o):o=t[4],o}function Qt(){const t=oe.c(4),{org:e,project:n}=Y(),s=`${e.id}/${n.id}`;let a;t[0]!==s?(a=de.taskLastViewed(s),t[0]=s,t[1]=a):a=t[1];const[,o]=le(a,Kt);let r;return t[2]!==o?(r={markTaskRead:p=>{o(d=>({...d,[p]:new Date().toISOString()}))}},t[2]=o,t[3]=r):r=t[3],r}function Kt(t){return t??{}}function Be(){const t=je(),{org:e}=Y(),n=Ee({strict:!1}),s=et({strict:!1}),a=n.virtualmcpid??ft(e.id).id,o=(p,d)=>{t({to:"/$org/$taskId",params:{org:e.slug,taskId:p},search:g=>{const b={},A=d?.virtualMcpId??g.virtualmcpid;A&&(b.virtualmcpid=A);const m=g.main;return m&&typeof m=="string"&&!vt(m)&&(b.main=m),(g.sidepanel==="chat"||g.sidepanel===0)&&(b.sidepanel=g.sidepanel),d?.autosend&&(b.autosend=Ue),b}})},r=x.useRef(crypto.randomUUID()),c=s.taskId??r.current;return{virtualMcpId:a,taskId:c,navigateToTask:o}}function Wt(t,e){const{mimeType:n,data:s}=t;if(n.startsWith("text/"))try{const a=new TextDecoder().decode(Uint8Array.from(atob(s),o=>o.charCodeAt(0)));return[{type:"text",text:`${e}
17
17
  ${a}`}]}catch(a){console.error("Failed to decode text file:",a)}return[{type:"file",url:`data:${n};base64,${s}`,filename:e,mediaType:n}]}function De(t,e){const n=[];for(const s of t)"text"in s&&s.text?n.push({type:"text",text:`[${e}]
18
- ${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function Bt(t,e){const n=(t.files??[]).filter(r=>r.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const a=n.map(r=>`<skill-file path="${r.relPath}">
18
+ ${s.text}`}):"blob"in s&&s.blob&&s.mimeType&&n.push({type:"file",url:`data:${s.mimeType};base64,${s.blob}`,filename:String(s.uri),mediaType:String(s.mimeType)});return n}function Vt(t,e){const n=(t.files??[]).filter(r=>r.content?.trim()),s=t.omittedPaths??[];if(n.length===0&&s.length===0)return[];const a=n.map(r=>`<skill-file path="${r.relPath}">
19
19
  ${r.content.trim()}
20
20
  </skill-file>`).join(`
21
21
 
22
22
  `),o=s.length>0?`
23
23
 
24
24
  Other files in \`${t.sandboxPath}/\`: ${s.join(", ")}`:"";return[{type:"text",text:`[${e}]
25
- ${a}${o}`}]}function Vt(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const a=Array.isArray(s.content)?s.content:[s.content];for(const o of a)switch(o.type){case"text":{const r=o.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
25
+ ${a}${o}`}]}function Bt(t,e){const n=[];for(const s of t){if(s.role!=="user"||!s.content)continue;const a=Array.isArray(s.content)?s.content:[s.content];for(const o of a)switch(o.type){case"text":{const r=o.text?.trim();if(!r)continue;n.push({type:"text",text:`[${e}]
26
26
  ${r}`});break}case"image":case"audio":{if(!o.data||!o.mimeType)continue;n.push({type:"file",url:`data:${o.mimeType};base64,${o.data}`,mediaType:o.mimeType});break}case"resource":{const r=o.resource;if(!r||!r.mimeType)continue;r&&("text"in r&&r.text?n.push({type:"text",text:`[${e}]
27
27
  ${r.text}`}):"blob"in r&&r.blob&&r.mimeType&&n.push({type:"file",url:`data:${r.mimeType};base64,${r.blob}`,filename:String(r.uri),mediaType:String(r.mimeType)}));break}}}return n}function He(t){if(!t)return[];const e=[];let n="";const s=a=>{if(a){if(a.type==="text"&&"text"in a&&typeof a.text=="string")n+=a.text;else if(a.type==="mention"&&a.attrs){const o=a.attrs.char??"/",r=`${o}${a.attrs.name}`;if(a.attrs.kind==="task"){const c=a.attrs.metadata,d=[c?.title??a.attrs.name??"",c?.description?.trim()].filter(Boolean).join(`
28
28
 
29
29
  `);d&&e.push({type:"text",text:d});return}if(n+=r,o==="@"){const c=a.attrs.metadata;c&&!Array.isArray(c)&&"agentId"in c?e.push({type:"text",text:`[DELEGATE TO AGENT: ${c.title??a.attrs.name} (agent_id: ${c.agentId})]
30
- Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(c)&&e.push(...De(c,r))}else if(a.attrs.kind==="skill"){const c=a.attrs.metadata;c&&!Array.isArray(c)&&Array.isArray(c.files)&&e.push(...Bt(c,r))}else{const c=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(c)&&c.length>0&&"role"in c[0]?e.push(...Vt(c,r)):Array.isArray(c)&&e.push(...De(c,r))}}else if(a.type==="file"&&a.attrs){const o=a.attrs,r=`[file:://${encodeURIComponent(o.name)}]`;n+=r,e.push(...Wt(o,r))}if("content"in a&&Array.isArray(a.content))for(const o of a.content)s(o)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function Mn(t){const e=He(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function wn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Ht(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function En(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function Gt(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function zt(t,e){return t.filter(n=>n.messageId!==e)}const Oe=new Map,Ae=new Set;function Xt(t){Ae.add(t)}function Zt(t){return Ae.has(t)}function Yt(t){Ae.delete(t)}function ye(t){let e=Oe.get(t);return e||(e=new ct([]),Oe.set(t,e)),e}function Ge(t,e){ye(t).update(n=>Gt(n,e))}function we(t,e){ye(t).update(n=>zt(n,e))}function Jt(t,e){ye(t).set(e)}const Ie=new Map;function en(t,e){Ie.set(`${t}:${e.id}`,e)}function tn(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function Le(t,e){Ie.delete(`${t}:${e}`)}async function Z(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Jt(e,s.items??[])}catch{}}function An(t){const e=oe.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return x.useSyncExternalStore(s.subscribe,s.get,s.get)}function nn(){const{org:t}=Y();return{enqueue:Ge,refresh:e=>Z(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;we(e,n);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return ae.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await Z(t.slug,e)}}}}function ne(t,e,n,s){if(!t)return null;const a=e.find(r=>r.id===t.keyId);if(!a)return null;const o=n.find(r=>r.modelId===t.modelId);return o?{...o,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function sn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function an(t,e,n,s){if(!n||s.length===0)return null;const a=e.find(p=>p.id===n);if(!a)return null;const o=Pt([a],{[n]:s}),r=t==="fast"?o.chat.fast:t==="thinking"?o.chat.thinking:o.chat.smart;if(!r)return null;const c=s.find(p=>p.modelId===r.modelId);return c?{...c,keyId:n}:null}const Ne=new Set,se=new Set;function ce(t){return x.useSyncExternalStore(t.subscribe,t.get,t.get)}function on(t){return t.kind==="loading"?"ready":t.kind}const rn=1e4,cn=10,_e=x.createContext(null),Re=x.createContext(null),$e=x.createContext(null),ze=x.createContext(null);function ln({children:t}){const{locator:e}=Y(),{virtualMcpId:n}=Ve(),[s,a]=le(de.chatSelectedImageModel(e),null),[o,r]=le(de.chatSelectedWebSearchModel(e),null),[c,p]=le(de.chatSelectedDeepResearchModel(e),null),[d,g]=x.useState(null),[b,A]=x.useState("default"),m=Ct(),[D,W]=le(de.chatSimpleModeTier(e),null),N=sn(D),C=yt(),T=m.tiers[N],O=d&&C.some(i=>i.id===d)?d:T?.keyId??C[0]?.id??null,{models:v,isLoading:B}=ge(O??void 0),{models:G}=ge(T?.keyId),{models:J}=ge(m.tiers.image?.keyId),{models:w}=ge(m.tiers.web_search?.keyId),{models:V}=ge(m.tiers.deep_research?.keyId),z=ne(T,C,G,T?.title)??an(N,C,O,v),j=B,H=v.filter(i=>i.capabilities?.includes("image")),U=ne(s,C,H),f=ne(m.tiers.image,C,J,m.tiers.image?.title)??U??H[0]??null,R=v.filter(We),F=ne(o,C,R),ee=R.find(i=>i.modelId==="perplexity/sonar")??R[0]??null,Q=ne(m.tiers.web_search,C,w,m.tiers.web_search?.title)??F??ee,q=v.filter(Be),M=ne(c,C,q),I=q.find(i=>i.modelId==="perplexity/deep-research")??q.find(i=>i.asyncResearch===!0)??q[0]??null,X=ne(m.tiers.deep_research,C,V,m.tiers.deep_research?.title)??M??I,xe=gt(n)??{id:n,title:"",description:null,icon:null},[ke,fe]=x.useState({}),Se=(i,$)=>{const P=[];for(const _ of $.content??[])_.type==="text"&&_.text?.trim()&&P.push(_.text.trim());const k=P.join(`
31
- `);if(!k){he(i);return}new TextEncoder().encode(k).length>rn||fe(_=>Object.keys(_).length>=cn&&!(i in _)?_:{..._,[i]:k})},he=i=>{fe($=>{const{[i]:P,...k}=$;return k})},[re,Ce]=le(de.chatLastAgentOption(e),i=>i&&i in ve?i:null),te=pn(),Te=te?.isThreadLocked&&te.lockedHarness!=null?Nt(te.lockedHarness,te.lockedSandbox):null,Me=Ot(),be=Ft(re,Me.ready&&!Me.online),me=te?.isThreadLocked?Te:be,l=me?ve[me]:null,u=l?.harness??null,L=l?.sandbox??null,[E,h]=x.useState(void 0),S=x.useRef(E);S.current=E;const y={selectedModel:z,setModel:()=>{},credentialId:O,setCredentialId:g,allModelsConnections:C,isModelsLoading:j,selectedVirtualMcp:xe,imageModel:f,setImageModel:i=>{a(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:Q,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:X,setDeepResearchModel:i=>{p(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:b,setChatMode:A,appContexts:ke,setAppContext:Se,clearAppContext:he,tiptapDoc:E,setTiptapDoc:h,tiptapDocRef:S,resetInteraction:()=>{},simpleModeTier:N,setSimpleModeTier:i=>W(i),pendingAgentOption:me,setPendingAgentOption:Ce,pendingHarnessId:u,pendingSandboxProviderKind:L};return K.jsx($e.Provider,{value:y,children:t})}function _n(t){const e=oe.c(41),{virtualMcpId:n,task:s,children:a}=t,{locator:o}=Y(),{data:r}=nt.useSession(),c=r?.user??null,{taskId:p,virtualMcpId:d,navigateToTask:g}=Ve(),[b]=st(),{markTaskRead:A}=Qt(),m=ut(),D=p,W=d,N=jt(W);let C;e[0]!==A||e[1]!==g?(C=(M,I)=>{A(M),g(M,{virtualMcpId:I?.virtualMcpId,autosend:I?.autosend})},e[0]=A,e[1]=g,e[2]=C):C=e[2];const T=C,O=D&&s?.id===D?s:null,v=O?.harness_id??null,B=O?.sandbox_provider_kind??null,G=O?.branch??null,J=v!=null,w=G;let V;e[3]!==w||e[4]!==T||e[5]!==m||e[6]!==n?(V=()=>{const M=crypto.randomUUID();return m.create({id:M,virtual_mcp_id:n,...w?{branch:w}:{}}).then(()=>T(M)).catch(()=>{T(M)}),M},e[3]=w,e[4]=T,e[5]=m,e[6]=n,e[7]=V):V=e[7];const z=V;let j;e[8]!==w||e[9]!==o||e[10]!==T||e[11]!==m||e[12]!==n?(j=M=>{const I=crypto.randomUUID(),X=M.virtualMcpId??n,pe=X===n?w:null;it(sessionStorage,o,I,M.message),m.create({id:I,virtual_mcp_id:X,...pe?{branch:pe}:{}}).then(()=>T(I,{virtualMcpId:M.virtualMcpId,autosend:!0})).catch(()=>{T(I,{virtualMcpId:M.virtualMcpId,autosend:!0})})},e[8]=w,e[9]=o,e[10]=T,e[11]=m,e[12]=n,e[13]=j):j=e[13];const H=j;let U;e[14]!==D||e[15]!==m?(U=M=>{D&&m.setBranch(D,M)},e[14]=D,e[15]=m,e[16]=U):U=e[16];let f;e[17]!==O||e[18]!==z||e[19]!==H||e[20]!==w||e[21]!==D||e[22]!==W||e[23]!==J||e[24]!==G||e[25]!==v||e[26]!==B||e[27]!==T||e[28]!==U?(f={virtualMcpId:W,taskId:D,openTask:T,createTask:z,createTaskWithMessage:H,activeTask:O,isThreadLocked:J,lockedHarness:v,lockedSandbox:B,lockedBranch:G,currentBranch:w,setCurrentTaskBranch:U},e[17]=O,e[18]=z,e[19]=H,e[20]=w,e[21]=D,e[22]=W,e[23]=J,e[24]=G,e[25]=v,e[26]=B,e[27]=T,e[28]=U,e[29]=f):f=e[29];const R=f;let F;e[30]!==N||e[31]!==b||e[32]!==g||e[33]!==c?(F={user:c,contextPrompt:N,preferences:b,rawNavigateToTask:g},e[30]=N,e[31]=b,e[32]=g,e[33]=c,e[34]=F):F=e[34];const ee=F;let Q;e[35]!==a||e[36]!==ee?(Q=K.jsx(ln,{children:K.jsx(ze.Provider,{value:ee,children:a})}),e[35]=a,e[36]=ee,e[37]=Q):Q=e[37];let q;return e[38]!==Q||e[39]!==R?(q=K.jsx(Re.Provider,{value:R,children:Q}),e[38]=Q,e[39]=R,e[40]=q):q=e[40],q}function Rn({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:a}=dn();t&&!Ne.has(t)&&(Ne.add(t),tt("chat_opened",{thread_id:t}));const{imageModel:o,webSearchModel:r,deepResearchModel:c,chatMode:p,setChatMode:d,appContexts:g,setTiptapDoc:b,simpleModeTier:A,pendingSandboxProviderKind:m,pendingHarnessId:D}=un(),W=x.useContext(ze);if(!W)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:N,contextPrompt:C,preferences:T,rawNavigateToTask:O}=W,{org:v,locator:B}=Y(),G=nn(),[J,w]=x.useState(null),V=Ut(),z=qe(),j=lt(),H=je(),U=ht({connectionId:mt,orgId:v.id,orgSlug:v.slug}),f=dt(v.slug,t,{client:U});x.use(f.ready);const R=ce(f.messages),F=ce(f.status),ee=ce(f.finishReason),Q=ce(f.runStatusStage),q=ce(f.hasMoreOlder),M=ce(f.isFetchingOlder),I=x.useRef({onToolCall:V,queryClient:z,rawNavigateToTask:O,taskId:t,manager:j,navigate:H,orgId:v.id,orgSlug:v.slug});I.current={onToolCall:V,queryClient:z,rawNavigateToTask:O,taskId:t,manager:j,navigate:H,orgId:v.id,orgSlug:v.slug},kt({orgSlug:v.slug,taskId:t,onTaskStatus:l=>{const u=I.current,L=l.data.message_id;if(l.data.status==="in_progress"&&L){we(u.taskId,L);const E=tn(u.taskId,L);E&&f.applyLocalMessage(E),Z(u.orgSlug,u.taskId)}Zt(u.taskId)&&(async()=>(await Z(u.orgSlug,u.taskId),await f.reconcileFromServer()&&ye(u.taskId).get().length===0&&Yt(u.taskId)))()}}),x.useEffect(()=>{const l={onData:h=>{if(h.type==="data-thread-title"){const S=h.data;if(!S?.title)return;const y=I.current;if(!y.taskId)return;y.manager.patchThread({id:y.taskId,title:S.title,updated_at:new Date().toISOString()});return}if(h.type==="data-deck-updated"){const S=h.data;if(!S?.path)return;const y=S.path,i=I.current;i.queryClient.invalidateQueries({queryKey:ue.orgFsStat(i.orgId,"home",y)}),i.queryClient.invalidateQueries({queryKey:ue.orgFsRecent(i.orgId)}),i.navigate({to:".",search:$=>({...$,main:It(y)}),replace:!0});return}if(h.type==="data-open-preview"){const S=h.data,y=I.current,i=y.taskId;if(i){const $=y.manager.threads.get().find(P=>P.id===i);y.manager.patchThread({id:i,...S?.branch?{branch:S.branch}:{},...S?.sandboxProviderKind?{sandbox_provider_kind:S.sandboxProviderKind}:{},metadata:{...$?.metadata??{},...S?.githubRepo?{githubRepo:S.githubRepo}:{},...S?.sandboxMap?{sandboxMap:S.sandboxMap}:{}}})}y.navigate({to:".",search:$=>({...$,main:"preview"}),replace:!0});return}},onFinish:(h,S,y)=>{const i=I.current;i.taskId&&Z(i.orgSlug,i.taskId),i.taskId&&i.manager.patchThread({id:i.taskId,status:Lt(y,h.parts),updated_at:new Date().toISOString()});const $=h.parts?.some(k=>{const _=k;return(_.type==="tool-share_with_user"||_.type==="tool-bash"||_.type==="tool-write")&&_.state==="output-available"});if(i.taskId&&$){const k=ue.threadOutputs(i.taskId);for(const _ of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{i.queryClient.invalidateQueries({queryKey:k})},_)}i.queryClient.invalidateQueries({queryKey:ue.homeNextActions(i.orgSlug)});const P=h.metadata?.thread_id;P&&P!==i.taskId&&i.rawNavigateToTask(P)},onError:h=>{w(h),console.error("[chat] Error",h)},onToolCall:h=>I.current.onToolCall(h)};f.observer=l,Z(I.current.orgSlug,I.current.taskId);const u=h=>h==="submitted"||h==="streaming";let L=u(f.status.get().kind);const E=f.status.subscribe(()=>{const h=u(f.status.get().kind);if(h===L)return;L=h;const S=I.current;Z(S.orgSlug,S.taskId)});return()=>{f.observer===l&&(f.observer=null),E()}},[f]);const X=F.kind==="submitted"||F.kind==="streaming",pe=R.length===0,xe=R.at(-1),ke=!X&&xe?.role==="assistant"&&xe.parts.some(l=>"state"in l&&l.state==="approval-requested"),fe=s,Se=(fe?.status==="in_progress"||fe?.status==="expired")&&F.kind==="ready"&&R.length>0;async function he(l){const u=t,L=n,E=Object.entries(g),h=E.length>0?E.map(([P,k])=>`### App Context: ${P}
30
+ Use the subtask tool to delegate this task to the agent above. Include the full relevant context from this conversation in the prompt field — the subagent has no conversation history.`}):Array.isArray(c)&&e.push(...De(c,r))}else if(a.attrs.kind==="skill"){const c=a.attrs.metadata;c&&!Array.isArray(c)&&Array.isArray(c.files)&&e.push(...Vt(c,r))}else{const c=a.attrs.metadata||a.attrs.prompts||[];Array.isArray(c)&&c.length>0&&"role"in c[0]?e.push(...Bt(c,r)):Array.isArray(c)&&e.push(...De(c,r))}}else if(a.type==="file"&&a.attrs){const o=a.attrs,r=`[file:://${encodeURIComponent(o.name)}]`;n+=r,e.push(...Wt(o,r))}if("content"in a&&Array.isArray(a.content))for(const o of a.content)s(o)}};return s(t),n.trim()&&e.unshift({type:"text",text:n.trim()}),e}function Mn(t){const e=He(t);return e.length===0?[]:[{id:crypto.randomUUID(),role:"user",parts:e,metadata:{tiptapDoc:t}}]}function wn(t){return new Set(t.filter(e=>e.status==="queued").map(e=>e.messageId))}function Ht(t){return(t??[]).map(e=>e?.type==="text"&&typeof e.text=="string"?e.text:"").join("").trim()}function En(t){return t.filter(e=>e.status==="queued").sort((e,n)=>e.enqueuedAt-n.enqueuedAt)}function Gt(t,e){return t.some(n=>n.messageId===e.messageId)?t:[...t,e]}function zt(t,e){return t.filter(n=>n.messageId!==e)}const Oe=new Map,Ae=new Set;function Xt(t){Ae.add(t)}function Zt(t){return Ae.has(t)}function Yt(t){Ae.delete(t)}function ye(t){let e=Oe.get(t);return e||(e=new ct([]),Oe.set(t,e)),e}function Ge(t,e){ye(t).update(n=>Gt(n,e))}function we(t,e){ye(t).update(n=>zt(n,e))}function Jt(t,e){ye(t).set(e)}const Ie=new Map;function en(t,e){Ie.set(`${t}:${e.id}`,e)}function tn(t,e){const n=`${t}:${e}`,s=Ie.get(n);return Ie.delete(n),s}function Le(t,e){Ie.delete(`${t}:${e}`)}async function Z(t,e){try{const n=await fetch(`/api/${encodeURIComponent(t)}/decopilot/queue/${encodeURIComponent(e)}`,{credentials:"include"});if(!n.ok)return;const s=await n.json();Jt(e,s.items??[])}catch{}}function An(t){const e=oe.c(2);let n;e[0]!==t?(n=ye(t),e[0]=t,e[1]=n):n=e[1];const s=n;return x.useSyncExternalStore(s.subscribe,s.get,s.get)}function nn(){const{org:t}=Y();return{enqueue:Ge,refresh:e=>Z(t.slug,e),cancel:async(e,n)=>{const s=`thread-run:${e}:${n}`;we(e,n);try{const a=await fetch(`/api/${encodeURIComponent(t.slug)}/decopilot/queue/${encodeURIComponent(e)}/cancel/${encodeURIComponent(s)}`,{method:"POST",credentials:"include"});if(!a.ok&&a.status!==404)throw new Error(`Cancel failed: ${a.status}`);return!0}catch(a){return ae.error(a instanceof Error?a.message:"Failed to cancel"),!1}finally{await Z(t.slug,e)}}}}function ne(t,e,n,s){if(!t)return null;const a=e.find(r=>r.id===t.keyId);if(!a)return null;const o=n.find(r=>r.modelId===t.modelId);return o?{...o,keyId:t.keyId}:{modelId:t.modelId,title:s??t.modelId,keyId:t.keyId,providerId:a.providerId,description:null,logo:null,capabilities:[],limits:null,costs:null}}function sn(t){return t==="fast"||t==="smart"||t==="thinking"?t:"smart"}function an(t,e,n,s){if(!n||s.length===0)return null;const a=e.find(p=>p.id===n);if(!a)return null;const o=Pt([a],{[n]:s}),r=t==="fast"?o.chat.fast:t==="thinking"?o.chat.thinking:o.chat.smart;if(!r)return null;const c=s.find(p=>p.modelId===r.modelId);return c?{...c,keyId:n}:null}const Ne=new Set,se=new Set;function ce(t){return x.useSyncExternalStore(t.subscribe,t.get,t.get)}function on(t){return t.kind==="loading"?"ready":t.kind}const rn=1e4,cn=10,_e=x.createContext(null),Re=x.createContext(null),$e=x.createContext(null),ze=x.createContext(null);function ln({children:t}){const{locator:e}=Y(),{virtualMcpId:n}=Be(),[s,a]=le(de.chatSelectedImageModel(e),null),[o,r]=le(de.chatSelectedWebSearchModel(e),null),[c,p]=le(de.chatSelectedDeepResearchModel(e),null),[d,g]=x.useState(null),[b,A]=x.useState("default"),m=Ct(),[D,W]=le(de.chatSimpleModeTier(e),null),N=sn(D),C=yt(),T=m.tiers[N],O=d&&C.some(i=>i.id===d)?d:T?.keyId??C[0]?.id??null,{models:v,isLoading:V}=ge(O??void 0),{models:G}=ge(T?.keyId),{models:J}=ge(m.tiers.image?.keyId),{models:w}=ge(m.tiers.web_search?.keyId),{models:B}=ge(m.tiers.deep_research?.keyId),z=ne(T,C,G,T?.title)??an(N,C,O,v),j=V,H=v.filter(i=>i.capabilities?.includes("image")),U=ne(s,C,H),f=ne(m.tiers.image,C,J,m.tiers.image?.title)??U??H[0]??null,R=v.filter(We),F=ne(o,C,R),ee=R.find(i=>i.modelId==="perplexity/sonar")??R[0]??null,Q=ne(m.tiers.web_search,C,w,m.tiers.web_search?.title)??F??ee,q=v.filter(Ve),M=ne(c,C,q),I=q.find(i=>i.modelId==="perplexity/deep-research")??q.find(i=>i.asyncResearch===!0)??q[0]??null,X=ne(m.tiers.deep_research,C,B,m.tiers.deep_research?.title)??M??I,xe=gt(n)??{id:n,title:"",description:null,icon:null},[ke,fe]=x.useState({}),Se=(i,$)=>{const P=[];for(const _ of $.content??[])_.type==="text"&&_.text?.trim()&&P.push(_.text.trim());const k=P.join(`
31
+ `);if(!k){he(i);return}new TextEncoder().encode(k).length>rn||fe(_=>Object.keys(_).length>=cn&&!(i in _)?_:{..._,[i]:k})},he=i=>{fe($=>{const{[i]:P,...k}=$;return k})},[re,Ce]=le(de.chatLastAgentOption(e),i=>i&&i in ve?i:null),te=pn(),Te=te?.isThreadLocked&&te.lockedHarness!=null?Nt(te.lockedHarness,te.lockedSandbox):null,Me=Ot(),be=Ft(re,Me.ready&&!Me.online),me=te?.isThreadLocked?Te:be,l=me?ve[me]:null,u=l?.harness??null,L=l?.sandbox??null,[E,h]=x.useState(void 0),S=x.useRef(E);S.current=E;const y={selectedModel:z,setModel:()=>{},credentialId:O,setCredentialId:g,allModelsConnections:C,isModelsLoading:j,selectedVirtualMcp:xe,imageModel:f,setImageModel:i=>{a(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},webSearchModel:Q,setWebSearchModel:i=>{r(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},deepResearchModel:X,setDeepResearchModel:i=>{p(i?.keyId?{keyId:i.keyId,modelId:i.modelId}:null)},chatMode:b,setChatMode:A,appContexts:ke,setAppContext:Se,clearAppContext:he,tiptapDoc:E,setTiptapDoc:h,tiptapDocRef:S,resetInteraction:()=>{},simpleModeTier:N,setSimpleModeTier:i=>W(i),pendingAgentOption:me,setPendingAgentOption:Ce,pendingHarnessId:u,pendingSandboxProviderKind:L};return K.jsx($e.Provider,{value:y,children:t})}function _n(t){const e=oe.c(41),{virtualMcpId:n,task:s,children:a}=t,{locator:o}=Y(),{data:r}=nt.useSession(),c=r?.user??null,{taskId:p,virtualMcpId:d,navigateToTask:g}=Be(),[b]=st(),{markTaskRead:A}=Qt(),m=ut(),D=p,W=d,N=jt(W);let C;e[0]!==A||e[1]!==g?(C=(M,I)=>{A(M),g(M,{virtualMcpId:I?.virtualMcpId,autosend:I?.autosend})},e[0]=A,e[1]=g,e[2]=C):C=e[2];const T=C,O=D&&s?.id===D?s:null,v=O?.harness_id??null,V=O?.sandbox_provider_kind??null,G=O?.branch??null,J=v!=null,w=G;let B;e[3]!==w||e[4]!==T||e[5]!==m||e[6]!==n?(B=()=>{const M=crypto.randomUUID();return m.create({id:M,virtual_mcp_id:n,...w?{branch:w}:{}}).then(()=>T(M)).catch(()=>{T(M)}),M},e[3]=w,e[4]=T,e[5]=m,e[6]=n,e[7]=B):B=e[7];const z=B;let j;e[8]!==w||e[9]!==o||e[10]!==T||e[11]!==m||e[12]!==n?(j=M=>{const I=crypto.randomUUID(),X=M.virtualMcpId??n,pe=X===n?w:null;it(sessionStorage,o,I,M.message),m.create({id:I,virtual_mcp_id:X,...pe?{branch:pe}:{}}).then(()=>T(I,{virtualMcpId:M.virtualMcpId,autosend:!0})).catch(()=>{T(I,{virtualMcpId:M.virtualMcpId,autosend:!0})})},e[8]=w,e[9]=o,e[10]=T,e[11]=m,e[12]=n,e[13]=j):j=e[13];const H=j;let U;e[14]!==D||e[15]!==m?(U=M=>{D&&m.setBranch(D,M)},e[14]=D,e[15]=m,e[16]=U):U=e[16];let f;e[17]!==O||e[18]!==z||e[19]!==H||e[20]!==w||e[21]!==D||e[22]!==W||e[23]!==J||e[24]!==G||e[25]!==v||e[26]!==V||e[27]!==T||e[28]!==U?(f={virtualMcpId:W,taskId:D,openTask:T,createTask:z,createTaskWithMessage:H,activeTask:O,isThreadLocked:J,lockedHarness:v,lockedSandbox:V,lockedBranch:G,currentBranch:w,setCurrentTaskBranch:U},e[17]=O,e[18]=z,e[19]=H,e[20]=w,e[21]=D,e[22]=W,e[23]=J,e[24]=G,e[25]=v,e[26]=V,e[27]=T,e[28]=U,e[29]=f):f=e[29];const R=f;let F;e[30]!==N||e[31]!==b||e[32]!==g||e[33]!==c?(F={user:c,contextPrompt:N,preferences:b,rawNavigateToTask:g},e[30]=N,e[31]=b,e[32]=g,e[33]=c,e[34]=F):F=e[34];const ee=F;let Q;e[35]!==a||e[36]!==ee?(Q=K.jsx(ln,{children:K.jsx(ze.Provider,{value:ee,children:a})}),e[35]=a,e[36]=ee,e[37]=Q):Q=e[37];let q;return e[38]!==Q||e[39]!==R?(q=K.jsx(Re.Provider,{value:R,children:Q}),e[38]=Q,e[39]=R,e[40]=q):q=e[40],q}function Rn({taskId:t,children:e}){const{virtualMcpId:n,activeTask:s,currentBranch:a}=dn();t&&!Ne.has(t)&&(Ne.add(t),tt("chat_opened",{thread_id:t}));const{imageModel:o,webSearchModel:r,deepResearchModel:c,chatMode:p,setChatMode:d,appContexts:g,setTiptapDoc:b,simpleModeTier:A,pendingSandboxProviderKind:m,pendingHarnessId:D}=un(),W=x.useContext(ze);if(!W)throw new Error("ActiveTaskProvider must be used within ChatContextProvider");const{user:N,contextPrompt:C,preferences:T,rawNavigateToTask:O}=W,{org:v,locator:V}=Y(),G=nn(),[J,w]=x.useState(null),B=Ut(),z=qe(),j=lt(),H=je(),U=ht({connectionId:mt,orgId:v.id,orgSlug:v.slug}),f=dt(v.slug,t,{client:U});x.use(f.ready);const R=ce(f.messages),F=ce(f.status),ee=ce(f.finishReason),Q=ce(f.runStatusStage),q=ce(f.hasMoreOlder),M=ce(f.isFetchingOlder),I=x.useRef({onToolCall:B,queryClient:z,rawNavigateToTask:O,taskId:t,manager:j,navigate:H,orgId:v.id,orgSlug:v.slug});I.current={onToolCall:B,queryClient:z,rawNavigateToTask:O,taskId:t,manager:j,navigate:H,orgId:v.id,orgSlug:v.slug},kt({orgSlug:v.slug,taskId:t,onTaskStatus:l=>{const u=I.current,L=l.data.message_id;if(l.data.status==="in_progress"&&L){we(u.taskId,L);const E=tn(u.taskId,L);E&&f.applyLocalMessage(E),Z(u.orgSlug,u.taskId)}Zt(u.taskId)&&(async()=>(await Z(u.orgSlug,u.taskId),await f.reconcileFromServer()&&ye(u.taskId).get().length===0&&Yt(u.taskId)))()}}),x.useEffect(()=>{const l={onData:h=>{if(h.type==="data-thread-title"){const S=h.data;if(!S?.title)return;const y=I.current;if(!y.taskId)return;y.manager.patchThread({id:y.taskId,title:S.title,updated_at:new Date().toISOString()});return}if(h.type==="data-deck-updated"){const S=h.data;if(!S?.path)return;const y=S.path,i=I.current;i.queryClient.invalidateQueries({queryKey:ue.orgFsStat(i.orgId,"home",y)}),i.queryClient.invalidateQueries({queryKey:ue.orgFsRecent(i.orgId)}),i.navigate({to:".",search:$=>({...$,main:It(y)}),replace:!0});return}if(h.type==="data-open-preview"){const S=h.data,y=I.current,i=y.taskId;if(i){const $=y.manager.threads.get().find(P=>P.id===i);y.manager.patchThread({id:i,...S?.branch?{branch:S.branch}:{},...S?.sandboxProviderKind?{sandbox_provider_kind:S.sandboxProviderKind}:{},metadata:{...$?.metadata??{},...S?.githubRepo?{githubRepo:S.githubRepo}:{},...S?.sandboxMap?{sandboxMap:S.sandboxMap}:{}}})}y.navigate({to:".",search:$=>({...$,main:"preview"}),replace:!0});return}},onFinish:(h,S,y)=>{const i=I.current;i.taskId&&Z(i.orgSlug,i.taskId),i.taskId&&i.manager.patchThread({id:i.taskId,status:Lt(y,h.parts),updated_at:new Date().toISOString()});const $=h.parts?.some(k=>{const _=k;return(_.type==="tool-share_with_user"||_.type==="tool-bash"||_.type==="tool-write")&&_.state==="output-available"});if(i.taskId&&$){const k=ue.threadOutputs(i.taskId);for(const _ of[0,1500,3e3,6e3,12e3,25e3])setTimeout(()=>{i.queryClient.invalidateQueries({queryKey:k})},_)}i.queryClient.invalidateQueries({queryKey:ue.homeNextActions(i.orgSlug)});const P=h.metadata?.thread_id;P&&P!==i.taskId&&i.rawNavigateToTask(P)},onError:h=>{w(h),console.error("[chat] Error",h)},onToolCall:h=>I.current.onToolCall(h)};f.observer=l,Z(I.current.orgSlug,I.current.taskId);const u=h=>h==="submitted"||h==="streaming";let L=u(f.status.get().kind);const E=f.status.subscribe(()=>{const h=u(f.status.get().kind);if(h===L)return;L=h;const S=I.current;Z(S.orgSlug,S.taskId)});return()=>{f.observer===l&&(f.observer=null),E()}},[f]);const X=F.kind==="submitted"||F.kind==="streaming",pe=R.length===0,xe=R.at(-1),ke=!X&&xe?.role==="assistant"&&xe.parts.some(l=>"state"in l&&l.state==="approval-requested"),fe=s,Se=(fe?.status==="in_progress"||fe?.status==="expired")&&F.kind==="ready"&&R.length>0;async function he(l){const u=t,L=n,E=Object.entries(g),h=E.length>0?E.map(([P,k])=>`### App Context: ${P}
32
32
  ${k}`).join(`
33
33
 
34
34
  `):"",S=[C,h].filter(Boolean).join(`
35
35
 
36
- `);let y=p;y==="gen-image"&&!o&&(y="default"),y==="web-search"&&!r&&(y="default"),y==="deep-research"&&!c&&(y="default"),(y==="web-search"||y==="deep-research")&&d("default");const i=qt({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:D??void 0,sandboxProviderKind:m??void 0,branch:a}});s?.harness_id||j.patchThread({id:u,harness_id:i.harnessId??"decopilot",sandbox_provider_kind:i.sandboxProviderKind??null,updated_at:new Date().toISOString()});const $={tier:A,mode:y,toolApprovalLevel:T.toolApprovalLevel??at(),system:S||void 0,agent:{id:L},thread_id:u,...i};try{if(X||Se){let P=!0;try{en(u,l),await f.enqueue(l,$),Ge(u,{workflowId:`thread-run:${u}:${l.id}`,messageId:l.id,text:Ht(l.parts),hasAttachments:l.parts.some(k=>k.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Xt(u)}catch(k){P=!1,Le(u,l.id),we(u,l.id),w(k instanceof Error?k:new Error(String(k))),ae.error(k instanceof Error?k.message:"Failed to queue message")}return Z(v.slug,u),P}return await f.submit({kind:"message",message:l},$),!0}finally{se.delete(u)}}async function re(l){const u=l.parts??He(l.tiptapDoc);if(u.length===0||se.has(t))return;se.add(t),w(null),b(void 0);const L={tiptapDoc:l.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:N?.image??void 0,name:N?.name??"you"}},E={id:crypto.randomUUID(),role:"user",parts:u,metadata:L};await he(E)}async function Ce(l,u){if(se.has(t))return ae.info("Still sending your previous message — try again in a moment"),!1;if(se.add(t),!await G.cancel(t,l))return se.delete(t),ae.error("Couldn't remove the original message"),!1;Le(t,l),f.removeLocalMessage(l);const E={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:u}],metadata:{created_at:new Date().toISOString(),user:{avatar:N?.image??void 0,name:N?.name??"you"}}};try{return await he(E)}catch(h){return ae.error(h instanceof Error?h.message:"Failed to send edited message"),!1}}const te=async()=>{f.stop();try{const l=await fetch(`/api/${v.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(l.status===404)return;if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u.message??`Cancel failed: ${l.status}`)}}catch(l){const u=l instanceof Error?l.message:"Failed to cancel";ae.error(u),console.error("[chat] cancelRun",l)}},Te=l=>l&&typeof l=="object"&&"type"in l?re({tiptapDoc:l}):re(l),be=Ee({strict:!1}).autosend===Ue;x.useEffect(()=>{if(!be||R.length>0)return;const l=ot(sessionStorage,B,t);l&&re(l.message).then(()=>{rt(sessionStorage,B,t)})},[be,R.length,B,t,re]);const me={messages:R,status:on(F),sendMessage:Te,editQueuedMessage:Ce,stop:()=>{te()},submit:(l,u)=>f.submit(l,u),removeLocalMessage:l=>f.removeLocalMessage(l),isSendInFlight:()=>se.has(t),error:J,clearError:()=>w(null),finishReason:ee,runStatusStage:Q,clearFinishReason:()=>f.finishReason.set(null),isStreaming:X,isChatEmpty:pe,isWaitingForApprovals:ke??!1,isRunInProgress:Se,hasMoreOlder:q,isFetchingOlder:M,fetchOlderMessages:f.fetchOlderMessages.bind(f)};return K.jsx(_e.Provider,{value:me,children:e})}function $n(){const t=x.useContext(_e);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function Pn(){return x.useContext(_e)}function dn(){const t=x.useContext(Re);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function un(){const t=x.useContext($e);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function Dn(){return x.useContext($e)}function pn(){return x.useContext(Re)}export{Rn as A,ln as C,Cn as S,un as a,$n as b,pn as c,dn as d,An as e,nn as f,Le as g,Pn as h,_n as i,wn as j,He as k,Ve as l,Dn as m,We as n,Be as o,Tn as p,Pt as q,En as s,Mn as t,Ot as u};
36
+ `);let y=p;y==="gen-image"&&!o&&(y="default"),y==="web-search"&&!r&&(y="default"),y==="deep-research"&&!c&&(y="default"),(y==="web-search"||y==="deep-research")&&d("default");const i=qt({thread:s?{harness_id:s.harness_id??null,sandbox_provider_kind:s.sandbox_provider_kind??null,branch:s.branch??null}:null,globals:{harnessId:D??void 0,sandboxProviderKind:m??void 0,branch:a}});s?.harness_id||j.patchThread({id:u,harness_id:i.harnessId??"decopilot",sandbox_provider_kind:i.sandboxProviderKind??null,updated_at:new Date().toISOString()});const $={tier:A,mode:y,toolApprovalLevel:T.toolApprovalLevel??at(),system:S||void 0,agent:{id:L},thread_id:u,...i};try{if(X||Se){let P=!0;try{en(u,l),await f.enqueue(l,$),Ge(u,{workflowId:`thread-run:${u}:${l.id}`,messageId:l.id,text:Ht(l.parts),hasAttachments:l.parts.some(k=>k.type==="file"),status:"queued",enqueuedAt:Date.now(),optimistic:!0}),Xt(u)}catch(k){P=!1,Le(u,l.id),we(u,l.id),w(k instanceof Error?k:new Error(String(k))),ae.error(k instanceof Error?k.message:"Failed to queue message")}return Z(v.slug,u),P}return await f.submit({kind:"message",message:l},$),!0}finally{se.delete(u)}}async function re(l){const u=l.parts??He(l.tiptapDoc);if(u.length===0||se.has(t))return;se.add(t),w(null),b(void 0);const L={tiptapDoc:l.tiptapDoc,created_at:new Date().toISOString(),user:{avatar:N?.image??void 0,name:N?.name??"you"}},E={id:crypto.randomUUID(),role:"user",parts:u,metadata:L};await he(E)}async function Ce(l,u){if(se.has(t))return ae.info("Still sending your previous message — try again in a moment"),!1;if(se.add(t),!await G.cancel(t,l))return se.delete(t),ae.error("Couldn't remove the original message"),!1;Le(t,l),f.removeLocalMessage(l);const E={id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:u}],metadata:{created_at:new Date().toISOString(),user:{avatar:N?.image??void 0,name:N?.name??"you"}}};try{return await he(E)}catch(h){return ae.error(h instanceof Error?h.message:"Failed to send edited message"),!1}}const te=async()=>{f.stop();try{const l=await fetch(`/api/${v.slug}/decopilot/cancel/${t}`,{method:"POST",credentials:"include"});if(l.status===404)return;if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u.message??`Cancel failed: ${l.status}`)}}catch(l){const u=l instanceof Error?l.message:"Failed to cancel";ae.error(u),console.error("[chat] cancelRun",l)}},Te=l=>l&&typeof l=="object"&&"type"in l?re({tiptapDoc:l}):re(l),be=Ee({strict:!1}).autosend===Ue;x.useEffect(()=>{if(!be||R.length>0)return;const l=ot(sessionStorage,V,t);l&&re(l.message).then(()=>{rt(sessionStorage,V,t)})},[be,R.length,V,t,re]);const me={messages:R,status:on(F),sendMessage:Te,editQueuedMessage:Ce,stop:()=>{te()},submit:(l,u)=>f.submit(l,u),removeLocalMessage:l=>f.removeLocalMessage(l),isSendInFlight:()=>se.has(t),error:J,clearError:()=>w(null),finishReason:ee,runStatusStage:Q,clearFinishReason:()=>f.finishReason.set(null),isStreaming:X,isChatEmpty:pe,isWaitingForApprovals:ke??!1,isRunInProgress:Se,hasMoreOlder:q,isFetchingOlder:M,fetchOlderMessages:f.fetchOlderMessages.bind(f)};return K.jsx(_e.Provider,{value:me,children:e})}function $n(){const t=x.useContext(_e);if(!t)throw new Error("useChatStream must be used within ActiveTaskProvider");return t}function Pn(){return x.useContext(_e)}function dn(){const t=x.useContext(Re);if(!t)throw new Error("useChatTask must be used within ChatContextProvider");return t}function un(){const t=x.useContext($e);if(!t)throw new Error("useChatPrefs must be used within ChatContextProvider");return t}function Dn(){return x.useContext($e)}function pn(){return x.useContext(Re)}export{Rn as A,ln as C,Cn as S,un as a,$n as b,pn as c,dn as d,An as e,nn as f,Le as g,Pn as h,_n as i,wn as j,He as k,Be as l,Dn as m,We as n,Ve as o,Tn as p,Pt as q,En as s,Mn as t,Ot as u};
@@ -0,0 +1 @@
1
+ import{c as n,l as d,j as c,bz as l,bA as b}from"./index-cMDjfUVQ.js";import{i as m}from"./Check-C8xezRP_.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
@@ -1 +1 @@
1
- import{c as a,a as c,r as m,j as o}from"./index-DmhdwAgP.js";import{A as u}from"./auth-split-layout-D9UYTbxy.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
1
+ import{c as a,a as c,r as m,j as o}from"./index-cMDjfUVQ.js";import{A as u}from"./auth-split-layout-BCda3jzi.js";function p(){const e=a.c(8),i=c.useSession().data?.user?.email;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0],m.useEffect(f,l);let t;e[1]!==i?(t=i?o.jsxs(o.Fragment,{children:[" as ",i]}):"",e[1]=i,e[2]=t):t=e[2];let s;e[3]!==t?(s=o.jsxs("h1",{className:"text-3xl font-semibold tracking-tight",children:["You're logged in",t,"."]}),e[3]=t,e[4]=s):s=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx("p",{className:"text-muted-foreground",children:"You can return to your terminal."}),e[5]=n):n=e[5];let r;return e[6]!==s?(r=o.jsx(u,{children:o.jsxs("div",{className:"space-y-3",children:[s,n]})}),e[6]=s,e[7]=r):r=e[7],r}function f(){window.close()}export{p as default};
@@ -0,0 +1 @@
1
+ import{c as y,j as t,B as F,i as Z,H as Ge,I as se,E as Pe,r as T,C as le,M as Qe,l as V,b9 as Ye,u as Ze,L as G,t as Xe,e as ae,aZ as ke}from"./index-cMDjfUVQ.js";import{E as Ae}from"./empty-state-DXghlCSF.js";import{u as et,a as Ee}from"./use-collections-DR_d-Teb.js";import{u as ce}from"./use-mcp-client-CX21NflZ.js";import{F as ne,a as tt,b as de,d as me}from"./form-DQ-7zIby.js";import{I as ue}from"./input-ChzvExXm.js";import{T as re}from"./textarea-CnNzHRRt.js";import{a as st,b as nt,V as pe,O as ot,M as it}from"./index-BCiQIrz6.js";import{aA as rt,T as lt,ar as at,_ as ct,a9 as dt,aB as mt,a2 as be}from"./agent-icon-DpP8KzFU.js";import{g as ut,M as pt,a as Ne}from"./index-KNJ3OCd2.js";import{A as xt,a as ft,b as ht}from"./alert-DiBfJ3z6.js";import{S as ve,a as Se,b as ye,c as we,d as oe}from"./select-sG3MQo05.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-OGhXfeBg.js";import{i as jt}from"./AlertCircle-Njhn01cX.js";import{s as bt}from"./Stars02-BQXVdDN3.js";import{a as Nt}from"./Copy01-BvTvgPMW.js";import{i as vt}from"./Play-CzcsEB-0.js";import{i as St}from"./ChevronRight-DsMfUSaC.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./use-mcp-auth-status-Dc0BBxuQ.js";import{a as Oe,u as Re}from"./use-connection-CwuiKrFd.js";import{a as It}from"./use-mcp-tools-BsmNzwNJ.js";import{M as $t,c as Tt}from"./monaco-editor-CjU5L-zs.js";import{I as Te}from"./integration-icon-Bhn0_xtP.js";import{h as Pt,m as kt}from"./chat-context-B5VF42iB.js";import{u as At}from"./shell-layout-BXBrTj2H.js";import{n as Et}from"./Tool02-egoF7acO.js";import"./auth-CmoeLSjh.js";import"./label-CuJFo9yJ.js";import"./index-COh-8QN3.js";import"./sidebar-CCj6ri6x.js";import"./LayoutLeft-tArvHAmP.js";import"./use-mobile-iuGXq52B.js";import"./X-BLwtZL0s.js";import"./ZoomOut-BtlatfMa.js";import"./Key01-uLXewYdO.js";import"./extract-connection-data-JVWAWvFf.js";import"./use-registry-connections-hPmj3HSR.js";import"./use-organization-settings-DVcDvmS7.js";import"./studio-tools-Cet6XIhz.js";import"./Plus-edG6Flwm.js";import"./index-CSe3WpII.js";import"./index-Ckjl1Fry.js";import"./popover-1mcOD1Dn.js";import"./use-virtual-mcp-CMX7Masu.js";import"./Check-C8xezRP_.js";import"./SearchMd-CCfeLY5x.js";import"./Users03-D_q12QHD.js";import"./use-create-virtual-mcp-sGGDSwNA.js";import"./use-navigate-to-agent-BGBWLfKe.js";import"./hooks-DQwk0XaJ.js";import"./decopilot-sse-pool-SXkhxj1m.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-B13YSnrO.js";import"./ArrowUp-DxvzPWYP.js";import"./Settings02-Bx_qgDLp.js";import"./ArrowRight-esEXrLxn.js";import"./ArrowUpRight-CxuPu6Tj.js";import"./TrendUp01-B_4HE6HC.js";import"./ZapSquare-CUzmnXYD.js";import"./CheckCircle-BQxAiBVq.js";import"./ChevronDown-DnZfSUpf.js";import"./ChevronUp-DGO207B8.js";import"./DotsVertical-Cpk8Ctc8.js";import"./Globe01-QTXFA3Hg.js";import"./Eye-BsbSF6dM.js";import"./FilterLines-DBjnKQVG.js";import"./Star01-8Dyem59l.js";import"./Globe04-Dpy9nX58.js";import"./SwitchHorizontal01-BvyA4hac.js";import"./HardDrive-B9qgGqhY.js";import"./Image01-CMr6OOW9.js";import"./XCircle-DHvjqByD.js";import"./LinkExternal01-DXy81AX9.js";import"./Monitor01-XHtWWQke.js";import"./Sun-CB79h_pC.js";import"./Package-B0zWER5V.js";import"./Palette-00Ixb1J1.js";import"./SearchLg-BZaz6095.js";import"./Shield01-BiDz13pn.js";import"./Stars01-3-zqXKvS.js";import"./Trash01-DLyQDi2Y.js";import"./Upload01-C-fdZkjY.js";import"./User01-ndlF2LEv.js";import"./Users01-BRUbM3mR.js";import"./XClose-CeJxo_5O.js";import"./Zap-Biv_hWgJ.js";import"./badge-BUVU0rMR.js";import"./mcp-oauth-BVO-f6t7.js";import"./index-4lUYXs_O.js";import"./autosend-CQ-47-85.js";import"./use-ai-providers-BEU7q_EV.js";import"./location-BpLtHjTZ.js";import"./tab-id-BijBBRwE.js";import"./use-decopilot-events-BWABMe_S.js";import"./avatar-CGcwSkmr.js";import"./use-t-DpDrKRdg.js";import"./dialog-CV70WKsd.js";import"./required-auth-layout-rQ3tDKtk.js";import"./use-org-sso-C0w-Y45A.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:i,isSaving:r,saveLabel:a,undoLabel:c}=s,l=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!i)return null;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(rt,{size:14}),e[0]=p):p=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[p,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let x;e[5]!==r?(x=r?t.jsx(Z,{size:14,className:"animate-spin"}):t.jsx(lt,{size:14}),e[5]=r,e[6]=x):x=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==x?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":l,children:[x,l]}),e[7]=r,e[8]=o,e[9]=l,e[10]=x,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function ie(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let i;e[1]!==o.control?(i=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),e[1]=o.control,e[2]=i):i=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsx(tt,{...o,children:l}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:i}=le(),r=o||null;let a;e[0]!==i.id||e[1]!==i.slug||e[2]!==r?(a={connectionId:r,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),l=et(o,"PROMPT",n,c),u=Ee(o,"PROMPT",c),p=u.update.isPending;let m;e[4]!==l?(m=l?{title:l.title,description:l.description??null,body:ie(l)}:void 0,e[4]=l,e[5]=m):m=e[5];let x;e[6]!==m?(x={values:m},e[6]=m,e[7]=x):x=e[7];const f=Qe(x);let g;e[8]!==f||e[9]!==l?(g=()=>{l&&f.reset({title:l.title,description:l.description??null,body:ie(l)})},e[8]=f,e[9]=l,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const E=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:E.title,description:E.description??null,body:ie(E)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!l){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==l.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:l.title}),e[16]=l.title,e[17]=$):$=e[17];let A;e[18]!==l.description?(A=l.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:l.description})]}):null,e[18]=l.description,e[19]=A):A=e[19];let P;e[20]!==$||e[21]!==A?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,A]})}),e[20]=$,e[21]=A,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==p||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:p})}),e[25]=f.formState.isDirty,e[26]=p,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(pe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const i=n;if(!i){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:i,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,i;e[0]!==s?({asChild:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==i||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...i}),e[6]=r,e[7]=i,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let i;e[3]!==o?(i=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=i):i=e[4];let r;return e[5]!==n||e[6]!==i?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:i,...n}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,i;e[0]!==s?({children:o,className:n,...i}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=i):(o=e[1],n=e[2],i=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==i||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...i,children:a}),e[8]=i,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:i,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const l=wt(c);if(!l.isAuthenticated){let m;return e[2]!==l.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(it,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let p;return e[5]!==n||e[6]!==r||e[7]!==i||e[8]!==u||e[9]!==o?(p=t.jsx(Vt,{toolName:o,connectionId:n,siblings:i,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=i,e[8]=u,e[9]=o,e[10]=p):p=e[10],p}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:i}=Ze({strict:!1}),r=(()=>{if(!i)return null;const d=`replay-${i}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,l]=T.useState(a??{}),[u,p]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,x]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[A,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=le(),k=Oe(e),N=Pt(),E=kt(),{openSidePanel:U}=At(),z=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=Tt(d.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,X]=T.useState("json"),[ze,Le]=T.useState(!1);O&&!ze&&(X("ui"),Le(!0));const xe=j?.inputSchema?.properties,fe=xe?Object.keys(xe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),x(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);x(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{l(v=>({...v,[d]:h}))},Be=()=>{x(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(De,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-destructive",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-destructive text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>p(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:A?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(pt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>E?.setAppContext(z,d),onTeardown:()=>E?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx($t,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(pe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success animate-pulse shrink-0"}):L.isLoading?t.jsx(Z,{size:10,className:"animate-spin text-warning shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-destructive shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:i}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(x=>x.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const l=c;if(!Oe(l||void 0)||!l){let x;return e[3]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=x):x=e[3],x}let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=p):p=e[4];let m;return e[5]!==l||e[6]!==i||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:p,children:t.jsx(Ft,{toolName:o,connectionId:l,siblings:n,onSelectInstance:a,onBack:i})}),e[5]=l,e[6]=i,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:i,description:r,buttonProps:a,buttonComponent:c,className:l,children:u}=s;let p;e[0]!==l?(p=V("flex flex-col items-center justify-center py-16 text-center",l),e[0]=l,e[1]=p):p=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let x;e[5]!==i?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:i}),e[5]=i,e[6]=x):x=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==x||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[x,f]}),e[9]=x,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==p||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:p,children:[m,g,S,u]}),e[15]=u,e[16]=p,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const l=c,u=Wt;let p;return s[5]!==l||s[6]!==i||s[7]!==a?(p=t.jsx(Jt,{itemId:i,siblings:a,onBack:l,onUpdate:u}),s[5]=l,s[6]=i,s[7]=a,s[8]=p):p=s[8],p}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),i=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:l}=le();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,x=m?.id??"",f=x||"no-connection",g=x??null;let S;s[5]!==l.id||s[6]!==l.slug||s[7]!==g?(S={connectionId:g,orgId:l.id,orgSlug:l.slug},s[5]=l.id,s[6]=l.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ee(f,i,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const A=$;let P;s[12]!==i?(P=i?.toLowerCase(),s[12]=i,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==i?(C=Gt(i),s[14]=i,s[15]=C):C=s[15];const k=C;let N;s[16]!==l.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:l.slug},children:"Connections"})})}),s[16]=l.slug,s[17]=N):N=s[17];let E;s[18]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Y,{}),s[18]=E):E=s[18];let U;s[19]!==i||s[20]!==m||s[21]!==l.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:n.appSlug},search:{tab:i},children:m.title})})}),t.jsx(Y,{})]}),s[19]=i,s[20]=m,s[21]=l.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,E,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==A||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:A}),s[30]=w,s[31]=c,s[32]=A,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(pe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function Kn(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Z,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Kn as default};
@@ -0,0 +1 @@
1
+ import{c as B,j as s,l as M,B as V}from"./index-cMDjfUVQ.js";import{d as z,a as _,c as $,D as E}from"./dropdown-menu-mvaVV4Vk.js";import{i as L,n as O}from"./ArrowUp-DxvzPWYP.js";import{i as S}from"./Check-C8xezRP_.js";import{a as R,i as A,c as F}from"./SwitchHorizontal01-BvyA4hac.js";import{T as I,a as K,c as P,b as W}from"./tooltip-OGhXfeBg.js";import{V as q}from"./view-mode-toggle-DT808FUj.js";import{B as G}from"./badge-BUVU0rMR.js";function re(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{re as C};
@@ -1 +1 @@
1
- import{c as v,l as b,j as a,i as w}from"./index-DmhdwAgP.js";import{i as C}from"./SearchMd-lwIiBODG.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
1
+ import{c as v,l as b,j as a,i as w}from"./index-cMDjfUVQ.js";import{i as C}from"./SearchMd-CCfeLY5x.js";function S(j){const e=v.c(21),{value:d,onChange:m,placeholder:g,onKeyDown:x,className:u,isSearching:f,disabled:i}=j,p=g===void 0?"Search...":g;let t;e[0]!==u?(t=b("shrink-0 w-full border-b border-border h-12",u),e[0]=u,e[1]=t):t=e[1];const h=i?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let l;e[4]!==f?(l=f?a.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):a.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=f,e[5]=l):l=e[5];let r;e[6]!==m?(r=N=>m(N.target.value),e[6]=m,e[7]=r):r=e[7];let o;e[8]!==i||e[9]!==x||e[10]!==p||e[11]!==r||e[12]!==d?(o=a.jsx("input",{type:"text",value:d,onChange:r,onKeyDown:x,placeholder:p,disabled:i,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=i,e[9]=x,e[10]=p,e[11]=r,e[12]=d,e[13]=o):o=e[13];let n;e[14]!==s||e[15]!==l||e[16]!==o?(n=a.jsxs("label",{className:s,children:[l,o]}),e[14]=s,e[15]=l,e[16]=o,e[17]=n):n=e[17];let c;return e[18]!==t||e[19]!==n?(c=a.jsx("div",{className:t,children:n}),e[18]=t,e[19]=n,e[20]=c):c=e[20],c}export{S as C};
@@ -1 +1 @@
1
- import{c as k,j as s,l as C}from"./index-DmhdwAgP.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-DnoPpUup.js";import{i as D,n as E}from"./ArrowUp-DNZsq7Zt.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};
1
+ import{c as k,j as s,l as C}from"./index-cMDjfUVQ.js";import{e as S,d as R,a as T,T as H,b as L,c as z}from"./table-LpLpROAI.js";import{i as D,n as E}from"./ArrowUp-DxvzPWYP.js";function I(y){const e=k.c(29),{columns:r,data:f,sortKey:x,sortDirection:u,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==u?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&u&&(u==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=u,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==x){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==x?(o=(t,h)=>{const N=x===t.id;return s.jsx(S,{className:C(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=x,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=x,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(y){const e=k.c(12),{columns:r,data:f,isLoading:x,sortKey:u,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(x===void 0?!1:x){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==u?(d=s.jsx("div",{className:"flex-1",children:s.jsx(I,{columns:r,data:f,sortKey:u,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}export{B as C};