decocms 2.367.13 → 2.367.25

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 (225) hide show
  1. package/dist/client/assets/{AlertCircle-BT4KzWnI.js → AlertCircle-B5W8e_5w.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-DL6IklHf.js → ArrowNarrowLeft-hiT9EAxM.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-CuD8Ec0Q.js → ArrowUpRight-BngWaIVR.js} +1 -1
  4. package/dist/client/assets/{Check-BwR-n-sF.js → Check-8Z25AyId.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-CeozB0CE.js → CheckCircle-BEasBYv4.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-NgrGgemj.js → ChevronDown-DYIWk9ra.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DzTdh7eY.js → ChevronRight-C956u55G.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-O1681VYk.js → ChevronUp-CdhHmg9Y.js} +1 -1
  9. package/dist/client/assets/{Container-2b4BXA-n.js → Container-eQJj-j5B.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DwV108_Y.js → DotsVertical-BY4pEp3W.js} +1 -1
  11. package/dist/client/assets/{FilterLines-DOivCNH_.js → FilterLines-z8ejuVIV.js} +1 -1
  12. package/dist/client/assets/{HardDrive-Cj4eW7va.js → HardDrive-C5cYoT_u.js} +1 -1
  13. package/dist/client/assets/{Key01-BQUJeWtG.js → Key01-D616GLzE.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-BtnBeX4Q.js → LayoutLeft-_rPJ3Xdj.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-gSnFHviP.js → LinkExternal01-DxWXfBDh.js} +1 -1
  16. package/dist/client/assets/{Lock01-CLcwdBbZ.js → Lock01-BCib8CWc.js} +1 -1
  17. package/dist/client/assets/{Monitor01-B72KxmOA.js → Monitor01-Bz4VCJsr.js} +1 -1
  18. package/dist/client/assets/{Palette-CDAteqS3.js → Palette-Vm3-5yKD.js} +1 -1
  19. package/dist/client/assets/{Play-3lq0IL_j.js → Play-CKvhUVKq.js} +1 -1
  20. package/dist/client/assets/{Plus-CuU_Vn1V.js → Plus-CpQnzuG3.js} +1 -1
  21. package/dist/client/assets/{RefreshCcw01-DYeBzgxl.js → RefreshCcw01-B7Js0dD2.js} +1 -1
  22. package/dist/client/assets/{SearchMd-YL-AZ1_e.js → SearchMd-D0mvaU5_.js} +1 -1
  23. package/dist/client/assets/{Settings02-CmAK-JQC.js → Settings02-CNt0vvEu.js} +1 -1
  24. package/dist/client/assets/{Shield01-DWmt0CsN.js → Shield01-CZAvPXer.js} +1 -1
  25. package/dist/client/assets/{Star01-B9_yj21o.js → Star01-CEifhmiR.js} +1 -1
  26. package/dist/client/assets/{Stars02-DjyZ6rm8.js → Stars02-M_tqgIvg.js} +1 -1
  27. package/dist/client/assets/{Sun-D3nbZYnT.js → Sun-Ch8hbN6j.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-CoAD8Pso.js → SwitchHorizontal01-CJw113gN.js} +1 -1
  29. package/dist/client/assets/{Tool01-Cr9-Ayar.js → Tool01-CbzoidXH.js} +1 -1
  30. package/dist/client/assets/{Trash01-Bdgng8Ny.js → Trash01-CUZkoYoW.js} +1 -1
  31. package/dist/client/assets/{Upload01-DEH4hqbP.js → Upload01-DaqpbIUH.js} +1 -1
  32. package/dist/client/assets/{User01-DvR2FzxS.js → User01-CtOhLzXW.js} +1 -1
  33. package/dist/client/assets/{Users01-DKVYUvbH.js → Users01-DQVYpyq7.js} +1 -1
  34. package/dist/client/assets/{Users03-BScPbfBT.js → Users03-DGJmr08f.js} +1 -1
  35. package/dist/client/assets/{X-BpMfki2j.js → X-Coa3_vHC.js} +1 -1
  36. package/dist/client/assets/{XCircle-D4gl9x0F.js → XCircle-DvYTE78y.js} +1 -1
  37. package/dist/client/assets/{XClose-8wwGH-xu.js → XClose-wy0ZjI4q.js} +1 -1
  38. package/dist/client/assets/{Zap-DGOMtCmx.js → Zap-B74dlfsg.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-C-QuJXiX.js → ZapSquare-BQ8gms0B.js} +1 -1
  40. package/dist/client/assets/{accordion-D87rF_9b.js → accordion-6vou0XmS.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-cS9loTSU.js → add-connection-dialog-DopFZPio.js} +1 -1
  42. package/dist/client/assets/{agent-icon-BbgplFYb.js → agent-icon-CPWEcMkW.js} +1 -1
  43. package/dist/client/assets/{agent-icons-D769sO2y.js → agent-icons-DbyclYUt.js} +1 -1
  44. package/dist/client/assets/{agents-list-BqvI6z2f.js → agents-list-B_iou2CS.js} +1 -1
  45. package/dist/client/assets/{ai-providers-B7Nlf_fJ.js → ai-providers-jnOr5scM.js} +1 -1
  46. package/dist/client/assets/{alert-WZR80uYd.js → alert-DSWorcln.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-CBfLU0-s.js → alert-dialog-jgkN1ow8.js} +1 -1
  48. package/dist/client/assets/{auth-catchall-drkgEnQI.js → auth-catchall-CibJUhS5.js} +1 -1
  49. package/dist/client/assets/{auth-split-layout-D19kU-YG.js → auth-split-layout-B_0OwIje.js} +1 -1
  50. package/dist/client/assets/{automation-list-row-D0ThPhss.js → automation-list-row-CBG4CRxM.js} +1 -1
  51. package/dist/client/assets/{automations-Cat5ivvi.js → automations-CtXXn5AE.js} +1 -1
  52. package/dist/client/assets/{avatar-DeKO2t6e.js → avatar-vA2R8qEK.js} +1 -1
  53. package/dist/client/assets/{badge-DYaA3f0o.js → badge-BFpOlUFq.js} +1 -1
  54. package/dist/client/assets/{brand-context-McBQ2_gj.js → brand-context-DSMoHChs.js} +1 -1
  55. package/dist/client/assets/{card-CzmU6DPx.js → card-Cd_hFdRe.js} +1 -1
  56. package/dist/client/assets/{chat-context-DsnxmnaH.js → chat-context-B5utwD_j.js} +1 -1
  57. package/dist/client/assets/{checkbox-VBT4OFjs.js → checkbox-cX_blfQo.js} +1 -1
  58. package/dist/client/assets/{cli-auth-success-BXNlJk3J.js → cli-auth-success-DRutP4ab.js} +1 -1
  59. package/dist/client/assets/{collection-detail-CNmVClMC.js → collection-detail-BtSEt034.js} +1 -1
  60. package/dist/client/assets/{collection-display-button-DO9Uub4Z.js → collection-display-button-DMY0cf-y.js} +1 -1
  61. package/dist/client/assets/{collection-search-CgHA_hw5.js → collection-search-CLSVS08U.js} +1 -1
  62. package/dist/client/assets/{collection-search-ZgHJOBo2.js → collection-search-XjYetQA3.js} +1 -1
  63. package/dist/client/assets/{collection-table-wrapper-DrLHkx2B.js → collection-table-wrapper-CqVfrSyn.js} +1 -1
  64. package/dist/client/assets/{collection-tabs-DW8sLdGn.js → collection-tabs-Cq1YLx0H.js} +1 -1
  65. package/dist/client/assets/{collections-DVQWcwMA.js → collections-DXz0tqzt.js} +1 -1
  66. package/dist/client/assets/{command-Cdu-1z9q.js → command-C_TH6iOa.js} +1 -1
  67. package/dist/client/assets/{connect-desktop-dialog-CejAAfIG.js → connect-desktop-dialog-CiOZeQs6.js} +1 -1
  68. package/dist/client/assets/{connection-card-kJpbPjBb.js → connection-card-BXYnxALA.js} +1 -1
  69. package/dist/client/assets/{connection-detail-D6x_V51B.js → connection-detail-DV4Eb2Ak.js} +1 -1
  70. package/dist/client/assets/{connection-form-helpers-Dg3964lu.js → connection-form-helpers-DNLR-aHd.js} +1 -1
  71. package/dist/client/assets/{connections-0_RrcJiG.js → connections-JdhjKCmC.js} +1 -1
  72. package/dist/client/assets/{constants-BwYc8BqM.js → constants-oggaZSfP.js} +1 -1
  73. package/dist/client/assets/{decopilot-sse-pool-B9BzYuaT.js → decopilot-sse-pool-atg0HfN2.js} +1 -1
  74. package/dist/client/assets/{dialog-TcaoJB0K.js → dialog-B_fGUV_0.js} +1 -1
  75. package/dist/client/assets/{domain-settings-BnZTuy7Y.js → domain-settings-CAp7ZsSN.js} +1 -1
  76. package/dist/client/assets/{drawer-Db2QUt1V.js → drawer-B6wZPR31.js} +1 -1
  77. package/dist/client/assets/{dropdown-menu-C_xsx5zL.js → dropdown-menu-BUe1eS9C.js} +1 -1
  78. package/dist/client/assets/{dynamic-plugin-layout-B1AK4Qfp.js → dynamic-plugin-layout-5vTDPOk1.js} +1 -1
  79. package/dist/client/assets/{empty-state-DTm9XCIk.js → empty-state-C6lTqnpg.js} +1 -1
  80. package/dist/client/assets/{empty-state-CewyMuo1.js → empty-state-DUBPA5NU.js} +1 -1
  81. package/dist/client/assets/{extract-connection-data-Bh_Tkl8z.js → extract-connection-data-DM9YCvRC.js} +1 -1
  82. package/dist/client/assets/{features-rGWmQRbS.js → features-DeqFL1TF.js} +1 -1
  83. package/dist/client/assets/{file-explorer-BxcoLq7k.js → file-explorer-DGNu1G6y.js} +1 -1
  84. package/dist/client/assets/{files-092UZxGN.js → files-CTFSKbFe.js} +1 -1
  85. package/dist/client/assets/{form-DD66RTDf.js → form-DIJniw7V.js} +1 -1
  86. package/dist/client/assets/{general-DTbdocsc.js → general-C1eIXBGl.js} +1 -1
  87. package/dist/client/assets/{generate-id-DMa8tQ_Y.js → generate-id-CUOrXJD_.js} +1 -1
  88. package/dist/client/assets/{github-repo-picker-BaZinHsd.js → github-repo-picker-CbPGsyKd.js} +1 -1
  89. package/dist/client/assets/{hooks-Bhk1YQ2I.js → hooks-wb_9T_1N.js} +1 -1
  90. package/dist/client/assets/{hover-card-szbVRwlX.js → hover-card-CKXherxT.js} +1 -1
  91. package/dist/client/assets/{index-y9b1xONk.js → index-4hlJQ9pJ.js} +1 -1
  92. package/dist/client/assets/{index-j4kSKfbx.js → index-BcTuPMjJ.js} +1 -1
  93. package/dist/client/assets/{index-BbdQ6KU8.js → index-C4lnfdzw.js} +1 -1
  94. package/dist/client/assets/{index-Dr77wSbz.js → index-C7pSmjIO.js} +1 -1
  95. package/dist/client/assets/{index-Bi14o9BI.js → index-C8daMTSw.js} +1 -1
  96. package/dist/client/assets/{index-DoZOGE8i.js → index-CCOM2TyZ.js} +1 -1
  97. package/dist/client/assets/{index-DbUSKXZz.js → index-CLNFUsz7.js} +1 -1
  98. package/dist/client/assets/{index-cthVMhmX.js → index-CZe7rsCu.js} +1 -1
  99. package/dist/client/assets/{index-CM1D3IOd.js → index-C_etCvW6.js} +2 -2
  100. package/dist/client/assets/{index-C9kZ7-22.js → index-CtrYWx6M.js} +1 -1
  101. package/dist/client/assets/{index-C5X_vClM.js → index-DQI8RGuh.js} +1 -1
  102. package/dist/client/assets/{index-DDxVYHfh.js → index-DTRFlXli.js} +1 -1
  103. package/dist/client/assets/{index-CN3piKjg.js → index-HbdqPSFx.js} +4 -4
  104. package/dist/client/assets/{index-joEaP8qc.js → index-JWYz3SFX.js} +1 -1
  105. package/dist/client/assets/{index-CN1EZuP6.js → index-iXiOYxiI.js} +1 -1
  106. package/dist/client/assets/{index-BNRl1Tot.js → index-oDkRJBov.js} +1 -1
  107. package/dist/client/assets/{infiniteQueryObserver-BThZVpCW.js → infiniteQueryObserver-ClfdJkk7.js} +1 -1
  108. package/dist/client/assets/{input-DrYpnRWV.js → input-CGbgb-E-.js} +1 -1
  109. package/dist/client/assets/{integration-icon-CpEacvrW.js → integration-icon-BruX6m5m.js} +1 -1
  110. package/dist/client/assets/{label-Cm89B89_.js → label-DZerbc9D.js} +1 -1
  111. package/dist/client/assets/{layout-D_sGbaUG.js → layout-BZH9O9Di.js} +1 -1
  112. package/dist/client/assets/{login-B0m7NoXF.js → login-DZffN_aA.js} +1 -1
  113. package/dist/client/assets/{members-TNc3XO9o.js → members-D7h7i7jo.js} +1 -1
  114. package/dist/client/assets/{monaco-editor-DA9r9xlp.js → monaco-editor-5gAmZPD0.js} +1 -1
  115. package/dist/client/assets/{monitoring-stats-row-BAGlU-cw.js → monitoring-stats-row-Bk1ZQbMo.js} +1 -1
  116. package/dist/client/assets/{oauth-callback-Bme8yHJx.js → oauth-callback-BIsI_jqc.js} +1 -1
  117. package/dist/client/assets/{oauth-callback-ai-provider-f1O1WajF.js → oauth-callback-ai-provider-C27n0WFg.js} +1 -1
  118. package/dist/client/assets/{onboarding-CQUJ9k5e.js → onboarding-Ck72MHHt.js} +1 -1
  119. package/dist/client/assets/{org-layout-I5rG58sc.js → org-layout-DKx39VER.js} +1 -1
  120. package/dist/client/assets/{org-plugin-layout-dR6pThVC.js → org-plugin-layout-BaK8uVO_.js} +1 -1
  121. package/dist/client/assets/{pair-DEIG2RgN.js → pair-Cgvtm3hX.js} +1 -1
  122. package/dist/client/assets/{plugin-empty-state-4_sYAII0.js → plugin-empty-state-DDY0jmoN.js} +1 -1
  123. package/dist/client/assets/{plugin-header-BwNgsj_9.js → plugin-header-CtGcek8l.js} +1 -1
  124. package/dist/client/assets/{plugin-layout-7nPkrfcu.js → plugin-layout-oaFFfdTI.js} +1 -1
  125. package/dist/client/assets/{popover-C9ON0IYH.js → popover-xTN6BEZL.js} +1 -1
  126. package/dist/client/assets/{profile-B1MkYulp.js → profile-Bt1eqeyk.js} +1 -1
  127. package/dist/client/assets/{project-app-view-BuPeSGT8.js → project-app-view-C4H7AVbl.js} +1 -1
  128. package/dist/client/assets/registry-BI9574MG.js +2 -0
  129. package/dist/client/assets/{registry-layout-gpmPSOEv.js → registry-layout-COVdyl2V.js} +1 -1
  130. package/dist/client/assets/{required-auth-layout-CUCq1Ujt.js → required-auth-layout-r_pSqbfY.js} +1 -1
  131. package/dist/client/assets/{reset-password-BVGQ_9V7.js → reset-password-C89Bjdhm.js} +1 -1
  132. package/dist/client/assets/{roles-DAPDhbwg.js → roles-Cg2trhAU.js} +1 -1
  133. package/dist/client/assets/{search-input-DKfonUQJ.js → search-input-CjfEjrnk.js} +1 -1
  134. package/dist/client/assets/{secrets-CHWB0VGD.js → secrets-CxfV7l1d.js} +1 -1
  135. package/dist/client/assets/{sections-editor-CeXP_fUW.js → sections-editor-Q3yGyCxb.js} +1 -1
  136. package/dist/client/assets/{select-Bi6n0v1l.js → select-DXIl-nWc.js} +1 -1
  137. package/dist/client/assets/{settings-layout-CCfPNWLq.js → settings-layout-skdEb6EQ.js} +1 -1
  138. package/dist/client/assets/{settings-section-CHdjpjU7.js → settings-section-DRZOyjZN.js} +1 -1
  139. package/dist/client/assets/{shell-controls-EFju5Xuz.js → shell-controls-Bh_0J4mE.js} +1 -1
  140. package/dist/client/assets/{shell-layout-odzNWxkB.js → shell-layout-DX8eVZ8L.js} +1 -1
  141. package/dist/client/assets/{sidebar-DapD5BLH.js → sidebar-BMGvDz3J.js} +1 -1
  142. package/dist/client/assets/{skeleton-BLQ-Z2or.js → skeleton-BNkut-Qo.js} +1 -1
  143. package/dist/client/assets/{sortable.esm-Dvr6sXXz.js → sortable.esm-gCXq3aZO.js} +1 -1
  144. package/dist/client/assets/{spinner-DSdP03Bc.js → spinner-TVmcFRIL.js} +1 -1
  145. package/dist/client/assets/{sso-06euccCF.js → sso-bbmzRIMK.js} +1 -1
  146. package/dist/client/assets/{store-C4RZhwKw.js → store-CioUjuaZ.js} +1 -1
  147. package/dist/client/assets/store-registry-B2Rmo0V0.js +2 -0
  148. package/dist/client/assets/{switch-BOO2ukng.js → switch-khv0BLvL.js} +1 -1
  149. package/dist/client/assets/{table-_uCDG2hl.js → table-C_yNGOnh.js} +1 -1
  150. package/dist/client/assets/{tabs-BQ9tTDv7.js → tabs-DRaRBGe3.js} +1 -1
  151. package/dist/client/assets/{task-status-GEjzAUmm.js → task-status-CkD92yfU.js} +1 -1
  152. package/dist/client/assets/{textarea-DMNeKZeZ.js → textarea-DASnyL4F.js} +1 -1
  153. package/dist/client/assets/{toggle-group-BwRgB5RE.js → toggle-group-DPmEdA-m.js} +1 -1
  154. package/dist/client/assets/{toolbar-ZFFuL6YR.js → toolbar-C9yYx7bm.js} +1 -1
  155. package/dist/client/assets/{tools-list-DXRB9DMK.js → tools-list-psDgt0om.js} +1 -1
  156. package/dist/client/assets/{tooltip-Cc8Oz_Tb.js → tooltip-8OqGw7oG.js} +1 -1
  157. package/dist/client/assets/{types-DETbs5zw.js → types-BmHvFlO1.js} +1 -1
  158. package/dist/client/assets/{use-ai-providers-BFMpjk_o.js → use-ai-providers-CCCd9SIG.js} +1 -1
  159. package/dist/client/assets/{use-collections-CW9RG6h4.js → use-collections-BsrK_euH.js} +1 -1
  160. package/dist/client/assets/{use-connection-BA0O34v3.js → use-connection--tE4CSIP.js} +1 -1
  161. package/dist/client/assets/{use-copy-BI1hoGvu.js → use-copy-CG-PSiHT.js} +1 -1
  162. package/dist/client/assets/{use-create-virtual-mcp-CPLlz8GU.js → use-create-virtual-mcp-DDF2B3SX.js} +1 -1
  163. package/dist/client/assets/{use-debounced-autosave-BwABkJt3.js → use-debounced-autosave-Dj2CoLmA.js} +1 -1
  164. package/dist/client/assets/{use-delete-connection-Dm_6Hsyx.js → use-delete-connection-CDD8AF8I.js} +1 -1
  165. package/dist/client/assets/{use-file-configs-DADtAUxx.js → use-file-configs-B37NAmGU.js} +1 -1
  166. package/dist/client/assets/{use-infinite-scroll-0oj3TOvR.js → use-infinite-scroll-BkFiyWBa.js} +1 -1
  167. package/dist/client/assets/{use-list-state-CCB61-YL.js → use-list-state-BcL02_1r.js} +1 -1
  168. package/dist/client/assets/{use-mcp-prompts-Coi1CKEf.js → use-mcp-prompts-D8zJ1XPI.js} +1 -1
  169. package/dist/client/assets/{use-mcp-tools-DSljy4qc.js → use-mcp-tools-C_ftxwer.js} +1 -1
  170. package/dist/client/assets/{use-members-B1GQuICM.js → use-members-CqC5jIzW.js} +1 -1
  171. package/dist/client/assets/{use-navigate-to-agent-TJFSx1rG.js → use-navigate-to-agent-bdiV5j2z.js} +1 -1
  172. package/dist/client/assets/{use-org-auth-client-CvyxOJ50.js → use-org-auth-client-DtBy8R2R.js} +1 -1
  173. package/dist/client/assets/{use-org-sso-BHhjzT3n.js → use-org-sso-T1wSzyZP.js} +1 -1
  174. package/dist/client/assets/{use-organization-roles-CqvnrNta.js → use-organization-roles-B6nrjgeY.js} +1 -1
  175. package/dist/client/assets/{use-organization-settings-Kf9UVBw8.js → use-organization-settings-CpDAWMUD.js} +1 -1
  176. package/dist/client/assets/{use-registry-connections-CaOaYe6E.js → use-registry-connections-BZm5h5va.js} +1 -1
  177. package/dist/client/assets/{use-secrets-DzvLviXH.js → use-secrets-Bzp6C09M.js} +1 -1
  178. package/dist/client/assets/{use-status-sounds-DAM8WOkV.js → use-status-sounds-BAU2JGUe.js} +1 -1
  179. package/dist/client/assets/{use-view-mode-X_MksRXE.js → use-view-mode-CL1AUq6a.js} +1 -1
  180. package/dist/client/assets/{use-virtual-mcp-2qLUU42J.js → use-virtual-mcp-D92JJRrE.js} +1 -1
  181. package/dist/client/assets/useInfiniteQuery-VRvGrh-Y.js +1 -0
  182. package/dist/client/assets/{useRouterState-D1LxQ93_.js → useRouterState-CFvTFlCq.js} +1 -1
  183. package/dist/client/assets/useSuspenseInfiniteQuery-DWV-fRnj.js +1 -0
  184. package/dist/client/assets/{user-BmoWQK0D.js → user-Cc4_vb_v.js} +1 -1
  185. package/dist/client/assets/{view-mode-toggle-Bt--nFn5.js → view-mode-toggle-B0PLoHTf.js} +1 -1
  186. package/dist/client/assets/workflow-detail-DMN9egvR.js +1 -0
  187. package/dist/client/assets/{workflow-CCgkz7n2.js → workflow-uatlbMiQ.js} +1 -1
  188. package/dist/client/index.html +1 -1
  189. package/dist/server/cli.js +1 -1
  190. package/package.json +1 -1
  191. package/dist/client/assets/registry-BPpui4Vv.js +0 -2
  192. package/dist/client/assets/store-registry-DOjXpenK.js +0 -2
  193. package/dist/client/assets/useInfiniteQuery-6Vl88Gwv.js +0 -1
  194. package/dist/client/assets/useSuspenseInfiniteQuery-Ciek5SC-.js +0 -1
  195. package/dist/client/assets/workflow-detail-C6NUgtqX.js +0 -1
  196. package/dist/server/node_modules/ansi-regex/index.d.ts +0 -33
  197. package/dist/server/node_modules/ansi-regex/index.js +0 -14
  198. package/dist/server/node_modules/ansi-regex/license +0 -9
  199. package/dist/server/node_modules/ansi-regex/package.json +0 -61
  200. package/dist/server/node_modules/ansi-regex/readme.md +0 -66
  201. package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
  202. package/dist/server/node_modules/emoji-regex/README.md +0 -107
  203. package/dist/server/node_modules/emoji-regex/index.d.ts +0 -3
  204. package/dist/server/node_modules/emoji-regex/index.js +0 -4
  205. package/dist/server/node_modules/emoji-regex/index.mjs +0 -4
  206. package/dist/server/node_modules/emoji-regex/package.json +0 -45
  207. package/dist/server/node_modules/pg-cloudflare/LICENSE +0 -21
  208. package/dist/server/node_modules/pg-cloudflare/README.md +0 -112
  209. package/dist/server/node_modules/pg-cloudflare/dist/empty.d.ts +0 -2
  210. package/dist/server/node_modules/pg-cloudflare/dist/empty.js +0 -6
  211. package/dist/server/node_modules/pg-cloudflare/dist/empty.js.map +0 -1
  212. package/dist/server/node_modules/pg-cloudflare/dist/index.d.ts +0 -31
  213. package/dist/server/node_modules/pg-cloudflare/dist/index.js +0 -152
  214. package/dist/server/node_modules/pg-cloudflare/dist/index.js.map +0 -1
  215. package/dist/server/node_modules/pg-cloudflare/esm/index.mjs +0 -3
  216. package/dist/server/node_modules/pg-cloudflare/package.json +0 -39
  217. package/dist/server/node_modules/pg-cloudflare/src/empty.ts +0 -3
  218. package/dist/server/node_modules/pg-cloudflare/src/index.ts +0 -166
  219. package/dist/server/node_modules/pg-cloudflare/src/types.d.ts +0 -25
  220. package/dist/server/node_modules/pg-connection-string/LICENSE +0 -21
  221. package/dist/server/node_modules/pg-connection-string/README.md +0 -105
  222. package/dist/server/node_modules/pg-connection-string/esm/index.mjs +0 -8
  223. package/dist/server/node_modules/pg-connection-string/index.d.ts +0 -36
  224. package/dist/server/node_modules/pg-connection-string/index.js +0 -231
  225. package/dist/server/node_modules/pg-connection-string/package.json +0 -52
