@xopcai/xopc 0.0.456 → 0.0.459

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 (312) hide show
  1. package/dist/browser-ext/dist/sidepanel.js +5 -1
  2. package/dist/browser-ext/manifest.json +1 -1
  3. package/dist/extensions/telegram/xopc.extension.json +1 -1
  4. package/dist/gateway/static/root/assets/{activity-store-DYwR1u3f.js → activity-store-CQHh48Zf.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CsRBprL-.js → agent-avatar-dicebear-CAz-Ke6Q.js} +1 -1
  6. package/dist/gateway/static/root/assets/{agent-avatar-display-DqFYHXCS.js → agent-avatar-display-loBdGw_i.js} +2 -2
  7. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DOAJrMLe.js → agent-defaults-settings-panel-By2Q-6JS.js} +1 -1
  8. package/dist/gateway/static/root/assets/{agent-plugin-dialog-vqlN3ORH.js → agent-plugin-dialog-CikzCYAG.js} +1 -1
  9. package/dist/gateway/static/root/assets/{agents-BgHlOVRV.js → agents-CGUdvmIT.js} +3 -3
  10. package/dist/gateway/static/root/assets/{agents-admin-api-CKscfdvA.js → agents-admin-api-D0N09mqJ.js} +1 -1
  11. package/dist/gateway/static/root/assets/{api-CHM2c_Ah.js → api-B1J5ajiP.js} +1 -1
  12. package/dist/gateway/static/root/assets/{api-DPNeNCmR.js → api-B4FJ51EC.js} +1 -1
  13. package/dist/gateway/static/root/assets/{app-management-settings-panel-Bhz6bj1C.js → app-management-settings-panel-BHlUDZOG.js} +1 -1
  14. package/dist/gateway/static/root/assets/{appearance-settings-BX32aogA.js → appearance-settings-Du5JLyV1.js} +1 -1
  15. package/dist/gateway/static/root/assets/{apps-page-0Yo3jBsQ.js → apps-page-M2XD1Pzu.js} +1 -1
  16. package/dist/gateway/static/root/assets/{archive-plugin-Bha8obMe.js → archive-plugin-BAvglLfu.js} +1 -1
  17. package/dist/gateway/static/root/assets/{automation-api-mn8ihWJ_.js → automation-api-DxBmyzp0.js} +1 -1
  18. package/dist/gateway/static/root/assets/automation-display-DaVDNZz8.js +2 -0
  19. package/dist/gateway/static/root/assets/{automation-result-state-COzakzak.js → automation-result-state-CAsqgMNR.js} +1 -1
  20. package/dist/gateway/static/root/assets/{automation-run-list-BhtaMpTb.js → automation-run-list-BmYeWB_N.js} +1 -1
  21. package/dist/gateway/static/root/assets/automation-task-card-CiJmJ7_h.js +2 -0
  22. package/dist/gateway/static/root/assets/{automations-page-CgQDpSpK.js → automations-page-CVjgENMO.js} +1 -1
  23. package/dist/gateway/static/root/assets/automations-workspace-CGPWyL0P.js +9 -0
  24. package/dist/gateway/static/root/assets/{binary-plugins-DUbrJFLU.js → binary-plugins-D2bFqG6K.js} +1 -1
  25. package/dist/gateway/static/root/assets/{block-editor-DW--pXAc.js → block-editor-CmnkluMF.js} +1 -1
  26. package/dist/gateway/static/root/assets/{browser-settings-page-CDh6nxs9.js → browser-settings-page-CGcgZOWh.js} +1 -1
  27. package/dist/gateway/static/root/assets/capabilities-DB713nRi.js +1 -0
  28. package/dist/gateway/static/root/assets/{capabilities-DKbXv8Ck.js → capabilities-DDqDvCBs.js} +1 -1
  29. package/dist/gateway/static/root/assets/capabilities-page-D2hq4cgE.js +2 -0
  30. package/dist/gateway/static/root/assets/{capabilities-settings-panel-BW5jQz5R.js → capabilities-settings-panel-CvF8VRTv.js} +1 -1
  31. package/dist/gateway/static/root/assets/{channels-BzZp42yO.js → channels-BDVQ6Z7A.js} +1 -1
  32. package/dist/gateway/static/root/assets/{chat-agents-api-UOdNWZ0_.js → chat-agents-api-CjlzCSmC.js} +1 -1
  33. package/dist/gateway/static/root/assets/{chat-chart-block-NSy-B0NS.js → chat-chart-block-stPJEZ90.js} +1 -1
  34. package/dist/gateway/static/root/assets/chat-page-BhPw56Vc.js +71 -0
  35. package/dist/gateway/static/root/assets/{chat-terminal-dock-CAaHWS7F.js → chat-terminal-dock-B4uA_W6R.js} +1 -1
  36. package/dist/gateway/static/root/assets/{command-palette-api-Dkn9bbYd.js → command-palette-api-CP0F6sIm.js} +1 -1
  37. package/dist/gateway/static/root/assets/{composer-model-config-control-BrK8-SNz.js → composer-model-config-control-DAagrRx_.js} +1 -1
  38. package/dist/gateway/static/root/assets/{composer-notifications-B-kL3qAA.js → composer-notifications-CqV6Xj-H.js} +1 -1
  39. package/dist/gateway/static/root/assets/composer-payload-handoff-Dc43dgSg.js +1 -0
  40. package/dist/gateway/static/root/assets/{computer-settings-page-C9KdEecx.js → computer-settings-page-f-vcEpeF.js} +1 -1
  41. package/dist/gateway/static/root/assets/{connected-providers-grid-D_8v6Qex.js → connected-providers-grid-CZ-FXxaW.js} +1 -1
  42. package/dist/gateway/static/root/assets/{connection-usage-guide-CiVpcbds.js → connection-usage-guide-Cibh2lrV.js} +1 -1
  43. package/dist/gateway/static/root/assets/{connector-service-page-B919cKSm.js → connector-service-page-Btz68iy8.js} +1 -1
  44. package/dist/gateway/static/root/assets/{connectors-api-CgsSm-Av.js → connectors-api-CTuVWwBf.js} +1 -1
  45. package/dist/gateway/static/root/assets/connectors-page-DyzDVVfz.js +1 -0
  46. package/dist/gateway/static/root/assets/{date-picker-dx284jQI.js → date-picker-XnE3iFhG.js} +1 -1
  47. package/dist/gateway/static/root/assets/{date-time-picker-Dj-bhLNP.js → date-time-picker-VGKm0HVn.js} +1 -1
  48. package/dist/gateway/static/root/assets/{desktop-pet-Cn1TfGz4.js → desktop-pet-CBm3DySQ.js} +1 -1
  49. package/dist/gateway/static/root/assets/{desktop-pet-settings-CsmrvoxU.js → desktop-pet-settings-6O77QXGo.js} +1 -1
  50. package/dist/gateway/static/root/assets/{dev-view-store-BOxbj1ie.js → dev-view-store-B8fGILny.js} +1 -1
  51. package/dist/gateway/static/root/assets/{device-pairing-wizard-CAqFIFRC.js → device-pairing-wizard-qtUvtdDT.js} +1 -1
  52. package/dist/gateway/static/root/assets/{directory-picker-path-field-BxEw5OrT.js → directory-picker-path-field-ByDqf5fE.js} +1 -1
  53. package/dist/gateway/static/root/assets/{discussion-annotation-sync-CyntTwIa.js → discussion-annotation-sync-fwPPMPv9.js} +1 -1
  54. package/dist/gateway/static/root/assets/{extension-authoritative-grants-C0ReZguU.js → extension-authoritative-grants-BfL8dMBf.js} +1 -1
  55. package/dist/gateway/static/root/assets/{extension-debug-page-Cd3HMUbi.js → extension-debug-page-BPwRrP3L.js} +1 -1
  56. package/dist/gateway/static/root/assets/{extension-iframe-host-DiIqM2JO.js → extension-iframe-host-DIH4TcdH.js} +1 -1
  57. package/dist/gateway/static/root/assets/{extension-marketplace-api-CK5CMKTs.js → extension-marketplace-api-BIzkukYp.js} +1 -1
  58. package/dist/gateway/static/root/assets/{extension-message-router-Dn8JzOdR.js → extension-message-router-C9JDpo_7.js} +1 -1
  59. package/dist/gateway/static/root/assets/{extension-page-CLZtAtqm.js → extension-page-CLDoL5N8.js} +1 -1
  60. package/dist/gateway/static/root/assets/{extension-provider-CbVokTvd.js → extension-provider-BPIoHw4r.js} +1 -1
  61. package/dist/gateway/static/root/assets/{extension-settings-page-BM79cwUy.js → extension-settings-page-BO_UKeG8.js} +1 -1
  62. package/dist/gateway/static/root/assets/file-preview-surface-i5UOFnQF.js +1 -0
  63. package/dist/gateway/static/root/assets/{gateway-config-swr-OGhON-s6.js → gateway-config-swr-1Rk0LeEM.js} +1 -1
  64. package/dist/gateway/static/root/assets/{gateway-realtime-B9u4uSXW.js → gateway-realtime-DIs1pjkQ.js} +1 -1
  65. package/dist/gateway/static/root/assets/gateway-realtime-store-sx7B8kdC.js +1 -0
  66. package/dist/gateway/static/root/assets/{gateway-restart-DKAweWmg.js → gateway-restart-DTmlcJps.js} +1 -1
  67. package/dist/gateway/static/root/assets/{gateway-settings-Dc7qUbG-.js → gateway-settings-ClcCloqQ.js} +1 -1
  68. package/dist/gateway/static/root/assets/{gateway-startup-retry-BaaoKBoB.js → gateway-startup-retry-D6WPS0RW.js} +1 -1
  69. package/dist/gateway/static/root/assets/{global-defaults-api-BIr3ApRj.js → global-defaults-api-BpDMnJe7.js} +1 -1
  70. package/dist/gateway/static/root/assets/home-page-BPPe4JXB.js +7 -0
  71. package/dist/gateway/static/root/assets/{image-generation-api-C7D2IetZ.js → image-generation-api-sbtx4NiC.js} +1 -1
  72. package/dist/gateway/static/root/assets/{imports-page-BjEdZJxZ.js → imports-page-CBlaxUhl.js} +1 -1
  73. package/dist/gateway/static/root/assets/index-D0_qnBzh.css +1 -0
  74. package/dist/gateway/static/root/assets/index-Hv71yddc.js +11 -0
  75. package/dist/gateway/static/root/assets/{install-connector-dialog-BsiyYQhx.js → install-connector-dialog-DxSv1wS2.js} +1 -1
  76. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CIthQ1lp.js → keyboard-shortcuts-settings-CnAV96nr.js} +1 -1
  77. package/dist/gateway/static/root/assets/{local-app-workbench-page-CSCIHvZV.js → local-app-workbench-page-D8oqDDAn.js} +1 -1
  78. package/dist/gateway/static/root/assets/{local-apps-page-EntiM0tz.js → local-apps-page-BI3Be5qo.js} +1 -1
  79. package/dist/gateway/static/root/assets/{local-session-drafts-XurtjR58.js → local-session-drafts-BIBHRkpM.js} +2 -2
  80. package/dist/gateway/static/root/assets/{locale-store-cg9cm2EL.js → locale-store-Dy1EByeG.js} +1 -1
  81. package/dist/gateway/static/root/assets/{logs-page-rmS9VSem.js → logs-page-CMW34T31.js} +1 -1
  82. package/dist/gateway/static/root/assets/{management-api-B6jVuJ6W.js → management-api-B5w5DdXH.js} +1 -1
  83. package/dist/gateway/static/root/assets/{management-settings-DdI9gs51.js → management-settings-DfcMIqbQ.js} +1 -1
  84. package/dist/gateway/static/root/assets/{markdown-view-D1zBWkfB.js → markdown-view-BlxIaCCQ.js} +1 -1
  85. package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-Bn49Ph1n.js → mcp-conversation-setup-page-CsTSmjmX.js} +1 -1
  86. package/dist/gateway/static/root/assets/{media-plugins-Cd6hAGDp.js → media-plugins-DGhWjPIU.js} +1 -1
  87. package/dist/gateway/static/root/assets/messages-BAnhwALN.js +3 -0
  88. package/dist/gateway/static/root/assets/{model-selector-CL6WT-jw.js → model-selector-C-CqPBao.js} +1 -1
  89. package/dist/gateway/static/root/assets/{models-hub-cache-s0FMNhq9.js → models-hub-cache-Bgh3Gfgl.js} +1 -1
  90. package/dist/gateway/static/root/assets/{note-detail-panel-C6s0WlNL.js → note-detail-panel-DLPwJGh0.js} +3 -3
  91. package/dist/gateway/static/root/assets/note-image-lightbox-CqK_uJ6Y.js +1 -0
  92. package/dist/gateway/static/root/assets/{notes-api-CR75RHd0.js → notes-api-CdXA-g9r.js} +1 -1
  93. package/dist/gateway/static/root/assets/{notes-page-CR7dNVDi.js → notes-page-DpfN5bZZ.js} +1 -1
  94. package/dist/gateway/static/root/assets/{oauth-api-CvPnQTlH.js → oauth-api-B560CHeD.js} +1 -1
  95. package/dist/gateway/static/root/assets/{oauth-provider-connect-Dk1NeeqD.js → oauth-provider-connect-D63M8Iv7.js} +1 -1
  96. package/dist/gateway/static/root/assets/{page-context-capture-button-BPtX67hZ.js → page-context-capture-button-Dibmspef.js} +1 -1
  97. package/dist/gateway/static/root/assets/{page-context-draft-Ckb8baxj.js → page-context-draft-Cr5GqS2D.js} +1 -1
  98. package/dist/gateway/static/root/assets/page-header-store-Bm8oxpFR.js +1 -0
  99. package/dist/gateway/static/root/assets/{personal-avatar-CZSnrSfc.js → personal-avatar-BMRVyTrE.js} +1 -1
  100. package/dist/gateway/static/root/assets/{personal-page-C89kLOIL.js → personal-page-BBGjwkAC.js} +1 -1
  101. package/dist/gateway/static/root/assets/{personal-profile-settings-DJRDcK2c.js → personal-profile-settings-HMQY9lz9.js} +1 -1
  102. package/dist/gateway/static/root/assets/{personal-settings-panel-C6p25Noq.js → personal-settings-panel-BppxtWBl.js} +1 -1
  103. package/dist/gateway/static/root/assets/{phone-dependencies-card-DKkFFpqi.js → phone-dependencies-card-flTci8mm.js} +1 -1
  104. package/dist/gateway/static/root/assets/{phone-model-connection-CRRHq4PQ.js → phone-model-connection-Vi_Swyv6.js} +1 -1
  105. package/dist/gateway/static/root/assets/{phone-model-picker-CN_I0-46.js → phone-model-picker-BOv3mb_F.js} +1 -1
  106. package/dist/gateway/static/root/assets/{phone-settings-page-CkdSOA7D.js → phone-settings-page-vD0bTcHj.js} +1 -1
  107. package/dist/gateway/static/root/assets/{phone-workspace-store-CC61pIuJ.js → phone-workspace-store-Ltrevdsx.js} +1 -1
  108. package/dist/gateway/static/root/assets/{plugin-details-dialog-Bqz4jT53.js → plugin-details-dialog-nSDw8sfo.js} +1 -1
  109. package/dist/gateway/static/root/assets/{preference-select-fields-DHeNbAvn.js → preference-select-fields-D1pZekPs.js} +1 -1
  110. package/dist/gateway/static/root/assets/{product-automation-feedback-BN2HTA9T.js → product-automation-feedback-D51I7Lg3.js} +1 -1
  111. package/dist/gateway/static/root/assets/{product-open-page-B-j4gpLD.js → product-open-page-BO8lUvw3.js} +1 -1
  112. package/dist/gateway/static/root/assets/product-preview-content-WkF2j_c-.js +1 -0
  113. package/dist/gateway/static/root/assets/{product-preview-modal-aurFBFq4.js → product-preview-modal-DMHOKocl.js} +2 -2
  114. package/dist/gateway/static/root/assets/{project-detail-page-sHcdluTm.js → project-detail-page-Dj_PuT7k.js} +2 -2
  115. package/dist/gateway/static/root/assets/{project-understanding-HNK9lFVy.js → project-understanding-Cg8WbBNB.js} +1 -1
  116. package/dist/gateway/static/root/assets/{projects-page-CugSyKl5.js → projects-page-C6Pt6OdT.js} +1 -1
  117. package/dist/gateway/static/root/assets/{providers-api-DUntOOqr.js → providers-api-Nytkkop9.js} +1 -1
  118. package/dist/gateway/static/root/assets/{recording-upload-DIwP541B.js → recording-upload-CyZSl2DJ.js} +1 -1
  119. package/dist/gateway/static/root/assets/{registry-api-BTd_OgbD.js → registry-api-DuDIthjL.js} +1 -1
  120. package/dist/gateway/static/root/assets/{remote-access-hub-f5mIfsBF.js → remote-access-hub-DePwafOK.js} +1 -1
  121. package/dist/gateway/static/root/assets/{resource-unavailable-DtQ2rfu_.js → resource-unavailable-BRKhKJA0.js} +1 -1
  122. package/dist/gateway/static/root/assets/right-workspace-store-HPw7Gw0n.js +1 -0
  123. package/dist/gateway/static/root/assets/route-preload-gas8e1we.js +2 -0
  124. package/dist/gateway/static/root/assets/routine-panel-CXs4PjW0.js +2 -0
  125. package/dist/gateway/static/root/assets/{runtime-tools-api-C1iI8EPo.js → runtime-tools-api-Dd8a07eo.js} +1 -1
  126. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-0tdI1z0g.js → runtime-tools-settings-panel-CvHQoqHu.js} +1 -1
  127. package/dist/gateway/static/root/assets/service-recommendation-list-DDlMyPvC.js +1 -0
  128. package/dist/gateway/static/root/assets/{session-api-CQlEq0MB.js → session-api-BFiIYodK.js} +1 -1
  129. package/dist/gateway/static/root/assets/{session-manager-C7RfUfqI.js → session-manager-D2LaQymu.js} +2 -2
  130. package/dist/gateway/static/root/assets/{sessions-page-DdS8U0RV.js → sessions-page-DQEq_VJS.js} +1 -1
  131. package/dist/gateway/static/root/assets/settings-advanced-gate-Cvx7DnU8.js +1 -0
  132. package/dist/gateway/static/root/assets/{settings-advanced-section-C6dPu5i1.js → settings-advanced-section-B-H1gYOs.js} +1 -1
  133. package/dist/gateway/static/root/assets/{settings-mode-store-BSiiowQa.js → settings-mode-store-YH60sibB.js} +1 -1
  134. package/dist/gateway/static/root/assets/{settings-page-C4CYw21O.js → settings-page-D2qkIrUg.js} +1 -1
  135. package/dist/gateway/static/root/assets/{settings-page-header-BSMu5Zq3.js → settings-page-header-DEZZ8D0S.js} +1 -1
  136. package/dist/gateway/static/root/assets/{settings-page-layout-B_vMffB1.js → settings-page-layout-De2j64Lo.js} +1 -1
  137. package/dist/gateway/static/root/assets/{setup-interaction-page-DKXfFdNt.js → setup-interaction-page-Dh6BPwv0.js} +1 -1
  138. package/dist/gateway/static/root/assets/{setup-status-panel-BbAZ9w77.js → setup-status-panel-DGAAczL-.js} +1 -1
  139. package/dist/gateway/static/root/assets/{share-link-dialog-ztX1WPXG.js → share-link-dialog-C1t_HB6f.js} +1 -1
  140. package/dist/gateway/static/root/assets/{share-preview-page-Ds2Ydfg6.js → share-preview-page-fV5USZb1.js} +1 -1
  141. package/dist/gateway/static/root/assets/{shares-api-CSZqeNL4.js → shares-api-Dm07CnXw.js} +1 -1
  142. package/dist/gateway/static/root/assets/{shares-settings-CX3TNAmI.js → shares-settings-sl40lqND.js} +1 -1
  143. package/dist/gateway/static/root/assets/{skill-api-CGzAQ-MX.js → skill-api-BV8oFqeE.js} +1 -1
  144. package/dist/gateway/static/root/assets/{skill-list-api-DfUsku-x.js → skill-list-api-1o_YRCu9.js} +1 -1
  145. package/dist/gateway/static/root/assets/{skill-reload-api-Y9qSMnBd.js → skill-reload-api-fGsO9Y86.js} +1 -1
  146. package/dist/gateway/static/root/assets/{skills-page-DnMN50Ot.js → skills-page-FTd0Z7Ey.js} +1 -1
  147. package/dist/gateway/static/root/assets/{system-settings-panel-DWNkQmme.js → system-settings-panel-CUI6QHEP.js} +1 -1
  148. package/dist/gateway/static/root/assets/task-detail-page-_5TEldtl.js +3 -0
  149. package/dist/gateway/static/root/assets/task-result-evidence-CSJeB9AH.js +1 -0
  150. package/dist/gateway/static/root/assets/{terminal-panel-store-D8eZPvql.js → terminal-panel-store-Du53Upr2.js} +1 -1
  151. package/dist/gateway/static/root/assets/{theme-store-GZQ3pTgy.js → theme-store-BaWep_o7.js} +1 -1
  152. package/dist/gateway/static/root/assets/{tracing-settings-page-DM3-7Hlw.js → tracing-settings-page-CnciBMVH.js} +1 -1
  153. package/dist/gateway/static/root/assets/{tunnel-api-DOGAIXRR.js → tunnel-api-Iz7JCBt3.js} +1 -1
  154. package/dist/gateway/static/root/assets/{understanding-activity-store-CuPfe0eQ.js → understanding-activity-store-BFc8PamJ.js} +1 -1
  155. package/dist/gateway/static/root/assets/{understanding-refresh-store-CIpGYSl0.js → understanding-refresh-store-CdEfR40A.js} +1 -1
  156. package/dist/gateway/static/root/assets/{usage-page-BA9Yrvqu.js → usage-page-DL2fmeOh.js} +1 -1
  157. package/dist/gateway/static/root/assets/{use-autosave-CO0IPCVg.js → use-autosave-N_SjHXTw.js} +1 -1
  158. package/dist/gateway/static/root/assets/use-composer-attachments-CO7XLI4x.js +2 -0
  159. package/dist/gateway/static/root/assets/{use-file-preview-expanded-dhNMHf5b.js → use-file-preview-expanded-BXXeXnT0.js} +3 -3
  160. package/dist/gateway/static/root/assets/{use-personal-profile-CVqDWBDS.js → use-personal-profile-C1vqD9yV.js} +1 -1
  161. package/dist/gateway/static/root/assets/{use-realtime-voice-DDVVlX1R.js → use-realtime-voice-C7iWQuUv.js} +1 -1
  162. package/dist/gateway/static/root/assets/{use-workspace-tree-CZej8mhf.js → use-workspace-tree-D27u-eoX.js} +1 -1
  163. package/dist/gateway/static/root/assets/{user-model-page-Bbi2MpIS.js → user-model-page-D2FHjLi7.js} +1 -1
  164. package/dist/gateway/static/root/assets/{voice-api-key-field-DpwUDAvu.js → voice-api-key-field-B_GApUQP.js} +1 -1
  165. package/dist/gateway/static/root/assets/{voice-config-api-GIuXoHXw.js → voice-config-api-DhJ3l8fk.js} +1 -1
  166. package/dist/gateway/static/root/assets/{voice-input-shortcut-events-Cc30ZcFy.js → voice-input-shortcut-events-CEeFBhp3.js} +1 -1
  167. package/dist/gateway/static/root/assets/{voice-settings-DA3m5MT0.js → voice-settings-BiqJ0tlf.js} +1 -1
  168. package/dist/gateway/static/root/assets/{work-discovery-overlay-yGUkk1NV.js → work-discovery-overlay-UvWbDUXi.js} +1 -1
  169. package/dist/gateway/static/root/assets/{work-discovery-page-RN6iuY-0.js → work-discovery-page-BM1HsYz6.js} +1 -1
  170. package/dist/gateway/static/root/assets/{working-directory-picker-modal-CeXl9w6z.js → working-directory-picker-modal-BGZduAXV.js} +1 -1
  171. package/dist/gateway/static/root/assets/{workspace-api-B1Uirhxf.js → workspace-api-LghfbP5g.js} +2 -2
  172. package/dist/gateway/static/root/assets/workspace-editor-agent-store-DVPJcbuE.js +1 -0
  173. package/dist/gateway/static/root/assets/workspace-file-preview-dialog-NffP-UXC.js +1 -0
  174. package/dist/gateway/static/root/assets/{workspace-open-location-menu-DWGNOIE2.js → workspace-open-location-menu-CvZxU9de.js} +1 -1
  175. package/dist/gateway/static/root/assets/workspace-preview-store-Do31QQH5.js +1 -0
  176. package/dist/gateway/static/root/assets/{xopc-cloud-account-card-x-XT4bKF.js → xopc-cloud-account-card-Q_jezTUy.js} +1 -1
  177. package/dist/gateway/static/root/index.html +92 -90
  178. package/dist/package.js +1 -1
  179. package/dist/packages/gateway-contract/src/automations.js +6 -0
  180. package/dist/packages/gateway-contract/src/capabilities.js +1 -1
  181. package/dist/packages/gateway-contract/src/home.js +3 -0
  182. package/dist/packages/gateway-contract/src/index.js +3 -1
  183. package/dist/packages/gateway-contract/src/observation.js +177 -0
  184. package/dist/packages/gateway-contract/src/session-input-command.js +5 -1
  185. package/dist/src/agent/agent-manager.js +1 -1
  186. package/dist/src/agent/background-review/run-background-review.js +1 -1
  187. package/dist/src/agent/client-error-format.js +1 -1
  188. package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
  189. package/dist/src/agent/embedded/execution-tool-policy.js +31 -5
  190. package/dist/src/agent/embedded/run-for-session.js +16 -8
  191. package/dist/src/agent/embedded/run-turn.js +65 -29
  192. package/dist/src/agent/embedded/types.d.ts +2 -0
  193. package/dist/src/agent/external-tools/cliProvider.js +2 -2
  194. package/dist/src/agent/external-tools/composio-provider.js +2 -2
  195. package/dist/src/agent/external-tools/endpoint-provider.js +3 -3
  196. package/dist/src/agent/fallback/reason.js +1 -1
  197. package/dist/src/agent/orchestration/llm-turn-retry.d.ts +5 -0
  198. package/dist/src/agent/orchestration/llm-turn-retry.js +17 -6
  199. package/dist/src/agent/service.js +1 -1
  200. package/dist/src/agent/skills/index.js +1 -1
  201. package/dist/src/agent/skills/managed-store.js +1 -1
  202. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  203. package/dist/src/agent/tools/personal-memory-tool.js +1 -1
  204. package/dist/src/agent/tools/personal-read-tool.js +1 -1
  205. package/dist/src/agent/tools/xopc-use-tool.js +2 -2
  206. package/dist/src/agent-catalog/capabilities.js +2 -2
  207. package/dist/src/agent-catalog/repository.js +1 -1
  208. package/dist/src/automations/api/routes.js +2 -2
  209. package/dist/src/automations/capabilities/drafts.js +1 -1
  210. package/dist/src/automations/capabilities/write.d.ts +10 -0
  211. package/dist/src/automations/capabilities/write.js +1 -1
  212. package/dist/src/automations/configuration-conversation.js +1 -1
  213. package/dist/src/automations/domain/types.d.ts +14 -0
  214. package/dist/src/automations/domain/validation.d.ts +20 -0
  215. package/dist/src/automations/domain/validation.js +6 -0
  216. package/dist/src/automations/draft/automation-draft-validator.d.ts +5 -0
  217. package/dist/src/automations/draft/automation-draft-validator.js +1 -0
  218. package/dist/src/automations/index.js +2 -2
  219. package/dist/src/automations/service/action-executor.d.ts +2 -0
  220. package/dist/src/automations/service/action-executor.js +18 -2
  221. package/dist/src/automations/service/index.js +2 -2
  222. package/dist/src/browser/providers/browser-ext-install.js +1 -1
  223. package/dist/src/capabilities/runtime/dispatcher.js +1 -1
  224. package/dist/src/capabilities/runtime/product.js +1 -1
  225. package/dist/src/cli/commands/agents.js +1 -1
  226. package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
  227. package/dist/src/cli/commands/models.js +1 -1
  228. package/dist/src/cli/commands/onboard/model.js +1 -1
  229. package/dist/src/cli/utils/init-workspace-core.js +1 -1
  230. package/dist/src/computer/endpoint-transport.js +1 -1
  231. package/dist/src/config/agent-profile.js +1 -1
  232. package/dist/src/execution-environments/local-worktree-manager.js +1 -1
  233. package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
  234. package/dist/src/extensions/agent-plugins/validation.js +1 -1
  235. package/dist/src/gateway/agents-admin.js +2 -2
  236. package/dist/src/gateway/global-defaults-admin.js +1 -1
  237. package/dist/src/gateway/hono/routes/agents.js +1 -1
  238. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  239. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  240. package/dist/src/gateway/hono/routes/home.js +100 -2
  241. package/dist/src/gateway/hono/routes/local-app-run-streams.js +1 -1
  242. package/dist/src/gateway/hono/routes/notes.js +2 -2
  243. package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
  244. package/dist/src/gateway/hono/routes/projects.js +2 -2
  245. package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
  246. package/dist/src/gateway/hono/routes/tasks.js +2 -2
  247. package/dist/src/gateway/image-generation-setup.js +1 -1
  248. package/dist/src/gateway/security/gateway-scopes.js +1 -0
  249. package/dist/src/gateway/service.js +21 -4
  250. package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
  251. package/dist/src/home-intelligence/application-service.d.ts +1 -0
  252. package/dist/src/home-intelligence/application-service.js +1 -1
  253. package/dist/src/home-intelligence/generator.js +4 -0
  254. package/dist/src/home-intelligence/host.d.ts +157 -1
  255. package/dist/src/home-intelligence/host.js +198 -14
  256. package/dist/src/home-intelligence/observation.d.ts +41 -0
  257. package/dist/src/home-intelligence/observation.js +297 -0
  258. package/dist/src/home-intelligence/repository.d.ts +1 -1
  259. package/dist/src/home-intelligence/routines.d.ts +36 -0
  260. package/dist/src/home-intelligence/routines.js +444 -0
  261. package/dist/src/home-intelligence/snapshot.d.ts +14 -0
  262. package/dist/src/imports/importService.js +1 -1
  263. package/dist/src/local-apps/automation-proposals.d.ts +20 -0
  264. package/dist/src/local-apps/automation-proposals.js +1 -1
  265. package/dist/src/local-apps/capabilities/automation-policy.js +1 -1
  266. package/dist/src/local-apps/capabilities/delegate.js +3 -3
  267. package/dist/src/local-apps/p1-services.js +1 -1
  268. package/dist/src/local-apps/service.js +1 -1
  269. package/dist/src/personal-agent/proactivity/repository.d.ts +1 -1
  270. package/dist/src/personal-agent/service.js +1 -1
  271. package/dist/src/providers/model-catalog-persistence.js +1 -1
  272. package/dist/src/providers/model-response.js +1 -1
  273. package/dist/src/realtime/compact-run-event.js +9 -0
  274. package/dist/src/runtime-tools/archive.js +1 -1
  275. package/dist/src/storage/sqlite/conversation-repository.js +4 -1
  276. package/dist/src/storage/sqlite/schema.d.ts +2 -2
  277. package/dist/src/storage/sqlite/schema.js +7 -7
  278. package/dist/src/storage/sqlite/schema.sql +71 -0
  279. package/dist/src/storage/sqlite/session-input-control-repository.js +2 -0
  280. package/dist/src/storage/sqlite/upgrades/272_home_observation.sql +41 -0
  281. package/dist/src/storage/sqlite/upgrades/273_observation_routines.sql +30 -0
  282. package/dist/src/tasks/capabilities/read.js +2 -2
  283. package/dist/src/tasks/capabilities/write.js +1 -1
  284. package/dist/src/tasks/home-query-service.js +1 -0
  285. package/dist/src/tui/backends/embedded-backend.js +1 -1
  286. package/dist/src/voice/realtime/persona-context.js +1 -1
  287. package/package.json +2 -2
  288. package/dist/gateway/static/root/assets/automation-task-card-BY_k6iWp.js +0 -3
  289. package/dist/gateway/static/root/assets/automations-workspace-CWEDraTP.js +0 -9
  290. package/dist/gateway/static/root/assets/calendar-clock-D-quYVPe.js +0 -1
  291. package/dist/gateway/static/root/assets/capabilities-kG175Q-7.js +0 -1
  292. package/dist/gateway/static/root/assets/capabilities-page-D1wQ2sPI.js +0 -2
  293. package/dist/gateway/static/root/assets/chat-page-BjYumhaI.js +0 -71
  294. package/dist/gateway/static/root/assets/composer-payload-handoff-DBE1mvOS.js +0 -1
  295. package/dist/gateway/static/root/assets/connectors-page-CEpfDCLA.js +0 -1
  296. package/dist/gateway/static/root/assets/file-preview-surface-z7_HV0WN.js +0 -1
  297. package/dist/gateway/static/root/assets/gateway-realtime-store-xB7Bq4Zs.js +0 -1
  298. package/dist/gateway/static/root/assets/home-page-i_PIrDCU.js +0 -3
  299. package/dist/gateway/static/root/assets/index-DBlVVXOA.js +0 -11
  300. package/dist/gateway/static/root/assets/index-DpkEeFEQ.css +0 -1
  301. package/dist/gateway/static/root/assets/messages-eQ2CYlpG.js +0 -3
  302. package/dist/gateway/static/root/assets/note-image-lightbox-DfK2KSgu.js +0 -1
  303. package/dist/gateway/static/root/assets/page-header-store-DU4NnGap.js +0 -1
  304. package/dist/gateway/static/root/assets/product-preview-content-EqrTk7kU.js +0 -1
  305. package/dist/gateway/static/root/assets/route-preload-DrfQJkmW.js +0 -2
  306. package/dist/gateway/static/root/assets/service-recommendation-list-DSIe-NRe.js +0 -1
  307. package/dist/gateway/static/root/assets/settings-advanced-gate-DnfH22f_.js +0 -1
  308. package/dist/gateway/static/root/assets/task-detail-page-DBnkT1Nj.js +0 -3
  309. package/dist/gateway/static/root/assets/task-input-card-lCMSy6YY.js +0 -1
  310. package/dist/gateway/static/root/assets/use-composer-attachments-CLIrD0mm.js +0 -2
  311. package/dist/gateway/static/root/assets/workspace-editor-agent-store-Nos5ebMv.js +0 -1
  312. package/dist/gateway/static/root/assets/workspace-file-preview-dialog-D0h2yJ3v.js +0 -1
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,t as n}from"./rolldown-runtime-aKtaBQYM.js";import{a as r,i,n as a,t as o}from"./vendor-react-BOUWij0V.js";import{n as s}from"./locale-store-cg9cm2EL.js";import{t as c}from"./messages-eQ2CYlpG.js";import{a as l,c as u,d,f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./unlink-BEuthaaq.js";import{t as w}from"./check-DUBLcKHA.js";import{t as T}from"./copy-Dv6d4Dvw.js";import{t as E}from"./external-link-DjqjBmc3.js";import{A as D,D as O,F as k,N as A,j,k as ee}from"./notes-api-CR75RHd0.js";import{t as te}from"./list-todo-CTVRto8O.js";import{t as ne}from"./loader-circle-CifKLtgG.js";import{C as re,G as ie,S as ae,T as oe,_ as se,b as ce,r as le,t as ue,v as de,w as fe,x as pe}from"./markdown-view-D1zBWkfB.js";import{t as me}from"./mic-CuUb7zc-.js";import{t as he}from"./pause-DuPxgSxk.js";import{t as ge}from"./pencil-DmIY3Oa-.js";import{t as _e}from"./play-kxZvpBg8.js";import{t as ve}from"./cn-0WouolD0.js";import{s as ye}from"./vendor-swr-CdRzEUwF.js";import{a as be,d as xe,i as Se,l as Ce,n as we,o as Te,r as Ee,s as De,t as Oe,u as ke}from"./floating-ui.dom-seOukHzT.js";import{t as Ae}from"./copy-to-clipboard-HOJ79TWv.js";import{a as je,i as Me,n as Ne,r as Pe,t as Fe}from"./linkify-it-BkqEorO0.js";import{S as Ie,x as Le}from"./vendor-codemirror-aCQ0FcJT.js";import{t as Re}from"./with-selector-xonYxPoM.js";import"./note-image-lightbox-DfK2KSgu.js";var M=e(r(),1),ze=e(i(),1),N=o(),Be=ye(),Ve=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,He=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Ue=t({Any:()=>je,Cc:()=>Me,Cf:()=>Ve,P:()=>Pe,S:()=>He,Z:()=>Ne}),We=Object.defineProperty,Ge=(e,t)=>{let n={};for(var r in e)We(n,r,{get:e[r],enumerable:!0});return t||We(n,Symbol.toStringTag,{value:`Module`}),n};function P(e){this.content=e}P.prototype={constructor:P,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new P(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new P(n)},addToStart:function(e,t){return new P([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new P(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new P(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=P.from(e),e.size?new P(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=P.from(e),e.size?new P(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=P.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},P.from=function(e){if(e instanceof P)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new P(t)};function Ke(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&Ye(e.charCodeAt(r-1))&&Je(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=Ke(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function qe(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&Ye(e.charCodeAt(i-1))&&Je(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=qe(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function Je(e){return e>=56320&&e<57344}function Ye(e){return e>=55296&&e<56320}var F=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.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 RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Ke(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return qe(this,e,t,n)}findIndex(e){if(e==0)return Ze(0,e);if(e==this.size)return Ze(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Ze(t+1,i):Ze(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};F.empty=new F([],0);var Xe={index:0,offset:0};function Ze(e,t){return Xe.index=e,Xe.offset=t,Xe}function Qe(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Qe(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Qe(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var I=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||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&&Qe(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 RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};I.none=[];var $e=class extends Error{},L=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=tt(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(et(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(F.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};L.empty=new L(F.empty,0,0);function et(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(et(a.content,t-i-1,n-i-1)))}function tt(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=tt(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function nt(e,t,n){if(n.openStart>e.depth)throw new $e(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new $e(`Inconsistent open depths`);return rt(e,t,n,0)}function rt(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=rt(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return ct(a,ut(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return ct(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=dt(n,e);return ct(a,lt(e,i,o,t,r))}}function it(e,t){if(!t.type.compatibleContent(e.type))throw new $e(`Cannot join `+t.type.name+` onto `+e.type.name)}function at(e,t,n){let r=e.node(n);return it(r,t.node(n)),r}function ot(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function st(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(ot(e.nodeAfter,r),a++));for(let e=a;e<o;e++)ot(i.child(e),r);t&&t.depth==n&&t.textOffset&&ot(t.nodeBefore,r)}function ct(e,t){if(!e.type.validContent(t))throw new $e(`Invalid content for node `+e.type.name);return e.copy(t)}function lt(e,t,n,r,i){let a=e.depth>i&&at(e,t,i+1),o=r.depth>i&&at(n,r,i+1),s=[];return st(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(it(a,o),ot(ct(a,lt(e,t,n,r,i+1)),s)):(a&&ot(ct(a,ut(e,t,i+1)),s),st(t,n,i,s),o&&ot(ct(o,ut(n,r,i+1)),s)),st(r,null,i,s),new F(s)}function ut(e,t,n){let r=[];return st(null,e,n,r),e.depth>n&&ot(ct(at(e,t,n+1),ut(e,t,n+1)),r),st(t,null,n,r),new F(r)}function dt(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(F.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var ft=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,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 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 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 n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}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 n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return I.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}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 n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new gt(this,e,n);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(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=ht.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else ht.set(t,r=new pt);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%mt,i}},pt=class{constructor(){this.elts=[],this.i=0}},mt=12,ht=new WeakMap,gt=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}},_t=Object.create(null),vt=class e{constructor(e,t,n,r=I.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||F.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,n,r=0){this.content.nodesBetween(e,t,n,r,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,n,r){return this.content.textBetween(e,t,n,r)}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,n){return this.type==e&&Qe(this.attrs,t||e.defaultAttrs||_t)&&I.sameSet(this.marks,n||I.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}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,n=!1){if(e==t)return L.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new L(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return nt(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return ft.resolveCached(this,e)}resolveNoCache(e){return ft.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),bt(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=F.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.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=I.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!I.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=F.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};vt.prototype.text=void 0;var yt=class e extends vt{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bt(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(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,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 bt(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var xt=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new St(t,n);if(r.next==null)return e.empty;let i=Ct(r);r.next&&r.err(`Unexpected trailing text`);let a=Nt(At(i));return Pt(a,r),a}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,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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 n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return F.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1
+ import{i as e,n as t,t as n}from"./rolldown-runtime-aKtaBQYM.js";import{a as r,i,n as a,t as o}from"./vendor-react-BOUWij0V.js";import{n as s}from"./locale-store-Dy1EByeG.js";import{t as c}from"./messages-BAnhwALN.js";import{a as l,c as u,d,f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./unlink-BEuthaaq.js";import{t as w}from"./check-DUBLcKHA.js";import{t as T}from"./copy-Dv6d4Dvw.js";import{t as E}from"./external-link-DjqjBmc3.js";import{A as D,D as O,F as k,N as A,j,k as ee}from"./notes-api-CdXA-g9r.js";import{t as te}from"./list-todo-CTVRto8O.js";import{t as ne}from"./loader-circle-CifKLtgG.js";import{C as re,G as ie,S as ae,T as oe,_ as se,b as ce,r as le,t as ue,v as de,w as fe,x as pe}from"./markdown-view-BlxIaCCQ.js";import{t as me}from"./mic-CuUb7zc-.js";import{t as he}from"./pause-DuPxgSxk.js";import{t as ge}from"./pencil-DmIY3Oa-.js";import{t as _e}from"./play-kxZvpBg8.js";import{t as ve}from"./cn-0WouolD0.js";import{s as ye}from"./vendor-swr-CdRzEUwF.js";import{a as be,d as xe,i as Se,l as Ce,n as we,o as Te,r as Ee,s as De,t as Oe,u as ke}from"./floating-ui.dom-seOukHzT.js";import{t as Ae}from"./copy-to-clipboard-HOJ79TWv.js";import{a as je,i as Me,n as Ne,r as Pe,t as Fe}from"./linkify-it-BkqEorO0.js";import{S as Ie,x as Le}from"./vendor-codemirror-aCQ0FcJT.js";import{t as Re}from"./with-selector-xonYxPoM.js";import"./note-image-lightbox-CqK_uJ6Y.js";var M=e(r(),1),ze=e(i(),1),N=o(),Be=ye(),Ve=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,He=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Ue=t({Any:()=>je,Cc:()=>Me,Cf:()=>Ve,P:()=>Pe,S:()=>He,Z:()=>Ne}),We=Object.defineProperty,Ge=(e,t)=>{let n={};for(var r in e)We(n,r,{get:e[r],enumerable:!0});return t||We(n,Symbol.toStringTag,{value:`Module`}),n};function P(e){this.content=e}P.prototype={constructor:P,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new P(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new P(n)},addToStart:function(e,t){return new P([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new P(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new P(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=P.from(e),e.size?new P(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=P.from(e),e.size?new P(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=P.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},P.from=function(e){if(e instanceof P)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new P(t)};function Ke(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&Ye(e.charCodeAt(r-1))&&Je(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=Ke(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function qe(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&Ye(e.charCodeAt(i-1))&&Je(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=qe(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function Je(e){return e>=56320&&e<57344}function Ye(e){return e>=55296&&e<56320}var F=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.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 RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Ke(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return qe(this,e,t,n)}findIndex(e){if(e==0)return Ze(0,e);if(e==this.size)return Ze(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Ze(t+1,i):Ze(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};F.empty=new F([],0);var Xe={index:0,offset:0};function Ze(e,t){return Xe.index=e,Xe.offset=t,Xe}function Qe(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Qe(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Qe(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var I=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||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&&Qe(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 RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};I.none=[];var $e=class extends Error{},L=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=tt(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(et(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(F.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};L.empty=new L(F.empty,0,0);function et(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(et(a.content,t-i-1,n-i-1)))}function tt(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=tt(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function nt(e,t,n){if(n.openStart>e.depth)throw new $e(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new $e(`Inconsistent open depths`);return rt(e,t,n,0)}function rt(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=rt(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return ct(a,ut(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return ct(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=dt(n,e);return ct(a,lt(e,i,o,t,r))}}function it(e,t){if(!t.type.compatibleContent(e.type))throw new $e(`Cannot join `+t.type.name+` onto `+e.type.name)}function at(e,t,n){let r=e.node(n);return it(r,t.node(n)),r}function ot(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function st(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(ot(e.nodeAfter,r),a++));for(let e=a;e<o;e++)ot(i.child(e),r);t&&t.depth==n&&t.textOffset&&ot(t.nodeBefore,r)}function ct(e,t){if(!e.type.validContent(t))throw new $e(`Invalid content for node `+e.type.name);return e.copy(t)}function lt(e,t,n,r,i){let a=e.depth>i&&at(e,t,i+1),o=r.depth>i&&at(n,r,i+1),s=[];return st(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(it(a,o),ot(ct(a,lt(e,t,n,r,i+1)),s)):(a&&ot(ct(a,ut(e,t,i+1)),s),st(t,n,i,s),o&&ot(ct(o,ut(n,r,i+1)),s)),st(r,null,i,s),new F(s)}function ut(e,t,n){let r=[];return st(null,e,n,r),e.depth>n&&ot(ct(at(e,t,n+1),ut(e,t,n+1)),r),st(t,null,n,r),new F(r)}function dt(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(F.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var ft=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,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 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 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 n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}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 n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return I.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}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 n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new gt(this,e,n);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(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=ht.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else ht.set(t,r=new pt);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%mt,i}},pt=class{constructor(){this.elts=[],this.i=0}},mt=12,ht=new WeakMap,gt=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}},_t=Object.create(null),vt=class e{constructor(e,t,n,r=I.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||F.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,n,r=0){this.content.nodesBetween(e,t,n,r,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,n,r){return this.content.textBetween(e,t,n,r)}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,n){return this.type==e&&Qe(this.attrs,t||e.defaultAttrs||_t)&&I.sameSet(this.marks,n||I.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}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,n=!1){if(e==t)return L.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new L(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return nt(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return ft.resolveCached(this,e)}resolveNoCache(e){return ft.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),bt(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=F.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.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=I.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!I.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=F.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};vt.prototype.text=void 0;var yt=class e extends vt{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bt(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(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,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 bt(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var xt=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new St(t,n);if(r.next==null)return e.empty;let i=Ct(r);r.next&&r.err(`Unexpected trailing text`);let a=Nt(At(i));return Pt(a,r),a}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,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}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 n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return F.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
2
  `)}};xt.empty=new xt(!0);var St=class{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 SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Ct(e){let t=[];do t.push(wt(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function wt(e){let t=[];do t.push(Tt(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Tt(e){let t=kt(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Dt(e,t);else break;return t}function Et(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Dt(e,t){let n=Et(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Et(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Ot(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function kt(e){if(e.eat(`(`)){let t=Ct(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Ot(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function At(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function jt(e,t){return t-e}function Mt(e,t){let n=[];return r(t),n.sort(jt);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Nt(e){let t=Object.create(null);return n(Mt(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Mt(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new xt(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(jt);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Pt(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Ft(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function It(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Lt(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}function Rt(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Vt(e,r,t[r]);return n}var zt=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Rt(e,n.attrs),this.defaultAttrs=Ft(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xt.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:It(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new vt(this,this.computeAttrs(e),F.from(t),I.setFrom(n))}createChecked(e=null,t,n){return t=F.from(t),this.checkContent(t),new vt(this,this.computeAttrs(e),t,I.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=F.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(F.empty,!0);return i?new vt(this,e,t.append(i),I.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Lt(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 n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:I.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Bt(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Vt=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Bt(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Ht=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Rt(e,r.attrs),this.excluded=null;let i=Ft(this.attrs);this.instance=i?new I(this,i):null}create(e=null){return!e&&this.instance?this.instance:new I(this,It(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),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){Lt(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Ut=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=P.from(e.nodes),t.marks=P.from(e.marks||{}),this.nodes=zt.compile(this.spec.nodes,this),this.marks=Ht.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=xt.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Wt(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Wt(this,n.split(` `))}this.nodeFromJSON=e=>vt.fromJSON(this,e),this.markFromJSON=e=>I.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof zt))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new yt(n,n.defaultAttrs,e,I.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 RangeError(`Unknown node type: `+e);return t}};function Wt(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Gt(e){return e.tag!=null}function Kt(e){return e.style!=null}var qt=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Gt(e))this.tags.push(e);else if(Kt(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new nn(this,t,!1);return n.addAll(e,I.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new nn(this,t,!0);return n.addAll(e,I.none,t.from,t.to),L.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(an(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=on(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=on(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Jt={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Yt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Xt={ol:!0,ul:!0},Zt=1,Qt=2,$t=4;function en(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Zt:0)|(t===`full`?Qt:0)}var tn=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=I.none,this.match=i||(a&$t?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(F.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Zt)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=F.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(F.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&&!Jt.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},nn=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=en(null,t.preserveWhitespace,0)|(n?$t:0);i=r?new tn(r.type,r.attrs,I.none,!0,t.topMatch||r.type.contentMatch,a):n?new tn(null,null,I.none,!0,null,a):new tn(e.schema.topNodeType,null,I.none,!0,null,a),this.nodes=[i],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 n=e.nodeValue,r=this.top,i=r.options&Qt?`full`:this.localPreserveWS||(r.options&Zt)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
3
3
  `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Xt.hasOwnProperty(a)&&this.parser.normalizeLists&&rn(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Yt.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Jt.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}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 n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=I.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):sn(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=en(e,i,a.options);a.options&$t&&a.content.length==0&&(o|=$t);let s=I.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):sn(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new tn(e,t,s,r,null,o)),this.open++,n}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;else this.localPreserveWS&&(this.nodes[t].options|=Zt);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].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,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].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(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function rn(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Xt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function an(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function on(e){let t={};for(let n in e)t[n]=e[n];return t}function sn(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var cn=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=un(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return un(t).createTextNode(e.text);let{dom:n,contentDOM:r}=mn(un(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&mn(un(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:mn(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=ln(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return ln(e.marks)}};function ln(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function un(e){return e.document||window.document}var dn=new WeakMap;function fn(e){let t=dn.get(e);return t===void 0&&dn.set(e,t=pn(e)),t}function pn(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function mn(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=fn(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=mn(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var hn=a(),gn=65535,_n=2**16;function vn(e,t){return e+t*_n}function yn(e){return e&gn}function bn(e){return(e-(e&gn))/_n}var xn=1,Sn=2,Cn=4,wn=8,Tn=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&wn)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Cn)>0}},En=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=yn(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+bn(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:vn(o/3,e-s),f=e==s?Sn:e==u?xn:Cn;return(t<0?e!=s:e!=u)&&(f|=wn),new Tn(a,f,d)}r+=l-c}return n?e+r:new Tn(e+r,0,null)}touches(e,t){let n=0,r=yn(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};En.empty=new En([]);var Dn=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r: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.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Tn(e,r,null)}},On=Object.create(null),kn=class{getMap(){return En.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=On[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in On)throw RangeError(`Duplicate use of step JSON ID `+e);return On[e]=t,t.prototype.jsonID=e,t}},An=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof $e)return e.fail(t.message);throw t}}};function jn(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(jn(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return F.fromArray(r)}var Mn=class e extends kn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new L(jn(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return An.fromReplace(e,this.from,this.to,i)}invert(){return new Nn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};kn.jsonID(`addMark`,Mn);var Nn=class e extends kn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new L(jn(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return An.fromReplace(e,this.from,this.to,n)}invert(){return new Mn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};kn.jsonID(`removeMark`,Nn);var Pn=class e extends kn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return An.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return An.fromReplace(e,this.pos,this.pos+1,new L(F.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Fn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};kn.jsonID(`addNodeMark`,Pn);var Fn=class e extends kn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return An.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return An.fromReplace(e,this.pos,this.pos+1,new L(F.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Pn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};kn.jsonID(`removeNodeMark`,Fn);var In=class e extends kn{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Rn(e,this.from,this.to)?An.fail(`Structure replace would overwrite content`):An.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new En([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?L.empty:new L(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?L.empty:new L(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,L.fromJSON(t,n.slice),!!n.structure)}};In.MAP_BIAS=1,kn.jsonID(`replace`,In);var Ln=class e extends kn{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Rn(e,this.from,this.gapFrom)||Rn(e,this.gapTo,this.to)))return An.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return An.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?An.fromReplace(e,this.from,this.to,n):An.fail(`Content does not fit in gap`)}getMap(){return new En([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,L.fromJSON(t,n.slice),n.insert,!!n.structure)}};kn.jsonID(`replaceAround`,Ln);function Rn(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function zn(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Nn(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Mn(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Bn(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof Ht){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Nn(t.from,t.to,t.style)))}function Vn(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new In(s,l,L.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Nn(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new L(F.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new In(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(F.empty,!0);e.replace(s,s,new L(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Hn(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Un(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Hn(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Wn(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=F.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=F.from(r.node(e).copy(u)),d++):c--;let f=F.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=F.from(i.node(e).copy(f)),p++):l++;e.step(new Ln(c,l,o,s,new L(u.append(f),d,p),u.size-d,!0))}function Gn(e,t,n=null,r=e){let i=qn(e,t),a=i&&Jn(r,t);return a?i.map(Kn).concat({type:t,attrs:n}).concat(a.map(Kn)):null}function Kn(e){return{type:e,attrs:null}}function qn(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Jn(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Yn(e,t,n){let r=F.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=F.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Ln(i,a,i,a,new L(r,0,0),n.length,!0))}function Xn(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&$n(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Qn(e,t,n,a),Vn(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Ln(c,l,c+1,l-1,new L(F.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Zn(e,t,n,a),!1}})}function Zn(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Qn(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as o,i as s,l as c,n as l,o as u}from"./locale-store-cg9cm2EL.js";import{t as d}from"./messages-eQ2CYlpG.js";import{t as f}from"./chevron-down-ccbiQQz_.js";import{t as p}from"./popover-select-CLsphyzA.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./cpu-B247669f.js";import{t as g}from"./download-Dk-ZjtO6.js";import{t as _}from"./external-link-DjqjBmc3.js";import{t as v}from"./eye-CABVeTq0.js";import{t as y}from"./folder-open-CyzJ19I9.js";import{t as b}from"./gauge-C78eD2BA.js";import{t as x}from"./globe-DSSGFWFn.js";import{t as S}from"./info-CDrmIZhb.js";import{t as C}from"./loader-circle-CifKLtgG.js";import{t as w}from"./lock-keyhole-DEK5kH0u.js";import{t as T}from"./plug-zap-L8NMe3Sv.js";import{t as E}from"./refresh-cw-BRlGaq2w.js";import{t as D}from"./settings-2-D-csvaET.js";import{t as O}from"./triangle-alert-2JXFNNKU.js";import{t as k}from"./skeleton-DzdOeGYz.js";import{i as A}from"./vendor-swr-CdRzEUwF.js";import{n as j,r as ee}from"./gateway-config-swr-OGhON-s6.js";import{t as M}from"./button-Cc4hUNTt.js";import{n as te,t as N}from"./settings-form-draft-Dy10ldo8.js";import{n as P}from"./settings-loading-skeleton-CAoOV17i.js";import{t as ne}from"./number-input-El7Szeln.js";import{n as F,t as re}from"./settings-page-header-BSMu5Zq3.js";import"./settings-page-layout-B_vMffB1.js";import{n as I,t as L}from"./use-autosave-CO0IPCVg.js";var R=n(),z=e(t(),1),B=r();function V(e){let t=(0,R.c)(31),{name:n,title:r,summary:a,icon:o,inset:s,children:c}=e,l=s!==void 0&&s,[u,d]=i(),p=(0,z.useId)(),m=`browser-${n}`,h;t[0]!==m||t[1]!==u?(h=u.get(m),t[0]=m,t[1]=u,t[2]=h):h=t[2];let g=h===`1`,_=l?`border-t border-edge-subtle`:`rounded-2xl border border-edge bg-surface-panel`,v;t[3]!==m||t[4]!==g||t[5]!==d?(v=()=>d(e=>{let t=new URLSearchParams(e);return t.set(m,g?`0`:`1`),t}),t[3]=m,t[4]=g,t[5]=d,t[6]=v):v=t[6];let y;t[7]===o?y=t[8]:(y=o&&(0,B.jsx)(`span`,{className:`shrink-0 text-fg-muted`,"aria-hidden":!0,children:o}),t[7]=o,t[8]=y);let b;t[9]===r?b=t[10]:(b=(0,B.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-semibold text-fg`,children:r}),t[9]=r,t[10]=b);let x;t[11]===a?x=t[12]:(x=a&&(0,B.jsx)(`span`,{className:`max-w-[40%] truncate text-xs font-normal text-fg-muted`,title:a,children:a}),t[11]=a,t[12]=x);let S=`size-4 shrink-0 text-fg-muted ${g?`rotate-180`:``}`,C;t[13]===S?C=t[14]:(C=(0,B.jsx)(f,{className:S,"aria-hidden":!0}),t[13]=S,t[14]=C);let w;t[15]!==p||t[16]!==g||t[17]!==v||t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==C?(w=(0,B.jsx)(`h2`,{children:(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":g,"aria-controls":p,className:`flex min-h-16 w-full items-center gap-3 rounded-2xl p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:p-5`,onClick:v,children:[y,b,x,C]})}),t[15]=p,t[16]=g,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=C,t[22]=w):w=t[22];let T=!g,E=g&&c,D;t[23]!==p||t[24]!==T||t[25]!==E?(D=(0,B.jsx)(`div`,{id:p,hidden:T,className:`space-y-4 border-t border-edge-subtle p-4 sm:p-5`,children:E}),t[23]=p,t[24]=T,t[25]=E,t[26]=D):D=t[26];let O;return t[27]!==w||t[28]!==D||t[29]!==_?(O=(0,B.jsxs)(`section`,{className:_,children:[w,D]}),t[27]=w,t[28]=D,t[29]=_,t[30]=O):O=t[30],O}function ie(){return u(s(`/api/browser/status`))}function H(){return u(s(`/api/browser/test`),{method:`POST`})}function ae(e=!1){return u(s(`/api/browser/extension/install`),{method:`POST`,body:JSON.stringify({force:e})})}function U(e){return u(s(`/api/browser/extension/open`),{method:`POST`,body:JSON.stringify({action:e})})}async function oe(e,t){let n=await o(s(`/api/browser/playwright/install/stream`),{method:`POST`,headers:{Accept:`text/event-stream`},signal:t});if(!n.ok||!n.body)throw Error(`Chromium install request failed (HTTP ${n.status}).`);let r=n.body.getReader(),i=new TextDecoder,a=``,c;try{for(;!c;){let t=await r.read();if(t.done)break;a+=i.decode(t.value,{stream:!0}),a=a.replace(/\r\n/g,`
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{m as i,u as a}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as o,i as s,l as c,n as l,o as u}from"./locale-store-Dy1EByeG.js";import{t as d}from"./messages-BAnhwALN.js";import{t as f}from"./chevron-down-ccbiQQz_.js";import{t as p}from"./popover-select-CLsphyzA.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./cpu-B247669f.js";import{t as g}from"./download-Dk-ZjtO6.js";import{t as _}from"./external-link-DjqjBmc3.js";import{t as v}from"./eye-CABVeTq0.js";import{t as y}from"./folder-open-CyzJ19I9.js";import{t as b}from"./gauge-C78eD2BA.js";import{t as x}from"./globe-DSSGFWFn.js";import{t as S}from"./info-CDrmIZhb.js";import{t as C}from"./loader-circle-CifKLtgG.js";import{t as w}from"./lock-keyhole-DEK5kH0u.js";import{t as T}from"./plug-zap-L8NMe3Sv.js";import{t as E}from"./refresh-cw-BRlGaq2w.js";import{t as D}from"./settings-2-D-csvaET.js";import{t as O}from"./triangle-alert-2JXFNNKU.js";import{t as k}from"./skeleton-DzdOeGYz.js";import{i as A}from"./vendor-swr-CdRzEUwF.js";import{n as j,r as ee}from"./gateway-config-swr-1Rk0LeEM.js";import{t as M}from"./button-Cc4hUNTt.js";import{n as te,t as N}from"./settings-form-draft-Dy10ldo8.js";import{n as P}from"./settings-loading-skeleton-CAoOV17i.js";import{t as ne}from"./number-input-El7Szeln.js";import{n as F,t as re}from"./settings-page-header-DEZZ8D0S.js";import"./settings-page-layout-De2j64Lo.js";import{n as I,t as L}from"./use-autosave-N_SjHXTw.js";var R=n(),z=e(t(),1),B=r();function V(e){let t=(0,R.c)(31),{name:n,title:r,summary:a,icon:o,inset:s,children:c}=e,l=s!==void 0&&s,[u,d]=i(),p=(0,z.useId)(),m=`browser-${n}`,h;t[0]!==m||t[1]!==u?(h=u.get(m),t[0]=m,t[1]=u,t[2]=h):h=t[2];let g=h===`1`,_=l?`border-t border-edge-subtle`:`rounded-2xl border border-edge bg-surface-panel`,v;t[3]!==m||t[4]!==g||t[5]!==d?(v=()=>d(e=>{let t=new URLSearchParams(e);return t.set(m,g?`0`:`1`),t}),t[3]=m,t[4]=g,t[5]=d,t[6]=v):v=t[6];let y;t[7]===o?y=t[8]:(y=o&&(0,B.jsx)(`span`,{className:`shrink-0 text-fg-muted`,"aria-hidden":!0,children:o}),t[7]=o,t[8]=y);let b;t[9]===r?b=t[10]:(b=(0,B.jsx)(`span`,{className:`min-w-0 flex-1 text-sm font-semibold text-fg`,children:r}),t[9]=r,t[10]=b);let x;t[11]===a?x=t[12]:(x=a&&(0,B.jsx)(`span`,{className:`max-w-[40%] truncate text-xs font-normal text-fg-muted`,title:a,children:a}),t[11]=a,t[12]=x);let S=`size-4 shrink-0 text-fg-muted ${g?`rotate-180`:``}`,C;t[13]===S?C=t[14]:(C=(0,B.jsx)(f,{className:S,"aria-hidden":!0}),t[13]=S,t[14]=C);let w;t[15]!==p||t[16]!==g||t[17]!==v||t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==C?(w=(0,B.jsx)(`h2`,{children:(0,B.jsxs)(`button`,{type:`button`,"aria-expanded":g,"aria-controls":p,className:`flex min-h-16 w-full items-center gap-3 rounded-2xl p-4 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:p-5`,onClick:v,children:[y,b,x,C]})}),t[15]=p,t[16]=g,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=C,t[22]=w):w=t[22];let T=!g,E=g&&c,D;t[23]!==p||t[24]!==T||t[25]!==E?(D=(0,B.jsx)(`div`,{id:p,hidden:T,className:`space-y-4 border-t border-edge-subtle p-4 sm:p-5`,children:E}),t[23]=p,t[24]=T,t[25]=E,t[26]=D):D=t[26];let O;return t[27]!==w||t[28]!==D||t[29]!==_?(O=(0,B.jsxs)(`section`,{className:_,children:[w,D]}),t[27]=w,t[28]=D,t[29]=_,t[30]=O):O=t[30],O}function ie(){return u(s(`/api/browser/status`))}function H(){return u(s(`/api/browser/test`),{method:`POST`})}function ae(e=!1){return u(s(`/api/browser/extension/install`),{method:`POST`,body:JSON.stringify({force:e})})}function U(e){return u(s(`/api/browser/extension/open`),{method:`POST`,body:JSON.stringify({action:e})})}async function oe(e,t){let n=await o(s(`/api/browser/playwright/install/stream`),{method:`POST`,headers:{Accept:`text/event-stream`},signal:t});if(!n.ok||!n.body)throw Error(`Chromium install request failed (HTTP ${n.status}).`);let r=n.body.getReader(),i=new TextDecoder,a=``,c;try{for(;!c;){let t=await r.read();if(t.done)break;a+=i.decode(t.value,{stream:!0}),a=a.replace(/\r\n/g,`
2
2
  `);let n=a.split(`
3
3
 
4
4
  `);a=n.pop()??``;for(let t of n){let n=t.split(`
@@ -0,0 +1 @@
1
+ import{_ as e,a as t,c as n,d as r,f as i,g as a,i as o,l as s,m as c,n as l,o as u,p as d,r as ee,s as f,u as p,y as m}from"./schemas-CCWMleym.js";import{c as te,f as ne,g as h,l as g,n as re,o as _,p as v,u as y,v as b}from"./tasks-BTLabOMp.js";import{a as ie,r as x,t as ae}from"./local-apps-DeqzkJiF.js";import{g as oe,h as S}from"./local-session-drafts-BIBHRkpM.js";var C=u(`kind`,[r({kind:n(`once`),at:c()}),r({kind:n(`interval`),everyMs:p().positive(),anchorMs:p().optional()}),r({kind:n(`cron`),expr:c(),tz:c().optional()})]),w=u(`kind`,[r({kind:n(`manual`)}),r({kind:n(`schedule`),schedule:C}),r({kind:n(`webhook`),secretId:c().optional()}),r({kind:n(`event`),eventType:c(),source:c().optional(),payloadMatch:i(c(),a([c(),p(),t(),ee()])).optional()})]),T=u(`kind`,[r({kind:n(`routine`),routineId:c(),version:p().int().positive(),hash:c()}),r({kind:n(`agent`),agentId:c().optional(),instruction:c(),mcpSourceId:c().max(200).optional(),workingDirectory:c().optional(),model:c().optional(),timeoutSeconds:p().positive().optional()}),r({kind:n(`task_command`),taskId:c(),command:re}),r({kind:n(`system`),capability:l([`home.advisor.refresh`,`personal.proactivity.tick`,`memory.temporal_sweep`,`memory.daily_reconciliation`,`memory.weekly_knowledge`])})]),E=l([`queued`,`running`,`cancelling`,`succeeded`,`failed`,`cancelled`,`timeout`]),se=u(`kind`,[r({key:c(),kind:n(`gateway_event`)}),r({key:c(),kind:n(`weixin`),conversationId:c().uuid(),principalId:c().min(1)}),r({key:c(),kind:n(`webhook`),endpoint:c().url().startsWith(`https://`),secretId:c()}),r({key:c(),kind:n(`file`),targetId:c(),pathTemplate:c()}),r({key:c(),kind:n(`card`),channelId:c(),templateId:c()})]),D=r({id:c(),name:c(),description:c().optional(),projectId:c().optional(),enabled:t(),trigger:w,action:T,safety:r({mode:l([`suggest_only`,`ask_before_apply`,`auto_apply`])}).optional(),conversationMode:l([`new_session`,`continuous`]).optional(),delivery:r({notificationPolicy:l([`attention`,`all`,`none`]),destinations:o(se)}),reliability:r({executionTimeoutSeconds:p().positive().optional(),retryCount:p().int().nonnegative().optional(),maxConcurrentRuns:p().int().positive().optional(),disableAfterConsecutiveFailures:p().int().positive().optional()}).optional(),management:r({owner:c(),editable:o(l([`enabled`,`trigger`])),runnable:t(),deletable:t()}).optional(),state:r({nextRunAtMs:p().optional(),runningRunId:c().optional(),lastRunAtMs:p().optional(),lastRunStatus:E.optional(),lastError:c().optional(),consecutiveFailures:p().int().nonnegative().optional()}),createdAtMs:p(),updatedAtMs:p()}),O=r({id:c(),automationId:c(),automationName:c(),status:E,triggerSnapshot:w,actionSnapshot:T,manual:t(),createdAtMs:p(),startedAtMs:p().optional(),endedAtMs:p().optional(),durationMs:p().optional(),summary:c().optional(),error:c().optional(),conversationId:c().optional(),conversationShared:t().optional(),model:c().optional(),deadlineAtMs:p().optional(),currentPhase:l([`queued`,`action`,`cancelling`,`completed`]).optional(),cancelRequestedAtMs:p().optional(),cancelConfirmedAtMs:p().optional(),termination:r({reason:l([`completed`,`failed`,`user_cancelled`,`deadline_exceeded`]),component:l([`automation`,`agent_turn`,`tool`,`mcp`,`process`]).optional(),componentName:c().optional(),cancellationConfirmed:t()}).optional(),heartbeatAtMs:p().optional(),leaseOwner:c().optional(),leaseExpiresAtMs:p().optional(),attemptNumber:p().int().positive().optional(),rootRunId:c().optional()}),k=r({id:c(),runId:c(),automationId:c(),type:l([`run.queued`,`run.started`,`run.deadline_resolved`,`run.cancel_requested`,`run.cancel_confirmed`,`run.cancellation_unconfirmed`,`run.recovered`,`action.started`,`action.retry_scheduled`,`action.completed`,`action.failed`,`run.completed`]),message:c(),data:e().optional(),createdAtMs:p()}),ce=r({totalAutomations:p().int().nonnegative(),enabledAutomations:p().int().nonnegative(),runningRuns:p().int().nonnegative(),failedLastHour:p().int().nonnegative(),nextRun:r({automationId:c(),name:c(),runAtMs:p()}).optional(),pendingEvents:p().int().nonnegative(),oldestPendingEventAgeMs:p().int().nonnegative(),projectionDeadLetters:p().int().nonnegative(),pendingRunDeliveries:p().int().nonnegative(),runDeliveryDeadLetters:p().int().nonnegative(),pendingResultDeliveries:p().int().nonnegative(),resultDeliveryDeadLetters:p().int().nonnegative(),activeExecutions:p().int().nonnegative(),activeDeliveryLeases:p().int().nonnegative()}),A=r({version:p(),baseVersion:p().nullable(),additions:o(c()),status:l([`candidate`,`validating`,`validated`,`approved`,`rejected`]),validationTaskId:c().nullable(),validation:l([`unverified`,`passed`,`failed`])}),j=r({id:c(),topicId:c(),title:c(),status:l([`active`,`paused`,`ended`]),revision:p(),adoptedVersion:p(),automationId:c(),validUntil:p(),schedule:C.nullable(),methods:o(A),executions:o(r({taskId:c(),runId:c(),version:p(),status:c(),verdict:c().nullable()}))});d({topicId:c().min(1),trialTaskId:c().min(1),expectedTaskVersion:p().int().positive(),idempotencyKey:c().min(1).max(200),schedule:C,validUntil:p().int().positive()}),d({expectedRevision:p().int().positive(),idempotencyKey:c().min(1).max(200),command:u(`kind`,[d({kind:n(`pause`)}),d({kind:n(`resume`)}),d({kind:n(`end`)}),d({kind:n(`configure`),schedule:C,validUntil:p().int().positive()}),d({kind:n(`validate`),version:p().int().positive()}),d({kind:n(`adopt_method`),version:p().int().positive()}),d({kind:n(`rollback`),version:p().int().positive()}),d({kind:n(`reject_method`),version:p().int().positive()})])});var M=r({id:c(),text:c(),scope:l([`once`,`project`,`similar`]),status:l([`active`,`retracted`]),createdAt:p()}),N=r({id:c(),title:c(),projectId:c().optional(),revision:p(),entries:o(r({id:c(),kind:c(),text:c(),sourceRef:c().nullish(),createdAt:p()})),feedback:o(M),trials:o(r({taskId:c(),title:c(),phase:c(),resolution:c().nullable(),taskVersion:p().optional()})),routine:j.optional()}),P=r({id:c().optional(),status:l([`disabled`,`active`,`paused`]),revision:p(),analyzedRevision:p(),lastProcessedAt:p().nullable(),topics:o(N)}),F=u(`kind`,[d({kind:n(`start`),backfillDays:p().int().min(0).max(30).default(30)}),d({kind:n(`pause`)}),d({kind:n(`resume`),mode:l([`catch_up`,`new_only`])}),d({kind:n(`feedback`),topicId:c().min(1),text:c().trim().min(1).max(1e3),scope:l([`once`,`project`,`similar`])}),d({kind:n(`retract`),topicId:c().min(1),feedbackId:c().min(1)}),d({kind:n(`forget`),topicId:c().min(1)})]);d({idempotencyKey:c().min(1).max(200),expectedRevision:p().int().nonnegative(),command:F}),d({topicId:c().min(1),opportunityId:c().min(1),expectedRevision:p().int().positive(),expectedOpportunityRevision:p().int().positive(),idempotencyKey:c().min(1).max(200)});var I=r({id:c(),kind:l([`task`,`connector_approval`]),title:c(),detail:c().optional(),reason:l([`needs_input`,`blocked`,`user_input`,`user_approval`,`dependency`,`external`,`scheduled`,`retry`,`paused`,`overdue`,`due_soon`,`decision_needed`,`approval_required`]),urgency:l([`now`,`soon`]),href:c(),projectId:c().optional(),projectName:c().optional(),dueAt:p().int().nonnegative().optional(),updatedAt:p(),response:u(`kind`,[r({kind:n(`connector_approval`),approvalId:c()}),r({kind:n(`task`),taskId:c(),canRetry:t()})]).optional()});r({id:c(),kind:l([`automation_run`]),runId:c(),title:c(),detail:c(),reason:l([`run_failed`,`run_timeout`]),href:c(),updatedAt:p(),conversationId:c().optional()});var L=u(`type`,[r({type:n(`task_review`),label:c(),taskId:c()}),r({type:n(`retry_task`),label:c(),taskId:c()}),r({type:n(`open`),label:c(),href:c()}),r({type:n(`connector_decision`),label:c(),approvalId:c(),decision:l([`approve`,`deny`])}),r({type:n(`retry_run`),label:c(),subjectKind:l([`automation_run`]),runId:c()}),r({type:n(`acknowledge_run`),label:c(),subjectKind:l([`automation_run`]),runId:c()})]),R=r({id:c(),kind:l([`decision`,`failure`,`running`,`scheduled`]),title:c(),summary:c(),projectName:c().optional(),recommendation:c().optional(),dueAt:p().int().nonnegative().optional(),statusLabel:c().optional(),backgroundState:l([`waiting`,`paused`]).optional(),updatedAt:p(),openAction:L.optional(),primaryAction:L.optional(),secondaryActions:o(L).max(2).default([])}),z=r({conversationId:c(),runId:c(),title:c().optional(),agentId:c().optional(),updatedAt:p()}),B=d({id:c().trim().min(1).max(300),sourceType:l([`project`,`task`,`conversation`,`calendar`,`mail`,`communication`,`file`,`user_model`]),sourceRef:c().trim().min(1).max(1e3),revision:c().trim().min(1).max(300),observation:c().trim().min(1).max(1e3),observedAt:p().int().nonnegative(),freshUntil:p().int().nonnegative(),href:c().trim().min(1).max(2e3).optional()}),V=d({kind:l([`connector`,`skill`,`agent`]),capability:c().trim().min(1).max(200),resolvedId:c().trim().min(1).max(300).optional(),readiness:l([`ready`,`needs_setup`,`unavailable`]),required:t(),recoveryPath:c().trim().min(1).max(2e3).optional(),reason:c().trim().min(1).max(500).optional()}),H=d({kind:l([`connector`,`skill`,`agent`]),capability:c().trim().min(1).max(200),code:l([`not_installed`,`disabled`,`agent_not_allowed`,`scope_too_narrow`,`connection_missing`,`account_selection_required`,`reauthorization_required`,`requirements_unmet`,`model_invocation_disabled`,`tool_gated`,`agent_unavailable`]),message:c().trim().min(1).max(500),recoveryPath:c().trim().min(1).max(2e3)}),U=u(`state`,[d({state:n(`ready`)}),d({state:n(`needs_setup`),blockers:o(H).min(1).max(12),recoveryActions:o(d({capability:c().trim().min(1).max(200),href:c().trim().min(1).max(2e3)})).min(1).max(12),degradedAction:d({mode:n(`degraded_start`)}).optional()})]),W=d({summary:c().trim().min(1).max(300),evidenceIds:o(c().trim().min(1).max(300)).min(1).max(8)}),G=d({version:n(1),locale:l([`zh`,`en`]),groups:o(W).min(1).max(8)}),K=d({id:c().trim().min(1).max(200),revision:p().int().positive(),kind:l([`project_next_step`,`delivery_risk`,`meeting_prep`,`commitment_follow_up`,`automation_candidate`]),projectId:c().trim().min(1).max(200).optional(),title:c().trim().min(1).max(160),outcome:c().trim().min(1).max(1e3),rationale:c().trim().min(1).max(1500),evidence:o(B).min(1).max(8),evidencePresentation:G.optional(),confidence:l([`high`,`medium`,`low`]),urgency:l([`now`,`today`,`this_week`]),estimatedMinutes:p().int().min(1).max(480).optional(),risk:l([`analysis`,`external_read`,`file_write`,`external_write`]),proposedSteps:o(c().trim().min(1).max(500)).min(1).max(6),capabilities:o(V).max(12),verification:o(c().trim().min(1).max(500)).max(8),actionPrompt:c().trim().min(1).max(4e3),degradedActionPrompt:c().trim().min(1).max(4e3).optional(),continuation:u(`kind`,[d({kind:n(`automation`),reason:n(`repeated_success`),href:c().trim().min(1).max(4e3),successCount:p().int().min(2)})]).optional(),actions:d({canStart:t(),canDiscuss:t(),degradedStartAvailable:t()}),generatedAt:p().int().nonnegative(),expiresAt:p().int().nonnegative()}),le=d({id:c().trim().min(1).max(200),revision:p().int().positive(),question:c().trim().min(1).max(500),options:o(d({id:c().trim().min(1).max(100),label:c().trim().min(1).max(200)})).min(2).max(3),evidenceIds:o(c().trim().min(1).max(300)).min(1).max(8)}),ue=u(`state`,[d({state:n(`disabled`)}),d({state:n(`quiet`),reason:l([`no_change`,`insufficient_value`,`model_unavailable`,`generation_failed`,`budget_exhausted`])}),d({state:n(`refreshing`),previous:K.optional(),requestedAt:p().int().nonnegative()}),d({state:n(`clarification`),question:le,generatedAt:p().int().nonnegative(),expiresAt:p().int().nonnegative()}),d({state:n(`ready`),primary:K,alternatives:o(K).max(2),placement:l([`primary`,`compact`]),generatedAt:p().int().nonnegative(),expiresAt:p().int().nonnegative(),stale:t()})]);d({idempotencyKey:c().trim().min(1).max(200),locale:c().trim().max(30).optional()}),d({idempotencyKey:c().trim().min(1).max(200),expectedRevision:p().int().positive(),kind:l([`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]),reasonCode:c().trim().min(1).max(100).optional(),note:c().trim().min(1).max(1e3).optional(),snoozedUntil:p().int().nonnegative().optional()}),d({idempotencyKey:c().trim().min(1).max(200)});var de=d({items:o(d({opportunity:K,status:l([`available`,`started`,`discussing`,`completed`,`snoozed`,`dismissed`,`expired`,`superseded`]),feedbackKind:l([`started`,`discussed`,`already_done`,`irrelevant`,`too_early`,`source_incorrect`,`less_like_this`,`snoozed`]).optional(),updatedAt:p().int().nonnegative(),snoozedUntil:p().int().nonnegative().optional(),href:c().trim().min(1).max(2e3).optional()})).max(100)});d({idempotencyKey:c().trim().min(1).max(200),expectedRevision:p().int().positive(),mode:l([`start`,`degraded_start`,`discuss`])});var fe=u(`outcome`,[d({outcome:n(`task`),taskId:c(),href:c()}),d({outcome:n(`chat_draft`),href:c()}),d({outcome:n(`needs_setup`),preflight:U})]),pe=r({observation:P.optional(),runningConversations:o(z).default([]),recentDeliveries:o(r({id:c(),kind:l([`task`,`automation`]),subjectId:c(),title:c(),summary:c(),completedAt:p(),read:t(),href:c()})).default([]),resumable:o(r({id:c(),kind:l([`task`,`conversation`]),title:c(),summary:c().optional(),projectName:c().optional(),updatedAt:p(),href:c()})).default([]),needsUser:o(R),background:o(R),backgroundCount:p().int().nonnegative(),decisions:o(I),advisor:ue,attentionPolicy:r({visibleDecisionCount:p().int().nonnegative(),suppressedDecisionCount:p().int().nonnegative(),visibleAttentionCount:p().int().nonnegative(),suppressedAttentionCount:p().int().nonnegative()}).default({visibleDecisionCount:0,suppressedDecisionCount:0,visibleAttentionCount:0,suppressedAttentionCount:0})});d({window:d({since:p().int().nonnegative(),until:p().int().nonnegative()}),currentStrategyVersion:c().trim().min(1).max(100),generations:d({total:p().int().nonnegative(),succeeded:p().int().nonnegative(),quiet:p().int().nonnegative(),failed:p().int().nonnegative(),estimatedCostUsd:p().nonnegative()}),outcomes:d({opportunities:p().int().nonnegative(),started:p().int().nonnegative(),discussed:p().int().nonnegative(),completed:p().int().nonnegative(),corrected:p().int().nonnegative(),expired:p().int().nonnegative()}),rates:d({start:p().min(0).max(1),completionFromStarted:p().min(0).max(1),correction:p().min(0).max(1)}),feedback:d({alreadyDone:p().int().nonnegative(),irrelevant:p().int().nonnegative(),tooEarly:p().int().nonnegative(),sourceIncorrect:p().int().nonnegative(),lessLikeThis:p().int().nonnegative()}),strategies:o(d({version:c().trim().min(1).max(100),generations:p().int().nonnegative(),opportunities:p().int().nonnegative(),started:p().int().nonnegative(),completed:p().int().nonnegative()}))});var me=r({northStar:r({weeklyTrustedProgress:p(),weeklyActiveUsers:p(),trustedProgressPerWeeklyActiveUser:p()}),tasks:r({total:p(),achieved:p(),partial:p(),notAchieved:p(),userCorrected:p(),achievementRate:p(),correctionRate:p(),trusted:p(),trustedRate:p()})});function he(e){return pe.parse(e)}l([`http`,`agent`,`cli`,`automation`,`mcp`,`extension`]);var ge=a([l(`overview.imports.sessions.tracing.usage.logs.computer-use.phone-use.agent-browser.extensions/debug.connector-service.appearance.keyboard-shortcuts.system.desktop-pet.desktop-app.agent-defaults.gateway.runtimes.devices.remote-access.shares.capabilities/models.capabilities/image.capabilities/voice.capabilities/search`.split(`.`)),c().regex(/^ext\/[a-z0-9_-]+(?:\/[a-z0-9_-]+)?$/i).max(512)]);l([`INVALID_INPUT`,`FORBIDDEN`,`NOT_FOUND`,`REVISION_CONFLICT`,`CONTRACT_CHANGED`,`APPROVAL_REQUIRED`,`IN_PROGRESS`,`UNAVAILABLE`,`OUTCOME_UNKNOWN`,`CANCELLED`,`INTERNAL`]);var _e=d({majorVersion:p().int().positive(),descriptorDigest:c().regex(/^[a-f0-9]{64}$/),input:f(),idempotencyKey:c().min(1).max(200).optional()}),ve=r({triggerSummary:c(),actionSummary:c(),safetyNotes:o(c()),requiredConfirmations:o(c()),canRunNow:t(),runNowBlockedReason:c().optional()});d({agentId:c().trim().min(1).max(64).optional(),language:l([`en`,`zh`]).default(`en`)}),r({draftId:c(),explanation:c(),assumptions:o(c()),risks:o(c()),automation:s({name:c(),trigger:f(),action:f()}),simulation:ve,repairAttempts:p().int().nonnegative()}),r({draftId:c(),patch:i(c(),f()),explanation:c(),expectedEffect:c(),risks:o(c()),requiresApproval:t(),repairAttempts:p().int().nonnegative()});var ye=d({eventId:c().min(1),kind:l([`note`,`task`,`project`,`automation`,`local_app`]),id:c().min(1),revision:p().int().nonnegative(),operation:l([`created`,`updated`,`deleted`]),operationId:c().optional()}),q=d({id:c().trim().min(1).max(512)});q.extend({expectedVersion:p().int().positive(),reason:c().trim().min(1).max(4096).default(`TaskRun cancelled`)}),q.extend({rating:l([`helpful`,`not_helpful`]),reason:c().trim().max(4096).optional()}),r({ok:n(!0),feedback:r({id:c(),runId:c(),rating:l([`helpful`,`not_helpful`]),reason:c().optional(),createdAt:p()})}),r({ok:n(!0),run:v,receipt:y,model:_.pick({task:!0,operationalState:!0,attention:!0,allowedCommands:!0}),executionStopConfirmed:n(!1)}),q.extend({enabled:t(),expectedRevision:p().int().nonnegative()}),r({ok:n(!0),automation:D.loose()}).extend({run:O.loose()}),r({ok:n(!0),cancelled:t(),confirmed:t()}),r({ok:n(!0),marked:n(!0)}),d({projectId:c().trim().min(1).max(512).optional()}),r({ok:n(!0),count:p().int().nonnegative()}),q.extend({reason:c().trim().min(1).max(2e3)}),d({runId:c().trim().min(1).max(200),destinationKey:c().trim().min(1).max(100),reason:c().trim().min(1).max(2e3)}),r({ok:n(!0),accepted:n(!0)}),q.extend({expectedRevision:p().int().nonnegative().nullable()}),r({ok:n(!0),removed:t(),automation:D.loose().optional(),cancelRunId:c().optional()});var be=d({status:l([`inbox`,`processed`,`archived`,`trashed`]).optional(),kind:l([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]).optional(),tag:c().max(512).optional(),projectId:c().min(1).max(512).optional(),unassigned:t().optional(),agentEdited:t().optional(),search:c().max(4096).optional(),pinned:t().optional(),limit:p().int().min(1).max(100).default(20),offset:p().int().min(0).default(0),sortBy:l([`createdAt`,`updatedAt`,`lastOpenedAt`]).optional(),sortOrder:l([`asc`,`desc`]).optional()}),J=s({id:c().min(1),markdown:c(),kind:l([`thought`,`todo`,`voice`,`media`,`bookmark`,`mixed`,`task`]),status:l([`inbox`,`processed`,`archived`,`trashed`]),createdAt:p(),updatedAt:p(),title:c().optional(),localVersion:p().optional()}),xe=r({note:J});q.extend({expectedRevision:p().int().positive(),revokeShares:t().default(!0)}),r({deleted:n(!0),revokedShares:p().int().nonnegative()});var Se=d({title:c().max(1e3).optional(),markdown:c().max(2e6).default(``),kind:J.shape.kind.optional(),tags:o(c().max(512)).max(100).optional(),capturedVia:d({channel:l([`app`,`web`,`electron`,`tui`,`telegram`,`wechat`,`feishu`]),platform:l([`ios`,`android`,`harmonyos`]).optional()}).default({channel:`web`}),pinned:t().default(!1),projectId:c().min(1).optional()});d({id:c().min(1),expectedRevision:p().int().positive(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]).optional(),patch:d({title:c().max(1e3).optional(),markdown:c().max(2e6).optional(),tags:o(c().max(512)).max(100).optional(),pinned:t().optional(),kind:J.shape.kind.optional(),status:J.shape.status.optional(),localVersion:p().int().positive().optional(),ai:i(c(),f()).optional(),aiDeep:s({processedAt:p()}).optional()})}),d({text:c().trim().min(1).max(2e6),capturedVia:Se.shape.capturedVia}),d({id:c().min(1),expectedRevision:p().int().positive().optional(),content:c().trim().min(1).max(2e6),heading:c().trim().min(1).max(1e3).default(`AI 讨论沉淀`)}),d({id:c().min(1),timestamp:p().int().positive(),expectedRevision:p().int().positive()});var Ce=s({items:o(s({id:c().min(1)})),total:p().int().nonnegative()}),we=d({phase:h.optional(),priority:g.optional(),projectId:c().min(1).max(512).optional(),search:c().max(4096).optional(),limit:p().int().min(1).max(200).default(50),offset:p().int().nonnegative().default(0)}),Y=s({id:c().min(1),name:c(),slug:c(),status:l([`planned`,`active`,`paused`,`completed`,`cancelled`,`archived`]),executionMode:l([`local_checkout`,`managed_worktree`]),successCriteria:o(c()),scope:i(c(),e()),nonGoals:o(c()),health:l([`unknown`,`on_track`,`at_risk`,`off_track`]),version:p().int().positive(),createdAt:p(),updatedAt:p(),workspaceRoot:c().optional(),defaultAgentId:c().optional()}),Te=d({id:c().trim().min(1),expectedVersion:p().int().positive(),pinned:t()});r({ok:n(!0),project:Y}),d({workspacePath:c().trim().min(1).max(4096),agentId:c().trim().min(1).max(512).optional(),defaultAgentId:c().trim().max(512).optional(),projectKind:l([`auto`,`coding`,`general`,`unknown`]).optional(),autoCreate:t().default(!1),conversationId:m().optional()}),r({ok:n(!0),project:Y.nullable(),reason:l([`exact`,`contained`,`auto_created`]).optional(),created:t().optional()}),Te.omit({pinned:!0}),r({ok:n(!0),deleted:n(!0),executionStopConfirmed:n(!1)});var X={name:c().trim().min(1).max(1e3).optional(),description:c().max(2e4).optional(),defaultAgentId:c().trim().max(512).optional(),workspaceRoot:c().trim().min(1).max(4096).optional(),createWorkspaceRoot:t().optional(),executionMode:Y.shape.executionMode.optional(),brief:c().max(2e4).optional(),instructions:c().max(1e5).optional(),outcome:c().max(2e4).optional(),successCriteria:o(c().max(4096)).max(100).optional(),scope:i(c(),f()).optional(),nonGoals:o(c().max(4096)).max(100).optional(),health:Y.shape.health.optional(),ownerId:c().max(512).optional(),targetAt:p().finite().optional()};d({...X,projectKind:l([`auto`,`coding`,`general`,`unknown`]).optional(),autoUnderstand:t().default(!1)}).refine(e=>!!(e.name||e.workspaceRoot),`name or workspaceRoot is required`),d({id:c().trim().min(1),expectedVersion:p().int().positive(),patch:d({...X,status:Y.shape.status.optional(),description:X.description.unwrap().nullable().optional(),defaultAgentId:X.defaultAgentId.unwrap().nullable().optional(),workspaceRoot:c().trim().max(4096).nullable().optional(),brief:X.brief.unwrap().nullable().optional(),instructions:X.instructions.unwrap().nullable().optional(),outcome:X.outcome.unwrap().nullable().optional(),ownerId:X.ownerId.unwrap().nullable().optional(),targetAt:X.targetAt.unwrap().nullable().optional()}).refine(e=>Object.values(e).some(e=>e!==void 0),`Empty project patch`)});var Ee=d({status:Y.shape.status.optional(),search:c().max(4096).optional(),sortBy:l([`updatedAt`,`createdAt`,`name`]).optional(),sortOrder:l([`asc`,`desc`]).optional(),limit:p().int().min(1).max(500).default(50),offset:p().int().nonnegative().default(0)}),Z=s({id:c(),projectId:c(),title:c(),status:l([`planned`,`active`,`completed`,`cancelled`]),sortOrder:p(),createdAt:p(),updatedAt:p()}),Q=s({id:c(),projectId:c(),summary:c(),health:Y.shape.health,createdAt:p()}),$={title:c().trim().min(1).max(1e3),description:c().max(2e4).optional(),status:Z.shape.status.optional(),targetAt:p().int().nonnegative().optional(),sortOrder:p().int().optional()};d({projectId:c().trim().min(1),...$}),d({projectId:c().trim().min(1),id:c().trim().min(1),expectedRevision:p().int().nonnegative(),patch:d({...$,description:c().max(2e4).nullable().optional(),targetAt:p().int().nonnegative().nullable().optional()}).partial().refine(e=>Object.values(e).some(e=>e!==void 0),`Empty milestone patch`)}).omit({patch:!0}),r({ok:n(!0),milestone:Z,project:Y}),r({ok:n(!0),deleted:n(!0)}),d({projectId:c().trim().min(1),expectedVersion:p().int().positive(),health:Y.shape.health,summary:c().trim().min(1).max(2e4),progress:o(c().max(1e4)).max(100).default([]),risks:o(c().max(1e4)).max(100).default([]),nextSteps:o(c().max(1e4)).max(100).default([])}),r({ok:n(!0),update:Q,project:Y});var De={"xopc.context.resolve":{input:S,output:oe},"xopc.notes.preview_edit":{input:q.extend({instruction:c().trim().min(1).max(16e3),markdown:c().max(2e6).optional(),context:s({type:l([`selection`,`section`,`block`,`note`]),range:d({start:p().int().nonnegative(),end:p().int().nonnegative()})}).optional()}),output:r({message:c(),patch:r({id:c(),summary:c(),operations:o(r({type:n(`replaceRange`),from:p().int().nonnegative(),to:p().int().nonnegative(),markdown:c()}))})})},"xopc.automations.get_run":{input:q.extend({waitMs:p().int().min(0).max(3e4).optional()}),output:r({ok:n(!0),run:O.loose()})},"xopc.automations.run_events":{input:q,output:r({ok:n(!0),events:o(k.loose())})},"xopc.automations.metrics":{input:d({}),output:r({ok:n(!0),metrics:ce})},"xopc.automations.events":{input:d({type:c().trim().min(1).max(512).optional(),source:c().trim().min(1).max(512).optional(),limit:p().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(r({event:r({id:c(),type:c(),schemaVersion:p().int(),source:c(),subject:r({kind:c(),id:c()}).optional(),payload:i(c(),e()),occurredAtMs:p(),ingestedAtMs:p(),correlationId:c(),causationId:c().optional(),rootEventId:c(),chainDepth:p().int(),dedupeKey:c().optional(),trust:l([`system`,`user`,`connector`,`untrusted_webhook`])}),projectionStatus:l([`pending`,`projecting`,`retrying`,`projected`,`dead_letter`]),projectionAttempts:p().int(),projectionError:c().optional(),deliveries:o(r({automationId:c(),status:l([`pending`,`retrying`,`queued`,`completed`,`failed`,`cancelled`,`skipped`,`dead_letter`]),runId:c().optional(),attempts:p().int(),lastError:c().optional()}))}))})},"xopc.automations.deliveries":{input:d({runId:c().trim().min(1).max(200).optional(),status:l([`pending`,`delivering`,`retrying`,`delivered`,`dead_letter`]).optional(),limit:p().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(r({runId:c(),destinationKey:c(),kind:c(),status:l([`pending`,`delivering`,`retrying`,`delivered`,`dead_letter`]),attempts:p().int(),nextAttemptAtMs:p(),lastError:c().optional(),createdAtMs:p(),updatedAtMs:p()}))})},"xopc.automations.product_events":{input:d({eventType:c().trim().min(1).max(512),source:c().trim().min(1).max(512).optional(),payloadKey:c().trim().min(1).max(512).optional(),payloadValue:c().max(4096).optional(),limit:p().int().min(1).max(100).default(10)}).refine(e=>e.payloadKey===void 0==(e.payloadValue===void 0),`payloadKey and payloadValue must be supplied together`),output:r({ok:n(!0),items:o(r({run:O.loose(),triggerEvent:k.loose()}))})},"xopc.automations.list":{input:d({projectId:c().trim().min(1).optional()}),output:r({ok:n(!0),items:o(D.loose()),projectId:c().optional(),executionSummaries:i(c(),r({unreadCount:p().int().nonnegative()})).optional()})},"xopc.automations.get":{input:q,output:r({ok:n(!0),automation:D.loose()})},"xopc.automations.history":{input:d({automationId:c().trim().min(1).optional(),projectId:c().trim().min(1).optional(),cursor:c().max(1024).optional(),limit:p().int().min(1).max(200).default(50)}),output:r({ok:n(!0),items:o(O.loose()),projectId:c().optional(),hasMore:t().optional(),nextCursor:c().optional()})},"xopc.settings.open":{input:d({section:c().trim().pipe(ge).default(`overview`),title:c().trim().min(1).max(512).default(`Settings`),summary:c().trim().max(4096).optional()}),output:r({ok:n(!0),settings:r({section:c(),title:c(),summary:c().optional()})})},"xopc.local_apps.list":{input:d({}),output:r({apps:o(x)})},"xopc.local_apps.get":{input:q,output:r({app:ae})},"xopc.local_apps.validate":{input:q,output:r({validation:ie})},"xopc.projects.get":{input:q,output:r({ok:n(!0),project:Y})},"xopc.projects.list":{input:Ee,output:s({ok:n(!0),items:o(Y),total:p().int().nonnegative()})},"xopc.projects.list_milestones":{input:q,output:r({ok:n(!0),projectId:c(),items:o(Z)})},"xopc.projects.list_updates":{input:q.extend({limit:p().int().min(1).max(500).default(20)}),output:r({ok:n(!0),projectId:c(),items:o(Q)})},"xopc.task_runs.get":{input:q,output:r({ok:n(!0),run:v,receipt:y.optional(),events:o(ne),activeWaits:o(b)})},"xopc.task_runs.list":{input:d({taskId:c().trim().min(1),limit:p().int().min(1).max(200).default(20)}),output:r({ok:n(!0),taskId:c(),items:o(v),receipts:o(y),activeWaits:o(b)})},"xopc.notes.project_summaries":{input:d({}),output:r({items:o(r({id:c(),name:c(),description:c().optional(),noteCount:p().int().nonnegative(),updatedAt:p().optional()}))})},"xopc.notes.history":{input:q,output:r({entries:o(r({timestamp:p().int().nonnegative(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]),snippet:c().optional()}))})},"xopc.notes.snapshot":{input:q.extend({timestamp:p().int().nonnegative()}),output:r({snapshot:r({noteId:c(),timestamp:p().int().nonnegative(),trigger:l([`edit`,`ai_edit`,`sync`,`restore`]),title:c().optional(),markdown:c(),tags:o(c()).optional(),kind:J.shape.kind,status:J.shape.status})})},"xopc.notes.get":{input:q,output:xe},"xopc.notes.list":{input:be,output:Ce},"xopc.tasks.metrics":{input:d({}),output:r({ok:n(!0),metrics:me})},"xopc.tasks.get":{input:q,output:_},"xopc.tasks.list":{input:we,output:te.extend({total:p().int().nonnegative()})}};export{de as a,j as c,fe as i,De as n,he as o,ye as r,P as s,_e as t};
@@ -1 +1 @@
1
- import{i as e,o as t}from"./locale-store-cg9cm2EL.js";import{n}from"./capabilities-kG175Q-7.js";async function r(r,i){let a=n[r],o=a.input.parse(i),s=`/api/capabilities/operations/${encodeURIComponent(r)}`,c=await t(e(s)),l=await t(e(`${s}/invocations`),{method:`POST`,body:JSON.stringify({majorVersion:c.majorVersion,descriptorDigest:c.descriptorDigest,input:o})});return a.output.parse(l.data)}export{r as t};
1
+ import{i as e,o as t}from"./locale-store-Dy1EByeG.js";import{n}from"./capabilities-DB713nRi.js";async function r(r,i){let a=n[r],o=a.input.parse(i),s=`/api/capabilities/operations/${encodeURIComponent(r)}`,c=await t(e(s)),l=await t(e(`${s}/invocations`),{method:`POST`,body:JSON.stringify({majorVersion:c.majorVersion,descriptorDigest:c.descriptorDigest,input:o})});return a.output.parse(l.data)}export{r as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/skills-page-FTd0Z7Ey.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/locale-store-Dy1EByeG.js","assets/messages-BAnhwALN.js","assets/dist-CY7CS_D3.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/briefcase-business-BsoCaI_t.js","assets/createLucideIcon-DPHK1VkS.js","assets/popover-select-CLsphyzA.js","assets/check-DUBLcKHA.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/skeleton-DzdOeGYz.js","assets/dist-GJ8-1PAx.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/code-xml-DJtYhZUF.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/file-archive-DanfQJNe.js","assets/file-text-D12HbeVy.js","assets/layers-mJW7JJKm.js","assets/loader-circle-CifKLtgG.js","assets/markdown-view-BlxIaCCQ.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/app-link-DImAfVs5.js","assets/product-delivery-BFfqdKLe.js","assets/schemas-CCWMleym.js","assets/local-apps-DeqzkJiF.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-DG8DDkEA.css","assets/palette-CDI0VweW.js","assets/refresh-cw-BRlGaq2w.js","assets/sparkles-DHlfQFAF.js","assets/trash-2-DusmjVPV.js","assets/triangle-alert-2JXFNNKU.js","assets/wrench-DFb4r8bH.js","assets/vendor-swr-CdRzEUwF.js","assets/gateway-config-swr-1Rk0LeEM.js","assets/chat-agents-api-CjlzCSmC.js","assets/button-Cc4hUNTt.js","assets/interaction-BdhHBbYa.js","assets/page-tabs-oeTY7z3_.js","assets/sliding-indicator-hwz0sx3h.js","assets/page-header-store-Bm8oxpFR.js","assets/use-async-resource-BHFGZCY2.js","assets/index.module-Cd9ENXfk.js","assets/dist-ZrL34Ps4.js","assets/command-palette-api-CP0F6sIm.js","assets/local-session-drafts-BIBHRkpM.js","assets/skill-wire-pattern-BPpeIcCi.js","assets/skill-list-api-1o_YRCu9.js","assets/skill-api-utils-C7V4JVXM.js","assets/capability-links-MZdYfPKx.js","assets/connection-usage-BhdQRWgQ.js","assets/capability-icon-CmvCZOJX.js","assets/capability-header-actions-BxMYfQ8y.js","assets/search-DA7gz22f.js","assets/use-media-query-ady-FgjK.js","assets/skill-reload-api-fGsO9Y86.js","assets/skill-api-BV8oFqeE.js","assets/connectors-page-DyzDVVfz.js","assets/service-recommendation-list-DDlMyPvC.js","assets/chevron-down-ccbiQQz_.js","assets/working-directory-picker-modal-BGZduAXV.js","assets/form-field-width-DJw_jULe.js","assets/settings-form-draft-Dy10ldo8.js","assets/circle-check-C23XjkUj.js","assets/key-round-DWbpyU2U.js","assets/install-connector-dialog-DxSv1wS2.js","assets/secret-input-DsjfQmDn.js","assets/copy-Dv6d4Dvw.js","assets/eye-CABVeTq0.js","assets/is-masked-secret-DOkL5b_X.js","assets/connectors-api-CTuVWwBf.js","assets/electron-env-DHOGevH3.js","assets/oauth-provider-connect-D63M8Iv7.js","assets/cloud-C4-yfnnk.js","assets/models-hub-cache-Bgh3Gfgl.js","assets/registry-api-DuDIthjL.js","assets/gateway-startup-retry-D6WPS0RW.js","assets/oauth-api-B560CHeD.js","assets/connection-usage-guide-Cibh2lrV.js","assets/package-wATCyihJ.js","assets/server-BlHCBjiE.js","assets/agent-plugin-dialog-CikzCYAG.js","assets/arrow-left-D880xG-P.js","assets/circle-alert-BEjgurr2.js","assets/circle-BoO4YvTx.js","assets/folder-open-CyzJ19I9.js","assets/shield-check-BU58siTV.js","assets/upload-rrb46c3c.js","assets/browser-BLJWD7WI.js","assets/extension-marketplace-api-BIzkukYp.js","assets/chevron-right-BweFrslA.js","assets/circle-pause-CN9jYH2s.js","assets/connector-filters-Cfcx9EA2.js","assets/clock-3-DnrAnuyZ.js","assets/database-CjjeZfRG.js","assets/plug-DKYPEgkR.js","assets/save-DRDABU--.js","assets/settings-uiTATseT.js","assets/store-SzD1Jvgm.js","assets/terminal-oKqqZdiG.js","assets/extension-provider-BPIoHw4r.js","assets/gateway-realtime-DIs1pjkQ.js","assets/gateway-realtime-store-sx7B8kdC.js","assets/theme-store-BaWep_o7.js","assets/middleware-Pd0e8Igk.js","assets/extension-message-router-C9JDpo_7.js","assets/session-manager-D2LaQymu.js","assets/constants-DpkUgykJ.js","assets/session-api-BFiIYodK.js","assets/tool-activity-BtJkgjFf.js","assets/attachment-utils-core-BIOUBrpT.js","assets/agents-admin-api-D0N09mqJ.js","assets/capabilities-DB713nRi.js","assets/tasks-BTLabOMp.js","assets/specialists-xbB3xL9e.js","assets/activity-store-CQHh48Zf.js","assets/sliding-tab-list-CmcrqRzN.js","assets/confirm-dialog-DrA5mTQp.js","assets/connector-service-page-Btz68iy8.js","assets/number-input-El7Szeln.js","assets/plugin-details-dialog-nSDw8sfo.js","assets/plugin-presentation-CO5BFDGW.js","assets/apps-page-M2XD1Pzu.js","assets/box-DvYoGszj.js","assets/extension-paths-DvuaZJuy.js","assets/agents-CGUdvmIT.js","assets/bot-DjLkhyZL.js","assets/heart-Cp4rgrqn.js","assets/message-square-plus-XP0tGdlV.js","assets/pencil-DmIY3Oa-.js","assets/rotate-ccw-JM1TBLpp.js","assets/sliders-horizontal-DqsYor6I.js","assets/new-session-preferences-gb411vZP.js","assets/agent-avatar-display-loBdGw_i.js","assets/loopi-CNtmi9FU.js","assets/loopi-C09I2mNj.css","assets/model-selector-C-CqPBao.js","assets/settings-2-D-csvaET.js","assets/open-capability-settings-DQsmJxI7.js","assets/model-sort-_Tz8s_4N.js","assets/agents-app-path-ciChvpCS.js","assets/agent-display-names-Bje7vfSn.js","assets/settings-advanced-section-B-H1gYOs.js","assets/settings-mode-store-YH60sibB.js","assets/settings-page-header-DEZZ8D0S.js","assets/settings-page-layout-De2j64Lo.js","assets/phone-model-picker-BOv3mb_F.js","assets/directory-picker-path-field-ByDqf5fE.js","assets/use-directory-picker-C4p7AgWY.js","assets/image-generation-api-sbtx4NiC.js","assets/channels-BDVQ6Z7A.js","assets/session-channel-icon-BzkFo-Ci.js","assets/git-branch-Dh9uxTot.js","assets/message-circle-Badhj-4D.js","assets/message-square-fVE7Ghj1.js","assets/zap-dximCGjy.js","assets/channels-routes-r2g-9DdC.js","assets/stethoscope-DRqTAtjD.js","assets/secret-input-labels-B5Jl5HqK.js","assets/navigation-ByOzYT0t.js","assets/refresh-button-DiWdGAaX.js","assets/extension-iframe-host-DIH4TcdH.js","assets/extension-authoritative-grants-BfL8dMBf.js","assets/settings-loading-skeleton-CAoOV17i.js","assets/schema-form-C9TYGa0_.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{f as a,m as o,r as s,u as c}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{n as l}from"./locale-store-Dy1EByeG.js";import{t as u}from"./messages-BAnhwALN.js";import{t as d}from"./skeleton-DzdOeGYz.js";import{r as f,t as p}from"./product-navigation-Dp-adLY_.js";import{t as m}from"./page-header-store-Bm8oxpFR.js";import{t as h}from"./capability-links-MZdYfPKx.js";import{t as g}from"./capability-header-actions-BxMYfQ8y.js";var _=n(),v=e(t(),1),y=r(),b=(0,v.lazy)(()=>i(()=>import(`./skills-page-FTd0Z7Ey.js`).then(e=>({default:e.SkillsPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70]))),ee=(0,v.lazy)(()=>i(()=>import(`./connectors-page-DyzDVVfz.js`).then(e=>({default:e.ConnectorsPage})),__vite__mapDeps([71,1,2,4,3,5,6,7,8,9,72,11,73,74,25,28,14,15,50,51,75,76,77,78,79,12,13,16,17,18,19,20,24,80,81,82,37,83,32,84,48,47,85,86,87,88,89,90,91,92,43,64,93,31,94,95,96,97,98,99,100,101,63,102,65,103,104,105,106,107,108,23,109,42,110,111,112,113,44,46,52,53,54,114,115,35,116,117,118,119,36,120,121,122,59,123,124,125,126,127,128,129,130,131,57,66,67,68,132,133]))),te=(0,v.lazy)(()=>i(()=>import(`./plugin-details-dialog-nSDw8sfo.js`).then(e=>({default:e.PluginDetailsDialog})),__vite__mapDeps([134,1,2,4,3,5,6,7,8,9,93,11,32,16,14,15,47,50,92,43,64,95,96,73,74,25,28,51,75,76,97,77,98,99,100,101,63,102,65,135]))),ne=(0,v.lazy)(()=>i(()=>import(`./apps-page-M2XD1Pzu.js`).then(e=>({default:e.ExtensionsPage})),__vite__mapDeps([136,1,2,4,3,5,6,7,8,9,96,11,137,138,23,24,28,29,22,30,31,32,14,15,33,34,35,36,37,38,39,40,93,111,100,44,45,16,47,115,116,50,51,52,53,54,114,117,118,119,120,121,122,90,59,123,124,89,125,48,126,127,128,129,76,57,18,19,95,73,74,25,75,97,77,98,99,101,63,64,102,65,103,66,67,17,68,135]))),re=(0,v.lazy)(()=>i(()=>import(`./agents-CGUdvmIT.js`).then(e=>({default:e.AgentsSettingsPanel})),__vite__mapDeps([139,1,2,3,4,5,6,7,8,9,140,11,10,12,13,14,15,16,17,18,19,20,21,23,82,141,29,22,30,31,32,33,34,35,36,37,38,39,40,142,143,144,111,145,45,101,128,146,47,48,89,90,125,50,51,117,118,52,53,147,148,149,130,131,57,150,151,152,75,153,154,155,156,157,68,133,158,24,43,159,160,161,74,25,28,76,162,163]))),ie=(0,v.lazy)(()=>i(()=>import(`./channels-BDVQ6Z7A.js`).then(e=>({default:e.ChannelsSettingsPanel})),__vite__mapDeps([164,1,2,4,3,5,6,7,8,9,12,11,13,14,15,16,17,18,19,20,97,77,24,28,165,107,166,167,168,109,151,113,169,35,170,144,171,45,32,47,49,48,50,51,172,173,174,42,175,117,118,114,115,116,119,36,120,121,122,90,59,123,124,89,125,126,127,128,129,76,176,155,177,102,156,157,158,43,159,178,80,81,82,37,75,83,133])));function ae(e){return p.includes(e)?e:null}function oe(e){let t=(0,_.c)(3),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Array.from({length:6},x),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,y.jsx)(`div`,{className:`mx-auto grid w-full max-w-7xl gap-4 px-4 pb-7 pt-3 sm:grid-cols-2 sm:px-6 lg:grid-cols-3 lg:px-8 lg:pb-9 lg:pt-4`,"aria-label":n,"aria-busy":!0,children:r}),t[1]=n,t[2]=i),i}function x(e,t){return(0,y.jsx)(d,{className:`h-40 rounded-xl`},t)}function S(){let e=(0,_.c)(65),t=l(T),n;e[0]===t?n=e[1]:(n=u(t),e[0]=t,e[1]=n);let r=n,i=r.capabilitiesHub,{section:d,detailId:x}=a(),[S]=o(),E=c(),D;e[2]===S?D=e[3]:(D=S.get(`plugin`),e[2]=S,e[3]=D);let O=D,k;e[4]!==E||e[5]!==S?(k=()=>{let e=new URLSearchParams(S);e.delete(`plugin`),e.delete(`connect`),E({search:e.toString()},{replace:!0,preventScrollReset:!0})},e[4]=E,e[5]=S,e[6]=k):k=e[6];let A=k,j;e[7]===d?j=e[8]:(j=ae(d),e[7]=d,e[8]=j);let M=j,N=M??p[0],P=r.productNavigation.sections[`capabilities-${N}`],F=m(w),I=m(C),L;e[9]===N?L=e[10]:(L={section:N,value:null},e[9]=N,e[10]=L);let[R,z]=(0,v.useState)(L),B=N===`extensions`&&x?null:R.section===N?R.value:null,V;e[11]===N?V=e[12]:(V=e=>{z({section:N,value:e})},e[11]=N,e[12]=V);let H=V,U,W;if(e[13]!==I||e[14]!==B||e[15]!==P||e[16]!==F?(U=()=>(F({startExtra:null,main:(0,y.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:P}),end:(0,y.jsx)(g,{contribution:B})}),()=>I()),W=[I,B,P,F],e[13]=I,e[14]=B,e[15]=P,e[16]=F,e[17]=U,e[18]=W):(U=e[17],W=e[18]),(0,v.useLayoutEffect)(U,W),N===`extensions`&&x){let t;e[19]===S?t=e[20]:(t=S.get(`from`)===`connections`?`connections`:S.get(`from`)===`skills`?`skills`:`installed`,e[19]=S,e[20]=t);let n;e[21]===S?n=e[22]:(n=S.get(`connect`),e[21]=S,e[22]=n);let r=n===`1`,i;e[23]!==x||e[24]!==S||e[25]!==r||e[26]!==t?(i=h(x,t,r,S.get(`returnTo`)??void 0),e[23]=x,e[24]=S,e[25]=r,e[26]=t,e[27]=i):i=e[27];let a;return e[28]===i?a=e[29]:(a=(0,y.jsx)(s,{replace:!0,to:i}),e[28]=i,e[29]=a),a}if(!M){let t;return e[30]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(s,{to:f(p[0]),replace:!0}),e[30]=t):t=e[30],t}let G;e[31]===i.discoverLoading?G=e[32]:(G=(0,y.jsx)(oe,{label:i.discoverLoading}),e[31]=i.discoverLoading,e[32]=G);let K;e[33]!==x||e[34]!==H||e[35]!==N?(K=N===`agents`?(0,y.jsx)(re,{agentId:x,onHeaderActionChange:H}):null,e[33]=x,e[34]=H,e[35]=N,e[36]=K):K=e[36];let q;e[37]!==H||e[38]!==N?(q=N===`skills`?(0,y.jsx)(b,{embedded:!0,onHeaderActionChange:H}):null,e[37]=H,e[38]=N,e[39]=q):q=e[39];let J;e[40]!==H||e[41]!==N?(J=N===`connectors`?(0,y.jsx)(ee,{embedded:!0,onHeaderActionChange:H}):null,e[40]=H,e[41]=N,e[42]=J):J=e[42];let Y;e[43]!==x||e[44]!==H||e[45]!==N?(Y=N===`channels`?(0,y.jsx)(ie,{channelId:x,onHeaderActionChange:H}):null,e[43]=x,e[44]=H,e[45]=N,e[46]=Y):Y=e[46];let X;e[47]!==H||e[48]!==N?(X=N===`extensions`?(0,y.jsx)(ne,{embedded:!0,onHeaderActionChange:H}):null,e[47]=H,e[48]=N,e[49]=X):X=e[49];let Z;e[50]!==N||e[51]!==q||e[52]!==J||e[53]!==Y||e[54]!==X||e[55]!==G||e[56]!==K?(Z=(0,y.jsxs)(v.Suspense,{fallback:G,children:[K,q,J,Y,X]},N),e[50]=N,e[51]=q,e[52]=J,e[53]=Y,e[54]=X,e[55]=G,e[56]=K,e[57]=Z):Z=e[57];let Q;e[58]!==A||e[59]!==O||e[60]!==S?(Q=O?(0,y.jsx)(v.Suspense,{fallback:null,children:(0,y.jsx)(te,{pluginId:O,initialConnect:S.get(`connect`)===`1`,onClose:A},O)}):null,e[58]=A,e[59]=O,e[60]=S,e[61]=Q):Q=e[61];let $;return e[62]!==Z||e[63]!==Q?($=(0,y.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,children:[Z,Q]}),e[62]=Z,e[63]=Q,e[64]=$):$=e[64],$}function C(e){return e.clearPageHeader}function w(e){return e.setPageHeader}function T(e){return e.language}export{S as CapabilitiesPage};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-swr-CdRzEUwF.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{f as a,l as o,m as s,r as c,t as l}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as u,i as d,l as f,n as p,o as m}from"./locale-store-cg9cm2EL.js";import{t as h}from"./messages-eQ2CYlpG.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./dist-CY7CS_D3.js";import{t as C}from"./arrow-right-DSSvoX71.js";import{t as w}from"./arrow-up-right-T72JbQ1Q.js";import{t as T}from"./chevron-right-BweFrslA.js";import{n as E,r as D,t as O}from"./popover-select-CLsphyzA.js";import{t as k}from"./circle-check-C23XjkUj.js";import{C as A,S as j,T as M,_ as N,a as P,b as F,c as I,d as L,f as ee,g as R,h as z,i as B,l as V,m as H,n as te,o as ne,p as U,r as re,s as W,t as ie,u as ae,v as oe,w as se,x as G,y as ce}from"./connected-providers-grid-D_8v6Qex.js";import{t as K}from"./cloud-C4-yfnnk.js";import{t as le}from"./external-link-DjqjBmc3.js";import{t as ue}from"./secret-input-DsjfQmDn.js";import{t as de}from"./eye-CABVeTq0.js";import{t as q}from"./image-Cwyalflz.js";import{t as fe}from"./key-round-DWbpyU2U.js";import{t as pe}from"./loader-circle-CifKLtgG.js";import{t as me}from"./pencil-DmIY3Oa-.js";import{t as he}from"./plug-DKYPEgkR.js";import{t as ge}from"./plus-Q2yW6OE7.js";import{t as _e}from"./refresh-cw-BRlGaq2w.js";import{t as ve}from"./settings-2-D-csvaET.js";import{t as ye}from"./shield-check-BU58siTV.js";import{t as be}from"./sliders-horizontal-DqsYor6I.js";import{t as xe}from"./trash-2-DusmjVPV.js";import{t as Se}from"./triangle-alert-2JXFNNKU.js";import{t as Ce}from"./wrench-DFb4r8bH.js";import{t as we}from"./x-B_N4OPjy.js";import{t as J}from"./cn-0WouolD0.js";import{t as Y}from"./skeleton-DzdOeGYz.js";import{t as Te}from"./voice-CDlC6XMH.js";import{i as X}from"./vendor-swr-CdRzEUwF.js";import{n as Ee,r as De}from"./gateway-config-swr-OGhON-s6.js";import{n as Oe,t as ke}from"./registry-api-BTd_OgbD.js";import{t as Z}from"./button-Cc4hUNTt.js";import{i as Ae,o as je}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as Me}from"./open-capability-settings-DQsmJxI7.js";import{n as Ne,t as Pe}from"./interaction-BdhHBbYa.js";import{n as Fe,t as Ie}from"./voice-settings-DA3m5MT0.js";import{a as Le,o as Re,s as ze}from"./form-field-width-DJw_jULe.js";import{n as Be}from"./is-masked-secret-DOkL5b_X.js";import{n as Ve,t as He}from"./secret-input-labels-B5Jl5HqK.js";import{a as Ue}from"./navigation-ByOzYT0t.js";import{t as We}from"./electron-env-DHOGevH3.js";import{n as Ge,t as Ke}from"./settings-form-draft-Dy10ldo8.js";import{t as qe}from"./sliding-tab-list-CmcrqRzN.js";import{t as Je}from"./confirm-dialog-DrA5mTQp.js";import{n as Ye,t as Xe}from"./model-sort-_Tz8s_4N.js";import{n as Ze,r as Qe}from"./model-selector-CL6WT-jw.js";import{n as $e}from"./agents-app-path-ciChvpCS.js";import{n as et,t as tt}from"./global-defaults-api-BIr3ApRj.js";import{t as nt}from"./settings-loading-skeleton-CAoOV17i.js";import{i as rt,n as it,r as at,t as ot}from"./capability-navigation-QtHJxxW2.js";import{i as st,r as ct,t as lt}from"./models-hub-cache-s0FMNhq9.js";import{a as ut,r as dt,s as ft,t as pt}from"./providers-api-DUntOOqr.js";import{a as mt,i as ht,n as gt,o as _t,r as vt,t as yt}from"./oauth-api-CvPnQTlH.js";import{t as bt}from"./settings-advanced-section-C6dPu5i1.js";import{n as xt,r as St,t as Ct}from"./oauth-authorization-window-o6URRos4.js";import{t as wt}from"./number-input-El7Szeln.js";import{n as Tt,t as Et}from"./settings-page-header-BSMu5Zq3.js";import"./settings-page-layout-B_vMffB1.js";import{n as Dt,t as Ot}from"./settings-form-section-num14vSv.js";import{n as kt,t as At}from"./use-autosave-CO0IPCVg.js";import{c as jt,h as Mt,l as Nt,n as Pt,o as Ft,t as It}from"./voice-config-api-GIuXoHXw.js";import{a as Lt,i as Rt,n as zt,o as Bt,r as Vt,s as Ht,t as Ut}from"./image-generation-api-C7D2IetZ.js";import{t as Wt}from"./xopc-cloud-account-card-x-XT4bKF.js";var Gt=n(),Q=e(t(),1),$=r(),Kt={en:{addTitle:`Add image service`,editTitle:`Manage image service`,intro:`Connect an endpoint that implements the OpenAI Images protocol.`,connection:`Connection`,providerId:`Provider ID`,providerIdHint:`Lowercase letters, numbers, hyphens, or underscores.`,name:`Display name`,baseUrl:`Base URL`,auth:`Authentication`,bearer:`Bearer token`,header:`Custom API key header`,none:`No authentication`,headerName:`Header name`,apiKey:`API key`,apiKeyHint:`Stored in the local credential store, separate from models.json.`,apiKeyUrl:`API key page (optional)`,docsUrl:`Documentation page (optional)`,openKeyPage:`Create API key`,paths:`Protocol and network`,generationsPath:`Generations path`,editsPath:`Edits path`,allowedHosts:`Allowed private hosts (optional)`,allowedHostsHint:`One exact hostname or IP per line. Private endpoints stay blocked unless listed here.`,staticHeaders:`Static headers (optional)`,staticHeadersHint:`One per line: X-Tenant: value. Credential headers are rejected.`,models:`Image models`,addModel:`Add model`,modelId:`Model ID`,modelName:`Name (optional)`,defaultModel:`Default model`,maxCount:`Max images`,defaultCount:`Default count`,defaultSize:`Default size`,format:`Output format`,supportsSize:`Supports size`,edit:`Supports edits`,remove:`Remove`,cancel:`Cancel`,save:`Save service`,saving:`Saving…`,test:`Test generation`,testing:`Generating…`,delete:`Delete service`,confirmDelete:`Delete permanently`,saved:`Image service saved.`,deleted:`Image service deleted.`,testReady:`Test image generated.`,show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`,revealFailed:`Unable to reveal the saved key.`,notRevealable:`No revealable key is stored locally.`,required:`Complete the required connection and model fields.`,duplicateModels:`Model IDs must be unique.`,invalidHeaders:`Static headers must use “Name: value”, one per line.`},zh:{addTitle:`添加图片服务`,editTitle:`管理图片服务`,intro:`连接一个严格实现 OpenAI Images 协议的服务端点。`,connection:`连接信息`,providerId:`Provider ID`,providerIdHint:`仅支持小写字母、数字、连字符和下划线。`,name:`显示名称`,baseUrl:`Base URL`,auth:`认证方式`,bearer:`Bearer Token`,header:`自定义 API Key Header`,none:`无需认证`,headerName:`Header 名称`,apiKey:`API Key`,apiKeyHint:`密钥单独保存在本机凭据存储,不写入 models.json。`,apiKeyUrl:`API Key 创建页面(可选)`,docsUrl:`协议文档页面(可选)`,openKeyPage:`去创建 API Key`,paths:`协议与网络`,generationsPath:`生成路径`,editsPath:`编辑路径`,allowedHosts:`允许访问的私有主机(可选)`,allowedHostsHint:`每行一个精确主机名或 IP;未列出的私网端点保持阻止。`,staticHeaders:`静态 Headers(可选)`,staticHeadersHint:`每行一个:X-Tenant: value。认证 Header 会被拒绝。`,models:`图片模型`,addModel:`添加模型`,modelId:`模型 ID`,modelName:`名称(可选)`,defaultModel:`默认模型`,maxCount:`单次最大张数`,defaultCount:`默认张数`,defaultSize:`默认尺寸`,format:`输出格式`,supportsSize:`支持尺寸参数`,edit:`支持图片编辑`,remove:`移除`,cancel:`取消`,save:`保存服务`,saving:`保存中…`,test:`测试生成`,testing:`生成中…`,delete:`删除服务`,confirmDelete:`确认永久删除`,saved:`图片服务已保存。`,deleted:`图片服务已删除。`,testReady:`测试图片生成成功。`,show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`,revealFailed:`无法查看已保存的密钥。`,notRevealable:`本机没有可查看的密钥。`,required:`请补全必填的连接和模型信息。`,duplicateModels:`模型 ID 不能重复。`,invalidHeaders:`静态 Header 必须使用“名称: 值”格式,每行一个。`}},qt=`mt-1.5 h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`;function Jt(e){let t=e??{id:``,capabilities:{generate:{maxCount:1,supportsSize:!0},edit:{enabled:!1}}};return{original:t,id:t.id,name:t.name??``,maxCount:String(t.capabilities.generate?.maxCount??1),defaultCount:t.defaults?.count?String(t.defaults.count):``,defaultSize:t.defaults?.size??``,outputFormat:t.defaults?.outputFormat??``,supportsSize:t.capabilities.generate?.supportsSize??!1,editEnabled:t.capabilities.edit?.enabled??!1}}function Yt(e){let t=e.split(`
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{f as a,l as o,m as s,r as c,t as l}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{a as u,i as d,l as f,n as p,o as m}from"./locale-store-Dy1EByeG.js";import{t as h}from"./messages-BAnhwALN.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as S}from"./dist-CY7CS_D3.js";import{t as C}from"./arrow-right-DSSvoX71.js";import{t as w}from"./arrow-up-right-T72JbQ1Q.js";import{t as T}from"./chevron-right-BweFrslA.js";import{n as E,r as D,t as O}from"./popover-select-CLsphyzA.js";import{t as k}from"./circle-check-C23XjkUj.js";import{C as A,S as j,T as M,_ as N,a as P,b as F,c as I,d as L,f as ee,g as R,h as z,i as B,l as V,m as H,n as te,o as ne,p as U,r as re,s as W,t as ie,u as ae,v as oe,w as se,x as G,y as ce}from"./connected-providers-grid-CZ-FXxaW.js";import{t as K}from"./cloud-C4-yfnnk.js";import{t as le}from"./external-link-DjqjBmc3.js";import{t as ue}from"./secret-input-DsjfQmDn.js";import{t as de}from"./eye-CABVeTq0.js";import{t as q}from"./image-Cwyalflz.js";import{t as fe}from"./key-round-DWbpyU2U.js";import{t as pe}from"./loader-circle-CifKLtgG.js";import{t as me}from"./pencil-DmIY3Oa-.js";import{t as he}from"./plug-DKYPEgkR.js";import{t as ge}from"./plus-Q2yW6OE7.js";import{t as _e}from"./refresh-cw-BRlGaq2w.js";import{t as ve}from"./settings-2-D-csvaET.js";import{t as ye}from"./shield-check-BU58siTV.js";import{t as be}from"./sliders-horizontal-DqsYor6I.js";import{t as xe}from"./trash-2-DusmjVPV.js";import{t as Se}from"./triangle-alert-2JXFNNKU.js";import{t as Ce}from"./wrench-DFb4r8bH.js";import{t as we}from"./x-B_N4OPjy.js";import{t as J}from"./cn-0WouolD0.js";import{t as Y}from"./skeleton-DzdOeGYz.js";import{t as Te}from"./voice-CDlC6XMH.js";import{i as X}from"./vendor-swr-CdRzEUwF.js";import{n as Ee,r as De}from"./gateway-config-swr-1Rk0LeEM.js";import{n as Oe,t as ke}from"./registry-api-DuDIthjL.js";import{t as Z}from"./button-Cc4hUNTt.js";import{i as Ae,o as je}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as Me}from"./open-capability-settings-DQsmJxI7.js";import{n as Ne,t as Pe}from"./interaction-BdhHBbYa.js";import{n as Fe,t as Ie}from"./voice-settings-BiqJ0tlf.js";import{a as Le,o as Re,s as ze}from"./form-field-width-DJw_jULe.js";import{n as Be}from"./is-masked-secret-DOkL5b_X.js";import{n as Ve,t as He}from"./secret-input-labels-B5Jl5HqK.js";import{a as Ue}from"./navigation-ByOzYT0t.js";import{t as We}from"./electron-env-DHOGevH3.js";import{n as Ge,t as Ke}from"./settings-form-draft-Dy10ldo8.js";import{t as qe}from"./sliding-tab-list-CmcrqRzN.js";import{t as Je}from"./confirm-dialog-DrA5mTQp.js";import{n as Ye,t as Xe}from"./model-sort-_Tz8s_4N.js";import{n as Ze,r as Qe}from"./model-selector-C-CqPBao.js";import{n as $e}from"./agents-app-path-ciChvpCS.js";import{n as et,t as tt}from"./global-defaults-api-BpDMnJe7.js";import{t as nt}from"./settings-loading-skeleton-CAoOV17i.js";import{i as rt,n as it,r as at,t as ot}from"./capability-navigation-QtHJxxW2.js";import{i as st,r as ct,t as lt}from"./models-hub-cache-Bgh3Gfgl.js";import{a as ut,r as dt,s as ft,t as pt}from"./providers-api-Nytkkop9.js";import{a as mt,i as ht,n as gt,o as _t,r as vt,t as yt}from"./oauth-api-B560CHeD.js";import{t as bt}from"./settings-advanced-section-B-H1gYOs.js";import{n as xt,r as St,t as Ct}from"./oauth-authorization-window-o6URRos4.js";import{t as wt}from"./number-input-El7Szeln.js";import{n as Tt,t as Et}from"./settings-page-header-DEZZ8D0S.js";import"./settings-page-layout-De2j64Lo.js";import{n as Dt,t as Ot}from"./settings-form-section-num14vSv.js";import{n as kt,t as At}from"./use-autosave-N_SjHXTw.js";import{c as jt,h as Mt,l as Nt,n as Pt,o as Ft,t as It}from"./voice-config-api-DhJ3l8fk.js";import{a as Lt,i as Rt,n as zt,o as Bt,r as Vt,s as Ht,t as Ut}from"./image-generation-api-sbtx4NiC.js";import{t as Wt}from"./xopc-cloud-account-card-Q_jezTUy.js";var Gt=n(),Q=e(t(),1),$=r(),Kt={en:{addTitle:`Add image service`,editTitle:`Manage image service`,intro:`Connect an endpoint that implements the OpenAI Images protocol.`,connection:`Connection`,providerId:`Provider ID`,providerIdHint:`Lowercase letters, numbers, hyphens, or underscores.`,name:`Display name`,baseUrl:`Base URL`,auth:`Authentication`,bearer:`Bearer token`,header:`Custom API key header`,none:`No authentication`,headerName:`Header name`,apiKey:`API key`,apiKeyHint:`Stored in the local credential store, separate from models.json.`,apiKeyUrl:`API key page (optional)`,docsUrl:`Documentation page (optional)`,openKeyPage:`Create API key`,paths:`Protocol and network`,generationsPath:`Generations path`,editsPath:`Edits path`,allowedHosts:`Allowed private hosts (optional)`,allowedHostsHint:`One exact hostname or IP per line. Private endpoints stay blocked unless listed here.`,staticHeaders:`Static headers (optional)`,staticHeadersHint:`One per line: X-Tenant: value. Credential headers are rejected.`,models:`Image models`,addModel:`Add model`,modelId:`Model ID`,modelName:`Name (optional)`,defaultModel:`Default model`,maxCount:`Max images`,defaultCount:`Default count`,defaultSize:`Default size`,format:`Output format`,supportsSize:`Supports size`,edit:`Supports edits`,remove:`Remove`,cancel:`Cancel`,save:`Save service`,saving:`Saving…`,test:`Test generation`,testing:`Generating…`,delete:`Delete service`,confirmDelete:`Delete permanently`,saved:`Image service saved.`,deleted:`Image service deleted.`,testReady:`Test image generated.`,show:`Show key`,hide:`Hide key`,copy:`Copy key`,copied:`Copied`,revealFailed:`Unable to reveal the saved key.`,notRevealable:`No revealable key is stored locally.`,required:`Complete the required connection and model fields.`,duplicateModels:`Model IDs must be unique.`,invalidHeaders:`Static headers must use “Name: value”, one per line.`},zh:{addTitle:`添加图片服务`,editTitle:`管理图片服务`,intro:`连接一个严格实现 OpenAI Images 协议的服务端点。`,connection:`连接信息`,providerId:`Provider ID`,providerIdHint:`仅支持小写字母、数字、连字符和下划线。`,name:`显示名称`,baseUrl:`Base URL`,auth:`认证方式`,bearer:`Bearer Token`,header:`自定义 API Key Header`,none:`无需认证`,headerName:`Header 名称`,apiKey:`API Key`,apiKeyHint:`密钥单独保存在本机凭据存储,不写入 models.json。`,apiKeyUrl:`API Key 创建页面(可选)`,docsUrl:`协议文档页面(可选)`,openKeyPage:`去创建 API Key`,paths:`协议与网络`,generationsPath:`生成路径`,editsPath:`编辑路径`,allowedHosts:`允许访问的私有主机(可选)`,allowedHostsHint:`每行一个精确主机名或 IP;未列出的私网端点保持阻止。`,staticHeaders:`静态 Headers(可选)`,staticHeadersHint:`每行一个:X-Tenant: value。认证 Header 会被拒绝。`,models:`图片模型`,addModel:`添加模型`,modelId:`模型 ID`,modelName:`名称(可选)`,defaultModel:`默认模型`,maxCount:`单次最大张数`,defaultCount:`默认张数`,defaultSize:`默认尺寸`,format:`输出格式`,supportsSize:`支持尺寸参数`,edit:`支持图片编辑`,remove:`移除`,cancel:`取消`,save:`保存服务`,saving:`保存中…`,test:`测试生成`,testing:`生成中…`,delete:`删除服务`,confirmDelete:`确认永久删除`,saved:`图片服务已保存。`,deleted:`图片服务已删除。`,testReady:`测试图片生成成功。`,show:`显示密钥`,hide:`隐藏密钥`,copy:`复制密钥`,copied:`已复制`,revealFailed:`无法查看已保存的密钥。`,notRevealable:`本机没有可查看的密钥。`,required:`请补全必填的连接和模型信息。`,duplicateModels:`模型 ID 不能重复。`,invalidHeaders:`静态 Header 必须使用“名称: 值”格式,每行一个。`}},qt=`mt-1.5 h-10 w-full rounded-lg border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`;function Jt(e){let t=e??{id:``,capabilities:{generate:{maxCount:1,supportsSize:!0},edit:{enabled:!1}}};return{original:t,id:t.id,name:t.name??``,maxCount:String(t.capabilities.generate?.maxCount??1),defaultCount:t.defaults?.count?String(t.defaults.count):``,defaultSize:t.defaults?.size??``,outputFormat:t.defaults?.outputFormat??``,supportsSize:t.capabilities.generate?.supportsSize??!1,editEnabled:t.capabilities.edit?.enabled??!1}}function Yt(e){let t=e.split(`
3
3
  `).map(e=>e.trim()).filter(Boolean);if(t.length===0)return;let n=t.map(e=>{let t=e.indexOf(`:`);if(t<=0||!e.slice(t+1).trim())throw Error(`invalid_headers`);return[e.slice(0,t).trim(),e.slice(t+1).trim()]});return Object.fromEntries(n)}function Xt({open:e,onOpenChange:t,provider:n,configured:r,language:i,onSaved:a,portalContainer:o,onPendingChange:s}){let c=Kt[i],[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(``),[h,C]=(0,Q.useState)(`bearer`),[T,E]=(0,Q.useState)(`x-api-key`),[D,k]=(0,Q.useState)(``),[A,j]=(0,Q.useState)(``),[M,N]=(0,Q.useState)(``),[P,F]=(0,Q.useState)(`/images/generations`),[I,L]=(0,Q.useState)(`/images/edits`),[ee,R]=(0,Q.useState)(``),[z,B]=(0,Q.useState)(``),[V,H]=(0,Q.useState)([Jt()]),[te,ne]=(0,Q.useState)(``),[U,re]=(0,Q.useState)(),[W,ie]=(0,Q.useState)(!1),[ae,oe]=(0,Q.useState)(),[se,G]=(0,Q.useState)(),[ce,K]=(0,Q.useState)();(0,Q.useEffect)(()=>(s?.(!!U),()=>s?.(!1)),[U,s]),(0,Q.useEffect)(()=>{if(!e)return;let t=n?.imageGeneration;u(n?.providerId??``),f(t?.name??``),m(n?.baseUrl??``),C(t?.auth.type??`bearer`),E(t?.auth.type===`header`?t.auth.headerName:`x-api-key`),k(r?`••••••••••••`:``),j(t?.apiKeyUrl??``),N(t?.documentationUrl??``),F(t?.paths?.generations??`/images/generations`),L(t?.paths?.edits??`/images/edits`),R(t?.network?.allowedHosts.join(`
4
4
  `)??``),B(Object.entries(n?.headers??{}).map(([e,t])=>`${e}: ${t}`).join(`
5
5
  `)),H(t?.models.map(Jt)??[Jt()]),ne(t?.defaultModel??``),G(void 0),re(void 0),ie(!1),oe(void 0),K(void 0)},[r,e,n]);let le=(0,Q.useMemo)(()=>V.filter(e=>e.id.trim()).sort(Ye).map(e=>({value:e.id.trim(),label:e.name.trim()||e.id.trim()})),[V]),q=(e,t)=>{H(n=>n.map((n,r)=>r===e?{...n,...t}:n))},fe=()=>{let e=l.trim(),t=V.map(e=>({...e,id:e.id.trim(),name:e.name.trim()}));if(!e||!d.trim()||!p.trim()||t.some(e=>!e.id))throw Error(c.required);if(new Set(t.map(e=>e.id)).size!==t.length)throw Error(c.duplicateModels);let n=te||t[0]?.id;if(!n||!t.some(e=>e.id===n))throw Error(c.required);let r;try{r=Yt(z)}catch{throw Error(c.invalidHeaders)}return{providerId:e,input:{baseUrl:p.trim(),...r?{headers:r}:{},imageGeneration:{api:`openai-images`,name:d.trim(),...M.trim()?{documentationUrl:M.trim()}:{},...A.trim()?{apiKeyUrl:A.trim()}:{},defaultModel:n,auth:h===`header`?{type:`header`,headerName:T.trim()}:{type:h},paths:{...P.trim()?{generations:P.trim()}:{},...I.trim()?{edits:I.trim()}:{}},...ee.trim()?{network:{allowedHosts:ee.split(`