@@ -1 +1 @@
1
- import{f as oe,q as ie,D as le,F as ge,G as fe,a as re,t as Y,o as L,K as Z,j as s,C as ee,J as xe,P as X,e as T,r as K,B as H,c as pe,z as he,U as te}from"./index-CM1D3IOd.js";import{P as G}from"./index-Dr77wSbz.js";import{u as je}from"./use-org-auth-client-CvyxOJ50.js";import{u as ve}from"./use-debounced-autosave-BwABkJt3.js";import{A as be}from"./avatar-DeKO2t6e.js";import{I as ae}from"./input-DrYpnRWV.js";import{S as J,a as W,b as Q,c as ye,d as Se}from"./settings-section-CHdjpjU7.js";import{D as Ce}from"./domain-settings-BnZTuy7Y.js";import{u as _e,a as se,K as Ne,P as ze,D as De,c as we,S as Ae,v as Pe,b as Ie,C as Oe,s as ke,d as Ee}from"./sortable.esm-Dvr6sXXz.js";import{i as Fe,S as Te,u as Re}from"./constants-BwYc8BqM.js";import{b as ce}from"./use-virtual-mcp-2qLUU42J.js";import{P as $e,a as Le,b as Me}from"./popover-C9ON0IYH.js";import{C as qe}from"./collection-search-ZgHJOBo2.js";import{S as Ke}from"./skeleton-BLQ-Z2or.js";import{ab as Be}from"./agent-icon-BbgplFYb.js";import{s as Ve}from"./Plus-CuU_Vn1V.js";import{a as de}from"./Users03-BScPbfBT.js";import{i as He}from"./X-BpMfki2j.js";import{I as me}from"./integration-icon-CpEacvrW.js";import{b as Ue,c as Ge}from"./use-organization-settings-Kf9UVBw8.js";import{c as Qe,b as Ye,d as Ze,f as Je,e as We,g as Xe,a as et,A as tt}from"./alert-dialog-CBfLU0-s.js";import"./sidebar-DapD5BLH.js";import"./LayoutLeft-BtnBeX4Q.js";import"./tooltip-Cc8Oz_Tb.js";import"./User01-DvR2FzxS.js";import"./card-CzmU6DPx.js";import"./ArrowUpRight-CuD8Ec0Q.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-BOO2ukng.js";import"./use-collections-CW9RG6h4.js";import"./SearchMd-YL-AZ1_e.js";import"./AlertCircle-BT4KzWnI.js";import"./Tool01-Cr9-Ayar.js";import"./Stars02-DjyZ6rm8.js";import"./SwitchHorizontal01-CoAD8Pso.js";import"./RefreshCcw01-DYeBzgxl.js";import"./ArrowNarrowLeft-DL6IklHf.js";import"./XCircle-D4gl9x0F.js";import"./ZapSquare-C-QuJXiX.js";import"./CheckCircle-CeozB0CE.js";import"./Check-BwR-n-sF.js";import"./ChevronDown-NgrGgemj.js";import"./ChevronRight-DzTdh7eY.js";import"./ChevronUp-O1681VYk.js";import"./DotsVertical-DwV108_Y.js";import"./Container-2b4BXA-n.js";import"./FilterLines-DOivCNH_.js";import"./Star01-B9_yj21o.js";import"./Palette-CDAteqS3.js";import"./HardDrive-Cj4eW7va.js";import"./Key01-BQUJeWtG.js";import"./LinkExternal01-gSnFHviP.js";import"./Lock01-CLcwdBbZ.js";import"./Monitor01-B72KxmOA.js";import"./Sun-D3nbZYnT.js";import"./Play-3lq0IL_j.js";import"./Settings02-CmAK-JQC.js";import"./Shield01-DWmt0CsN.js";import"./Trash01-Bdgng8Ny.js";import"./Upload01-DEH4hqbP.js";import"./Users01-DKVYUvbH.js";import"./XClose-8wwGH-xu.js";import"./Zap-DGOMtCmx.js";const st=xe({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:X().optional()});function nt(e){const t=T.c(13),{value:l,onChange:r,name:c,disabled:f}=e,n=K.useRef(null);let j;t[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>n.current?.click(),t[0]=j):j=t[0];const u=j;let v;t[1]!==r?(v=w=>{const g=w.target.files?.[0];if(!g)return;if(g.size>2097152){L.error("Image must be smaller than 2MB");return}const h=new FileReader;h.onerror=ot,h.onloadend=()=>{h.result&&r(h.result),n.current&&(n.current.value="")},h.readAsDataURL(g)},t[1]=r,t[2]=v):v=t[2];const o=v;let i;t[3]!==f||t[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:f}),t[3]=f,t[4]=o,t[5]=i):i=t[5];const d=l||void 0,m=c??"?";let x;t[6]!==d||t[7]!==m?(x=s.jsx(be,{url:d,fallback:m,shape:"square",size:"base"}),t[6]=d,t[7]=m,t[8]=x):x=t[8];let p;return t[9]!==f||t[10]!==i||t[11]!==x?(p=s.jsxs("button",{type:"button",onClick:u,disabled:f,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,x]}),t[9]=f,t[10]=i,t[11]=x,t[12]=p):p=t[12],p}function ot(){return L.error("Failed to read image")}function it(){const e=oe(),{org:t}=ie(),l=je(),r=le(),c=ge({resolver:fe(st),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),f=re({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const d=await l.organization.update({data:i});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:(o,i)=>{Y("organization_settings_updated",{organization_id:t.id,fields:Object.keys(i)}),r.invalidateQueries({queryKey:Z.organizations()}),r.invalidateQueries({queryKey:Z.activeOrganization(t.slug)}),L.success("Organization updated successfully"),o?.data?.slug&&o.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{Y("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),L.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:j}=ve({save:async()=>{const o=c.control._formState.dirtyFields;if(Object.keys(o).length===0||!await c.trigger())return;const d=c.getValues(),m=c.control._defaultValues;c.reset(d,{keepValues:!0});try{await f.mutateAsync(d)}catch{c.reset(m,{keepValues:!0})}}}),u=c.formState.errors,v=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(J,{children:s.jsxs(W,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(nt,{value:c.watch("logo"),onChange:o=>{c.setValue("logo",o??"",{shouldDirty:!0}),j()},name:c.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(ee,{control:c.control,name:"name",render:({field:o})=>s.jsx(ae,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),j()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[v&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:v}),s.jsx(ee,{control:c.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:i=>{const d=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.setValue("slug",d,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),j()}})})]})}),(u.name||u.slug||u.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[u.name&&s.jsx("p",{className:"text-xs text-destructive",children:u.name.message}),u.slug&&s.jsx("p",{className:"text-xs text-destructive",children:u.slug.message}),u.logo&&s.jsx("p",{className:"text-xs text-destructive",children:u.logo.message})]})]})})}const ne=8;function lt(e,t){const l=t.find(r=>r.id===e);return l?{id:e,title:l.title,icon:l.icon??null,kind:"custom"}:{id:e,title:e,icon:null,kind:"missing"}}function rt(e){const t=T.c(39),{agent:l,onRemove:r}=e;let c;t[0]!==l.id?(c={id:l.id},t[0]=l.id,t[1]=c):c=t[1];const{attributes:f,listeners:n,setNodeRef:j,transform:u,transition:v,isDragging:o}=Ie(c);let i;t[2]!==u?(i=Oe.Transform.toString(u),t[2]=u,t[3]=i):i=t[3];const d=o?.5:void 0,m=o?100:void 0;let x;t[4]!==i||t[5]!==d||t[6]!==m||t[7]!==v?(x={transform:i,transition:v,opacity:d,zIndex:m},t[4]=i,t[5]=d,t[6]=m,t[7]=v,t[8]=x):x=t[8];const p=x,w=o&&"shadow-lg";let g;t[9]!==w?(g=pe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",w),t[9]=w,t[10]=g):g=t[10];const h=`Drag to reorder ${l.title}`;let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Be,{size:14}),t[11]=S):S=t[11];let N;t[12]!==f||t[13]!==n||t[14]!==h?(N=s.jsx("button",{type:"button",...f,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":h,children:S}),t[12]=f,t[13]=n,t[14]=h,t[15]=N):N=t[15];let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(de,{size:14}),t[16]=C):C=t[16];let b;t[17]!==l.icon||t[18]!==l.title?(b=s.jsx(me,{icon:l.icon,name:l.title,size:"xs",fallbackIcon:C}),t[17]=l.icon,t[18]=l.title,t[19]=b):b=t[19];let _;t[20]!==l.title?(_=s.jsx("span",{className:"text-sm text-foreground truncate",children:l.title}),t[20]=l.title,t[21]=_):_=t[21];const P=l.kind==="custom"?"Custom agent":"Unavailable";let y;t[22]!==P?(y=s.jsx("span",{className:"text-xs text-muted-foreground",children:P}),t[22]=P,t[23]=y):y=t[23];let A;t[24]!==_||t[25]!==y?(A=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[_,y]}),t[24]=_,t[25]=y,t[26]=A):A=t[26];const z=`Remove ${l.title}`;let D;t[27]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(He,{size:14}),t[27]=D):D=t[27];let a;t[28]!==r||t[29]!==z?(a=s.jsx("button",{type:"button",onClick:r,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":z,children:D}),t[28]=r,t[29]=z,t[30]=a):a=t[30];let I;return t[31]!==j||t[32]!==p||t[33]!==N||t[34]!==b||t[35]!==A||t[36]!==a||t[37]!==g?(I=s.jsxs("div",{ref:j,style:p,className:g,children:[N,b,A,a]}),t[31]=j,t[32]=p,t[33]=N,t[34]=b,t[35]=A,t[36]=a,t[37]=g,t[38]=I):I=t[38],I}function at(e){const t=T.c(39),{selectedIds:l,onAdd:r}=e,[c,f]=K.useState(!1),[n,j]=K.useState(""),u=ce();let v;t[0]!==l?(v=new Set(l),t[0]=l,t[1]=v):v=t[1];const o=v;let i,d,m,x,p,w,g,h,S,N;if(t[2]!==u||t[3]!==r||t[4]!==c||t[5]!==n||t[6]!==o){const P=n.toLowerCase();let y;t[17]!==o?(y=a=>a.id!==null&&!Fe(a.id)&&!o.has(a.id),t[17]=o,t[18]=y):y=t[18];const A=u.filter(y).filter(a=>!n||a.title.toLowerCase().includes(P));let z;t[19]!==r?(z=a=>{r(a),f(!1),j("")},t[19]=r,t[20]=z):z=t[20];const D=z;d=$e,h=c,S=f,t[21]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Le,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),t[21]=N):N=t[21],i=Me,p="w-[320px] p-0 overflow-hidden",w="start",t[22]!==n?(g=s.jsx(qe,{value:n,onChange:j,placeholder:"Search agents..."}),t[22]=n,t[23]=g):g=t[23],m="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=A.length>0?s.jsx("div",{className:"flex flex-col gap-1",children:A.map(a=>s.jsxs("button",{type:"button",onClick:()=>D(a.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(me,{icon:a.icon,name:a.title,size:"xs",fallbackIcon:s.jsx(de,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:a.title})]},a.id))}):s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),t[2]=u,t[3]=r,t[4]=c,t[5]=n,t[6]=o,t[7]=i,t[8]=d,t[9]=m,t[10]=x,t[11]=p,t[12]=w,t[13]=g,t[14]=h,t[15]=S,t[16]=N}else i=t[7],d=t[8],m=t[9],x=t[10],p=t[11],w=t[12],g=t[13],h=t[14],S=t[15],N=t[16];let C;t[24]!==m||t[25]!==x?(C=s.jsx("div",{className:m,children:x}),t[24]=m,t[25]=x,t[26]=C):C=t[26];let b;t[27]!==i||t[28]!==C||t[29]!==p||t[30]!==w||t[31]!==g?(b=s.jsxs(i,{className:p,align:w,children:[g,C]}),t[27]=i,t[28]=C,t[29]=p,t[30]=w,t[31]=g,t[32]=b):b=t[32];let _;return t[33]!==d||t[34]!==b||t[35]!==h||t[36]!==S||t[37]!==N?(_=s.jsxs(d,{open:h,onOpenChange:S,children:[N,b]}),t[33]=d,t[34]=b,t[35]=h,t[36]=S,t[37]=N,t[38]=_):_=t[38],_}function ct(){const e=T.c(61),t=Ue(),l=ce(),r=Ge();let c;e[0]!==t?.ids?(c=t?.ids??[],e[0]=t?.ids,e[1]=c):c=e[1];const f=c,[n,j]=K.useState(f);let u;e[2]!==n||e[3]!==f?(u=n.length!==f.length||n.some((k,F)=>k!==f[F]),e[2]=n,e[3]=f,e[4]=u):u=e[4];const v=u;let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:ke},e[6]=i):i=e[6];const d=_e(se(ze,o),se(Ne,i));let m;e[7]!==n?(m=k=>{const{active:F,over:M}=k;if(!M||F.id===M.id)return;const q=n.indexOf(F.id),$=n.indexOf(M.id);q===-1||$===-1||j(Ee([...n],q,$))},e[7]=n,e[8]=m):m=e[8];const x=m;let p;e[9]!==n?(p=k=>{n.includes(k)||j([...n,k])},e[9]=n,e[10]=p):p=e[10];const w=p;let g;e[11]!==n?(g=k=>{j(n.filter(F=>F!==k))},e[11]=n,e[12]=g):g=e[12];const h=g;let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{j([])},e[13]=S):S=e[13];const N=S;let C;e[14]!==n||e[15]!==r?(C=()=>{r.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length}),L.success("Default home agents updated")},onError:dt})},e[14]=n,e[15]=r,e[16]=C):C=e[16];const b=C;let _,P,y,A,z,D,a;if(e[17]!==l||e[18]!==n||e[19]!==x||e[20]!==h||e[21]!==d||e[22]!==r.isPending){let k;e[30]!==l?(k=$=>lt($,l),e[30]=l,e[31]=k):k=e[31];const F=n.map(k);y=Math.max(0,n.length-ne),P=J,z="Default home agents";const M=r.isPending||n.length===0;let q;e[32]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(he,{size:14}),e[32]=q):q=e[32],e[33]!==M?(D=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:N,disabled:M,children:[q,"Clear all"]}),e[33]=M,e[34]=D):D=e[34],_=W,a="px-5 py-5 flex flex-col gap-3",A=F.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(De,{sensors:d,collisionDetection:we,onDragEnd:x,children:s.jsx(Ae,{items:n,strategy:Pe,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:F.map(($,ue)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[ue===ne&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(rt,{agent:$,onRemove:()=>h($.id)})]},$.id))})})}),e[17]=l,e[18]=n,e[19]=x,e[20]=h,e[21]=d,e[22]=r.isPending,e[23]=_,e[24]=P,e[25]=y,e[26]=A,e[27]=z,e[28]=D,e[29]=a}else _=e[23],P=e[24],y=e[25],A=e[26],z=e[27],D=e[28],a=e[29];let I;e[35]!==n||e[36]!==w?(I=s.jsx(at,{selectedIds:n,onAdd:w}),e[35]=n,e[36]=w,e[37]=I):I=e[37];let O;e[38]!==y?(O=y>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[y," agent",y===1?"":"s"," won't fit on the home view"]}),e[38]=y,e[39]=O):O=e[39];let E;e[40]!==I||e[41]!==O?(E=s.jsxs("div",{className:"flex items-center justify-between",children:[I,O]}),e[40]=I,e[41]=O,e[42]=E):E=e[42];let R;e[43]!==A||e[44]!==E||e[45]!==a?(R=s.jsxs("div",{className:a,children:[A,E]}),e[43]=A,e[44]=E,e[45]=a,e[46]=R):R=e[46];let B;e[47]!==b||e[48]!==f||e[49]!==v||e[50]!==r.isPending?(B=v&&s.jsxs(ye,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>j(f),disabled:r.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:b,disabled:r.isPending,children:r.isPending?"Saving…":"Save"})]}),e[47]=b,e[48]=f,e[49]=v,e[50]=r.isPending,e[51]=B):B=e[51];let V;e[52]!==_||e[53]!==R||e[54]!==B?(V=s.jsxs(_,{children:[R,B]}),e[52]=_,e[53]=R,e[54]=B,e[55]=V):V=e[55];let U;return e[56]!==P||e[57]!==z||e[58]!==D||e[59]!==V?(U=s.jsx(P,{title:z,actions:D,children:V}),e[56]=P,e[57]=z,e[58]=D,e[59]=V,e[60]=U):U=e[60],U}function dt(e){L.error(e instanceof Error?e.message:"Failed to update default home agents")}function mt(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(J,{title:"Default home agents",children:s.jsx(W,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(ut)})})}),e[0]=t):t=e[0],t}function ut(e,t){return s.jsx(Ke,{className:"h-12 w-full rounded-lg"},t)}function gt(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(K.Suspense,{fallback:s.jsx(mt,{}),children:s.jsx(ct,{})}),e[0]=t):t=e[0],t}function ft(){const e=T.c(47),{org:t}=ie(),l=oe(),r=le(),[c,f]=K.useState(!1),[n,j]=K.useState("");let u;e[0]!==t.id||e[1]!==t.slug?(u={connectionId:Te,orgSlug:t.slug,orgId:t.id},e[0]=t.id,e[1]=t.slug,e[2]=u):u=e[2];const v=Re(u);let o;e[3]!==t.id||e[4]!==v?(o=async()=>{const O=await v.callTool({name:"ORGANIZATION_DELETE",arguments:{id:t.id}});if(O.isError){const E=O.content,R=Array.isArray(E)&&E[0]?.type==="text"&&typeof E[0].text=="string"?E[0].text:"Failed to delete organization";throw new Error(R)}},e[3]=t.id,e[4]=v,e[5]=o):o=e[5];let i;e[6]!==l||e[7]!==t.id||e[8]!==t.slug||e[9]!==r?(i=()=>{Y("organization_deleted",{organization_id:t.id}),localStorage.getItem(te.lastOrgSlug())===t.slug&&localStorage.removeItem(te.lastOrgSlug()),r.removeQueries({queryKey:Z.activeOrganization(t.slug)}),r.invalidateQueries({queryKey:Z.organizations()}),L.success("Organization deleted"),l({to:"/"})},e[6]=l,e[7]=t.id,e[8]=t.slug,e[9]=r,e[10]=i):i=e[10];let d;e[11]!==o||e[12]!==i?(d={mutationFn:o,onSuccess:i,onError:xt},e[11]=o,e[12]=i,e[13]=d):d=e[13];const m=re(d);let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=()=>f(!0),e[14]=x):x=e[14];let p;e[15]!==m.isPending?(p=s.jsx(J,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:s.jsx(W,{className:"border-destructive/40",children:s.jsx(Q,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:s.jsx(H,{variant:"destructive",size:"sm",onClick:x,disabled:m.isPending,children:"Delete"})})})}),e[15]=m.isPending,e[16]=p):p=e[16];let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=O=>{f(O),O||j("")},e[17]=w):w=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Qe,{children:"Delete Organization?"}),e[18]=g):g=e[18];let h;e[19]!==t.name?(h=s.jsxs("p",{children:["This will permanently delete all data associated with"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[19]=t.name,e[20]=h):h=e[20];let S;e[21]!==t.name?(S=s.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[21]=t.name,e[22]=S):S=e[22];let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=O=>j(O.target.value),e[23]=N):N=e[23];let C;e[24]!==n||e[25]!==t.name?(C=s.jsx(ae,{value:n,onChange:N,placeholder:t.name,autoFocus:!0}),e[24]=n,e[25]=t.name,e[26]=C):C=e[26];let b;e[27]!==C||e[28]!==h||e[29]!==S?(b=s.jsxs(Ye,{children:[g,s.jsx(Ze,{asChild:!0,children:s.jsxs("div",{children:[h,S,C]})})]}),e[27]=C,e[28]=h,e[29]=S,e[30]=b):b=e[30];let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Je,{children:"Cancel"}),e[31]=_):_=e[31];let P;e[32]!==m?(P=()=>m.mutate(),e[32]=m,e[33]=P):P=e[33];const y=n!==t.name||m.isPending,A=m.isPending?"Deleting…":"Delete organization";let z;e[34]!==P||e[35]!==y||e[36]!==A?(z=s.jsxs(We,{children:[_,s.jsx(Xe,{onClick:P,disabled:y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:A})]}),e[34]=P,e[35]=y,e[36]=A,e[37]=z):z=e[37];let D;e[38]!==b||e[39]!==z?(D=s.jsxs(et,{children:[b,z]}),e[38]=b,e[39]=z,e[40]=D):D=e[40];let a;e[41]!==c||e[42]!==D?(a=s.jsx(tt,{open:c,onOpenChange:w,children:D}),e[41]=c,e[42]=D,e[43]=a):a=e[43];let I;return e[44]!==a||e[45]!==p?(I=s.jsxs(s.Fragment,{children:[p,a]}),e[44]=a,e[45]=p,e[46]=I):I=e[46],I}function xt(e){L.error(e instanceof Error?e.message:"Failed to delete organization")}function pt(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Se,{children:[s.jsx(G.Title,{children:"Organization"}),s.jsx(it,{}),s.jsx(Ce,{}),s.jsx(gt,{}),s.jsx(ft,{})]})})})}),e[0]=t):t=e[0],t}function zs(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(pt,{}),e[0]=t):t=e[0],t}export{zs as default};
1
+ import{f as oe,q as ie,D as le,F as ge,G as fe,a as re,t as Y,o as L,K as Z,j as s,C as ee,J as xe,P as X,e as T,r as K,B as H,c as pe,z as he,U as te}from"./index-C_etCvW6.js";import{P as G}from"./index-C7pSmjIO.js";import{u as je}from"./use-org-auth-client-DtBy8R2R.js";import{u as ve}from"./use-debounced-autosave-Dj2CoLmA.js";import{A as be}from"./avatar-vA2R8qEK.js";import{I as ae}from"./input-CGbgb-E-.js";import{S as J,a as W,b as Q,c as ye,d as Se}from"./settings-section-DRZOyjZN.js";import{D as Ce}from"./domain-settings-CAp7ZsSN.js";import{u as _e,a as se,K as Ne,P as ze,D as De,c as we,S as Ae,v as Pe,b as Ie,C as Oe,s as ke,d as Ee}from"./sortable.esm-gCXq3aZO.js";import{i as Fe,S as Te,u as Re}from"./constants-oggaZSfP.js";import{b as ce}from"./use-virtual-mcp-D92JJRrE.js";import{P as $e,a as Le,b as Me}from"./popover-xTN6BEZL.js";import{C as qe}from"./collection-search-CLSVS08U.js";import{S as Ke}from"./skeleton-BNkut-Qo.js";import{ab as Be}from"./agent-icon-CPWEcMkW.js";import{s as Ve}from"./Plus-CpQnzuG3.js";import{a as de}from"./Users03-DGJmr08f.js";import{i as He}from"./X-Coa3_vHC.js";import{I as me}from"./integration-icon-BruX6m5m.js";import{b as Ue,c as Ge}from"./use-organization-settings-CpDAWMUD.js";import{c as Qe,b as Ye,d as Ze,f as Je,e as We,g as Xe,a as et,A as tt}from"./alert-dialog-jgkN1ow8.js";import"./sidebar-BMGvDz3J.js";import"./LayoutLeft-_rPJ3Xdj.js";import"./tooltip-8OqGw7oG.js";import"./User01-CtOhLzXW.js";import"./card-Cd_hFdRe.js";import"./ArrowUpRight-BngWaIVR.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-khv0BLvL.js";import"./use-collections-BsrK_euH.js";import"./SearchMd-D0mvaU5_.js";import"./AlertCircle-B5W8e_5w.js";import"./Tool01-CbzoidXH.js";import"./Stars02-M_tqgIvg.js";import"./SwitchHorizontal01-CJw113gN.js";import"./RefreshCcw01-B7Js0dD2.js";import"./ArrowNarrowLeft-hiT9EAxM.js";import"./XCircle-DvYTE78y.js";import"./ZapSquare-BQ8gms0B.js";import"./CheckCircle-BEasBYv4.js";import"./Check-8Z25AyId.js";import"./ChevronDown-DYIWk9ra.js";import"./ChevronRight-C956u55G.js";import"./ChevronUp-CdhHmg9Y.js";import"./DotsVertical-BY4pEp3W.js";import"./Container-eQJj-j5B.js";import"./FilterLines-z8ejuVIV.js";import"./Star01-CEifhmiR.js";import"./Palette-Vm3-5yKD.js";import"./HardDrive-C5cYoT_u.js";import"./Key01-D616GLzE.js";import"./LinkExternal01-DxWXfBDh.js";import"./Lock01-BCib8CWc.js";import"./Monitor01-Bz4VCJsr.js";import"./Sun-Ch8hbN6j.js";import"./Play-CKvhUVKq.js";import"./Settings02-CNt0vvEu.js";import"./Shield01-CZAvPXer.js";import"./Trash01-CUZkoYoW.js";import"./Upload01-DaqpbIUH.js";import"./Users01-DQVYpyq7.js";import"./XClose-wy0ZjI4q.js";import"./Zap-B74dlfsg.js";const st=xe({name:X().min(1,"Name is required").max(255,"Name is too long"),slug:X().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:X().optional()});function nt(e){const t=T.c(13),{value:l,onChange:r,name:c,disabled:f}=e,n=K.useRef(null);let j;t[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>n.current?.click(),t[0]=j):j=t[0];const u=j;let v;t[1]!==r?(v=w=>{const g=w.target.files?.[0];if(!g)return;if(g.size>2097152){L.error("Image must be smaller than 2MB");return}const h=new FileReader;h.onerror=ot,h.onloadend=()=>{h.result&&r(h.result),n.current&&(n.current.value="")},h.readAsDataURL(g)},t[1]=r,t[2]=v):v=t[2];const o=v;let i;t[3]!==f||t[4]!==o?(i=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:f}),t[3]=f,t[4]=o,t[5]=i):i=t[5];const d=l||void 0,m=c??"?";let x;t[6]!==d||t[7]!==m?(x=s.jsx(be,{url:d,fallback:m,shape:"square",size:"base"}),t[6]=d,t[7]=m,t[8]=x):x=t[8];let p;return t[9]!==f||t[10]!==i||t[11]!==x?(p=s.jsxs("button",{type:"button",onClick:u,disabled:f,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[i,x]}),t[9]=f,t[10]=i,t[11]=x,t[12]=p):p=t[12],p}function ot(){return L.error("Failed to read image")}function it(){const e=oe(),{org:t}=ie(),l=je(),r=le(),c=ge({resolver:fe(st),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),f=re({mutationFn:async o=>{const i={name:o.name,slug:o.slug};o.logo&&(i.logo=o.logo);const d=await l.organization.update({data:i});if(d?.error)throw new Error(d.error.message||"Failed to update organization");return d},onSuccess:(o,i)=>{Y("organization_settings_updated",{organization_id:t.id,fields:Object.keys(i)}),r.invalidateQueries({queryKey:Z.organizations()}),r.invalidateQueries({queryKey:Z.activeOrganization(t.slug)}),L.success("Organization updated successfully"),o?.data?.slug&&o.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:(o,i)=>{Y("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(i),error:o instanceof Error?o.message:String(o)}),L.error(o instanceof Error?o.message:"Failed to update organization")}}),{schedule:n,flush:j}=ve({save:async()=>{const o=c.control._formState.dirtyFields;if(Object.keys(o).length===0||!await c.trigger())return;const d=c.getValues(),m=c.control._defaultValues;c.reset(d,{keepValues:!0});try{await f.mutateAsync(d)}catch{c.reset(m,{keepValues:!0})}}}),u=c.formState.errors,v=typeof window<"u"?`${window.location.host}/`:"";return s.jsx(J,{children:s.jsxs(W,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(nt,{value:c.watch("logo"),onChange:o=>{c.setValue("logo",o??"",{shouldDirty:!0}),j()},name:c.watch("name")})}),s.jsx(Q,{title:"Name",action:s.jsx(ee,{control:c.control,name:"name",render:({field:o})=>s.jsx(ae,{id:"org-name",...o,onChange:i=>{o.onChange(i),n()},onBlur:()=>{o.onBlur(),j()},placeholder:"Organization name",className:"w-[280px]"})})}),s.jsx(Q,{title:"URL",action:s.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[v&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:v}),s.jsx(ee,{control:c.control,name:"slug",render:({field:o})=>s.jsx("input",{id:"org-slug",value:o.value??"",name:o.name,ref:o.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:i=>{const d=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.setValue("slug",d,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),n()},onBlur:()=>{o.onBlur(),j()}})})]})}),(u.name||u.slug||u.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[u.name&&s.jsx("p",{className:"text-xs text-destructive",children:u.name.message}),u.slug&&s.jsx("p",{className:"text-xs text-destructive",children:u.slug.message}),u.logo&&s.jsx("p",{className:"text-xs text-destructive",children:u.logo.message})]})]})})}const ne=8;function lt(e,t){const l=t.find(r=>r.id===e);return l?{id:e,title:l.title,icon:l.icon??null,kind:"custom"}:{id:e,title:e,icon:null,kind:"missing"}}function rt(e){const t=T.c(39),{agent:l,onRemove:r}=e;let c;t[0]!==l.id?(c={id:l.id},t[0]=l.id,t[1]=c):c=t[1];const{attributes:f,listeners:n,setNodeRef:j,transform:u,transition:v,isDragging:o}=Ie(c);let i;t[2]!==u?(i=Oe.Transform.toString(u),t[2]=u,t[3]=i):i=t[3];const d=o?.5:void 0,m=o?100:void 0;let x;t[4]!==i||t[5]!==d||t[6]!==m||t[7]!==v?(x={transform:i,transition:v,opacity:d,zIndex:m},t[4]=i,t[5]=d,t[6]=m,t[7]=v,t[8]=x):x=t[8];const p=x,w=o&&"shadow-lg";let g;t[9]!==w?(g=pe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",w),t[9]=w,t[10]=g):g=t[10];const h=`Drag to reorder ${l.title}`;let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Be,{size:14}),t[11]=S):S=t[11];let N;t[12]!==f||t[13]!==n||t[14]!==h?(N=s.jsx("button",{type:"button",...f,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":h,children:S}),t[12]=f,t[13]=n,t[14]=h,t[15]=N):N=t[15];let C;t[16]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(de,{size:14}),t[16]=C):C=t[16];let b;t[17]!==l.icon||t[18]!==l.title?(b=s.jsx(me,{icon:l.icon,name:l.title,size:"xs",fallbackIcon:C}),t[17]=l.icon,t[18]=l.title,t[19]=b):b=t[19];let _;t[20]!==l.title?(_=s.jsx("span",{className:"text-sm text-foreground truncate",children:l.title}),t[20]=l.title,t[21]=_):_=t[21];const P=l.kind==="custom"?"Custom agent":"Unavailable";let y;t[22]!==P?(y=s.jsx("span",{className:"text-xs text-muted-foreground",children:P}),t[22]=P,t[23]=y):y=t[23];let A;t[24]!==_||t[25]!==y?(A=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[_,y]}),t[24]=_,t[25]=y,t[26]=A):A=t[26];const z=`Remove ${l.title}`;let D;t[27]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(He,{size:14}),t[27]=D):D=t[27];let a;t[28]!==r||t[29]!==z?(a=s.jsx("button",{type:"button",onClick:r,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":z,children:D}),t[28]=r,t[29]=z,t[30]=a):a=t[30];let I;return t[31]!==j||t[32]!==p||t[33]!==N||t[34]!==b||t[35]!==A||t[36]!==a||t[37]!==g?(I=s.jsxs("div",{ref:j,style:p,className:g,children:[N,b,A,a]}),t[31]=j,t[32]=p,t[33]=N,t[34]=b,t[35]=A,t[36]=a,t[37]=g,t[38]=I):I=t[38],I}function at(e){const t=T.c(39),{selectedIds:l,onAdd:r}=e,[c,f]=K.useState(!1),[n,j]=K.useState(""),u=ce();let v;t[0]!==l?(v=new Set(l),t[0]=l,t[1]=v):v=t[1];const o=v;let i,d,m,x,p,w,g,h,S,N;if(t[2]!==u||t[3]!==r||t[4]!==c||t[5]!==n||t[6]!==o){const P=n.toLowerCase();let y;t[17]!==o?(y=a=>a.id!==null&&!Fe(a.id)&&!o.has(a.id),t[17]=o,t[18]=y):y=t[18];const A=u.filter(y).filter(a=>!n||a.title.toLowerCase().includes(P));let z;t[19]!==r?(z=a=>{r(a),f(!1),j("")},t[19]=r,t[20]=z):z=t[20];const D=z;d=$e,h=c,S=f,t[21]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Le,{asChild:!0,children:s.jsxs(H,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Ve,{size:14}),"Add agent"]})}),t[21]=N):N=t[21],i=Me,p="w-[320px] p-0 overflow-hidden",w="start",t[22]!==n?(g=s.jsx(qe,{value:n,onChange:j,placeholder:"Search agents..."}),t[22]=n,t[23]=g):g=t[23],m="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=A.length>0?s.jsx("div",{className:"flex flex-col gap-1",children:A.map(a=>s.jsxs("button",{type:"button",onClick:()=>D(a.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(me,{icon:a.icon,name:a.title,size:"xs",fallbackIcon:s.jsx(de,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:a.title})]},a.id))}):s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),t[2]=u,t[3]=r,t[4]=c,t[5]=n,t[6]=o,t[7]=i,t[8]=d,t[9]=m,t[10]=x,t[11]=p,t[12]=w,t[13]=g,t[14]=h,t[15]=S,t[16]=N}else i=t[7],d=t[8],m=t[9],x=t[10],p=t[11],w=t[12],g=t[13],h=t[14],S=t[15],N=t[16];let C;t[24]!==m||t[25]!==x?(C=s.jsx("div",{className:m,children:x}),t[24]=m,t[25]=x,t[26]=C):C=t[26];let b;t[27]!==i||t[28]!==C||t[29]!==p||t[30]!==w||t[31]!==g?(b=s.jsxs(i,{className:p,align:w,children:[g,C]}),t[27]=i,t[28]=C,t[29]=p,t[30]=w,t[31]=g,t[32]=b):b=t[32];let _;return t[33]!==d||t[34]!==b||t[35]!==h||t[36]!==S||t[37]!==N?(_=s.jsxs(d,{open:h,onOpenChange:S,children:[N,b]}),t[33]=d,t[34]=b,t[35]=h,t[36]=S,t[37]=N,t[38]=_):_=t[38],_}function ct(){const e=T.c(61),t=Ue(),l=ce(),r=Ge();let c;e[0]!==t?.ids?(c=t?.ids??[],e[0]=t?.ids,e[1]=c):c=e[1];const f=c,[n,j]=K.useState(f);let u;e[2]!==n||e[3]!==f?(u=n.length!==f.length||n.some((k,F)=>k!==f[F]),e[2]=n,e[3]=f,e[4]=u):u=e[4];const v=u;let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o={activationConstraint:{distance:5}},e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i={coordinateGetter:ke},e[6]=i):i=e[6];const d=_e(se(ze,o),se(Ne,i));let m;e[7]!==n?(m=k=>{const{active:F,over:M}=k;if(!M||F.id===M.id)return;const q=n.indexOf(F.id),$=n.indexOf(M.id);q===-1||$===-1||j(Ee([...n],q,$))},e[7]=n,e[8]=m):m=e[8];const x=m;let p;e[9]!==n?(p=k=>{n.includes(k)||j([...n,k])},e[9]=n,e[10]=p):p=e[10];const w=p;let g;e[11]!==n?(g=k=>{j(n.filter(F=>F!==k))},e[11]=n,e[12]=g):g=e[12];const h=g;let S;e[13]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{j([])},e[13]=S):S=e[13];const N=S;let C;e[14]!==n||e[15]!==r?(C=()=>{r.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length}),L.success("Default home agents updated")},onError:dt})},e[14]=n,e[15]=r,e[16]=C):C=e[16];const b=C;let _,P,y,A,z,D,a;if(e[17]!==l||e[18]!==n||e[19]!==x||e[20]!==h||e[21]!==d||e[22]!==r.isPending){let k;e[30]!==l?(k=$=>lt($,l),e[30]=l,e[31]=k):k=e[31];const F=n.map(k);y=Math.max(0,n.length-ne),P=J,z="Default home agents";const M=r.isPending||n.length===0;let q;e[32]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(he,{size:14}),e[32]=q):q=e[32],e[33]!==M?(D=s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:N,disabled:M,children:[q,"Clear all"]}),e[33]=M,e[34]=D):D=e[34],_=W,a="px-5 py-5 flex flex-col gap-3",A=F.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(De,{sensors:d,collisionDetection:we,onDragEnd:x,children:s.jsx(Ae,{items:n,strategy:Pe,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:F.map(($,ue)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[ue===ne&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(rt,{agent:$,onRemove:()=>h($.id)})]},$.id))})})}),e[17]=l,e[18]=n,e[19]=x,e[20]=h,e[21]=d,e[22]=r.isPending,e[23]=_,e[24]=P,e[25]=y,e[26]=A,e[27]=z,e[28]=D,e[29]=a}else _=e[23],P=e[24],y=e[25],A=e[26],z=e[27],D=e[28],a=e[29];let I;e[35]!==n||e[36]!==w?(I=s.jsx(at,{selectedIds:n,onAdd:w}),e[35]=n,e[36]=w,e[37]=I):I=e[37];let O;e[38]!==y?(O=y>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[y," agent",y===1?"":"s"," won't fit on the home view"]}),e[38]=y,e[39]=O):O=e[39];let E;e[40]!==I||e[41]!==O?(E=s.jsxs("div",{className:"flex items-center justify-between",children:[I,O]}),e[40]=I,e[41]=O,e[42]=E):E=e[42];let R;e[43]!==A||e[44]!==E||e[45]!==a?(R=s.jsxs("div",{className:a,children:[A,E]}),e[43]=A,e[44]=E,e[45]=a,e[46]=R):R=e[46];let B;e[47]!==b||e[48]!==f||e[49]!==v||e[50]!==r.isPending?(B=v&&s.jsxs(ye,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>j(f),disabled:r.isPending,children:"Cancel"}),s.jsx(H,{type:"button",onClick:b,disabled:r.isPending,children:r.isPending?"Saving…":"Save"})]}),e[47]=b,e[48]=f,e[49]=v,e[50]=r.isPending,e[51]=B):B=e[51];let V;e[52]!==_||e[53]!==R||e[54]!==B?(V=s.jsxs(_,{children:[R,B]}),e[52]=_,e[53]=R,e[54]=B,e[55]=V):V=e[55];let U;return e[56]!==P||e[57]!==z||e[58]!==D||e[59]!==V?(U=s.jsx(P,{title:z,actions:D,children:V}),e[56]=P,e[57]=z,e[58]=D,e[59]=V,e[60]=U):U=e[60],U}function dt(e){L.error(e instanceof Error?e.message:"Failed to update default home agents")}function mt(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(J,{title:"Default home agents",children:s.jsx(W,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(ut)})})}),e[0]=t):t=e[0],t}function ut(e,t){return s.jsx(Ke,{className:"h-12 w-full rounded-lg"},t)}function gt(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(K.Suspense,{fallback:s.jsx(mt,{}),children:s.jsx(ct,{})}),e[0]=t):t=e[0],t}function ft(){const e=T.c(47),{org:t}=ie(),l=oe(),r=le(),[c,f]=K.useState(!1),[n,j]=K.useState("");let u;e[0]!==t.id||e[1]!==t.slug?(u={connectionId:Te,orgSlug:t.slug,orgId:t.id},e[0]=t.id,e[1]=t.slug,e[2]=u):u=e[2];const v=Re(u);let o;e[3]!==t.id||e[4]!==v?(o=async()=>{const O=await v.callTool({name:"ORGANIZATION_DELETE",arguments:{id:t.id}});if(O.isError){const E=O.content,R=Array.isArray(E)&&E[0]?.type==="text"&&typeof E[0].text=="string"?E[0].text:"Failed to delete organization";throw new Error(R)}},e[3]=t.id,e[4]=v,e[5]=o):o=e[5];let i;e[6]!==l||e[7]!==t.id||e[8]!==t.slug||e[9]!==r?(i=()=>{Y("organization_deleted",{organization_id:t.id}),localStorage.getItem(te.lastOrgSlug())===t.slug&&localStorage.removeItem(te.lastOrgSlug()),r.removeQueries({queryKey:Z.activeOrganization(t.slug)}),r.invalidateQueries({queryKey:Z.organizations()}),L.success("Organization deleted"),l({to:"/"})},e[6]=l,e[7]=t.id,e[8]=t.slug,e[9]=r,e[10]=i):i=e[10];let d;e[11]!==o||e[12]!==i?(d={mutationFn:o,onSuccess:i,onError:xt},e[11]=o,e[12]=i,e[13]=d):d=e[13];const m=re(d);let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=()=>f(!0),e[14]=x):x=e[14];let p;e[15]!==m.isPending?(p=s.jsx(J,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:s.jsx(W,{className:"border-destructive/40",children:s.jsx(Q,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:s.jsx(H,{variant:"destructive",size:"sm",onClick:x,disabled:m.isPending,children:"Delete"})})})}),e[15]=m.isPending,e[16]=p):p=e[16];let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=O=>{f(O),O||j("")},e[17]=w):w=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Qe,{children:"Delete Organization?"}),e[18]=g):g=e[18];let h;e[19]!==t.name?(h=s.jsxs("p",{children:["This will permanently delete all data associated with"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[19]=t.name,e[20]=h):h=e[20];let S;e[21]!==t.name?(S=s.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[21]=t.name,e[22]=S):S=e[22];let N;e[23]===Symbol.for("react.memo_cache_sentinel")?(N=O=>j(O.target.value),e[23]=N):N=e[23];let C;e[24]!==n||e[25]!==t.name?(C=s.jsx(ae,{value:n,onChange:N,placeholder:t.name,autoFocus:!0}),e[24]=n,e[25]=t.name,e[26]=C):C=e[26];let b;e[27]!==C||e[28]!==h||e[29]!==S?(b=s.jsxs(Ye,{children:[g,s.jsx(Ze,{asChild:!0,children:s.jsxs("div",{children:[h,S,C]})})]}),e[27]=C,e[28]=h,e[29]=S,e[30]=b):b=e[30];let _;e[31]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Je,{children:"Cancel"}),e[31]=_):_=e[31];let P;e[32]!==m?(P=()=>m.mutate(),e[32]=m,e[33]=P):P=e[33];const y=n!==t.name||m.isPending,A=m.isPending?"Deleting…":"Delete organization";let z;e[34]!==P||e[35]!==y||e[36]!==A?(z=s.jsxs(We,{children:[_,s.jsx(Xe,{onClick:P,disabled:y,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:A})]}),e[34]=P,e[35]=y,e[36]=A,e[37]=z):z=e[37];let D;e[38]!==b||e[39]!==z?(D=s.jsxs(et,{children:[b,z]}),e[38]=b,e[39]=z,e[40]=D):D=e[40];let a;e[41]!==c||e[42]!==D?(a=s.jsx(tt,{open:c,onOpenChange:w,children:D}),e[41]=c,e[42]=D,e[43]=a):a=e[43];let I;return e[44]!==a||e[45]!==p?(I=s.jsxs(s.Fragment,{children:[p,a]}),e[44]=a,e[45]=p,e[46]=I):I=e[46],I}function xt(e){L.error(e instanceof Error?e.message:"Failed to delete organization")}function pt(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Se,{children:[s.jsx(G.Title,{children:"Organization"}),s.jsx(it,{}),s.jsx(Ce,{}),s.jsx(gt,{}),s.jsx(ft,{})]})})})}),e[0]=t):t=e[0],t}function zs(){const e=T.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(pt,{}),e[0]=t):t=e[0],t}export{zs as default};
@@ -1 +1 @@
1
- import{B as r}from"./collections-DVQWcwMA.js";import{bR as o}from"./index-CM1D3IOd.js";const m=o(r,{target:"draft-7"});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",a=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[a[t]&63];return e};function s(t){return`${t}_${l()}`}export{m as B,s as g};
1
+ import{B as r}from"./collections-DXz0tqzt.js";import{bR as o}from"./index-C_etCvW6.js";const m=o(r,{target:"draft-7"});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",a=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[a[t]&63];return e};function s(t){return`${t}_${l()}`}export{m as B,s as g};
@@ -1,4 +1,4 @@
1
- import{e as $,j as t,q as ae,D as ye,b as _e,r as P,K as X,n as ke,a as Te,c as ie,B as ve,t as he,o as Z,I as Ge,H as He,R as be,l as ce,s as Me}from"./index-CM1D3IOd.js";import{a as Ue}from"./use-virtual-mcp-2qLUU42J.js";import{a as je}from"./use-navigate-to-agent-TJFSx1rG.js";import{S as we,u as ee,W as De}from"./constants-BwYc8BqM.js";import{a as Ae,b as Ee,c as Re,d as Pe,D as ze}from"./dialog-TcaoJB0K.js";import{i as Ce}from"./RefreshCcw01-DYeBzgxl.js";import{C as Oe}from"./collection-search-CgHA_hw5.js";import{C as Ie}from"./checkbox-VBT4OFjs.js";import{b as qe,u as Fe}from"./use-connection-BA0O34v3.js";import{i as Be}from"./Lock01-CLcwdBbZ.js";import{n as Ve}from"./agent-icon-BbgplFYb.js";import{u as Ke}from"./use-mcp-tools-DSljy4qc.js";import{e as Qe}from"./extract-connection-data-Bh_Tkl8z.js";const Ye=`<svg width="74" height="84" viewBox="0 0 74 84" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ import{e as $,j as t,q as ae,D as ye,b as _e,r as P,K as X,n as ke,a as Te,c as ie,B as ve,t as he,o as Z,I as Ge,H as He,R as be,l as ce,s as Me}from"./index-C_etCvW6.js";import{a as Ue}from"./use-virtual-mcp-D92JJRrE.js";import{a as je}from"./use-navigate-to-agent-bdiV5j2z.js";import{S as we,u as ee,W as De}from"./constants-oggaZSfP.js";import{a as Ae,b as Ee,c as Re,d as Pe,D as ze}from"./dialog-B_fGUV_0.js";import{i as Ce}from"./RefreshCcw01-B7Js0dD2.js";import{C as Oe}from"./collection-search-XjYetQA3.js";import{C as Ie}from"./checkbox-cX_blfQo.js";import{b as qe,u as Fe}from"./use-connection--tE4CSIP.js";import{i as Be}from"./Lock01-BCib8CWc.js";import{n as Ve}from"./agent-icon-CPWEcMkW.js";import{u as Ke}from"./use-mcp-tools-C_ftxwer.js";import{e as Qe}from"./extract-connection-data-DM9YCvRC.js";const Ye=`<svg width="74" height="84" viewBox="0 0 74 84" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M63.4462 15.3005C63.1414 15.2764 57.2333 15.1845 57.2333 15.1845C57.2333 15.1845 52.2906 10.3849 51.8019 9.89426C51.6127 9.71981 51.3729 9.60981 51.1172 9.58008V83.0253L73.2664 77.5175C73.2664 77.5175 64.2277 16.3953 64.1696 15.9772C64.1417 15.7997 64.055 15.6366 63.9235 15.5139C63.7919 15.3913 63.6255 15.3162 63.4462 15.3005Z" fill="#171717"/>
3
3
  <path fill-rule="evenodd" clip-rule="evenodd" d="M32.748 0.00356357C34.8334 -0.0568526 36.5759 0.651298 37.9307 2.10122C38.0276 2.20613 38.1209 2.31463 38.2109 2.42544L38.2354 2.42349C38.4434 2.40657 38.6494 2.38638 38.8574 2.38638H38.8672C41.9831 2.3913 44.5571 4.16796 46.3184 7.527C46.8023 8.4621 47.2004 9.43976 47.5068 10.4469L49.9883 9.67837C50.3609 9.56961 51.315 9.42163 51.8037 9.90981L51.9922 82.3883L51.1162 83.0387L0 74.1979C0.0195597 74.0466 6.09952 27.0238 6.3291 25.3629C6.63636 23.1661 6.70922 23.0933 9.03906 22.361L16.957 19.9079C17.4531 16.377 19.1884 11.8165 21.4746 8.18423C24.7237 3.02487 28.7273 0.119714 32.748 0.00356357ZM38.8408 26.7077C38.8133 26.694 36.5926 25.6009 32.2842 25.8747C21.032 26.5853 15.9341 34.4515 16.4229 42.2213C17.0059 51.4485 26.2283 51.1199 26.584 56.734C26.6686 58.0922 25.8271 60.0114 23.4658 60.1588C19.8562 60.3883 15.3438 56.9831 15.3438 56.9831L13.6191 64.3249C13.6191 64.3249 18.1021 69.1296 26.2432 68.6149C33.027 68.1895 37.7351 62.759 37.2344 54.8249C36.5981 44.7397 25.2729 43.7966 25.002 39.4948C24.9512 38.7038 25.0055 35.556 29.9932 35.2418C33.3786 35.0279 36.2354 36.3195 36.2666 36.3336L38.8408 26.7077ZM32.8262 2.6813C26.6181 2.86014 21.2028 12.5587 19.8213 19.0211L26.8311 16.8512C27.6101 12.7476 29.5648 8.48928 32.1221 5.74868C33.0162 4.76667 34.0719 3.94401 35.2432 3.31704H35.2451C34.5654 2.87005 33.7695 2.66203 32.8262 2.6813ZM36.9775 5.46548C35.7921 5.95366 34.7952 6.80972 34.0791 7.57583C32.1608 9.63716 30.5951 12.7807 29.7725 15.9391L38.3057 13.2956C38.3322 11.0721 38.0904 7.7854 36.9775 5.46548ZM39.7568 5.14907C40.7052 7.59721 40.9505 10.4321 40.9795 12.4694L44.9473 11.2389C44.3133 9.17981 42.8075 5.72907 39.7568 5.14907Z" fill="#393939"/>
4
4
  </svg>`,Je=`data:image/svg+xml,${encodeURIComponent(Ye)}`,_t={title:"New Website",description:"Website cloned from a public template",url:"https://github.com/decocms/webapp-template",owner:"decocms",name:"webapp-template"},kt={title:"Shopify Headless Store",description:"Shopify Headless Store cloned from a public template",url:"https://github.com/Shopify/hydrogen-demo-store",owner:"Shopify",name:"hydrogen-demo-store",icon:Je};function Tt(){const o=$.c(6),e=Ue(),n=je();let r;o[0]!==e.create||o[1]!==n?(r=async i=>{const f=await e.create.mutateAsync({title:i.title,description:i.description,icon:i.icon??null,status:"active",pinned:!0,connections:[],metadata:{githubRepo:{url:i.url,owner:i.owner,name:i.name},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}});return f.id&&n(f.id),f},o[0]=e.create,o[1]=n,o[2]=r):r=o[2];const a=r;let s;return o[3]!==e.create.isPending||o[4]!==a?(s={createFromTemplate:a,isCreating:e.create.isPending},o[3]=e.create.isPending,o[4]=a,o[5]=s):s=o[5],s}function te(o){const e=$.c(4),{size:n,className:r}=o;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=a):a=e[0];let s;return e[1]!==r||e[2]!==n?(s=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:r,children:a}),e[1]=r,e[2]=n,e[3]=s):s=e[3],s}function We(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ze(o){const e=await fetch(`/api/${o}/deco-sites`);if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Failed to load sites (${e.status})`)}return e.json()}function At(o){const e=$.c(70),{open:n,onOpenChange:r,onBack:a}=o,{org:s}=ae(),i=je(),f=ye(),{data:h}=_e.useSession(),[m,w]=P.useState(null),[p,c]=P.useState("");let C;e[0]!==s.id||e[1]!==s.slug?(C={connectionId:we,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=C):C=e[2];const b=ee(C);let y;e[3]!==h?.user?.email?(y=X.decoSites(h?.user?.email),e[3]=h?.user?.email,e[4]=y):y=e[4];let u;e[5]!==s.slug?(u=()=>Ze(s.slug),e[5]=s.slug,e[6]=u):u=e[6];const g=n&&!!h?.user?.email;let j;e[7]!==y||e[8]!==u||e[9]!==g?(j={queryKey:y,queryFn:u,enabled:g,staleTime:6e4,retry:!1},e[7]=y,e[8]=u,e[9]=g,e[10]=j):j=e[10];const{data:N,isLoading:d,error:I}=ke(j),x=N?.sites??[];let v;e[11]!==r?(v=_=>{_||(w(null),c("")),r(_)},e[11]=r,e[12]=v):v=e[12];const k=v;let l;e[13]!==p?(l=_=>_.name.toLowerCase().includes(p.toLowerCase())||_.domains?.[0]?.domain.toLowerCase().includes(p.toLowerCase()),e[13]=p,e[14]=l):l=e[14];const S=x.filter(l),A=!m||S.some(_=>_.name===m);let T;e[15]!==b||e[16]!==s.id||e[17]!==s.slug?(T=async _=>{he("deco_site_import_started",{site_name:_});const G=await fetch(`/api/${s.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:_,orgId:s.id})}),H=await G.json().catch(tt);if(!G.ok)throw new Error(H.error??`Failed to create connection (${G.status})`);const L=H.connId;if(!L)throw new Error("Server did not return a connection ID");const re=H.icon??null,W=We(_),Se=await b.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:_,description:"Imported from deco.cx",pinned:!0,icon:re??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],ui:{banner:null,bannerColor:"#22C55E",icon:re,themeColor:"#22C55E",slug:W,pinnedViews:[{connectionId:L,toolName:"file_explorer",label:"Preview",icon:null},{connectionId:L,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:L,toolName:"get_monitor_data",label:"Monitor",icon:null},{connectionId:L,toolName:"list_pull_requests",label:"Pull Requests",icon:null},{connectionId:L,toolName:"list_releases",label:"Releases",icon:null}],layout:{defaultMainView:{type:"ext-apps",id:L,toolName:"file_explorer"},chatDefaultOpen:!0}}},connections:[{connection_id:L}]}}}),Ne=Se.structuredContent??Se;return{slug:W,virtualMcpId:Ne.item.id,connId:L,item:Ne.item}},e[15]=b,e[16]=s.id,e[17]=s.slug,e[18]=T):T=e[18];let R;e[19]!==b||e[20]!==k||e[21]!==i||e[22]!==s.id||e[23]!==f?(R=_=>{const{slug:G,virtualMcpId:H,item:L}=_;he("deco_site_import_succeeded",{site_name:L.title,virtual_mcp_id:H,slug:G}),f.setQueryData(X.collectionItem(b,s.id,"","VIRTUAL_MCP",H),{item:L}),f.invalidateQueries({predicate:re=>{const W=re.queryKey;return W[1]===s.id&&W[3]==="collection"&&W[4]==="VIRTUAL_MCP"}}),f.invalidateQueries({queryKey:X.projects(s.id)}),Z.success(`Imported ${G} from deco.cx`),k(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),i(H)},e[19]=b,e[20]=k,e[21]=i,e[22]=s.id,e[23]=f,e[24]=R):R=e[24];let O;e[25]!==T||e[26]!==R?(O={mutationFn:T,onSuccess:R,onError:et},e[25]=T,e[26]=R,e[27]=O):O=e[27];const E=Te(O),ue=Ee,de=Ae,Le="sm:max-w-[900px] p-0 gap-0 overflow-hidden";let M;e[28]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Re,{className:"sr-only",children:t.jsx(Pe,{children:"Import from deco.cx"})}),e[28]=M):M=e[28];let U;e[29]!==a?(U=a&&t.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:t.jsx(Ce,{size:18})}),e[29]=a,e[30]=U):U=e[30];let ne;e[31]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"}),e[31]=ne):ne=e[31];let D;e[32]!==U?(D=t.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[U,ne]}),e[32]=U,e[33]=D):D=e[33];let se;e[34]===Symbol.for("react.memo_cache_sentinel")?(se=_=>{_.key==="Escape"&&c("")},e[34]=se):se=e[34];let z;e[35]!==p?(z=t.jsx("div",{children:t.jsx(Oe,{value:p,onChange:c,placeholder:"Search sites...",onKeyDown:se})}),e[35]=p,e[36]=z):z=e[36];const $e="pb-0 min-h-[300px]";let q;e[37]!==d?(q=d&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),e[37]=d,e[38]=q):q=e[38];const me=!d&&!I&&x.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),fe=!d&&x.length>0&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[S.length===0&&t.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",p,"”"]}),S.map(_=>{const G=_.domains?.find(Xe)?.domain??_.domains?.[0]?.domain,H=m===_.name;return t.jsxs("button",{type:"button",onClick:()=>w(_.name),className:ie("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",H?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[t.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:_.thumb_url?t.jsx("img",{src:_.thumb_url,alt:_.name,className:"w-full h-full object-cover",loading:"lazy"}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsxs("div",{className:"px-4 py-3",children:[t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:_.name}),G&&t.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},_.name)})]});let F;e[39]!==q||e[40]!==me||e[41]!==fe?(F=t.jsxs("div",{className:$e,children:[q,me,fe]}),e[39]=q,e[40]=me,e[41]=fe,e[42]=F):F=e[42];let B;e[43]!==k?(B=()=>k(!1),e[43]=k,e[44]=B):B=e[44];let V;e[45]!==E.isPending||e[46]!==B?(V=t.jsx(ve,{variant:"outline",onClick:B,disabled:E.isPending,children:"Cancel"}),e[45]=E.isPending,e[46]=B,e[47]=V):V=e[47];const pe=!m||!A||E.isPending||d;let K;e[48]!==E||e[49]!==m?(K=()=>m&&E.mutate(m),e[48]=E,e[49]=m,e[50]=K):K=e[50];const ge=E.isPending?"Importing...":"Import";let Q;e[51]!==pe||e[52]!==K||e[53]!==ge?(Q=t.jsx(ve,{disabled:pe,onClick:K,children:ge}),e[51]=pe,e[52]=K,e[53]=ge,e[54]=Q):Q=e[54];let Y;e[55]!==V||e[56]!==Q?(Y=t.jsxs(ze,{className:"px-8 py-5 border-t border-border",children:[V,Q]}),e[55]=V,e[56]=Q,e[57]=Y):Y=e[57];let J;e[58]!==de||e[59]!==M||e[60]!==D||e[61]!==z||e[62]!==F||e[63]!==Y?(J=t.jsxs(de,{className:Le,children:[M,D,z,F,Y]}),e[58]=de,e[59]=M,e[60]=D,e[61]=z,e[62]=F,e[63]=Y,e[64]=J):J=e[64];let oe;return e[65]!==ue||e[66]!==k||e[67]!==n||e[68]!==J?(oe=t.jsx(ue,{open:n,onOpenChange:k,children:J}),e[65]=ue,e[66]=k,e[67]=n,e[68]=J,e[69]=oe):oe=e[69],oe}function Xe(o){return o.production}function et(o){he("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),Z.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}function tt(){return{}}function nt(o,e){const n=$.c(4),[r,a]=P.useState(o);let s,i;return n[0]!==e||n[1]!==o?(s=()=>{const f=setTimeout(()=>a(o),e);return()=>clearTimeout(f)},i=[o,e],n[0]=e,n[1]=o,n[2]=s,n[3]=i):(s=n[2],i=n[3]),P.useEffect(s,i),r}function st(o,e){const n=$.c(12),{org:r}=ae();let a;n[0]!==r.id?(a=De.REGISTRY(r.id),n[0]=r.id,n[1]=a):a=n[1];const s=a;let i;n[2]!==r.id||n[3]!==r.slug||n[4]!==s?(i={connectionId:s,orgId:r.id,orgSlug:r.slug},n[2]=r.id,n[3]=r.slug,n[4]=s,n[5]=i):i=n[5];const f=ee(i);let h;n[6]!==o?(h={name:o},n[6]=o,n[7]=h):h=n[7];const m=e?.enabled??!0;let w;return n[8]!==f||n[9]!==h||n[10]!==m?(w={client:f,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:h,enabled:m,staleTime:3e5,select:ot},n[8]=f,n[9]=h,n[10]=m,n[11]=w):w=n[11],Ke(w)}function ot(o){return o.structuredContent?.item??null}const rt="deco/mcp-github";function it(o){const{org:e}=ae(),{data:n}=_e.useSession(),r=qe(),a=ye(),[s,i]=P.useState("idle"),[f,h]=P.useState(null),[m,w]=P.useState(null),{data:p,isLoading:c}=st(rt,{enabled:o.enabled}),C=P.useRef(!1);o.enabled&&p&&!c&&!C.current&&n?.user?.id&&s==="idle"&&(C.current=!0,b());async function b(){if(!(!p||!n?.user?.id||!e))try{i("installing"),h(null);const u=Qe(p,e.id,n.user.id,{remoteIndex:0});if(!u.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:j}=await r.create.mutateAsync(u);i("authenticating");const N=new URL(`/api/${e.slug}/mcp/${j}`,window.location.origin),d=await Ge({url:N.href,token:null,orgId:e.id});if(d.supportsOAuth&&!d.isAuthenticated){const{token:I,tokenInfo:x,error:v}=await He({connectionId:j,orgSlug:e.slug,scope:"offline_access"});if(v||!I){try{await r.delete.mutateAsync(j)}catch{}throw new Error(v??"No token received from GitHub")}if(x)try{(await fetch(`/api/${e.slug}/connections/${j}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:x.accessToken,refreshToken:x.refreshToken,expiresIn:x.expiresIn,scope:x.scope,clientId:x.clientId,clientSecret:x.clientSecret,tokenEndpoint:x.tokenEndpoint})})).ok||await r.update.mutateAsync({id:j,data:{connection_token:I}})}catch{await r.update.mutateAsync({id:j,data:{connection_token:I}})}}be(a,e.id),w(u),i("ready")}catch(u){h(u instanceof Error?u.message:String(u)),i("error")}}function y(){i("idle"),h(null),w(null),C.current=!1}return o.enabled&&c&&s==="idle"?{status:"installing",error:null,connection:null,retry:y}:{status:s,error:f,connection:m,retry:y}}const le=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:o,name:e})=>`A new GitHub issue has been opened in ${o}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:o,name:e})=>`A pull request was opened in ${o}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:o,name:e})=>`A pull request was closed in ${o}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function lt(o,e){const n=new Set;if(o.paramsSchema)for(const a of Object.keys(o.paramsSchema))n.add(a);if(Array.isArray(o.params))for(const a of o.params)n.add(a.name);else if(o.params&&typeof o.params=="object")for(const a of Object.keys(o.params))n.add(a);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const r={};return n.has("owner")&&(r.owner=e.owner),n.has("name")&&(r.name=e.name),n.has("repository")&&(r.repository=`${e.owner}/${e.name}`),r}async function at({githubCallTool:o,selfCallTool:e,virtualMcpId:n,repo:r,connectionId:a,selectedKeys:s}){const i=await o({name:"TRIGGER_LIST",arguments:{}}),f=i.structuredContent??i,h=new Map((f.triggers??[]).map(c=>[c.type,c])),m=le.filter(c=>s.has(c.key)),w=await Promise.allSettled(m.map(async c=>{const C=h.get(c.triggerType);if(!C)throw new Error(`Trigger ${c.triggerType} not exposed`);const b=await e({name:"AUTOMATION_CREATE",arguments:{name:`${r.name}: ${c.nameSuffix}`,virtual_mcp_id:n,messages:c.instructions(r),active:!0}}),y=(b.structuredContent??b).id;if(!y)throw new Error(`AUTOMATION_CREATE returned no id for ${c.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:y,type:"event",connection_id:a,event_type:c.triggerType,params:lt(C,r)}})})),p=w.filter(c=>c.status==="rejected").length;return p>0&&console.error("Some GitHub automations failed to set up:",w.filter(c=>c.status==="rejected")),{total:w.length,failed:p}}function Et(o){const e=$.c(21),{open:n,onOpenChange:r,title:a,hideAutoRespondCheckbox:s,onImportComplete:i}=o,f=a===void 0?"Import from GitHub":a,h=s===void 0?!1:s,[m,w]=P.useState(null);let p;e[0]!==f?(p=t.jsx(Re,{className:"sr-only",children:t.jsx(Pe,{children:f})}),e[0]=f,e[1]=p):p=e[1];let c;e[2]!==m||e[3]!==f?(c=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:m?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>w(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Ce,{size:16})}),t.jsx("img",{src:m.avatarUrl,alt:m.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:m.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(te,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:f})]})}),e[2]=m,e[3]=f,e[4]=c):c=e[4];let C;e[5]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ce,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=C):C=e[5];let b;e[6]!==r?(b=()=>r(!1),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==h||e[9]!==i||e[10]!==m||e[11]!==b?(y=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(P.Suspense,{fallback:C,children:t.jsx(ct,{onComplete:b,selectedInstallation:m,onSelectInstallation:w,hideAutoRespondCheckbox:h,onImportComplete:i})})}),e[8]=h,e[9]=i,e[10]=m,e[11]=b,e[12]=y):y=e[12];let u;e[13]!==p||e[14]!==c||e[15]!==y?(u=t.jsxs(Ae,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[p,c,y]}),e[13]=p,e[14]=c,e[15]=y,e[16]=u):u=e[16];let g;return e[17]!==r||e[18]!==n||e[19]!==u?(g=t.jsx(Ee,{open:n,onOpenChange:r,children:u}),e[17]=r,e[18]=n,e[19]=u,e[20]=g):g=e[20],g}function ct({onComplete:o,selectedInstallation:e,onSelectInstallation:n,hideAutoRespondCheckbox:r,onImportComplete:a}){const{org:s}=ae(),i=ye(),f=je(),[h,m]=P.useState(null),[w,p]=P.useState(!0),[c,C]=P.useState(()=>new Set(le.filter(l=>l.defaultEnabled).map(l=>l.key))),b=le.filter(l=>l.defaultEnabled).map(l=>l.key),y=r?new Set(b):w?c:new Set,u=Fe({slug:"mcp-github"}),g=it({enabled:u.length===0}),j=u.length===1?u[0]??null:h,N=ee({connectionId:j?.id??"",orgId:s.id,orgSlug:s.slug}),d=ee({connectionId:we,orgId:s.id,orgSlug:s.slug}),I=async(l,S)=>{try{const T=await N.callTool({name:"get_file_contents",arguments:{owner:l.owner,repo:l.name,path:S}});if(T.isError)return null;const O=T.content?.find(E=>E.type==="resource")?.resource?.text;if(!O)return null;try{const E=JSON.parse(O);return typeof E=="string"?E:JSON.stringify(E)}catch{return O}}catch{return null}},x=(l,S)=>{Promise.all([I(S,"AGENTS.md"),I(S,"CLAUDE.md")]).then(async([A,T])=>{const R=A??T??null;R&&(await d.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:l,data:{metadata:{instructions:R}}}}),be(i,s.id))}).catch(A=>{console.error("GitHub instructions fetch failed:",A)})},v=async({virtualMcpId:l,repo:S,connectionId:A,selectedKeys:T})=>{const{total:R,failed:O}=await at({githubCallTool:E=>N.callTool(E),selfCallTool:E=>d.callTool(E),virtualMcpId:l,repo:S,connectionId:A,selectedKeys:T});O>0&&Z.warning(`Set up ${R-O}/${R} GitHub automations. Add the rest from the automations view.`)},k=Te({mutationFn:async l=>{if(!j||!e)throw new Error("No GitHub connection or installation");const S=j.id,A=await d.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:l.name,description:l.description||"Imported from GitHub",pinned:!0,icon:null,metadata:{githubRepo:{owner:l.owner,name:l.name,url:l.url,installationId:e.installationId,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),T=A.structuredContent??A,R=T.item.id;return y.size>0&&await v({virtualMcpId:R,repo:l,connectionId:S,selectedKeys:y}).catch(O=>{console.error("Failed to set up GitHub automations:",O),Z.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:R,repo:l,connectionId:S,item:T.item}},onSuccess:({virtualMcpId:l,repo:S,connectionId:A,item:T})=>{if(i.setQueryData(X.collectionItem(d,s.id,"","VIRTUAL_MCP",l),{item:T}),be(i,s.id),x(l,S),a){a({virtualMcpId:l,repo:S,connectionId:A});return}Z.success(`Imported ${S.name} from GitHub`),o(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),f(l)},onError:l=>{Z.error("Failed to import repo: "+(l instanceof Error?l.message:"Unknown error"))}});return g.status==="installing"||g.status==="authenticating"?t.jsx(xe,{status:g.status,error:null,retry:g.retry}):g.status==="error"?t.jsx(xe,{status:"error",error:g.error,retry:g.retry}):u.length===0&&g.status==="idle"?t.jsx(xe,{status:"installing",error:null,retry:g.retry}):u.length>1&&!j?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(l=>t.jsxs("button",{type:"button",onClick:()=>m(l),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[l.icon?t.jsx("img",{src:l.icon,alt:l.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(te,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:l.title})]},l.id))]}):j?e?t.jsx(dt,{connectionId:j.id,orgId:s.id,orgSlug:s.slug,installation:e,onSelectRepo:l=>k.mutate(l),isSaving:k.isPending,autoRespondEnabled:w,onAutoRespondChange:p,selectedAutomationKeys:c,onAutomationKeysChange:C,hideAutoRespondCheckbox:r}):t.jsx(ut,{connectionId:j.id,orgId:s.id,orgSlug:s.slug,onSelect:n,showBackButton:u.length>1,onBack:()=>m(null)}):null}function ut(o){const e=$.c(31),{connectionId:n,orgId:r,orgSlug:a,onSelect:s,showBackButton:i,onBack:f}=o;let h;e[0]!==r||e[1]!==a?(h={connectionId:we,orgId:r,orgSlug:a},e[0]=r,e[1]=a,e[2]=h):h=e[2];const m=ee(h);let w;e[3]!==n||e[4]!==r?(w=X.githubUserOrgs(r,n),e[3]=n,e[4]=r,e[5]=w):w=e[5];let p;e[6]!==n||e[7]!==m?(p=async()=>{const v=(await m.callTool({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:n}})).content?.[0]?.text;if(!v)throw new Error("No response from GITHUB_LIST_USER_ORGS");return JSON.parse(v)},e[6]=n,e[7]=m,e[8]=p):p=e[8];let c;e[9]!==w||e[10]!==p?(c={queryKey:w,queryFn:p},e[9]=w,e[10]=p,e[11]=c):c=e[11];const C=ke(c);if(C.isLoading){let x;return e[12]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ce,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=x):x=e[12],x}if(C.isError){let x;return e[13]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=x):x=e[13],x}const b=C.data;if(!b)return null;let y;e[14]!==f||e[15]!==i?(y=i&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:f,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Ce,{size:12}),"Change connection"]})}),e[14]=f,e[15]=i,e[16]=y):y=e[16];let u;if(e[17]!==b.installations||e[18]!==s){let x;e[20]!==s?(x=v=>t.jsxs("button",{type:"button",onClick:()=>s(v),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:v.login}),v.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},v.installationId),e[20]=s,e[21]=x):x=e[21],u=b.installations.map(x),e[17]=b.installations,e[18]=s,e[19]=u}else u=e[19];let g;e[22]!==u?(g=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:u}),e[22]=u,e[23]=g):g=e[23];const j=b.appSlug?`https://github.com/apps/${b.appSlug}/installations/new`:"https://github.com/settings/installations";let N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=N):N=e[24];let d;e[25]!==j?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",N]})}),e[25]=j,e[26]=d):d=e[26];let I;return e[27]!==d||e[28]!==y||e[29]!==g?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[y,g,d]}),e[27]=d,e[28]=y,e[29]=g,e[30]=I):I=e[30],I}function dt(o){const e=$.c(27),{connectionId:n,orgId:r,orgSlug:a,installation:s,onSelectRepo:i,isSaving:f,autoRespondEnabled:h,onAutoRespondChange:m,selectedAutomationKeys:w,onAutomationKeysChange:p,hideAutoRespondCheckbox:c}=o,[C,b]=P.useState(""),y=nt(C,300),u=P.useDeferredValue(y),g=C!==u;let j;e[0]!==g||e[1]!==C?(j=t.jsx(Oe,{placeholder:"Search repositories...",value:C,onChange:b,isSearching:g}),e[0]=g,e[1]=C,e[2]=j):j=e[2];const N=g?"opacity-40":"opacity-100";let d;e[3]!==N?(d=ie("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",N),e[3]=N,e[4]=d):d=e[4];let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ce,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=I):I=e[5];let x;e[6]!==n||e[7]!==u||e[8]!==s||e[9]!==f||e[10]!==i||e[11]!==r||e[12]!==a?(x=t.jsx(P.Suspense,{fallback:I,children:t.jsx(mt,{connectionId:n,orgId:r,orgSlug:a,installation:s,query:u,onSelectRepo:i,isSaving:f})}),e[6]=n,e[7]=u,e[8]=s,e[9]=f,e[10]=i,e[11]=r,e[12]=a,e[13]=x):x=e[13];let v;e[14]!==d||e[15]!==x?(v=t.jsx("div",{className:d,children:x}),e[14]=d,e[15]=x,e[16]=v):v=e[16];let k;e[17]!==h||e[18]!==c||e[19]!==m||e[20]!==p||e[21]!==w?(k=!c&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(Ie,{checked:h,onCheckedChange:S=>m(S===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),h&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:le.map(S=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(Ie,{checked:w.has(S.key),onCheckedChange:A=>{const T=new Set(w);A===!0?T.add(S.key):T.delete(S.key),p(T)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:S.label})]},S.key))})]}),e[17]=h,e[18]=c,e[19]=m,e[20]=p,e[21]=w,e[22]=k):k=e[22];let l;return e[23]!==j||e[24]!==v||e[25]!==k?(l=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[j,v,k]}),e[23]=j,e[24]=v,e[25]=k,e[26]=l):l=e[26],l}function mt(o){const e=$.c(29),{connectionId:n,orgId:r,orgSlug:a,installation:s,query:i,onSelectRepo:f,isSaving:h}=o;let m;e[0]!==n||e[1]!==r||e[2]!==a?(m={connectionId:n,orgId:r,orgSlug:a},e[0]=n,e[1]=r,e[2]=a,e[3]=m):m=e[3];const w=ee(m),p=s.type==="User"?"user":"org",c=i?`${p}:${s.login} ${i} in:name`:`${p}:${s.login}`;let C;e[4]!==n||e[5]!==s.login||e[6]!==r||e[7]!==i?(C=X.githubOrgRepos(r,n,s.login,i),e[4]=n,e[5]=s.login,e[6]=r,e[7]=i,e[8]=C):C=e[8];let b;e[9]!==w||e[10]!==c?(b=async N=>{const{signal:d}=N,x=(await w.callTool({name:"search_repositories",arguments:{query:c,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!x)throw new Error("No response from search_repositories");return(JSON.parse(x).items??[]).map(ft)},e[9]=w,e[10]=c,e[11]=b):b=e[11];let y;e[12]!==C||e[13]!==b?(y={queryKey:C,queryFn:b},e[12]=C,e[13]=b,e[14]=y):y=e[14];const{data:u}=Me(y);if(u.length===0){let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=N):N=e[15];let d;e[16]!==i?(d=i&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=i,e[17]=d):d=e[17];let I;return e[18]!==d?(I=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[N,d]}),e[18]=d,e[19]=I):I=e[19],I}let g;if(e[20]!==h||e[21]!==f||e[22]!==u){let N;e[24]!==h||e[25]!==f?(N=d=>t.jsxs("button",{type:"button",onClick:()=>f(d),disabled:h,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(te,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:d.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[d.private?t.jsx(Be,{size:10}):t.jsx(Ve,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=h,e[25]=f,e[26]=N):N=e[26],g=u.map(N),e[20]=h,e[21]=f,e[22]=u,e[23]=g}else g=e[23];let j;return e[27]!==g?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[27]=g,e[28]=j):j=e[28],j}function ft(o){return{name:o.name,fullName:o.full_name,owner:o.full_name.split("/")[0]??"",url:o.html_url,private:o.private,description:o.description,updatedAt:o.updated_at}}function xe(o){const e=$.c(33),{status:n,error:r,retry:a}=o;if(n==="error"){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(te,{className:"size-5 text-destructive"})}),e[0]=x):x=e[0];let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=v):v=e[1];const k=r??"Something went wrong while connecting to GitHub.";let l;e[2]!==k?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:k})]}),e[2]=k,e[3]=l):l=e[3];let S;e[4]!==a?(S=t.jsx("button",{type:"button",onClick:a,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=a,e[5]=S):S=e[5];let A;return e[6]!==l||e[7]!==S?(A=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[x,l,S]}),e[6]=l,e[7]=S,e[8]=A):A=e[8],A}const s=n==="authenticating";let i;e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(te,{className:"size-5 text-foreground"})}),e[9]=i):i=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"relative size-10",children:[i,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(ce,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=f):f=e[10];const h=s?"Authenticating with GitHub":"Setting up GitHub";let m;e[11]!==h?(m=t.jsx("p",{className:"text-sm font-medium",children:h}),e[11]=h,e[12]=m):m=e[12];const w=s?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let p;e[13]!==w?(p=t.jsx("p",{className:"text-xs text-muted-foreground",children:w}),e[13]=w,e[14]=p):p=e[14];let c;e[15]!==m||e[16]!==p?(c=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[m,p]}),e[15]=m,e[16]=p,e[17]=c):c=e[17];const C=s?"bg-muted-foreground/30":"bg-foreground animate-pulse";let b;e[18]!==C?(b=ie("size-1.5 rounded-full",C),e[18]=C,e[19]=b):b=e[19];let y;e[20]!==b?(y=t.jsx("span",{className:b}),e[20]=b,e[21]=y):y=e[21];const u=s?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[22]!==u?(g=ie("size-1.5 rounded-full",u),e[22]=u,e[23]=g):g=e[23];let j;e[24]!==g?(j=t.jsx("span",{className:g}),e[24]=g,e[25]=j):j=e[25];let N;e[26]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=N):N=e[26];let d;e[27]!==y||e[28]!==j?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[y,j,N]}),e[27]=y,e[28]=j,e[29]=d):d=e[29];let I;return e[30]!==d||e[31]!==c?(I=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[f,c,d]}),e[30]=d,e[31]=c,e[32]=I):I=e[32],I}export{te as G,kt as H,At as I,Je as S,_t as W,Et as a,Tt as u};
@@ -1,4 +1,4 @@
1
- import{U as gt,bQ as yt,bR as bt,bG as M,P as c,bS as se,bT as Ue,bU as Et,bV as _t,M as It,aq as A,ap as $,an as K,J as b,aY as f,aM as k,bW as St,bX as E,ao as Tt,o as fe,e as ye,q as wt,j as At,r as z}from"./index-CM1D3IOd.js";import{S as Mt,u as Ot}from"./constants-BwYc8BqM.js";import{d as Ct,D as Nt}from"./decopilot-sse-pool-B9BzYuaT.js";var X;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(X||(X={}));var Se;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Se||(Se={}));X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);X.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ne extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,d=0;for(;d<i.path.length;){const l=i.path[d];d===i.path.length-1?(n[l]=n[l]||{_errors:[]},n[l]._errors.push(a(i))):n[l]=n[l]||{_errors:[]},n=n[l],d++}}};return s(this),r}static assert(e){if(!(e instanceof ne))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,X.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ne.create=t=>new ne(t);var Te;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Te||(Te={}));var m;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(m||(m={}));const Rt=1e4,Rr="true";function ie(t,e){return gt.chatAutosend(t,e)}function xt(t){return t==="pending"||t==="sending"}function Pt(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return!e||typeof e!="object"||typeof e.createdAt!="number"||typeof e.message!="object"||!xt(e.status)?null:e}function xr(t,e,a,r,s=Date.now()){const o={message:r,createdAt:s,status:"pending"};return t.setItem(ie(e,a),JSON.stringify(o)),o}function Dt(t,e,a){const r=ie(e,a),s=Pt(t.getItem(r));return s||(t.removeItem(r),null)}function Pr(t,e,a,r=Date.now()){const s=ie(e,a),o=Dt(t,e,a);return!o||o.status!=="pending"?null:r-o.createdAt>=Rt?(t.removeItem(s),null):(t.setItem(s,JSON.stringify({...o,status:"sending"})),{message:o.message,createdAt:o.createdAt})}function Dr(t,e,a){t.removeItem(ie(e,a))}var Be="vercel.ai.error",Lt=Symbol.for(Be),we,Ae,x=class Fe extends(Ae=Error,we=Lt,Ae){constructor({name:e,message:a,cause:r}){super(a),this[we]=!0,this.name=e,this.cause=r}static isInstance(e){return Fe.hasMarker(e,Be)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ve(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var ze="AI_InvalidArgumentError",Je=`vercel.ai.error.${ze}`,kt=Symbol.for(Je),Me,Oe,Zt=class extends(Oe=x,Me=kt,Oe){constructor({message:t,cause:e,argument:a}){super({name:ze,message:t,cause:e}),this[Me]=!0,this.argument=a}static isInstance(t){return x.hasMarker(t,Je)}},Ye="AI_JSONParseError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Ce,Ne,Re=class extends(Ne=x,Ce=jt,Ne){constructor({text:t,cause:e}){super({name:Ye,message:`JSON parsing failed: Text: ${t}.
1
+ import{U as gt,bQ as yt,bR as bt,bG as M,P as c,bS as se,bT as Ue,bU as Et,bV as _t,M as It,aq as A,ap as $,an as K,J as b,aY as f,aM as k,bW as St,bX as E,ao as Tt,o as fe,e as ye,q as wt,j as At,r as z}from"./index-C_etCvW6.js";import{S as Mt,u as Ot}from"./constants-oggaZSfP.js";import{d as Ct,D as Nt}from"./decopilot-sse-pool-atg0HfN2.js";var X;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(n=>typeof s[s[n]]!="number"),i={};for(const n of o)i[n]=s[n];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(X||(X={}));var Se;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Se||(Se={}));X.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);X.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ne extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let n=r,d=0;for(;d<i.path.length;){const l=i.path[d];d===i.path.length-1?(n[l]=n[l]||{_errors:[]},n[l]._errors.push(a(i))):n[l]=n[l]||{_errors:[]},n=n[l],d++}}};return s(this),r}static assert(e){if(!(e instanceof ne))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,X.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];a[o]=a[o]||[],a[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ne.create=t=>new ne(t);var Te;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Te||(Te={}));var m;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(m||(m={}));const Rt=1e4,Rr="true";function ie(t,e){return gt.chatAutosend(t,e)}function xt(t){return t==="pending"||t==="sending"}function Pt(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return!e||typeof e!="object"||typeof e.createdAt!="number"||typeof e.message!="object"||!xt(e.status)?null:e}function xr(t,e,a,r,s=Date.now()){const o={message:r,createdAt:s,status:"pending"};return t.setItem(ie(e,a),JSON.stringify(o)),o}function Dt(t,e,a){const r=ie(e,a),s=Pt(t.getItem(r));return s||(t.removeItem(r),null)}function Pr(t,e,a,r=Date.now()){const s=ie(e,a),o=Dt(t,e,a);return!o||o.status!=="pending"?null:r-o.createdAt>=Rt?(t.removeItem(s),null):(t.setItem(s,JSON.stringify({...o,status:"sending"})),{message:o.message,createdAt:o.createdAt})}function Dr(t,e,a){t.removeItem(ie(e,a))}var Be="vercel.ai.error",Lt=Symbol.for(Be),we,Ae,x=class Fe extends(Ae=Error,we=Lt,Ae){constructor({name:e,message:a,cause:r}){super(a),this[we]=!0,this.name=e,this.cause=r}static isInstance(e){return Fe.hasMarker(e,Be)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ve(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var ze="AI_InvalidArgumentError",Je=`vercel.ai.error.${ze}`,kt=Symbol.for(Je),Me,Oe,Zt=class extends(Oe=x,Me=kt,Oe){constructor({message:t,cause:e,argument:a}){super({name:ze,message:t,cause:e}),this[Me]=!0,this.argument=a}static isInstance(t){return x.hasMarker(t,Je)}},Ye="AI_JSONParseError",He=`vercel.ai.error.${Ye}`,jt=Symbol.for(He),Ce,Ne,Re=class extends(Ne=x,Ce=jt,Ne){constructor({text:t,cause:e}){super({name:Ye,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${Ve(e)}`,cause:e}),this[Ce]=!0,this.text=t}static isInstance(t){return x.hasMarker(t,He)}},We="AI_TypeValidationError",qe=`vercel.ai.error.${We}`,$t=Symbol.for(qe),xe,Pe,Y=class me extends(Pe=x,xe=$t,Pe){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const o=[];r.entityName&&o.push(r.entityName),r.entityId&&o.push(`id: "${r.entityId}"`),s+=o.join(", "),s+=")"}super({name:We,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Ve(a)}`,cause:a}),this[xe]=!0,this.value=e,this.context=r}static isInstance(e){return x.hasMarker(e,qe)}static wrap({value:e,cause:a,context:r}){var s,o,i;return me.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((o=a.context)==null?void 0:o.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new me({value:e,cause:a,context:r})}},ee=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const o=a.length,i=new Array(e);for(let n=0;n<e;n++)i[n]=a[Math.random()*o|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new Zt({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ee();var Ut=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Bt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function De(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Ut.test(t)===!1&&Bt.test(t)===!1?e:Ft(e)}function Ft(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const o=r[s];o&&typeof o=="object"&&e.push(o)}}}return t}function Vt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return De(t)}try{return De(t)}finally{Error.stackTraceLimit=e}}function be(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=j(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(j):j(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(j)),t.allOf!=null&&(t.allOf=t.allOf.map(j)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(j));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=j(e[a]);return t}function j(t){return typeof t=="boolean"?t:be(t)}var zt=Symbol("Let zodToJsonSchema decide on which parser to use"),Le={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Jt=t=>typeof t=="string"?{...Le,name:t}:{...Le,...t};function O(){return{}}function Yt(t,e){var a,r,s;const o={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==m.ZodAny&&(o.items=g(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(o.minItems=t.minLength.value),t.maxLength&&(o.maxItems=t.maxLength.value),t.exactLength&&(o.minItems=t.exactLength.value,o.maxItems=t.exactLength.value),o}function Ht(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function Wt(){return{type:"boolean"}}function Ge(t,e){return g(t.type._def,e)}var qt=(t,e)=>g(t.innerType._def,e);function Xe(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,o)=>Xe(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Gt(t)}}var Gt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Xt(t,e){return{...g(t.innerType._def,e),default:t.defaultValue()}}function Qt(t,e){return e.effectStrategy==="input"?g(t.schema._def,e):O()}function Kt(t){return{type:"string",enum:Array.from(t.values)}}var ea=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function ta(t,e){const a=[g(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),g(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(ea(s))r.push(...s.allOf);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...n}=s;o=n}r.push(o)}}),r.length?{allOf:r}:void 0}function aa(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var de=void 0,C={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(de===void 0&&(de=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),de),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Qe(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":N(a,"email",r.message,e);break;case"format:idn-email":N(a,"idn-email",r.message,e);break;case"pattern:zod":w(a,C.email,r.message,e);break}break;case"url":N(a,"uri",r.message,e);break;case"uuid":N(a,"uuid",r.message,e);break;case"regex":w(a,r.regex,r.message,e);break;case"cuid":w(a,C.cuid,r.message,e);break;case"cuid2":w(a,C.cuid2,r.message,e);break;case"startsWith":w(a,RegExp(`^${ce(r.value,e)}`),r.message,e);break;case"endsWith":w(a,RegExp(`${ce(r.value,e)}$`),r.message,e);break;case"datetime":N(a,"date-time",r.message,e);break;case"date":N(a,"date",r.message,e);break;case"time":N(a,"time",r.message,e);break;case"duration":N(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{w(a,RegExp(ce(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&N(a,"ipv4",r.message,e),r.version!=="v4"&&N(a,"ipv6",r.message,e);break}case"base64url":w(a,C.base64url,r.message,e);break;case"jwt":w(a,C.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&w(a,C.ipv4Cidr,r.message,e),r.version!=="v4"&&w(a,C.ipv6Cidr,r.message,e);break}case"emoji":w(a,C.emoji(),r.message,e);break;case"ulid":{w(a,C.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{N(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{w(a,C.base64,r.message,e);break}}break}case"nanoid":w(a,C.nanoid,r.message,e)}return a}function ce(t,e){return e.patternStrategy==="escape"?sa(t):t}var ra=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sa(t){let e="";for(let a=0;a<t.length;a++)ra.has(t[a])||(e+="\\"),e+=t[a];return e}function N(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function w(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:ke(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=ke(e,r)}function ke(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let o="",i=!1,n=!1,d=!1;for(let l=0;l<s.length;l++){if(i){o+=s[l],i=!1;continue}if(r.i){if(n){if(s[l].match(/[a-z]/)){d?(o+=s[l],o+=`${s[l-2]}-${s[l]}`.toUpperCase(),d=!1):s[l+1]==="-"&&((a=s[l+2])!=null&&a.match(/[a-z]/))?(o+=s[l],d=!0):o+=`${s[l]}${s[l].toUpperCase()}`;continue}}else if(s[l].match(/[a-z]/)){o+=`[${s[l]}${s[l].toUpperCase()}]`;continue}}if(r.m){if(s[l]==="^"){o+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(s[l]==="$"){o+=`($|(?=[\r
@@ -1 +1 @@
1
- import{r as i,j as l,c7 as k,a4 as F,a5 as f,aV as T,c8 as $,aS as I,c6 as U,c9 as O,b4 as W,cf as z,cg as B,ab as G,ch as K,e as E,c as V}from"./index-CM1D3IOd.js";var w,R="HoverCard",[N]=G(R,[O]),b=O(),[q,S]=N(R),_=o=>{const{__scopeHoverCard:e,children:t,open:r,defaultOpen:a,onOpenChange:s,openDelay:d=700,closeDelay:u=300}=o,c=b(e),p=i.useRef(0),v=i.useRef(0),C=i.useRef(!1),h=i.useRef(!1),[m,n]=I({prop:r,defaultProp:a??!1,onChange:s,caller:R}),x=i.useCallback(()=>{clearTimeout(v.current),p.current=window.setTimeout(()=>n(!0),d)},[d,n]),L=i.useCallback(()=>{clearTimeout(p.current),!C.current&&!h.current&&(v.current=window.setTimeout(()=>n(!1),u))},[u,n]),M=i.useCallback(()=>n(!1),[n]);return i.useEffect(()=>()=>{clearTimeout(p.current),clearTimeout(v.current)},[]),l.jsx(q,{scope:e,open:m,onOpenChange:n,onOpen:x,onClose:L,onDismiss:M,hasSelectionRef:C,isPointerDownOnContentRef:h,children:l.jsx(U,{...c,children:t})})};_.displayName=R;var y="HoverCardTrigger",D=i.forwardRef((o,e)=>{const{__scopeHoverCard:t,...r}=o,a=S(y,t),s=b(t);return l.jsx(k,{asChild:!0,...s,children:l.jsx(F.a,{"data-state":a.open?"open":"closed",...r,ref:e,onPointerEnter:f(o.onPointerEnter,P(a.onOpen)),onPointerLeave:f(o.onPointerLeave,P(a.onClose)),onFocus:f(o.onFocus,a.onOpen),onBlur:f(o.onBlur,a.onClose),onTouchStart:f(o.onTouchStart,d=>d.preventDefault())})})});D.displayName=y;var H="HoverCardPortal",[J,Q]=N(H,{forceMount:void 0}),j=o=>{const{__scopeHoverCard:e,forceMount:t,children:r,container:a}=o,s=S(H,e);return l.jsx(J,{scope:e,forceMount:t,children:l.jsx(T,{present:t||s.open,children:l.jsx($,{asChild:!0,container:a,children:r})})})};j.displayName=H;var g="HoverCardContent",A=i.forwardRef((o,e)=>{const t=Q(g,o.__scopeHoverCard),{forceMount:r=t.forceMount,...a}=o,s=S(g,o.__scopeHoverCard);return l.jsx(T,{present:r||s.open,children:l.jsx(X,{"data-state":s.open?"open":"closed",...a,onPointerEnter:f(o.onPointerEnter,P(s.onOpen)),onPointerLeave:f(o.onPointerLeave,P(s.onClose)),ref:e})})});A.displayName=g;var X=i.forwardRef((o,e)=>{const{__scopeHoverCard:t,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:d,...u}=o,c=S(g,t),p=b(t),v=i.useRef(null),C=W(e,v),[h,m]=i.useState(!1);return i.useEffect(()=>{if(h){const n=document.body;return w=n.style.userSelect||n.style.webkitUserSelect,n.style.userSelect="none",n.style.webkitUserSelect="none",()=>{n.style.userSelect=w,n.style.webkitUserSelect=w}}},[h]),i.useEffect(()=>{if(v.current){const n=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",n),()=>{document.removeEventListener("pointerup",n),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),i.useEffect(()=>{v.current&&ee(v.current).forEach(x=>x.setAttribute("tabindex","-1"))}),l.jsx(z,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:d,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:f(s,n=>{n.preventDefault()}),onDismiss:c.onDismiss,children:l.jsx(B,{...p,...u,onPointerDown:f(u.onPointerDown,n=>{n.currentTarget.contains(n.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:C,style:{...u.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=i.forwardRef((o,e)=>{const{__scopeHoverCard:t,...r}=o,a=b(t);return l.jsx(K,{...a,...r,ref:e})});Z.displayName=Y;function P(o){return e=>e.pointerType==="touch"?void 0:o()}function ee(o){const e=[],t=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();)e.push(t.currentNode);return e}var te=_,oe=D,re=j,ne=A;function se(o){const e=E.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=l.jsx(te,{"data-slot":"hover-card",...t}),e[2]=t,e[3]=r):r=e[3],r}function ce(o){const e=E.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=l.jsx(oe,{"data-slot":"hover-card-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function ie(o){const e=E.c(12);let t,r,a,s;e[0]!==o?({className:t,align:a,sideOffset:s,...r}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=a,e[4]=s):(t=e[1],r=e[2],a=e[3],s=e[4]);const d=a===void 0?"center":a,u=s===void 0?4:s;let c;e[5]!==t?(c=V("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),e[5]=t,e[6]=c):c=e[6];let p;return e[7]!==d||e[8]!==r||e[9]!==u||e[10]!==c?(p=l.jsx(re,{"data-slot":"hover-card-portal",children:l.jsx(ne,{"data-slot":"hover-card-content",align:d,sideOffset:u,className:c,...r})}),e[7]=d,e[8]=r,e[9]=u,e[10]=c,e[11]=p):p=e[11],p}export{ce as H,ie as a,se as b};
1
+ import{r as i,j as l,c7 as k,a4 as F,a5 as f,aV as T,c8 as $,aS as I,c6 as U,c9 as O,b4 as W,cf as z,cg as B,ab as G,ch as K,e as E,c as V}from"./index-C_etCvW6.js";var w,R="HoverCard",[N]=G(R,[O]),b=O(),[q,S]=N(R),_=o=>{const{__scopeHoverCard:e,children:t,open:r,defaultOpen:a,onOpenChange:s,openDelay:d=700,closeDelay:u=300}=o,c=b(e),p=i.useRef(0),v=i.useRef(0),C=i.useRef(!1),h=i.useRef(!1),[m,n]=I({prop:r,defaultProp:a??!1,onChange:s,caller:R}),x=i.useCallback(()=>{clearTimeout(v.current),p.current=window.setTimeout(()=>n(!0),d)},[d,n]),L=i.useCallback(()=>{clearTimeout(p.current),!C.current&&!h.current&&(v.current=window.setTimeout(()=>n(!1),u))},[u,n]),M=i.useCallback(()=>n(!1),[n]);return i.useEffect(()=>()=>{clearTimeout(p.current),clearTimeout(v.current)},[]),l.jsx(q,{scope:e,open:m,onOpenChange:n,onOpen:x,onClose:L,onDismiss:M,hasSelectionRef:C,isPointerDownOnContentRef:h,children:l.jsx(U,{...c,children:t})})};_.displayName=R;var y="HoverCardTrigger",D=i.forwardRef((o,e)=>{const{__scopeHoverCard:t,...r}=o,a=S(y,t),s=b(t);return l.jsx(k,{asChild:!0,...s,children:l.jsx(F.a,{"data-state":a.open?"open":"closed",...r,ref:e,onPointerEnter:f(o.onPointerEnter,P(a.onOpen)),onPointerLeave:f(o.onPointerLeave,P(a.onClose)),onFocus:f(o.onFocus,a.onOpen),onBlur:f(o.onBlur,a.onClose),onTouchStart:f(o.onTouchStart,d=>d.preventDefault())})})});D.displayName=y;var H="HoverCardPortal",[J,Q]=N(H,{forceMount:void 0}),j=o=>{const{__scopeHoverCard:e,forceMount:t,children:r,container:a}=o,s=S(H,e);return l.jsx(J,{scope:e,forceMount:t,children:l.jsx(T,{present:t||s.open,children:l.jsx($,{asChild:!0,container:a,children:r})})})};j.displayName=H;var g="HoverCardContent",A=i.forwardRef((o,e)=>{const t=Q(g,o.__scopeHoverCard),{forceMount:r=t.forceMount,...a}=o,s=S(g,o.__scopeHoverCard);return l.jsx(T,{present:r||s.open,children:l.jsx(X,{"data-state":s.open?"open":"closed",...a,onPointerEnter:f(o.onPointerEnter,P(s.onOpen)),onPointerLeave:f(o.onPointerLeave,P(s.onClose)),ref:e})})});A.displayName=g;var X=i.forwardRef((o,e)=>{const{__scopeHoverCard:t,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:d,...u}=o,c=S(g,t),p=b(t),v=i.useRef(null),C=W(e,v),[h,m]=i.useState(!1);return i.useEffect(()=>{if(h){const n=document.body;return w=n.style.userSelect||n.style.webkitUserSelect,n.style.userSelect="none",n.style.webkitUserSelect="none",()=>{n.style.userSelect=w,n.style.webkitUserSelect=w}}},[h]),i.useEffect(()=>{if(v.current){const n=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",n),()=>{document.removeEventListener("pointerup",n),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),i.useEffect(()=>{v.current&&ee(v.current).forEach(x=>x.setAttribute("tabindex","-1"))}),l.jsx(z,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:d,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:f(s,n=>{n.preventDefault()}),onDismiss:c.onDismiss,children:l.jsx(B,{...p,...u,onPointerDown:f(u.onPointerDown,n=>{n.currentTarget.contains(n.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:C,style:{...u.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Y="HoverCardArrow",Z=i.forwardRef((o,e)=>{const{__scopeHoverCard:t,...r}=o,a=b(t);return l.jsx(K,{...a,...r,ref:e})});Z.displayName=Y;function P(o){return e=>e.pointerType==="touch"?void 0:o()}function ee(o){const e=[],t=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();)e.push(t.currentNode);return e}var te=_,oe=D,re=j,ne=A;function se(o){const e=E.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=l.jsx(te,{"data-slot":"hover-card",...t}),e[2]=t,e[3]=r):r=e[3],r}function ce(o){const e=E.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=l.jsx(oe,{"data-slot":"hover-card-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function ie(o){const e=E.c(12);let t,r,a,s;e[0]!==o?({className:t,align:a,sideOffset:s,...r}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=a,e[4]=s):(t=e[1],r=e[2],a=e[3],s=e[4]);const d=a===void 0?"center":a,u=s===void 0?4:s;let c;e[5]!==t?(c=V("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),e[5]=t,e[6]=c):c=e[6];let p;return e[7]!==d||e[8]!==r||e[9]!==u||e[10]!==c?(p=l.jsx(re,{"data-slot":"hover-card-portal",children:l.jsx(ne,{"data-slot":"hover-card-content",align:d,sideOffset:u,className:c,...r})}),e[7]=d,e[8]=r,e[9]=u,e[10]=c,e[11]=p):p=e[11],p}export{ce as H,ie as a,se as b};
@@ -1,4 +1,4 @@
1
- import{r as R,d5 as wl,be as uu,j as J,az as du,ba as mt,d6 as fu,a4 as Zs,a5 as hu,aV as pu,aS as mu,aT as gu,b4 as yu,c$ as bu,ab as ku}from"./index-CM1D3IOd.js";function X(n){this.content=n}X.prototype={constructor:X,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new X(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new X(t)},addToStart:function(n,e){return new X([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new X(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new X(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=X.from(n),n.size?new X(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=X.from(n),n.size?new X(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=X.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};X.from=function(n){if(n instanceof X)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new X(e)};function Ml(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Ml(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function El(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=El(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Ml(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return El(this,e,t,r)}findIndex(e){if(e==0)return vn(0,e);if(e==this.size)return vn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?vn(t+1,i):vn(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Jr={index:0,offset:0};function vn(n,e){return Jr.index=n,Jr.offset=e,Jr}function Wn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Wn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Wn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let B=class Cs{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Wn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cs.none;if(e instanceof Cs)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};B.none=[];class qn extends Error{}class w{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=vl(this.content,e+this.openStart,t);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(e,t){return new w(Tl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return w.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new w(e,r,s)}}w.empty=new w(k.empty,0,0);function Tl(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Tl(i.content,e-s-1,t-s-1)))}function vl(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=vl(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function xu(n,e,t){if(t.openStart>n.depth)throw new qn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new qn("Inconsistent open depths");return Al(n,e,t,0)}function Al(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Al(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return dt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Su(t,n);return dt(i,Ol(n,o,l,e,r))}else return dt(i,Un(n,e,r))}function Nl(n,e){if(!e.type.compatibleContent(n.type))throw new qn("Cannot join "+e.type.name+" onto "+n.type.name)}function ws(n,e,t){let r=n.node(t);return Nl(r,e.node(t)),r}function ut(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function en(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(ut(n.nodeAfter,r),i++));for(let l=i;l<o;l++)ut(s.child(l),r);e&&e.depth==t&&e.textOffset&&ut(e.nodeBefore,r)}function dt(n,e){return n.type.checkContent(e),n.copy(e)}function Ol(n,e,t,r,s){let i=n.depth>s&&ws(n,e,s+1),o=r.depth>s&&ws(t,r,s+1),l=[];return en(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Nl(i,o),ut(dt(i,Ol(n,e,t,r,s+1)),l)):(i&&ut(dt(i,Un(n,e,s+1)),l),en(e,t,s,l),o&&ut(dt(o,Un(t,r,s+1)),l)),en(r,null,s,l),new k(l)}function Un(n,e,t){let r=[];if(en(null,n,t,r),n.depth>t){let s=ws(n,e,t+1);ut(dt(s,Un(n,e,t+1)),r)}return en(e,null,t,r),new k(r)}function Su(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class fn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return B.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Kn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new fn(t,r,i)}static resolveCached(e,t){let r=Wi.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Wi.set(e,r=new Cu);let s=r.elts[r.i]=fn.resolve(e,t);return r.i=(r.i+1)%wu,s}}class Cu{constructor(){this.elts=[],this.i=0}}const wu=12,Wi=new WeakMap;class Kn{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Mu=Object.create(null);class we{constructor(e,t,r,s=B.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Wn(this.attrs,t||e.defaultAttrs||Mu)&&B.sameSet(this.marks,r||B.none)}copy(e=null){return e==this.content?this:new we(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new we(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return w.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new w(c,s.depth-o,i.depth-o)}replace(e,t,r){return xu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return fn.resolveCached(this,e)}resolveNoCache(e){return fn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Dl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.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=B.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!B.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}we.prototype.text=void 0;class Jn extends we{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Dl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Jn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Jn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Dl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class gt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Eu(e,t);if(r.next==null)return gt.empty;let s=Il(r);r.next&&r.err("Unexpected trailing text");let i=Iu(Du(s));return Ru(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
1
+ import{r as R,d5 as wl,be as uu,j as J,az as du,ba as mt,d6 as fu,a4 as Zs,a5 as hu,aV as pu,aS as mu,aT as gu,b4 as yu,c$ as bu,ab as ku}from"./index-C_etCvW6.js";function X(n){this.content=n}X.prototype={constructor:X,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new X(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new X(t)},addToStart:function(n,e){return new X([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new X(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new X(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=X.from(n),n.size?new X(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=X.from(n),n.size?new X(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=X.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};X.from=function(n){if(n instanceof X)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new X(e)};function Ml(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Ml(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function El(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=El(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class k{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new k(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new k(r,s)}cutByIndex(e,t){return e==t?k.empty:e==0&&t==this.content.length?this:new k(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new k(s,i)}addToStart(e){return new k([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new k(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Ml(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return El(this,e,t,r)}findIndex(e){if(e==0)return vn(0,e);if(e==this.size)return vn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?vn(t+1,i):vn(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return k.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return k.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new k(t||e,r)}static from(e){if(!e)return k.empty;if(e instanceof k)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new k([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}k.empty=new k([],0);const Jr={index:0,offset:0};function vn(n,e){return Jr.index=n,Jr.offset=e,Jr}function Wn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Wn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Wn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let B=class Cs{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Wn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Cs.none;if(e instanceof Cs)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};B.none=[];class qn extends Error{}class w{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=vl(this.content,e+this.openStart,t);return r&&new w(r,this.openStart,this.openEnd)}removeBetween(e,t){return new w(Tl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return w.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(k.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new w(e,r,s)}}w.empty=new w(k.empty,0,0);function Tl(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Tl(i.content,e-s-1,t-s-1)))}function vl(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=vl(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function xu(n,e,t){if(t.openStart>n.depth)throw new qn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new qn("Inconsistent open depths");return Al(n,e,t,0)}function Al(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Al(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return dt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=Su(t,n);return dt(i,Ol(n,o,l,e,r))}else return dt(i,Un(n,e,r))}function Nl(n,e){if(!e.type.compatibleContent(n.type))throw new qn("Cannot join "+e.type.name+" onto "+n.type.name)}function ws(n,e,t){let r=n.node(t);return Nl(r,e.node(t)),r}function ut(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function en(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(ut(n.nodeAfter,r),i++));for(let l=i;l<o;l++)ut(s.child(l),r);e&&e.depth==t&&e.textOffset&&ut(e.nodeBefore,r)}function dt(n,e){return n.type.checkContent(e),n.copy(e)}function Ol(n,e,t,r,s){let i=n.depth>s&&ws(n,e,s+1),o=r.depth>s&&ws(t,r,s+1),l=[];return en(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(Nl(i,o),ut(dt(i,Ol(n,e,t,r,s+1)),l)):(i&&ut(dt(i,Un(n,e,s+1)),l),en(e,t,s,l),o&&ut(dt(o,Un(t,r,s+1)),l)),en(r,null,s,l),new k(l)}function Un(n,e,t){let r=[];if(en(null,n,t,r),n.depth>t){let s=ws(n,e,t+1);ut(dt(s,Un(n,e,t+1)),r)}return en(e,null,t,r),new k(r)}function Su(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(k.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class fn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return B.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Kn(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new fn(t,r,i)}static resolveCached(e,t){let r=Wi.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Wi.set(e,r=new Cu);let s=r.elts[r.i]=fn.resolve(e,t);return r.i=(r.i+1)%wu,s}}class Cu{constructor(){this.elts=[],this.i=0}}const wu=12,Wi=new WeakMap;class Kn{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Mu=Object.create(null);class we{constructor(e,t,r,s=B.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||k.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Wn(this.attrs,t||e.defaultAttrs||Mu)&&B.sameSet(this.marks,r||B.none)}copy(e=null){return e==this.content?this:new we(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new we(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return w.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new w(c,s.depth-o,i.depth-o)}replace(e,t,r){return xu(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return fn.resolveCached(this,e)}resolveNoCache(e){return fn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Dl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=k.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.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=B.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!B.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=k.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}we.prototype.text=void 0;class Jn extends we{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Dl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Jn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Jn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Dl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class gt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Eu(e,t);if(r.next==null)return gt.empty;let s=Il(r);r.next&&r.err("Unexpected trailing text");let i=Iu(Du(s));return Ru(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return k.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
2
2
  `)}}gt.empty=new gt(!0);class Eu{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Il(n){let e=[];do e.push(Tu(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Tu(n){let e=[];do e.push(vu(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function vu(n){let e=Ou(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Au(n,e);else break;return e}function qi(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Au(n,e){let t=qi(n),r=t;return n.eat(",")&&(n.next!="}"?r=qi(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Nu(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function Ou(n){if(n.eat("(")){let e=Il(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Nu(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Du(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Rl(n,e){return e-n}function Ui(n,e){let t=[];return r(e),t.sort(Rl);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function Iu(n){let e=Object.create(null);return t(Ui(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Ui(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new gt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(Rl);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function Ru(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Pl(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Ll(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function Bl(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function zl(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Lu(n,r,e[r]);return t}let Ki=class $l{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=zl(e,r.attrs),this.defaultAttrs=Pl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==gt.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:Ll(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new we(this,this.computeAttrs(e),k.from(t),B.setFrom(r))}createChecked(e=null,t,r){return t=k.from(t),this.checkContent(t),new we(this,this.computeAttrs(e),t,B.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=k.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(k.empty,!0);return i?new we(this,e,t.append(i),B.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Bl(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:B.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new $l(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Pu(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class Lu{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Pu(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ir{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=zl(e,s.attrs),this.excluded=null;let i=Pl(this.attrs);this.instance=i?new B(this,i):null}create(e=null){return!e&&this.instance?this.instance:new B(this,Ll(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new Ir(i,s++,t,o)),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){Bl(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Fl{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=X.from(e.nodes),t.marks=X.from(e.marks||{}),this.nodes=Ki.compile(this.spec.nodes,this),this.marks=Ir.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=gt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Ji(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Ji(this,o.split(" "))}this.nodeFromJSON=s=>we.fromJSON(this,s),this.markFromJSON=s=>B.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ki){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new Jn(r,r.defaultAttrs,e,B.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ji(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Bu(n){return n.tag!=null}function zu(n){return n.style!=null}class Ge{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(Bu(s))this.tags.push(s);else if(zu(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Yi(this,t,!1);return r.addAll(e,B.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Yi(this,t,!0);return r.addAll(e,B.none,t.from,t.to),w.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Vu(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Xi(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Xi(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ge(e,Ge.schemaRules(e)))}}const Vl={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},$u={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_l={ol:!0,ul:!0},hn=1,Ms=2,tn=4;function Gi(n,e,t){return e!=null?(e?hn:0)|(e==="full"?Ms:0):n&&n.whitespace=="pre"?hn|Ms:t&~tn}class An{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=B.none,this.match=i||(o&tn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(k.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&hn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=k.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(k.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&&!Vl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Yi{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=Gi(null,t.preserveWhitespace,0)|(r?tn:0);s?i=new An(s.type,s.attrs,B.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new An(null,null,B.none,!0,null,o):i=new An(e.schema.topNodeType,null,B.none,!0,null,o),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 r=e.nodeValue,s=this.top,i=s.options&Ms?"full":this.localPreserveWS||(s.options&hn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
3
3
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;_l.hasOwnProperty(o)&&this.parser.normalizeLists&&Fu(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:$u.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Vl.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=B.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Qi(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Gi(e,i,o.options);o.options&tn&&o.content.length==0&&(l|=tn);let a=B.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):Qi(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new An(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=hn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Fu(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&_l.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Vu(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Xi(n){let e={};for(let t in n)e[t]=n[t];return e}function Qi(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class St{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Gr(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=Fn(Gr(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Fn(Gr(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return Fn(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new St(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Zi(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Zi(e.marks)}}function Zi(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Gr(n){return n.document||window.document}const eo=new WeakMap;function _u(n){let e=eo.get(n);return e===void 0&&eo.set(n,e=Hu(n)),e}function Hu(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function Fn(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=_u(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Fn(n,f,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Hl=65535,jl=Math.pow(2,16);function ju(n,e){return n+e*jl}function to(n){return n&Hl}function Wu(n){return(n-(n&Hl))/jl}const Wl=1,ql=2,Vn=4,Ul=8;class Es{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ul)>0}get deletedBefore(){return(this.delInfo&(Wl|Vn))>0}get deletedAfter(){return(this.delInfo&(ql|Vn))>0}get deletedAcross(){return(this.delInfo&Vn)>0}}class de{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&de.empty)return de.empty}recover(e){let t=0,r=to(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+Wu(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,h=a+s+(f<0?0:u);if(r)return h;let p=e==(t<0?a:d)?null:ju(l/3,e-a),m=e==a?ql:e==d?Wl:Vn;return(t<0?e!=a:e!=d)&&(m|=Ul),new Es(h,m,p)}s+=u-c}return r?e+s:new Es(e+s,0,null)}touches(e,t){let r=0,s=to(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new de(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?de.empty:new de(e<0?[0,-e,0]:[0,0,e])}}de.empty=new de([]);class pn{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new pn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new pn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new Es(e,s,null)}}const Yr=Object.create(null);class re{getMap(){return de.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Yr[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Yr)throw new RangeError("Duplicate use of step JSON ID "+e);return Yr[e]=t,t.prototype.jsonID=e,t}}class W{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new W(e,null)}static fail(e){return new W(null,e)}static fromReplace(e,t,r,s){try{return W.ok(e.replace(t,r,s))}catch(i){if(i instanceof qn)return W.fail(i.message);throw i}}}function ei(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(ei(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return k.fromArray(r)}class Ue extends re{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new w(ei(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return W.fromReplace(e,this.from,this.to,i)}invert(){return new Ce(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ue(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ue&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ue(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ue(t.from,t.to,e.markFromJSON(t.mark))}}re.jsonID("addMark",Ue);class Ce extends re{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new w(ei(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return W.fromReplace(e,this.from,this.to,r)}invert(){return new Ue(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ce(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ce&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ce(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ce(t.from,t.to,e.markFromJSON(t.mark))}}re.jsonID("removeMark",Ce);class Ke extends re{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return W.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return W.fromReplace(e,this.pos,this.pos+1,new w(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new Ke(this.pos,t.marks[s]);return new Ke(this.pos,this.mark)}}return new yt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ke(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ke(t.pos,e.markFromJSON(t.mark))}}re.jsonID("addNodeMark",Ke);class yt extends re{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return W.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return W.fromReplace(e,this.pos,this.pos+1,new w(k.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ke(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new yt(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new yt(t.pos,e.markFromJSON(t.mark))}}re.jsonID("removeNodeMark",yt);class j extends re{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&Ts(e,this.from,this.to)?W.fail("Structure replace would overwrite content"):W.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new de([this.from,this.to-this.from,this.slice.size])}invert(e){return new j(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&j.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new j(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof j)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?w.empty:new w(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new j(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?w.empty:new w(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new j(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new j(t.from,t.to,w.fromJSON(e,t.slice),!!t.structure)}}j.MAP_BIAS=1;re.jsonID("replace",j);class G extends re{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Ts(e,this.from,this.gapFrom)||Ts(e,this.gapTo,this.to)))return W.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return W.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?W.fromReplace(e,this.from,this.to,r):W.fail("Content does not fit in gap")}getMap(){return new de([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new G(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new G(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new G(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}}re.jsonID("replaceAround",G);function Ts(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function qu(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[m])?o.to=h:s.push(o=new Ce(f,h,d[m])));l&&l.to==f?l.to=h:i.push(l=new Ue(f,h,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function Uu(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof Ir){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],f;for(let h=0;h<s.length;h++){let p=s[h];p.step==i-1&&d.eq(s[h].style)&&(f=p)}f?(f.to=c,f.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new Ce(o.from,o.to,o.style)))}function ti(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new j(l,u,w.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Ce(l,u,c.marks[f]));if(s&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new w(k.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new j(l+f.index,l+f.index+f[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(k.empty,!0);n.replace(l,l,new w(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function Ku(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function jt(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!Ku(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Ju(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=k.empty,d=0;for(let p=i,m=!1;p>t;p--)m||r.index(p)>0?(m=!0,u=k.from(r.node(p).copy(u)),d++):a--;let f=k.empty,h=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)<s.end(p)?(m=!0,f=k.from(s.node(p).copy(f)),h++):c++;n.step(new G(a,c,o,l,new w(u.append(f),d,h),u.size-d,!0))}function ni(n,e,t=null,r=n){let s=Gu(n,e),i=s&&Yu(r,e);return i?s.map(no).concat({type:e,attrs:t}).concat(i.map(no)):null}function no(n){return{type:n,attrs:null}}function Gu(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Yu(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Xu(n,e,t){let r=k.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=k.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new G(s,i,s,i,new w(r,0,0),t.length,!0))}function Qu(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&Zu(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Jl(n,o,l,i),ti(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),f=u.map(l+o.nodeSize,1);return n.step(new G(d,f,d+1,f-1,new w(k.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&Kl(n,o,l,i),!1}})}function Kl(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Jl(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{b9 as _}from"./index-CM1D3IOd.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
1
+ import{b9 as _}from"./index-C_etCvW6.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};